modern-text 1.7.3 → 1.7.4

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(H,te){typeof exports=="object"&&typeof module<"u"?te(exports):typeof define=="function"&&define.amd?define(["exports"],te):(H=typeof globalThis<"u"?globalThis:H||self,te(H.modernText={}))})(this,function(H){"use strict";function te(n,t,e){if(typeof t=="string"&&t.startsWith("linear-gradient")){const{x0:r,y0:i,x1:s,y1:o,stops:a}=ts(t,e.left,e.top,e.width,e.height),l=n.createLinearGradient(r,i,s,o);return a.forEach(c=>l.addColorStop(c.offset,c.color)),l}return t}function Te(n,t,e){n?.color&&(n.color=te(e,n.color,t)),n?.backgroundColor&&(n.backgroundColor=te(e,n.backgroundColor,t)),n?.textStrokeColor&&(n.textStrokeColor=te(e,n.textStrokeColor,t))}function ts(n,t,e,r,i){const s=n.match(/linear-gradient\((.+)\)$/)?.[1]??"",o=s.split(",")[0],a=o.includes("deg")?o:"0deg",l=s.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),u=(Number(a.replace("deg",""))||0)*Math.PI/180,h=r*Math.sin(u),p=i*Math.cos(u);return{x0:t+r/2-h,y0:e+i/2+p,x1:t+r/2+h,y1:e+i/2-p,stops:Array.from(l).map(d=>{let f=d[2];return f.startsWith("(")?f=f.split(",").length>3?`rgba${f}`:`rgb${f}`:f=`#${f}`,{offset:Number(d[3].replace("%",""))/100,color:f}})}}function he(n){const{ctx:t,path:e,fontSize:r,clipRect:i}=n;t.save(),t.beginPath();const s=e.style,o={...s,fill:n.color??s.fill,stroke:n.textStrokeColor??s.stroke,strokeWidth:n.textStrokeWidth?n.textStrokeWidth*r:s.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(n.shadowOffsetX??0)*r,shadowOffsetY:(n.shadowOffsetY??0)*r,shadowBlur:(n.shadowBlur??0)*r,shadowColor:n.shadowColor};i&&(t.rect(i.left,i.top,i.width,i.height),t.clip(),t.beginPath()),e.drawTo(t,o),t.restore()}function dr(n,t,e){const{left:r,top:i,width:s,height:o}=e,a=n.canvas;a.dataset.viewBox=`${r} ${i} ${s} ${o}`,a.dataset.pixelRatio=String(t);const l=s,c=o;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,n.clearRect(0,0,a.width,a.height),n.scale(t,t),n.translate(-r,-i)}function gr(n,t){const{paragraphs:e,computedStyle:r,glyphBox:i}=t;Te(r,i,n),e.forEach(s=>{Te(s.computedStyle,s.lineBox,n),s.fragments.forEach(o=>{Te(o.computedStyle,o.inlineBox,n)})})}var ut=Uint8Array,At=Uint16Array,Pn=Int32Array,Xe=new ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ze=new ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Tn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yr=function(n,t){for(var e=new At(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new Pn(e[30]),r=1;r<30;++r)for(var s=e[r];s<e[r+1];++s)i[s]=s-e[r]<<5|r;return{b:e,r:i}},mr=yr(Xe,2),xr=mr.b,_n=mr.r;xr[28]=258,_n[258]=28;for(var vr=yr(Ze,0),es=vr.b,wr=vr.r,kn=new At(32768),K=0;K<32768;++K){var ee=(K&43690)>>1|(K&21845)<<1;ee=(ee&52428)>>2|(ee&13107)<<2,ee=(ee&61680)>>4|(ee&3855)<<4,kn[K]=((ee&65280)>>8|(ee&255)<<8)>>1}for(var Rt=function(n,t,e){for(var r=n.length,i=0,s=new At(t);i<r;++i)n[i]&&++s[n[i]-1];var o=new At(t);for(i=1;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new At(1<<t);var l=15-t;for(i=0;i<r;++i)if(n[i])for(var c=i<<4|n[i],u=t-n[i],h=o[n[i]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)a[kn[h]>>l]=c}else for(a=new At(r),i=0;i<r;++i)n[i]&&(a[i]=kn[o[n[i]-1]++]>>15-n[i]);return a},ne=new ut(288),K=0;K<144;++K)ne[K]=8;for(var K=144;K<256;++K)ne[K]=9;for(var K=256;K<280;++K)ne[K]=7;for(var K=280;K<288;++K)ne[K]=8;for(var _e=new ut(32),K=0;K<32;++K)_e[K]=5;var ns=Rt(ne,9,0),rs=Rt(ne,9,1),is=Rt(_e,5,0),ss=Rt(_e,5,1),An=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},Ft=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},In=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},On=function(n){return(n+7)/8|0},br=function(n,t,e){return(e==null||e>n.length)&&(e=n.length),new ut(n.subarray(t,e))},os=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ut=function(n,t,e){var r=new Error(t||os[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Ut),!e)throw r;return r},as=function(n,t,e,r){var i=n.length,s=0;if(!i||t.f&&!t.l)return e||new ut(0);var o=!e,a=o||t.i!=2,l=t.i;o&&(e=new ut(i*3));var c=function(Mt){var _t=e.length;if(Mt>_t){var ht=new ut(Math.max(_t*2,Mt));ht.set(e),e=ht}},u=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,g=t.n,M=i*8;do{if(!d){u=Ft(n,h,1);var P=Ft(n,h+1,3);if(h+=3,P)if(P==1)d=rs,f=ss,m=9,g=5;else if(P==2){var x=Ft(n,h,31)+257,S=Ft(n,h+10,15)+4,b=x+Ft(n,h+5,31)+1;h+=14;for(var D=new ut(b),N=new ut(19),E=0;E<S;++E)N[Tn[E]]=Ft(n,h+E*3,7);h+=S*3;for(var L=An(N),z=(1<<L)-1,B=Rt(N,L,1),E=0;E<b;){var A=B[Ft(n,h,z)];h+=A&15;var w=A>>4;if(w<16)D[E++]=w;else{var W=0,I=0;for(w==16?(I=3+Ft(n,h,3),h+=2,W=D[E-1]):w==17?(I=3+Ft(n,h,7),h+=3):w==18&&(I=11+Ft(n,h,127),h+=7);I--;)D[E++]=W}}var U=D.subarray(0,x),j=D.subarray(x);m=An(U),g=An(j),d=Rt(U,m,1),f=Rt(j,g,1)}else Ut(1);else{var w=On(h)+4,C=n[w-4]|n[w-3]<<8,v=w+C;if(v>i){l&&Ut(0);break}a&&c(p+C),e.set(n.subarray(w,v),p),t.b=p+=C,t.p=h=v*8,t.f=u;continue}if(h>M){l&&Ut(0);break}}a&&c(p+131072);for(var O=(1<<m)-1,V=(1<<g)-1,_=h;;_=h){var W=d[In(n,h)&O],T=W>>4;if(h+=W&15,h>M){l&&Ut(0);break}if(W||Ut(2),T<256)e[p++]=T;else if(T==256){_=h,d=null;break}else{var F=T-254;if(T>264){var E=T-257,$=Xe[E];F=Ft(n,h,(1<<$)-1)+xr[E],h+=$}var q=f[In(n,h)&V],Z=q>>4;q||Ut(3),h+=q&15;var j=es[Z];if(Z>3){var $=Ze[Z];j+=In(n,h)&(1<<$)-1,h+=$}if(h>M){l&&Ut(0);break}a&&c(p+131072);var nt=p+F;if(p<j){var Zt=s-j,Dt=Math.min(j,nt);for(Zt+p<0&&Ut(3);p<Dt;++p)e[p]=r[Zt+p]}for(;p<nt;++p)e[p]=e[p-j]}}t.l=d,t.p=_,t.b=p,t.f=u,d&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=e.length&&o?br(e,0,p):e.subarray(0,p)},Yt=function(n,t,e){e<<=t&7;var r=t/8|0;n[r]|=e,n[r+1]|=e>>8},ke=function(n,t,e){e<<=t&7;var r=t/8|0;n[r]|=e,n[r+1]|=e>>8,n[r+2]|=e>>16},En=function(n,t){for(var e=[],r=0;r<n.length;++r)n[r]&&e.push({s:r,f:n[r]});var i=e.length,s=e.slice();if(!i)return{t:Pr,l:0};if(i==1){var o=new ut(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(v,x){return v.f-x.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,u=1,h=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=e[e[c].f<e[h].f?c++:h++],l=e[c!=u&&e[c].f<e[h].f?c++:h++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var d=new At(p+1),f=Bn(e[u-1],d,0);if(f>t){var r=0,m=0,g=f-t,M=1<<g;for(s.sort(function(x,S){return d[S.s]-d[x.s]||x.f-S.f});r<i;++r){var P=s[r].s;if(d[P]>t)m+=M-(1<<f-d[P]),d[P]=t;else break}for(m>>=g;m>0;){var w=s[r].s;d[w]<t?m-=1<<t-d[w]++-1:++r}for(;r>=0&&m;--r){var C=s[r].s;d[C]==t&&(--d[C],++m)}f=t}return{t:new ut(d),l:f}},Bn=function(n,t,e){return n.s==-1?Math.max(Bn(n.l,t,e+1),Bn(n.r,t,e+1)):t[n.s]=e},Sr=function(n){for(var t=n.length;t&&!n[--t];);for(var e=new At(++t),r=0,i=n[0],s=1,o=function(l){e[r++]=l},a=1;a<=t;++a)if(n[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=n[a]}return{c:e.subarray(0,r),n:t}},Ae=function(n,t){for(var e=0,r=0;r<t.length;++r)e+=n[r]*t[r];return e},Cr=function(n,t,e){var r=e.length,i=On(t+2);n[i]=r&255,n[i+1]=r>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var s=0;s<r;++s)n[i+s+4]=e[s];return(i+4+r)*8},Mr=function(n,t,e,r,i,s,o,a,l,c,u){Yt(t,u++,e),++i[256];for(var h=En(i,15),p=h.t,d=h.l,f=En(s,15),m=f.t,g=f.l,M=Sr(p),P=M.c,w=M.n,C=Sr(m),v=C.c,x=C.n,S=new At(19),b=0;b<P.length;++b)++S[P[b]&31];for(var b=0;b<v.length;++b)++S[v[b]&31];for(var D=En(S,7),N=D.t,E=D.l,L=19;L>4&&!N[Tn[L-1]];--L);var z=c+5<<3,B=Ae(i,ne)+Ae(s,_e)+o,A=Ae(i,p)+Ae(s,m)+o+14+3*L+Ae(S,N)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&z<=B&&z<=A)return Cr(t,u,n.subarray(l,l+c));var W,I,U,j;if(Yt(t,u,1+(A<B)),u+=2,A<B){W=Rt(p,d,0),I=p,U=Rt(m,g,0),j=m;var O=Rt(N,E,0);Yt(t,u,w-257),Yt(t,u+5,x-1),Yt(t,u+10,L-4),u+=14;for(var b=0;b<L;++b)Yt(t,u+3*b,N[Tn[b]]);u+=3*L;for(var V=[P,v],_=0;_<2;++_)for(var T=V[_],b=0;b<T.length;++b){var F=T[b]&31;Yt(t,u,O[F]),u+=N[F],F>15&&(Yt(t,u,T[b]>>5&127),u+=T[b]>>12)}}else W=ns,I=ne,U=is,j=_e;for(var b=0;b<a;++b){var $=r[b];if($>255){var F=$>>18&31;ke(t,u,W[F+257]),u+=I[F+257],F>7&&(Yt(t,u,$>>23&31),u+=Xe[F]);var q=$&31;ke(t,u,U[q]),u+=j[q],q>3&&(ke(t,u,$>>5&8191),u+=Ze[q])}else ke(t,u,W[$]),u+=I[$]}return ke(t,u,W[256]),u+I[256]},ls=new Pn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pr=new ut(0),cs=function(n,t,e,r,i,s){var o=s.z||n.length,a=new ut(r+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(r,a.length-i),c=s.l,u=(s.r||0)&7;if(t){u&&(l[0]=s.r>>3);for(var h=ls[t-1],p=h>>13,d=h&8191,f=(1<<e)-1,m=s.p||new At(32768),g=s.h||new At(f+1),M=Math.ceil(e/3),P=2*M,w=function(kt){return(n[kt]^n[kt+1]<<M^n[kt+2]<<P)&f},C=new Pn(25e3),v=new At(288),x=new At(32),S=0,b=0,D=s.i||0,N=0,E=s.w||0,L=0;D+2<o;++D){var z=w(D),B=D&32767,A=g[z];if(m[B]=A,g[z]=B,E<=D){var W=o-D;if((S>7e3||N>24576)&&(W>423||!c)){u=Mr(n,l,0,C,v,x,b,N,L,D-L,u),N=S=b=0,L=D;for(var I=0;I<286;++I)v[I]=0;for(var I=0;I<30;++I)x[I]=0}var U=2,j=0,O=d,V=B-A&32767;if(W>2&&z==w(D-V))for(var _=Math.min(p,W)-1,T=Math.min(32767,D),F=Math.min(258,W);V<=T&&--O&&B!=A;){if(n[D+U]==n[D+U-V]){for(var $=0;$<F&&n[D+$]==n[D+$-V];++$);if($>U){if(U=$,j=V,$>_)break;for(var q=Math.min(V,$-2),Z=0,I=0;I<q;++I){var nt=D-V+I&32767,Zt=m[nt],Dt=nt-Zt&32767;Dt>Z&&(Z=Dt,A=nt)}}}B=A,A=m[B],V+=B-A&32767}if(j){C[N++]=268435456|_n[U]<<18|wr[j];var Mt=_n[U]&31,_t=wr[j]&31;b+=Xe[Mt]+Ze[_t],++v[257+Mt],++x[_t],E=D+U,++S}else C[N++]=n[D],++v[n[D]]}}for(D=Math.max(D,E);D<o;++D)C[N++]=n[D],++v[n[D]];u=Mr(n,l,c,C,v,x,b,N,L,D-L,u),c||(s.r=u&7|l[u/8|0]<<3,u-=7,s.h=g,s.p=m,s.i=D,s.w=E)}else{for(var D=s.w||0;D<o+c;D+=65535){var ht=D+65535;ht>=o&&(l[u/8|0]=c,ht=o),u=Cr(l,u+1,n.subarray(D,ht))}s.i=o}return br(a,0,r+On(u)+i)},Tr=function(){var n=1,t=0;return{p:function(e){for(var r=n,i=t,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=r+=e[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}n=r,t=i},d:function(){return n%=65521,t%=65521,(n&255)<<24|(n&65280)<<8|(t&255)<<8|t>>8}}},hs=function(n,t,e,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new ut(s.length+n.length);o.set(s),o.set(n,s.length),n=o,i.w=s.length}return cs(n,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+t.mem,e,r,i)},_r=function(n,t,e){for(;e;++t)n[t]=e,e>>>=8},us=function(n,t){var e=t.level,r=e==0?0:e<6?1:e==9?3:2;if(n[0]=120,n[1]=r<<6|(t.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,t.dictionary){var i=Tr();i.p(t.dictionary),_r(n,2,i.d())}},fs=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&Ut(6,"invalid zlib data"),(n[1]>>5&1)==1&&Ut(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function ps(n,t){t||(t={});var e=Tr();e.p(n);var r=hs(n,t,t.dictionary?6:2,4);return us(r,t),_r(r,r.length-4,e.d()),r}function ds(n,t){return as(n.subarray(fs(n),-4),{i:2},t,t)}var gs=typeof TextDecoder<"u"&&new TextDecoder,ys=0;try{gs.decode(Pr,{stream:!0}),ys=1}catch{}const ms="modern-font";function Ie(n,t){if(!n)throw new Error(`[${ms}] ${t}`)}function xs(n){if("buffer"in n){const t=n.buffer;return n.byteOffset>0||n.byteLength<n.buffer.byteLength?t.slice(n.byteOffset,n.byteOffset+n.byteLength):t}else return n}function ye(n){return"buffer"in n?new DataView(n.buffer,n.byteOffset,n.byteLength):new DataView(n)}function vs(n){let t="";for(let e=0,r=n.length,i;e<r;e++)i=n.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function Ye(n){n=vs(n);const t=[];for(let e=0,r=n.length,i;e<r;e++)i=n.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function ws(n){let t="";for(let e=0,r=n.length;e<r;e++)n[e]<127?t+=String.fromCharCode(n[e]):t+=`%${(256+n[e]).toString(16).slice(1)}`;return unescape(t)}function bs(n){let t="";for(let e=0,r=n.length;e<r;e+=2)t+=String.fromCharCode((n[e]<<8)+n[e+1]);return t}var Ss=Object.defineProperty,ft=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Ss(t,e,i),i};const Ke={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(n,t){Object.defineProperty(n.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,r,i){super(xs(t),e,r),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(r,i)=>this.read(t.type,t.offset+i));switch(t.type){case"char":return e.join("");default:return e}}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(r,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,r=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,r);case"longDateTime":return this.readLongDateTime(e,r)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,s=this,a=s[i]?.bind(s)?.(e,r);return this.cursor+=Ke[t],a}readUint24(t=this.cursor){const[e,r,i]=this.readBytes(t,3);return(e<<16)+(r<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const r=[];for(let i=0;i<e;++i)r.push(this.getUint8(t+i));return this.cursor=t+e,r}readString(t,e){const r=this.readBytes(t,e);let i="";for(let s=0,o=r.length;s<o;s++)i+=String.fromCharCode(r[s]);return i}readFixed(t,e){const r=this.readInt32(t,e)/65536;return Math.ceil(r*1e5)/1e5}readLongDateTime(t=this.cursor,e){const r=this.readUint32(t+4,e),i=new Date;return i.setTime(r*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,r=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,r);case"fixed":return this.writeFixed(e,r);case"longDateTime":return this.writeLongDateTime(e,r)}const s=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,o=this,l=o[s]?.bind(o)?.(r,e,i);return this.cursor+=Ke[t.toLowerCase()],l}writeString(t="",e=this.cursor){const r=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,s=t.length,o;i<s;++i)o=t.charCodeAt(i)||0,o>127?this.writeUint16(o):this.writeUint8(o);return this.cursor+=r,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let r;if(Array.isArray(t)){r=t.length;for(let i=0;i<r;++i)this.setUint8(e+i,t[i])}else{const i=ye(t);r=i.byteLength;for(let s=0;s<r;++s)this.setUint8(e+s,i.getUint8(s))}return this.cursor=e+r,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const kr=new WeakMap;function y(n){const t=typeof n=="object"?n:{type:n},{size:e=1,type:r}=t;return(i,s)=>{if(typeof s!="string")return;let o=kr.get(i);o||(o={columns:[],byteLength:0},kr.set(i,o));const a={...t,name:s,byteLength:e*Ke[r],offset:t.offset??o.columns.reduce((l,c)=>l+c.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,c)=>l+Ke[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Ot{view;constructor(t,e,r,i){this.view=new lt(t,e,r,i)}}class Dn extends Ot{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Cs=Object.defineProperty,vt=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Cs(t,e,i),i};const wt=class Yi extends Dn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,s=Ye(i.fontFamily||""),o=s.length,a=Ye(i.fontStyle||""),l=a.length,c=Ye(i.version||""),u=c.length,h=Ye(i.fullName||""),p=h.length,d=86+o+4+l+4+u+4+p+2+t.view.byteLength,f=new Yi(new ArrayBuffer(d),0,d,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const m=e.os2;return m&&(f.FontPANOSE=m.fontPANOSE,f.Italic=m.fsSelection,f.Weight=m.usWeightClass,f.fsType=m.fsType,f.UnicodeRange=m.ulUnicodeRange,f.CodePageRange=m.ulCodePageRange),f.view.writeUint16(o),f.view.writeBytes(s),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(u),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(h),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};vt([y("uint32")],wt.prototype,"EOTSize"),vt([y("uint32")],wt.prototype,"FontDataSize"),vt([y("uint32")],wt.prototype,"Version"),vt([y("uint32")],wt.prototype,"Flags"),vt([y({type:"uint8",size:10})],wt.prototype,"FontPANOSE"),vt([y("uint8")],wt.prototype,"Charset"),vt([y("uint8")],wt.prototype,"Italic"),vt([y("uint32")],wt.prototype,"Weight"),vt([y("uint16")],wt.prototype,"fsType"),vt([y("uint16")],wt.prototype,"MagicNumber"),vt([y({type:"uint8",size:16})],wt.prototype,"UnicodeRange"),vt([y({type:"uint8",size:8})],wt.prototype,"CodePageRange"),vt([y("uint32")],wt.prototype,"CheckSumAdjustment"),vt([y({type:"uint8",size:16})],wt.prototype,"Reserved"),vt([y("uint16")],wt.prototype,"Padding1");var Ms=Object.defineProperty,Qe=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Ms(t,e,i),i};class Oe extends Ot{constructor(t,e){super(t,e,16)}}Qe([y({type:"char",size:4})],Oe.prototype,"tag"),Qe([y("uint32")],Oe.prototype,"checkSum"),Qe([y("uint32")],Oe.prototype,"offset"),Qe([y("uint32")],Oe.prototype,"length");const Ln=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Ps=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Ar{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,r=72,i={},s){const o=1/(s?.unitsPerEm??1e3)*r,{xScale:a=o,yScale:l=o}=i,c=this.pathCommands,u=[];for(let h=0,p=c.length;h<p;h+=1){const d=c[h];d.type==="M"?u.push({type:"M",x:t+d.x*a,y:e+-d.y*l}):d.type==="L"?u.push({type:"L",x:t+d.x*a,y:e+-d.y*l}):d.type==="Q"?u.push({type:"Q",x1:t+d.x1*a,y1:e+-d.y1*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="C"?u.push({type:"C",x1:t+d.x1*a,y1:e+-d.y1*l,x2:t+d.x2*a,y2:e+-d.y2*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="Z"&&u.push({type:"Z"})}return u}}class Ts extends Ar{parse(t,e,r){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,u=this.index;let h,p,d,f;const m=[],g=[];let M=0,P=!1,w=!1,C=o,v=0,x=0;function S(B,A){m.push({type:"L",x:B,y:A})}function b(B,A,W,I,U,j){m.push({type:"C",x1:B,y1:A,x2:W,y2:I,x:U,y:j})}function D(B,A){w&&c!==2&&N(),w=!0,m.push({type:"M",x:B,y:A})}function N(){m.push({type:"Z"})}function E(B){m.push(...B)}function L(){g.length%2!==0&&!P&&(C=g.shift()+s),M+=g.length>>1,g.length=0,P=!0}function z(B){let A,W,I,U,j,O,V,_,T,F,$,q,Z=0;for(;Z<B.length;){let nt=B[Z++];switch(nt){case 1:L();break;case 3:L();break;case 4:g.length>1&&!P&&(C=g.shift()+s,P=!0),x+=g.pop(),D(v,x);break;case 5:for(;g.length>0;)v+=g.shift(),x+=g.shift(),S(v,x);break;case 6:for(;g.length>0&&(v+=g.shift(),S(v,x),g.length!==0);)x+=g.shift(),S(v,x);break;case 7:for(;g.length>0&&(x+=g.shift(),S(v,x),g.length!==0);)v+=g.shift(),S(v,x);break;case 8:for(;g.length>0;)h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);break;case 10:j=g.pop()+l,O=t.subrs[j],O&&z(O);break;case 11:return;case 12:switch(nt=B[Z],Z+=1,nt){case 35:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f+g.shift(),T=V+g.shift(),F=_+g.shift(),$=T+g.shift(),q=F+g.shift(),v=$+g.shift(),x=q+g.shift(),g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 34:h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f,T=V+g.shift(),F=f,$=T+g.shift(),q=x,v=$+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 36:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f,T=V+g.shift(),F=f,$=T+g.shift(),q=F+g.shift(),v=$+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 37:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f+g.shift(),T=V+g.shift(),F=_+g.shift(),$=T+g.shift(),q=F+g.shift(),Math.abs($-v)>Math.abs(q-x)?v=$+g.shift():x=q+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;default:console.warn(`Glyph ${u}: unknown operator ${1200+nt}`),g.length=0}break;case 14:if(g.length>=4){const Zt=Ln[g.pop()],Dt=Ln[g.pop()],Mt=g.pop(),_t=g.pop();if(Zt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Zt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:_t,dy:Mt}),E(r.get(kt).pathCommands);const Vt=JSON.parse(JSON.stringify(r.get(ht).pathCommands));for(let jt=0;jt<Vt.length;jt+=1){const Lt=Vt[jt];Lt.type!=="Z"&&(Lt.x+=_t,Lt.y+=Mt),(Lt.type==="Q"||Lt.type==="C")&&(Lt.x1+=_t,Lt.y1+=Mt),Lt.type==="C"&&(Lt.x2+=_t,Lt.y2+=Mt)}E(Vt)}}else g.length>0&&!P&&(C=g.shift()+s,P=!0);w&&c!==2&&(N(),w=!1);break;case 18:L();break;case 19:case 20:L(),Z+=M+7>>3;break;case 21:g.length>2&&!P&&(C=g.shift()+s,P=!0),x+=g.pop(),v+=g.pop(),D(v,x);break;case 22:g.length>1&&!P&&(C=g.shift()+s,P=!0),v+=g.pop(),D(v,x);break;case 23:L();break;case 24:for(;g.length>2;)h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);v+=g.shift(),x+=g.shift(),S(v,x);break;case 25:for(;g.length>6;)v+=g.shift(),x+=g.shift(),S(v,x);h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);break;case 26:for(g.length%2&&(v+=g.shift());g.length>0;)h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d,x=f+g.shift(),b(h,p,d,f,v,x);break;case 27:for(g.length%2&&(x+=g.shift());g.length>0;)h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f,b(h,p,d,f,v,x);break;case 28:A=B[Z],W=B[Z+1],g.push((A<<24|W<<16)>>16),Z+=2;break;case 29:j=g.pop()+a,O=t.gsubrs[j],O&&z(O);break;case 30:for(;g.length>0&&(h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+(g.length===1?g.shift():0),b(h,p,d,f,v,x),g.length!==0);)h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),x=f+g.shift(),v=d+(g.length===1?g.shift():0),b(h,p,d,f,v,x);break;case 31:for(;g.length>0&&(h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),x=f+g.shift(),v=d+(g.length===1?g.shift():0),b(h,p,d,f,v,x),g.length!==0);)h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+(g.length===1?g.shift():0),b(h,p,d,f,v,x);break;default:nt<32?console.warn(`Glyph ${u}: unknown operator ${nt}`):nt<247?g.push(nt-139):nt<251?(A=B[Z],Z+=1,g.push((nt-247)*256+A+108)):nt<255?(A=B[Z],Z+=1,g.push(-(nt-251)*256-A-108)):(A=B[Z],W=B[Z+1],I=B[Z+2],U=B[Z+3],Z+=4,g.push((A<<24|W<<16|I<<8|U)/65536))}}}z(e),this.pathCommands=m,P&&(this.advanceWidth=C)}}class Ir{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let r;if(e)r=e;else{r=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(r.advanceWidth=r.advanceWidth||i.advanceWidth,r.leftSideBearing=r.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);s&&(r.unicode??=s[0],r.unicodes??=s),this._items[t]=r}return r}}class _s extends Ir{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,r=new Ts({index:t});return r.parse(e,e.charStringsIndex.get(t),this),r.name=e.charset[t],r}}var ks=Object.defineProperty,Or=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&ks(t,e,i),i};class Je extends Ot{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,r,i){super(t,e,r,i),this._init()}_init(){const t=this.view,e=this.count,r=this.offsetSize;this.objectOffset=(e+1)*r+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,r=this.offsetSize;t.seek(3);const i=[];for(let s=0,o=e+1;s<o;s++){const a=this.view;let l=0;for(let c=0;c<r;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,r=this.count;e<r;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,r=this.objectOffset,i=r+e[t],o=r+e[t+1]-i;return this._isString?this.view.readString(i,o):this.view.readBytes(i,o)}}Or([y("uint16")],Je.prototype,"count"),Or([y("uint8")],Je.prototype,"offsetSize");class tn extends Je{_isString=!1}class Er extends Je{_isString=!0}const As=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Is=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Os=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Es=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function en(n,t){return t<=390?As[t]:n[t-391]}function Q(n,t="number",e){return(r,i)=>{if(typeof i!="string")return;const s={type:t,operator:n,default:e??t==="number"?0:void 0};Object.defineProperty(r.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class Br extends Ot{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const r=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=t.readUint8(),o=s>>4,a=s&15;if(o===r||(e+=i[o],a===r))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let r,i,s,o;if(t===28)return r=e.readUint8(),i=e.readUint8(),r<<8|i;if(t===29)return r=e.readUint8(),i=e.readUint8(),s=e.readUint8(),o=e.readUint8(),r<<24|i<<16|s<<8|o;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return r=e.readUint8(),(t-247)*256+r+108;if(t>=251&&t<=254)return r=e.readUint8(),-(t-251)*256-r-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const r=t.cursor+t.byteLength,i={};for(;t.cursor<r;){let s=t.readUint8();s<=21?(s===12&&(s=1200+t.readUint8()),i[s]=e,e=[]):e.push(this._readOperand(s))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return en(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var Bs=Object.defineProperty,Fn=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Bs(t,e,i),i};class nn extends Br{}Fn([Q(19)],nn.prototype,"subrs"),Fn([Q(20)],nn.prototype,"defaultWidthX"),Fn([Q(21)],nn.prototype,"nominalWidthX");var Ds=Object.defineProperty,rt=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Ds(t,e,i),i};class et extends Br{}rt([Q(0,"string")],et.prototype,"version"),rt([Q(1,"string")],et.prototype,"notice"),rt([Q(1200,"string")],et.prototype,"copyright"),rt([Q(2,"string")],et.prototype,"fullName"),rt([Q(3,"string")],et.prototype,"familyName"),rt([Q(4,"string")],et.prototype,"weight"),rt([Q(1201)],et.prototype,"isFixedPitch"),rt([Q(1202)],et.prototype,"italicAngle"),rt([Q(1203,"number",-100)],et.prototype,"underlinePosition"),rt([Q(1204,"number",50)],et.prototype,"underlineThickness"),rt([Q(1205)],et.prototype,"paintType"),rt([Q(1206,"number",2)],et.prototype,"charstringType"),rt([Q(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),rt([Q(13)],et.prototype,"uniqueId"),rt([Q(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),rt([Q(1208)],et.prototype,"strokeWidth"),rt([Q(14)],et.prototype,"xuid"),rt([Q(15)],et.prototype,"charset"),rt([Q(16)],et.prototype,"encoding"),rt([Q(17)],et.prototype,"charStrings"),rt([Q(18,"number[]",[0,0])],et.prototype,"private");function dt(n,t=n){return e=>{Kt.tableDefinitions.set(n,{tag:n,prop:t,class:e}),Object.defineProperty(Kt.prototype,t,{get(){return this.get(n)},set(r){return this.set(n,r)},configurable:!0,enumerable:!0})}}class Kt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:r,charset:i}=this.cff;e=i.indexOf(r[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const r of t)e.push(this.charToGlyphIndex(r));return e}textToGlyphs(t){const e=this.glyphs,r=this.textToGlyphIndexes(t),i=r.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(r[a])||o;return s}getPathCommands(t,e,r,i,s){const o=[];return this.forEachGlyph(t,e,r,i,s,(a,l,c,u,h)=>{o.push(...a.getPathCommands(l,c,u,h,this))}),o}getAdvanceWidth(t,e,r){return this.forEachGlyph(t,0,0,e,r,()=>{})}forEachGlyph(t,e=0,r=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const u=l[c];o.call(this,u,e,r,i,s),u.advanceWidth&&(e+=u.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((r,i)=>{this.tableViews.set(i,new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)))})}clone(){return new Kt(this.tableViews)}delete(t){const e=Kt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const r=Kt.tableDefinitions.get(t);return r&&this.tables.set(r.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Kt.tableDefinitions.get(t);if(!e)return;let r=this.tables.get(e.prop);if(!r){const i=e.class;if(i){const s=this.tableViews.get(t);if(!s)return;r=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,r)}}return r}}class gt extends Ot{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var Ls=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Ee=(n,t,e,r)=>{for(var i=r>1?void 0:r?Fs(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&Ls(t,e,i),i};let me=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new _s(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(n,t,e,r){super(n,t,e,r),this._init()}_init(){const n=this.view,{buffer:t,byteOffset:e}=n,r=e+4;this.nameIndex=new Er(t,r),this.topDictIndex=new tn(t,this.nameIndex.endOffset),this.stringIndex=new Er(t,this.topDictIndex.endOffset),this.globalSubrIndex=new tn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],s=this.topDict.private[1];i&&(this.privateDict=new nn(t,e+s,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new tn(t,e+s+this.privateDict.subrs))),this.charStringsIndex=new tn(t,e+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Is:this.topDict.charset===1?this.charset=Os:this.topDict.charset===2?this.charset=Es:this.charset=this._readCharset(e+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Ln:this.topDict.encoding===1?this.encoding=Ps:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(n,t,e){const r=this.view;r.seek(n);let i,s,o;t-=1;const a=[".notdef"],l=r.readUint8();if(l===0)for(i=0;i<t;i+=1)s=r.readUint16(),a.push(en(e,s));else if(l===1)for(;a.length<=t;)for(s=r.readUint16(),o=r.readUint8(),i=0;i<=o;i+=1)a.push(en(e,s)),s+=1;else if(l===2)for(;a.length<=t;)for(s=r.readUint16(),o=r.readUint16(),i=0;i<=o;i+=1)a.push(en(e,s)),s+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(n){const t=this.view;t.seek(n);let e,r;const i={},s=t.readUint8();if(s===0){const o=t.readUint8();for(e=0;e<o;e+=1)r=t.readUint8(),i[r]=e}else if(s===1){const o=t.readUint8();for(r=1,e=0;e<o;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=r,r+=1}}else console.warn(`unknown encoding format:${s}`);return i}_calcSubroutineBias(n){let t;return n.length<1240?t=107:n.length<33900?t=1131:t=32768,t}};Ee([y("uint8")],me.prototype,"majorVersion",2),Ee([y("uint8")],me.prototype,"minorVersion",2),Ee([y("uint8")],me.prototype,"headerSize",2),Ee([y("uint8")],me.prototype,"offsetSize",2),me=Ee([dt("CFF ","cff")],me);var Us=Object.defineProperty,rn=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Us(t,e,i),i};const Be=class Ki extends Ot{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Ki;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((r,i)=>{i<256&&r<256&&e.view.writeUint8(r,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,r)=>{t.set(r,e)}),t}};rn([y("uint16")],Be.prototype,"format"),rn([y("uint16")],Be.prototype,"length"),rn([y("uint16")],Be.prototype,"language"),rn([y({type:"uint8",size:256})],Be.prototype,"glyphIndexArray");let Dr=Be;var $s=Object.defineProperty,Un=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&$s(t,e,i),i};class sn extends Ot{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,r)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-r)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const r=(this.view.byteLength-e)/2;return Array.from({length:r},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,r=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=r.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(r[c]===0)c>=a||c<s[0].firstCode||c>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(c-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(c-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const u=r[c];for(let h=0,p=s[u].entryCount;h<p;h++)if(s[u].idRangeOffset+h>=o.length?l=0:(l=o[s[u].idRangeOffset+h],l!==0&&(l=l+s[u].idDelta)),l!==0&&l<t){const d=(c<<8|h+s[u].firstCode)%65535;e.set(d,l)}}return e}}Un([y("uint16")],sn.prototype,"format"),Un([y("uint16")],sn.prototype,"length"),Un([y("uint16")],sn.prototype,"language");function Lr(n){return n>32767?n-65536:n<-32767?n+65536:n}function Fr(n,t){let e;const r=[];let i={};return n.forEach((s,o)=>{t&&o>t||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,r.push(i),i={start:o,startId:s,delta:Lr(s-o)}):(i.start=Number(o),i.startId=s,i.delta=Lr(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,r.push(i)),r}var zs=Object.defineProperty,ue=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&zs(t,e,i),i};const re=class Qi extends Ot{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(r=>this.view.writeUint16(r))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Fr(t,65535),r=e.length+1,i=Math.floor(Math.log(r)/Math.LN2),s=2*2**i,o=new Qi(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=r*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*r-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:r},()=>0),o}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,r=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let u=i[c],h=s[c];u<=h;++u)if(o[c]===0)t.set(u,(u+a[c])%65536);else{const p=c+o[c]/2+(u-i[c])-r,d=l[p];d!==0?t.set(u,(d+a[c])%65536):t.set(u,0)}return t.delete(65535),t}};ue([y("uint16")],re.prototype,"format"),ue([y("uint16")],re.prototype,"length"),ue([y("uint16")],re.prototype,"language"),ue([y("uint16")],re.prototype,"segCountX2"),ue([y("uint16")],re.prototype,"searchRange"),ue([y("uint16")],re.prototype,"entrySelector"),ue([y("uint16")],re.prototype,"rangeShift");let Ur=re;var Ns=Object.defineProperty,De=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Ns(t,e,i),i};class xe extends Ot{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((r,i)=>{e.set(i,r)}),e}}De([y("uint16")],xe.prototype,"format"),De([y("uint16")],xe.prototype,"length"),De([y("uint16")],xe.prototype,"language"),De([y("uint16")],xe.prototype,"firstCode"),De([y("uint16")],xe.prototype,"entryCount");var Vs=Object.defineProperty,Le=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Vs(t,e,i),i};const ve=class Ji extends Ot{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Fr(t),r=new Ji(new ArrayBuffer(16+e.length*12));return r.format=12,r.reserved=0,r.length=r.view.byteLength,r.language=0,r.nGroups=e.length,e.forEach(i=>{r.view.writeUint32(i.start),r.view.writeUint32(i.end),r.view.writeUint32(i.startId)}),r}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let r=0,i=e.length;r<i;r++){const s=e[r];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)t.set(a++,o++)}return t}};Le([y("uint16")],ve.prototype,"format"),Le([y("uint16")],ve.prototype,"reserved"),Le([y("uint32")],ve.prototype,"length"),Le([y("uint32")],ve.prototype,"language"),Le([y("uint32")],ve.prototype,"nGroups");let $r=ve;var js=Object.defineProperty,$n=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&js(t,e,i),i};class on extends Ot{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const r=this.view.readUint32();e.unicodeValueRanges=Array.from({length:r},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const r=this.view.readUint32();e.uVSMappings=Array.from({length:r},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let r=0,i=e.length;r<i;r++){const{uVSMappings:s}=e[r];s.forEach(o=>{t.set(o.unicodeValue,o.glyphID)})}return t}}$n([y("uint16")],on.prototype,"format"),$n([y("uint32")],on.prototype,"length"),$n([y("uint32")],on.prototype,"numVarSelectorRecords");var Rs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,zn=(n,t,e,r)=>{for(var i=r>1?void 0:r?Gs(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&Rs(t,e,i),i};let Fe=class extends gt{static from(n){const t=Array.from(n.keys()).some(u=>u>65535),e=Ur.from(n),r=Dr.from(n),i=t?$r.from(n):void 0,s=4+(i?32:24),o=s+e.view.byteLength,a=o+r.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:s},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:s},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Fe(new ArrayBuffer(4+8*l.length+e.view.byteLength+r.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(u=>{c.view.writeUint16(u.platformID),c.view.writeUint16(u.platformSpecificID),c.view.writeUint32(u.offset)}),c.view.writeBytes(e.view,s),c.view.writeBytes(r.view,o),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const n=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let r=0,i=e.length;r<i;r++){const s=e[r],o=t.get(s);n.has(o)?n.get(o).push(s):n.set(o,[s])}this._glyphIndexToUnicodesMap=n}return this._glyphIndexToUnicodesMap}readSubtables(){const n=this.numberSubtables;return this.view.seek(4),Array.from({length:n},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let r;switch(e){case 0:r=new Dr(this.view.buffer,t.offset);break;case 2:r=new sn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:r=new Ur(this.view.buffer,t.offset,this.view.readUint16());break;case 6:r=new xe(this.view.buffer,t.offset,this.view.readUint16());break;case 12:r=new $r(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:r=new on(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:r}})}readunicodeToGlyphIndexMap(){const n=this.readSubtables(),t=n.find(o=>o.format===0)?.view,e=n.find(o=>o.platformID===3&&o.platformSpecificID===3&&o.format===2)?.view,r=n.find(o=>o.platformID===3&&o.platformSpecificID===1&&o.format===4)?.view,i=n.find(o=>o.platformID===3&&o.platformSpecificID===10&&o.format===12)?.view,s=n.find(o=>o.platformID===0&&o.platformSpecificID===5&&o.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...r?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...s?.getUnicodeToGlyphIndexMap()??[]])}};zn([y("uint16")],Fe.prototype,"version",2),zn([y("uint16")],Fe.prototype,"numberSubtables",2),Fe=zn([dt("cmap")],Fe);class qs extends Ar{_parseContours(t){const e=[];let r=[];for(let i=0;i<t.length;i+=1){const s=t[i];r.push(s),s.lastPointOfContour&&(e.push(r),r=[])}return Ie(r.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const r=[];for(let i=0;i<t.length;i+=1){const s=t[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};r.push(o)}return r}_parseGlyphCoordinate(t,e,r,i,s){let o;return(e&i)>0?(o=t.view.readUint8(),(e&s)===0&&(o=-o),o=r+o):(e&s)>0?o=r:o=r+t.view.readInt16(),o}parse(t,e,r){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let m=0;m<i;m++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ie(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let m=0;m<l;++m)c.push(t.view.readUint8());const u=t.view.byteOffset,h=a[a.length-1]+1;Ie(h<2e4,`Bad numberOfCoordinates:${u}`);const p=[];let d,f=0;for(;f<h;)if(d=t.view.readUint8(),p.push(d),f++,d&8&&f<h){const m=t.view.readUint8();for(let g=0;g<m;g++)p.push(d),f++}if(Ie(p.length===h,`Bad flags length: ${p.length}, numberOfCoordinates: ${h}`),a.length>0){const m=[];let g;if(h>0){for(let w=0;w<h;w+=1)d=p[w],g={},g.onCurve=!!(d&1),g.lastPointOfContour=a.includes(w),m.push(g);let M=0;for(let w=0;w<h;w+=1)d=p[w],g=m[w],g.x=this._parseGlyphCoordinate(t,d,M,2,16),M=g.x;let P=0;for(let w=0;w<h;w+=1)d=p[w],g=m[w],g.y=this._parseGlyphCoordinate(t,d,P,4,32),P=g.y}this.points=m}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=r.get(l.glyphIndex);if(c.getPathCommands(),c.points){let u;if(l.matchedPoints===void 0)u=this._transformPoints(c.points,l);else{Ie(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const h=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=h.x-p.x,d.dy=h.y-p.y,u=this._transformPoints(c.points,d)}this.points=this.points.concat(u)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const c=o[a];let u=c[c.length-1],h=c[0];u.onCurve?s.push({type:"M",x:u.x,y:u.y}):h.onCurve?s.push({type:"M",x:h.x,y:h.y}):s.push({type:"M",x:(u.x+h.x)*.5,y:(u.y+h.y)*.5});for(let p=0,d=c.length;p<d;++p)if(u=h,h=c[(p+1)%d],u.onCurve)s.push({type:"L",x:u.x,y:u.y});else{let f=h;h.onCurve||(f={x:(u.x+h.x)*.5,y:(u.y+h.y)*.5}),s.push({type:"Q",x1:u.x,y1:u.y,x:f.x,y:f.y})}s.push({type:"Z"})}this.pathCommands=s}}class Ws extends Ir{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,r=e[t],i=new qs({index:t});return r!==e[t+1]&&i.parse(this._sfnt.glyf,r,this),i}}var Hs=Object.getOwnPropertyDescriptor,Xs=(n,t,e,r)=>{for(var i=r>1?void 0:r?Hs(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let Nn=class extends gt{static from(n){const t=n.reduce((r,i)=>r+i.byteLength,0),e=new Nn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeBytes(r)}),e}_glyphs;get glyphs(){return this._glyphs??=new Ws(this._sfnt)}};Nn=Xs([dt("glyf")],Nn);var Zs=Object.getOwnPropertyDescriptor,Ys=(n,t,e,r)=>{for(var i=r>1?void 0:r?Zs(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let zr=class extends gt{};zr=Ys([dt("GPOS","gpos")],zr);var Ks=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,fe=(n,t,e,r)=>{for(var i=r>1?void 0:r?Qs(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&Ks(t,e,i),i};let ie=class extends gt{};fe([y("uint16")],ie.prototype,"majorVersion",2),fe([y("uint16")],ie.prototype,"minorVersion",2),fe([y("uint16")],ie.prototype,"scriptListOffset",2),fe([y("uint16")],ie.prototype,"featureListOffset",2),fe([y("uint16")],ie.prototype,"lookupListOffset",2),fe([y("uint16")],ie.prototype,"featureVariationsOffset",2),ie=fe([dt("GSUB","gsub")],ie);var Js=Object.defineProperty,to=Object.getOwnPropertyDescriptor,ot=(n,t,e,r)=>{for(var i=r>1?void 0:r?to(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&Js(t,e,i),i};let st=class extends gt{constructor(n=new ArrayBuffer(54),t){super(n,t,Math.min(54,n.byteLength-(t??0)))}};ot([y("fixed")],st.prototype,"version",2),ot([y("fixed")],st.prototype,"fontRevision",2),ot([y("uint32")],st.prototype,"checkSumAdjustment",2),ot([y("uint32")],st.prototype,"magickNumber",2),ot([y("uint16")],st.prototype,"flags",2),ot([y("uint16")],st.prototype,"unitsPerEm",2),ot([y({type:"longDateTime"})],st.prototype,"created",2),ot([y({type:"longDateTime"})],st.prototype,"modified",2),ot([y("int16")],st.prototype,"xMin",2),ot([y("int16")],st.prototype,"yMin",2),ot([y("int16")],st.prototype,"xMax",2),ot([y("int16")],st.prototype,"yMax",2),ot([y("uint16")],st.prototype,"macStyle",2),ot([y("uint16")],st.prototype,"lowestRecPPEM",2),ot([y("int16")],st.prototype,"fontDirectionHint",2),ot([y("int16")],st.prototype,"indexToLocFormat",2),ot([y("int16")],st.prototype,"glyphDataFormat",2),st=ot([dt("head")],st);var eo=Object.defineProperty,no=Object.getOwnPropertyDescriptor,bt=(n,t,e,r)=>{for(var i=r>1?void 0:r?no(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&eo(t,e,i),i};let yt=class extends gt{constructor(n=new ArrayBuffer(36),t){super(n,t,Math.min(36,n.byteLength-(t??0)))}};bt([y("fixed")],yt.prototype,"version",2),bt([y("int16")],yt.prototype,"ascent",2),bt([y("int16")],yt.prototype,"descent",2),bt([y("int16")],yt.prototype,"lineGap",2),bt([y("uint16")],yt.prototype,"advanceWidthMax",2),bt([y("int16")],yt.prototype,"minLeftSideBearing",2),bt([y("int16")],yt.prototype,"minRightSideBearing",2),bt([y("int16")],yt.prototype,"xMaxExtent",2),bt([y("int16")],yt.prototype,"caretSlopeRise",2),bt([y("int16")],yt.prototype,"caretSlopeRun",2),bt([y("int16")],yt.prototype,"caretOffset",2),bt([y({type:"int16",size:4})],yt.prototype,"reserved",2),bt([y("int16")],yt.prototype,"metricDataFormat",2),bt([y("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=bt([dt("hhea")],yt);var ro=Object.getOwnPropertyDescriptor,io=(n,t,e,r)=>{for(var i=r>1?void 0:r?ro(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let Vn=class extends gt{static from(n){const t=n.length*4,e=new Vn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeUint16(r.advanceWidth),e.view.writeUint16(r.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const r=this.view;return r.seek(0),Array.from({length:n}).map((i,s)=>(s<t&&(e=r.readUint16()),{advanceWidth:e,leftSideBearing:r.readUint16()}))}};Vn=io([dt("hmtx")],Vn);var so=Object.getOwnPropertyDescriptor,oo=(n,t,e,r)=>{for(var i=r>1?void 0:r?so(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let Nr=class extends gt{};Nr=oo([dt("kern","kern")],Nr);var ao=Object.getOwnPropertyDescriptor,lo=(n,t,e,r)=>{for(var i=r>1?void 0:r?ao(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let jn=class extends gt{static from(n,t=1){const e=n.length*(t?4:2),r=new jn(new ArrayBuffer(e));return n.forEach(i=>{t?r.view.writeUint32(i):r.view.writeUint16(i/2)}),r}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:n}).map(()=>t?e.readUint32():e.readUint16()*2)}};jn=lo([dt("loca")],jn);var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,mt=(n,t,e,r)=>{for(var i=r>1?void 0:r?ho(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&co(t,e,i),i};let ct=class extends gt{constructor(n=new ArrayBuffer(32),t){super(n,t,Math.min(32,n.byteLength-(t??0)))}};mt([y("fixed")],ct.prototype,"version",2),mt([y("uint16")],ct.prototype,"numGlyphs",2),mt([y("uint16")],ct.prototype,"maxPoints",2),mt([y("uint16")],ct.prototype,"maxContours",2),mt([y("uint16")],ct.prototype,"maxComponentPoints",2),mt([y("uint16")],ct.prototype,"maxComponentContours",2),mt([y("uint16")],ct.prototype,"maxZones",2),mt([y("uint16")],ct.prototype,"maxTwilightPoints",2),mt([y("uint16")],ct.prototype,"maxStorage",2),mt([y("uint16")],ct.prototype,"maxFunctionDefs",2),mt([y("uint16")],ct.prototype,"maxInstructionDefs",2),mt([y("uint16")],ct.prototype,"maxStackElements",2),mt([y("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([y("uint16")],ct.prototype,"maxComponentElements",2),mt([y("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var uo=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,an=(n,t,e,r)=>{for(var i=r>1?void 0:r?fo(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&uo(t,e,i),i};const Vr={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},Rn={Macintosh:1,Microsoft:3},po={Default:0},jr={UCS2:1};let Ue=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const n=this.count;this.view.seek(6);const t=[];for(let a=0;a<n;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<n;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let r=Rn.Macintosh,i=po.Default,s=0;t.some(a=>a.platform===Rn.Microsoft&&a.encoding===jr.UCS2&&a.language===1033)&&(r=Rn.Microsoft,i=jr.UCS2,s=1033);const o={};for(let a=0;a<n;++a){const l=t[a];l.platform===r&&l.encoding===i&&l.language===s&&Vr[l.nameId]&&(o[Vr[l.nameId]]=s===0?ws(l.name):bs(l.name))}return o}};an([y("uint16")],Ue.prototype,"format",2),an([y("uint16")],Ue.prototype,"count",2),an([y("uint16")],Ue.prototype,"stringOffset",2),Ue=an([dt("name")],Ue);var go=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,G=(n,t,e,r)=>{for(var i=r>1?void 0:r?yo(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&go(t,e,i),i};let R=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([y("uint16")],R.prototype,"version",2),G([y("int16")],R.prototype,"xAvgCharWidth",2),G([y("uint16")],R.prototype,"usWeightClass",2),G([y("uint16")],R.prototype,"usWidthClass",2),G([y("uint16")],R.prototype,"fsType",2),G([y("uint16")],R.prototype,"ySubscriptXSize",2),G([y("uint16")],R.prototype,"ySubscriptYSize",2),G([y("uint16")],R.prototype,"ySubscriptXOffset",2),G([y("uint16")],R.prototype,"ySubscriptYOffset",2),G([y("uint16")],R.prototype,"ySuperscriptXSize",2),G([y("uint16")],R.prototype,"ySuperscriptYSize",2),G([y("uint16")],R.prototype,"ySuperscriptXOffset",2),G([y("uint16")],R.prototype,"ySuperscriptYOffset",2),G([y("uint16")],R.prototype,"yStrikeoutSize",2),G([y("uint16")],R.prototype,"yStrikeoutPosition",2),G([y("uint16")],R.prototype,"sFamilyClass",2),G([y({type:"uint8"})],R.prototype,"bFamilyType",2),G([y({type:"uint8"})],R.prototype,"bSerifStyle",2),G([y({type:"uint8"})],R.prototype,"bWeight",2),G([y({type:"uint8"})],R.prototype,"bProportion",2),G([y({type:"uint8"})],R.prototype,"bContrast",2),G([y({type:"uint8"})],R.prototype,"bStrokeVariation",2),G([y({type:"uint8"})],R.prototype,"bArmStyle",2),G([y({type:"uint8"})],R.prototype,"bLetterform",2),G([y({type:"uint8"})],R.prototype,"bMidline",2),G([y({type:"uint8"})],R.prototype,"bXHeight",2),G([y({type:"uint8",size:16})],R.prototype,"ulUnicodeRange",2),G([y({type:"char",size:4})],R.prototype,"achVendID",2),G([y("uint16")],R.prototype,"fsSelection",2),G([y("uint16")],R.prototype,"usFirstCharIndex",2),G([y("uint16")],R.prototype,"usLastCharIndex",2),G([y("int16")],R.prototype,"sTypoAscender",2),G([y("int16")],R.prototype,"sTypoDescender",2),G([y("int16")],R.prototype,"sTypoLineGap",2),G([y("uint16")],R.prototype,"usWinAscent",2),G([y("uint16")],R.prototype,"usWinDescent",2),G([y({offset:72,type:"uint8",size:8})],R.prototype,"ulCodePageRange",2),G([y({offset:72,type:"int16"})],R.prototype,"sxHeight",2),G([y("int16")],R.prototype,"sCapHeight",2),G([y("uint16")],R.prototype,"usDefaultChar",2),G([y("uint16")],R.prototype,"usBreakChar",2),G([y("uint16")],R.prototype,"usMaxContext",2),R=G([dt("OS/2","os2")],R);var mo=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,Gt=(n,t,e,r)=>{for(var i=r>1?void 0:r?xo(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&mo(t,e,i),i};let $t=class extends gt{constructor(n=new ArrayBuffer(32),t,e){super(n,t,e)}};Gt([y("fixed")],$t.prototype,"format",2),Gt([y("fixed")],$t.prototype,"italicAngle",2),Gt([y("int16")],$t.prototype,"underlinePosition",2),Gt([y("int16")],$t.prototype,"underlineThickness",2),Gt([y("uint32")],$t.prototype,"isFixedPitch",2),Gt([y("uint32")],$t.prototype,"minMemType42",2),Gt([y("uint32")],$t.prototype,"maxMemType42",2),Gt([y("uint32")],$t.prototype,"minMemType1",2),Gt([y("uint32")],$t.prototype,"maxMemType1",2),$t=Gt([dt("post")],$t);var vo=Object.defineProperty,wo=Object.getOwnPropertyDescriptor,St=(n,t,e,r)=>{for(var i=r>1?void 0:r?wo(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(t,e,i):o(i))||i);return r&&i&&vo(t,e,i),i};let xt=class extends gt{constructor(n=new ArrayBuffer(36),t){super(n,t,Math.min(36,n.byteLength-(t??0)))}};St([y("fixed")],xt.prototype,"version",2),St([y("int16")],xt.prototype,"vertTypoAscender",2),St([y("int16")],xt.prototype,"vertTypoDescender",2),St([y("int16")],xt.prototype,"vertTypoLineGap",2),St([y("int16")],xt.prototype,"advanceHeightMax",2),St([y("int16")],xt.prototype,"minTopSideBearing",2),St([y("int16")],xt.prototype,"minBottomSideBearing",2),St([y("int16")],xt.prototype,"yMaxExtent",2),St([y("int16")],xt.prototype,"caretSlopeRise",2),St([y("int16")],xt.prototype,"caretSlopeRun",2),St([y("int16")],xt.prototype,"caretOffset",2),St([y({type:"int16",size:4})],xt.prototype,"reserved",2),St([y("int16")],xt.prototype,"metricDataFormat",2),St([y("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=St([dt("vhea")],xt);var bo=Object.getOwnPropertyDescriptor,So=(n,t,e,r)=>{for(var i=r>1?void 0:r?bo(t,e):t,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(i)||i);return i};let Gn=class extends gt{static from(n){const t=n.length*4,e=new Gn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeUint16(r.advanceHeight),e.view.writeInt16(r.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let r=0;return Array.from({length:n}).map((i,s)=>(s<t&&(r=e.readUint16()),{advanceHeight:r,topSideBearing:e.readUint8()}))}};Gn=So([dt("vmtx")],Gn);var Co=Object.defineProperty,$e=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Co(t,e,i),i};class qt extends Dn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(ye(t).getUint32(0))}static checksum(t){const e=ye(t);let r=e.byteLength;for(;r%4;)r++;let i=0;for(let s=0,o=r/4;s<o;s+=4)s*4<r-4&&(i+=e.getUint32(s*4,!1));return i&4294967295}static from(t){const e=h=>h+3&-4,r=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((h,p)=>h+e(p.byteLength),0),s=new this(new ArrayBuffer(12+r*16+i));s.scalerType=65536,s.numTables=r;const o=Math.log(2);s.searchRange=Math.floor(Math.log(r)/o)*16,s.entrySelector=Math.floor(s.searchRange/o),s.rangeShift=r*16-s.searchRange;let a=12+r*16,l=0;const c=s.getDirectories();t.tableViews.forEach((h,p)=>{const d=c[l++];d.tag=p,d.checkSum=this.checksum(h),d.offset=a,d.length=h.byteLength,s.view.writeBytes(h,a),a+=e(d.length)});const u=s.createSFNT().head;return u.checkSumAdjustment=0,u.checkSumAdjustment=2981146554-this.checksum(s.view),s}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Oe(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Kt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}$e([y("uint32")],qt.prototype,"scalerType"),$e([y("uint16")],qt.prototype,"numTables"),$e([y("uint16")],qt.prototype,"searchRange"),$e([y("uint16")],qt.prototype,"entrySelector"),$e([y("uint16")],qt.prototype,"rangeShift");class qn extends qt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var Mo=Object.defineProperty,ze=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Mo(t,e,i),i};class we extends Ot{constructor(t,e){super(t,e,20)}}ze([y({type:"char",size:4})],we.prototype,"tag"),ze([y("uint32")],we.prototype,"offset"),ze([y("uint32")],we.prototype,"compLength"),ze([y("uint32")],we.prototype,"origLength"),ze([y("uint32")],we.prototype,"origChecksum");var Po=Object.defineProperty,It=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Po(t,e,i),i};const Pt=class pr extends Dn{format="WOFF";mimeType="font/woff";get subfontFormat(){return qt.is(this.flavor)?"TrueType":qn.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(ye(t).getUint32(0))}static checkSum(t){const e=ye(t),r=e.byteLength,i=Math.floor(r/4);let s=0,o=0;for(;o<i;)s+=e.getUint32(4*o++,!1);let a=r-i*4;if(a){let l=i*4;for(;a>0;)s+=e.getUint8(l)<<a*8,l++,a--}return s%4294967296}static from(t,e=new ArrayBuffer(0)){const r=h=>h+3&-4,i=[];t.tableViews.forEach((h,p)=>{const d=ye(ps(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)));i.push({tag:p,view:d.byteLength<h.byteLength?d:h,rawView:h})});const s=i.length,o=i.reduce((h,p)=>h+r(p.view.byteLength),0),a=new pr(new ArrayBuffer(44+20*s+o+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=s,a.totalSFNTSize=12+16*s+i.reduce((h,p)=>h+r(p.rawView.byteLength),0);let l=44+s*20,c=0;const u=a.getDirectories();return i.forEach(h=>{const p=u[c++];p.tag=h.tag,p.offset=l,p.compLength=h.view.byteLength,p.origChecksum=pr.checkSum(h.rawView),p.origLength=h.rawView.byteLength,a.view.writeBytes(h.view,l),l+=r(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new we(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Kt(this.getDirectories().reduce((t,e)=>{const r=e.tag,i=this.view.byteOffset+e.offset,s=e.compLength,o=e.origLength,a=i+s;return t[r]=s>=o?new DataView(this.view.buffer,i,s):new DataView(ds(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};It([y("uint32")],Pt.prototype,"signature"),It([y("uint32")],Pt.prototype,"flavor"),It([y("uint32")],Pt.prototype,"length"),It([y("uint16")],Pt.prototype,"numTables"),It([y("uint16")],Pt.prototype,"reserved"),It([y("uint32")],Pt.prototype,"totalSFNTSize"),It([y("uint16")],Pt.prototype,"majorVersion"),It([y("uint16")],Pt.prototype,"minorVersion"),It([y("uint32")],Pt.prototype,"metaOffset"),It([y("uint32")],Pt.prototype,"metaLength"),It([y("uint32")],Pt.prototype,"metaOrigLength"),It([y("uint32")],Pt.prototype,"privOffset"),It([y("uint32")],Pt.prototype,"privLength");let Wn=Pt;function To(n,t=!0){if(qt.is(n))return new qt(n);if(qn.is(n))return new qn(n);if(Wn.is(n))return new Wn(n);if(t)throw new Error("Failed to parseFont")}function _o(n,t=!0){const e=To(n,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class Hn{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const r=new AbortController;return{url:t,when:fetch(t,{...Hn.defaultRequestInit,...e,signal:r.signal}).then(i=>i.arrayBuffer()),cancel:()=>r.abort()}}injectFontFace(t,e){return document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const r=document.createElement("style");return r.appendChild(document.createTextNode(`@font-face {
1
+ (function(H,te){typeof exports=="object"&&typeof module<"u"?te(exports):typeof define=="function"&&define.amd?define(["exports"],te):(H=typeof globalThis<"u"?globalThis:H||self,te(H.modernText={}))})(this,function(H){"use strict";function te(n,t,e){if(typeof t=="string"&&t.startsWith("linear-gradient")){const{x0:r,y0:i,x1:o,y1:s,stops:a}=ts(t,e.left,e.top,e.width,e.height),l=n.createLinearGradient(r,i,o,s);return a.forEach(c=>l.addColorStop(c.offset,c.color)),l}return t}function Te(n,t,e){n?.color&&(n.color=te(e,n.color,t)),n?.backgroundColor&&(n.backgroundColor=te(e,n.backgroundColor,t)),n?.textStrokeColor&&(n.textStrokeColor=te(e,n.textStrokeColor,t))}function ts(n,t,e,r,i){const o=n.match(/linear-gradient\((.+)\)$/)?.[1]??"",s=o.split(",")[0],a=s.includes("deg")?s:"0deg",l=o.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),u=(Number(a.replace("deg",""))||0)*Math.PI/180,h=r*Math.sin(u),p=i*Math.cos(u);return{x0:t+r/2-h,y0:e+i/2+p,x1:t+r/2+h,y1:e+i/2-p,stops:Array.from(l).map(d=>{let f=d[2];return f.startsWith("(")?f=f.split(",").length>3?`rgba${f}`:`rgb${f}`:f=`#${f}`,{offset:Number(d[3].replace("%",""))/100,color:f}})}}function he(n){const{ctx:t,path:e,fontSize:r,clipRect:i}=n;t.save(),t.beginPath();const o=e.style,s={...o,fill:n.color??o.fill,stroke:n.textStrokeColor??o.stroke,strokeWidth:n.textStrokeWidth?n.textStrokeWidth*r:o.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(n.shadowOffsetX??0)*r,shadowOffsetY:(n.shadowOffsetY??0)*r,shadowBlur:(n.shadowBlur??0)*r,shadowColor:n.shadowColor};i&&(t.rect(i.left,i.top,i.width,i.height),t.clip(),t.beginPath()),e.drawTo(t,s),t.restore()}function dr(n,t,e){const{left:r,top:i,width:o,height:s}=e,a=n.canvas;a.dataset.viewBox=`${r} ${i} ${o} ${s}`,a.dataset.pixelRatio=String(t);const l=o,c=s;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,n.clearRect(0,0,a.width,a.height),n.scale(t,t),n.translate(-r,-i)}function gr(n,t){const{paragraphs:e,computedStyle:r,glyphBox:i}=t;Te(r,i,n),e.forEach(o=>{Te(o.computedStyle,o.lineBox,n),o.fragments.forEach(s=>{Te(s.computedStyle,s.inlineBox,n)})})}var ut=Uint8Array,At=Uint16Array,Pn=Int32Array,Xe=new ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ze=new ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Tn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yr=function(n,t){for(var e=new At(31),r=0;r<31;++r)e[r]=t+=1<<n[r-1];for(var i=new Pn(e[30]),r=1;r<30;++r)for(var o=e[r];o<e[r+1];++o)i[o]=o-e[r]<<5|r;return{b:e,r:i}},mr=yr(Xe,2),xr=mr.b,_n=mr.r;xr[28]=258,_n[258]=28;for(var vr=yr(Ze,0),es=vr.b,wr=vr.r,kn=new At(32768),K=0;K<32768;++K){var ee=(K&43690)>>1|(K&21845)<<1;ee=(ee&52428)>>2|(ee&13107)<<2,ee=(ee&61680)>>4|(ee&3855)<<4,kn[K]=((ee&65280)>>8|(ee&255)<<8)>>1}for(var Rt=function(n,t,e){for(var r=n.length,i=0,o=new At(t);i<r;++i)n[i]&&++o[n[i]-1];var s=new At(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(e){a=new At(1<<t);var l=15-t;for(i=0;i<r;++i)if(n[i])for(var c=i<<4|n[i],u=t-n[i],h=s[n[i]-1]++<<u,p=h|(1<<u)-1;h<=p;++h)a[kn[h]>>l]=c}else for(a=new At(r),i=0;i<r;++i)n[i]&&(a[i]=kn[s[n[i]-1]++]>>15-n[i]);return a},ne=new ut(288),K=0;K<144;++K)ne[K]=8;for(var K=144;K<256;++K)ne[K]=9;for(var K=256;K<280;++K)ne[K]=7;for(var K=280;K<288;++K)ne[K]=8;for(var _e=new ut(32),K=0;K<32;++K)_e[K]=5;var ns=Rt(ne,9,0),rs=Rt(ne,9,1),is=Rt(_e,5,0),ss=Rt(_e,5,1),An=function(n){for(var t=n[0],e=1;e<n.length;++e)n[e]>t&&(t=n[e]);return t},Ft=function(n,t,e){var r=t/8|0;return(n[r]|n[r+1]<<8)>>(t&7)&e},In=function(n,t){var e=t/8|0;return(n[e]|n[e+1]<<8|n[e+2]<<16)>>(t&7)},On=function(n){return(n+7)/8|0},br=function(n,t,e){return(e==null||e>n.length)&&(e=n.length),new ut(n.subarray(t,e))},os=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ut=function(n,t,e){var r=new Error(t||os[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Ut),!e)throw r;return r},as=function(n,t,e,r){var i=n.length,o=0;if(!i||t.f&&!t.l)return e||new ut(0);var s=!e,a=s||t.i!=2,l=t.i;s&&(e=new ut(i*3));var c=function(Mt){var _t=e.length;if(Mt>_t){var ht=new ut(Math.max(_t*2,Mt));ht.set(e),e=ht}},u=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,g=t.n,M=i*8;do{if(!d){u=Ft(n,h,1);var P=Ft(n,h+1,3);if(h+=3,P)if(P==1)d=rs,f=ss,m=9,g=5;else if(P==2){var x=Ft(n,h,31)+257,S=Ft(n,h+10,15)+4,b=x+Ft(n,h+5,31)+1;h+=14;for(var D=new ut(b),N=new ut(19),E=0;E<S;++E)N[Tn[E]]=Ft(n,h+E*3,7);h+=S*3;for(var L=An(N),z=(1<<L)-1,B=Rt(N,L,1),E=0;E<b;){var A=B[Ft(n,h,z)];h+=A&15;var w=A>>4;if(w<16)D[E++]=w;else{var W=0,I=0;for(w==16?(I=3+Ft(n,h,3),h+=2,W=D[E-1]):w==17?(I=3+Ft(n,h,7),h+=3):w==18&&(I=11+Ft(n,h,127),h+=7);I--;)D[E++]=W}}var U=D.subarray(0,x),j=D.subarray(x);m=An(U),g=An(j),d=Rt(U,m,1),f=Rt(j,g,1)}else Ut(1);else{var w=On(h)+4,C=n[w-4]|n[w-3]<<8,v=w+C;if(v>i){l&&Ut(0);break}a&&c(p+C),e.set(n.subarray(w,v),p),t.b=p+=C,t.p=h=v*8,t.f=u;continue}if(h>M){l&&Ut(0);break}}a&&c(p+131072);for(var O=(1<<m)-1,V=(1<<g)-1,_=h;;_=h){var W=d[In(n,h)&O],T=W>>4;if(h+=W&15,h>M){l&&Ut(0);break}if(W||Ut(2),T<256)e[p++]=T;else if(T==256){_=h,d=null;break}else{var F=T-254;if(T>264){var E=T-257,$=Xe[E];F=Ft(n,h,(1<<$)-1)+xr[E],h+=$}var q=f[In(n,h)&V],Z=q>>4;q||Ut(3),h+=q&15;var j=es[Z];if(Z>3){var $=Ze[Z];j+=In(n,h)&(1<<$)-1,h+=$}if(h>M){l&&Ut(0);break}a&&c(p+131072);var nt=p+F;if(p<j){var Zt=o-j,Dt=Math.min(j,nt);for(Zt+p<0&&Ut(3);p<Dt;++p)e[p]=r[Zt+p]}for(;p<nt;++p)e[p]=e[p-j]}}t.l=d,t.p=_,t.b=p,t.f=u,d&&(u=1,t.m=m,t.d=f,t.n=g)}while(!u);return p!=e.length&&s?br(e,0,p):e.subarray(0,p)},Yt=function(n,t,e){e<<=t&7;var r=t/8|0;n[r]|=e,n[r+1]|=e>>8},ke=function(n,t,e){e<<=t&7;var r=t/8|0;n[r]|=e,n[r+1]|=e>>8,n[r+2]|=e>>16},En=function(n,t){for(var e=[],r=0;r<n.length;++r)n[r]&&e.push({s:r,f:n[r]});var i=e.length,o=e.slice();if(!i)return{t:Pr,l:0};if(i==1){var s=new ut(e[0].s+1);return s[e[0].s]=1,{t:s,l:1}}e.sort(function(v,x){return v.f-x.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,u=1,h=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=e[e[c].f<e[h].f?c++:h++],l=e[c!=u&&e[c].f<e[h].f?c++:h++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=o[0].s,r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var d=new At(p+1),f=Bn(e[u-1],d,0);if(f>t){var r=0,m=0,g=f-t,M=1<<g;for(o.sort(function(x,S){return d[S.s]-d[x.s]||x.f-S.f});r<i;++r){var P=o[r].s;if(d[P]>t)m+=M-(1<<f-d[P]),d[P]=t;else break}for(m>>=g;m>0;){var w=o[r].s;d[w]<t?m-=1<<t-d[w]++-1:++r}for(;r>=0&&m;--r){var C=o[r].s;d[C]==t&&(--d[C],++m)}f=t}return{t:new ut(d),l:f}},Bn=function(n,t,e){return n.s==-1?Math.max(Bn(n.l,t,e+1),Bn(n.r,t,e+1)):t[n.s]=e},Sr=function(n){for(var t=n.length;t&&!n[--t];);for(var e=new At(++t),r=0,i=n[0],o=1,s=function(l){e[r++]=l},a=1;a<=t;++a)if(n[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=n[a]}return{c:e.subarray(0,r),n:t}},Ae=function(n,t){for(var e=0,r=0;r<t.length;++r)e+=n[r]*t[r];return e},Cr=function(n,t,e){var r=e.length,i=On(t+2);n[i]=r&255,n[i+1]=r>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var o=0;o<r;++o)n[i+o+4]=e[o];return(i+4+r)*8},Mr=function(n,t,e,r,i,o,s,a,l,c,u){Yt(t,u++,e),++i[256];for(var h=En(i,15),p=h.t,d=h.l,f=En(o,15),m=f.t,g=f.l,M=Sr(p),P=M.c,w=M.n,C=Sr(m),v=C.c,x=C.n,S=new At(19),b=0;b<P.length;++b)++S[P[b]&31];for(var b=0;b<v.length;++b)++S[v[b]&31];for(var D=En(S,7),N=D.t,E=D.l,L=19;L>4&&!N[Tn[L-1]];--L);var z=c+5<<3,B=Ae(i,ne)+Ae(o,_e)+s,A=Ae(i,p)+Ae(o,m)+s+14+3*L+Ae(S,N)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&z<=B&&z<=A)return Cr(t,u,n.subarray(l,l+c));var W,I,U,j;if(Yt(t,u,1+(A<B)),u+=2,A<B){W=Rt(p,d,0),I=p,U=Rt(m,g,0),j=m;var O=Rt(N,E,0);Yt(t,u,w-257),Yt(t,u+5,x-1),Yt(t,u+10,L-4),u+=14;for(var b=0;b<L;++b)Yt(t,u+3*b,N[Tn[b]]);u+=3*L;for(var V=[P,v],_=0;_<2;++_)for(var T=V[_],b=0;b<T.length;++b){var F=T[b]&31;Yt(t,u,O[F]),u+=N[F],F>15&&(Yt(t,u,T[b]>>5&127),u+=T[b]>>12)}}else W=ns,I=ne,U=is,j=_e;for(var b=0;b<a;++b){var $=r[b];if($>255){var F=$>>18&31;ke(t,u,W[F+257]),u+=I[F+257],F>7&&(Yt(t,u,$>>23&31),u+=Xe[F]);var q=$&31;ke(t,u,U[q]),u+=j[q],q>3&&(ke(t,u,$>>5&8191),u+=Ze[q])}else ke(t,u,W[$]),u+=I[$]}return ke(t,u,W[256]),u+I[256]},ls=new Pn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pr=new ut(0),cs=function(n,t,e,r,i,o){var s=o.z||n.length,a=new ut(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var h=ls[t-1],p=h>>13,d=h&8191,f=(1<<e)-1,m=o.p||new At(32768),g=o.h||new At(f+1),M=Math.ceil(e/3),P=2*M,w=function(kt){return(n[kt]^n[kt+1]<<M^n[kt+2]<<P)&f},C=new Pn(25e3),v=new At(288),x=new At(32),S=0,b=0,D=o.i||0,N=0,E=o.w||0,L=0;D+2<s;++D){var z=w(D),B=D&32767,A=g[z];if(m[B]=A,g[z]=B,E<=D){var W=s-D;if((S>7e3||N>24576)&&(W>423||!c)){u=Mr(n,l,0,C,v,x,b,N,L,D-L,u),N=S=b=0,L=D;for(var I=0;I<286;++I)v[I]=0;for(var I=0;I<30;++I)x[I]=0}var U=2,j=0,O=d,V=B-A&32767;if(W>2&&z==w(D-V))for(var _=Math.min(p,W)-1,T=Math.min(32767,D),F=Math.min(258,W);V<=T&&--O&&B!=A;){if(n[D+U]==n[D+U-V]){for(var $=0;$<F&&n[D+$]==n[D+$-V];++$);if($>U){if(U=$,j=V,$>_)break;for(var q=Math.min(V,$-2),Z=0,I=0;I<q;++I){var nt=D-V+I&32767,Zt=m[nt],Dt=nt-Zt&32767;Dt>Z&&(Z=Dt,A=nt)}}}B=A,A=m[B],V+=B-A&32767}if(j){C[N++]=268435456|_n[U]<<18|wr[j];var Mt=_n[U]&31,_t=wr[j]&31;b+=Xe[Mt]+Ze[_t],++v[257+Mt],++x[_t],E=D+U,++S}else C[N++]=n[D],++v[n[D]]}}for(D=Math.max(D,E);D<s;++D)C[N++]=n[D],++v[n[D]];u=Mr(n,l,c,C,v,x,b,N,L,D-L,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=g,o.p=m,o.i=D,o.w=E)}else{for(var D=o.w||0;D<s+c;D+=65535){var ht=D+65535;ht>=s&&(l[u/8|0]=c,ht=s),u=Cr(l,u+1,n.subarray(D,ht))}o.i=s}return br(a,0,r+On(u)+i)},Tr=function(){var n=1,t=0;return{p:function(e){for(var r=n,i=t,o=e.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=e[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}n=r,t=i},d:function(){return n%=65521,t%=65521,(n&255)<<24|(n&65280)<<8|(t&255)<<8|t>>8}}},hs=function(n,t,e,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ut(o.length+n.length);s.set(o),s.set(n,o.length),n=s,i.w=o.length}return cs(n,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+t.mem,e,r,i)},_r=function(n,t,e){for(;e;++t)n[t]=e,e>>>=8},us=function(n,t){var e=t.level,r=e==0?0:e<6?1:e==9?3:2;if(n[0]=120,n[1]=r<<6|(t.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,t.dictionary){var i=Tr();i.p(t.dictionary),_r(n,2,i.d())}},fs=function(n,t){return((n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31)&&Ut(6,"invalid zlib data"),(n[1]>>5&1)==1&&Ut(6,"invalid zlib data: "+(n[1]&32?"need":"unexpected")+" dictionary"),(n[1]>>3&4)+2};function ps(n,t){t||(t={});var e=Tr();e.p(n);var r=hs(n,t,t.dictionary?6:2,4);return us(r,t),_r(r,r.length-4,e.d()),r}function ds(n,t){return as(n.subarray(fs(n),-4),{i:2},t,t)}var gs=typeof TextDecoder<"u"&&new TextDecoder,ys=0;try{gs.decode(Pr,{stream:!0}),ys=1}catch{}const ms="modern-font";function Ie(n,t){if(!n)throw new Error(`[${ms}] ${t}`)}function xs(n){if("buffer"in n){const t=n.buffer;return n.byteOffset>0||n.byteLength<n.buffer.byteLength?t.slice(n.byteOffset,n.byteOffset+n.byteLength):t}else return n}function ye(n){return"buffer"in n?new DataView(n.buffer,n.byteOffset,n.byteLength):new DataView(n)}function vs(n){let t="";for(let e=0,r=n.length,i;e<r;e++)i=n.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function Ye(n){n=vs(n);const t=[];for(let e=0,r=n.length,i;e<r;e++)i=n.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function ws(n){let t="";for(let e=0,r=n.length;e<r;e++)n[e]<127?t+=String.fromCharCode(n[e]):t+=`%${(256+n[e]).toString(16).slice(1)}`;return unescape(t)}function bs(n){let t="";for(let e=0,r=n.length;e<r;e+=2)t+=String.fromCharCode((n[e]<<8)+n[e+1]);return t}var Ss=Object.defineProperty,ft=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Ss(t,e,i),i};const Ke={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(n,t){Object.defineProperty(n.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,r,i){super(xs(t),e,r),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(r,i)=>this.read(t.type,t.offset+i));switch(t.type){case"char":return e.join("");default:return e}}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(r,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,r=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,r);case"longDateTime":return this.readLongDateTime(e,r)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,o=this,a=o[i]?.bind(o)?.(e,r);return this.cursor+=Ke[t],a}readUint24(t=this.cursor){const[e,r,i]=this.readBytes(t,3);return(e<<16)+(r<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const r=[];for(let i=0;i<e;++i)r.push(this.getUint8(t+i));return this.cursor=t+e,r}readString(t,e){const r=this.readBytes(t,e);let i="";for(let o=0,s=r.length;o<s;o++)i+=String.fromCharCode(r[o]);return i}readFixed(t,e){const r=this.readInt32(t,e)/65536;return Math.ceil(r*1e5)/1e5}readLongDateTime(t=this.cursor,e){const r=this.readUint32(t+4,e),i=new Date;return i.setTime(r*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,r=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,r);case"fixed":return this.writeFixed(e,r);case"longDateTime":return this.writeLongDateTime(e,r)}const o=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,s=this,l=s[o]?.bind(s)?.(r,e,i);return this.cursor+=Ke[t.toLowerCase()],l}writeString(t="",e=this.cursor){const r=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,o=t.length,s;i<o;++i)s=t.charCodeAt(i)||0,s>127?this.writeUint16(s):this.writeUint8(s);return this.cursor+=r,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let r;if(Array.isArray(t)){r=t.length;for(let i=0;i<r;++i)this.setUint8(e+i,t[i])}else{const i=ye(t);r=i.byteLength;for(let o=0;o<r;++o)this.setUint8(e+o,i.getUint8(o))}return this.cursor=e+r,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const kr=new WeakMap;function y(n){const t=typeof n=="object"?n:{type:n},{size:e=1,type:r}=t;return(i,o)=>{if(typeof o!="string")return;let s=kr.get(i);s||(s={columns:[],byteLength:0},kr.set(i,s));const a={...t,name:o,byteLength:e*Ke[r],offset:t.offset??s.columns.reduce((l,c)=>l+c.byteLength,0)};s.columns.push(a),s.byteLength=s.columns.reduce((l,c)=>l+Ke[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,o,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Ot{view;constructor(t,e,r,i){this.view=new lt(t,e,r,i)}}class Dn extends Ot{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Cs=Object.defineProperty,vt=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Cs(t,e,i),i};const wt=class Yi extends Dn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,o=Ye(i.fontFamily||""),s=o.length,a=Ye(i.fontStyle||""),l=a.length,c=Ye(i.version||""),u=c.length,h=Ye(i.fullName||""),p=h.length,d=86+s+4+l+4+u+4+p+2+t.view.byteLength,f=new Yi(new ArrayBuffer(d),0,d,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const m=e.os2;return m&&(f.FontPANOSE=m.fontPANOSE,f.Italic=m.fsSelection,f.Weight=m.usWeightClass,f.fsType=m.fsType,f.UnicodeRange=m.ulUnicodeRange,f.CodePageRange=m.ulCodePageRange),f.view.writeUint16(s),f.view.writeBytes(o),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(u),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(h),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};vt([y("uint32")],wt.prototype,"EOTSize"),vt([y("uint32")],wt.prototype,"FontDataSize"),vt([y("uint32")],wt.prototype,"Version"),vt([y("uint32")],wt.prototype,"Flags"),vt([y({type:"uint8",size:10})],wt.prototype,"FontPANOSE"),vt([y("uint8")],wt.prototype,"Charset"),vt([y("uint8")],wt.prototype,"Italic"),vt([y("uint32")],wt.prototype,"Weight"),vt([y("uint16")],wt.prototype,"fsType"),vt([y("uint16")],wt.prototype,"MagicNumber"),vt([y({type:"uint8",size:16})],wt.prototype,"UnicodeRange"),vt([y({type:"uint8",size:8})],wt.prototype,"CodePageRange"),vt([y("uint32")],wt.prototype,"CheckSumAdjustment"),vt([y({type:"uint8",size:16})],wt.prototype,"Reserved"),vt([y("uint16")],wt.prototype,"Padding1");var Ms=Object.defineProperty,Qe=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Ms(t,e,i),i};class Oe extends Ot{constructor(t,e){super(t,e,16)}}Qe([y({type:"char",size:4})],Oe.prototype,"tag"),Qe([y("uint32")],Oe.prototype,"checkSum"),Qe([y("uint32")],Oe.prototype,"offset"),Qe([y("uint32")],Oe.prototype,"length");const Ln=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Ps=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Ar{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,r=72,i={},o){const s=1/(o?.unitsPerEm??1e3)*r,{xScale:a=s,yScale:l=s}=i,c=this.pathCommands,u=[];for(let h=0,p=c.length;h<p;h+=1){const d=c[h];d.type==="M"?u.push({type:"M",x:t+d.x*a,y:e+-d.y*l}):d.type==="L"?u.push({type:"L",x:t+d.x*a,y:e+-d.y*l}):d.type==="Q"?u.push({type:"Q",x1:t+d.x1*a,y1:e+-d.y1*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="C"?u.push({type:"C",x1:t+d.x1*a,y1:e+-d.y1*l,x2:t+d.x2*a,y2:e+-d.y2*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="Z"&&u.push({type:"Z"})}return u}}class Ts extends Ar{parse(t,e,r){const i=this,{nominalWidthX:o,defaultWidthX:s,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,u=this.index;let h,p,d,f;const m=[],g=[];let M=0,P=!1,w=!1,C=s,v=0,x=0;function S(B,A){m.push({type:"L",x:B,y:A})}function b(B,A,W,I,U,j){m.push({type:"C",x1:B,y1:A,x2:W,y2:I,x:U,y:j})}function D(B,A){w&&c!==2&&N(),w=!0,m.push({type:"M",x:B,y:A})}function N(){m.push({type:"Z"})}function E(B){m.push(...B)}function L(){g.length%2!==0&&!P&&(C=g.shift()+o),M+=g.length>>1,g.length=0,P=!0}function z(B){let A,W,I,U,j,O,V,_,T,F,$,q,Z=0;for(;Z<B.length;){let nt=B[Z++];switch(nt){case 1:L();break;case 3:L();break;case 4:g.length>1&&!P&&(C=g.shift()+o,P=!0),x+=g.pop(),D(v,x);break;case 5:for(;g.length>0;)v+=g.shift(),x+=g.shift(),S(v,x);break;case 6:for(;g.length>0&&(v+=g.shift(),S(v,x),g.length!==0);)x+=g.shift(),S(v,x);break;case 7:for(;g.length>0&&(x+=g.shift(),S(v,x),g.length!==0);)v+=g.shift(),S(v,x);break;case 8:for(;g.length>0;)h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);break;case 10:j=g.pop()+l,O=t.subrs[j],O&&z(O);break;case 11:return;case 12:switch(nt=B[Z],Z+=1,nt){case 35:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f+g.shift(),T=V+g.shift(),F=_+g.shift(),$=T+g.shift(),q=F+g.shift(),v=$+g.shift(),x=q+g.shift(),g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 34:h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f,T=V+g.shift(),F=f,$=T+g.shift(),q=x,v=$+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 36:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f,T=V+g.shift(),F=f,$=T+g.shift(),q=F+g.shift(),v=$+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;case 37:h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),V=d+g.shift(),_=f+g.shift(),T=V+g.shift(),F=_+g.shift(),$=T+g.shift(),q=F+g.shift(),Math.abs($-v)>Math.abs(q-x)?v=$+g.shift():x=q+g.shift(),b(h,p,d,f,V,_),b(T,F,$,q,v,x);break;default:console.warn(`Glyph ${u}: unknown operator ${1200+nt}`),g.length=0}break;case 14:if(g.length>=4){const Zt=Ln[g.pop()],Dt=Ln[g.pop()],Mt=g.pop(),_t=g.pop();if(Zt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Zt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:_t,dy:Mt}),E(r.get(kt).pathCommands);const Vt=JSON.parse(JSON.stringify(r.get(ht).pathCommands));for(let jt=0;jt<Vt.length;jt+=1){const Lt=Vt[jt];Lt.type!=="Z"&&(Lt.x+=_t,Lt.y+=Mt),(Lt.type==="Q"||Lt.type==="C")&&(Lt.x1+=_t,Lt.y1+=Mt),Lt.type==="C"&&(Lt.x2+=_t,Lt.y2+=Mt)}E(Vt)}}else g.length>0&&!P&&(C=g.shift()+o,P=!0);w&&c!==2&&(N(),w=!1);break;case 18:L();break;case 19:case 20:L(),Z+=M+7>>3;break;case 21:g.length>2&&!P&&(C=g.shift()+o,P=!0),x+=g.pop(),v+=g.pop(),D(v,x);break;case 22:g.length>1&&!P&&(C=g.shift()+o,P=!0),v+=g.pop(),D(v,x);break;case 23:L();break;case 24:for(;g.length>2;)h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);v+=g.shift(),x+=g.shift(),S(v,x);break;case 25:for(;g.length>6;)v+=g.shift(),x+=g.shift(),S(v,x);h=v+g.shift(),p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+g.shift(),b(h,p,d,f,v,x);break;case 26:for(g.length%2&&(v+=g.shift());g.length>0;)h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d,x=f+g.shift(),b(h,p,d,f,v,x);break;case 27:for(g.length%2&&(x+=g.shift());g.length>0;)h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f,b(h,p,d,f,v,x);break;case 28:A=B[Z],W=B[Z+1],g.push((A<<24|W<<16)>>16),Z+=2;break;case 29:j=g.pop()+a,O=t.gsubrs[j],O&&z(O);break;case 30:for(;g.length>0&&(h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+(g.length===1?g.shift():0),b(h,p,d,f,v,x),g.length!==0);)h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),x=f+g.shift(),v=d+(g.length===1?g.shift():0),b(h,p,d,f,v,x);break;case 31:for(;g.length>0&&(h=v+g.shift(),p=x,d=h+g.shift(),f=p+g.shift(),x=f+g.shift(),v=d+(g.length===1?g.shift():0),b(h,p,d,f,v,x),g.length!==0);)h=v,p=x+g.shift(),d=h+g.shift(),f=p+g.shift(),v=d+g.shift(),x=f+(g.length===1?g.shift():0),b(h,p,d,f,v,x);break;default:nt<32?console.warn(`Glyph ${u}: unknown operator ${nt}`):nt<247?g.push(nt-139):nt<251?(A=B[Z],Z+=1,g.push((nt-247)*256+A+108)):nt<255?(A=B[Z],Z+=1,g.push(-(nt-251)*256-A-108)):(A=B[Z],W=B[Z+1],I=B[Z+2],U=B[Z+3],Z+=4,g.push((A<<24|W<<16|I<<8|U)/65536))}}}z(e),this.pathCommands=m,P&&(this.advanceWidth=C)}}class Ir{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let r;if(e)r=e;else{r=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(r.advanceWidth=r.advanceWidth||i.advanceWidth,r.leftSideBearing=r.leftSideBearing||i.leftSideBearing);const o=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);o&&(r.unicode??=o[0],r.unicodes??=o),this._items[t]=r}return r}}class _s extends Ir{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,r=new Ts({index:t});return r.parse(e,e.charStringsIndex.get(t),this),r.name=e.charset[t],r}}var ks=Object.defineProperty,Or=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&ks(t,e,i),i};class Je extends Ot{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,r,i){super(t,e,r,i),this._init()}_init(){const t=this.view,e=this.count,r=this.offsetSize;this.objectOffset=(e+1)*r+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,r=this.offsetSize;t.seek(3);const i=[];for(let o=0,s=e+1;o<s;o++){const a=this.view;let l=0;for(let c=0;c<r;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,r=this.count;e<r;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,r=this.objectOffset,i=r+e[t],s=r+e[t+1]-i;return this._isString?this.view.readString(i,s):this.view.readBytes(i,s)}}Or([y("uint16")],Je.prototype,"count"),Or([y("uint8")],Je.prototype,"offsetSize");class tn extends Je{_isString=!1}class Er extends Je{_isString=!0}const As=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Is=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Os=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Es=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function en(n,t){return t<=390?As[t]:n[t-391]}function Q(n,t="number",e){return(r,i)=>{if(typeof i!="string")return;const o={type:t,operator:n,default:e??t==="number"?0:void 0};Object.defineProperty(r.constructor.prototype,i,{get(){return this._getProp(o)},set(s){this._setProp(o,s)},configurable:!0,enumerable:!0})}}class Br extends Ot{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const r=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const o=t.readUint8(),s=o>>4,a=o&15;if(s===r||(e+=i[s],a===r))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let r,i,o,s;if(t===28)return r=e.readUint8(),i=e.readUint8(),r<<8|i;if(t===29)return r=e.readUint8(),i=e.readUint8(),o=e.readUint8(),s=e.readUint8(),r<<24|i<<16|o<<8|s;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return r=e.readUint8(),(t-247)*256+r+108;if(t>=251&&t<=254)return r=e.readUint8(),-(t-251)*256-r-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const r=t.cursor+t.byteLength,i={};for(;t.cursor<r;){let o=t.readUint8();o<=21?(o===12&&(o=1200+t.readUint8()),i[o]=e,e=[]):e.push(this._readOperand(o))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return en(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var Bs=Object.defineProperty,Fn=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Bs(t,e,i),i};class nn extends Br{}Fn([Q(19)],nn.prototype,"subrs"),Fn([Q(20)],nn.prototype,"defaultWidthX"),Fn([Q(21)],nn.prototype,"nominalWidthX");var Ds=Object.defineProperty,rt=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Ds(t,e,i),i};class et extends Br{}rt([Q(0,"string")],et.prototype,"version"),rt([Q(1,"string")],et.prototype,"notice"),rt([Q(1200,"string")],et.prototype,"copyright"),rt([Q(2,"string")],et.prototype,"fullName"),rt([Q(3,"string")],et.prototype,"familyName"),rt([Q(4,"string")],et.prototype,"weight"),rt([Q(1201)],et.prototype,"isFixedPitch"),rt([Q(1202)],et.prototype,"italicAngle"),rt([Q(1203,"number",-100)],et.prototype,"underlinePosition"),rt([Q(1204,"number",50)],et.prototype,"underlineThickness"),rt([Q(1205)],et.prototype,"paintType"),rt([Q(1206,"number",2)],et.prototype,"charstringType"),rt([Q(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),rt([Q(13)],et.prototype,"uniqueId"),rt([Q(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),rt([Q(1208)],et.prototype,"strokeWidth"),rt([Q(14)],et.prototype,"xuid"),rt([Q(15)],et.prototype,"charset"),rt([Q(16)],et.prototype,"encoding"),rt([Q(17)],et.prototype,"charStrings"),rt([Q(18,"number[]",[0,0])],et.prototype,"private");function dt(n,t=n){return e=>{Kt.tableDefinitions.set(n,{tag:n,prop:t,class:e}),Object.defineProperty(Kt.prototype,t,{get(){return this.get(n)},set(r){return this.set(n,r)},configurable:!0,enumerable:!0})}}class Kt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:r,charset:i}=this.cff;e=i.indexOf(r[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const r of t)e.push(this.charToGlyphIndex(r));return e}textToGlyphs(t){const e=this.glyphs,r=this.textToGlyphIndexes(t),i=r.length,o=Array.from({length:i}),s=e.get(0);for(let a=0;a<i;a+=1)o[a]=e.get(r[a])||s;return o}getPathCommands(t,e,r,i,o){const s=[];return this.forEachGlyph(t,e,r,i,o,(a,l,c,u,h)=>{s.push(...a.getPathCommands(l,c,u,h,this))}),s}getAdvanceWidth(t,e,r){return this.forEachGlyph(t,0,0,e,r,()=>{})}forEachGlyph(t,e=0,r=0,i=72,o={},s){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const u=l[c];s.call(this,u,e,r,i,o),u.advanceWidth&&(e+=u.advanceWidth*a),o.letterSpacing?e+=o.letterSpacing*i:o.tracking&&(e+=o.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((r,i)=>{this.tableViews.set(i,new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)))})}clone(){return new Kt(this.tableViews)}delete(t){const e=Kt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const r=Kt.tableDefinitions.get(t);return r&&this.tables.set(r.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Kt.tableDefinitions.get(t);if(!e)return;let r=this.tables.get(e.prop);if(!r){const i=e.class;if(i){const o=this.tableViews.get(t);if(!o)return;r=new i(o.buffer,o.byteOffset,o.byteLength).setSFNT(this),this.tables.set(e.prop,r)}}return r}}class gt extends Ot{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var Ls=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Ee=(n,t,e,r)=>{for(var i=r>1?void 0:r?Fs(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Ls(t,e,i),i};let me=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new _s(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(n,t,e,r){super(n,t,e,r),this._init()}_init(){const n=this.view,{buffer:t,byteOffset:e}=n,r=e+4;this.nameIndex=new Er(t,r),this.topDictIndex=new tn(t,this.nameIndex.endOffset),this.stringIndex=new Er(t,this.topDictIndex.endOffset),this.globalSubrIndex=new tn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],o=this.topDict.private[1];i&&(this.privateDict=new nn(t,e+o,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new tn(t,e+o+this.privateDict.subrs))),this.charStringsIndex=new tn(t,e+this.topDict.charStrings);const s=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Is:this.topDict.charset===1?this.charset=Os:this.topDict.charset===2?this.charset=Es:this.charset=this._readCharset(e+this.topDict.charset,s,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Ln:this.topDict.encoding===1?this.encoding=Ps:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(n,t,e){const r=this.view;r.seek(n);let i,o,s;t-=1;const a=[".notdef"],l=r.readUint8();if(l===0)for(i=0;i<t;i+=1)o=r.readUint16(),a.push(en(e,o));else if(l===1)for(;a.length<=t;)for(o=r.readUint16(),s=r.readUint8(),i=0;i<=s;i+=1)a.push(en(e,o)),o+=1;else if(l===2)for(;a.length<=t;)for(o=r.readUint16(),s=r.readUint16(),i=0;i<=s;i+=1)a.push(en(e,o)),o+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(n){const t=this.view;t.seek(n);let e,r;const i={},o=t.readUint8();if(o===0){const s=t.readUint8();for(e=0;e<s;e+=1)r=t.readUint8(),i[r]=e}else if(o===1){const s=t.readUint8();for(r=1,e=0;e<s;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=r,r+=1}}else console.warn(`unknown encoding format:${o}`);return i}_calcSubroutineBias(n){let t;return n.length<1240?t=107:n.length<33900?t=1131:t=32768,t}};Ee([y("uint8")],me.prototype,"majorVersion",2),Ee([y("uint8")],me.prototype,"minorVersion",2),Ee([y("uint8")],me.prototype,"headerSize",2),Ee([y("uint8")],me.prototype,"offsetSize",2),me=Ee([dt("CFF ","cff")],me);var Us=Object.defineProperty,rn=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Us(t,e,i),i};const Be=class Ki extends Ot{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Ki;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((r,i)=>{i<256&&r<256&&e.view.writeUint8(r,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,r)=>{t.set(r,e)}),t}};rn([y("uint16")],Be.prototype,"format"),rn([y("uint16")],Be.prototype,"length"),rn([y("uint16")],Be.prototype,"language"),rn([y({type:"uint8",size:256})],Be.prototype,"glyphIndexArray");let Dr=Be;var $s=Object.defineProperty,Un=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&$s(t,e,i),i};class sn extends Ot{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,r)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-r)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const r=(this.view.byteLength-e)/2;return Array.from({length:r},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,r=this.subHeaderKeys,i=this.maxSubHeaderKey,o=this.subHeaders,s=this.glyphIndexArray,a=r.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(r[c]===0)c>=a||c<o[0].firstCode||c>=o[0].firstCode+o[0].entryCount||o[0].idRangeOffset+(c-o[0].firstCode)>=s.length?l=0:(l=s[o[0].idRangeOffset+(c-o[0].firstCode)],l!==0&&(l=l+o[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const u=r[c];for(let h=0,p=o[u].entryCount;h<p;h++)if(o[u].idRangeOffset+h>=s.length?l=0:(l=s[o[u].idRangeOffset+h],l!==0&&(l=l+o[u].idDelta)),l!==0&&l<t){const d=(c<<8|h+o[u].firstCode)%65535;e.set(d,l)}}return e}}Un([y("uint16")],sn.prototype,"format"),Un([y("uint16")],sn.prototype,"length"),Un([y("uint16")],sn.prototype,"language");function Lr(n){return n>32767?n-65536:n<-32767?n+65536:n}function Fr(n,t){let e;const r=[];let i={};return n.forEach((o,s)=>{t&&s>t||((!e||s!==e.unicode+1||o!==e.glyphIndex+1)&&(e?(i.end=e.unicode,r.push(i),i={start:s,startId:o,delta:Lr(o-s)}):(i.start=Number(s),i.startId=o,i.delta=Lr(o-s))),e={unicode:s,glyphIndex:o})}),e&&(i.end=e.unicode,r.push(i)),r}var zs=Object.defineProperty,ue=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&zs(t,e,i),i};const re=class Qi extends Ot{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(r=>this.view.writeUint16(r))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Fr(t,65535),r=e.length+1,i=Math.floor(Math.log(r)/Math.LN2),o=2*2**i,s=new Qi(new ArrayBuffer(24+e.length*8));return s.format=4,s.length=s.view.byteLength,s.language=0,s.segCountX2=r*2,s.searchRange=o,s.entrySelector=i,s.rangeShift=2*r-o,s.endCode=[...e.map(a=>a.end),65535],s.reservedPad=0,s.startCode=[...e.map(a=>a.start),65535],s.idDelta=[...e.map(a=>a.delta),1],s.idRangeOffset=Array.from({length:r},()=>0),s}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,r=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,o=this.endCode,s=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let u=i[c],h=o[c];u<=h;++u)if(s[c]===0)t.set(u,(u+a[c])%65536);else{const p=c+s[c]/2+(u-i[c])-r,d=l[p];d!==0?t.set(u,(d+a[c])%65536):t.set(u,0)}return t.delete(65535),t}};ue([y("uint16")],re.prototype,"format"),ue([y("uint16")],re.prototype,"length"),ue([y("uint16")],re.prototype,"language"),ue([y("uint16")],re.prototype,"segCountX2"),ue([y("uint16")],re.prototype,"searchRange"),ue([y("uint16")],re.prototype,"entrySelector"),ue([y("uint16")],re.prototype,"rangeShift");let Ur=re;var Ns=Object.defineProperty,De=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Ns(t,e,i),i};class xe extends Ot{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((r,i)=>{e.set(i,r)}),e}}De([y("uint16")],xe.prototype,"format"),De([y("uint16")],xe.prototype,"length"),De([y("uint16")],xe.prototype,"language"),De([y("uint16")],xe.prototype,"firstCode"),De([y("uint16")],xe.prototype,"entryCount");var Vs=Object.defineProperty,Le=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Vs(t,e,i),i};const ve=class Ji extends Ot{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Fr(t),r=new Ji(new ArrayBuffer(16+e.length*12));return r.format=12,r.reserved=0,r.length=r.view.byteLength,r.language=0,r.nGroups=e.length,e.forEach(i=>{r.view.writeUint32(i.start),r.view.writeUint32(i.end),r.view.writeUint32(i.startId)}),r}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let r=0,i=e.length;r<i;r++){const o=e[r];let s=o.startGlyphCode,a=o.startCharCode;const l=o.endCharCode;for(;a<=l;)t.set(a++,s++)}return t}};Le([y("uint16")],ve.prototype,"format"),Le([y("uint16")],ve.prototype,"reserved"),Le([y("uint32")],ve.prototype,"length"),Le([y("uint32")],ve.prototype,"language"),Le([y("uint32")],ve.prototype,"nGroups");let $r=ve;var js=Object.defineProperty,$n=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&js(t,e,i),i};class on extends Ot{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const r=this.view.readUint32();e.unicodeValueRanges=Array.from({length:r},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const r=this.view.readUint32();e.uVSMappings=Array.from({length:r},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let r=0,i=e.length;r<i;r++){const{uVSMappings:o}=e[r];o.forEach(s=>{t.set(s.unicodeValue,s.glyphID)})}return t}}$n([y("uint16")],on.prototype,"format"),$n([y("uint32")],on.prototype,"length"),$n([y("uint32")],on.prototype,"numVarSelectorRecords");var Rs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,zn=(n,t,e,r)=>{for(var i=r>1?void 0:r?Gs(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Rs(t,e,i),i};let Fe=class extends gt{static from(n){const t=Array.from(n.keys()).some(u=>u>65535),e=Ur.from(n),r=Dr.from(n),i=t?$r.from(n):void 0,o=4+(i?32:24),s=o+e.view.byteLength,a=s+r.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:s},{platformID:3,platformSpecificID:1,offset:o},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Fe(new ArrayBuffer(4+8*l.length+e.view.byteLength+r.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(u=>{c.view.writeUint16(u.platformID),c.view.writeUint16(u.platformSpecificID),c.view.writeUint32(u.offset)}),c.view.writeBytes(e.view,o),c.view.writeBytes(r.view,s),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const n=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let r=0,i=e.length;r<i;r++){const o=e[r],s=t.get(o);n.has(s)?n.get(s).push(o):n.set(s,[o])}this._glyphIndexToUnicodesMap=n}return this._glyphIndexToUnicodesMap}readSubtables(){const n=this.numberSubtables;return this.view.seek(4),Array.from({length:n},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let r;switch(e){case 0:r=new Dr(this.view.buffer,t.offset);break;case 2:r=new sn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:r=new Ur(this.view.buffer,t.offset,this.view.readUint16());break;case 6:r=new xe(this.view.buffer,t.offset,this.view.readUint16());break;case 12:r=new $r(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:r=new on(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:r}})}readunicodeToGlyphIndexMap(){const n=this.readSubtables(),t=n.find(s=>s.format===0)?.view,e=n.find(s=>s.platformID===3&&s.platformSpecificID===3&&s.format===2)?.view,r=n.find(s=>s.platformID===3&&s.platformSpecificID===1&&s.format===4)?.view,i=n.find(s=>s.platformID===3&&s.platformSpecificID===10&&s.format===12)?.view,o=n.find(s=>s.platformID===0&&s.platformSpecificID===5&&s.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...r?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...o?.getUnicodeToGlyphIndexMap()??[]])}};zn([y("uint16")],Fe.prototype,"version",2),zn([y("uint16")],Fe.prototype,"numberSubtables",2),Fe=zn([dt("cmap")],Fe);class qs extends Ar{_parseContours(t){const e=[];let r=[];for(let i=0;i<t.length;i+=1){const o=t[i];r.push(o),o.lastPointOfContour&&(e.push(r),r=[])}return Ie(r.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const r=[];for(let i=0;i<t.length;i+=1){const o=t[i],s={x:e.xScale*o.x+e.scale10*o.y+e.dx,y:e.scale01*o.x+e.yScale*o.y+e.dy,onCurve:o.onCurve,lastPointOfContour:o.lastPointOfContour};r.push(s)}return r}_parseGlyphCoordinate(t,e,r,i,o){let s;return(e&i)>0?(s=t.view.readUint8(),(e&o)===0&&(s=-s),s=r+s):(e&o)>0?s=r:s=r+t.view.readInt16(),s}parse(t,e,r){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let m=0;m<i;m++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ie(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let m=0;m<l;++m)c.push(t.view.readUint8());const u=t.view.byteOffset,h=a[a.length-1]+1;Ie(h<2e4,`Bad numberOfCoordinates:${u}`);const p=[];let d,f=0;for(;f<h;)if(d=t.view.readUint8(),p.push(d),f++,d&8&&f<h){const m=t.view.readUint8();for(let g=0;g<m;g++)p.push(d),f++}if(Ie(p.length===h,`Bad flags length: ${p.length}, numberOfCoordinates: ${h}`),a.length>0){const m=[];let g;if(h>0){for(let w=0;w<h;w+=1)d=p[w],g={},g.onCurve=!!(d&1),g.lastPointOfContour=a.includes(w),m.push(g);let M=0;for(let w=0;w<h;w+=1)d=p[w],g=m[w],g.x=this._parseGlyphCoordinate(t,d,M,2,16),M=g.x;let P=0;for(let w=0;w<h;w+=1)d=p[w],g=m[w],g.y=this._parseGlyphCoordinate(t,d,P,4,32),P=g.y}this.points=m}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=r.get(l.glyphIndex);if(c.getPathCommands(),c.points){let u;if(l.matchedPoints===void 0)u=this._transformPoints(c.points,l);else{Ie(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const h=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=h.x-p.x,d.dy=h.y-p.y,u=this._transformPoints(c.points,d)}this.points=this.points.concat(u)}}const o=[],s=this._parseContours(this.points);for(let a=0,l=s.length;a<l;++a){const c=s[a];let u=c[c.length-1],h=c[0];u.onCurve?o.push({type:"M",x:u.x,y:u.y}):h.onCurve?o.push({type:"M",x:h.x,y:h.y}):o.push({type:"M",x:(u.x+h.x)*.5,y:(u.y+h.y)*.5});for(let p=0,d=c.length;p<d;++p)if(u=h,h=c[(p+1)%d],u.onCurve)o.push({type:"L",x:u.x,y:u.y});else{let f=h;h.onCurve||(f={x:(u.x+h.x)*.5,y:(u.y+h.y)*.5}),o.push({type:"Q",x1:u.x,y1:u.y,x:f.x,y:f.y})}o.push({type:"Z"})}this.pathCommands=o}}class Ws extends Ir{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,r=e[t],i=new qs({index:t});return r!==e[t+1]&&i.parse(this._sfnt.glyf,r,this),i}}var Hs=Object.getOwnPropertyDescriptor,Xs=(n,t,e,r)=>{for(var i=r>1?void 0:r?Hs(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let Nn=class extends gt{static from(n){const t=n.reduce((r,i)=>r+i.byteLength,0),e=new Nn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeBytes(r)}),e}_glyphs;get glyphs(){return this._glyphs??=new Ws(this._sfnt)}};Nn=Xs([dt("glyf")],Nn);var Zs=Object.getOwnPropertyDescriptor,Ys=(n,t,e,r)=>{for(var i=r>1?void 0:r?Zs(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let zr=class extends gt{};zr=Ys([dt("GPOS","gpos")],zr);var Ks=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,fe=(n,t,e,r)=>{for(var i=r>1?void 0:r?Qs(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Ks(t,e,i),i};let ie=class extends gt{};fe([y("uint16")],ie.prototype,"majorVersion",2),fe([y("uint16")],ie.prototype,"minorVersion",2),fe([y("uint16")],ie.prototype,"scriptListOffset",2),fe([y("uint16")],ie.prototype,"featureListOffset",2),fe([y("uint16")],ie.prototype,"lookupListOffset",2),fe([y("uint16")],ie.prototype,"featureVariationsOffset",2),ie=fe([dt("GSUB","gsub")],ie);var Js=Object.defineProperty,to=Object.getOwnPropertyDescriptor,ot=(n,t,e,r)=>{for(var i=r>1?void 0:r?to(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Js(t,e,i),i};let st=class extends gt{constructor(n=new ArrayBuffer(54),t){super(n,t,Math.min(54,n.byteLength-(t??0)))}};ot([y("fixed")],st.prototype,"version",2),ot([y("fixed")],st.prototype,"fontRevision",2),ot([y("uint32")],st.prototype,"checkSumAdjustment",2),ot([y("uint32")],st.prototype,"magickNumber",2),ot([y("uint16")],st.prototype,"flags",2),ot([y("uint16")],st.prototype,"unitsPerEm",2),ot([y({type:"longDateTime"})],st.prototype,"created",2),ot([y({type:"longDateTime"})],st.prototype,"modified",2),ot([y("int16")],st.prototype,"xMin",2),ot([y("int16")],st.prototype,"yMin",2),ot([y("int16")],st.prototype,"xMax",2),ot([y("int16")],st.prototype,"yMax",2),ot([y("uint16")],st.prototype,"macStyle",2),ot([y("uint16")],st.prototype,"lowestRecPPEM",2),ot([y("int16")],st.prototype,"fontDirectionHint",2),ot([y("int16")],st.prototype,"indexToLocFormat",2),ot([y("int16")],st.prototype,"glyphDataFormat",2),st=ot([dt("head")],st);var eo=Object.defineProperty,no=Object.getOwnPropertyDescriptor,bt=(n,t,e,r)=>{for(var i=r>1?void 0:r?no(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&eo(t,e,i),i};let yt=class extends gt{constructor(n=new ArrayBuffer(36),t){super(n,t,Math.min(36,n.byteLength-(t??0)))}};bt([y("fixed")],yt.prototype,"version",2),bt([y("int16")],yt.prototype,"ascent",2),bt([y("int16")],yt.prototype,"descent",2),bt([y("int16")],yt.prototype,"lineGap",2),bt([y("uint16")],yt.prototype,"advanceWidthMax",2),bt([y("int16")],yt.prototype,"minLeftSideBearing",2),bt([y("int16")],yt.prototype,"minRightSideBearing",2),bt([y("int16")],yt.prototype,"xMaxExtent",2),bt([y("int16")],yt.prototype,"caretSlopeRise",2),bt([y("int16")],yt.prototype,"caretSlopeRun",2),bt([y("int16")],yt.prototype,"caretOffset",2),bt([y({type:"int16",size:4})],yt.prototype,"reserved",2),bt([y("int16")],yt.prototype,"metricDataFormat",2),bt([y("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=bt([dt("hhea")],yt);var ro=Object.getOwnPropertyDescriptor,io=(n,t,e,r)=>{for(var i=r>1?void 0:r?ro(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let Vn=class extends gt{static from(n){const t=n.length*4,e=new Vn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeUint16(r.advanceWidth),e.view.writeUint16(r.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const r=this.view;return r.seek(0),Array.from({length:n}).map((i,o)=>(o<t&&(e=r.readUint16()),{advanceWidth:e,leftSideBearing:r.readUint16()}))}};Vn=io([dt("hmtx")],Vn);var so=Object.getOwnPropertyDescriptor,oo=(n,t,e,r)=>{for(var i=r>1?void 0:r?so(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let Nr=class extends gt{};Nr=oo([dt("kern","kern")],Nr);var ao=Object.getOwnPropertyDescriptor,lo=(n,t,e,r)=>{for(var i=r>1?void 0:r?ao(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let jn=class extends gt{static from(n,t=1){const e=n.length*(t?4:2),r=new jn(new ArrayBuffer(e));return n.forEach(i=>{t?r.view.writeUint32(i):r.view.writeUint16(i/2)}),r}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:n}).map(()=>t?e.readUint32():e.readUint16()*2)}};jn=lo([dt("loca")],jn);var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,mt=(n,t,e,r)=>{for(var i=r>1?void 0:r?ho(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&co(t,e,i),i};let ct=class extends gt{constructor(n=new ArrayBuffer(32),t){super(n,t,Math.min(32,n.byteLength-(t??0)))}};mt([y("fixed")],ct.prototype,"version",2),mt([y("uint16")],ct.prototype,"numGlyphs",2),mt([y("uint16")],ct.prototype,"maxPoints",2),mt([y("uint16")],ct.prototype,"maxContours",2),mt([y("uint16")],ct.prototype,"maxComponentPoints",2),mt([y("uint16")],ct.prototype,"maxComponentContours",2),mt([y("uint16")],ct.prototype,"maxZones",2),mt([y("uint16")],ct.prototype,"maxTwilightPoints",2),mt([y("uint16")],ct.prototype,"maxStorage",2),mt([y("uint16")],ct.prototype,"maxFunctionDefs",2),mt([y("uint16")],ct.prototype,"maxInstructionDefs",2),mt([y("uint16")],ct.prototype,"maxStackElements",2),mt([y("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([y("uint16")],ct.prototype,"maxComponentElements",2),mt([y("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var uo=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,an=(n,t,e,r)=>{for(var i=r>1?void 0:r?fo(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&uo(t,e,i),i};const Vr={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},Rn={Macintosh:1,Microsoft:3},po={Default:0},jr={UCS2:1};let Ue=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const n=this.count;this.view.seek(6);const t=[];for(let a=0;a<n;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<n;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let r=Rn.Macintosh,i=po.Default,o=0;t.some(a=>a.platform===Rn.Microsoft&&a.encoding===jr.UCS2&&a.language===1033)&&(r=Rn.Microsoft,i=jr.UCS2,o=1033);const s={};for(let a=0;a<n;++a){const l=t[a];l.platform===r&&l.encoding===i&&l.language===o&&Vr[l.nameId]&&(s[Vr[l.nameId]]=o===0?ws(l.name):bs(l.name))}return s}};an([y("uint16")],Ue.prototype,"format",2),an([y("uint16")],Ue.prototype,"count",2),an([y("uint16")],Ue.prototype,"stringOffset",2),Ue=an([dt("name")],Ue);var go=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,G=(n,t,e,r)=>{for(var i=r>1?void 0:r?yo(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&go(t,e,i),i};let R=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([y("uint16")],R.prototype,"version",2),G([y("int16")],R.prototype,"xAvgCharWidth",2),G([y("uint16")],R.prototype,"usWeightClass",2),G([y("uint16")],R.prototype,"usWidthClass",2),G([y("uint16")],R.prototype,"fsType",2),G([y("uint16")],R.prototype,"ySubscriptXSize",2),G([y("uint16")],R.prototype,"ySubscriptYSize",2),G([y("uint16")],R.prototype,"ySubscriptXOffset",2),G([y("uint16")],R.prototype,"ySubscriptYOffset",2),G([y("uint16")],R.prototype,"ySuperscriptXSize",2),G([y("uint16")],R.prototype,"ySuperscriptYSize",2),G([y("uint16")],R.prototype,"ySuperscriptXOffset",2),G([y("uint16")],R.prototype,"ySuperscriptYOffset",2),G([y("uint16")],R.prototype,"yStrikeoutSize",2),G([y("uint16")],R.prototype,"yStrikeoutPosition",2),G([y("uint16")],R.prototype,"sFamilyClass",2),G([y({type:"uint8"})],R.prototype,"bFamilyType",2),G([y({type:"uint8"})],R.prototype,"bSerifStyle",2),G([y({type:"uint8"})],R.prototype,"bWeight",2),G([y({type:"uint8"})],R.prototype,"bProportion",2),G([y({type:"uint8"})],R.prototype,"bContrast",2),G([y({type:"uint8"})],R.prototype,"bStrokeVariation",2),G([y({type:"uint8"})],R.prototype,"bArmStyle",2),G([y({type:"uint8"})],R.prototype,"bLetterform",2),G([y({type:"uint8"})],R.prototype,"bMidline",2),G([y({type:"uint8"})],R.prototype,"bXHeight",2),G([y({type:"uint8",size:16})],R.prototype,"ulUnicodeRange",2),G([y({type:"char",size:4})],R.prototype,"achVendID",2),G([y("uint16")],R.prototype,"fsSelection",2),G([y("uint16")],R.prototype,"usFirstCharIndex",2),G([y("uint16")],R.prototype,"usLastCharIndex",2),G([y("int16")],R.prototype,"sTypoAscender",2),G([y("int16")],R.prototype,"sTypoDescender",2),G([y("int16")],R.prototype,"sTypoLineGap",2),G([y("uint16")],R.prototype,"usWinAscent",2),G([y("uint16")],R.prototype,"usWinDescent",2),G([y({offset:72,type:"uint8",size:8})],R.prototype,"ulCodePageRange",2),G([y({offset:72,type:"int16"})],R.prototype,"sxHeight",2),G([y("int16")],R.prototype,"sCapHeight",2),G([y("uint16")],R.prototype,"usDefaultChar",2),G([y("uint16")],R.prototype,"usBreakChar",2),G([y("uint16")],R.prototype,"usMaxContext",2),R=G([dt("OS/2","os2")],R);var mo=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,Gt=(n,t,e,r)=>{for(var i=r>1?void 0:r?xo(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&mo(t,e,i),i};let $t=class extends gt{constructor(n=new ArrayBuffer(32),t,e){super(n,t,e)}};Gt([y("fixed")],$t.prototype,"format",2),Gt([y("fixed")],$t.prototype,"italicAngle",2),Gt([y("int16")],$t.prototype,"underlinePosition",2),Gt([y("int16")],$t.prototype,"underlineThickness",2),Gt([y("uint32")],$t.prototype,"isFixedPitch",2),Gt([y("uint32")],$t.prototype,"minMemType42",2),Gt([y("uint32")],$t.prototype,"maxMemType42",2),Gt([y("uint32")],$t.prototype,"minMemType1",2),Gt([y("uint32")],$t.prototype,"maxMemType1",2),$t=Gt([dt("post")],$t);var vo=Object.defineProperty,wo=Object.getOwnPropertyDescriptor,St=(n,t,e,r)=>{for(var i=r>1?void 0:r?wo(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&vo(t,e,i),i};let xt=class extends gt{constructor(n=new ArrayBuffer(36),t){super(n,t,Math.min(36,n.byteLength-(t??0)))}};St([y("fixed")],xt.prototype,"version",2),St([y("int16")],xt.prototype,"vertTypoAscender",2),St([y("int16")],xt.prototype,"vertTypoDescender",2),St([y("int16")],xt.prototype,"vertTypoLineGap",2),St([y("int16")],xt.prototype,"advanceHeightMax",2),St([y("int16")],xt.prototype,"minTopSideBearing",2),St([y("int16")],xt.prototype,"minBottomSideBearing",2),St([y("int16")],xt.prototype,"yMaxExtent",2),St([y("int16")],xt.prototype,"caretSlopeRise",2),St([y("int16")],xt.prototype,"caretSlopeRun",2),St([y("int16")],xt.prototype,"caretOffset",2),St([y({type:"int16",size:4})],xt.prototype,"reserved",2),St([y("int16")],xt.prototype,"metricDataFormat",2),St([y("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=St([dt("vhea")],xt);var bo=Object.getOwnPropertyDescriptor,So=(n,t,e,r)=>{for(var i=r>1?void 0:r?bo(t,e):t,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(i)||i);return i};let Gn=class extends gt{static from(n){const t=n.length*4,e=new Gn(new ArrayBuffer(t));return n.forEach(r=>{e.view.writeUint16(r.advanceHeight),e.view.writeInt16(r.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const n=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let r=0;return Array.from({length:n}).map((i,o)=>(o<t&&(r=e.readUint16()),{advanceHeight:r,topSideBearing:e.readUint8()}))}};Gn=So([dt("vmtx")],Gn);var Co=Object.defineProperty,$e=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Co(t,e,i),i};class qt extends Dn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(ye(t).getUint32(0))}static checksum(t){const e=ye(t);let r=e.byteLength;for(;r%4;)r++;let i=0;for(let o=0,s=r/4;o<s;o+=4)o*4<r-4&&(i+=e.getUint32(o*4,!1));return i&4294967295}static from(t){const e=h=>h+3&-4,r=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((h,p)=>h+e(p.byteLength),0),o=new this(new ArrayBuffer(12+r*16+i));o.scalerType=65536,o.numTables=r;const s=Math.log(2);o.searchRange=Math.floor(Math.log(r)/s)*16,o.entrySelector=Math.floor(o.searchRange/s),o.rangeShift=r*16-o.searchRange;let a=12+r*16,l=0;const c=o.getDirectories();t.tableViews.forEach((h,p)=>{const d=c[l++];d.tag=p,d.checkSum=this.checksum(h),d.offset=a,d.length=h.byteLength,o.view.writeBytes(h,a),a+=e(d.length)});const u=o.createSFNT().head;return u.checkSumAdjustment=0,u.checkSumAdjustment=2981146554-this.checksum(o.view),o}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Oe(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Kt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}$e([y("uint32")],qt.prototype,"scalerType"),$e([y("uint16")],qt.prototype,"numTables"),$e([y("uint16")],qt.prototype,"searchRange"),$e([y("uint16")],qt.prototype,"entrySelector"),$e([y("uint16")],qt.prototype,"rangeShift");class qn extends qt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var Mo=Object.defineProperty,ze=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Mo(t,e,i),i};class we extends Ot{constructor(t,e){super(t,e,20)}}ze([y({type:"char",size:4})],we.prototype,"tag"),ze([y("uint32")],we.prototype,"offset"),ze([y("uint32")],we.prototype,"compLength"),ze([y("uint32")],we.prototype,"origLength"),ze([y("uint32")],we.prototype,"origChecksum");var Po=Object.defineProperty,It=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&Po(t,e,i),i};const Pt=class pr extends Dn{format="WOFF";mimeType="font/woff";get subfontFormat(){return qt.is(this.flavor)?"TrueType":qn.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(ye(t).getUint32(0))}static checkSum(t){const e=ye(t),r=e.byteLength,i=Math.floor(r/4);let o=0,s=0;for(;s<i;)o+=e.getUint32(4*s++,!1);let a=r-i*4;if(a){let l=i*4;for(;a>0;)o+=e.getUint8(l)<<a*8,l++,a--}return o%4294967296}static from(t,e=new ArrayBuffer(0)){const r=h=>h+3&-4,i=[];t.tableViews.forEach((h,p)=>{const d=ye(ps(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)));i.push({tag:p,view:d.byteLength<h.byteLength?d:h,rawView:h})});const o=i.length,s=i.reduce((h,p)=>h+r(p.view.byteLength),0),a=new pr(new ArrayBuffer(44+20*o+s+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=o,a.totalSFNTSize=12+16*o+i.reduce((h,p)=>h+r(p.rawView.byteLength),0);let l=44+o*20,c=0;const u=a.getDirectories();return i.forEach(h=>{const p=u[c++];p.tag=h.tag,p.offset=l,p.compLength=h.view.byteLength,p.origChecksum=pr.checkSum(h.rawView),p.origLength=h.rawView.byteLength,a.view.writeBytes(h.view,l),l+=r(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new we(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Kt(this.getDirectories().reduce((t,e)=>{const r=e.tag,i=this.view.byteOffset+e.offset,o=e.compLength,s=e.origLength,a=i+o;return t[r]=o>=s?new DataView(this.view.buffer,i,o):new DataView(ds(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};It([y("uint32")],Pt.prototype,"signature"),It([y("uint32")],Pt.prototype,"flavor"),It([y("uint32")],Pt.prototype,"length"),It([y("uint16")],Pt.prototype,"numTables"),It([y("uint16")],Pt.prototype,"reserved"),It([y("uint32")],Pt.prototype,"totalSFNTSize"),It([y("uint16")],Pt.prototype,"majorVersion"),It([y("uint16")],Pt.prototype,"minorVersion"),It([y("uint32")],Pt.prototype,"metaOffset"),It([y("uint32")],Pt.prototype,"metaLength"),It([y("uint32")],Pt.prototype,"metaOrigLength"),It([y("uint32")],Pt.prototype,"privOffset"),It([y("uint32")],Pt.prototype,"privLength");let Wn=Pt;function To(n,t=!0){if(qt.is(n))return new qt(n);if(qn.is(n))return new qn(n);if(Wn.is(n))return new Wn(n);if(t)throw new Error("Failed to parseFont")}function _o(n,t=!0){const e=To(n,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class Hn{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const r=new AbortController;return{url:t,when:fetch(t,{...Hn.defaultRequestInit,...e,signal:r.signal}).then(i=>i.arrayBuffer()),cancel:()=>r.abort()}}injectFontFace(t,e){return document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const r=document.createElement("style");return r.appendChild(document.createTextNode(`@font-face {
2
2
  font-family: "${t}";
3
3
  src: url(${e});
4
- }`)),document.head.appendChild(r),this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(r=>this.familyToUrl.get(r.trim())??this.familyToUrl.get(r)??r)))}get(t){let e;return t&&(e=this._parseUrls(t).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(t,e){return this.familyToUrl.set(t,e.src),this.loaded.set(e.src,e),this}delete(t){return this._parseUrls(t).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(t,e={}){const{cancelOther:r,injectFontFace:i=!0,injectStyleTag:s=!0,...o}=e;let a,l;if(typeof t=="string"?a=t:{src:a,family:l}=t,this.loaded.has(a))return r&&(this.loading.forEach(d=>d.cancel()),this.loading.clear()),h(this.loaded.get(a));let c=this.loading.get(a);return c||(c=this._createRequest(a,o),this.loading.set(a,c)),r&&this.loading.forEach((d,f)=>{d!==c&&(d.cancel(),this.loading.delete(f))}),c.when.then(d=>{if(this.loaded.has(a))return h(this.loaded.get(a));{const f=p(d);return e.noAdd||this.loaded.set(a,f),f.familySet.forEach(m=>{this.familyToUrl.set(m,a),typeof document<"u"&&(i&&this.injectFontFace(m,d),s&&this.injectStyleTag(m,a))}),f}}).catch(d=>{if(d instanceof DOMException&&d.message==="The user aborted a request.")return p();throw d}).finally(()=>{this.loading.delete(a)});function u(){return l?Array.isArray(l)?l:[l]:[]}function h(d){return u().forEach(f=>{d.familySet.add(f)}),d}function p(d=new ArrayBuffer(0)){let f;function m(){return f||(f=d.byteLength?_o(d,!1):void 0),f}function g(){const M=m();if(M instanceof qt||M instanceof Wn)return M.sfnt}return{src:a,family:l,buffer:d,familySet:new Set(u()),getFont:m,getSFNT:g}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const ko=new Hn;function Ao(n,t,e=2){const r=t&&t.length,i=r?t[0]*e:n.length;let s=Rr(n,0,i,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(r&&(s=Do(n,t,s,e)),n.length>80*e){a=n[0],l=n[1];let u=a,h=l;for(let p=e;p<i;p+=e){const d=n[p],f=n[p+1];d<a&&(a=d),f<l&&(l=f),d>u&&(u=d),f>h&&(h=f)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}return Ne(s,o,e,a,l,c,0),o}function Rr(n,t,e,r,i){let s;if(i===qo(n,t,e,r)>0)for(let o=t;o<e;o+=r)s=Hr(o/r|0,n[o],n[o+1],s);else for(let o=e-r;o>=t;o-=r)s=Hr(o/r|0,n[o],n[o+1],s);return s&&be(s,s.next)&&(Re(s),s=s.next),s}function pe(n,t){if(!n)return n;t||(t=n);let e=n,r;do if(r=!1,!e.steiner&&(be(e,e.next)||J(e.prev,e,e.next)===0)){if(Re(e),e=t=e.prev,e===e.next)break;r=!0}else e=e.next;while(r||e!==t);return t}function Ne(n,t,e,r,i,s,o){if(!n)return;!o&&s&&zo(n,r,i,s);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(s?Oo(n,r,i,s):Io(n)){t.push(l.i,n.i,c.i),Re(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Eo(pe(n),t),Ne(n,t,e,r,i,s,2)):o===2&&Bo(n,t,e,r,i,s):Ne(pe(n),t,e,r,i,s,1);break}}}function Io(n){const t=n.prev,e=n,r=n.next;if(J(t,e,r)>=0)return!1;const i=t.x,s=e.x,o=r.x,a=t.y,l=e.y,c=r.y,u=Math.min(i,s,o),h=Math.min(a,l,c),p=Math.max(i,s,o),d=Math.max(a,l,c);let f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&Ve(i,a,s,l,o,c,f.x,f.y)&&J(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Oo(n,t,e,r){const i=n.prev,s=n,o=n.next;if(J(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,p=o.y,d=Math.min(a,l,c),f=Math.min(u,h,p),m=Math.max(a,l,c),g=Math.max(u,h,p),M=Xn(d,f,t,e,r),P=Xn(m,g,t,e,r);let w=n.prevZ,C=n.nextZ;for(;w&&w.z>=M&&C&&C.z<=P;){if(w.x>=d&&w.x<=m&&w.y>=f&&w.y<=g&&w!==i&&w!==o&&Ve(a,u,l,h,c,p,w.x,w.y)&&J(w.prev,w,w.next)>=0||(w=w.prevZ,C.x>=d&&C.x<=m&&C.y>=f&&C.y<=g&&C!==i&&C!==o&&Ve(a,u,l,h,c,p,C.x,C.y)&&J(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;w&&w.z>=M;){if(w.x>=d&&w.x<=m&&w.y>=f&&w.y<=g&&w!==i&&w!==o&&Ve(a,u,l,h,c,p,w.x,w.y)&&J(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;C&&C.z<=P;){if(C.x>=d&&C.x<=m&&C.y>=f&&C.y<=g&&C!==i&&C!==o&&Ve(a,u,l,h,c,p,C.x,C.y)&&J(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Eo(n,t){let e=n;do{const r=e.prev,i=e.next.next;!be(r,i)&&qr(r,e,e.next,i)&&je(r,i)&&je(i,r)&&(t.push(r.i,e.i,i.i),Re(e),Re(e.next),e=n=i),e=e.next}while(e!==n);return pe(e)}function Bo(n,t,e,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&jo(o,a)){let l=Wr(o,a);o=pe(o,o.next),l=pe(l,l.next),Ne(o,t,e,r,i,s,0),Ne(l,t,e,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function Do(n,t,e,r){const i=[];for(let s=0,o=t.length;s<o;s++){const a=t[s]*r,l=s<o-1?t[s+1]*r:n.length,c=Rr(n,a,l,r,!1);c===c.next&&(c.steiner=!0),i.push(Vo(c))}i.sort(Lo);for(let s=0;s<i.length;s++)e=Fo(i[s],e);return e}function Lo(n,t){let e=n.x-t.x;if(e===0&&(e=n.y-t.y,e===0)){const r=(n.next.y-n.y)/(n.next.x-n.x),i=(t.next.y-t.y)/(t.next.x-t.x);e=r-i}return e}function Fo(n,t){const e=Uo(n,t);if(!e)return t;const r=Wr(e,n);return pe(r,r.next),pe(e,e.next)}function Uo(n,t){let e=t;const r=n.x,i=n.y;let s=-1/0,o;if(be(n,e))return e;do{if(be(n,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const h=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=r&&h>s&&(s=h,o=e.x<e.next.x?e:e.next,h===r))return o}e=e.next}while(e!==t);if(!o)return null;const a=o,l=o.x,c=o.y;let u=1/0;e=o;do{if(r>=e.x&&e.x>=l&&r!==e.x&&Gr(i<c?r:s,i,l,c,i<c?s:r,i,e.x,e.y)){const h=Math.abs(i-e.y)/(r-e.x);je(e,n)&&(h<u||h===u&&(e.x>o.x||e.x===o.x&&$o(o,e)))&&(o=e,u=h)}e=e.next}while(e!==a);return o}function $o(n,t){return J(n.prev,n,t.prev)<0&&J(t.next,n,n.next)<0}function zo(n,t,e,r){let i=n;do i.z===0&&(i.z=Xn(i.x,i.y,t,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,No(i)}function No(n){let t,e=1;do{let r=n,i;n=null;let s=null;for(t=0;r;){t++;let o=r,a=0;for(let c=0;c<e&&(a++,o=o.nextZ,!!o);c++);let l=e;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,a--):(i=o,o=o.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;r=o}s.nextZ=null,e*=2}while(t>1);return n}function Xn(n,t,e,r,i){return n=(n-e)*i|0,t=(t-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function Vo(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Gr(n,t,e,r,i,s,o,a){return(i-o)*(t-a)>=(n-o)*(s-a)&&(n-o)*(r-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(i-o)*(r-a)}function Ve(n,t,e,r,i,s,o,a){return!(n===o&&t===a)&&Gr(n,t,e,r,i,s,o,a)}function jo(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!Ro(n,t)&&(je(n,t)&&je(t,n)&&Go(n,t)&&(J(n.prev,n,t.prev)||J(n,t.prev,t))||be(n,t)&&J(n.prev,n,n.next)>0&&J(t.prev,t,t.next)>0)}function J(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function be(n,t){return n.x===t.x&&n.y===t.y}function qr(n,t,e,r){const i=cn(J(n,t,e)),s=cn(J(n,t,r)),o=cn(J(e,r,n)),a=cn(J(e,r,t));return!!(i!==s&&o!==a||i===0&&ln(n,e,t)||s===0&&ln(n,r,t)||o===0&&ln(e,n,r)||a===0&&ln(e,t,r))}function ln(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function cn(n){return n>0?1:n<0?-1:0}function Ro(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&qr(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function je(n,t){return J(n.prev,n,n.next)<0?J(n,t,n.next)>=0&&J(n,n.prev,t)>=0:J(n,t,n.prev)<0||J(n,n.next,t)<0}function Go(n,t){let e=n,r=!1;const i=(n.x+t.x)/2,s=(n.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next;while(e!==n);return r}function Wr(n,t){const e=Zn(n.i,n.x,n.y),r=Zn(t.i,t.x,t.y),i=n.next,s=t.prev;return n.next=t,t.prev=n,e.next=i,i.prev=e,r.next=e,e.prev=r,s.next=r,r.prev=s,r}function Hr(n,t,e,r){const i=Zn(n,t,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Zn(n,t,e){return{i:n,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qo(n,t,e,r){let i=0;for(let s=t,o=e-r;s<e;s+=r)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}function Wo(n,t,e,r={}){const{radius:i=1}=r;n.moveTo(t,e),n.arc(t,e,i,0,Math.PI*2)}const Ho={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Yn(n,t){const{fill:e="#000",stroke:r="none",strokeWidth:i=r==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:c=0,shadowOffsetX:u=0,shadowOffsetY:h=0,shadowBlur:p=0,shadowColor:d="rgba(0, 0, 0, 0)"}=t;n.fillStyle=e,n.strokeStyle=r,n.lineWidth=i,n.lineCap=s,n.lineJoin=Ho[o],n.miterLimit=a,n.setLineDash(l),n.lineDashOffset=c,n.shadowOffsetX=u,n.shadowOffsetY=h,n.shadowBlur=p,n.shadowColor=d}class k{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new k(1/0,1/0)}static get MIN(){return new k(-1/0,-1/0)}get array(){return[this.x,this.y]}finite(){return this.x=Number.isFinite(this.x)?this.x:0,this.y=Number.isFinite(this.y)?this.y:0,this}set(t,e){return this.x=t,this.y=e,this}add(t){return this.x+=t.x,this.y+=t.y,this}sub(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}divide(t){return this.x/=t.x,this.y/=t.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}rotate(t,e={x:0,y:0}){const r=-t/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),o=Math.sin(r),a=Math.cos(r);return this.set(e.x+(i*a-s*o),e.y-(i*o+s*a)),this}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y;return e*e+r*r}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(t,e=t,r={x:0,y:0}){const i=t<0?r.x-this.x+r.x:this.x,s=e<0?r.y-this.y+r.y:this.y;return this.x=i*Math.abs(t),this.y=s*Math.abs(e),this}skew(t,e=0,r={x:0,y:0}){const i=this.x-r.x,s=this.y-r.y;return this.x=r.x+(i+Math.tan(t)*s),this.y=r.y+(s+Math.tan(e)*i),this}min(...t){return this.x=Math.min(this.x,...t.map(e=>e.x)),this.y=Math.min(this.y,...t.map(e=>e.y)),this}max(...t){return this.x=Math.max(this.x,...t.map(e=>e.x)),this.y=Math.max(this.y,...t.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}divideVectors(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}equals(t){return this.x===t.x&&this.y===t.y}applyMatrix3(t){const e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new k(this.x,this.y)}}class X{constructor(t=0,e=0,r=0,i=0){this.left=t,this.top=e,this.width=r,this.height=i}get x(){return this.left}set x(t){this.left=t}get y(){return this.top}set y(t){this.top=t}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new k((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...t){if(t.length===0)return new X;if(t.length===1)return t[0].clone();const e=t[0],r=t.slice(1).reduce((i,s)=>(i.left=Math.min(i.left,s.left),i.top=Math.min(i.top,s.top),i.right=Math.max(i.right,s.right),i.bottom=Math.max(i.bottom,s.bottom),i),{left:e?.left??0,top:e?.top??0,right:e?.right??0,bottom:e?.bottom??0});return new X(r.left,r.top,r.right-r.left,r.bottom-r.top)}translate(t,e){return this.left+=t,this.top+=e,this}copy(t){return this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height,this}clone(){return new X(this.left,this.top,this.width,this.height)}}class Ct{elements=[];constructor(t=1,e=0,r=0,i=0,s=1,o=0,a=0,l=0,c=1){this.set(t,e,r,i,s,o,a,l,c)}set(t,e,r,i,s,o,a,l,c){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=s,u[5]=l,u[6]=r,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const r=t.elements,i=e.elements,s=this.elements,o=r[0],a=r[3],l=r[6],c=r[1],u=r[4],h=r[7],p=r[2],d=r[5],f=r[8],m=i[0],g=i[3],M=i[6],P=i[1],w=i[4],C=i[7],v=i[2],x=i[5],S=i[8];return s[0]=o*m+a*P+l*v,s[3]=o*g+a*w+l*x,s[6]=o*M+a*C+l*S,s[1]=c*m+u*P+h*v,s[4]=c*g+u*w+h*x,s[7]=c*M+u*C+h*S,s[2]=p*m+d*P+f*v,s[5]=p*g+d*w+f*x,s[8]=p*M+d*C+f*S,this}invert(){const t=this.elements,e=t[0],r=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*o-a*c,p=a*l-u*s,d=c*s-o*l,f=e*h+r*p+i*d;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/f;return t[0]=h*m,t[1]=(i*c-u*r)*m,t[2]=(a*r-i*o)*m,t[3]=p*m,t[4]=(u*e-i*l)*m,t[5]=(i*s-a*e)*m,t[6]=d*m,t[7]=(r*l-c*e)*m,t[8]=(o*e-r*s)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}scale(t,e){return this.premultiply(Kn.makeScale(t,e)),this}rotate(t){return this.premultiply(Kn.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kn.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Kn=new Ct;function Xr(n,t,e,r){const i=n*e+t*r,s=Math.sqrt(n*n+t*t)*Math.sqrt(e*e+r*r);let o=Math.acos(Math.max(-1,Math.min(1,i/s)));return n*r-t*e<0&&(o=-o),o}function Xo(n,t,e,r,i,s,o,a){if(t===0||e===0){n.lineTo(a.x,a.y);return}r=r*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const l=(o.x-a.x)/2,c=(o.y-a.y)/2,u=Math.cos(r)*l+Math.sin(r)*c,h=-Math.sin(r)*l+Math.cos(r)*c;let p=t*t,d=e*e;const f=u*u,m=h*h,g=f/p+m/d;if(g>1){const N=Math.sqrt(g);t=N*t,e=N*e,p=t*t,d=e*e}const M=p*m+d*f,P=(p*d-M)/M;let w=Math.sqrt(Math.max(0,P));i===s&&(w=-w);const C=w*t*h/e,v=-w*e*u/t,x=Math.cos(r)*C-Math.sin(r)*v+(o.x+a.x)/2,S=Math.sin(r)*C+Math.cos(r)*v+(o.y+a.y)/2,b=Xr(1,0,(u-C)/t,(h-v)/e),D=Xr((u-C)/t,(h-v)/e,(-u-C)/t,(-h-v)/e)%(Math.PI*2);n.ellipse(x,S,t,e,r,b,b+D,s===0)}const it={WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Wt(n,t,e=0){let a=0,l=!0,c="",u="";const h=[];function p(g,M,P){const w=new SyntaxError(`Unexpected character "${g}" at index ${M}.`);throw w.partial=P,w}function d(){c!==""&&(u===""?h.push(Number(c)):h.push(Number(c)*10**Number(u))),c="",u=""}let f;const m=n.length;for(let g=0;g<m;g++){if(f=n[g],Array.isArray(t)&&t.includes(h.length%e)&&it.FLAGS.test(f)){a=1,c=f,d();continue}if(a===0){if(it.WHITESPACE.test(f))continue;if(it.DIGIT.test(f)||it.SIGN.test(f)){a=1,c=f;continue}if(it.POINT.test(f)){a=2,c=f;continue}it.COMMA.test(f)&&(l&&p(f,g,h),l=!0)}if(a===1){if(it.DIGIT.test(f)){c+=f;continue}if(it.POINT.test(f)){c+=f,a=2;continue}if(it.EXP.test(f)){a=3;continue}it.SIGN.test(f)&&c.length===1&&it.SIGN.test(c[0])&&p(f,g,h)}if(a===2){if(it.DIGIT.test(f)){c+=f;continue}if(it.EXP.test(f)){a=3;continue}it.POINT.test(f)&&c[c.length-1]==="."&&p(f,g,h)}if(a===3){if(it.DIGIT.test(f)){u+=f;continue}if(it.SIGN.test(f)){if(u===""){u+=f;continue}u.length===1&&it.SIGN.test(u)&&p(f,g,h)}}it.WHITESPACE.test(f)?(d(),a=0,l=!1):it.COMMA.test(f)?(d(),a=0,l=!0):it.SIGN.test(f)?(d(),a=1,c=f):it.POINT.test(f)?(d(),a=2,c=f):p(f,g,h)}return d(),h}function Se(n,t){return n-(t-n)}function Zr(n,t){const e=new k,r=new k;for(let i=0,s=n.length;i<s;i++){const o=n[i];if(o.type==="m"||o.type==="M")o.type==="m"?e.add(o):e.copy(o),t.moveTo(e.x,e.y),r.copy(e);else if(o.type==="h"||o.type==="H")o.type==="h"?e.x+=o.x:e.x=o.x,t.lineTo(e.x,e.y),r.copy(e);else if(o.type==="v"||o.type==="V")o.type==="v"?e.y+=o.y:e.y=o.y,t.lineTo(e.x,e.y),r.copy(e);else if(o.type==="l"||o.type==="L")o.type==="l"?e.add(o):e.copy(o),t.lineTo(e.x,e.y),r.copy(e);else if(o.type==="c"||o.type==="C")o.type==="c"?(t.bezierCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),r.x=e.x+o.x2,r.y=e.y+o.y2,e.add(o)):(t.bezierCurveTo(o.x1,o.y1,o.x2,o.y2,o.x,o.y),r.x=o.x2,r.y=o.y2,e.copy(o));else if(o.type==="s"||o.type==="S")o.type==="s"?(t.bezierCurveTo(Se(e.x,r.x),Se(e.y,r.y),e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),r.x=e.x+o.x2,r.y=e.y+o.y2,e.add(o)):(t.bezierCurveTo(Se(e.x,r.x),Se(e.y,r.y),o.x2,o.y2,o.x,o.y),r.x=o.x2,r.y=o.y2,e.copy(o));else if(o.type==="q"||o.type==="Q")o.type==="q"?(t.quadraticCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x,e.y+o.y),r.x=e.x+o.x1,r.y=e.y+o.y1,e.add(o)):(t.quadraticCurveTo(o.x1,o.y1,o.x,o.y),r.x=o.x1,r.y=o.y1,e.copy(o));else if(o.type==="t"||o.type==="T"){const a=Se(e.x,r.x),l=Se(e.y,r.y);r.x=a,r.y=l,o.type==="t"?(t.quadraticCurveTo(a,l,e.x+o.x,e.y+o.y),e.add(o)):(t.quadraticCurveTo(a,l,o.x,o.y),e.copy(o))}else if(o.type==="a"||o.type==="A"){const a=e.clone();if(o.type==="a"){if(o.x===0&&o.y===0)continue;e.add(o)}else{if(e.equals(o))continue;e.copy(o)}r.copy(e),Xo(t,o.rx,o.ry,o.angle,o.largeArcFlag,o.sweepFlag,a,e)}else o.type==="z"||o.type==="Z"?(t.startPoint&&e.copy(t.startPoint),t.closePath()):console.warn("Unsupported commands",o)}}function Zo(n){let t,e;const r=[];for(let i=0,s=n.length;i<s;i++){const o=n[i];switch(o.type){case"m":case"M":if(o.x.toFixed(4)===e?.x.toFixed(4)&&o.y.toFixed(4)===e?.y.toFixed(4))continue;r.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y},t={x:o.x,y:o.y};break;case"h":case"H":r.push(`${o.type} ${o.x}`),e={x:o.x,y:e?.y??0};break;case"v":case"V":r.push(`${o.type} ${o.y}`),e={x:e?.x??0,y:o.y};break;case"l":case"L":r.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"c":case"C":r.push(`${o.type} ${o.x1} ${o.y1} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"s":case"S":r.push(`${o.type} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"q":case"Q":r.push(`${o.type} ${o.x1} ${o.y1} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"t":case"T":r.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"a":case"A":r.push(`${o.type} ${o.rx} ${o.ry} ${o.angle} ${o.largeArcFlag} ${o.sweepFlag} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"z":case"Z":r.push(o.type),t&&(e={x:t.x,y:t.y});break}}return r.join(" ")}const Yo=/[a-df-z][^a-df-z]*/gi;function Yr(n){const t=[],e=n.match(Yo);if(!e)return t;for(let r=0,i=e.length;r<i;r++){const s=e[r],o=s.charAt(0),a=s.slice(1).trim();let l;switch(o){case"m":case"M":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)c===0?t.push({type:o,x:l[c],y:l[c+1]}):t.push({type:o==="m"?"l":"L",x:l[c],y:l[c+1]});break;case"h":case"H":l=Wt(a);for(let c=0,u=l.length;c<u;c++)t.push({type:o,x:l[c]});break;case"v":case"V":l=Wt(a);for(let c=0,u=l.length;c<u;c++)t.push({type:o,y:l[c]});break;case"l":case"L":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)t.push({type:o,x:l[c],y:l[c+1]});break;case"c":case"C":l=Wt(a);for(let c=0,u=l.length;c<u;c+=6)t.push({type:o,x1:l[c],y1:l[c+1],x2:l[c+2],y2:l[c+3],x:l[c+4],y:l[c+5]});break;case"s":case"S":l=Wt(a);for(let c=0,u=l.length;c<u;c+=4)t.push({type:o,x2:l[c],y2:l[c+1],x:l[c+2],y:l[c+3]});break;case"q":case"Q":l=Wt(a);for(let c=0,u=l.length;c<u;c+=4)t.push({type:o,x1:l[c],y1:l[c+1],x:l[c+2],y:l[c+3]});break;case"t":case"T":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)t.push({type:o,x:l[c],y:l[c+1]});break;case"a":case"A":l=Wt(a,[3,4],7);for(let c=0,u=l.length;c<u;c+=7)t.push({type:o,rx:l[c],ry:l[c+1],angle:l[c+2],largeArcFlag:l[c+3],sweepFlag:l[c+4],x:l[c+5],y:l[c+6]});break;case"z":case"Z":t.push({type:o});break;default:console.warn(s)}}return t}const Kr="data:image/svg+xml;",Qr=`${Kr}base64,`,Jr=`${Kr}charset=utf8,`;function ti(n){if(typeof n=="string"){let t;n.startsWith(Qr)?(n=n.substring(Qr.length,n.length),t=atob(n)):n.startsWith(Jr)?(n=n.substring(Jr.length,n.length),t=decodeURIComponent(n)):t=n;const e=new DOMParser().parseFromString(t,"text/xml"),r=e.querySelector("parsererror");if(r)throw new Error(`${r.textContent??"parser error"}
5
- ${t}`);return e.documentElement}else return n}const Ko="px",Qo=90,ei=["mm","cm","in","pt","pc","px"],ni={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function Y(n){let t="px";if(typeof n=="string")for(let r=0,i=ei.length;r<i;r++){const s=ei[r];if(n.endsWith(s)){t=s,n=n.substring(0,n.length-s.length);break}}let e;return e=ni[t][Ko],e<0&&(e=ni[t].in*Qo),e*Number.parseFloat(n)}const Jo=new Ct,hn=new Ct,ri=new Ct,ii=new Ct;function ta(n,t,e){if(!(n.hasAttribute("transform")||n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))))return null;const r=ea(n);return e.length>0&&r.premultiply(e[e.length-1]),t.copy(r),e.push(r),r}function ea(n){const t=new Ct,e=Jo;if(n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))&&t.translate(Y(n.getAttribute("x")),Y(n.getAttribute("y"))),n.hasAttribute("transform")){const r=n.getAttribute("transform").split(")");for(let i=r.length-1;i>=0;i--){const s=r[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),c=Wt(s.slice(o+1));switch(e.identity(),l){case"translate":if(c.length>=1){const u=c[0];let h=0;c.length>=2&&(h=c[1]),e.translate(u,h)}break;case"rotate":if(c.length>=1){let u=0,h=0,p=0;u=c[0]*Math.PI/180,c.length>=3&&(h=c[1],p=c[2]),hn.makeTranslation(-h,-p),ri.makeRotation(u),ii.multiplyMatrices(ri,hn),hn.makeTranslation(h,p),e.multiplyMatrices(hn,ii)}break;case"scale":c.length>=1&&e.scale(c[0],c[1]??c[0]);break;case"skewX":c.length===1&&e.set(1,Math.tan(c[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":c.length===1&&e.set(1,0,0,Math.tan(c[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":c.length===6&&e.set(c[0],c[2],c[4],c[1],c[3],c[5],0,0,1);break}}t.premultiply(e)}}return t}function na(n){return new Tt().arc(Y(n.getAttribute("cx")||0),Y(n.getAttribute("cy")||0),Y(n.getAttribute("r")||0),0,Math.PI*2)}function ra(n,t){if(!(!n.sheet||!n.sheet.cssRules||!n.sheet.cssRules.length))for(let e=0;e<n.sheet.cssRules.length;e++){const r=n.sheet.cssRules[e];if(r.type!==1)continue;const i=r.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=r.style.length,a=0;a<o;a++){const l=r.style.item(a);s[l]=r.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)t[i[o]]=Object.assign(t[i[o]]||{},{...s})}}function ia(n){return new Tt().ellipse(Y(n.getAttribute("cx")||0),Y(n.getAttribute("cy")||0),Y(n.getAttribute("rx")||0),Y(n.getAttribute("ry")||0),0,0,Math.PI*2)}function sa(n){return new Tt().moveTo(Y(n.getAttribute("x1")||0),Y(n.getAttribute("y1")||0)).lineTo(Y(n.getAttribute("x2")||0),Y(n.getAttribute("y2")||0))}function oa(n){const t=new Tt,e=n.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const aa=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function la(n){const t=new Tt;let e=0;return n.getAttribute("points")?.replace(aa,(r,i,s)=>{const o=Y(i),a=Y(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,r}),t.currentCurve.autoClose=!0,t}const ca=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function ha(n){const t=new Tt;let e=0;return n.getAttribute("points")?.replace(ca,(r,i,s)=>{const o=Y(i),a=Y(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,r}),t.currentCurve.autoClose=!1,t}function ua(n){const t=Y(n.getAttribute("x")||0),e=Y(n.getAttribute("y")||0),r=Y(n.getAttribute("rx")||n.getAttribute("ry")||0),i=Y(n.getAttribute("ry")||n.getAttribute("rx")||0),s=Y(n.getAttribute("width")),o=Y(n.getAttribute("height")),a=1-.551915024494,l=new Tt;return l.moveTo(t+r,e),l.lineTo(t+s-r,e),(r!==0||i!==0)&&l.bezierCurveTo(t+s-r*a,e,t+s,e+i*a,t+s,e+i),l.lineTo(t+s,e+o-i),(r!==0||i!==0)&&l.bezierCurveTo(t+s,e+o-i*a,t+s-r*a,e+o,t+s-r,e+o),l.lineTo(t+r,e+o),(r!==0||i!==0)&&l.bezierCurveTo(t+r*a,e+o,t,e+o-i*a,t,e+o-i),l.lineTo(t,e+i),(r!==0||i!==0)&&l.bezierCurveTo(t,e+i*a,t+r*a,e,t+r,e),l}function Ht(n,t,e){t=Object.assign({},t);let r={};if(n.hasAttribute("class")){const c=n.getAttribute("class").split(/\s/).filter(Boolean).map(u=>u.trim());for(let u=0;u<c.length;u++)r=Object.assign(r,e[`.${c[u]}`])}n.hasAttribute("id")&&(r=Object.assign(r,e[`#${n.getAttribute("id")}`]));for(let c=n.style.length,u=0;u<c;u++){const h=n.style.item(u),p=n.style.getPropertyValue(h);t[h]=p,r[h]=p}function i(c,u,h=s){n.hasAttribute(c)&&(t[u]=h(n.getAttribute(c))),r[c]&&(t[u]=h(r[c]))}function s(c){return c.startsWith("url")&&console.warn("url access in attributes is not implemented."),c}function o(c){return Math.max(0,Math.min(1,Y(c)))}function a(c){return Math.max(0,Y(c))}function l(c){return c.split(" ").filter(u=>u!=="").map(u=>Y(u))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",Y),i("visibility","visibility"),t}function Qn(n,t,e=[],r={}){if(n.nodeType!==1)return e;let i=!1,s=null,o={...t};switch(n.nodeName){case"svg":o=Ht(n,o,r);break;case"style":ra(n,r);break;case"g":o=Ht(n,o,r);break;case"path":o=Ht(n,o,r),n.hasAttribute("d")&&(s=oa(n));break;case"rect":o=Ht(n,o,r),s=ua(n);break;case"polygon":o=Ht(n,o,r),s=la(n);break;case"polyline":o=Ht(n,o,r),s=ha(n);break;case"circle":o=Ht(n,o,r),s=na(n);break;case"ellipse":o=Ht(n,o,r),s=ia(n);break;case"line":o=Ht(n,o,r),s=sa(n);break;case"defs":i=!0;break;case"use":{o=Ht(n,o,r);const p=(n.getAttributeNS("http://www.w3.org/1999/xlink","href")||n.getAttribute("href")||"").substring(1),d=n.viewportElement?.getElementById(p);d?Qn(d,o,e,r):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(n);break}if(o.display==="none")return e;const a=new Ct,l=[],c=ta(n,a,l);s&&(s.applyTransform(a),e.push(s),s.style={...o});const u=n.childNodes;for(let h=0,p=u.length;h<p;h++){const d=u[h];i&&d.nodeName!=="style"&&d.nodeName!=="defs"||Qn(d,o,e,r)}return c&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function si(n){const t=ti(n);return new se(Qn(t,{}),t.getAttribute("viewBox")?.trim().split(" ").map(e=>Number(e)))}function oi(n,t,e,r,i){const s=(r-t)*.5,o=(i-e)*.5,a=n*n,l=n*a;return(2*e-2*r+s+o)*l+(-3*e+3*r-2*s-o)*a+s*n+e}function fa(n,t){const e=1-n;return e*e*e*t}function pa(n,t){const e=1-n;return 3*e*e*n*t}function da(n,t){return 3*(1-n)*n*n*t}function ga(n,t){return n*n*n*t}function ai(n,t,e,r,i){return fa(n,t)+pa(n,e)+da(n,r)+ga(n,i)}function li(n,t={}){let{vertices:e=[],indices:r=[],holes:i=[],verticesStride:s=2,verticesOffset:o=e.length/s,indicesOffset:a=r.length}=t;const l=Ao(n,i,2);if(l.length){for(let u=0;u<l.length;u+=3)r[a++]=l[u]+o,r[a++]=l[u+1]+o,r[a++]=l[u+2]+o;let c=o*s;for(let u=0;u<n.length;u+=2)e[c]=n[u],e[c+1]=n[u+1],c+=s}return{vertices:e,indices:r}}const ya=8,un=11920929e-14,ma=1;function xa(n,t,e,r,i,s,o,a,l=.5,c=[]){const h=Math.min(.99,Math.max(0,l));let p=(ma-h)/1;return p*=p,Jn(n,t,e,r,i,s,o,a,c,p,0),c.push(o,a),c}function Jn(n,t,e,r,i,s,o,a,l,c,u){if(u>ya)return;const h=(n+e)/2,p=(t+r)/2,d=(e+i)/2,f=(r+s)/2,m=(i+o)/2,g=(s+a)/2,M=(h+d)/2,P=(p+f)/2,w=(d+m)/2,C=(f+g)/2,v=(M+w)/2,x=(P+C)/2;if(u>0){let S=o-n,b=a-t;const D=Math.abs((e-o)*b-(r-a)*S),N=Math.abs((i-o)*b-(s-a)*S);if(D>un&&N>un){if((D+N)*(D+N)<=c*(S*S+b*b)){l.push(v,x);return}}else if(D>un){if(D*D<=c*(S*S+b*b)){l.push(v,x);return}}else if(N>un){if(N*N<=c*(S*S+b*b)){l.push(v,x);return}}else if(S=v-(n+o)/2,b=x-(t+a)/2,S*S+b*b<=c){l.push(v,x);return}}Jn(n,t,h,p,M,P,v,x,l,c,u+1),Jn(v,x,w,C,m,g,o,a,l,c,u+1)}const va=8,wa=11920929e-14,ba=1;function Sa(n,t,e,r,i,s,o=.5,a=[]){const c=Math.min(.99,Math.max(0,o));let u=(ba-c)/1;return u*=u,tr(a,n,t,e,r,i,s,u,0),a.push(i,s),a}function tr(n,t,e,r,i,s,o,a,l){if(l>va)return;const c=(t+r)/2,u=(e+i)/2,h=(r+s)/2,p=(i+o)/2,d=(c+h)/2,f=(u+p)/2;let m=s-t,g=o-e;const M=Math.abs((r-s)*g-(i-o)*m);if(M>wa){if(M*M<=a*(m*m+g*g)){n.push(d,f);return}}else if(m=d-(t+s)/2,g=f-(e+o)/2,m*m+g*g<=a){n.push(d,f);return}tr(n,t,e,c,u,d,f,a,l+1),tr(n,d,f,h,p,s,o,a,l+1)}function Ca(n){return n.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Ma(n,t,e,r){const i=t.clone().sub(n),s=r.clone().sub(e),o=e.clone().sub(n),a=i.cross(s);if(a===0)return new k((n.x+e.x)/2,(n.y+e.y)/2);const l=o.cross(s)/a;return Math.abs(l)>1?new k((n.x+e.x)/2,(n.y+e.y)/2):new k(n.x+l*i.x,n.y+l*i.y)}function Pa(n){const t=n.length;let e=0,r=0;const i=t/2;for(let s=0;s<t;s+=2)e+=n[s],r+=n[s+1];return[e/i,r/i]}function Ta(n){let t=0;const e=n.length/2;for(let r=0;r<e;r++){const i=n[2*r],s=n[2*r+1],o=(r+1)%e,a=n[2*o],l=n[2*o+1];t+=(a-i)*(l+s)}return t}function ci(n,t,e,r,i,s){return(e-n)*(s-t)-(i-n)*(r-t)}function _a(n,t,e){const r=e.length;let i=0;for(let s=0,o=r-2;s<r;o=s,s+=2){const a=e[s],l=e[s+1],c=e[o],u=e[o+1];l<=t?u>t&&ci(c,u,a,l,n,t)>0&&i++:u<=t&&ci(c,u,a,l,n,t)<0&&i--}return i}function ka(n){const t=n.length,e=n.map((r,i)=>({index:i,parentIndex:null,wn:0}));for(let r=0;r<t;r++){let i=null;if(Ta(n[r])<0)continue;const s=[...Pa(n[r])];for(let o=0;o<t;o++){if(r===o)continue;let a=0;for(let c=0;c<s.length&&(a=a||_a(s[c],s[c+1],n[o]),!a);c+=2);const l=Math.abs(a);l!==0&&(!i||l>Math.abs(i.wn))&&(i={idx:o,wn:a})}i&&(e[r].parentIndex=i.idx,e[r].wn=i.wn)}return e}function Aa(n,t){const e=1-n;return e*e*t}function Ia(n,t){return 2*(1-n)*n*t}function Oa(n,t){return n*n*t}function hi(n,t,e,r){return Aa(n,t)+Ia(n,e)+Oa(n,r)}const Ea=1e-4,ui=1e-4;function Ba(n,t={}){const{vertices:e=[],indices:r=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:o=!0}=t,a=Ea;if(n.length===0)return{vertices:e,indices:r};const l=i;let c=l.alignment;if(i.alignment!==.5){let O=Da(n);s&&(O*=-1),c=(c-.5)*O+.5}const u={x:n[0],y:n[1]},h={x:n[n.length-2],y:n[n.length-1]},p=o,d=Math.abs(u.x-h.x)<a&&Math.abs(u.y-h.y)<a;if(p){n=n.slice(),d&&(n.pop(),n.pop(),h.x=n[n.length-2],h.y=n[n.length-1]);const O=(u.x+h.x)*.5,V=(h.y+u.y)*.5;n.unshift(O,V),n.push(O,V)}const f=e,m=n.length/2;let g=n.length;const M=f.length/2,P=l.width/2,w=P*P,C=l.miterLimit*l.miterLimit;let v=n[0],x=n[1],S=n[2],b=n[3],D=0,N=0,E=-(x-b),L=v-S,z=0,B=0,A=Math.sqrt(E*E+L*L);E/=A,L/=A,E*=P,L*=P;const W=c,I=(1-W)*2,U=W*2;p||(l.cap==="round"?g+=de(v-E*(I-U)*.5,x-L*(I-U)*.5,v-E*I,x-L*I,v+E*U,x+L*U,f,!0)+2:l.cap==="square"&&(g+=fi(v,x,E,L,I,U,!0,f))),f.push(v-E*I,x-L*I),f.push(v+E*U,x+L*U);for(let O=1;O<m-1;++O){v=n[(O-1)*2],x=n[(O-1)*2+1],S=n[O*2],b=n[O*2+1],D=n[(O+1)*2],N=n[(O+1)*2+1],E=-(x-b),L=v-S,A=Math.sqrt(E*E+L*L),E/=A,L/=A,E*=P,L*=P,z=-(b-N),B=S-D,A=Math.sqrt(z*z+B*B),z/=A,B/=A,z*=P,B*=P;const V=S-v,_=x-b,T=S-D,F=N-b,$=V*T+_*F,q=_*T-F*V,Z=q<0;if(Math.abs(q)<.001*Math.abs($)){f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),$>=0&&(l.join==="round"?g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+4:g+=2,f.push(S-z*U,b-B*U),f.push(S+z*I,b+B*I));continue}const nt=(-E+v)*(-L+b)-(-E+S)*(-L+x),Zt=(-z+D)*(-B+b)-(-z+S)*(-B+N),Dt=(V*Zt-T*nt)/q,Mt=(F*nt-_*Zt)/q,_t=(Dt-S)*(Dt-S)+(Mt-b)*(Mt-b),ht=S+(Dt-S)*I,kt=b+(Mt-b)*I,Vt=S-(Dt-S)*U,jt=b-(Mt-b)*U,Lt=Math.min(V*V+_*_,T*T+F*F),Zi=Z?I:U,Zl=Lt+Zi*Zi*w;_t<=Zl?l.join==="bevel"||_t/w>C?(Z?(f.push(ht,kt),f.push(S+E*U,b+L*U),f.push(ht,kt),f.push(S+z*U,b+B*U)):(f.push(S-E*I,b-L*I),f.push(Vt,jt),f.push(S-z*I,b-B*I),f.push(Vt,jt)),g+=2):l.join==="round"?Z?(f.push(ht,kt),f.push(S+E*U,b+L*U),g+=de(S,b,S+E*U,b+L*U,S+z*U,b+B*U,f,!0)+4,f.push(ht,kt),f.push(S+z*U,b+B*U)):(f.push(S-E*I,b-L*I),f.push(Vt,jt),g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+4,f.push(S-z*I,b-B*I),f.push(Vt,jt)):(f.push(ht,kt),f.push(Vt,jt)):(f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),l.join==="round"?Z?g+=de(S,b,S+E*U,b+L*U,S+z*U,b+B*U,f,!0)+2:g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+2:l.join==="miter"&&_t/w<=C&&(Z?(f.push(Vt,jt),f.push(Vt,jt)):(f.push(ht,kt),f.push(ht,kt)),g+=2),f.push(S-z*I,b-B*I),f.push(S+z*U,b+B*U),g+=2)}v=n[(m-2)*2],x=n[(m-2)*2+1],S=n[(m-1)*2],b=n[(m-1)*2+1],E=-(x-b),L=v-S,A=Math.sqrt(E*E+L*L),E/=A,L/=A,E*=P,L*=P,f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),p||(l.cap==="round"?g+=de(S-E*(I-U)*.5,b-L*(I-U)*.5,S-E*I,b-L*I,S+E*U,b+L*U,f,!1)+2:l.cap==="square"&&(g+=fi(S,b,E,L,I,U,!1,f)));const j=ui*ui;for(let O=M;O<g+M-2;++O)v=f[O*2],x=f[O*2+1],S=f[(O+1)*2],b=f[(O+1)*2+1],D=f[(O+2)*2],N=f[(O+2)*2+1],!(Math.abs(v*(b-N)+S*(N-x)+D*(x-b))<j)&&r.push(O,O+1,O+2);return{vertices:e,indices:r}}function Da(n){const t=n.length;if(t<6)return 1;let e=0;for(let r=0,i=n[t-2],s=n[t-1];r<t;r+=2){const o=n[r],a=n[r+1];e+=(o-i)*(a+s),i=o,s=a}return e<0?-1:1}function fi(n,t,e,r,i,s,o,a){const l=n-e*i,c=t-r*i,u=n+e*s,h=t+r*s;let p,d;o?(p=r,d=-e):(p=-r,d=e);const f=l+p,m=c+d,g=u+p,M=h+d;return a.push(f,m),a.push(g,M),2}function de(n,t,e,r,i,s,o,a){const l=e-n,c=r-t;let u=Math.atan2(l,c),h=Math.atan2(i-n,s-t);a&&u<h?u+=Math.PI*2:!a&&u>h&&(h+=Math.PI*2);let p=u;const d=h-u,f=Math.abs(d),m=Math.sqrt(l*l+c*c),g=(15*f*Math.sqrt(m)/Math.PI>>0)+1,M=d/g;if(p+=M,a){o.push(n,t),o.push(e,r);for(let P=1,w=p;P<g;P++,w+=M)o.push(n,t),o.push(n+Math.sin(w)*m,t+Math.cos(w)*m);o.push(n,t),o.push(i,s)}else{o.push(e,r),o.push(n,t);for(let P=1,w=p;P<g;P++,w+=M)o.push(n+Math.sin(w)*m,t+Math.cos(w)*m),o.push(n,t);o.push(i,s),o.push(n,t)}return g*2}class Ce{arcLengthDivision=200;_arcLengths;getPointAt(t,e=new k){return this.getPoint(this.getUToTMapping(t),e)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(t){const e=typeof t=="function";return this.getControlPointRefs().forEach(r=>{e?t(r):r.applyMatrix3(t)}),this}getUnevenVertices(t=5,e=[]){const r=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPoint(i/s,r),e.push(r.x,r.y);return e}getSpacedVertices(t=5,e=[]){const r=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPointAt(i/s,r),e.push(r.x,r.y);return e}getAdaptiveVertices(t=[]){return this.getUnevenVertices(5,t)}_verticesToPoints(t,e=[]){for(let r=0,i=t.length;r<i;r+=2){const s=t[r],o=t[r+1];e.push(new k(s,o))}return e}getSpacedPoints(t,e=[]){const r=this.getSpacedVertices(t);return this._verticesToPoints(r,e),e}getUnevenPoints(t,e=[]){const r=this.getUnevenVertices(t);return this._verticesToPoints(r,e),e}getAdaptivePoints(t=[]){const e=this.getAdaptiveVertices();return this._verticesToPoints(e,t),t}getPoints(t,e=[]){let r;return t?r=this.getUnevenVertices(t):r=this.getAdaptiveVertices(),this._verticesToPoints(r,e),e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const t=this.arcLengthDivision,e=[0];for(let r=0,i=this.getPoint(0),s=1;s<=t;s++){const o=this.getPoint(s/t);r+=o.distanceTo(i),e.push(r),i=o}this._arcLengths=e}getUToTMapping(t,e){const r=this.getLengths(),i=r.length,s=e??t*r[i-1];if(i<2)return s/r[0];let o=0,a=0,l=i-1,c;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),c=r[o]-s,c<0)a=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=l,r[o]===s)return o/(i-1);const u=r[o],p=r[o+1]-u,d=(s-u)/p;return(o+d)/(i-1)}getTangent(t,e=new k){const i=Math.max(0,t-1e-4),s=Math.min(1,t+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new k){return this.getTangent(t,e),e.set(-e.y,e.x).normalize()}getNormalAt(t,e){return this.getNormal(this.getUToTMapping(t),e)}getTForPoint(t,e=.001){let r=0,i=1,s=(r+i)/2;for(;i-r>e;){s=(r+i)/2;const o=this.getPoint(s);if(o.distanceTo(t)<e)return s;o.x<t.x?r=s:i=s}return s}getMinMax(t=k.MAX,e=k.MIN){const r=this.getPoints();for(let i=0,s=r.length;i<s;i++){const o=r[i];t.min(o),e.max(o)}return{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new X(t.x,t.y,e.x-t.x,e.y-t.y)}getFillVertices(t){return this.getAdaptiveVertices()}fillTriangulate(t){return li(this.getFillVertices(t),t)}strokeTriangulate(t){return Ba(this.getAdaptiveVertices(),t)}toCommands(){const t=[],e=this.getPoints();for(let r=0,i=e.length;r<i;r++){const s=e[r];r===0?t.push({type:"M",x:s.x,y:s.y}):t.push({type:"L",x:s.x,y:s.y})}return t}toData(){return Zo(this.toCommands())}drawTo(t){return this.toCommands().forEach(e=>{switch(e.type){case"M":t.moveTo(e.x,e.y);break;case"L":t.lineTo(e.x,e.y);break}}),this}copy(t){return this.arcLengthDivision=t.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const La=new Ct,pi=new Ct,di=new Ct,fn=new k;class er extends Ce{constructor(t=new k,e=new k,r=new k,i=0,s=0,o=Math.PI*2,a=!1){super(),this._center=t,this._radius=e,this._diff=r,this.rotate=i,this.startAngle=s,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(t){this._center.x=t}get cy(){return this._center.y}set cy(t){this._center.y=t}get rx(){return this._radius.x}set rx(t){this._radius.x=t}get ry(){return this._radius.y}set ry(t){this._radius.y=t}get dx(){return this._diff.x}set dx(t){this._diff.x=t}get dy(){return this._diff.y}set dy(t){this._diff.y=t}isClockwise(){return this.clockwise}_getDeltaAngle(){const t=Math.PI*2;let e=this.endAngle-this.startAngle;const r=Math.abs(e)<Number.EPSILON;return e=(e%t+t)%t,r?e=0:this.clockwise||(e=e===0?-t:e-t),e}getPoint(t,e=new k){const r=this._getDeltaAngle(),i=this.startAngle+t*r;let s=this.cx+this.rx*Math.cos(i),o=this.cy+this.ry*Math.sin(i);if(this.rotate!==0){const a=Math.cos(this.rotate),l=Math.sin(this.rotate),c=s-this.cx,u=o-this.cy;s=c*a-u*l+this.cx,o=c*l+u*a+this.cy}return e.set(s,o)}toCommands(){const{cx:t,cy:e,rx:r,ry:i,startAngle:s,endAngle:o,clockwise:a,rotate:l}=this,c=t+r*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),u=e+r*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l),h=Math.abs(s-o),p=h>Math.PI?1:0,d=a?1:0,f=l*180/Math.PI;if(h>=2*Math.PI){const m=s+Math.PI,g=t+r*Math.cos(m)*Math.cos(l)-i*Math.sin(m)*Math.sin(l),M=e+r*Math.cos(m)*Math.sin(l)+i*Math.sin(m)*Math.cos(l);return[{type:"M",x:c,y:u},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:g,y:M},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:c,y:u}]}else{const m=t+r*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),g=e+r*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:c,y:u},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:p,sweepFlag:d,x:m,y:g}]}}drawTo(t){const{cx:e,cy:r,rx:i,ry:s,rotate:o,startAngle:a,endAngle:l,clockwise:c}=this;return t.ellipse(e,r,i,s,o,a,l,!c),this}applyTransform(t){return fn.set(this.cx,this.cy),fn.applyMatrix3(t),this.cx=fn.x,this.cy=fn.y,$a(t)?Fa(this,t):Ua(this,t),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(t=[]){const{cx:e,cy:r,rx:i,ry:s,dx:o,dy:a,startAngle:l,endAngle:c,clockwise:u,rotate:h}=this,p=!u;let d=Math.abs(l-c);(!p&&l>c||p&&c>l)&&(d=2*Math.PI-d);const f=Math.max(12,Math.floor(12*i**(1/3)*(d/Math.PI)));let m=d/f,g=l;m*=p?-1:1;const M=Math.cos(p?h:-h),P=Math.sin(p?h:-h);for(let w=0;w<f+1;w++){const C=o+Math.cos(g)*i,v=a+Math.sin(g)*s,x=C*M-v*P,S=C*P+v*M;t.push(e+x,r+S),g+=m}return t}_getAdaptiveVerticesByCircle(t=[]){const{cx:e,cy:r,rx:i,ry:s,dx:o,dy:a,rotate:l,clockwise:c}=this;if(!(i>=0&&s>=0&&o>=0&&a>=0))return t;const u=Math.ceil(2.3*Math.sqrt(i+s)),h=u*8+(o?4:0)+(a?4:0),p=[];if(h===0)return t;{const m=p.length;if(u===0)p[m]=p[m+6]=e+o,p[m+1]=p[m+3]=r+a,p[m+2]=p[m+4]=e-o,p[m+5]=p[m+7]=r-a;else{let g=m,M=m+u*4+(o?2:0)+2,P=M,w=h,C=o+i,v=a,x=e+C,S=e-C,b=r+v;if(p[g++]=x,p[g++]=b,p[--M]=b,p[--M]=S,a){const N=r-v;p[P++]=S,p[P++]=N,p[--w]=N,p[--w]=x}for(let N=1;N<u;N++){const E=Math.PI/2*(N/u),L=o+Math.cos(E)*i,z=a+Math.sin(E)*s,B=e+L,A=e-L,W=r+z,I=r-z;p[g++]=B,p[g++]=W,p[--M]=W,p[--M]=A,p[P++]=A,p[P++]=I,p[--w]=I,p[--w]=B}C=o,v=a+s,x=e+C,S=e-C,b=r+v;const D=r-v;p[g++]=x,p[g++]=b,p[--w]=D,p[--w]=x,o&&(p[g++]=S,p[g++]=b,p[--w]=D,p[--w]=S)}}const d=Math.cos(c?-l:l),f=Math.sin(c?-l:l);for(let m=0;m<p.length;m+=2){const g=p[m],M=p[m+1],P=g-e,w=M-r,C=P*d-w*f,v=P*f+w*d;t.push(e+C,r+v)}return t}getAdaptiveVertices(t=[]){return this.startAngle===0&&this.endAngle===Math.PI*2?this._getAdaptiveVerticesByCircle(t):this._getAdaptiveVerticesByArc(t)}copy(t){return super.copy(t),this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.dx=t.dx,this.dy=t.dy,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotate=t.rotate,this}}function Fa(n,t){const e=n.rx,r=n.ry,i=Math.cos(n.rotate),s=Math.sin(n.rotate),o=new k(e*i,e*s),a=new k(-r*s,r*i),l=o.applyMatrix3(t),c=a.applyMatrix3(t),u=La.set(l.x,c.x,0,l.y,c.y,0,0,0,1),h=pi.copy(u).invert(),f=di.copy(h).transpose().multiply(h).elements,m=za(f[0],f[1],f[4]),g=Math.sqrt(m.rt1),M=Math.sqrt(m.rt2);if(n.rx=1/g,n.ry=1/M,n.rotate=Math.atan2(m.sn,m.cs),!((n.endAngle-n.startAngle)%(2*Math.PI)<Number.EPSILON)){const w=pi.set(g,0,0,0,M,0,0,0,1),C=di.set(m.cs,m.sn,0,-m.sn,m.cs,0,0,0,1),v=w.multiply(C).multiply(u),x=S=>{const{x:b,y:D}=new k(Math.cos(S),Math.sin(S)).applyMatrix3(v);return Math.atan2(D,b)};n.startAngle=x(n.startAngle),n.endAngle=x(n.endAngle),gi(t)&&(n.clockwise=!n.clockwise)}}function Ua(n,t){const e=yi(t),r=mi(t);n.rx*=e,n.ry*=r;const i=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);n.rotate+=i,gi(t)&&(n.startAngle*=-1,n.endAngle*=-1,n.clockwise=!n.clockwise)}function gi(n){const t=n.elements;return t[0]*t[4]-t[1]*t[3]<0}function $a(n){const t=n.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const r=yi(n),i=mi(n);return Math.abs(e/(r*i))>Number.EPSILON}function yi(n){const t=n.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function mi(n){const t=n.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function za(n,t,e){let r,i,s,o,a;const l=n+e,c=n-e,u=Math.sqrt(c*c+4*t*t);return l>0?(r=.5*(l+u),a=1/r,i=n*a*e-t*a*t):l<0?i=.5*(l-u):(r=.5*u,i=-.5*u),c>0?s=c+u:s=c-u,Math.abs(s)>2*Math.abs(t)?(a=-2*t/s,o=1/Math.sqrt(1+a*a),s=a*o):Math.abs(t)===0?(s=1,o=0):(a=-.5*s/t,s=1/Math.sqrt(1+a*a),o=a*s),c>0&&(a=s,s=-o,o=a),{rt1:r,rt2:i,cs:s,sn:o}}class Na extends er{constructor(t=0,e=0,r=1,i=0,s=Math.PI*2,o=!1){super(new k(t,e),new k(r,r),new k,0,i,s,o)}drawTo(t){const{cx:e,cy:r,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;return t.arc(e,r,i,s,o,!a),this}}class Qt extends Ce{constructor(t=new k,e=new k){super(),this.p1=t,this.p2=e}static from(t,e,r,i){return new Qt(new k(t,e),new k(r,i))}getPoint(t,e=new k){return t===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(t).add(this.p1),e}getPointAt(t,e=new k){return this.getPoint(t,e)}getTangent(t,e=new k){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(t,e=new k){return this.getTangent(t,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptiveVertices(t=[]){return t.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),t}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,p2:i}=this;return t.x=Math.min(t.x,r.x,i.x),t.y=Math.min(t.y,r.y,i.y),e.x=Math.max(e.x,r.x,i.x),e.y=Math.max(e.y,r.y,i.y),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,p2:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}getFillVertices(t={}){const e=Math.min(this.p1.x,this.p2.x),r=Math.max(this.p1.x,this.p2.x),i=Math.min(this.p1.y,this.p2.y),s=Math.max(this.p1.y,this.p2.y),o=e,a=i,l=r-e||t.style?.strokeWidth||0,c=s-i||t.style?.strokeWidth||0;return[o,a,o+l,a,o+l,a+c,o,a+c]}drawTo(t){const{p1:e,p2:r}=this;return t.lineTo(e.x,e.y),t.lineTo(r.x,r.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.p2.copy(t.p2),this}}class Ge extends Ce{constructor(t=[]){super(),this.curves=t}getFlatCurves(){return this.curves.flatMap(t=>t instanceof Ge?t.getFlatCurves():t)}addCurve(t){return this.curves.push(t),this}getPoint(t,e=new k){const r=t*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=r){const o=i[s]-r,a=this.curves[s],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,e)}s++}return e}updateLengths(){const t=[];for(let e=0,r=0,i=this.curves.length;e<i;e++)r+=this.curves[e].getLength(),t.push(r);this._arcLengths=t}getControlPointRefs(){return this.curves.flatMap(t=>t.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(t,e){const r=[t[e-1],t[e]],i=[t[e+1],t[e+2]];return r[0]===i[0]&&r[1]===i[1]&&t.splice(e+1,2),t}getSpacedVertices(t=5,e=[]){let r;return this.curves.forEach(i=>{i.getSpacedVertices(t,e),r&&this._removeNextPointIfEqualPrevPoint(e,r),r=e.length-1}),e}getAdaptiveVertices(t=[]){let e;return this.curves.forEach(r=>{r.getAdaptiveVertices(t),e&&this._removeNextPointIfEqualPrevPoint(t,e),e=t.length-1}),t}strokeTriangulate(t){return this.curves.length===1?this.curves[0].strokeTriangulate(t):super.strokeTriangulate(t)}getFillVertices(t){if(this.curves.length===1)return this.curves[0].getFillVertices(t);{const e=[];let r;return this.curves.forEach(i=>{let s;i instanceof Qt?s=i.getAdaptiveVertices():s=i.getFillVertices(t),e.push(...s),r&&this._removeNextPointIfEqualPrevPoint(e,r),r=e.length-1}),e}}applyTransform(t){return this.curves.forEach(e=>e.applyTransform(t)),this}getMinMax(t=k.MAX,e=k.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new X(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(r=>r.drawTo(t)),this}copy(t){return super.copy(t),this.curves=t.curves.map(e=>e.clone()),this}}class nr extends Ce{constructor(t=new k,e=new k,r=new k,i=new k){super(),this.p1=t,this.cp1=e,this.cp2=r,this.p2=i}static from(t,e,r,i,s,o,a,l){return new nr(new k(t,e),new k(r,i),new k(s,o),new k(a,l))}getPoint(t,e=new k){const{p1:r,cp1:i,cp2:s,p2:o}=this;return e.set(ai(t,r.x,i.x,s.x,o.x),ai(t,r.y,i.y,s.y,o.y))}getAdaptiveVertices(t=[]){return xa(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,t)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(t,e,r){const i=e*e-4*t*r;if(i<0)return[];const s=Math.sqrt(i),o=(-e+s)/(2*t),a=(-e-s)/(2*t);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,cp1:i,cp2:s,p2:o}=this,a=this._solveQuadratic(3*(i.x-r.x),6*(s.x-i.x),3*(o.x-s.x)),l=this._solveQuadratic(3*(i.y-r.y),6*(s.y-i.y),3*(o.y-s.y)),c=[0,1,...a,...l];return((h,p)=>{for(const d of h)for(let f=0;f<=p;f++){const m=f/p-.5,g=Math.min(1,Math.max(0,d+m)),M=this.getPoint(g);t.x=Math.min(t.x,M.x),t.y=Math.min(t.y,M.y),e.x=Math.max(e.x,M.x),e.y=Math.max(e.y,M.y)}})(c,10),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp1:e,cp2:r,p2:i}=this;return[{type:"M",x:t.x,y:t.y},{type:"C",x1:e.x,y1:e.y,x2:r.x,y2:r.y,x:i.x,y:i.y}]}drawTo(t){const{p1:e,cp1:r,cp2:i,p2:s}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(r.x,r.y,i.x,i.y,s.x,s.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp1.copy(t.cp1),this.cp2.copy(t.cp2),this.p2.copy(t.p2),this}}class Va extends er{constructor(t=0,e=0,r=1,i=1,s=0,o=0,a=Math.PI*2,l=!1){super(new k(t,e),new k(r,i),new k,s,o,a,l)}drawTo(t){return t.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class ja extends Ge{}class rr extends Ce{constructor(t=new k,e=new k,r=new k){super(),this.p1=t,this.cp=e,this.p2=r}static from(t,e,r,i,s,o){return new rr(new k(t,e),new k(r,i),new k(s,o))}getPoint(t,e=new k){const{p1:r,cp:i,p2:s}=this;return e.set(hi(t,r.x,i.x,s.x),hi(t,r.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(t=[]){return Sa(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,t)}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,cp:i,p2:s}=this,o=.5*(r.x+i.x),a=.5*(r.y+i.y),l=.5*(r.x+s.x),c=.5*(r.y+s.y);return t.x=Math.min(t.x,r.x,s.x,o,l),t.y=Math.min(t.y,r.y,s.y,a,c),e.x=Math.max(e.x,r.x,s.x,o,l),e.y=Math.max(e.y,r.y,s.y,a,c),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp:e,p2:r}=this;return[{type:"M",x:t.x,y:t.y},{type:"Q",x1:e.x,y1:e.y,x:r.x,y:r.y}]}drawTo(t){const{p1:e,cp:r,p2:i}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,i.x,i.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp.copy(t.cp),this.p2.copy(t.p2),this}}class Ra extends ja{constructor(t=0,e=0,r=0,i=0){super(),this.x=t,this.y=e,this.width=r,this.height=i,this.update()}update(){const{x:t,y:e,width:r,height:i}=this,s=[new k(t,e),new k(t+r,e),new k(t+r,e+i),new k(t,e+i)];return this.curves=[new Qt(s[0],s[1]),new Qt(s[1],s[2]),new Qt(s[2],s[3]),new Qt(s[3],s[0])],this}drawTo(t){return t.rect(this.x,this.y,this.width,this.height),this}getFillVertices(t={}){const{x:e,y:r,width:i,height:s}=this;return[e,r,e+i,r,e+i,r+s,e,r+s]}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.update(),this}}class Ga extends er{constructor(t=0,e=0,r=1,i=1,s=1){super(),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=s,this.update()}update(){const{x:t,y:e,width:r,height:i,radius:s}=this,o=r/2,a=i/2,l=t+o,c=e+a,u=Math.max(0,Math.min(s,Math.min(o,a))),h=u;return this._center=new k(l,c),this._radius=new k(u,h),this._diff=new k(o-u,a-h),this}drawTo(t){const{x:e,y:r,width:i,height:s,radius:o}=this;return t.roundRect(e,r,i,s,o),this}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.radius=t.radius,this.update(),this}}class qa extends Ce{constructor(t=[]){super(),this.points=t}getPoint(t,e=new k){const{points:r}=this,i=(r.length-1)*t,s=Math.floor(i),o=i-s,a=r[s===0?s:s-1],l=r[s],c=r[s>r.length-2?r.length-1:s+1],u=r[s>r.length-3?r.length-1:s+2];return e.set(oi(o,a.x,l.x,c.x,u.x),oi(o,a.y,l.y,c.y,u.y)),e}getControlPointRefs(){return this.points}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++)this.points.push(t.points[e].clone());return this}}class pn extends Ge{startPoint;currentPoint;autoClose=!1;constructor(t){super(),t&&this.addPoints(t)}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++){const{x:i,y:s}=t[e];this.lineTo(i,s)}return this}addCommands(t){return Zr(t,this),this}addData(t){return this.addCommands(Yr(t)),this}_closeVertices(t){return this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getUnevenVertices(t=40,e=[]){return this._closeVertices(super.getUnevenVertices(t,e))}getSpacedVertices(t=40,e=[]){return this._closeVertices(super.getSpacedVertices(t,e))}getAdaptiveVertices(t=[]){return this._closeVertices(super.getAdaptiveVertices(t))}getFillVertices(t){return this._closeVertices(super.getFillVertices(t))}_setCurrentPoint(t){return this.currentPoint=new k(t.x,t.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(t){if(this.curves.length>0){const e=t.getPoint(0);(!this.currentPoint||!e.equals(this.currentPoint))&&this.lineTo(e.x,e.y)}return this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;e&&!t.equals(e)&&(this.curves.push(new Qt(e.clone(),t.clone())),e.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint=new k(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){const r=this.currentPoint;return r?.equals({x:t,y:e})||this.curves.push(Qt.from(r?.x??0,r?.y??0,t,e)),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,r,i,s,o){const a=this.currentPoint;return a?.equals({x:s,y:o})||this.curves.push(nr.from(a?.x??0,a?.y??0,t,e,r,i,s,o)),this._setCurrentPoint({x:s,y:o}),this}quadraticCurveTo(t,e,r,i){const s=this.currentPoint;return s?.equals({x:r,y:i})||this.curves.push(rr.from(s?.x??0,s?.y??0,t,e,r,i)),this._setCurrentPoint({x:r,y:i}),this}arc(t,e,r,i,s,o){const a=new Na(t,e,r,i,s,!o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(t,e,r,i,s,o){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.arc(t,e,r,i,s,o),this}arcTo(t,e,r,i,s){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,r,i,s,o,a,l=!0){const c=new Va(t,e,r,i,s,o,a,!l);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(t,e,r,i,s,o,a,l){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.ellipse(t,e,r,i,s,o,a,l),this}rect(t,e,r,i){const s=new Ra(t,e,r,i);return this._connetLineTo(s),this.curves.push(s),this._setCurrentPoint({x:t,y:e}),this}roundRect(t,e,r,i,s){const o=new Ga(t,e,r,i,s);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){const e=this.currentPoint??new k;return this.curves.push(new qa([e].concat(t))),this._setCurrentPoint(t[t.length-1]),this}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(r=>r.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){return super.copy(t),this.autoClose=t.autoClose,this.currentPoint=t.currentPoint?.clone(),this}}class Tt extends Ge{currentCurve=new pn;style;get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}constructor(t,e={}){super(),this.curves.push(this.currentCurve),this.style=e,t&&(t instanceof Tt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}addPath(t){const e=this.curves.findIndex(r=>r===this.currentCurve);return e>-1&&this.curves.splice(e,1),t instanceof Tt?this.curves.push(...t.curves.filter(r=>r.curves.length).map(r=>r.clone())):t.curves.length&&this.curves.push(t),this.curves.push(this.currentCurve),this}closePath(){const t=this.startPoint;return t&&(this.currentCurve.closePath(),this.currentCurve.curves.length&&(this.currentCurve=new pn().moveTo(t.x,t.y),this.curves.push(this.currentCurve))),this}moveTo(t,e){return this.currentCurve.currentPoint?.equals({x:t,y:e})||(this.currentCurve.curves.length&&(this.currentCurve=new pn,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(t,e)),this}lineTo(t,e){return this.currentCurve.lineTo(t,e),this}bezierCurveTo(t,e,r,i,s,o){return this.currentCurve.bezierCurveTo(t,e,r,i,s,o),this}quadraticCurveTo(t,e,r,i){return this.currentCurve.quadraticCurveTo(t,e,r,i),this}arc(t,e,r,i,s,o){return this.currentCurve.arc(t,e,r,i,s,o),this}arcTo(t,e,r,i,s){return this.currentCurve.arcTo(t,e,r,i,s),this}ellipse(t,e,r,i,s,o,a,l){return this.currentCurve.ellipse(t,e,r,i,s,o,a,l),this}rect(t,e,r,i){return this.currentCurve.rect(t,e,r,i),this}roundRect(t,e,r,i,s){return this.currentCurve.roundRect(t,e,r,i,s),this}reset(){return this.currentCurve=new pn,this.curves=[this.currentCurve],this.style={},this}addCommands(t){return Zr(t,this),this}addData(t){return this.addCommands(Yr(t)),this}splineThru(t){return this.currentCurve.splineThru(t),this}scale(t,e=t,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(t,e,r)}),this}skew(t,e=0,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(t,e,r)}),this}rotate(t,e={x:0,y:0}){return this.getControlPointRefs().forEach(r=>{r.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getFlatCurves(),r=[],i=[],s=[];e.forEach((a,l)=>{const c=a.getControlPointRefs(),u=a.isClockwise();s[l]=c,i[l]=u;const h=c[0],p=c[c.length-1]??h;r.push({start:u?p:h,end:u?h:p,index:l})});const o=[];return r.forEach((a,l)=>{o[l]=[],r.forEach((c,u)=>{c.start&&a.end&&u!==l&&c.start?.equals(a.end)&&o[l].push(c.index)})}),e.forEach((a,l)=>{const c=i[l];s[l].forEach(u=>{u.add(a.getNormal(a.getTForPoint(u)).scale(c?t:-t))})}),o.forEach((a,l)=>{const c=s[l];a.forEach(u=>{const h=s[u],p=Ma(c[c.length-1],c[c.length-2]??c[c.length-1],h[0],h[1]??h[0]);p&&(c[c.length-1].copy(p),h[0].copy(p))})}),this}getMinMax(t=k.MAX,e=k.MIN,r=!0){const i=this.strokeWidth;return this.curves.forEach(s=>{if(s.getMinMax(t,e),r&&i>1){const o=i/2,a=s.isClockwise(),l=[];for(let c=0;c<=1;c+=1/s.arcLengthDivision){const u=s.getPoint(c),h=s.getNormal(c),p=h.clone().scale(a?o:-o),d=h.clone().scale(a?-o:o);l.push(u.clone().add(p),u.clone().add(d),u.clone().add({x:o,y:0}),u.clone().add({x:-o,y:0}),u.clone().add({x:0,y:o}),u.clone().add({x:0,y:-o}),u.clone().add({x:o,y:o}),u.clone().add({x:-o,y:-o}))}t.min(...l),e.max(...l)}}),{min:t.finite(),max:e.finite()}}strokeTriangulate(t){const e=t?.indices??[],r=t?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...t,indices:e,vertices:r,style:{...this.style}})}),{indices:e,vertices:r}}fillTriangulate(t){const e={...t,style:{...this.style,...t?.style}},r=e.indices??[],i=e.vertices??[];if((e.style.fillRule??"nonzero")==="nonzero"){const o=this.curves.map(c=>c.getFillVertices(e)),a=ka(o),l=a.length;for(let c=0;c<l;c++){const u=a[c],h=o[c];if(u.wn||!h.length)continue;const p=h.slice(),d=[];for(let f=0;f<l;f++){const m=a[f];m.parentIndex===c&&(d.push(p.length/2),p.push(...o[m.index]))}li(p,{...t,indices:r,vertices:i,holes:d,style:{...this.style}})}}else this.curves.forEach(o=>{o.fillTriangulate({...t,indices:r,vertices:i,style:{...this.style}})});return{indices:r,vertices:i}}getBoundingBox(t=!0){const{min:e,max:r}=this.getMinMax(void 0,void 0,t);return new X(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Yn(t,e),this.curves.forEach(s=>{s.drawTo(t)}),r!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Yn(t,e),this.getControlPointRefs().forEach(s=>{Wo(t,s.x,s.y,{radius:4})}),r!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.curves.flatMap(t=>t.toCommands())}toData(){return this.curves.filter(t=>t.curves.length).map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const i in t)t[i]!==void 0&&(e[Ca(i)]=t[i]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let r="";for(const i in e)e[i]!==void 0&&(r+=`${i}:${e[i]};`);return`<path d="${this.toData()}" style="${r}"></path>`}copy(t){return super.copy(t),this.currentCurve=t.currentCurve.clone(),this.style={...t.style},this}}class se{constructor(t=[],e){this.paths=t,this.viewBox=e}getBoundingBox(t=!0){if(!this.paths.length)return;const e=k.MAX,r=k.MIN;return this.paths.forEach(i=>i.getMinMax(e,r,t)),new X(e.x,e.y,r.x-e.x,r.y-e.y)}toTriangulatedSvgString(t=this.paths.map(r=>r.fillTriangulate()),e=0){let r="";const i={x:-e,y:-e},s={x:e,y:e};(Array.isArray(t)?t:[t]).forEach(({vertices:l,indices:c})=>{const u=h=>{const p=l[h*2],d=l[h*2+1];return i.x=Math.min(i.x,p+e),s.x=Math.max(s.x,p+e),i.y=Math.min(i.y,d+e),s.y=Math.max(s.y,d+e),[p,d]};for(let h=0,p=c.length;h<p;h+=3){const d=u(c[h]),f=u(c[h+1]),m=u(c[h+2]);r+=`<polygon points="${d.join(",")} ${f.join(",")} ${m.join(",")}" stroke="none" fill="black" />`}});const a=[i.x,i.y,s.x-i.x,s.y-i.y];return`<svg width="${a[2]}" height="${a[3]}" viewBox="${a.join(" ")}" xmlns="http://www.w3.org/2000/svg">${r}</svg>`}toTriangulatedSvg(t,e){return new DOMParser().parseFromString(this.toTriangulatedSvgString(t,e),"image/svg+xml").documentElement}toSvgString(){const{x:t,y:e,width:r,height:i}=this.getBoundingBox(),s=this.paths.map(o=>o.toSvgPathString()).join("");return`<svg viewBox="${t} ${e} ${r} ${i}" width="${r}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${s}</svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...r}=t,{left:i,top:s,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*e,l.height=a*e,l.style.width=`${o}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-s),this.paths.forEach(u=>{u.drawTo(c,r)})),l}}const Wa=new Set(["©","®","÷"]),Ha=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),Xa={1:"italic",32:"bold"},Za={1:"italic",2:"bold"},xi={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class vi{constructor(t,e,r){this.content=t,this.index=e,this.parent=r}path=new Tt;lineBox=new X;inlineBox=new X;glyphBox;advanceWidth=0;advanceHeight=0;underlinePosition=0;underlineThickness=0;strikeoutPosition=0;strikeoutSize=0;ascender=0;descender=0;typoAscender=0;typoDescender=0;typoLineGap=0;winAscent=0;winDescent=0;xHeight=0;capHeight=0;baseline=0;centerDiviation=0;fontStyle;get compatibleGlyphBox(){const t=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new X(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new X(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-t/2,this.lineBox.width,t))}get center(){return this.compatibleGlyphBox.center}get computedFill(){return this.parent.computedFill}get computedOutline(){return this.parent.computedOutline}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(t){const e=this.computedStyle.fontFamily,r=t??ko;let s=(e?r.get(e):r.fallbackFont)?.getSFNT();return s?.textToGlyphIndexes(this.content).includes(0)&&(s=r.fallbackFont?.getSFNT()),s}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:r,post:i,head:s}=t,o=s.unitsPerEm,a=e.ascent,l=e.descent,{content:c,computedStyle:u,isVertical:h}=this,{fontSize:p}=u,d=o/p,f=t.getAdvanceWidth(c,p),m=(a+Math.abs(l))/d,g=a/d;return this.advanceWidth=f,this.advanceHeight=m,this.inlineBox.width=h?m:f,this.inlineBox.height=h?f:m,this.underlinePosition=(a-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(a-r.yStrikeoutPosition)/d,this.strikeoutSize=r.yStrikeoutSize/d,this.ascender=a/d,this.descender=l/d,this.typoAscender=r.sTypoAscender/d,this.typoDescender=r.sTypoDescender/d,this.typoLineGap=r.sTypoLineGap/d,this.winAscent=r.usWinAscent/d,this.winDescent=r.usWinDescent/d,this.xHeight=r.sxHeight/d,this.capHeight=r.sCapHeight/d,this.baseline=g,this.centerDiviation=m/2-g,this.fontStyle=Xa[r.fsSelection]??Za[s.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:r,content:i,computedStyle:s,baseline:o,inlineBox:a,ascender:l,descender:c,typoAscender:u,fontStyle:h,advanceWidth:p,advanceHeight:d}=this,{left:f,top:m}=a,g=s.fontStyle==="italic"&&h!=="italic";let M=f,P=m+o,w;const C=new Tt;if(r&&(M+=(d-p)/2,Math.abs(p-d)>.1&&(P-=(l-u)/(l+Math.abs(c))*d),w=void 0),r&&!Wa.has(i)&&(i.codePointAt(0)<=256||Ha.has(i))){C.addCommands(e.getPathCommands(i,M,m+o-(d-p)/2,s.fontSize));const x={y:m-(d-p)/2+d/2,x:M+p/2};g&&this._italic(C,r?{x:x.x,y:m-(d-p)/2+o}:void 0),C.rotate(90,x)}else w!==void 0?(C.addCommands(e.glyphs.get(w).getPathCommands(M,P,s.fontSize)),g&&this._italic(C,r?{x:M+p/2,y:m+u/(l+Math.abs(c))*d}:void 0)):(C.addCommands(e.getPathCommands(i,M,P,s.fontSize)),g&&this._italic(C,r?{x:M+d/2,y:P}:void 0));const v=s.fontWeight??400;return v in xi&&(v===700||v==="bold")&&h!=="bold"&&C.bold(xi[v]*s.fontSize*.05),C.style={fill:this.computedFill??s.color,fillRule:"nonzero",stroke:this.computedOutline??(s.textStrokeWidth?s.textStrokeColor:"none"),strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(t,e){t.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(t,e,r){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,r)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:r,max:i}=e;return new X(r.x,r.y,i.x-r.x,i.y-r.y)}drawTo(t,e={}){const r=this.computedStyle,i={ctx:t,path:this.path,fontSize:r.fontSize,color:r.color,...e};if(this.glyphBox)he(i);else{t.save(),t.beginPath();const s=this.path.style,o={...s,fill:i.color??s.fill,stroke:i.textStrokeColor??s.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:s.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};Yn(t,o),t.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(t.textBaseline="middle",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(t.textBaseline="alphabetic",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),t.restore()}}}function ir(){const n=new Map;async function t(r){if(!n.has(r)){n.set(r,r);try{n.set(r,await fetch(r).then(i=>i.text()))}catch(i){console.warn(i),n.delete(r)}}}function e(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("blob://")}return{loaded:n,needsLoad:e,load:t}}function sr(n){const t=new Map;function e(r){let i=t.get(r);if(!i){const s=ti(n.needsLoad(r)?n.loaded.get(r)??r:r),o=si(s);i={dom:s,pathSet:o},t.set(r,i)}return i}return{parsed:t,parse:e}}var Ya={grad:.9,turn:360,rad:360/(2*Math.PI)},Jt=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},at=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},Et=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},wi=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},bi=function(n){return{r:Et(n.r,0,255),g:Et(n.g,0,255),b:Et(n.b,0,255),a:Et(n.a)}},or=function(n){return{r:at(n.r),g:at(n.g),b:at(n.b),a:at(n.a,3)}},Ka=/^#([0-9a-f]{3,8})$/i,dn=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},Si=function(n){var t=n.r,e=n.g,r=n.b,i=n.a,s=Math.max(t,e,r),o=s-Math.min(t,e,r),a=o?s===t?(e-r)/o:s===e?2+(r-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},Ci=function(n){var t=n.h,e=n.s,r=n.v,i=n.a;t=t/360*6,e/=100,r/=100;var s=Math.floor(t),o=r*(1-e),a=r*(1-(t-s)*e),l=r*(1-(1-t+s)*e),c=s%6;return{r:255*[r,a,o,o,l,r][c],g:255*[l,r,r,a,o,o][c],b:255*[o,o,l,r,r,a][c],a:i}},Mi=function(n){return{h:wi(n.h),s:Et(n.s,0,100),l:Et(n.l,0,100),a:Et(n.a)}},Pi=function(n){return{h:at(n.h),s:at(n.s),l:at(n.l),a:at(n.a,3)}},Ti=function(n){return Ci((e=(t=n).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r},qe=function(n){return{h:(t=Si(n)).h,s:(i=(200-(e=t.s))*(r=t.v)/100)>0&&i<200?e*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,r,i},Qa=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ja=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,el=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_i={string:[[function(n){var t=Ka.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?at(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?at(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=tl.exec(n)||el.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:bi({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=Qa.exec(n)||Ja.exec(n);if(!t)return null;var e,r,i=Mi({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(Ya[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Ti(i)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,r=n.b,i=n.a,s=i===void 0?1:i;return Jt(t)&&Jt(e)&&Jt(r)?bi({r:Number(t),g:Number(e),b:Number(r),a:Number(s)}):null},"rgb"],[function(n){var t=n.h,e=n.s,r=n.l,i=n.a,s=i===void 0?1:i;if(!Jt(t)||!Jt(e)||!Jt(r))return null;var o=Mi({h:Number(t),s:Number(e),l:Number(r),a:Number(s)});return Ti(o)},"hsl"],[function(n){var t=n.h,e=n.s,r=n.v,i=n.a,s=i===void 0?1:i;if(!Jt(t)||!Jt(e)||!Jt(r))return null;var o=function(a){return{h:wi(a.h),s:Et(a.s,0,100),v:Et(a.v,0,100),a:Et(a.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(s)});return Ci(o)},"hsv"]]},ki=function(n,t){for(var e=0;e<t.length;e++){var r=t[e][0](n);if(r)return[r,t[e][1]]}return[null,void 0]},nl=function(n){return typeof n=="string"?ki(n.trim(),_i.string):typeof n=="object"&&n!==null?ki(n,_i.object):[null,void 0]},ar=function(n,t){var e=qe(n);return{h:e.h,s:Et(e.s+100*t,0,100),l:e.l,a:e.a}},lr=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},Ai=function(n,t){var e=qe(n);return{h:e.h,s:e.s,l:Et(e.l+100*t,0,100),a:e.a}},Ii=function(){function n(t){this.parsed=nl(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return at(lr(this.rgba),2)},n.prototype.isDark=function(){return lr(this.rgba)<.5},n.prototype.isLight=function(){return lr(this.rgba)>=.5},n.prototype.toHex=function(){return t=or(this.rgba),e=t.r,r=t.g,i=t.b,o=(s=t.a)<1?dn(at(255*s)):"","#"+dn(e)+dn(r)+dn(i)+o;var t,e,r,i,s,o},n.prototype.toRgb=function(){return or(this.rgba)},n.prototype.toRgbString=function(){return t=or(this.rgba),e=t.r,r=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+r+", "+i+", "+s+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,s},n.prototype.toHsl=function(){return Pi(qe(this.rgba))},n.prototype.toHslString=function(){return t=Pi(qe(this.rgba)),e=t.h,r=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+s+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,s},n.prototype.toHsv=function(){return t=Si(this.rgba),{h:at(t.h),s:at(t.s),v:at(t.v),a:at(t.a,3)};var t},n.prototype.invert=function(){return Xt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),Xt(ar(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),Xt(ar(this.rgba,-t))},n.prototype.grayscale=function(){return Xt(ar(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),Xt(Ai(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),Xt(Ai(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?Xt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):at(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=qe(this.rgba);return typeof t=="number"?Xt({h:t,s:e.s,l:e.l,a:e.a}):at(e.h)},n.prototype.isEqual=function(t){return this.toHex()===Xt(t).toHex()},n}(),Xt=function(n){return n instanceof Ii?n:new Ii(n)};class rl{eventListeners=new Map;addEventListener(t,e,r){const i={value:e,options:r},s=this.eventListeners.get(t);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(t,[s,i]):this.eventListeners.set(t,i),this}removeEventListener(t,e,r){if(!e)return this.eventListeners.delete(t),this;const i=this.eventListeners.get(t);if(!i)return this;if(Array.isArray(i)){const s=[];for(let o=0,a=i.length;o<a;o++){const l=i[o];(l.value!==e||typeof r=="object"&&r?.once&&(typeof l.options=="boolean"||!l.options?.once))&&s.push(l)}s.length?this.eventListeners.set(t,s.length===1?s[0]:s):this.eventListeners.delete(t)}else i.value===e&&(typeof r=="boolean"||!r?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(t);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(t){return this.eventListeners.has(t)}dispatchEvent(t,...e){const r=this.eventListeners.get(t);if(r){if(Array.isArray(r))for(let i=r.length,s=0;s<i;s++){const o=r[s];typeof o.options=="object"&&o.options?.once&&this.off(t,o.value,o.options),o.value.apply(this,e)}else typeof r.options=="object"&&r.options?.once&&this.off(t,r.value,r.options),r.value.apply(this,e);return!0}else return!1}on(t,e,r){return this.addEventListener(t,e,r)}once(t,e){return this.addEventListener(t,e,{once:!0})}off(t,e,r){return this.removeEventListener(t,e,r)}emit(t,...e){this.dispatchEvent(t,...e)}}function tt(n){return n==null||n==="none"}function Me(n,t=0,e=10**t){return Math.round(e*n)/e+0}function zt(n,t=!1){if(typeof n!="object"||!n)return n;if(Array.isArray(n))return t?n.map(r=>zt(r,t)):n;const e={};for(const r in n){const i=n[r];i!=null&&(t?e[r]=zt(i,t):e[r]=i)}return e}function il(n,t){const e={};return t.forEach(r=>{r in n&&(e[r]=n[r])}),e}function cr(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Array.from(new Set([...Object.keys(n),...Object.keys(t)]));return!e.length||e.every(r=>n[r]===t[r])}return!1}function sl(n,t,e){const r=t.length-1;if(r<0)return n===void 0?e:n;for(let i=0;i<r;i++){if(n==null)return e;n=n[t[i]]}return n==null||n[t[r]]===void 0?e:n[t[r]]}function ol(n,t,e){const r=t.length-1;for(let i=0;i<r;i++)typeof n[t[i]]!="object"&&(n[t[i]]={}),n=n[t[i]];n[t[r]]=e}function al(n,t,e){return n==null||!t||typeof t!="string"?e:n[t]!==void 0?n[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),sl(n,t.split("."),e))}function ll(n,t,e){if(!(typeof n!="object"||!t))return t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),ol(n,t.split("."),e)}function Oi(n){let t;return typeof n=="number"?t={r:n>>24&255,g:n>>16&255,b:n>>8&255,a:(n&255)/255}:t=n,Xt(t)}function cl(n){return{r:Me(n.r),g:Me(n.g),b:Me(n.b),a:Me(n.a,3)}}function gn(n){const t=n.toString(16);return t.length<2?`0${t}`:t}const hl="#000000FF";function ul(n){return Oi(n).isValid()}function Bt(n,t=!1){const e=Oi(n);if(!e.isValid()){if(typeof n=="string")return n;const a=`Failed to normalizeColor ${n}`;if(t)throw new Error(a);return console.warn(a),hl}const{r,g:i,b:s,a:o}=cl(e.rgba);return`#${gn(r)}${gn(i)}${gn(s)}${gn(Me(o*255))}`}var yn=yn||{};yn.parse=function(){const n={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let t="";function e(_){const T=new Error(`${t}: ${_}`);throw T.source=t,T}function r(){const _=i();return t.length>0&&e("Invalid input not EOF"),_}function i(){return w(s)}function s(){return o("linear-gradient",n.linearGradient,l)||o("repeating-linear-gradient",n.repeatingLinearGradient,l)||o("radial-gradient",n.radialGradient,h)||o("repeating-radial-gradient",n.repeatingRadialGradient,h)}function o(_,T,F){return a(T,$=>{const q=F();return q&&(O(n.comma)||e("Missing comma before color stops")),{type:_,orientation:q,colorStops:w(C)}})}function a(_,T){const F=O(_);if(F){O(n.startCall)||e("Missing (");const $=T(F);return O(n.endCall)||e("Missing )"),$}}function l(){const _=c();if(_)return _;const T=j("position-keyword",n.positionKeywords,1);return T?{type:"directional",value:T.value}:u()}function c(){return j("directional",n.sideOrCorner,1)}function u(){return j("angular",n.angleValue,1)||j("angular",n.radianValue,1)}function h(){let _,T=p(),F;return T&&(_=[],_.push(T),F=t,O(n.comma)&&(T=p(),T?_.push(T):t=F)),_}function p(){let _=d()||f();if(_)_.at=g();else{const T=m();if(T){_=T;const F=g();F&&(_.at=F)}else{const F=g();if(F)_={type:"default-radial",at:F};else{const $=M();$&&(_={type:"default-radial",at:$})}}}return _}function d(){const _=j("shape",/^(circle)/i,0);return _&&(_.style=U()||m()),_}function f(){const _=j("shape",/^(ellipse)/i,0);return _&&(_.style=M()||A()||m()),_}function m(){return j("extent-keyword",n.extentKeywords,1)}function g(){if(j("position",/^at/,0)){const _=M();return _||e("Missing positioning value"),_}}function M(){const _=P();if(_.x||_.y)return{type:"position",value:_}}function P(){return{x:A(),y:A()}}function w(_){let T=_();const F=[];if(T)for(F.push(T);O(n.comma);)T=_(),T?F.push(T):e("One extra comma");return F}function C(){const _=v();return _||e("Expected color definition"),_.length=A(),_}function v(){return S()||L()||E()||D()||b()||N()||x()}function x(){return j("literal",n.literalColor,0)}function S(){return j("hex",n.hexColor,1)}function b(){return a(n.rgbColor,()=>({type:"rgb",value:w(B)}))}function D(){return a(n.rgbaColor,()=>({type:"rgba",value:w(B)}))}function N(){return a(n.varColor,()=>({type:"var",value:z()}))}function E(){return a(n.hslColor,()=>{O(n.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const T=B();O(n.comma);let F=O(n.percentageValue);const $=F?F[1]:null;O(n.comma),F=O(n.percentageValue);const q=F?F[1]:null;return(!$||!q)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[T,$,q]}})}function L(){return a(n.hslaColor,()=>{const _=B();O(n.comma);let T=O(n.percentageValue);const F=T?T[1]:null;O(n.comma),T=O(n.percentageValue);const $=T?T[1]:null;O(n.comma);const q=B();return(!F||!$)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[_,F,$,q]}})}function z(){return O(n.variableName)[1]}function B(){return O(n.number)[1]}function A(){return j("%",n.percentageValue,1)||W()||I()||U()}function W(){return j("position-keyword",n.positionKeywords,1)}function I(){return a(n.calcValue,()=>{let _=1,T=0;for(;_>0&&T<t.length;){const $=t.charAt(T);$==="("?_++:$===")"&&_--,T++}_>0&&e("Missing closing parenthesis in calc() expression");const F=t.substring(0,T-1);return V(T-1),{type:"calc",value:F}})}function U(){return j("px",n.pixelValue,1)||j("em",n.emValue,1)}function j(_,T,F){const $=O(T);if($)return{type:_,value:$[F]}}function O(_){let T,F;return F=/^\s+/.exec(t),F&&V(F[0].length),T=_.exec(t),T&&V(T[0].length),T}function V(_){t=t.substr(_)}return function(_){return t=_.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),r()}}();const fl=yn.parse.bind(yn);var mn=mn||{};mn.stringify=function(){var n={"visit_linear-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return n.visit_gradient(t)},"visit_radial-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return n.visit_gradient(t)},visit_gradient:function(t){var e=n.visit(t.orientation);return e&&(e+=", "),t.type+"("+e+n.visit(t.colorStops)+")"},visit_shape:function(t){var e=t.value,r=n.visit(t.at),i=n.visit(t.style);return i&&(e+=" "+i),r&&(e+=" at "+r),e},"visit_default-radial":function(t){var e="",r=n.visit(t.at);return r&&(e+=r),e},"visit_extent-keyword":function(t){var e=t.value,r=n.visit(t.at);return r&&(e+=" at "+r),e},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return n.visit(t.value.x)+" "+n.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return n.visit_color(t.value,t)},visit_hex:function(t){return n.visit_color("#"+t.value,t)},visit_rgb:function(t){return n.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return n.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return n.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return n.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return n.visit_color("var("+t.value+")",t)},visit_color:function(t,e){var r=t,i=n.visit(e.length);return i&&(r+=" "+i),r},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var e="",r=t.length;return t.forEach(function(i,s){e+=n.visit(i),s<r-1&&(e+=", ")}),e},visit_object:function(t){return t.width&&t.height?n.visit(t.width)+" "+n.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return n.visit_array(t);if(typeof t=="object"&&!t.type)return n.visit_object(t);if(t.type){var e=n["visit_"+t.type];if(e)return e(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return n.visit(t)}}(),mn.stringify.bind(mn);function Ei(n){const t=n.length-1;return n.map((e,r)=>{const i=e.value;let s=Me(r/t,3),o="#00000000";switch(e.type){case"rgb":o=Bt({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":o=Bt({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":o=Bt(e.value);break;case"hex":o=Bt(`#${e.value}`);break}switch(e.length?.type){case"%":s=Number(e.length.value)/100;break}return{offset:s,color:o}})}function Bi(n){let t=0;switch(n.orientation?.type){case"angular":t=Number(n.orientation.value);break}return{type:"linear-gradient",angle:t,stops:Ei(n.colorStops)}}function Di(n){return n.orientation?.map(t=>{switch(t?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Ei(n.colorStops)}}function xn(n){return n.startsWith("linear-gradient(")||n.startsWith("radial-gradient(")}function pl(n){return fl(n).map(t=>{switch(t?.type){case"linear-gradient":return Bi(t);case"repeating-linear-gradient":return{...Bi(t),repeat:!0};case"radial-gradient":return Di(t);case"repeating-radial-gradient":return{...Di(t),repeat:!0};default:return}}).filter(Boolean)}function dl(n){let t;return typeof n=="string"?t={color:n}:t=n,{color:Bt(t.color)}}function gl(n){let t;if(typeof n=="string"?t={image:n}:t=n,t.image){const{type:e,...r}=pl(t.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:r};case"linear-gradient":return{linearGradient:r}}}return t}function yl(n){let t;return typeof n=="string"?t={image:n}:t=n,t}function ml(n){let t;return typeof n=="string"?t={preset:n}:t=n,{preset:t.preset,foregroundColor:tt(t.foregroundColor)?void 0:Bt(t.foregroundColor),backgroundColor:tt(t.backgroundColor)?void 0:Bt(t.backgroundColor)}}function xl(n){return!tt(n.color)}function vl(n){return typeof n=="string"?ul(n):xl(n)}function wl(n){return!tt(n.image)&&xn(n.image)||!!n.linearGradient||!!n.radialGradient}function bl(n){return typeof n=="string"?xn(n):wl(n)}function Sl(n){return!tt(n.image)&&!xn(n.image)}function Cl(n){return typeof n=="string"?!xn(n):Sl(n)}function Ml(n){return!tt(n.preset)}function Pl(n){return typeof n=="string"?!1:Ml(n)}function We(n){const t=n&&typeof n=="object"?n.enabled:void 0;return vl(n)?zt({enabled:t,...dl(n)}):bl(n)?zt({enabled:t,...gl(n)}):Cl(n)?zt({enabled:t,...yl(n)}):Pl(n)?zt({enabled:t,...ml(n)}):{}}const hr=Symbol("properties"),Li=Symbol("defaultValueInited");function Fi(n){let t;if(Object.hasOwn(n,hr))t=n[hr];else{const e=Object.getPrototypeOf(n);t=new Map(e?Fi(e):void 0),n[hr]=t}return t}function Tl(n,t={}){const e=Symbol.for(n),{default:r,fallback:i,alias:s}=t,o={declaration:t,internalKey:e},a=()=>typeof r=="function"?r():r,l=()=>typeof i=="function"?i():i;function c(){let h;if(s&&s!==n?h=al(this,s):typeof this.getter<"u"?h=this.getter(n,o):h=this[e],h=h??l(),h===void 0&&r!==void 0&&!this[Li]){this[Li]=!0;const p=a();p!==void 0&&(u.call(this,p),h=p)}return h}function u(h){s&&s!==n?ll(this,s,h):typeof this.setter<"u"?this.setter(n,h,o):this[e]=h}return{get:c,set:u}}function _l(n,t,e={}){Fi(n).set(t,e);const r=Tl(t,e);Object.defineProperty(n.prototype,t,{get(){return r.get.call(this)},set(i){const s=r.get.call(this);r.set.call(this,i),this.onUpdateProperty?.(t,i,s,e)},configurable:!0,enumerable:!0})}function oe(n){return function(t,e){if(typeof e!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");_l(t.constructor,e,n)}}function ur(n){return typeof n=="string"?{...We(n)}:{...We(n),...il(n,["width","style","headEnd","tailEnd"])}}function kl(){return{boxShadow:"none"}}function Al(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Il(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Ol(){return{...Al(),...Il(),...kl(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function El(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function Bl(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Dl(){return{...El(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function Ll(){return{...Bl(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Fl(){return{...Ll(),...Dl(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function vn(n){return zt({...n,color:tt(n.color)?void 0:Bt(n.color),backgroundColor:tt(n.backgroundColor)?void 0:Bt(n.backgroundColor),borderColor:tt(n.borderColor)?void 0:Bt(n.borderColor),outlineColor:tt(n.outlineColor)?void 0:Bt(n.outlineColor),shadowColor:tt(n.shadowColor)?void 0:Bt(n.shadowColor)})}function Ul(){return{...Ol(),...Fl()}}const $l=/\r\n|\n\r|\n|\r/,zl=new RegExp(`^(${$l.source})$`),Ui=`
6
- `;function Nl(n){return zl.test(n)}function $i(n){const t=[];function e(){return t[t.length-1]}function r(a,l,c){const u=a?vn(a):{},h=l?We(l):void 0,p=c?ur(c):void 0,d=zt({...u,fill:h,outline:p,fragments:[]});return t[t.length-1]?.fragments.length===0?t[t.length-1]=d:t.push(d),d}function i(a="",l,c,u){const h=l?vn(l):{},p=c?We(c):void 0,d=u?ur(u):void 0;Array.from(a).forEach(f=>{if(Nl(f)){const{fragments:m,fill:g,outline:M,...P}=e()||r();m.length||m.push(zt({...h,fill:p,outline:d,content:Ui})),r(P,g,M)}else{const m=e()||r(),g=m.fragments[m.fragments.length-1];if(g){const{content:M,fill:P,outline:w,...C}=g;if(cr(p,P)&&cr(d,w)&&cr(h,C)){g.content=`${M}${f}`;return}}m.fragments.push(zt({...h,fill:p,outline:d,content:f}))}})}(Array.isArray(n)?n:[n]).forEach(a=>{if(typeof a=="string")r(),i(a);else if(zi(a)){const{content:l,fill:c,outline:u,...h}=a;r(h,c,u),i(l)}else if(Vl(a)){const{fragments:l,fill:c,outline:u,...h}=a;r(h,c,u),l.forEach(p=>{const{content:d,fill:f,outline:m,...g}=p;i(d,g,f,m)})}else Array.isArray(a)?(r(),a.forEach(l=>{if(typeof l=="string")i(l);else if(zi(l)){const{content:c,fill:u,outline:h,...p}=l;i(c,p,u,h)}})):console.warn("Failed to parse text content",a)});const o=e();return o&&!o.fragments.length&&o.fragments.push({content:Ui}),t}function Vl(n){return n&&typeof n=="object"&&"fragments"in n&&Array.isArray(n.fragments)}function zi(n){return n&&typeof n=="object"&&"content"in n&&typeof n.content=="string"}function jl(n){return typeof n=="string"||Array.isArray(n)?{content:$i(n)}:zt({...n,content:$i(n.content??""),style:n.style?vn(n.style):void 0,effects:n.effects?n.effects.map(t=>vn(t)):void 0,measureDom:n.measureDom,fonts:n.fonts,fill:n.fill?We(n.fill):void 0,outline:n.outline?ur(n.outline):void 0})}function wn(n,t){return typeof n=="number"?n:n.endsWith("%")?(n=n.substring(0,n.length-1),Math.ceil(Number(n)/100*t.total)):n.endsWith("rem")?(n=n.substring(0,n.length-3),Number(n)*t.fontSize):n.endsWith("em")?(n=n.substring(0,n.length-2),Number(n)*t.fontSize):Number(n)}function bn(n){return tt(n)?{}:n}function Ni(n,t){const e=Object.keys(n),r=Object.keys(t);return Array.from(new Set([...e,...r])).every(s=>ge(n[s],t[s]))}function ge(n,t){const e=typeof n;return e===typeof t?e==="object"?Ni(n,t):n===t:!1}function Rl(n){const t=n.startsWith("#")?n.slice(1):n;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(t))return null;const r=t.length===3?t.split("").map(a=>a+a).join(""):t,i=Number.parseInt(r.slice(0,2),16),s=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16);return`rgb(${i}, ${s}, ${o})`}function Sn(n){if(!n)return n;const t={};for(const e in n)n[e]!==""&&n[e]!==void 0&&(t[e]=n[e]);return t}class Vi{constructor(t,e={},r){this.content=t,this.style=e,this.parent=r,this.updateComputedStyle().initCharacters()}inlineBox=new X;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const t=this.computedStyle;return t.textTransform==="uppercase"?this.content.toUpperCase():t.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Sn(this.style)},this}initCharacters(){const t=[];let e=0;for(const r of this.computedContent)t.push(new vi(r,e++,this));return this.characters=t,this}}class ji{constructor(t,e){this.style=t,this.parent=e,this.updateComputedStyle()}lineBox=new X;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Sn(this.parent.computedStyle),...Sn(this.style)},this}addFragment(t,e){const r=new Vi(t,e,this);return this.fragments.push(r),r}}function Gl(n){return n}class He{static notZeroStyles=new Set(["width","height"]);static pxStyles=new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]);_toDomStyle(t){const e={};for(const r in t){const i=t[r];He.notZeroStyles.has(r)&&i===0||(typeof i=="number"&&He.pxStyles.has(r)?e[r]=`${i}px`:e[r]=i)}return e}createDom(t,e){const r=document.createElement("section"),i={...e},s=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"end":case"right":i.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":i.alignItems="flex-start";break;case"middle":i.alignItems="center";break;case"bottom":i.alignItems="flex-end";break}const o=!!(i.justifyContent||i.alignItems);Object.assign(r.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(o?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:o&&s?"100%":void 0,height:o&&!s?"100%":void 0}),t.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(u=>{const h=document.createElement("span");Object.assign(h.style,{verticalAlign:"inherit",...this._toDomStyle(u.style)}),h.appendChild(document.createTextNode(u.content)),c.appendChild(h)}),a.appendChild(c)}),r.appendChild(a),r}measureDOMText(t){const e=document.createRange();e.selectNodeContents(t);const r=t.data??"";let i=0;return Array.from(r).map(s=>{const o=i+=r.substring(i).indexOf(s),a=o+s.length;i+=s.length,e.setStart(t,Math.max(o,0)),e.setEnd(t,a);const l=e.getClientRects?.()??[e.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const u=e.toString();if(u!==""&&c&&c.width+c.height!==0)return{content:u,top:c.top,left:c.left,height:c.height,width:c.width}}).filter(Boolean)}measureDOM(t){const e=[],r=[],i=[];return t.querySelectorAll("li").forEach((s,o)=>{const a=s.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),s.querySelectorAll(":scope > *").forEach((l,c)=>{const u=l.getBoundingClientRect();r.push({paragraphIndex:o,fragmentIndex:c,left:u.left,top:u.top,width:u.width,height:u.height});let h=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDOMText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDOMText(p.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:r,characters:i}}measureParagraphDOM(t,e){const r=e.getBoundingClientRect(),i=this.measureDOM(e);i.paragraphs.forEach(a=>{const l=t[a.paragraphIndex];l.lineBox.left=a.left-r.left,l.lineBox.top=a.top-r.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=t[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-r.left,l.inlineBox.top=a.top-r.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const s=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:u}=a;s.push({...a,newParagraphIndex:l,left:a.left-r.left,top:a.top-r.top});const h=t[l].fragments[c].characters[u],{fontHeight:p,isVertical:d}=h,f=s[o];h.inlineBox.left=f.left,h.inlineBox.top=f.top,h.inlineBox.width=f.width,h.inlineBox.height=f.height,d?(h.lineBox.left=f.left+(f.width-p)/2,h.lineBox.top=f.top,h.lineBox.width=p,h.lineBox.height=f.height):(h.lineBox.left=f.left,h.lineBox.top=f.top+(f.height-p)/2,h.lineBox.width=f.width,h.lineBox.height=p),o++}),{paragraphs:t,boundingBox:new X(0,0,r.width,r.height)}}measure(t,e,r){let i;r||(r=this.createDom(t,e),Object.assign(r.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(r),i=()=>r?.parentNode?.removeChild(r));const s=this.measureParagraphDOM(t,r);return i?.(),s}}function Ri(){const n=new se,t=ir(),e=sr(t);return{name:"background",pathSet:n,load:async r=>{const{backgroundImage:i}=r.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:r=>{n.paths.length=0;const{computedStyle:i,lineBox:s,isVertical:o}=r,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(tt(a))return;const{pathSet:u}=e.parse(a),h=u.getBoundingBox(!0);let p,d,f,m;o?{x:d,y:p,width:m,height:f}=s:{x:p,y:d,width:f,height:m}=s;const g=bn(c??"none"),M=u.paths.map(v=>{const x=v.clone();return x.style.fill&&x.style.fill in g&&(x.style.fill=g[x.style.fill]),x.style.stroke&&x.style.stroke in g&&(x.style.stroke=g[x.style.stroke]),x});let P,w;if(l==="rigid"){P=Math.max(r.fontSize*5/h.width),w=P;const v=new k;v.x=h.width-f/P,v.y=h.height-m/w,M.forEach(x=>{x.applyTransform(S=>{const b=S.x>h.left+h.width/2,D=S.y>h.top+h.height/2;b&&(S.x-=v.x),D&&(S.y-=v.y)})})}else P=f/h.width,w=m/h.height;const C=new Ct;C.translate(-h.x,-h.y),C.scale(P,w),o&&(C.translate(-f/2,-m/2),C.rotate(-Math.PI/2),C.translate(m/2,f/2)),C.translate(p,d),M.forEach(v=>{v.applyTransform(x=>{x.applyMatrix3(C)})}),n.paths.push(...M)},renderOrder:-2,render:(r,i)=>{const{boundingBox:s,computedStyle:o}=i;tt(o.backgroundColor)||(r.fillStyle=o.backgroundColor,r.fillRect(...s.array)),n.paths.forEach(a=>{if(he({ctx:r,path:a,fontSize:o.fontSize}),i.debug){const l=new se([a]).getBoundingBox();l&&r.strokeRect(l.x,l.y,l.width,l.height)}}),i.paragraphs.forEach(a=>{const{lineBox:l,style:c}=a;tt(c.backgroundColor)||(r.fillStyle=c.backgroundColor,r.fillRect(...l.array)),a.fragments.forEach(u=>{const{inlineBox:h,style:p}=u;tt(p.backgroundColor)||(r.fillStyle=p.backgroundColor,r.fillRect(...h.array))})})}}}function Cn(n){const{highlight:t,highlightImage:e,highlightReferImage:r,highlightColormap:i,highlightLine:s,highlightSize:o,highlightThickness:a}=n;return{image:t?.image??e??"none",referImage:t?.referImage??r??"none",colormap:t?.colormap??i??"none",line:t?.line??s??"none",size:t?.size??o??"cover",thickness:t?.thickness??a??"100%"}}function Gi(){const n=new se,t=[],e=ir(),r=sr(e);return{name:"highlight",pathSet:n,load:async i=>{const s=new Set;i.forEachCharacter(o=>{const{computedStyle:a}=o,{image:l,referImage:c}=Cn(a);l&&e.needsLoad(l)&&s.add(l),c&&e.needsLoad(c)&&s.add(c)}),await Promise.all(Array.from(s).map(o=>e.load(o)))},update:i=>{t.length=0,n.paths.length=0;let s=[],o,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,u=Cn(c),{image:h,colormap:p,line:d,size:f,thickness:m}=u;if(tt(h))o?.length&&(o=[],s.push(o));else{const{inlineBox:g,isVertical:M}=l,{fontSize:P}=c;(!a||ge(a.image,h)&&ge(a.colormap,p)&&ge(a.line,d)&&ge(a.size,f)&&ge(a.thickness,m))&&o?.length&&(M?o[0].inlineBox.left===g.left:o[0].inlineBox.top===g.top)&&o[0].fontSize===P?o.push(l):(o=[],o.push(l),s.push(o))}a=u}),s=s.filter(l=>l.length);for(let l=0;l<s.length;l++){const c=s[l],u=c[0],h=X.from(...c.map(O=>O.compatibleGlyphBox));if(!h.height||!h.width)continue;const{computedStyle:p,isVertical:d,inlineBox:f,compatibleGlyphBox:m,strikeoutPosition:g,underlinePosition:M}=u,{fontSize:P}=p,{image:w,referImage:C,colormap:v,line:x,size:S,thickness:b}=Cn(p),D=wn(b,{fontSize:P,total:h.width})/h.width,N=bn(v),{pathSet:E,dom:L}=r.parse(w),z=E.getBoundingBox(!0),B=P/z.width*2,A=new X().copy(h);d&&(A.width=h.height,A.height=h.width,A.left=h.left+h.width);const W=Math.floor(A.width);let I=W;S!=="cover"&&(I=wn(S,{fontSize:P,total:h.width})||W,A.width=I);const U=!tt(C)&&tt(x);if(U)z.copy(r.parse(C).pathSet.getBoundingBox(!0));else{let O;if(tt(x))if(z.width/z.height>4){O="underline";const V=L.getAttribute("viewBox");if(V){const[_,T,F,$]=V.split(" ").map(Z=>Number(Z)),q=T+$/2;z.y<q&&z.y+z.height>q?O="line-through":z.y+z.height<q?O="overline":O="underline"}}else O="outline";else O=x;switch(O){case"outline":{const V=A.width*.2,_=A.height*.2;d?(A.x-=_/2,A.y-=V/2,A.x-=A.height):(A.x-=V/2,A.y-=_/2),A.width+=V,A.height+=_;break}case"overline":A.height=z.height*B,d?A.x=f.left+f.width:A.y=f.top;break;case"line-through":A.height=z.height*B,d?A.x=f.left+f.width-g+A.height/2:A.y=f.top+g-A.height/2;break;case"underline":A.height=z.height*B,d?A.x=m.left+m.width-M:A.y=f.top+M;break}}const j=new Ct;if(j.translate(-z.x,-z.y),j.scale(A.width/z.width,A.height/z.height),d){const O=A.width/2,V=A.height/2;U||j.translate(-O,-V),j.rotate(-Math.PI/2),U||j.translate(V,O)}j.translate(A.x,A.y);for(let O=0;O<Math.ceil(W/I);O++){const V=j.clone();d?V.translate(0,O*A.width):V.translate(O*A.width,0),E.paths.forEach(_=>{const T=_.clone().applyTransform(V);T.style.strokeWidth&&(T.style.strokeWidth*=B*D),T.style.strokeMiterlimit&&(T.style.strokeMiterlimit*=B),T.style.strokeDashoffset&&(T.style.strokeDashoffset*=B),T.style.strokeDasharray&&(T.style.strokeDasharray=T.style.strokeDasharray.map(F=>F*B)),T.style.fill&&T.style.fill in N&&(T.style.fill=N[T.style.fill]),T.style.stroke&&T.style.stroke in N&&(T.style.stroke=N[T.style.stroke]),n.paths.push(T),W!==I&&(d?t[n.paths.length-1]=new X(h.left-h.width*2,h.top,h.width*4,h.height):t[n.paths.length-1]=new X(h.left,h.top-h.height*2,h.width,h.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return n.paths.forEach((s,o)=>{const a=t[o];let l=s.getBoundingBox();if(a){const c=Math.max(l.x,a.x),u=Math.max(l.y,a.y),h=Math.min(l.right,a.right),p=Math.min(l.bottom,a.bottom);l=new X(c,u,h-c,p-u)}i.push(l)}),X.from(...i)},render:(i,s)=>{n.paths.forEach((o,a)=>{if(he({ctx:i,path:o,fontSize:s.computedStyle.fontSize,clipRect:t[a]}),s.debug){const l=new se([o]).getBoundingBox();l&&i.strokeRect(l.x,l.y,l.width,l.height)}})}}}function ql(n,t){return`<svg width="${n*2}" height="${n*2}" xmlns="http://www.w3.org/2000/svg">
4
+ }`)),document.head.appendChild(r),this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(r=>this.familyToUrl.get(r.trim())??this.familyToUrl.get(r)??r)))}get(t){let e;return t&&(e=this._parseUrls(t).reduce((i,o)=>i||this.loaded.get(o),void 0)),e??this.fallbackFont}set(t,e){return this.familyToUrl.set(t,e.src),this.loaded.set(e.src,e),this}delete(t){return this._parseUrls(t).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(t,e={}){const{cancelOther:r,injectFontFace:i=!0,injectStyleTag:o=!0,...s}=e;let a,l;if(typeof t=="string"?a=t:{src:a,family:l}=t,this.loaded.has(a))return r&&(this.loading.forEach(d=>d.cancel()),this.loading.clear()),h(this.loaded.get(a));let c=this.loading.get(a);return c||(c=this._createRequest(a,s),this.loading.set(a,c)),r&&this.loading.forEach((d,f)=>{d!==c&&(d.cancel(),this.loading.delete(f))}),c.when.then(d=>{if(this.loaded.has(a))return h(this.loaded.get(a));{const f=p(d);return e.noAdd||this.loaded.set(a,f),f.familySet.forEach(m=>{this.familyToUrl.set(m,a),typeof document<"u"&&(i&&this.injectFontFace(m,d),o&&this.injectStyleTag(m,a))}),f}}).catch(d=>{if(d instanceof DOMException&&d.message==="The user aborted a request.")return p();throw d}).finally(()=>{this.loading.delete(a)});function u(){return l?Array.isArray(l)?l:[l]:[]}function h(d){return u().forEach(f=>{d.familySet.add(f)}),d}function p(d=new ArrayBuffer(0)){let f;function m(){return f||(f=d.byteLength?_o(d,!1):void 0),f}function g(){const M=m();if(M instanceof qt||M instanceof Wn)return M.sfnt}return{src:a,family:l,buffer:d,familySet:new Set(u()),getFont:m,getSFNT:g}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const ko=new Hn;function Ao(n,t,e=2){const r=t&&t.length,i=r?t[0]*e:n.length;let o=Rr(n,0,i,e,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c;if(r&&(o=Do(n,t,o,e)),n.length>80*e){a=n[0],l=n[1];let u=a,h=l;for(let p=e;p<i;p+=e){const d=n[p],f=n[p+1];d<a&&(a=d),f<l&&(l=f),d>u&&(u=d),f>h&&(h=f)}c=Math.max(u-a,h-l),c=c!==0?32767/c:0}return Ne(o,s,e,a,l,c,0),s}function Rr(n,t,e,r,i){let o;if(i===qo(n,t,e,r)>0)for(let s=t;s<e;s+=r)o=Hr(s/r|0,n[s],n[s+1],o);else for(let s=e-r;s>=t;s-=r)o=Hr(s/r|0,n[s],n[s+1],o);return o&&be(o,o.next)&&(Re(o),o=o.next),o}function pe(n,t){if(!n)return n;t||(t=n);let e=n,r;do if(r=!1,!e.steiner&&(be(e,e.next)||J(e.prev,e,e.next)===0)){if(Re(e),e=t=e.prev,e===e.next)break;r=!0}else e=e.next;while(r||e!==t);return t}function Ne(n,t,e,r,i,o,s){if(!n)return;!s&&o&&zo(n,r,i,o);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(o?Oo(n,r,i,o):Io(n)){t.push(l.i,n.i,c.i),Re(n),n=c.next,a=c.next;continue}if(n=c,n===a){s?s===1?(n=Eo(pe(n),t),Ne(n,t,e,r,i,o,2)):s===2&&Bo(n,t,e,r,i,o):Ne(pe(n),t,e,r,i,o,1);break}}}function Io(n){const t=n.prev,e=n,r=n.next;if(J(t,e,r)>=0)return!1;const i=t.x,o=e.x,s=r.x,a=t.y,l=e.y,c=r.y,u=Math.min(i,o,s),h=Math.min(a,l,c),p=Math.max(i,o,s),d=Math.max(a,l,c);let f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&Ve(i,a,o,l,s,c,f.x,f.y)&&J(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Oo(n,t,e,r){const i=n.prev,o=n,s=n.next;if(J(i,o,s)>=0)return!1;const a=i.x,l=o.x,c=s.x,u=i.y,h=o.y,p=s.y,d=Math.min(a,l,c),f=Math.min(u,h,p),m=Math.max(a,l,c),g=Math.max(u,h,p),M=Xn(d,f,t,e,r),P=Xn(m,g,t,e,r);let w=n.prevZ,C=n.nextZ;for(;w&&w.z>=M&&C&&C.z<=P;){if(w.x>=d&&w.x<=m&&w.y>=f&&w.y<=g&&w!==i&&w!==s&&Ve(a,u,l,h,c,p,w.x,w.y)&&J(w.prev,w,w.next)>=0||(w=w.prevZ,C.x>=d&&C.x<=m&&C.y>=f&&C.y<=g&&C!==i&&C!==s&&Ve(a,u,l,h,c,p,C.x,C.y)&&J(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;w&&w.z>=M;){if(w.x>=d&&w.x<=m&&w.y>=f&&w.y<=g&&w!==i&&w!==s&&Ve(a,u,l,h,c,p,w.x,w.y)&&J(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;C&&C.z<=P;){if(C.x>=d&&C.x<=m&&C.y>=f&&C.y<=g&&C!==i&&C!==s&&Ve(a,u,l,h,c,p,C.x,C.y)&&J(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Eo(n,t){let e=n;do{const r=e.prev,i=e.next.next;!be(r,i)&&qr(r,e,e.next,i)&&je(r,i)&&je(i,r)&&(t.push(r.i,e.i,i.i),Re(e),Re(e.next),e=n=i),e=e.next}while(e!==n);return pe(e)}function Bo(n,t,e,r,i,o){let s=n;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&jo(s,a)){let l=Wr(s,a);s=pe(s,s.next),l=pe(l,l.next),Ne(s,t,e,r,i,o,0),Ne(l,t,e,r,i,o,0);return}a=a.next}s=s.next}while(s!==n)}function Do(n,t,e,r){const i=[];for(let o=0,s=t.length;o<s;o++){const a=t[o]*r,l=o<s-1?t[o+1]*r:n.length,c=Rr(n,a,l,r,!1);c===c.next&&(c.steiner=!0),i.push(Vo(c))}i.sort(Lo);for(let o=0;o<i.length;o++)e=Fo(i[o],e);return e}function Lo(n,t){let e=n.x-t.x;if(e===0&&(e=n.y-t.y,e===0)){const r=(n.next.y-n.y)/(n.next.x-n.x),i=(t.next.y-t.y)/(t.next.x-t.x);e=r-i}return e}function Fo(n,t){const e=Uo(n,t);if(!e)return t;const r=Wr(e,n);return pe(r,r.next),pe(e,e.next)}function Uo(n,t){let e=t;const r=n.x,i=n.y;let o=-1/0,s;if(be(n,e))return e;do{if(be(n,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const h=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=r&&h>o&&(o=h,s=e.x<e.next.x?e:e.next,h===r))return s}e=e.next}while(e!==t);if(!s)return null;const a=s,l=s.x,c=s.y;let u=1/0;e=s;do{if(r>=e.x&&e.x>=l&&r!==e.x&&Gr(i<c?r:o,i,l,c,i<c?o:r,i,e.x,e.y)){const h=Math.abs(i-e.y)/(r-e.x);je(e,n)&&(h<u||h===u&&(e.x>s.x||e.x===s.x&&$o(s,e)))&&(s=e,u=h)}e=e.next}while(e!==a);return s}function $o(n,t){return J(n.prev,n,t.prev)<0&&J(t.next,n,n.next)<0}function zo(n,t,e,r){let i=n;do i.z===0&&(i.z=Xn(i.x,i.y,t,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,No(i)}function No(n){let t,e=1;do{let r=n,i;n=null;let o=null;for(t=0;r;){t++;let s=r,a=0;for(let c=0;c<e&&(a++,s=s.nextZ,!!s);c++);let l=e;for(;a>0||l>0&&s;)a!==0&&(l===0||!s||r.z<=s.z)?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,l--),o?o.nextZ=i:n=i,i.prevZ=o,o=i;r=s}o.nextZ=null,e*=2}while(t>1);return n}function Xn(n,t,e,r,i){return n=(n-e)*i|0,t=(t-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function Vo(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Gr(n,t,e,r,i,o,s,a){return(i-s)*(t-a)>=(n-s)*(o-a)&&(n-s)*(r-a)>=(e-s)*(t-a)&&(e-s)*(o-a)>=(i-s)*(r-a)}function Ve(n,t,e,r,i,o,s,a){return!(n===s&&t===a)&&Gr(n,t,e,r,i,o,s,a)}function jo(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!Ro(n,t)&&(je(n,t)&&je(t,n)&&Go(n,t)&&(J(n.prev,n,t.prev)||J(n,t.prev,t))||be(n,t)&&J(n.prev,n,n.next)>0&&J(t.prev,t,t.next)>0)}function J(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function be(n,t){return n.x===t.x&&n.y===t.y}function qr(n,t,e,r){const i=cn(J(n,t,e)),o=cn(J(n,t,r)),s=cn(J(e,r,n)),a=cn(J(e,r,t));return!!(i!==o&&s!==a||i===0&&ln(n,e,t)||o===0&&ln(n,r,t)||s===0&&ln(e,n,r)||a===0&&ln(e,t,r))}function ln(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function cn(n){return n>0?1:n<0?-1:0}function Ro(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&qr(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function je(n,t){return J(n.prev,n,n.next)<0?J(n,t,n.next)>=0&&J(n,n.prev,t)>=0:J(n,t,n.prev)<0||J(n,n.next,t)<0}function Go(n,t){let e=n,r=!1;const i=(n.x+t.x)/2,o=(n.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&i<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next;while(e!==n);return r}function Wr(n,t){const e=Zn(n.i,n.x,n.y),r=Zn(t.i,t.x,t.y),i=n.next,o=t.prev;return n.next=t,t.prev=n,e.next=i,i.prev=e,r.next=e,e.prev=r,o.next=r,r.prev=o,r}function Hr(n,t,e,r){const i=Zn(n,t,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Zn(n,t,e){return{i:n,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qo(n,t,e,r){let i=0;for(let o=t,s=e-r;o<e;o+=r)i+=(n[s]-n[o])*(n[o+1]+n[s+1]),s=o;return i}function Wo(n,t,e,r={}){const{radius:i=1}=r;n.moveTo(t,e),n.arc(t,e,i,0,Math.PI*2)}const Ho={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Yn(n,t){const{fill:e="#000",stroke:r="none",strokeWidth:i=r==="none"?0:1,strokeLinecap:o="round",strokeLinejoin:s="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:c=0,shadowOffsetX:u=0,shadowOffsetY:h=0,shadowBlur:p=0,shadowColor:d="rgba(0, 0, 0, 0)"}=t;n.fillStyle=e,n.strokeStyle=r,n.lineWidth=i,n.lineCap=o,n.lineJoin=Ho[s],n.miterLimit=a,n.setLineDash(l),n.lineDashOffset=c,n.shadowOffsetX=u,n.shadowOffsetY=h,n.shadowBlur=p,n.shadowColor=d}class k{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new k(1/0,1/0)}static get MIN(){return new k(-1/0,-1/0)}get array(){return[this.x,this.y]}finite(){return this.x=Number.isFinite(this.x)?this.x:0,this.y=Number.isFinite(this.y)?this.y:0,this}set(t,e){return this.x=t,this.y=e,this}add(t){return this.x+=t.x,this.y+=t.y,this}sub(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}divide(t){return this.x/=t.x,this.y/=t.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}rotate(t,e={x:0,y:0}){const r=-t/180*Math.PI,i=this.x-e.x,o=-(this.y-e.y),s=Math.sin(r),a=Math.cos(r);return this.set(e.x+(i*a-o*s),e.y-(i*s+o*a)),this}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y;return e*e+r*r}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(t,e=t,r={x:0,y:0}){const i=t<0?r.x-this.x+r.x:this.x,o=e<0?r.y-this.y+r.y:this.y;return this.x=i*Math.abs(t),this.y=o*Math.abs(e),this}skew(t,e=0,r={x:0,y:0}){const i=this.x-r.x,o=this.y-r.y;return this.x=r.x+(i+Math.tan(t)*o),this.y=r.y+(o+Math.tan(e)*i),this}min(...t){return this.x=Math.min(this.x,...t.map(e=>e.x)),this.y=Math.min(this.y,...t.map(e=>e.y)),this}max(...t){return this.x=Math.max(this.x,...t.map(e=>e.x)),this.y=Math.max(this.y,...t.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}divideVectors(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}equals(t){return this.x===t.x&&this.y===t.y}applyMatrix3(t){const e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new k(this.x,this.y)}}class X{constructor(t=0,e=0,r=0,i=0){this.left=t,this.top=e,this.width=r,this.height=i}get x(){return this.left}set x(t){this.left=t}get y(){return this.top}set y(t){this.top=t}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new k((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...t){if(t.length===0)return new X;if(t.length===1)return t[0].clone();const e=t[0],r=t.slice(1).reduce((i,o)=>(i.left=Math.min(i.left,o.left),i.top=Math.min(i.top,o.top),i.right=Math.max(i.right,o.right),i.bottom=Math.max(i.bottom,o.bottom),i),{left:e?.left??0,top:e?.top??0,right:e?.right??0,bottom:e?.bottom??0});return new X(r.left,r.top,r.right-r.left,r.bottom-r.top)}translate(t,e){return this.left+=t,this.top+=e,this}copy(t){return this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height,this}clone(){return new X(this.left,this.top,this.width,this.height)}}class Ct{elements=[];constructor(t=1,e=0,r=0,i=0,o=1,s=0,a=0,l=0,c=1){this.set(t,e,r,i,o,s,a,l,c)}set(t,e,r,i,o,s,a,l,c){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const r=t.elements,i=e.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],h=r[7],p=r[2],d=r[5],f=r[8],m=i[0],g=i[3],M=i[6],P=i[1],w=i[4],C=i[7],v=i[2],x=i[5],S=i[8];return o[0]=s*m+a*P+l*v,o[3]=s*g+a*w+l*x,o[6]=s*M+a*C+l*S,o[1]=c*m+u*P+h*v,o[4]=c*g+u*w+h*x,o[7]=c*M+u*C+h*S,o[2]=p*m+d*P+f*v,o[5]=p*g+d*w+f*x,o[8]=p*M+d*C+f*S,this}invert(){const t=this.elements,e=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,p=a*l-u*o,d=c*o-s*l,f=e*h+r*p+i*d;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/f;return t[0]=h*m,t[1]=(i*c-u*r)*m,t[2]=(a*r-i*s)*m,t[3]=p*m,t[4]=(u*e-i*l)*m,t[5]=(i*o-a*e)*m,t[6]=d*m,t[7]=(r*l-c*e)*m,t[8]=(s*e-r*o)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}scale(t,e){return this.premultiply(Kn.makeScale(t,e)),this}rotate(t){return this.premultiply(Kn.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kn.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Kn=new Ct;function Xr(n,t,e,r){const i=n*e+t*r,o=Math.sqrt(n*n+t*t)*Math.sqrt(e*e+r*r);let s=Math.acos(Math.max(-1,Math.min(1,i/o)));return n*r-t*e<0&&(s=-s),s}function Xo(n,t,e,r,i,o,s,a){if(t===0||e===0){n.lineTo(a.x,a.y);return}r=r*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const l=(s.x-a.x)/2,c=(s.y-a.y)/2,u=Math.cos(r)*l+Math.sin(r)*c,h=-Math.sin(r)*l+Math.cos(r)*c;let p=t*t,d=e*e;const f=u*u,m=h*h,g=f/p+m/d;if(g>1){const N=Math.sqrt(g);t=N*t,e=N*e,p=t*t,d=e*e}const M=p*m+d*f,P=(p*d-M)/M;let w=Math.sqrt(Math.max(0,P));i===o&&(w=-w);const C=w*t*h/e,v=-w*e*u/t,x=Math.cos(r)*C-Math.sin(r)*v+(s.x+a.x)/2,S=Math.sin(r)*C+Math.cos(r)*v+(s.y+a.y)/2,b=Xr(1,0,(u-C)/t,(h-v)/e),D=Xr((u-C)/t,(h-v)/e,(-u-C)/t,(-h-v)/e)%(Math.PI*2);n.ellipse(x,S,t,e,r,b,b+D,o===0)}const it={WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Wt(n,t,e=0){let a=0,l=!0,c="",u="";const h=[];function p(g,M,P){const w=new SyntaxError(`Unexpected character "${g}" at index ${M}.`);throw w.partial=P,w}function d(){c!==""&&(u===""?h.push(Number(c)):h.push(Number(c)*10**Number(u))),c="",u=""}let f;const m=n.length;for(let g=0;g<m;g++){if(f=n[g],Array.isArray(t)&&t.includes(h.length%e)&&it.FLAGS.test(f)){a=1,c=f,d();continue}if(a===0){if(it.WHITESPACE.test(f))continue;if(it.DIGIT.test(f)||it.SIGN.test(f)){a=1,c=f;continue}if(it.POINT.test(f)){a=2,c=f;continue}it.COMMA.test(f)&&(l&&p(f,g,h),l=!0)}if(a===1){if(it.DIGIT.test(f)){c+=f;continue}if(it.POINT.test(f)){c+=f,a=2;continue}if(it.EXP.test(f)){a=3;continue}it.SIGN.test(f)&&c.length===1&&it.SIGN.test(c[0])&&p(f,g,h)}if(a===2){if(it.DIGIT.test(f)){c+=f;continue}if(it.EXP.test(f)){a=3;continue}it.POINT.test(f)&&c[c.length-1]==="."&&p(f,g,h)}if(a===3){if(it.DIGIT.test(f)){u+=f;continue}if(it.SIGN.test(f)){if(u===""){u+=f;continue}u.length===1&&it.SIGN.test(u)&&p(f,g,h)}}it.WHITESPACE.test(f)?(d(),a=0,l=!1):it.COMMA.test(f)?(d(),a=0,l=!0):it.SIGN.test(f)?(d(),a=1,c=f):it.POINT.test(f)?(d(),a=2,c=f):p(f,g,h)}return d(),h}function Se(n,t){return n-(t-n)}function Zr(n,t){const e=new k,r=new k;for(let i=0,o=n.length;i<o;i++){const s=n[i];if(s.type==="m"||s.type==="M")s.type==="m"?e.add(s):e.copy(s),t.moveTo(e.x,e.y),r.copy(e);else if(s.type==="h"||s.type==="H")s.type==="h"?e.x+=s.x:e.x=s.x,t.lineTo(e.x,e.y),r.copy(e);else if(s.type==="v"||s.type==="V")s.type==="v"?e.y+=s.y:e.y=s.y,t.lineTo(e.x,e.y),r.copy(e);else if(s.type==="l"||s.type==="L")s.type==="l"?e.add(s):e.copy(s),t.lineTo(e.x,e.y),r.copy(e);else if(s.type==="c"||s.type==="C")s.type==="c"?(t.bezierCurveTo(e.x+s.x1,e.y+s.y1,e.x+s.x2,e.y+s.y2,e.x+s.x,e.y+s.y),r.x=e.x+s.x2,r.y=e.y+s.y2,e.add(s)):(t.bezierCurveTo(s.x1,s.y1,s.x2,s.y2,s.x,s.y),r.x=s.x2,r.y=s.y2,e.copy(s));else if(s.type==="s"||s.type==="S")s.type==="s"?(t.bezierCurveTo(Se(e.x,r.x),Se(e.y,r.y),e.x+s.x2,e.y+s.y2,e.x+s.x,e.y+s.y),r.x=e.x+s.x2,r.y=e.y+s.y2,e.add(s)):(t.bezierCurveTo(Se(e.x,r.x),Se(e.y,r.y),s.x2,s.y2,s.x,s.y),r.x=s.x2,r.y=s.y2,e.copy(s));else if(s.type==="q"||s.type==="Q")s.type==="q"?(t.quadraticCurveTo(e.x+s.x1,e.y+s.y1,e.x+s.x,e.y+s.y),r.x=e.x+s.x1,r.y=e.y+s.y1,e.add(s)):(t.quadraticCurveTo(s.x1,s.y1,s.x,s.y),r.x=s.x1,r.y=s.y1,e.copy(s));else if(s.type==="t"||s.type==="T"){const a=Se(e.x,r.x),l=Se(e.y,r.y);r.x=a,r.y=l,s.type==="t"?(t.quadraticCurveTo(a,l,e.x+s.x,e.y+s.y),e.add(s)):(t.quadraticCurveTo(a,l,s.x,s.y),e.copy(s))}else if(s.type==="a"||s.type==="A"){const a=e.clone();if(s.type==="a"){if(s.x===0&&s.y===0)continue;e.add(s)}else{if(e.equals(s))continue;e.copy(s)}r.copy(e),Xo(t,s.rx,s.ry,s.angle,s.largeArcFlag,s.sweepFlag,a,e)}else s.type==="z"||s.type==="Z"?(t.startPoint&&e.copy(t.startPoint),t.closePath()):console.warn("Unsupported commands",s)}}function Zo(n){let t,e;const r=[];for(let i=0,o=n.length;i<o;i++){const s=n[i];switch(s.type){case"m":case"M":if(s.x.toFixed(4)===e?.x.toFixed(4)&&s.y.toFixed(4)===e?.y.toFixed(4))continue;r.push(`${s.type} ${s.x} ${s.y}`),e={x:s.x,y:s.y},t={x:s.x,y:s.y};break;case"h":case"H":r.push(`${s.type} ${s.x}`),e={x:s.x,y:e?.y??0};break;case"v":case"V":r.push(`${s.type} ${s.y}`),e={x:e?.x??0,y:s.y};break;case"l":case"L":r.push(`${s.type} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"c":case"C":r.push(`${s.type} ${s.x1} ${s.y1} ${s.x2} ${s.y2} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"s":case"S":r.push(`${s.type} ${s.x2} ${s.y2} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"q":case"Q":r.push(`${s.type} ${s.x1} ${s.y1} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"t":case"T":r.push(`${s.type} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"a":case"A":r.push(`${s.type} ${s.rx} ${s.ry} ${s.angle} ${s.largeArcFlag} ${s.sweepFlag} ${s.x} ${s.y}`),e={x:s.x,y:s.y};break;case"z":case"Z":r.push(s.type),t&&(e={x:t.x,y:t.y});break}}return r.join(" ")}const Yo=/[a-df-z][^a-df-z]*/gi;function Yr(n){const t=[],e=n.match(Yo);if(!e)return t;for(let r=0,i=e.length;r<i;r++){const o=e[r],s=o.charAt(0),a=o.slice(1).trim();let l;switch(s){case"m":case"M":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)c===0?t.push({type:s,x:l[c],y:l[c+1]}):t.push({type:s==="m"?"l":"L",x:l[c],y:l[c+1]});break;case"h":case"H":l=Wt(a);for(let c=0,u=l.length;c<u;c++)t.push({type:s,x:l[c]});break;case"v":case"V":l=Wt(a);for(let c=0,u=l.length;c<u;c++)t.push({type:s,y:l[c]});break;case"l":case"L":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)t.push({type:s,x:l[c],y:l[c+1]});break;case"c":case"C":l=Wt(a);for(let c=0,u=l.length;c<u;c+=6)t.push({type:s,x1:l[c],y1:l[c+1],x2:l[c+2],y2:l[c+3],x:l[c+4],y:l[c+5]});break;case"s":case"S":l=Wt(a);for(let c=0,u=l.length;c<u;c+=4)t.push({type:s,x2:l[c],y2:l[c+1],x:l[c+2],y:l[c+3]});break;case"q":case"Q":l=Wt(a);for(let c=0,u=l.length;c<u;c+=4)t.push({type:s,x1:l[c],y1:l[c+1],x:l[c+2],y:l[c+3]});break;case"t":case"T":l=Wt(a);for(let c=0,u=l.length;c<u;c+=2)t.push({type:s,x:l[c],y:l[c+1]});break;case"a":case"A":l=Wt(a,[3,4],7);for(let c=0,u=l.length;c<u;c+=7)t.push({type:s,rx:l[c],ry:l[c+1],angle:l[c+2],largeArcFlag:l[c+3],sweepFlag:l[c+4],x:l[c+5],y:l[c+6]});break;case"z":case"Z":t.push({type:s});break;default:console.warn(o)}}return t}const Kr="data:image/svg+xml;",Qr=`${Kr}base64,`,Jr=`${Kr}charset=utf8,`;function ti(n){if(typeof n=="string"){let t;n.startsWith(Qr)?(n=n.substring(Qr.length,n.length),t=atob(n)):n.startsWith(Jr)?(n=n.substring(Jr.length,n.length),t=decodeURIComponent(n)):t=n;const e=new DOMParser().parseFromString(t,"text/xml"),r=e.querySelector("parsererror");if(r)throw new Error(`${r.textContent??"parser error"}
5
+ ${t}`);return e.documentElement}else return n}const Ko="px",Qo=90,ei=["mm","cm","in","pt","pc","px"],ni={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function Y(n){let t="px";if(typeof n=="string")for(let r=0,i=ei.length;r<i;r++){const o=ei[r];if(n.endsWith(o)){t=o,n=n.substring(0,n.length-o.length);break}}let e;return e=ni[t][Ko],e<0&&(e=ni[t].in*Qo),e*Number.parseFloat(n)}const Jo=new Ct,hn=new Ct,ri=new Ct,ii=new Ct;function ta(n,t,e){if(!(n.hasAttribute("transform")||n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))))return null;const r=ea(n);return e.length>0&&r.premultiply(e[e.length-1]),t.copy(r),e.push(r),r}function ea(n){const t=new Ct,e=Jo;if(n.nodeName==="use"&&(n.hasAttribute("x")||n.hasAttribute("y"))&&t.translate(Y(n.getAttribute("x")),Y(n.getAttribute("y"))),n.hasAttribute("transform")){const r=n.getAttribute("transform").split(")");for(let i=r.length-1;i>=0;i--){const o=r[i].trim();if(o==="")continue;const s=o.indexOf("("),a=o.length;if(s>0&&s<a){const l=o.slice(0,s),c=Wt(o.slice(s+1));switch(e.identity(),l){case"translate":if(c.length>=1){const u=c[0];let h=0;c.length>=2&&(h=c[1]),e.translate(u,h)}break;case"rotate":if(c.length>=1){let u=0,h=0,p=0;u=c[0]*Math.PI/180,c.length>=3&&(h=c[1],p=c[2]),hn.makeTranslation(-h,-p),ri.makeRotation(u),ii.multiplyMatrices(ri,hn),hn.makeTranslation(h,p),e.multiplyMatrices(hn,ii)}break;case"scale":c.length>=1&&e.scale(c[0],c[1]??c[0]);break;case"skewX":c.length===1&&e.set(1,Math.tan(c[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":c.length===1&&e.set(1,0,0,Math.tan(c[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":c.length===6&&e.set(c[0],c[2],c[4],c[1],c[3],c[5],0,0,1);break}}t.premultiply(e)}}return t}function na(n){return new Tt().arc(Y(n.getAttribute("cx")||0),Y(n.getAttribute("cy")||0),Y(n.getAttribute("r")||0),0,Math.PI*2)}function ra(n,t){if(!(!n.sheet||!n.sheet.cssRules||!n.sheet.cssRules.length))for(let e=0;e<n.sheet.cssRules.length;e++){const r=n.sheet.cssRules[e];if(r.type!==1)continue;const i=r.selectorText.split(/,/g).filter(Boolean).map(s=>s.trim()),o={};for(let s=r.style.length,a=0;a<s;a++){const l=r.style.item(a);o[l]=r.style.getPropertyValue(l)}for(let s=0;s<i.length;s++)t[i[s]]=Object.assign(t[i[s]]||{},{...o})}}function ia(n){return new Tt().ellipse(Y(n.getAttribute("cx")||0),Y(n.getAttribute("cy")||0),Y(n.getAttribute("rx")||0),Y(n.getAttribute("ry")||0),0,0,Math.PI*2)}function sa(n){return new Tt().moveTo(Y(n.getAttribute("x1")||0),Y(n.getAttribute("y1")||0)).lineTo(Y(n.getAttribute("x2")||0),Y(n.getAttribute("y2")||0))}function oa(n){const t=new Tt,e=n.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const aa=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function la(n){const t=new Tt;let e=0;return n.getAttribute("points")?.replace(aa,(r,i,o)=>{const s=Y(i),a=Y(o);return e===0?t.moveTo(s,a):t.lineTo(s,a),e++,r}),t.currentCurve.autoClose=!0,t}const ca=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function ha(n){const t=new Tt;let e=0;return n.getAttribute("points")?.replace(ca,(r,i,o)=>{const s=Y(i),a=Y(o);return e===0?t.moveTo(s,a):t.lineTo(s,a),e++,r}),t.currentCurve.autoClose=!1,t}function ua(n){const t=Y(n.getAttribute("x")||0),e=Y(n.getAttribute("y")||0),r=Y(n.getAttribute("rx")||n.getAttribute("ry")||0),i=Y(n.getAttribute("ry")||n.getAttribute("rx")||0),o=Y(n.getAttribute("width")),s=Y(n.getAttribute("height")),a=1-.551915024494,l=new Tt;return l.moveTo(t+r,e),l.lineTo(t+o-r,e),(r!==0||i!==0)&&l.bezierCurveTo(t+o-r*a,e,t+o,e+i*a,t+o,e+i),l.lineTo(t+o,e+s-i),(r!==0||i!==0)&&l.bezierCurveTo(t+o,e+s-i*a,t+o-r*a,e+s,t+o-r,e+s),l.lineTo(t+r,e+s),(r!==0||i!==0)&&l.bezierCurveTo(t+r*a,e+s,t,e+s-i*a,t,e+s-i),l.lineTo(t,e+i),(r!==0||i!==0)&&l.bezierCurveTo(t,e+i*a,t+r*a,e,t+r,e),l}function Ht(n,t,e){t=Object.assign({},t);let r={};if(n.hasAttribute("class")){const c=n.getAttribute("class").split(/\s/).filter(Boolean).map(u=>u.trim());for(let u=0;u<c.length;u++)r=Object.assign(r,e[`.${c[u]}`])}n.hasAttribute("id")&&(r=Object.assign(r,e[`#${n.getAttribute("id")}`]));for(let c=n.style.length,u=0;u<c;u++){const h=n.style.item(u),p=n.style.getPropertyValue(h);t[h]=p,r[h]=p}function i(c,u,h=o){n.hasAttribute(c)&&(t[u]=h(n.getAttribute(c))),r[c]&&(t[u]=h(r[c]))}function o(c){return c.startsWith("url")&&console.warn("url access in attributes is not implemented."),c}function s(c){return Math.max(0,Math.min(1,Y(c)))}function a(c){return Math.max(0,Y(c))}function l(c){return c.split(" ").filter(u=>u!=="").map(u=>Y(u))}return i("fill","fill"),i("fill-opacity","fillOpacity",s),i("fill-rule","fillRule"),i("opacity","opacity",s),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",s),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",Y),i("visibility","visibility"),t}function Qn(n,t,e=[],r={}){if(n.nodeType!==1)return e;let i=!1,o=null,s={...t};switch(n.nodeName){case"svg":s=Ht(n,s,r);break;case"style":ra(n,r);break;case"g":s=Ht(n,s,r);break;case"path":s=Ht(n,s,r),n.hasAttribute("d")&&(o=oa(n));break;case"rect":s=Ht(n,s,r),o=ua(n);break;case"polygon":s=Ht(n,s,r),o=la(n);break;case"polyline":s=Ht(n,s,r),o=ha(n);break;case"circle":s=Ht(n,s,r),o=na(n);break;case"ellipse":s=Ht(n,s,r),o=ia(n);break;case"line":s=Ht(n,s,r),o=sa(n);break;case"defs":i=!0;break;case"use":{s=Ht(n,s,r);const p=(n.getAttributeNS("http://www.w3.org/1999/xlink","href")||n.getAttribute("href")||"").substring(1),d=n.viewportElement?.getElementById(p);d?Qn(d,s,e,r):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(n);break}if(s.display==="none")return e;const a=new Ct,l=[],c=ta(n,a,l);o&&(o.applyTransform(a),e.push(o),o.style={...s});const u=n.childNodes;for(let h=0,p=u.length;h<p;h++){const d=u[h];i&&d.nodeName!=="style"&&d.nodeName!=="defs"||Qn(d,s,e,r)}return c&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function si(n){const t=ti(n);return new se(Qn(t,{}),t.getAttribute("viewBox")?.trim().split(" ").map(e=>Number(e)))}function oi(n,t,e,r,i){const o=(r-t)*.5,s=(i-e)*.5,a=n*n,l=n*a;return(2*e-2*r+o+s)*l+(-3*e+3*r-2*o-s)*a+o*n+e}function fa(n,t){const e=1-n;return e*e*e*t}function pa(n,t){const e=1-n;return 3*e*e*n*t}function da(n,t){return 3*(1-n)*n*n*t}function ga(n,t){return n*n*n*t}function ai(n,t,e,r,i){return fa(n,t)+pa(n,e)+da(n,r)+ga(n,i)}function li(n,t={}){let{vertices:e=[],indices:r=[],holes:i=[],verticesStride:o=2,verticesOffset:s=e.length/o,indicesOffset:a=r.length}=t;const l=Ao(n,i,2);if(l.length){for(let u=0;u<l.length;u+=3)r[a++]=l[u]+s,r[a++]=l[u+1]+s,r[a++]=l[u+2]+s;let c=s*o;for(let u=0;u<n.length;u+=2)e[c]=n[u],e[c+1]=n[u+1],c+=o}return{vertices:e,indices:r}}const ya=8,un=11920929e-14,ma=1;function xa(n,t,e,r,i,o,s,a,l=.5,c=[]){const h=Math.min(.99,Math.max(0,l));let p=(ma-h)/1;return p*=p,Jn(n,t,e,r,i,o,s,a,c,p,0),c.push(s,a),c}function Jn(n,t,e,r,i,o,s,a,l,c,u){if(u>ya)return;const h=(n+e)/2,p=(t+r)/2,d=(e+i)/2,f=(r+o)/2,m=(i+s)/2,g=(o+a)/2,M=(h+d)/2,P=(p+f)/2,w=(d+m)/2,C=(f+g)/2,v=(M+w)/2,x=(P+C)/2;if(u>0){let S=s-n,b=a-t;const D=Math.abs((e-s)*b-(r-a)*S),N=Math.abs((i-s)*b-(o-a)*S);if(D>un&&N>un){if((D+N)*(D+N)<=c*(S*S+b*b)){l.push(v,x);return}}else if(D>un){if(D*D<=c*(S*S+b*b)){l.push(v,x);return}}else if(N>un){if(N*N<=c*(S*S+b*b)){l.push(v,x);return}}else if(S=v-(n+s)/2,b=x-(t+a)/2,S*S+b*b<=c){l.push(v,x);return}}Jn(n,t,h,p,M,P,v,x,l,c,u+1),Jn(v,x,w,C,m,g,s,a,l,c,u+1)}const va=8,wa=11920929e-14,ba=1;function Sa(n,t,e,r,i,o,s=.5,a=[]){const c=Math.min(.99,Math.max(0,s));let u=(ba-c)/1;return u*=u,tr(a,n,t,e,r,i,o,u,0),a.push(i,o),a}function tr(n,t,e,r,i,o,s,a,l){if(l>va)return;const c=(t+r)/2,u=(e+i)/2,h=(r+o)/2,p=(i+s)/2,d=(c+h)/2,f=(u+p)/2;let m=o-t,g=s-e;const M=Math.abs((r-o)*g-(i-s)*m);if(M>wa){if(M*M<=a*(m*m+g*g)){n.push(d,f);return}}else if(m=d-(t+o)/2,g=f-(e+s)/2,m*m+g*g<=a){n.push(d,f);return}tr(n,t,e,c,u,d,f,a,l+1),tr(n,d,f,h,p,o,s,a,l+1)}function Ca(n){return n.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Ma(n,t,e,r){const i=t.clone().sub(n),o=r.clone().sub(e),s=e.clone().sub(n),a=i.cross(o);if(a===0)return new k((n.x+e.x)/2,(n.y+e.y)/2);const l=s.cross(o)/a;return Math.abs(l)>1?new k((n.x+e.x)/2,(n.y+e.y)/2):new k(n.x+l*i.x,n.y+l*i.y)}function Pa(n){let t=0;const e=n.length/2;for(let r=0;r<e;r++){const i=n[2*r],o=n[2*r+1],s=(r+1)%e,a=n[2*s],l=n[2*s+1];t+=(a-i)*(l+o)}return t}function ci(n,t,e,r,i,o){return(e-n)*(o-t)-(i-n)*(r-t)}function Ta(n,t,e){const r=e.length;let i=0;for(let o=0,s=r-2;o<r;s=o,o+=2){const a=e[o],l=e[o+1],c=e[s],u=e[s+1];l<=t?u>t&&ci(c,u,a,l,n,t)>0&&i++:u<=t&&ci(c,u,a,l,n,t)<0&&i--}return i}function _a(n){const t=n.length,e=n.map((r,i)=>({index:i,parentIndex:null,wn:0}));for(let r=0;r<t;r++){let i=null;if(Pa(n[r])<0)continue;const o=[n[r][0],n[r][1]];for(let s=0;s<t;s++){if(r===s)continue;let a=0;for(let c=0;c<o.length&&(a=a||Ta(o[c],o[c+1],n[s]),!a);c+=2);const l=Math.abs(a);l!==0&&(!i||l>Math.abs(i.wn))&&(i={idx:s,wn:a})}i&&(e[r].parentIndex=i.idx,e[r].wn=i.wn)}return e}function ka(n,t){const e=1-n;return e*e*t}function Aa(n,t){return 2*(1-n)*n*t}function Ia(n,t){return n*n*t}function hi(n,t,e,r){return ka(n,t)+Aa(n,e)+Ia(n,r)}const Oa=1e-4,ui=1e-4;function Ea(n,t={}){const{vertices:e=[],indices:r=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:o=!1,closed:s=!0}=t,a=Oa;if(n.length===0)return{vertices:e,indices:r};const l=i;let c=l.alignment;if(i.alignment!==.5){let O=Ba(n);o&&(O*=-1),c=(c-.5)*O+.5}const u={x:n[0],y:n[1]},h={x:n[n.length-2],y:n[n.length-1]},p=s,d=Math.abs(u.x-h.x)<a&&Math.abs(u.y-h.y)<a;if(p){n=n.slice(),d&&(n.pop(),n.pop(),h.x=n[n.length-2],h.y=n[n.length-1]);const O=(u.x+h.x)*.5,V=(h.y+u.y)*.5;n.unshift(O,V),n.push(O,V)}const f=e,m=n.length/2;let g=n.length;const M=f.length/2,P=l.width/2,w=P*P,C=l.miterLimit*l.miterLimit;let v=n[0],x=n[1],S=n[2],b=n[3],D=0,N=0,E=-(x-b),L=v-S,z=0,B=0,A=Math.sqrt(E*E+L*L);E/=A,L/=A,E*=P,L*=P;const W=c,I=(1-W)*2,U=W*2;p||(l.cap==="round"?g+=de(v-E*(I-U)*.5,x-L*(I-U)*.5,v-E*I,x-L*I,v+E*U,x+L*U,f,!0)+2:l.cap==="square"&&(g+=fi(v,x,E,L,I,U,!0,f))),f.push(v-E*I,x-L*I),f.push(v+E*U,x+L*U);for(let O=1;O<m-1;++O){v=n[(O-1)*2],x=n[(O-1)*2+1],S=n[O*2],b=n[O*2+1],D=n[(O+1)*2],N=n[(O+1)*2+1],E=-(x-b),L=v-S,A=Math.sqrt(E*E+L*L),E/=A,L/=A,E*=P,L*=P,z=-(b-N),B=S-D,A=Math.sqrt(z*z+B*B),z/=A,B/=A,z*=P,B*=P;const V=S-v,_=x-b,T=S-D,F=N-b,$=V*T+_*F,q=_*T-F*V,Z=q<0;if(Math.abs(q)<.001*Math.abs($)){f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),$>=0&&(l.join==="round"?g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+4:g+=2,f.push(S-z*U,b-B*U),f.push(S+z*I,b+B*I));continue}const nt=(-E+v)*(-L+b)-(-E+S)*(-L+x),Zt=(-z+D)*(-B+b)-(-z+S)*(-B+N),Dt=(V*Zt-T*nt)/q,Mt=(F*nt-_*Zt)/q,_t=(Dt-S)*(Dt-S)+(Mt-b)*(Mt-b),ht=S+(Dt-S)*I,kt=b+(Mt-b)*I,Vt=S-(Dt-S)*U,jt=b-(Mt-b)*U,Lt=Math.min(V*V+_*_,T*T+F*F),Zi=Z?I:U,Xl=Lt+Zi*Zi*w;_t<=Xl?l.join==="bevel"||_t/w>C?(Z?(f.push(ht,kt),f.push(S+E*U,b+L*U),f.push(ht,kt),f.push(S+z*U,b+B*U)):(f.push(S-E*I,b-L*I),f.push(Vt,jt),f.push(S-z*I,b-B*I),f.push(Vt,jt)),g+=2):l.join==="round"?Z?(f.push(ht,kt),f.push(S+E*U,b+L*U),g+=de(S,b,S+E*U,b+L*U,S+z*U,b+B*U,f,!0)+4,f.push(ht,kt),f.push(S+z*U,b+B*U)):(f.push(S-E*I,b-L*I),f.push(Vt,jt),g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+4,f.push(S-z*I,b-B*I),f.push(Vt,jt)):(f.push(ht,kt),f.push(Vt,jt)):(f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),l.join==="round"?Z?g+=de(S,b,S+E*U,b+L*U,S+z*U,b+B*U,f,!0)+2:g+=de(S,b,S-E*I,b-L*I,S-z*I,b-B*I,f,!1)+2:l.join==="miter"&&_t/w<=C&&(Z?(f.push(Vt,jt),f.push(Vt,jt)):(f.push(ht,kt),f.push(ht,kt)),g+=2),f.push(S-z*I,b-B*I),f.push(S+z*U,b+B*U),g+=2)}v=n[(m-2)*2],x=n[(m-2)*2+1],S=n[(m-1)*2],b=n[(m-1)*2+1],E=-(x-b),L=v-S,A=Math.sqrt(E*E+L*L),E/=A,L/=A,E*=P,L*=P,f.push(S-E*I,b-L*I),f.push(S+E*U,b+L*U),p||(l.cap==="round"?g+=de(S-E*(I-U)*.5,b-L*(I-U)*.5,S-E*I,b-L*I,S+E*U,b+L*U,f,!1)+2:l.cap==="square"&&(g+=fi(S,b,E,L,I,U,!1,f)));const j=ui*ui;for(let O=M;O<g+M-2;++O)v=f[O*2],x=f[O*2+1],S=f[(O+1)*2],b=f[(O+1)*2+1],D=f[(O+2)*2],N=f[(O+2)*2+1],!(Math.abs(v*(b-N)+S*(N-x)+D*(x-b))<j)&&r.push(O,O+1,O+2);return{vertices:e,indices:r}}function Ba(n){const t=n.length;if(t<6)return 1;let e=0;for(let r=0,i=n[t-2],o=n[t-1];r<t;r+=2){const s=n[r],a=n[r+1];e+=(s-i)*(a+o),i=s,o=a}return e<0?-1:1}function fi(n,t,e,r,i,o,s,a){const l=n-e*i,c=t-r*i,u=n+e*o,h=t+r*o;let p,d;s?(p=r,d=-e):(p=-r,d=e);const f=l+p,m=c+d,g=u+p,M=h+d;return a.push(f,m),a.push(g,M),2}function de(n,t,e,r,i,o,s,a){const l=e-n,c=r-t;let u=Math.atan2(l,c),h=Math.atan2(i-n,o-t);a&&u<h?u+=Math.PI*2:!a&&u>h&&(h+=Math.PI*2);let p=u;const d=h-u,f=Math.abs(d),m=Math.sqrt(l*l+c*c),g=(15*f*Math.sqrt(m)/Math.PI>>0)+1,M=d/g;if(p+=M,a){s.push(n,t),s.push(e,r);for(let P=1,w=p;P<g;P++,w+=M)s.push(n,t),s.push(n+Math.sin(w)*m,t+Math.cos(w)*m);s.push(n,t),s.push(i,o)}else{s.push(e,r),s.push(n,t);for(let P=1,w=p;P<g;P++,w+=M)s.push(n+Math.sin(w)*m,t+Math.cos(w)*m),s.push(n,t);s.push(i,o),s.push(n,t)}return g*2}class Ce{arcLengthDivision=200;_arcLengths;getPointAt(t,e=new k){return this.getPoint(this.getUToTMapping(t),e)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(t){const e=typeof t=="function";return this.getControlPointRefs().forEach(r=>{e?t(r):r.applyMatrix3(t)}),this}getUnevenVertices(t=5,e=[]){const r=new k;for(let i=0,o=Math.max(1,t)-1;i<=o;i++)this.getPoint(i/o,r),e.push(r.x,r.y);return e}getSpacedVertices(t=5,e=[]){const r=new k;for(let i=0,o=Math.max(1,t)-1;i<=o;i++)this.getPointAt(i/o,r),e.push(r.x,r.y);return e}getAdaptiveVertices(t=[]){return this.getUnevenVertices(5,t)}_verticesToPoints(t,e=[]){for(let r=0,i=t.length;r<i;r+=2){const o=t[r],s=t[r+1];e.push(new k(o,s))}return e}getSpacedPoints(t,e=[]){const r=this.getSpacedVertices(t);return this._verticesToPoints(r,e),e}getUnevenPoints(t,e=[]){const r=this.getUnevenVertices(t);return this._verticesToPoints(r,e),e}getAdaptivePoints(t=[]){const e=this.getAdaptiveVertices();return this._verticesToPoints(e,t),t}getPoints(t,e=[]){let r;return t?r=this.getUnevenVertices(t):r=this.getAdaptiveVertices(),this._verticesToPoints(r,e),e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const t=this.arcLengthDivision,e=[0];for(let r=0,i=this.getPoint(0),o=1;o<=t;o++){const s=this.getPoint(o/t);r+=s.distanceTo(i),e.push(r),i=s}this._arcLengths=e}getUToTMapping(t,e){const r=this.getLengths(),i=r.length,o=e??t*r[i-1];if(i<2)return o/r[0];let s=0,a=0,l=i-1,c;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),c=r[s]-o,c<0)a=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,r[s]===o)return s/(i-1);const u=r[s],p=r[s+1]-u,d=(o-u)/p;return(s+d)/(i-1)}getTangent(t,e=new k){const i=Math.max(0,t-1e-4),o=Math.min(1,t+1e-4);return e.copy(this.getPoint(o).sub(this.getPoint(i)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new k){return this.getTangent(t,e),e.set(-e.y,e.x).normalize()}getNormalAt(t,e){return this.getNormal(this.getUToTMapping(t),e)}getTForPoint(t,e=.001){let r=0,i=1,o=(r+i)/2;for(;i-r>e;){o=(r+i)/2;const s=this.getPoint(o);if(s.distanceTo(t)<e)return o;s.x<t.x?r=o:i=o}return o}getMinMax(t=k.MAX,e=k.MIN){const r=this.getPoints();for(let i=0,o=r.length;i<o;i++){const s=r[i];t.min(s),e.max(s)}return{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new X(t.x,t.y,e.x-t.x,e.y-t.y)}getFillVertices(t){return this.getAdaptiveVertices()}fillTriangulate(t){return li(this.getFillVertices(t),t)}strokeTriangulate(t){return Ea(this.getAdaptiveVertices(),t)}toCommands(){const t=[],e=this.getPoints();for(let r=0,i=e.length;r<i;r++){const o=e[r];r===0?t.push({type:"M",x:o.x,y:o.y}):t.push({type:"L",x:o.x,y:o.y})}return t}toData(){return Zo(this.toCommands())}drawTo(t){return this.toCommands().forEach(e=>{switch(e.type){case"M":t.moveTo(e.x,e.y);break;case"L":t.lineTo(e.x,e.y);break}}),this}copy(t){return this.arcLengthDivision=t.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Da=new Ct,pi=new Ct,di=new Ct,fn=new k;class er extends Ce{constructor(t=new k,e=new k,r=new k,i=0,o=0,s=Math.PI*2,a=!1){super(),this._center=t,this._radius=e,this._diff=r,this.rotate=i,this.startAngle=o,this.endAngle=s,this.clockwise=a}get cx(){return this._center.x}set cx(t){this._center.x=t}get cy(){return this._center.y}set cy(t){this._center.y=t}get rx(){return this._radius.x}set rx(t){this._radius.x=t}get ry(){return this._radius.y}set ry(t){this._radius.y=t}get dx(){return this._diff.x}set dx(t){this._diff.x=t}get dy(){return this._diff.y}set dy(t){this._diff.y=t}isClockwise(){return this.clockwise}_getDeltaAngle(){const t=Math.PI*2;let e=this.endAngle-this.startAngle;const r=Math.abs(e)<Number.EPSILON;return e=(e%t+t)%t,r?e=0:this.clockwise||(e=e===0?-t:e-t),e}getPoint(t,e=new k){const r=this._getDeltaAngle(),i=this.startAngle+t*r;let o=this.cx+this.rx*Math.cos(i),s=this.cy+this.ry*Math.sin(i);if(this.rotate!==0){const a=Math.cos(this.rotate),l=Math.sin(this.rotate),c=o-this.cx,u=s-this.cy;o=c*a-u*l+this.cx,s=c*l+u*a+this.cy}return e.set(o,s)}toCommands(){const{cx:t,cy:e,rx:r,ry:i,startAngle:o,endAngle:s,clockwise:a,rotate:l}=this,c=t+r*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),u=e+r*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l),h=Math.abs(o-s),p=h>Math.PI?1:0,d=a?1:0,f=l*180/Math.PI;if(h>=2*Math.PI){const m=o+Math.PI,g=t+r*Math.cos(m)*Math.cos(l)-i*Math.sin(m)*Math.sin(l),M=e+r*Math.cos(m)*Math.sin(l)+i*Math.sin(m)*Math.cos(l);return[{type:"M",x:c,y:u},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:g,y:M},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:c,y:u}]}else{const m=t+r*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),g=e+r*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l);return[{type:"M",x:c,y:u},{type:"A",rx:r,ry:i,angle:f,largeArcFlag:p,sweepFlag:d,x:m,y:g}]}}drawTo(t){const{cx:e,cy:r,rx:i,ry:o,rotate:s,startAngle:a,endAngle:l,clockwise:c}=this;return t.ellipse(e,r,i,o,s,a,l,!c),this}applyTransform(t){return fn.set(this.cx,this.cy),fn.applyMatrix3(t),this.cx=fn.x,this.cy=fn.y,Ua(t)?La(this,t):Fa(this,t),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(t=[]){const{cx:e,cy:r,rx:i,ry:o,dx:s,dy:a,startAngle:l,endAngle:c,clockwise:u,rotate:h}=this,p=!u;let d=Math.abs(l-c);(!p&&l>c||p&&c>l)&&(d=2*Math.PI-d);const f=Math.max(12,Math.floor(12*i**(1/3)*(d/Math.PI)));let m=d/f,g=l;m*=p?-1:1;const M=Math.cos(p?h:-h),P=Math.sin(p?h:-h);for(let w=0;w<f+1;w++){const C=s+Math.cos(g)*i,v=a+Math.sin(g)*o,x=C*M-v*P,S=C*P+v*M;t.push(e+x,r+S),g+=m}return t}_getAdaptiveVerticesByCircle(t=[]){const{cx:e,cy:r,rx:i,ry:o,dx:s,dy:a,rotate:l,clockwise:c}=this;if(!(i>=0&&o>=0&&s>=0&&a>=0))return t;const u=Math.ceil(2.3*Math.sqrt(i+o)),h=u*8+(s?4:0)+(a?4:0),p=[];if(h===0)return t;{const m=p.length;if(u===0)p[m]=p[m+6]=e+s,p[m+1]=p[m+3]=r+a,p[m+2]=p[m+4]=e-s,p[m+5]=p[m+7]=r-a;else{let g=m,M=m+u*4+(s?2:0)+2,P=M,w=h,C=s+i,v=a,x=e+C,S=e-C,b=r+v;if(p[g++]=x,p[g++]=b,p[--M]=b,p[--M]=S,a){const N=r-v;p[P++]=S,p[P++]=N,p[--w]=N,p[--w]=x}for(let N=1;N<u;N++){const E=Math.PI/2*(N/u),L=s+Math.cos(E)*i,z=a+Math.sin(E)*o,B=e+L,A=e-L,W=r+z,I=r-z;p[g++]=B,p[g++]=W,p[--M]=W,p[--M]=A,p[P++]=A,p[P++]=I,p[--w]=I,p[--w]=B}C=s,v=a+o,x=e+C,S=e-C,b=r+v;const D=r-v;p[g++]=x,p[g++]=b,p[--w]=D,p[--w]=x,s&&(p[g++]=S,p[g++]=b,p[--w]=D,p[--w]=S)}}const d=Math.cos(c?-l:l),f=Math.sin(c?-l:l);for(let m=0;m<p.length;m+=2){const g=p[m],M=p[m+1],P=g-e,w=M-r,C=P*d-w*f,v=P*f+w*d;t.push(e+C,r+v)}return t}getAdaptiveVertices(t=[]){return this.startAngle===0&&this.endAngle===Math.PI*2?this._getAdaptiveVerticesByCircle(t):this._getAdaptiveVerticesByArc(t)}copy(t){return super.copy(t),this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.dx=t.dx,this.dy=t.dy,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotate=t.rotate,this}}function La(n,t){const e=n.rx,r=n.ry,i=Math.cos(n.rotate),o=Math.sin(n.rotate),s=new k(e*i,e*o),a=new k(-r*o,r*i),l=s.applyMatrix3(t),c=a.applyMatrix3(t),u=Da.set(l.x,c.x,0,l.y,c.y,0,0,0,1),h=pi.copy(u).invert(),f=di.copy(h).transpose().multiply(h).elements,m=$a(f[0],f[1],f[4]),g=Math.sqrt(m.rt1),M=Math.sqrt(m.rt2);if(n.rx=1/g,n.ry=1/M,n.rotate=Math.atan2(m.sn,m.cs),!((n.endAngle-n.startAngle)%(2*Math.PI)<Number.EPSILON)){const w=pi.set(g,0,0,0,M,0,0,0,1),C=di.set(m.cs,m.sn,0,-m.sn,m.cs,0,0,0,1),v=w.multiply(C).multiply(u),x=S=>{const{x:b,y:D}=new k(Math.cos(S),Math.sin(S)).applyMatrix3(v);return Math.atan2(D,b)};n.startAngle=x(n.startAngle),n.endAngle=x(n.endAngle),gi(t)&&(n.clockwise=!n.clockwise)}}function Fa(n,t){const e=yi(t),r=mi(t);n.rx*=e,n.ry*=r;const i=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);n.rotate+=i,gi(t)&&(n.startAngle*=-1,n.endAngle*=-1,n.clockwise=!n.clockwise)}function gi(n){const t=n.elements;return t[0]*t[4]-t[1]*t[3]<0}function Ua(n){const t=n.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const r=yi(n),i=mi(n);return Math.abs(e/(r*i))>Number.EPSILON}function yi(n){const t=n.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function mi(n){const t=n.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function $a(n,t,e){let r,i,o,s,a;const l=n+e,c=n-e,u=Math.sqrt(c*c+4*t*t);return l>0?(r=.5*(l+u),a=1/r,i=n*a*e-t*a*t):l<0?i=.5*(l-u):(r=.5*u,i=-.5*u),c>0?o=c+u:o=c-u,Math.abs(o)>2*Math.abs(t)?(a=-2*t/o,s=1/Math.sqrt(1+a*a),o=a*s):Math.abs(t)===0?(o=1,s=0):(a=-.5*o/t,o=1/Math.sqrt(1+a*a),s=a*o),c>0&&(a=o,o=-s,s=a),{rt1:r,rt2:i,cs:o,sn:s}}class za extends er{constructor(t=0,e=0,r=1,i=0,o=Math.PI*2,s=!1){super(new k(t,e),new k(r,r),new k,0,i,o,s)}drawTo(t){const{cx:e,cy:r,rx:i,startAngle:o,endAngle:s,clockwise:a}=this;return t.arc(e,r,i,o,s,!a),this}}class Qt extends Ce{constructor(t=new k,e=new k){super(),this.p1=t,this.p2=e}static from(t,e,r,i){return new Qt(new k(t,e),new k(r,i))}getPoint(t,e=new k){return t===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(t).add(this.p1),e}getPointAt(t,e=new k){return this.getPoint(t,e)}getTangent(t,e=new k){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(t,e=new k){return this.getTangent(t,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptiveVertices(t=[]){return t.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),t}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,p2:i}=this;return t.x=Math.min(t.x,r.x,i.x),t.y=Math.min(t.y,r.y,i.y),e.x=Math.max(e.x,r.x,i.x),e.y=Math.max(e.y,r.y,i.y),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,p2:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}getFillVertices(t={}){const e=Math.min(this.p1.x,this.p2.x),r=Math.max(this.p1.x,this.p2.x),i=Math.min(this.p1.y,this.p2.y),o=Math.max(this.p1.y,this.p2.y),s=e,a=i,l=r-e||t.style?.strokeWidth||0,c=o-i||t.style?.strokeWidth||0;return[s,a,s+l,a,s+l,a+c,s,a+c]}drawTo(t){const{p1:e,p2:r}=this;return t.lineTo(e.x,e.y),t.lineTo(r.x,r.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.p2.copy(t.p2),this}}class Ge extends Ce{constructor(t=[]){super(),this.curves=t}getFlatCurves(){return this.curves.flatMap(t=>t instanceof Ge?t.getFlatCurves():t)}addCurve(t){return this.curves.push(t),this}getPoint(t,e=new k){const r=t*this.getLength(),i=this.getLengths();let o=0;for(;o<i.length;){if(i[o]>=r){const s=i[o]-r,a=this.curves[o],l=a.getLength();return a.getPointAt(l===0?0:1-s/l,e)}o++}return e}updateLengths(){const t=[];for(let e=0,r=0,i=this.curves.length;e<i;e++)r+=this.curves[e].getLength(),t.push(r);this._arcLengths=t}getControlPointRefs(){return this.curves.flatMap(t=>t.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(t,e){const r=[t[e-1],t[e]],i=[t[e+1],t[e+2]];return r[0]===i[0]&&r[1]===i[1]&&t.splice(e+1,2),t}getSpacedVertices(t=5,e=[]){let r;return this.curves.forEach(i=>{i.getSpacedVertices(t,e),r&&this._removeNextPointIfEqualPrevPoint(e,r),r=e.length-1}),e}getAdaptiveVertices(t=[]){let e;return this.curves.forEach(r=>{r.getAdaptiveVertices(t),e&&this._removeNextPointIfEqualPrevPoint(t,e),e=t.length-1}),t}strokeTriangulate(t){return this.curves.length===1?this.curves[0].strokeTriangulate(t):super.strokeTriangulate(t)}getFillVertices(t){if(this.curves.length===1)return this.curves[0].getFillVertices(t);{const e=[];let r;return this.curves.forEach(i=>{let o;i instanceof Qt?o=i.getAdaptiveVertices():o=i.getFillVertices(t),e.push(...o),r&&this._removeNextPointIfEqualPrevPoint(e,r),r=e.length-1}),e}}applyTransform(t){return this.curves.forEach(e=>e.applyTransform(t)),this}getMinMax(t=k.MAX,e=k.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new X(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(r=>r.drawTo(t)),this}copy(t){return super.copy(t),this.curves=t.curves.map(e=>e.clone()),this}}class nr extends Ce{constructor(t=new k,e=new k,r=new k,i=new k){super(),this.p1=t,this.cp1=e,this.cp2=r,this.p2=i}static from(t,e,r,i,o,s,a,l){return new nr(new k(t,e),new k(r,i),new k(o,s),new k(a,l))}getPoint(t,e=new k){const{p1:r,cp1:i,cp2:o,p2:s}=this;return e.set(ai(t,r.x,i.x,o.x,s.x),ai(t,r.y,i.y,o.y,s.y))}getAdaptiveVertices(t=[]){return xa(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,t)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(t,e,r){const i=e*e-4*t*r;if(i<0)return[];const o=Math.sqrt(i),s=(-e+o)/(2*t),a=(-e-o)/(2*t);return[s,a].filter(l=>l>=0&&l<=1)}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,cp1:i,cp2:o,p2:s}=this,a=this._solveQuadratic(3*(i.x-r.x),6*(o.x-i.x),3*(s.x-o.x)),l=this._solveQuadratic(3*(i.y-r.y),6*(o.y-i.y),3*(s.y-o.y)),c=[0,1,...a,...l];return((h,p)=>{for(const d of h)for(let f=0;f<=p;f++){const m=f/p-.5,g=Math.min(1,Math.max(0,d+m)),M=this.getPoint(g);t.x=Math.min(t.x,M.x),t.y=Math.min(t.y,M.y),e.x=Math.max(e.x,M.x),e.y=Math.max(e.y,M.y)}})(c,10),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp1:e,cp2:r,p2:i}=this;return[{type:"M",x:t.x,y:t.y},{type:"C",x1:e.x,y1:e.y,x2:r.x,y2:r.y,x:i.x,y:i.y}]}drawTo(t){const{p1:e,cp1:r,cp2:i,p2:o}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(r.x,r.y,i.x,i.y,o.x,o.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp1.copy(t.cp1),this.cp2.copy(t.cp2),this.p2.copy(t.p2),this}}class Na extends er{constructor(t=0,e=0,r=1,i=1,o=0,s=0,a=Math.PI*2,l=!1){super(new k(t,e),new k(r,i),new k,o,s,a,l)}drawTo(t){return t.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class Va extends Ge{}class rr extends Ce{constructor(t=new k,e=new k,r=new k){super(),this.p1=t,this.cp=e,this.p2=r}static from(t,e,r,i,o,s){return new rr(new k(t,e),new k(r,i),new k(o,s))}getPoint(t,e=new k){const{p1:r,cp:i,p2:o}=this;return e.set(hi(t,r.x,i.x,o.x),hi(t,r.y,i.y,o.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(t=[]){return Sa(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,t)}getMinMax(t=k.MAX,e=k.MIN){const{p1:r,cp:i,p2:o}=this,s=.5*(r.x+i.x),a=.5*(r.y+i.y),l=.5*(r.x+o.x),c=.5*(r.y+o.y);return t.x=Math.min(t.x,r.x,o.x,s,l),t.y=Math.min(t.y,r.y,o.y,a,c),e.x=Math.max(e.x,r.x,o.x,s,l),e.y=Math.max(e.y,r.y,o.y,a,c),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp:e,p2:r}=this;return[{type:"M",x:t.x,y:t.y},{type:"Q",x1:e.x,y1:e.y,x:r.x,y:r.y}]}drawTo(t){const{p1:e,cp:r,p2:i}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,i.x,i.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp.copy(t.cp),this.p2.copy(t.p2),this}}class ja extends Va{constructor(t=0,e=0,r=0,i=0){super(),this.x=t,this.y=e,this.width=r,this.height=i,this.update()}update(){const{x:t,y:e,width:r,height:i}=this,o=[new k(t,e),new k(t+r,e),new k(t+r,e+i),new k(t,e+i)];return this.curves=[new Qt(o[0],o[1]),new Qt(o[1],o[2]),new Qt(o[2],o[3]),new Qt(o[3],o[0])],this}drawTo(t){return t.rect(this.x,this.y,this.width,this.height),this}getFillVertices(t={}){const{x:e,y:r,width:i,height:o}=this;return[e,r,e+i,r,e+i,r+o,e,r+o]}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.update(),this}}class Ra extends er{constructor(t=0,e=0,r=1,i=1,o=1){super(),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=o,this.update()}update(){const{x:t,y:e,width:r,height:i,radius:o}=this,s=r/2,a=i/2,l=t+s,c=e+a,u=Math.max(0,Math.min(o,Math.min(s,a))),h=u;return this._center=new k(l,c),this._radius=new k(u,h),this._diff=new k(s-u,a-h),this}drawTo(t){const{x:e,y:r,width:i,height:o,radius:s}=this;return t.roundRect(e,r,i,o,s),this}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.radius=t.radius,this.update(),this}}class Ga extends Ce{constructor(t=[]){super(),this.points=t}getPoint(t,e=new k){const{points:r}=this,i=(r.length-1)*t,o=Math.floor(i),s=i-o,a=r[o===0?o:o-1],l=r[o],c=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return e.set(oi(s,a.x,l.x,c.x,u.x),oi(s,a.y,l.y,c.y,u.y)),e}getControlPointRefs(){return this.points}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e<r;e++)this.points.push(t.points[e].clone());return this}}class pn extends Ge{startPoint;currentPoint;autoClose=!1;constructor(t){super(),t&&this.addPoints(t)}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++){const{x:i,y:o}=t[e];this.lineTo(i,o)}return this}addCommands(t){return Zr(t,this),this}addData(t){return this.addCommands(Yr(t)),this}_closeVertices(t){return this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getUnevenVertices(t=40,e=[]){return this._closeVertices(super.getUnevenVertices(t,e))}getSpacedVertices(t=40,e=[]){return this._closeVertices(super.getSpacedVertices(t,e))}getAdaptiveVertices(t=[]){return this._closeVertices(super.getAdaptiveVertices(t))}getFillVertices(t){return this._closeVertices(super.getFillVertices(t))}_setCurrentPoint(t){return this.currentPoint=new k(t.x,t.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(t){if(this.curves.length>0){const e=t.getPoint(0);(!this.currentPoint||!e.equals(this.currentPoint))&&this.lineTo(e.x,e.y)}return this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;e&&!t.equals(e)&&(this.curves.push(new Qt(e.clone(),t.clone())),e.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint=new k(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){const r=this.currentPoint;return r?.equals({x:t,y:e})||this.curves.push(Qt.from(r?.x??0,r?.y??0,t,e)),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,r,i,o,s){const a=this.currentPoint;return a?.equals({x:o,y:s})||this.curves.push(nr.from(a?.x??0,a?.y??0,t,e,r,i,o,s)),this._setCurrentPoint({x:o,y:s}),this}quadraticCurveTo(t,e,r,i){const o=this.currentPoint;return o?.equals({x:r,y:i})||this.curves.push(rr.from(o?.x??0,o?.y??0,t,e,r,i)),this._setCurrentPoint({x:r,y:i}),this}arc(t,e,r,i,o,s){const a=new za(t,e,r,i,o,!s);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(t,e,r,i,o,s){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.arc(t,e,r,i,o,s),this}arcTo(t,e,r,i,o){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,r,i,o,s,a,l=!0){const c=new Na(t,e,r,i,o,s,a,!l);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(t,e,r,i,o,s,a,l){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.ellipse(t,e,r,i,o,s,a,l),this}rect(t,e,r,i){const o=new ja(t,e,r,i);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:t,y:e}),this}roundRect(t,e,r,i,o){const s=new Ra(t,e,r,i,o);return this._connetLineTo(s),this.curves.push(s),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){const e=this.currentPoint??new k;return this.curves.push(new Ga([e].concat(t))),this._setCurrentPoint(t[t.length-1]),this}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(r=>r.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){return super.copy(t),this.autoClose=t.autoClose,this.currentPoint=t.currentPoint?.clone(),this}}class Tt extends Ge{currentCurve=new pn;style;get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}constructor(t,e={}){super(),this.curves.push(this.currentCurve),this.style=e,t&&(t instanceof Tt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}addPath(t){const e=this.curves.findIndex(r=>r===this.currentCurve);return e>-1&&this.curves.splice(e,1),t instanceof Tt?this.curves.push(...t.curves.filter(r=>r.curves.length).map(r=>r.clone())):t.curves.length&&this.curves.push(t),this.curves.push(this.currentCurve),this}closePath(){const t=this.startPoint;return t&&(this.currentCurve.closePath(),this.currentCurve.curves.length&&(this.currentCurve=new pn().moveTo(t.x,t.y),this.curves.push(this.currentCurve))),this}moveTo(t,e){return this.currentCurve.currentPoint?.equals({x:t,y:e})||(this.currentCurve.curves.length&&(this.currentCurve=new pn,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(t,e)),this}lineTo(t,e){return this.currentCurve.lineTo(t,e),this}bezierCurveTo(t,e,r,i,o,s){return this.currentCurve.bezierCurveTo(t,e,r,i,o,s),this}quadraticCurveTo(t,e,r,i){return this.currentCurve.quadraticCurveTo(t,e,r,i),this}arc(t,e,r,i,o,s){return this.currentCurve.arc(t,e,r,i,o,s),this}arcTo(t,e,r,i,o){return this.currentCurve.arcTo(t,e,r,i,o),this}ellipse(t,e,r,i,o,s,a,l){return this.currentCurve.ellipse(t,e,r,i,o,s,a,l),this}rect(t,e,r,i){return this.currentCurve.rect(t,e,r,i),this}roundRect(t,e,r,i,o){return this.currentCurve.roundRect(t,e,r,i,o),this}reset(){return this.currentCurve=new pn,this.curves=[this.currentCurve],this.style={},this}addCommands(t){return Zr(t,this),this}addData(t){return this.addCommands(Yr(t)),this}splineThru(t){return this.currentCurve.splineThru(t),this}scale(t,e=t,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(t,e,r)}),this}skew(t,e=0,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(t,e,r)}),this}rotate(t,e={x:0,y:0}){return this.getControlPointRefs().forEach(r=>{r.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getFlatCurves(),r=[],i=[],o=[];e.forEach((a,l)=>{const c=a.getControlPointRefs(),u=a.isClockwise();o[l]=c,i[l]=u;const h=c[0],p=c[c.length-1]??h;r.push({start:u?p:h,end:u?h:p,index:l})});const s=[];return r.forEach((a,l)=>{s[l]=[],r.forEach((c,u)=>{c.start&&a.end&&u!==l&&c.start?.equals(a.end)&&s[l].push(c.index)})}),e.forEach((a,l)=>{const c=i[l];o[l].forEach(u=>{u.add(a.getNormal(a.getTForPoint(u)).scale(c?t:-t))})}),s.forEach((a,l)=>{const c=o[l];a.forEach(u=>{const h=o[u],p=Ma(c[c.length-1],c[c.length-2]??c[c.length-1],h[0],h[1]??h[0]);p&&(c[c.length-1].copy(p),h[0].copy(p))})}),this}getMinMax(t=k.MAX,e=k.MIN,r=!0){const i=this.strokeWidth;return this.curves.forEach(o=>{if(o.getMinMax(t,e),r&&i>1){const s=i/2,a=o.isClockwise(),l=[];for(let c=0;c<=1;c+=1/o.arcLengthDivision){const u=o.getPoint(c),h=o.getNormal(c),p=h.clone().scale(a?s:-s),d=h.clone().scale(a?-s:s);l.push(u.clone().add(p),u.clone().add(d),u.clone().add({x:s,y:0}),u.clone().add({x:-s,y:0}),u.clone().add({x:0,y:s}),u.clone().add({x:0,y:-s}),u.clone().add({x:s,y:s}),u.clone().add({x:-s,y:-s}))}t.min(...l),e.max(...l)}}),{min:t.finite(),max:e.finite()}}strokeTriangulate(t){const e=t?.indices??[],r=t?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...t,indices:e,vertices:r,style:{...this.style}})}),{indices:e,vertices:r}}fillTriangulate(t){const e={...t,style:{...this.style,...t?.style}},r=e.indices??[],i=e.vertices??[];if((e.style.fillRule??"nonzero")==="nonzero"){const s=this.curves.map(c=>c.getFillVertices(e)),a=_a(s),l=a.length;for(let c=0;c<l;c++){const u=a[c],h=s[c];if(u.wn||!h.length)continue;const p=h.slice(),d=[];for(let f=0;f<l;f++){const m=a[f];m.parentIndex===c&&(d.push(p.length/2),p.push(...s[m.index]))}li(p,{...t,indices:r,vertices:i,holes:d,style:{...this.style}})}}else this.curves.forEach(s=>{s.fillTriangulate({...t,indices:r,vertices:i,style:{...this.style}})});return{indices:r,vertices:i}}getBoundingBox(t=!0){const{min:e,max:r}=this.getMinMax(void 0,void 0,t);return new X(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Yn(t,e),this.curves.forEach(o=>{o.drawTo(t)}),r!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Yn(t,e),this.getControlPointRefs().forEach(o=>{Wo(t,o.x,o.y,{radius:4})}),r!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.curves.flatMap(t=>t.toCommands())}toData(){return this.curves.filter(t=>t.curves.length).map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const i in t)t[i]!==void 0&&(e[Ca(i)]=t[i]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let r="";for(const i in e)e[i]!==void 0&&(r+=`${i}:${e[i]};`);return`<path d="${this.toData()}" style="${r}"></path>`}copy(t){return super.copy(t),this.currentCurve=t.currentCurve.clone(),this.style={...t.style},this}}class se{constructor(t=[],e){this.paths=t,this.viewBox=e}getBoundingBox(t=!0){if(!this.paths.length)return;const e=k.MAX,r=k.MIN;return this.paths.forEach(i=>i.getMinMax(e,r,t)),new X(e.x,e.y,r.x-e.x,r.y-e.y)}toTriangulatedSvgString(t=this.paths.map(r=>r.fillTriangulate()),e=0){let r="";const i={x:-e,y:-e},o={x:e,y:e};(Array.isArray(t)?t:[t]).forEach(({vertices:l,indices:c})=>{const u=h=>{const p=l[h*2],d=l[h*2+1];return i.x=Math.min(i.x,p+e),o.x=Math.max(o.x,p+e),i.y=Math.min(i.y,d+e),o.y=Math.max(o.y,d+e),[p,d]};for(let h=0,p=c.length;h<p;h+=3){const d=u(c[h]),f=u(c[h+1]),m=u(c[h+2]);r+=`<polygon points="${d.join(",")} ${f.join(",")} ${m.join(",")}" stroke="none" fill="black" />`}});const a=[i.x,i.y,o.x-i.x,o.y-i.y];return`<svg width="${a[2]}" height="${a[3]}" viewBox="${a.join(" ")}" xmlns="http://www.w3.org/2000/svg">${r}</svg>`}toTriangulatedSvg(t,e){return new DOMParser().parseFromString(this.toTriangulatedSvgString(t,e),"image/svg+xml").documentElement}toSvgString(){const{x:t,y:e,width:r,height:i}=this.getBoundingBox(),o=this.paths.map(s=>s.toSvgPathString()).join("");return`<svg viewBox="${t} ${e} ${r} ${i}" width="${r}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${o}</svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...r}=t,{left:i,top:o,width:s,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=s*e,l.height=a*e,l.style.width=`${s}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-o),this.paths.forEach(u=>{u.drawTo(c,r)})),l}}const qa=new Set(["©","®","÷"]),Wa=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),Ha={1:"italic",32:"bold"},Xa={1:"italic",2:"bold"},xi={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class vi{constructor(t,e,r){this.content=t,this.index=e,this.parent=r}path=new Tt;lineBox=new X;inlineBox=new X;glyphBox;advanceWidth=0;advanceHeight=0;underlinePosition=0;underlineThickness=0;strikeoutPosition=0;strikeoutSize=0;ascender=0;descender=0;typoAscender=0;typoDescender=0;typoLineGap=0;winAscent=0;winDescent=0;xHeight=0;capHeight=0;baseline=0;centerDiviation=0;fontStyle;get compatibleGlyphBox(){const t=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new X(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new X(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-t/2,this.lineBox.width,t))}get center(){return this.compatibleGlyphBox.center}get computedFill(){return this.parent.computedFill}get computedOutline(){return this.parent.computedOutline}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(t){const e=this.computedStyle.fontFamily,r=t??ko;let o=(e?r.get(e):r.fallbackFont)?.getSFNT();return o?.textToGlyphIndexes(this.content).includes(0)&&(o=r.fallbackFont?.getSFNT()),o}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:r,post:i,head:o}=t,s=o.unitsPerEm,a=e.ascent,l=e.descent,{content:c,computedStyle:u,isVertical:h}=this,{fontSize:p}=u,d=s/p,f=t.getAdvanceWidth(c,p),m=(a+Math.abs(l))/d,g=a/d;return this.advanceWidth=f,this.advanceHeight=m,this.inlineBox.width=h?m:f,this.inlineBox.height=h?f:m,this.underlinePosition=(a-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(a-r.yStrikeoutPosition)/d,this.strikeoutSize=r.yStrikeoutSize/d,this.ascender=a/d,this.descender=l/d,this.typoAscender=r.sTypoAscender/d,this.typoDescender=r.sTypoDescender/d,this.typoLineGap=r.sTypoLineGap/d,this.winAscent=r.usWinAscent/d,this.winDescent=r.usWinDescent/d,this.xHeight=r.sxHeight/d,this.capHeight=r.sCapHeight/d,this.baseline=g,this.centerDiviation=m/2-g,this.fontStyle=Ha[r.fsSelection]??Xa[o.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:r,content:i,computedStyle:o,baseline:s,inlineBox:a,ascender:l,descender:c,typoAscender:u,fontStyle:h,advanceWidth:p,advanceHeight:d}=this,{left:f,top:m}=a,g=o.fontStyle==="italic"&&h!=="italic";let M=f,P=m+s,w;const C=new Tt;if(r&&(M+=(d-p)/2,Math.abs(p-d)>.1&&(P-=(l-u)/(l+Math.abs(c))*d),w=void 0),r&&!qa.has(i)&&(i.codePointAt(0)<=256||Wa.has(i))){C.addCommands(e.getPathCommands(i,M,m+s-(d-p)/2,o.fontSize));const x={y:m-(d-p)/2+d/2,x:M+p/2};g&&this._italic(C,r?{x:x.x,y:m-(d-p)/2+s}:void 0),C.rotate(90,x)}else w!==void 0?(C.addCommands(e.glyphs.get(w).getPathCommands(M,P,o.fontSize)),g&&this._italic(C,r?{x:M+p/2,y:m+u/(l+Math.abs(c))*d}:void 0)):(C.addCommands(e.getPathCommands(i,M,P,o.fontSize)),g&&this._italic(C,r?{x:M+d/2,y:P}:void 0));const v=o.fontWeight??400;return v in xi&&(v===700||v==="bold")&&h!=="bold"&&C.bold(xi[v]*o.fontSize*.05),C.style={fill:this.computedFill??o.color,fillRule:"nonzero",stroke:this.computedOutline??(o.textStrokeWidth?o.textStrokeColor:"none"),strokeWidth:o.textStrokeWidth?o.textStrokeWidth*o.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(t,e){t.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(t,e,r){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,r)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:r,max:i}=e;return new X(r.x,r.y,i.x-r.x,i.y-r.y)}drawTo(t,e={}){const r=this.computedStyle,i={ctx:t,path:this.path,fontSize:r.fontSize,color:r.color,...e};if(this.glyphBox)he(i);else{t.save(),t.beginPath();const o=this.path.style,s={...o,fill:i.color??o.fill,stroke:i.textStrokeColor??o.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:o.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};Yn(t,s),t.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(t.textBaseline="middle",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(t.textBaseline="alphabetic",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),t.restore()}}}function ir(){const n=new Map;async function t(r){if(!n.has(r)){n.set(r,r);try{n.set(r,await fetch(r).then(i=>i.text()))}catch(i){console.warn(i),n.delete(r)}}}function e(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("blob://")}return{loaded:n,needsLoad:e,load:t}}function sr(n){const t=new Map;function e(r){let i=t.get(r);if(!i){const o=ti(n.needsLoad(r)?n.loaded.get(r)??r:r),s=si(o);i={dom:o,pathSet:s},t.set(r,i)}return i}return{parsed:t,parse:e}}var Za={grad:.9,turn:360,rad:360/(2*Math.PI)},Jt=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},at=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*n)/e+0},Et=function(n,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),n>e?e:n>t?n:t},wi=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},bi=function(n){return{r:Et(n.r,0,255),g:Et(n.g,0,255),b:Et(n.b,0,255),a:Et(n.a)}},or=function(n){return{r:at(n.r),g:at(n.g),b:at(n.b),a:at(n.a,3)}},Ya=/^#([0-9a-f]{3,8})$/i,dn=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},Si=function(n){var t=n.r,e=n.g,r=n.b,i=n.a,o=Math.max(t,e,r),s=o-Math.min(t,e,r),a=s?o===t?(e-r)/s:o===e?2+(r-t)/s:4+(t-e)/s:0;return{h:60*(a<0?a+6:a),s:o?s/o*100:0,v:o/255*100,a:i}},Ci=function(n){var t=n.h,e=n.s,r=n.v,i=n.a;t=t/360*6,e/=100,r/=100;var o=Math.floor(t),s=r*(1-e),a=r*(1-(t-o)*e),l=r*(1-(1-t+o)*e),c=o%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:i}},Mi=function(n){return{h:wi(n.h),s:Et(n.s,0,100),l:Et(n.l,0,100),a:Et(n.a)}},Pi=function(n){return{h:at(n.h),s:at(n.s),l:at(n.l),a:at(n.a,3)}},Ti=function(n){return Ci((e=(t=n).s,{h:t.h,s:(e*=((r=t.l)<50?r:100-r)/100)>0?2*e/(r+e)*100:0,v:r+e,a:t.a}));var t,e,r},qe=function(n){return{h:(t=Si(n)).h,s:(i=(200-(e=t.s))*(r=t.v)/100)>0&&i<200?e*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,r,i},Ka=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qa=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ja=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_i={string:[[function(n){var t=Ya.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?at(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?at(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=Ja.exec(n)||tl.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:bi({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=Ka.exec(n)||Qa.exec(n);if(!t)return null;var e,r,i=Mi({h:(e=t[1],r=t[2],r===void 0&&(r="deg"),Number(e)*(Za[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Ti(i)},"hsl"]],object:[[function(n){var t=n.r,e=n.g,r=n.b,i=n.a,o=i===void 0?1:i;return Jt(t)&&Jt(e)&&Jt(r)?bi({r:Number(t),g:Number(e),b:Number(r),a:Number(o)}):null},"rgb"],[function(n){var t=n.h,e=n.s,r=n.l,i=n.a,o=i===void 0?1:i;if(!Jt(t)||!Jt(e)||!Jt(r))return null;var s=Mi({h:Number(t),s:Number(e),l:Number(r),a:Number(o)});return Ti(s)},"hsl"],[function(n){var t=n.h,e=n.s,r=n.v,i=n.a,o=i===void 0?1:i;if(!Jt(t)||!Jt(e)||!Jt(r))return null;var s=function(a){return{h:wi(a.h),s:Et(a.s,0,100),v:Et(a.v,0,100),a:Et(a.a)}}({h:Number(t),s:Number(e),v:Number(r),a:Number(o)});return Ci(s)},"hsv"]]},ki=function(n,t){for(var e=0;e<t.length;e++){var r=t[e][0](n);if(r)return[r,t[e][1]]}return[null,void 0]},el=function(n){return typeof n=="string"?ki(n.trim(),_i.string):typeof n=="object"&&n!==null?ki(n,_i.object):[null,void 0]},ar=function(n,t){var e=qe(n);return{h:e.h,s:Et(e.s+100*t,0,100),l:e.l,a:e.a}},lr=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},Ai=function(n,t){var e=qe(n);return{h:e.h,s:e.s,l:Et(e.l+100*t,0,100),a:e.a}},Ii=function(){function n(t){this.parsed=el(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return at(lr(this.rgba),2)},n.prototype.isDark=function(){return lr(this.rgba)<.5},n.prototype.isLight=function(){return lr(this.rgba)>=.5},n.prototype.toHex=function(){return t=or(this.rgba),e=t.r,r=t.g,i=t.b,s=(o=t.a)<1?dn(at(255*o)):"","#"+dn(e)+dn(r)+dn(i)+s;var t,e,r,i,o,s},n.prototype.toRgb=function(){return or(this.rgba)},n.prototype.toRgbString=function(){return t=or(this.rgba),e=t.r,r=t.g,i=t.b,(o=t.a)<1?"rgba("+e+", "+r+", "+i+", "+o+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,o},n.prototype.toHsl=function(){return Pi(qe(this.rgba))},n.prototype.toHslString=function(){return t=Pi(qe(this.rgba)),e=t.h,r=t.s,i=t.l,(o=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+o+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,o},n.prototype.toHsv=function(){return t=Si(this.rgba),{h:at(t.h),s:at(t.s),v:at(t.v),a:at(t.a,3)};var t},n.prototype.invert=function(){return Xt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),Xt(ar(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),Xt(ar(this.rgba,-t))},n.prototype.grayscale=function(){return Xt(ar(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),Xt(Ai(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),Xt(Ai(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?Xt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):at(this.rgba.a,3);var e},n.prototype.hue=function(t){var e=qe(this.rgba);return typeof t=="number"?Xt({h:t,s:e.s,l:e.l,a:e.a}):at(e.h)},n.prototype.isEqual=function(t){return this.toHex()===Xt(t).toHex()},n}(),Xt=function(n){return n instanceof Ii?n:new Ii(n)};class nl{eventListeners=new Map;addEventListener(t,e,r){const i={value:e,options:r},o=this.eventListeners.get(t);return o?Array.isArray(o)?o.push(i):this.eventListeners.set(t,[o,i]):this.eventListeners.set(t,i),this}removeEventListener(t,e,r){if(!e)return this.eventListeners.delete(t),this;const i=this.eventListeners.get(t);if(!i)return this;if(Array.isArray(i)){const o=[];for(let s=0,a=i.length;s<a;s++){const l=i[s];(l.value!==e||typeof r=="object"&&r?.once&&(typeof l.options=="boolean"||!l.options?.once))&&o.push(l)}o.length?this.eventListeners.set(t,o.length===1?o[0]:o):this.eventListeners.delete(t)}else i.value===e&&(typeof r=="boolean"||!r?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(t);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(t){return this.eventListeners.has(t)}dispatchEvent(t,...e){const r=this.eventListeners.get(t);if(r){if(Array.isArray(r))for(let i=r.length,o=0;o<i;o++){const s=r[o];typeof s.options=="object"&&s.options?.once&&this.off(t,s.value,s.options),s.value.apply(this,e)}else typeof r.options=="object"&&r.options?.once&&this.off(t,r.value,r.options),r.value.apply(this,e);return!0}else return!1}on(t,e,r){return this.addEventListener(t,e,r)}once(t,e){return this.addEventListener(t,e,{once:!0})}off(t,e,r){return this.removeEventListener(t,e,r)}emit(t,...e){this.dispatchEvent(t,...e)}}function tt(n){return n==null||n==="none"}function Me(n,t=0,e=10**t){return Math.round(e*n)/e+0}function zt(n,t=!1){if(typeof n!="object"||!n)return n;if(Array.isArray(n))return t?n.map(r=>zt(r,t)):n;const e={};for(const r in n){const i=n[r];i!=null&&(t?e[r]=zt(i,t):e[r]=i)}return e}function rl(n,t){const e={};return t.forEach(r=>{r in n&&(e[r]=n[r])}),e}function cr(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Array.from(new Set([...Object.keys(n),...Object.keys(t)]));return!e.length||e.every(r=>n[r]===t[r])}return!1}function il(n,t,e){const r=t.length-1;if(r<0)return n===void 0?e:n;for(let i=0;i<r;i++){if(n==null)return e;n=n[t[i]]}return n==null||n[t[r]]===void 0?e:n[t[r]]}function sl(n,t,e){const r=t.length-1;for(let i=0;i<r;i++)typeof n[t[i]]!="object"&&(n[t[i]]={}),n=n[t[i]];n[t[r]]=e}function ol(n,t,e){return n==null||!t||typeof t!="string"?e:n[t]!==void 0?n[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),il(n,t.split("."),e))}function al(n,t,e){if(!(typeof n!="object"||!t))return t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),sl(n,t.split("."),e)}function Oi(n){let t;return typeof n=="number"?t={r:n>>24&255,g:n>>16&255,b:n>>8&255,a:(n&255)/255}:t=n,Xt(t)}function ll(n){return{r:Me(n.r),g:Me(n.g),b:Me(n.b),a:Me(n.a,3)}}function gn(n){const t=n.toString(16);return t.length<2?`0${t}`:t}const cl="#000000FF";function hl(n){return Oi(n).isValid()}function Bt(n,t=!1){const e=Oi(n);if(!e.isValid()){if(typeof n=="string")return n;const a=`Failed to normalizeColor ${n}`;if(t)throw new Error(a);return console.warn(a),cl}const{r,g:i,b:o,a:s}=ll(e.rgba);return`#${gn(r)}${gn(i)}${gn(o)}${gn(Me(s*255))}`}var yn=yn||{};yn.parse=function(){const n={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let t="";function e(_){const T=new Error(`${t}: ${_}`);throw T.source=t,T}function r(){const _=i();return t.length>0&&e("Invalid input not EOF"),_}function i(){return w(o)}function o(){return s("linear-gradient",n.linearGradient,l)||s("repeating-linear-gradient",n.repeatingLinearGradient,l)||s("radial-gradient",n.radialGradient,h)||s("repeating-radial-gradient",n.repeatingRadialGradient,h)}function s(_,T,F){return a(T,$=>{const q=F();return q&&(O(n.comma)||e("Missing comma before color stops")),{type:_,orientation:q,colorStops:w(C)}})}function a(_,T){const F=O(_);if(F){O(n.startCall)||e("Missing (");const $=T(F);return O(n.endCall)||e("Missing )"),$}}function l(){const _=c();if(_)return _;const T=j("position-keyword",n.positionKeywords,1);return T?{type:"directional",value:T.value}:u()}function c(){return j("directional",n.sideOrCorner,1)}function u(){return j("angular",n.angleValue,1)||j("angular",n.radianValue,1)}function h(){let _,T=p(),F;return T&&(_=[],_.push(T),F=t,O(n.comma)&&(T=p(),T?_.push(T):t=F)),_}function p(){let _=d()||f();if(_)_.at=g();else{const T=m();if(T){_=T;const F=g();F&&(_.at=F)}else{const F=g();if(F)_={type:"default-radial",at:F};else{const $=M();$&&(_={type:"default-radial",at:$})}}}return _}function d(){const _=j("shape",/^(circle)/i,0);return _&&(_.style=U()||m()),_}function f(){const _=j("shape",/^(ellipse)/i,0);return _&&(_.style=M()||A()||m()),_}function m(){return j("extent-keyword",n.extentKeywords,1)}function g(){if(j("position",/^at/,0)){const _=M();return _||e("Missing positioning value"),_}}function M(){const _=P();if(_.x||_.y)return{type:"position",value:_}}function P(){return{x:A(),y:A()}}function w(_){let T=_();const F=[];if(T)for(F.push(T);O(n.comma);)T=_(),T?F.push(T):e("One extra comma");return F}function C(){const _=v();return _||e("Expected color definition"),_.length=A(),_}function v(){return S()||L()||E()||D()||b()||N()||x()}function x(){return j("literal",n.literalColor,0)}function S(){return j("hex",n.hexColor,1)}function b(){return a(n.rgbColor,()=>({type:"rgb",value:w(B)}))}function D(){return a(n.rgbaColor,()=>({type:"rgba",value:w(B)}))}function N(){return a(n.varColor,()=>({type:"var",value:z()}))}function E(){return a(n.hslColor,()=>{O(n.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const T=B();O(n.comma);let F=O(n.percentageValue);const $=F?F[1]:null;O(n.comma),F=O(n.percentageValue);const q=F?F[1]:null;return(!$||!q)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[T,$,q]}})}function L(){return a(n.hslaColor,()=>{const _=B();O(n.comma);let T=O(n.percentageValue);const F=T?T[1]:null;O(n.comma),T=O(n.percentageValue);const $=T?T[1]:null;O(n.comma);const q=B();return(!F||!$)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[_,F,$,q]}})}function z(){return O(n.variableName)[1]}function B(){return O(n.number)[1]}function A(){return j("%",n.percentageValue,1)||W()||I()||U()}function W(){return j("position-keyword",n.positionKeywords,1)}function I(){return a(n.calcValue,()=>{let _=1,T=0;for(;_>0&&T<t.length;){const $=t.charAt(T);$==="("?_++:$===")"&&_--,T++}_>0&&e("Missing closing parenthesis in calc() expression");const F=t.substring(0,T-1);return V(T-1),{type:"calc",value:F}})}function U(){return j("px",n.pixelValue,1)||j("em",n.emValue,1)}function j(_,T,F){const $=O(T);if($)return{type:_,value:$[F]}}function O(_){let T,F;return F=/^\s+/.exec(t),F&&V(F[0].length),T=_.exec(t),T&&V(T[0].length),T}function V(_){t=t.substr(_)}return function(_){return t=_.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),r()}}();const ul=yn.parse.bind(yn);var mn=mn||{};mn.stringify=function(){var n={"visit_linear-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return n.visit_gradient(t)},"visit_radial-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return n.visit_gradient(t)},visit_gradient:function(t){var e=n.visit(t.orientation);return e&&(e+=", "),t.type+"("+e+n.visit(t.colorStops)+")"},visit_shape:function(t){var e=t.value,r=n.visit(t.at),i=n.visit(t.style);return i&&(e+=" "+i),r&&(e+=" at "+r),e},"visit_default-radial":function(t){var e="",r=n.visit(t.at);return r&&(e+=r),e},"visit_extent-keyword":function(t){var e=t.value,r=n.visit(t.at);return r&&(e+=" at "+r),e},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return n.visit(t.value.x)+" "+n.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return n.visit_color(t.value,t)},visit_hex:function(t){return n.visit_color("#"+t.value,t)},visit_rgb:function(t){return n.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return n.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return n.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return n.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return n.visit_color("var("+t.value+")",t)},visit_color:function(t,e){var r=t,i=n.visit(e.length);return i&&(r+=" "+i),r},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var e="",r=t.length;return t.forEach(function(i,o){e+=n.visit(i),o<r-1&&(e+=", ")}),e},visit_object:function(t){return t.width&&t.height?n.visit(t.width)+" "+n.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return n.visit_array(t);if(typeof t=="object"&&!t.type)return n.visit_object(t);if(t.type){var e=n["visit_"+t.type];if(e)return e(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return n.visit(t)}}(),mn.stringify.bind(mn);function Ei(n){const t=n.length-1;return n.map((e,r)=>{const i=e.value;let o=Me(r/t,3),s="#00000000";switch(e.type){case"rgb":s=Bt({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":s=Bt({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":s=Bt(e.value);break;case"hex":s=Bt(`#${e.value}`);break}switch(e.length?.type){case"%":o=Number(e.length.value)/100;break}return{offset:o,color:s}})}function Bi(n){let t=0;switch(n.orientation?.type){case"angular":t=Number(n.orientation.value);break}return{type:"linear-gradient",angle:t,stops:Ei(n.colorStops)}}function Di(n){return n.orientation?.map(t=>{switch(t?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Ei(n.colorStops)}}function xn(n){return n.startsWith("linear-gradient(")||n.startsWith("radial-gradient(")}function fl(n){return ul(n).map(t=>{switch(t?.type){case"linear-gradient":return Bi(t);case"repeating-linear-gradient":return{...Bi(t),repeat:!0};case"radial-gradient":return Di(t);case"repeating-radial-gradient":return{...Di(t),repeat:!0};default:return}}).filter(Boolean)}function pl(n){let t;return typeof n=="string"?t={color:n}:t=n,{color:Bt(t.color)}}function dl(n){let t;if(typeof n=="string"?t={image:n}:t=n,t.image){const{type:e,...r}=fl(t.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:r};case"linear-gradient":return{linearGradient:r}}}return t}function gl(n){let t;return typeof n=="string"?t={image:n}:t=n,t}function yl(n){let t;return typeof n=="string"?t={preset:n}:t=n,{preset:t.preset,foregroundColor:tt(t.foregroundColor)?void 0:Bt(t.foregroundColor),backgroundColor:tt(t.backgroundColor)?void 0:Bt(t.backgroundColor)}}function ml(n){return!tt(n.color)}function xl(n){return typeof n=="string"?hl(n):ml(n)}function vl(n){return!tt(n.image)&&xn(n.image)||!!n.linearGradient||!!n.radialGradient}function wl(n){return typeof n=="string"?xn(n):vl(n)}function bl(n){return!tt(n.image)&&!xn(n.image)}function Sl(n){return typeof n=="string"?!xn(n):bl(n)}function Cl(n){return!tt(n.preset)}function Ml(n){return typeof n=="string"?!1:Cl(n)}function We(n){const t=n&&typeof n=="object"?n.enabled:void 0;return xl(n)?zt({enabled:t,...pl(n)}):wl(n)?zt({enabled:t,...dl(n)}):Sl(n)?zt({enabled:t,...gl(n)}):Ml(n)?zt({enabled:t,...yl(n)}):{}}const hr=Symbol("properties"),Li=Symbol("defaultValueInited");function Fi(n){let t;if(Object.hasOwn(n,hr))t=n[hr];else{const e=Object.getPrototypeOf(n);t=new Map(e?Fi(e):void 0),n[hr]=t}return t}function Pl(n,t={}){const e=Symbol.for(n),{default:r,fallback:i,alias:o}=t,s={declaration:t,internalKey:e},a=()=>typeof r=="function"?r():r,l=()=>typeof i=="function"?i():i;function c(){let h;if(o&&o!==n?h=ol(this,o):typeof this.getter<"u"?h=this.getter(n,s):h=this[e],h=h??l(),h===void 0&&r!==void 0&&!this[Li]){this[Li]=!0;const p=a();p!==void 0&&(u.call(this,p),h=p)}return h}function u(h){o&&o!==n?al(this,o,h):typeof this.setter<"u"?this.setter(n,h,s):this[e]=h}return{get:c,set:u}}function Tl(n,t,e={}){Fi(n).set(t,e);const r=Pl(t,e);Object.defineProperty(n.prototype,t,{get(){return r.get.call(this)},set(i){const o=r.get.call(this);r.set.call(this,i),this.onUpdateProperty?.(t,i,o,e)},configurable:!0,enumerable:!0})}function oe(n){return function(t,e){if(typeof e!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");Tl(t.constructor,e,n)}}function ur(n){return typeof n=="string"?{...We(n)}:{...We(n),...rl(n,["width","style","headEnd","tailEnd"])}}function _l(){return{boxShadow:"none"}}function kl(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Al(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Il(){return{...kl(),...Al(),..._l(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function Ol(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function El(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Bl(){return{...Ol(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function Dl(){return{...El(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Ll(){return{...Dl(),...Bl(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function vn(n){return zt({...n,color:tt(n.color)?void 0:Bt(n.color),backgroundColor:tt(n.backgroundColor)?void 0:Bt(n.backgroundColor),borderColor:tt(n.borderColor)?void 0:Bt(n.borderColor),outlineColor:tt(n.outlineColor)?void 0:Bt(n.outlineColor),shadowColor:tt(n.shadowColor)?void 0:Bt(n.shadowColor)})}function Fl(){return{...Il(),...Ll()}}const Ul=/\r\n|\n\r|\n|\r/,$l=new RegExp(`^(${Ul.source})$`),Ui=`
6
+ `;function zl(n){return $l.test(n)}function $i(n){const t=[];function e(){return t[t.length-1]}function r(a,l,c){const u=a?vn(a):{},h=l?We(l):void 0,p=c?ur(c):void 0,d=zt({...u,fill:h,outline:p,fragments:[]});return t[t.length-1]?.fragments.length===0?t[t.length-1]=d:t.push(d),d}function i(a="",l,c,u){const h=l?vn(l):{},p=c?We(c):void 0,d=u?ur(u):void 0;Array.from(a).forEach(f=>{if(zl(f)){const{fragments:m,fill:g,outline:M,...P}=e()||r();m.length||m.push(zt({...h,fill:p,outline:d,content:Ui})),r(P,g,M)}else{const m=e()||r(),g=m.fragments[m.fragments.length-1];if(g){const{content:M,fill:P,outline:w,...C}=g;if(cr(p,P)&&cr(d,w)&&cr(h,C)){g.content=`${M}${f}`;return}}m.fragments.push(zt({...h,fill:p,outline:d,content:f}))}})}(Array.isArray(n)?n:[n]).forEach(a=>{if(typeof a=="string")r(),i(a);else if(zi(a)){const{content:l,fill:c,outline:u,...h}=a;r(h,c,u),i(l)}else if(Nl(a)){const{fragments:l,fill:c,outline:u,...h}=a;r(h,c,u),l.forEach(p=>{const{content:d,fill:f,outline:m,...g}=p;i(d,g,f,m)})}else Array.isArray(a)?(r(),a.forEach(l=>{if(typeof l=="string")i(l);else if(zi(l)){const{content:c,fill:u,outline:h,...p}=l;i(c,p,u,h)}})):console.warn("Failed to parse text content",a)});const s=e();return s&&!s.fragments.length&&s.fragments.push({content:Ui}),t}function Nl(n){return n&&typeof n=="object"&&"fragments"in n&&Array.isArray(n.fragments)}function zi(n){return n&&typeof n=="object"&&"content"in n&&typeof n.content=="string"}function Vl(n){return typeof n=="string"||Array.isArray(n)?{content:$i(n)}:zt({...n,content:$i(n.content??""),style:n.style?vn(n.style):void 0,effects:n.effects?n.effects.map(t=>vn(t)):void 0,measureDom:n.measureDom,fonts:n.fonts,fill:n.fill?We(n.fill):void 0,outline:n.outline?ur(n.outline):void 0})}function wn(n,t){return typeof n=="number"?n:n.endsWith("%")?(n=n.substring(0,n.length-1),Math.ceil(Number(n)/100*t.total)):n.endsWith("rem")?(n=n.substring(0,n.length-3),Number(n)*t.fontSize):n.endsWith("em")?(n=n.substring(0,n.length-2),Number(n)*t.fontSize):Number(n)}function bn(n){return tt(n)?{}:n}function Ni(n,t){const e=Object.keys(n),r=Object.keys(t);return Array.from(new Set([...e,...r])).every(o=>ge(n[o],t[o]))}function ge(n,t){const e=typeof n;return e===typeof t?e==="object"?Ni(n,t):n===t:!1}function jl(n){const t=n.startsWith("#")?n.slice(1):n;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(t))return null;const r=t.length===3?t.split("").map(a=>a+a).join(""):t,i=Number.parseInt(r.slice(0,2),16),o=Number.parseInt(r.slice(2,4),16),s=Number.parseInt(r.slice(4,6),16);return`rgb(${i}, ${o}, ${s})`}function Sn(n){if(!n)return n;const t={};for(const e in n)n[e]!==""&&n[e]!==void 0&&(t[e]=n[e]);return t}class Vi{constructor(t,e={},r){this.content=t,this.style=e,this.parent=r,this.updateComputedStyle().initCharacters()}inlineBox=new X;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const t=this.computedStyle;return t.textTransform==="uppercase"?this.content.toUpperCase():t.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Sn(this.style)},this}initCharacters(){const t=[];let e=0;for(const r of this.computedContent)t.push(new vi(r,e++,this));return this.characters=t,this}}class ji{constructor(t,e){this.style=t,this.parent=e,this.updateComputedStyle()}lineBox=new X;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Sn(this.parent.computedStyle),...Sn(this.style)},this}addFragment(t,e){const r=new Vi(t,e,this);return this.fragments.push(r),r}}function Rl(n){return n}class He{static notZeroStyles=new Set(["width","height"]);static pxStyles=new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]);_toDomStyle(t){const e={};for(const r in t){const i=t[r];He.notZeroStyles.has(r)&&i===0||(typeof i=="number"&&He.pxStyles.has(r)?e[r]=`${i}px`:e[r]=i)}return e}createDom(t,e){const r=document.createElement("section"),i={...e},o=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"end":case"right":i.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":i.alignItems="flex-start";break;case"middle":i.alignItems="center";break;case"bottom":i.alignItems="flex-end";break}const s=!!(i.justifyContent||i.alignItems);Object.assign(r.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(s?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:s&&o?"100%":void 0,height:s&&!o?"100%":void 0}),t.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(u=>{const h=document.createElement("span");Object.assign(h.style,{verticalAlign:"inherit",...this._toDomStyle(u.style)}),h.appendChild(document.createTextNode(u.content)),c.appendChild(h)}),a.appendChild(c)}),r.appendChild(a),r}measureDOMText(t){const e=document.createRange();e.selectNodeContents(t);const r=t.data??"";let i=0;return Array.from(r).map(o=>{const s=i+=r.substring(i).indexOf(o),a=s+o.length;i+=o.length,e.setStart(t,Math.max(s,0)),e.setEnd(t,a);const l=e.getClientRects?.()??[e.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const u=e.toString();if(u!==""&&c&&c.width+c.height!==0)return{content:u,top:c.top,left:c.left,height:c.height,width:c.width}}).filter(Boolean)}measureDOM(t){const e=[],r=[],i=[];return t.querySelectorAll("li").forEach((o,s)=>{const a=o.getBoundingClientRect();e.push({paragraphIndex:s,left:a.left,top:a.top,width:a.width,height:a.height}),o.querySelectorAll(":scope > *").forEach((l,c)=>{const u=l.getBoundingClientRect();r.push({paragraphIndex:s,fragmentIndex:c,left:u.left,top:u.top,width:u.width,height:u.height});let h=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDOMText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:s,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDOMText(p.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:s,fragmentIndex:c,characterIndex:h++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:r,characters:i}}measureParagraphDOM(t,e){const r=e.getBoundingClientRect(),i=this.measureDOM(e);i.paragraphs.forEach(a=>{const l=t[a.paragraphIndex];l.lineBox.left=a.left-r.left,l.lineBox.top=a.top-r.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=t[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-r.left,l.inlineBox.top=a.top-r.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const o=[];let s=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:u}=a;o.push({...a,newParagraphIndex:l,left:a.left-r.left,top:a.top-r.top});const h=t[l].fragments[c].characters[u],{fontHeight:p,isVertical:d}=h,f=o[s];h.inlineBox.left=f.left,h.inlineBox.top=f.top,h.inlineBox.width=f.width,h.inlineBox.height=f.height,d?(h.lineBox.left=f.left+(f.width-p)/2,h.lineBox.top=f.top,h.lineBox.width=p,h.lineBox.height=f.height):(h.lineBox.left=f.left,h.lineBox.top=f.top+(f.height-p)/2,h.lineBox.width=f.width,h.lineBox.height=p),s++}),{paragraphs:t,boundingBox:new X(0,0,r.width,r.height)}}measure(t,e,r){let i;r||(r=this.createDom(t,e),Object.assign(r.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(r),i=()=>r?.parentNode?.removeChild(r));const o=this.measureParagraphDOM(t,r);return i?.(),o}}function Ri(){const n=new se,t=ir(),e=sr(t);return{name:"background",pathSet:n,load:async r=>{const{backgroundImage:i}=r.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:r=>{n.paths.length=0;const{computedStyle:i,lineBox:o,isVertical:s}=r,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(tt(a))return;const{pathSet:u}=e.parse(a),h=u.getBoundingBox(!0);let p,d,f,m;s?{x:d,y:p,width:m,height:f}=o:{x:p,y:d,width:f,height:m}=o;const g=bn(c??"none"),M=u.paths.map(v=>{const x=v.clone();return x.style.fill&&x.style.fill in g&&(x.style.fill=g[x.style.fill]),x.style.stroke&&x.style.stroke in g&&(x.style.stroke=g[x.style.stroke]),x});let P,w;if(l==="rigid"){P=Math.max(r.fontSize*5/h.width),w=P;const v=new k;v.x=h.width-f/P,v.y=h.height-m/w,M.forEach(x=>{x.applyTransform(S=>{const b=S.x>h.left+h.width/2,D=S.y>h.top+h.height/2;b&&(S.x-=v.x),D&&(S.y-=v.y)})})}else P=f/h.width,w=m/h.height;const C=new Ct;C.translate(-h.x,-h.y),C.scale(P,w),s&&(C.translate(-f/2,-m/2),C.rotate(-Math.PI/2),C.translate(m/2,f/2)),C.translate(p,d),M.forEach(v=>{v.applyTransform(x=>{x.applyMatrix3(C)})}),n.paths.push(...M)},renderOrder:-2,render:(r,i)=>{const{boundingBox:o,computedStyle:s}=i;tt(s.backgroundColor)||(r.fillStyle=s.backgroundColor,r.fillRect(...o.array)),n.paths.forEach(a=>{if(he({ctx:r,path:a,fontSize:s.fontSize}),i.debug){const l=new se([a]).getBoundingBox();l&&r.strokeRect(l.x,l.y,l.width,l.height)}}),i.paragraphs.forEach(a=>{const{lineBox:l,style:c}=a;tt(c.backgroundColor)||(r.fillStyle=c.backgroundColor,r.fillRect(...l.array)),a.fragments.forEach(u=>{const{inlineBox:h,style:p}=u;tt(p.backgroundColor)||(r.fillStyle=p.backgroundColor,r.fillRect(...h.array))})})}}}function Cn(n){const{highlight:t,highlightImage:e,highlightReferImage:r,highlightColormap:i,highlightLine:o,highlightSize:s,highlightThickness:a}=n;return{image:t?.image??e??"none",referImage:t?.referImage??r??"none",colormap:t?.colormap??i??"none",line:t?.line??o??"none",size:t?.size??s??"cover",thickness:t?.thickness??a??"100%"}}function Gi(){const n=new se,t=[],e=ir(),r=sr(e);return{name:"highlight",pathSet:n,load:async i=>{const o=new Set;i.forEachCharacter(s=>{const{computedStyle:a}=s,{image:l,referImage:c}=Cn(a);l&&e.needsLoad(l)&&o.add(l),c&&e.needsLoad(c)&&o.add(c)}),await Promise.all(Array.from(o).map(s=>e.load(s)))},update:i=>{t.length=0,n.paths.length=0;let o=[],s,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,u=Cn(c),{image:h,colormap:p,line:d,size:f,thickness:m}=u;if(tt(h))s?.length&&(s=[],o.push(s));else{const{inlineBox:g,isVertical:M}=l,{fontSize:P}=c;(!a||ge(a.image,h)&&ge(a.colormap,p)&&ge(a.line,d)&&ge(a.size,f)&&ge(a.thickness,m))&&s?.length&&(M?s[0].inlineBox.left===g.left:s[0].inlineBox.top===g.top)&&s[0].fontSize===P?s.push(l):(s=[],s.push(l),o.push(s))}a=u}),o=o.filter(l=>l.length);for(let l=0;l<o.length;l++){const c=o[l],u=c[0],h=X.from(...c.map(O=>O.compatibleGlyphBox));if(!h.height||!h.width)continue;const{computedStyle:p,isVertical:d,inlineBox:f,compatibleGlyphBox:m,strikeoutPosition:g,underlinePosition:M}=u,{fontSize:P}=p,{image:w,referImage:C,colormap:v,line:x,size:S,thickness:b}=Cn(p),D=wn(b,{fontSize:P,total:h.width})/h.width,N=bn(v),{pathSet:E,dom:L}=r.parse(w),z=E.getBoundingBox(!0),B=P/z.width*2,A=new X().copy(h);d&&(A.width=h.height,A.height=h.width,A.left=h.left+h.width);const W=Math.floor(A.width);let I=W;S!=="cover"&&(I=wn(S,{fontSize:P,total:h.width})||W,A.width=I);const U=!tt(C)&&tt(x);if(U)z.copy(r.parse(C).pathSet.getBoundingBox(!0));else{let O;if(tt(x))if(z.width/z.height>4){O="underline";const V=L.getAttribute("viewBox");if(V){const[_,T,F,$]=V.split(" ").map(Z=>Number(Z)),q=T+$/2;z.y<q&&z.y+z.height>q?O="line-through":z.y+z.height<q?O="overline":O="underline"}}else O="outline";else O=x;switch(O){case"outline":{const V=A.width*.2,_=A.height*.2;d?(A.x-=_/2,A.y-=V/2,A.x-=A.height):(A.x-=V/2,A.y-=_/2),A.width+=V,A.height+=_;break}case"overline":A.height=z.height*B,d?A.x=f.left+f.width:A.y=f.top;break;case"line-through":A.height=z.height*B,d?A.x=f.left+f.width-g+A.height/2:A.y=f.top+g-A.height/2;break;case"underline":A.height=z.height*B,d?A.x=m.left+m.width-M:A.y=f.top+M;break}}const j=new Ct;if(j.translate(-z.x,-z.y),j.scale(A.width/z.width,A.height/z.height),d){const O=A.width/2,V=A.height/2;U||j.translate(-O,-V),j.rotate(-Math.PI/2),U||j.translate(V,O)}j.translate(A.x,A.y);for(let O=0;O<Math.ceil(W/I);O++){const V=j.clone();d?V.translate(0,O*A.width):V.translate(O*A.width,0),E.paths.forEach(_=>{const T=_.clone().applyTransform(V);T.style.strokeWidth&&(T.style.strokeWidth*=B*D),T.style.strokeMiterlimit&&(T.style.strokeMiterlimit*=B),T.style.strokeDashoffset&&(T.style.strokeDashoffset*=B),T.style.strokeDasharray&&(T.style.strokeDasharray=T.style.strokeDasharray.map(F=>F*B)),T.style.fill&&T.style.fill in N&&(T.style.fill=N[T.style.fill]),T.style.stroke&&T.style.stroke in N&&(T.style.stroke=N[T.style.stroke]),n.paths.push(T),W!==I&&(d?t[n.paths.length-1]=new X(h.left-h.width*2,h.top,h.width*4,h.height):t[n.paths.length-1]=new X(h.left,h.top-h.height*2,h.width,h.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return n.paths.forEach((o,s)=>{const a=t[s];let l=o.getBoundingBox();if(a){const c=Math.max(l.x,a.x),u=Math.max(l.y,a.y),h=Math.min(l.right,a.right),p=Math.min(l.bottom,a.bottom);l=new X(c,u,h-c,p-u)}i.push(l)}),X.from(...i)},render:(i,o)=>{n.paths.forEach((s,a)=>{if(he({ctx:i,path:s,fontSize:o.computedStyle.fontSize,clipRect:t[a]}),o.debug){const l=new se([s]).getBoundingBox();l&&i.strokeRect(l.x,l.y,l.width,l.height)}})}}}function Gl(n,t){return`<svg width="${n*2}" height="${n*2}" xmlns="http://www.w3.org/2000/svg">
7
7
  <circle cx="${n}" cy="${n}" r="${n}" fill="${t}" />
8
- </svg>`}function qi(){const n=new se;return{name:"listStyle",pathSet:n,update:t=>{n.paths.length=0;const{paragraphs:e,isVertical:r,fontSize:i}=t,s=i*.45;e.forEach(o=>{const{computedStyle:a}=o,{color:l,listStyleImage:c,listStyleColormap:u,listStyleSize:h,listStyleType:p}=a,d=bn(u);let f=h,m;if(!tt(c))m=c;else if(!tt(p)){const x=i*.38/2;switch(f=f==="cover"?x*2:f,p){case"disc":m=ql(x,String(l));break}}if(!m)return;const g=si(m),M=g.getBoundingBox(),P=o.fragments[0]?.characters[0];if(!P)return;const{inlineBox:w}=P,C=f==="cover"?1:wn(f,{total:i,fontSize:i})/i,v=new Ct;if(r){const x=i/M.height*C;v.translate(-M.left,-M.top).rotate(Math.PI/2).scale(x,x).translate(w.left+(w.width-M.height*x)/2,w.top-s)}else{const x=i/M.height*C;v.translate(-M.left,-M.top).scale(x,x).translate(w.left-M.width*x-s,w.top+(w.height-M.height*x)/2)}n.paths.push(...g.paths.map(x=>{const S=x.clone();return S.applyTransform(v),S.style.fill&&S.style.fill in d&&(S.style.fill=d[S.style.fill]),S.style.stroke&&S.style.stroke in d&&(S.style.stroke=d[S.style.stroke]),S}))})}}}function Wi(){return{name:"outline"}}const ae=new k,Pe=new Ct,le=new Ct;function Hi(){const n=new se;return{name:"render",pathSet:n,update:t=>{n.paths.length=0;const{paragraphs:e}=t;e.forEach(r=>{r.fragments.forEach(i=>{i.characters.forEach(s=>{n.paths.push(s.path)})})})},getBoundingBox:t=>{const{characters:e,fontSize:r,effects:i}=t,s=[];return e.forEach(o=>{i?.forEach(a=>{if(!o.glyphBox)return;const l=o.glyphBox.clone(),c=Mn(t,a);ae.set(l.left,l.top),ae.applyMatrix3(c),l.left=ae.x,l.top=ae.y,ae.set(l.right,l.bottom),ae.applyMatrix3(c),l.width=ae.x-l.left,l.height=ae.y-l.top;const u=(a.shadowOffsetX??0)*r,h=(a.shadowOffsetY??0)*r,p=Math.max(.1,a.textStrokeWidth??0)*r;l.left+=u-p,l.top+=h-p,l.width+=p*2,l.height+=p*2,s.push(l)})}),s.length?X.from(...s):void 0},render:(t,e)=>{const{paragraphs:r,glyphBox:i,effects:s}=e;s?s.forEach(o=>{Te(o,i,t),t.save();const[a,l,c,u,h,p]=Mn(e,o).transpose().elements;t.transform(a,u,l,h,c,p),e.forEachCharacter(d=>{d.drawTo(t,o)}),t.restore()}):r.forEach(o=>{o.fragments.forEach(a=>{a.characters.forEach(l=>{l.drawTo(t)})})}),e.debug&&r.forEach(o=>{t.strokeRect(o.lineBox.x,o.lineBox.y,o.lineBox.width,o.lineBox.height)})}}}function Mn(n,t){const{fontSize:e,glyphBox:r}=n,i=(t.translateX??0)*e,s=(t.translateY??0)*e,o=Math.PI*2,a=(t.skewX??0)/360*o,l=(t.skewY??0)/360*o,{left:c,top:u,width:h,height:p}=r,d=c+h/2,f=u+p/2;return Pe.identity(),le.makeTranslation(i,s),Pe.multiply(le),le.makeTranslation(d,f),Pe.multiply(le),le.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),Pe.multiply(le),le.makeTranslation(-d,-f),Pe.multiply(le),Pe.clone()}function Xi(){const n=new se;return{name:"textDecoration",pathSet:n,update:t=>{n.paths.length=0;const e=[];let r,i;t.forEachCharacter(s=>{const{computedStyle:o,isVertical:a,inlineBox:l,underlinePosition:c,underlineThickness:u,strikeoutPosition:h,strikeoutSize:p}=s,{color:d,textDecoration:f,writingMode:m}=o;if(tt(f))i=void 0;else{let g=!1;if(i?.textDecoration===f&&i?.writingMode===m&&i?.color===d&&(a?r[0].inlineBox.left===l.left:r[0].inlineBox.top===l.top))switch(f){case"underline":r[0].underlinePosition===c&&r[0].underlineThickness===u&&(g=!0);break;case"line-through":r[0].strikeoutPosition===h&&r[0].strikeoutSize===p&&(g=!0);break}g?r.push(s):(r=[],r.push(s),e.push(r)),i=o}}),e.forEach(s=>{const{computedStyle:o,isVertical:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:u,strikeoutSize:h}=s[0],{color:p,textDecoration:d}=o,f=X.from(...s.map(S=>S.inlineBox)),{left:m,top:g,width:M,height:P}=f;let w=a?m+M:g;const C=a?-1:1;let v=0;switch(d){case"overline":v=c*2;break;case"underline":w+=C*l,v=c*2;break;case"line-through":w+=C*u,v=h*2;break}w-=v;let x;a?x=new Tt([{type:"M",x:w,y:g},{type:"L",x:w,y:g+P},{type:"L",x:w+v,y:g+P},{type:"L",x:w+v,y:g},{type:"Z"}],{fill:p}):x=new Tt([{type:"M",x:m,y:w},{type:"L",x:m+M,y:w},{type:"L",x:m+M,y:w+v},{type:"L",x:m,y:w+v},{type:"Z"}],{fill:p}),n.paths.push(x)})},render:(t,e)=>{const{effects:r,computedStyle:i}=e;r?r.forEach(s=>{t.save();const[o,a,l,c,u,h]=Mn(e,s).transpose().elements;t.transform(o,c,a,u,l,h),n.paths.forEach(p=>{he({ctx:t,path:p,fontSize:i.fontSize,...s})}),t.restore()}):n.paths.forEach(s=>{he({ctx:t,path:s,fontSize:i.fontSize})})}}}var Wl=Object.defineProperty,ce=(n,t,e,r)=>{for(var i=void 0,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=o(t,e,i)||i);return i&&Wl(t,e,i),i};const fr=Ul();class Nt extends rl{needsUpdate=!0;computedStyle={...fr};paragraphs=[];lineBox=new X;rawGlyphBox=new X;glyphBox=new X;pathBox=new X;boundingBox=new X;measurer=new He;plugins=new Map;pathSets=[];get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(t=>t.fragments.flatMap(e=>e.characters))}constructor(t={}){super(),this.set(t)}set(t={}){const{content:e,effects:r,style:i,measureDom:s,fonts:o,fill:a,outline:l}=jl(t);this.debug=t.debug??!1,this.content=e,this.effects=r,this.style=i,this.measureDom=s,this.fonts=o,this.fill=a,this.outline=l,this.use(Ri()).use(Wi()).use(qi()).use(Xi()).use(Gi()).use(Hi()),(t.plugins??[]).forEach(c=>{this.use(c)}),this.updateParagraphs()}onUpdateProperty(t,e,r,i){this.emit("updateProperty",t,e,r,i)}use(t){return this.plugins.set(t.name,t),this}forEachCharacter(t){return this.paragraphs.forEach((e,r)=>{e.fragments.forEach((i,s)=>{i.characters.forEach((o,a)=>{t(o,{paragraphIndex:r,fragmentIndex:s,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(t=>t.load?.(this)))}updateParagraphs(){this.computedStyle={...fr,...this.style};const{content:t}=this,e=[];return t.forEach(r=>{const{fragments:i,fill:s,outline:o,...a}=r,l=new ji(a,this);l.fill=s,l.outline=o,i.forEach(c=>{const{content:u,fill:h,outline:p,...d}=c;if(u!==void 0){const f=l.addFragment(u,d);f.fill=h,f.outline=p}}),e.push(l)}),this.paragraphs=e,this}createDom(){return this.updateParagraphs(),this.measurer.createDom(this.paragraphs,this.computedStyle)}measure(t=this.measureDom){const e={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this.updateParagraphs();const r=this.measurer.measure(this.paragraphs,this.computedStyle,t);this.paragraphs=r.paragraphs,this.lineBox=r.boundingBox,this.characters.forEach(i=>{i.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((i,s)=>(i.updateOrder??0)-(s.updateOrder??0)).forEach(i=>{i.update?.(this)}),this.pathSets.length=0,Array.from(this.plugins.values()).sort((i,s)=>(i.renderOrder??0)-(s.renderOrder??0)).forEach(i=>{i.pathSet?.paths.length&&this.pathSets.push(i.pathSet)}),this.glyphBox=this.getGlyphBox(),this.updatePathBox().updateBoundingBox();for(const i in e)r[i]=this[i],this[i]=e[i];return this.emit("measure",{text:this,result:r}),r}getGlyphBox(){const t=k.MAX,e=k.MIN;return this.characters.forEach(r=>{if(!r.getGlyphMinMax(t,e)){const{inlineBox:i}=r,{left:s,top:o,width:a,height:l}=i,c=new k(s,o),u=new k(s+a,o+l);t.min(c,u),e.max(c,u)}}),new X(t.x,t.y,e.x-t.x,e.y-t.y)}updatePathBox(){return this.pathBox=X.from(this.glyphBox,...Array.from(this.plugins.values()).map(t=>t.getBoundingBox?t.getBoundingBox(this):t.pathSet?.getBoundingBox()).filter(Boolean)),this}updateBoundingBox(){return this.boundingBox=X.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(t=this.measureDom){const e=this.measure(t);for(const r in e)this[r]=e[r];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(t){const{view:e,pixelRatio:r=2}=t,i=e.getContext("2d");i&&(this.needsUpdate&&this.update(),dr(i,r,this.boundingBox),gr(i,this),Array.from(this.plugins.values()).sort((s,o)=>(s.renderOrder??0)-(o.renderOrder??0)).forEach(s=>{if(s.render)s.render?.(i,this);else if(s.pathSet){const o=this.computedStyle;s.pathSet.paths.forEach(a=>{he({ctx:i,path:a,fontSize:o.fontSize})})}}),this.emit("render",{text:this,view:e,pixelRatio:r}),t.onContext?.(i))}toString(){return this.content.flatMap(t=>t.fragments.map(e=>e.content)).join("")}}ce([oe()],Nt.prototype,"debug"),ce([oe()],Nt.prototype,"content"),ce([oe()],Nt.prototype,"style"),ce([oe()],Nt.prototype,"effects"),ce([oe()],Nt.prototype,"fill"),ce([oe()],Nt.prototype,"outline"),ce([oe()],Nt.prototype,"measureDom"),ce([oe()],Nt.prototype,"fonts");function Hl(n,t){const e=new Nt(n);return t?e.load().then(()=>e.measure()):e.measure()}function Xl(n,t){const e=new Nt(n);return t?e.load().then(()=>e.render(n)):e.render(n)}H.Character=vi,H.Fragment=Vi,H.Measurer=He,H.Paragraph=ji,H.Text=Nt,H.backgroundPlugin=Ri,H.createSVGLoader=ir,H.createSVGParser=sr,H.definePlugin=Gl,H.drawPath=he,H.filterEmpty=Sn,H.getHighlightStyle=Cn,H.getTransform2D=Mn,H.hexToRgb=Rl,H.highlightPlugin=Gi,H.isEqualObject=Ni,H.isEqualValue=ge,H.listStylePlugin=qi,H.measureText=Hl,H.outlinePlugin=Wi,H.parseColor=te,H.parseColormap=bn,H.parseValueNumber=wn,H.renderPlugin=Hi,H.renderText=Xl,H.setupView=dr,H.textDecorationPlugin=Xi,H.textDefaultStyle=fr,H.uploadColor=Te,H.uploadColors=gr,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
8
+ </svg>`}function qi(){const n=new se;return{name:"listStyle",pathSet:n,update:t=>{n.paths.length=0;const{paragraphs:e,isVertical:r,fontSize:i}=t,o=i*.45;e.forEach(s=>{const{computedStyle:a}=s,{color:l,listStyleImage:c,listStyleColormap:u,listStyleSize:h,listStyleType:p}=a,d=bn(u);let f=h,m;if(!tt(c))m=c;else if(!tt(p)){const x=i*.38/2;switch(f=f==="cover"?x*2:f,p){case"disc":m=Gl(x,String(l));break}}if(!m)return;const g=si(m),M=g.getBoundingBox(),P=s.fragments[0]?.characters[0];if(!P)return;const{inlineBox:w}=P,C=f==="cover"?1:wn(f,{total:i,fontSize:i})/i,v=new Ct;if(r){const x=i/M.height*C;v.translate(-M.left,-M.top).rotate(Math.PI/2).scale(x,x).translate(w.left+(w.width-M.height*x)/2,w.top-o)}else{const x=i/M.height*C;v.translate(-M.left,-M.top).scale(x,x).translate(w.left-M.width*x-o,w.top+(w.height-M.height*x)/2)}n.paths.push(...g.paths.map(x=>{const S=x.clone();return S.applyTransform(v),S.style.fill&&S.style.fill in d&&(S.style.fill=d[S.style.fill]),S.style.stroke&&S.style.stroke in d&&(S.style.stroke=d[S.style.stroke]),S}))})}}}function Wi(){return{name:"outline"}}const ae=new k,Pe=new Ct,le=new Ct;function Hi(){const n=new se;return{name:"render",pathSet:n,update:t=>{n.paths.length=0;const{paragraphs:e}=t;e.forEach(r=>{r.fragments.forEach(i=>{i.characters.forEach(o=>{n.paths.push(o.path)})})})},getBoundingBox:t=>{const{characters:e,fontSize:r,effects:i}=t,o=[];return e.forEach(s=>{i?.forEach(a=>{if(!s.glyphBox)return;const l=s.glyphBox.clone(),c=Mn(t,a);ae.set(l.left,l.top),ae.applyMatrix3(c),l.left=ae.x,l.top=ae.y,ae.set(l.right,l.bottom),ae.applyMatrix3(c),l.width=ae.x-l.left,l.height=ae.y-l.top;const u=(a.shadowOffsetX??0)*r,h=(a.shadowOffsetY??0)*r,p=Math.max(.1,a.textStrokeWidth??0)*r;l.left+=u-p,l.top+=h-p,l.width+=p*2,l.height+=p*2,o.push(l)})}),o.length?X.from(...o):void 0},render:(t,e)=>{const{paragraphs:r,glyphBox:i,effects:o}=e;o?o.forEach(s=>{Te(s,i,t),t.save();const[a,l,c,u,h,p]=Mn(e,s).transpose().elements;t.transform(a,u,l,h,c,p),e.forEachCharacter(d=>{d.drawTo(t,s)}),t.restore()}):r.forEach(s=>{s.fragments.forEach(a=>{a.characters.forEach(l=>{l.drawTo(t)})})}),e.debug&&r.forEach(s=>{t.strokeRect(s.lineBox.x,s.lineBox.y,s.lineBox.width,s.lineBox.height)})}}}function Mn(n,t){const{fontSize:e,glyphBox:r}=n,i=(t.translateX??0)*e,o=(t.translateY??0)*e,s=Math.PI*2,a=(t.skewX??0)/360*s,l=(t.skewY??0)/360*s,{left:c,top:u,width:h,height:p}=r,d=c+h/2,f=u+p/2;return Pe.identity(),le.makeTranslation(i,o),Pe.multiply(le),le.makeTranslation(d,f),Pe.multiply(le),le.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),Pe.multiply(le),le.makeTranslation(-d,-f),Pe.multiply(le),Pe.clone()}function Xi(){const n=new se;return{name:"textDecoration",pathSet:n,update:t=>{n.paths.length=0;const e=[];let r,i;t.forEachCharacter(o=>{const{computedStyle:s,isVertical:a,inlineBox:l,underlinePosition:c,underlineThickness:u,strikeoutPosition:h,strikeoutSize:p}=o,{color:d,textDecoration:f,writingMode:m}=s;if(tt(f))i=void 0;else{let g=!1;if(i?.textDecoration===f&&i?.writingMode===m&&i?.color===d&&(a?r[0].inlineBox.left===l.left:r[0].inlineBox.top===l.top))switch(f){case"underline":r[0].underlinePosition===c&&r[0].underlineThickness===u&&(g=!0);break;case"line-through":r[0].strikeoutPosition===h&&r[0].strikeoutSize===p&&(g=!0);break}g?r.push(o):(r=[],r.push(o),e.push(r)),i=s}}),e.forEach(o=>{const{computedStyle:s,isVertical:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:u,strikeoutSize:h}=o[0],{color:p,textDecoration:d}=s,f=X.from(...o.map(S=>S.inlineBox)),{left:m,top:g,width:M,height:P}=f;let w=a?m+M:g;const C=a?-1:1;let v=0;switch(d){case"overline":v=c*2;break;case"underline":w+=C*l,v=c*2;break;case"line-through":w+=C*u,v=h*2;break}w-=v;let x;a?x=new Tt([{type:"M",x:w,y:g},{type:"L",x:w,y:g+P},{type:"L",x:w+v,y:g+P},{type:"L",x:w+v,y:g},{type:"Z"}],{fill:p}):x=new Tt([{type:"M",x:m,y:w},{type:"L",x:m+M,y:w},{type:"L",x:m+M,y:w+v},{type:"L",x:m,y:w+v},{type:"Z"}],{fill:p}),n.paths.push(x)})},render:(t,e)=>{const{effects:r,computedStyle:i}=e;r?r.forEach(o=>{t.save();const[s,a,l,c,u,h]=Mn(e,o).transpose().elements;t.transform(s,c,a,u,l,h),n.paths.forEach(p=>{he({ctx:t,path:p,fontSize:i.fontSize,...o})}),t.restore()}):n.paths.forEach(o=>{he({ctx:t,path:o,fontSize:i.fontSize})})}}}var ql=Object.defineProperty,ce=(n,t,e,r)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,e,i)||i);return i&&ql(t,e,i),i};const fr=Fl();class Nt extends nl{needsUpdate=!0;computedStyle={...fr};paragraphs=[];lineBox=new X;rawGlyphBox=new X;glyphBox=new X;pathBox=new X;boundingBox=new X;measurer=new He;plugins=new Map;pathSets=[];get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(t=>t.fragments.flatMap(e=>e.characters))}constructor(t={}){super(),this.set(t)}set(t={}){const{content:e,effects:r,style:i,measureDom:o,fonts:s,fill:a,outline:l}=Vl(t);this.debug=t.debug??!1,this.content=e,this.effects=r,this.style=i,this.measureDom=o,this.fonts=s,this.fill=a,this.outline=l,this.use(Ri()).use(Wi()).use(qi()).use(Xi()).use(Gi()).use(Hi()),(t.plugins??[]).forEach(c=>{this.use(c)}),this.updateParagraphs()}onUpdateProperty(t,e,r,i){this.emit("updateProperty",t,e,r,i)}use(t){return this.plugins.set(t.name,t),this}forEachCharacter(t){return this.paragraphs.forEach((e,r)=>{e.fragments.forEach((i,o)=>{i.characters.forEach((s,a)=>{t(s,{paragraphIndex:r,fragmentIndex:o,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(t=>t.load?.(this)))}updateParagraphs(){this.computedStyle={...fr,...this.style};const{content:t}=this,e=[];return t.forEach(r=>{const{fragments:i,fill:o,outline:s,...a}=r,l=new ji(a,this);l.fill=o,l.outline=s,i.forEach(c=>{const{content:u,fill:h,outline:p,...d}=c;if(u!==void 0){const f=l.addFragment(u,d);f.fill=h,f.outline=p}}),e.push(l)}),this.paragraphs=e,this}createDom(){return this.updateParagraphs(),this.measurer.createDom(this.paragraphs,this.computedStyle)}measure(t=this.measureDom){const e={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this.updateParagraphs();const r=this.measurer.measure(this.paragraphs,this.computedStyle,t);this.paragraphs=r.paragraphs,this.lineBox=r.boundingBox,this.characters.forEach(i=>{i.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((i,o)=>(i.updateOrder??0)-(o.updateOrder??0)).forEach(i=>{i.update?.(this)}),this.pathSets.length=0,Array.from(this.plugins.values()).sort((i,o)=>(i.renderOrder??0)-(o.renderOrder??0)).forEach(i=>{i.pathSet?.paths.length&&this.pathSets.push(i.pathSet)}),this.glyphBox=this.getGlyphBox(),this.updatePathBox().updateBoundingBox();for(const i in e)r[i]=this[i],this[i]=e[i];return this.emit("measure",{text:this,result:r}),r}getGlyphBox(){const t=k.MAX,e=k.MIN;return this.characters.forEach(r=>{if(!r.getGlyphMinMax(t,e)){const{inlineBox:i}=r,{left:o,top:s,width:a,height:l}=i,c=new k(o,s),u=new k(o+a,s+l);t.min(c,u),e.max(c,u)}}),new X(t.x,t.y,e.x-t.x,e.y-t.y)}updatePathBox(){return this.pathBox=X.from(this.glyphBox,...Array.from(this.plugins.values()).map(t=>t.getBoundingBox?t.getBoundingBox(this):t.pathSet?.getBoundingBox()).filter(Boolean)),this}updateBoundingBox(){return this.boundingBox=X.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(t=this.measureDom){const e=this.measure(t);for(const r in e)this[r]=e[r];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(t){const{view:e,pixelRatio:r=2}=t,i=e.getContext("2d");i&&(this.needsUpdate&&this.update(),dr(i,r,this.boundingBox),gr(i,this),Array.from(this.plugins.values()).sort((o,s)=>(o.renderOrder??0)-(s.renderOrder??0)).forEach(o=>{if(o.render)o.render?.(i,this);else if(o.pathSet){const s=this.computedStyle;o.pathSet.paths.forEach(a=>{he({ctx:i,path:a,fontSize:s.fontSize})})}}),this.emit("render",{text:this,view:e,pixelRatio:r}),t.onContext?.(i))}toString(){return this.content.flatMap(t=>t.fragments.map(e=>e.content)).join("")}}ce([oe()],Nt.prototype,"debug"),ce([oe()],Nt.prototype,"content"),ce([oe()],Nt.prototype,"style"),ce([oe()],Nt.prototype,"effects"),ce([oe()],Nt.prototype,"fill"),ce([oe()],Nt.prototype,"outline"),ce([oe()],Nt.prototype,"measureDom"),ce([oe()],Nt.prototype,"fonts");function Wl(n,t){const e=new Nt(n);return t?e.load().then(()=>e.measure()):e.measure()}function Hl(n,t){const e=new Nt(n);return t?e.load().then(()=>e.render(n)):e.render(n)}H.Character=vi,H.Fragment=Vi,H.Measurer=He,H.Paragraph=ji,H.Text=Nt,H.backgroundPlugin=Ri,H.createSVGLoader=ir,H.createSVGParser=sr,H.definePlugin=Rl,H.drawPath=he,H.filterEmpty=Sn,H.getHighlightStyle=Cn,H.getTransform2D=Mn,H.hexToRgb=jl,H.highlightPlugin=Gi,H.isEqualObject=Ni,H.isEqualValue=ge,H.listStylePlugin=qi,H.measureText=Wl,H.outlinePlugin=Wi,H.parseColor=te,H.parseColormap=bn,H.parseValueNumber=wn,H.renderPlugin=Hi,H.renderText=Hl,H.setupView=dr,H.textDecorationPlugin=Xi,H.textDefaultStyle=fr,H.uploadColor=Te,H.uploadColors=gr,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-text",
3
3
  "type": "module",
4
- "version": "1.7.3",
4
+ "version": "1.7.4",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "Measure and render text in a way that describes the DOM.",
7
7
  "author": "wxm",
@@ -58,10 +58,10 @@
58
58
  "diff": "^8.0.2",
59
59
  "modern-font": "^0.4.1",
60
60
  "modern-idoc": "^0.8.6",
61
- "modern-path2d": "^1.4.7"
61
+ "modern-path2d": "^1.4.8"
62
62
  },
63
63
  "devDependencies": {
64
- "@antfu/eslint-config": "^4.17.0",
64
+ "@antfu/eslint-config": "^4.18.0",
65
65
  "@types/node": "^24.1.0",
66
66
  "bumpp": "^10.2.0",
67
67
  "conventional-changelog-cli": "^5.0.0",