modern-text 0.2.31 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +15 -12
- package/dist/index.d.cts +4 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +15 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -732,18 +732,18 @@ class Parser {
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
|
|
735
|
-
function
|
|
735
|
+
function definePlugin(options) {
|
|
736
736
|
return options;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
739
|
const tempV1 = new modernPath2d.Vector2();
|
|
740
740
|
const tempM1 = new modernPath2d.Matrix3();
|
|
741
741
|
const tempM2 = new modernPath2d.Matrix3();
|
|
742
|
-
function effect(
|
|
743
|
-
return
|
|
742
|
+
function effect() {
|
|
743
|
+
return definePlugin({
|
|
744
744
|
name: "effect",
|
|
745
745
|
getBoundingBox: (text) => {
|
|
746
|
-
const { characters, fontSize } = text;
|
|
746
|
+
const { characters, fontSize, effects } = text;
|
|
747
747
|
const boxes = [];
|
|
748
748
|
characters.forEach((character) => {
|
|
749
749
|
effects?.forEach((style) => {
|
|
@@ -770,7 +770,7 @@ function effect(effects) {
|
|
|
770
770
|
return boxes.length ? modernPath2d.BoundingBox.from(...boxes) : void 0;
|
|
771
771
|
},
|
|
772
772
|
render: (ctx, text) => {
|
|
773
|
-
const { characters, renderBoundingBox } = text;
|
|
773
|
+
const { characters, renderBoundingBox, effects } = text;
|
|
774
774
|
if (effects) {
|
|
775
775
|
effects.forEach((style) => {
|
|
776
776
|
uploadColor(style, renderBoundingBox, ctx);
|
|
@@ -850,7 +850,7 @@ function highlight(options = {}) {
|
|
|
850
850
|
const referPaths = modernPath2d.parseSvg(config.referImage);
|
|
851
851
|
const paths = [];
|
|
852
852
|
const clipRects = [];
|
|
853
|
-
return
|
|
853
|
+
return definePlugin({
|
|
854
854
|
name: "highlight",
|
|
855
855
|
paths,
|
|
856
856
|
update: (text) => {
|
|
@@ -958,9 +958,11 @@ function parseScale(size, fontSize, total) {
|
|
|
958
958
|
}
|
|
959
959
|
function listStyle() {
|
|
960
960
|
const paths = [];
|
|
961
|
-
return
|
|
961
|
+
return definePlugin({
|
|
962
962
|
name: "listStyle",
|
|
963
|
+
paths,
|
|
963
964
|
update: (text) => {
|
|
965
|
+
paths.length = 0;
|
|
964
966
|
const { paragraphs, computedStyle: style, fontSize } = text;
|
|
965
967
|
let listStyleSize = style.listStyleSize;
|
|
966
968
|
let image;
|
|
@@ -996,8 +998,7 @@ function listStyle() {
|
|
|
996
998
|
paths.push(...imagePaths.map((p) => p.clone().matrix(m)));
|
|
997
999
|
}
|
|
998
1000
|
});
|
|
999
|
-
}
|
|
1000
|
-
paths
|
|
1001
|
+
}
|
|
1001
1002
|
});
|
|
1002
1003
|
}
|
|
1003
1004
|
|
|
@@ -1051,6 +1052,7 @@ class Text {
|
|
|
1051
1052
|
constructor(options = {}) {
|
|
1052
1053
|
__publicField(this, "content");
|
|
1053
1054
|
__publicField(this, "style");
|
|
1055
|
+
__publicField(this, "effects");
|
|
1054
1056
|
__publicField(this, "measureDom");
|
|
1055
1057
|
__publicField(this, "needsUpdate", true);
|
|
1056
1058
|
__publicField(this, "computedStyle", { ...defaultTextStyles });
|
|
@@ -1060,11 +1062,12 @@ class Text {
|
|
|
1060
1062
|
__publicField(this, "parser", new Parser(this));
|
|
1061
1063
|
__publicField(this, "measurer", new Measurer(this));
|
|
1062
1064
|
__publicField(this, "plugins", /* @__PURE__ */ new Map());
|
|
1063
|
-
const { content = "", style = {}, measureDom } = options;
|
|
1065
|
+
const { content = "", style = {}, measureDom, effects } = options;
|
|
1064
1066
|
this.content = content;
|
|
1065
1067
|
this.style = style;
|
|
1066
1068
|
this.measureDom = measureDom;
|
|
1067
|
-
this.
|
|
1069
|
+
this.effects = effects;
|
|
1070
|
+
this.use(effect()).use(highlight(options.highlight)).use(listStyle());
|
|
1068
1071
|
}
|
|
1069
1072
|
get fontSize() {
|
|
1070
1073
|
return this.computedStyle.fontSize;
|
|
@@ -1149,6 +1152,7 @@ exports.Paragraph = Paragraph;
|
|
|
1149
1152
|
exports.Parser = Parser;
|
|
1150
1153
|
exports.Text = Text;
|
|
1151
1154
|
exports.defaultTextStyles = defaultTextStyles;
|
|
1155
|
+
exports.definePlugin = definePlugin;
|
|
1152
1156
|
exports.drawPath = drawPath;
|
|
1153
1157
|
exports.effect = effect;
|
|
1154
1158
|
exports.fillBackground = fillBackground;
|
|
@@ -1158,7 +1162,6 @@ exports.highlight = highlight;
|
|
|
1158
1162
|
exports.isNone = isNone;
|
|
1159
1163
|
exports.listStyle = listStyle;
|
|
1160
1164
|
exports.parseColor = parseColor;
|
|
1161
|
-
exports.plugin = plugin;
|
|
1162
1165
|
exports.setupView = setupView;
|
|
1163
1166
|
exports.uploadColor = uploadColor;
|
|
1164
1167
|
exports.uploadColors = uploadColors;
|
package/dist/index.d.cts
CHANGED
|
@@ -223,6 +223,7 @@ declare const defaultTextStyles: TextStyle;
|
|
|
223
223
|
declare class Text {
|
|
224
224
|
content: TextContent;
|
|
225
225
|
style: Partial<TextStyle>;
|
|
226
|
+
effects?: TextEffect[];
|
|
226
227
|
measureDom?: HTMLElement;
|
|
227
228
|
needsUpdate: boolean;
|
|
228
229
|
computedStyle: {
|
|
@@ -282,7 +283,7 @@ interface Plugin {
|
|
|
282
283
|
renderOrder?: number;
|
|
283
284
|
render?: (ctx: CanvasRenderingContext2D, text: Text) => void;
|
|
284
285
|
}
|
|
285
|
-
declare function
|
|
286
|
+
declare function definePlugin(options: Plugin): Plugin;
|
|
286
287
|
|
|
287
288
|
type TextEffect = Partial<TextDrawStyle & {
|
|
288
289
|
offsetX: number;
|
|
@@ -290,7 +291,7 @@ type TextEffect = Partial<TextDrawStyle & {
|
|
|
290
291
|
skewX: number;
|
|
291
292
|
skewY: number;
|
|
292
293
|
}>;
|
|
293
|
-
declare function effect(
|
|
294
|
+
declare function effect(): Plugin;
|
|
294
295
|
declare function getTransform2D(text: Text, style: TextEffect): Matrix3;
|
|
295
296
|
|
|
296
297
|
interface HighlightOptions {
|
|
@@ -317,4 +318,4 @@ declare function uploadColors(ctx: CanvasRenderingContext2D, text: Text): void;
|
|
|
317
318
|
declare function isNone(val: string | undefined): boolean;
|
|
318
319
|
declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
|
|
319
320
|
|
|
320
|
-
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor,
|
|
321
|
+
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, definePlugin, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor, setupView, uploadColor, uploadColors };
|
package/dist/index.d.mts
CHANGED
|
@@ -223,6 +223,7 @@ declare const defaultTextStyles: TextStyle;
|
|
|
223
223
|
declare class Text {
|
|
224
224
|
content: TextContent;
|
|
225
225
|
style: Partial<TextStyle>;
|
|
226
|
+
effects?: TextEffect[];
|
|
226
227
|
measureDom?: HTMLElement;
|
|
227
228
|
needsUpdate: boolean;
|
|
228
229
|
computedStyle: {
|
|
@@ -282,7 +283,7 @@ interface Plugin {
|
|
|
282
283
|
renderOrder?: number;
|
|
283
284
|
render?: (ctx: CanvasRenderingContext2D, text: Text) => void;
|
|
284
285
|
}
|
|
285
|
-
declare function
|
|
286
|
+
declare function definePlugin(options: Plugin): Plugin;
|
|
286
287
|
|
|
287
288
|
type TextEffect = Partial<TextDrawStyle & {
|
|
288
289
|
offsetX: number;
|
|
@@ -290,7 +291,7 @@ type TextEffect = Partial<TextDrawStyle & {
|
|
|
290
291
|
skewX: number;
|
|
291
292
|
skewY: number;
|
|
292
293
|
}>;
|
|
293
|
-
declare function effect(
|
|
294
|
+
declare function effect(): Plugin;
|
|
294
295
|
declare function getTransform2D(text: Text, style: TextEffect): Matrix3;
|
|
295
296
|
|
|
296
297
|
interface HighlightOptions {
|
|
@@ -317,4 +318,4 @@ declare function uploadColors(ctx: CanvasRenderingContext2D, text: Text): void;
|
|
|
317
318
|
declare function isNone(val: string | undefined): boolean;
|
|
318
319
|
declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
|
|
319
320
|
|
|
320
|
-
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor,
|
|
321
|
+
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, definePlugin, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor, setupView, uploadColor, uploadColors };
|
package/dist/index.d.ts
CHANGED
|
@@ -223,6 +223,7 @@ declare const defaultTextStyles: TextStyle;
|
|
|
223
223
|
declare class Text {
|
|
224
224
|
content: TextContent;
|
|
225
225
|
style: Partial<TextStyle>;
|
|
226
|
+
effects?: TextEffect[];
|
|
226
227
|
measureDom?: HTMLElement;
|
|
227
228
|
needsUpdate: boolean;
|
|
228
229
|
computedStyle: {
|
|
@@ -282,7 +283,7 @@ interface Plugin {
|
|
|
282
283
|
renderOrder?: number;
|
|
283
284
|
render?: (ctx: CanvasRenderingContext2D, text: Text) => void;
|
|
284
285
|
}
|
|
285
|
-
declare function
|
|
286
|
+
declare function definePlugin(options: Plugin): Plugin;
|
|
286
287
|
|
|
287
288
|
type TextEffect = Partial<TextDrawStyle & {
|
|
288
289
|
offsetX: number;
|
|
@@ -290,7 +291,7 @@ type TextEffect = Partial<TextDrawStyle & {
|
|
|
290
291
|
skewX: number;
|
|
291
292
|
skewY: number;
|
|
292
293
|
}>;
|
|
293
|
-
declare function effect(
|
|
294
|
+
declare function effect(): Plugin;
|
|
294
295
|
declare function getTransform2D(text: Text, style: TextEffect): Matrix3;
|
|
295
296
|
|
|
296
297
|
interface HighlightOptions {
|
|
@@ -317,4 +318,4 @@ declare function uploadColors(ctx: CanvasRenderingContext2D, text: Text): void;
|
|
|
317
318
|
declare function isNone(val: string | undefined): boolean;
|
|
318
319
|
declare function filterEmpty(val: Record<string, any> | undefined): Record<string, any> | undefined;
|
|
319
320
|
|
|
320
|
-
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor,
|
|
321
|
+
export { Character, type DrawShapePathsOptions, type FontKerning, type FontStyle, type FontWeight, Fragment, type FragmentContent, type HighlightImage, type HighlightOptions, type HighlightOverflow, type HighlightSize, type HighlightStrokeWidth, type LinearGradient, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleType, type MeasuredCharacter, type MeasuredFragment, type MeasuredParagraph, type MeasuredResult, Measurer, Paragraph, type ParagraphContent, Parser, type Plugin, type Sizeable, Text, type TextAlign, type TextContent, type TextDecoration, type TextDrawStyle, type TextEffect, type TextHighlightStyle, type TextLayoutStyle, type TextListStyle, type TextOptions, type TextOrientation, type TextRenderOptions, type TextStyle, type TextTransform, type TextWrap, type VerticalAlign, type WritingMode, defaultTextStyles, definePlugin, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor, setupView, uploadColor, uploadColors };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(f,it){typeof exports=="object"&&typeof module<"u"?it(exports):typeof define=="function"&&define.amd?define(["exports"],it):(f=typeof globalThis<"u"?globalThis:f||self,it(f.modernText={}))})(this,function(f){"use strict";var ha=Object.defineProperty;var ca=(f,it,Tt)=>it in f?ha(f,it,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):f[it]=Tt;var z=(f,it,Tt)=>ca(f,typeof it!="symbol"?it+"":it,Tt);function it(s,t,e){if(typeof t=="string"&&t.startsWith("linear-gradient")){const{x0:r,y0:n,x1:i,y1:o,stops:a}=ns(t,e.left,e.top,e.width,e.height),h=s.createLinearGradient(r,n,i,o);return a.forEach(l=>h.addColorStop(l.offset,l.color)),h}return t}function Tt(s,t,e){s!=null&&s.color&&(s.color=it(e,s.color,t)),s!=null&&s.backgroundColor&&(s.backgroundColor=it(e,s.backgroundColor,t)),s!=null&&s.textStrokeColor&&(s.textStrokeColor=it(e,s.textStrokeColor,t))}function ns(s,t,e,r,n){var g;const i=((g=s.match(/linear-gradient\((.+)\)$/))==null?void 0:g[1])??"",o=i.split(",")[0],a=o.includes("deg")?o:"0deg",h=i.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),u=(Number(a.replace("deg",""))||0)*Math.PI/180,c=r*Math.sin(u),p=n*Math.cos(u);return{x0:t+r/2-c,y0:e+n/2+p,x1:t+r/2+c,y1:e+n/2-p,stops:Array.from(h).map(y=>{let w=y[2];return w.startsWith("(")?w=w.split(",").length>3?`rgba${w}`:`rgb${w}`:w=`#${w}`,{offset:Number(y[3].replace("%",""))/100,color:w}})}}function Ce(s){const{ctx:t,path:e,fontSize:r,clipRect:n}=s;t.save(),t.beginPath();const i=e.style,o={...i,fill:s.color??i.fill,stroke:s.textStrokeColor??i.stroke,strokeWidth:s.textStrokeWidth?s.textStrokeWidth*r:i.strokeWidth,shadowOffsetX:(s.shadowOffsetX??0)*r,shadowOffsetY:(s.shadowOffsetY??0)*r,shadowBlur:(s.shadowBlur??0)*r,shadowColor:s.shadowColor};n&&(t.rect(n.left,n.top,n.width,n.height),t.clip(),t.beginPath()),e.drawTo(t,o),t.restore()}function ss(s,t){const{computedStyle:e,paragraphs:r}=t;function n(i,o,a,h,l){s.fillStyle=i,s.fillRect(o,a,h,l)}e!=null&&e.backgroundColor&&n(e.backgroundColor,0,0,s.canvas.width,s.canvas.height),r.forEach(i=>{var o;(o=i.style)!=null&&o.backgroundColor&&n(i.computedStyle.backgroundColor,...i.boundingBox.toArray()),i.fragments.forEach(a=>{var h;(h=a.style)!=null&&h.backgroundColor&&n(a.computedStyle.backgroundColor,...a.boundingBox.toArray())})})}function Dr(s,t,e){const{left:r,top:n,width:i,height:o}=e,a=s.canvas;a.dataset.viewbox=`${r} ${n} ${i} ${o}`,a.dataset.pixelRatio=String(t),a.width=Math.max(1,Math.ceil(i*t)),a.height=Math.max(1,Math.ceil(o*t)),a.style.marginTop=`${n}px`,a.style.marginLeft=`${r}px`,a.style.width=`${i}px`,a.style.height=`${o}px`,s.clearRect(0,0,s.canvas.width,s.canvas.height),s.scale(t,t),s.translate(-r,-n)}function Nr(s,t){const{paragraphs:e,computedStyle:r,renderBoundingBox:n}=t;Tt(r,n,s),e.forEach(i=>{Tt(i.computedStyle,i.boundingBox,s),i.fragments.forEach(o=>{Tt(o.computedStyle,o.boundingBox,s)})})}var ot=Uint8Array,wt=Uint16Array,We=Int32Array,Se=new ot([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]),Pe=new ot([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]),qe=new ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zr=function(s,t){for(var e=new wt(31),r=0;r<31;++r)e[r]=t+=1<<s[r-1];for(var n=new We(e[30]),r=1;r<30;++r)for(var i=e[r];i<e[r+1];++i)n[i]=i-e[r]<<5|r;return{b:e,r:n}},Er=zr(Se,2),Ur=Er.b,He=Er.r;Ur[28]=258,He[258]=28;for(var Lr=zr(Pe,0),is=Lr.b,$r=Lr.r,Qe=new wt(32768),j=0;j<32768;++j){var $t=(j&43690)>>1|(j&21845)<<1;$t=($t&52428)>>2|($t&13107)<<2,$t=($t&61680)>>4|($t&3855)<<4,Qe[j]=(($t&65280)>>8|($t&255)<<8)>>1}for(var Ot=function(s,t,e){for(var r=s.length,n=0,i=new wt(t);n<r;++n)s[n]&&++i[s[n]-1];var o=new wt(t);for(n=1;n<t;++n)o[n]=o[n-1]+i[n-1]<<1;var a;if(e){a=new wt(1<<t);var h=15-t;for(n=0;n<r;++n)if(s[n])for(var l=n<<4|s[n],u=t-s[n],c=o[s[n]-1]++<<u,p=c|(1<<u)-1;c<=p;++c)a[Qe[c]>>h]=l}else for(a=new wt(r),n=0;n<r;++n)s[n]&&(a[n]=Qe[o[s[n]-1]++]>>15-s[n]);return a},jt=new ot(288),j=0;j<144;++j)jt[j]=8;for(var j=144;j<256;++j)jt[j]=9;for(var j=256;j<280;++j)jt[j]=7;for(var j=280;j<288;++j)jt[j]=8;for(var se=new ot(32),j=0;j<32;++j)se[j]=5;var os=Ot(jt,9,0),as=Ot(jt,9,1),ls=Ot(se,5,0),hs=Ot(se,5,1),Xe=function(s){for(var t=s[0],e=1;e<s.length;++e)s[e]>t&&(t=s[e]);return t},Ct=function(s,t,e){var r=t/8|0;return(s[r]|s[r+1]<<8)>>(t&7)&e},Ye=function(s,t){var e=t/8|0;return(s[e]|s[e+1]<<8|s[e+2]<<16)>>(t&7)},Ze=function(s){return(s+7)/8|0},jr=function(s,t,e){return(e==null||e>s.length)&&(e=s.length),new ot(s.subarray(t,e))},cs=["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"],St=function(s,t,e){var r=new Error(t||cs[s]);if(r.code=s,Error.captureStackTrace&&Error.captureStackTrace(r,St),!e)throw r;return r},us=function(s,t,e,r){var n=s.length,i=0;if(!n||t.f&&!t.l)return e||new ot(0);var o=!e,a=o||t.i!=2,h=t.i;o&&(e=new ot(n*3));var l=function(Dt){var Nt=e.length;if(Dt>Nt){var Lt=new ot(Math.max(Nt*2,Dt));Lt.set(e),e=Lt}},u=t.f||0,c=t.p||0,p=t.b||0,g=t.l,y=t.d,w=t.m,d=t.n,P=n*8;do{if(!g){u=Ct(s,c,1);var C=Ct(s,c+1,3);if(c+=3,C)if(C==1)g=as,y=hs,w=9,d=5;else if(C==2){var b=Ct(s,c,31)+257,A=Ct(s,c+10,15)+4,S=b+Ct(s,c+5,31)+1;c+=14;for(var _=new ot(S),k=new ot(19),L=0;L<A;++L)k[qe[L]]=Ct(s,c+L*3,7);c+=A*3;for(var V=Xe(k),mt=(1<<V)-1,O=Ot(k,V,1),L=0;L<S;){var N=O[Ct(s,c,mt)];c+=N&15;var x=N>>4;if(x<16)_[L++]=x;else{var R=0,U=0;for(x==16?(U=3+Ct(s,c,3),c+=2,R=_[L-1]):x==17?(U=3+Ct(s,c,7),c+=3):x==18&&(U=11+Ct(s,c,127),c+=7);U--;)_[L++]=R}}var J=_.subarray(0,b),W=_.subarray(b);w=Xe(J),d=Xe(W),g=Ot(J,w,1),y=Ot(W,d,1)}else St(1);else{var x=Ze(c)+4,T=s[x-4]|s[x-3]<<8,v=x+T;if(v>n){h&&St(0);break}a&&l(p+T),e.set(s.subarray(x,v),p),t.b=p+=T,t.p=c=v*8,t.f=u;continue}if(c>P){h&&St(0);break}}a&&l(p+131072);for(var xt=(1<<w)-1,B=(1<<d)-1,K=c;;K=c){var R=g[Ye(s,c)&xt],$=R>>4;if(c+=R&15,c>P){h&&St(0);break}if(R||St(2),$<256)e[p++]=$;else if($==256){K=c,g=null;break}else{var F=$-254;if($>264){var L=$-257,D=Se[L];F=Ct(s,c,(1<<D)-1)+Ur[L],c+=D}var X=y[Ye(s,c)&B],q=X>>4;X||St(3),c+=X&15;var W=is[q];if(q>3){var D=Pe[q];W+=Ye(s,c)&(1<<D)-1,c+=D}if(c>P){h&&St(0);break}a&&l(p+131072);var tt=p+F;if(p<W){var Qt=i-W,Xt=Math.min(W,tt);for(Qt+p<0&&St(3);p<Xt;++p)e[p]=r[Qt+p]}for(;p<tt;++p)e[p]=e[p-W]}}t.l=g,t.p=K,t.b=p,t.f=u,g&&(u=1,t.m=w,t.d=y,t.n=d)}while(!u);return p!=e.length&&o?jr(e,0,p):e.subarray(0,p)},Et=function(s,t,e){e<<=t&7;var r=t/8|0;s[r]|=e,s[r+1]|=e>>8},ie=function(s,t,e){e<<=t&7;var r=t/8|0;s[r]|=e,s[r+1]|=e>>8,s[r+2]|=e>>16},Ke=function(s,t){for(var e=[],r=0;r<s.length;++r)s[r]&&e.push({s:r,f:s[r]});var n=e.length,i=e.slice();if(!n)return{t:Gr,l:0};if(n==1){var o=new ot(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(v,b){return v.f-b.f}),e.push({s:-1,f:25001});var a=e[0],h=e[1],l=0,u=1,c=2;for(e[0]={s:-1,f:a.f+h.f,l:a,r:h};u!=n-1;)a=e[e[l].f<e[c].f?l++:c++],h=e[l!=u&&e[l].f<e[c].f?l++:c++],e[u++]={s:-1,f:a.f+h.f,l:a,r:h};for(var p=i[0].s,r=1;r<n;++r)i[r].s>p&&(p=i[r].s);var g=new wt(p+1),y=Je(e[u-1],g,0);if(y>t){var r=0,w=0,d=y-t,P=1<<d;for(i.sort(function(b,A){return g[A.s]-g[b.s]||b.f-A.f});r<n;++r){var C=i[r].s;if(g[C]>t)w+=P-(1<<y-g[C]),g[C]=t;else break}for(w>>=d;w>0;){var x=i[r].s;g[x]<t?w-=1<<t-g[x]++-1:++r}for(;r>=0&&w;--r){var T=i[r].s;g[T]==t&&(--g[T],++w)}y=t}return{t:new ot(g),l:y}},Je=function(s,t,e){return s.s==-1?Math.max(Je(s.l,t,e+1),Je(s.r,t,e+1)):t[s.s]=e},kr=function(s){for(var t=s.length;t&&!s[--t];);for(var e=new wt(++t),r=0,n=s[0],i=1,o=function(h){e[r++]=h},a=1;a<=t;++a)if(s[a]==n&&a!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=s[a]}return{c:e.subarray(0,r),n:t}},oe=function(s,t){for(var e=0,r=0;r<t.length;++r)e+=s[r]*t[r];return e},Br=function(s,t,e){var r=e.length,n=Ze(t+2);s[n]=r&255,s[n+1]=r>>8,s[n+2]=s[n]^255,s[n+3]=s[n+1]^255;for(var i=0;i<r;++i)s[n+i+4]=e[i];return(n+4+r)*8},Fr=function(s,t,e,r,n,i,o,a,h,l,u){Et(t,u++,e),++n[256];for(var c=Ke(n,15),p=c.t,g=c.l,y=Ke(i,15),w=y.t,d=y.l,P=kr(p),C=P.c,x=P.n,T=kr(w),v=T.c,b=T.n,A=new wt(19),S=0;S<C.length;++S)++A[C[S]&31];for(var S=0;S<v.length;++S)++A[v[S]&31];for(var _=Ke(A,7),k=_.t,L=_.l,V=19;V>4&&!k[qe[V-1]];--V);var mt=l+5<<3,O=oe(n,jt)+oe(i,se)+o,N=oe(n,p)+oe(i,w)+o+14+3*V+oe(A,k)+2*A[16]+3*A[17]+7*A[18];if(h>=0&&mt<=O&&mt<=N)return Br(t,u,s.subarray(h,h+l));var R,U,J,W;if(Et(t,u,1+(N<O)),u+=2,N<O){R=Ot(p,g,0),U=p,J=Ot(w,d,0),W=w;var xt=Ot(k,L,0);Et(t,u,x-257),Et(t,u+5,b-1),Et(t,u+10,V-4),u+=14;for(var S=0;S<V;++S)Et(t,u+3*S,k[qe[S]]);u+=3*V;for(var B=[C,v],K=0;K<2;++K)for(var $=B[K],S=0;S<$.length;++S){var F=$[S]&31;Et(t,u,xt[F]),u+=k[F],F>15&&(Et(t,u,$[S]>>5&127),u+=$[S]>>12)}}else R=os,U=jt,J=ls,W=se;for(var S=0;S<a;++S){var D=r[S];if(D>255){var F=D>>18&31;ie(t,u,R[F+257]),u+=U[F+257],F>7&&(Et(t,u,D>>23&31),u+=Se[F]);var X=D&31;ie(t,u,J[X]),u+=W[X],X>3&&(ie(t,u,D>>5&8191),u+=Pe[X])}else ie(t,u,R[D]),u+=U[D]}return ie(t,u,R[256]),u+U[256]},fs=new We([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gr=new ot(0),ps=function(s,t,e,r,n,i){var o=i.z||s.length,a=new ot(r+o+5*(1+Math.ceil(o/7e3))+n),h=a.subarray(r,a.length-n),l=i.l,u=(i.r||0)&7;if(t){u&&(h[0]=i.r>>3);for(var c=fs[t-1],p=c>>13,g=c&8191,y=(1<<e)-1,w=i.p||new wt(32768),d=i.h||new wt(y+1),P=Math.ceil(e/3),C=2*P,x=function(ne){return(s[ne]^s[ne+1]<<P^s[ne+2]<<C)&y},T=new We(25e3),v=new wt(288),b=new wt(32),A=0,S=0,_=i.i||0,k=0,L=i.w||0,V=0;_+2<o;++_){var mt=x(_),O=_&32767,N=d[mt];if(w[O]=N,d[mt]=O,L<=_){var R=o-_;if((A>7e3||k>24576)&&(R>423||!l)){u=Fr(s,h,0,T,v,b,S,k,V,_-V,u),k=A=S=0,V=_;for(var U=0;U<286;++U)v[U]=0;for(var U=0;U<30;++U)b[U]=0}var J=2,W=0,xt=g,B=O-N&32767;if(R>2&&mt==x(_-B))for(var K=Math.min(p,R)-1,$=Math.min(32767,_),F=Math.min(258,R);B<=$&&--xt&&O!=N;){if(s[_+J]==s[_+J-B]){for(var D=0;D<F&&s[_+D]==s[_+D-B];++D);if(D>J){if(J=D,W=B,D>K)break;for(var X=Math.min(B,D-2),q=0,U=0;U<X;++U){var tt=_-B+U&32767,Qt=w[tt],Xt=tt-Qt&32767;Xt>q&&(q=Xt,N=tt)}}}O=N,N=w[O],B+=O-N&32767}if(W){T[k++]=268435456|He[J]<<18|$r[W];var Dt=He[J]&31,Nt=$r[W]&31;S+=Se[Dt]+Pe[Nt],++v[257+Dt],++b[Nt],L=_+J,++A}else T[k++]=s[_],++v[s[_]]}}for(_=Math.max(_,L);_<o;++_)T[k++]=s[_],++v[s[_]];u=Fr(s,h,l,T,v,b,S,k,V,_-V,u),l||(i.r=u&7|h[u/8|0]<<3,u-=7,i.h=d,i.p=w,i.i=_,i.w=L)}else{for(var _=i.w||0;_<o+l;_+=65535){var Lt=_+65535;Lt>=o&&(h[u/8|0]=l,Lt=o),u=Br(h,u+1,s.subarray(_,Lt))}i.i=o}return jr(a,0,r+Ze(u)+n)},Vr=function(){var s=1,t=0;return{p:function(e){for(var r=s,n=t,i=e.length|0,o=0;o!=i;){for(var a=Math.min(o+2655,i);o<a;++o)n+=r+=e[o];r=(r&65535)+15*(r>>16),n=(n&65535)+15*(n>>16)}s=r,t=n},d:function(){return s%=65521,t%=65521,(s&255)<<24|(s&65280)<<8|(t&255)<<8|t>>8}}},ds=function(s,t,e,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new ot(i.length+s.length);o.set(i),o.set(s,i.length),s=o,n.w=i.length}return ps(s,t.level==null?6:t.level,t.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(s.length)))*1.5):20:12+t.mem,e,r,n)},Rr=function(s,t,e){for(;e;++t)s[t]=e,e>>>=8},gs=function(s,t){var e=t.level,r=e==0?0:e<6?1:e==9?3:2;if(s[0]=120,s[1]=r<<6|(t.dictionary&&32),s[1]|=31-(s[0]<<8|s[1])%31,t.dictionary){var n=Vr();n.p(t.dictionary),Rr(s,2,n.d())}},ys=function(s,t){return((s[0]&15)!=8||s[0]>>4>7||(s[0]<<8|s[1])%31)&&St(6,"invalid zlib data"),(s[1]>>5&1)==+!t&&St(6,"invalid zlib data: "+(s[1]&32?"need":"unexpected")+" dictionary"),(s[1]>>3&4)+2};function ms(s,t){t||(t={});var e=Vr();e.p(s);var r=ds(s,t,t.dictionary?6:2,4);return gs(r,t),Rr(r,r.length-4,e.d()),r}function ws(s,t){return us(s.subarray(ys(s,t),-4),{i:2},t,t)}var vs=typeof TextDecoder<"u"&&new TextDecoder,bs=0;try{vs.decode(Gr,{stream:!0}),bs=1}catch{}const Ms="modern-font";function ae(s,t){if(!s)throw new Error(`[${Ms}] ${t}`)}function xs(s){return ArrayBuffer.isView(s)?s.byteOffset>0||s.byteLength<s.buffer.byteLength?s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength):s.buffer:s}function Gt(s){return ArrayBuffer.isView(s)?new DataView(s.buffer,s.byteOffset,s.byteLength):new DataView(s)}var Wr=Object.defineProperty,Cs=(s,t,e)=>t in s?Wr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,at=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&Wr(t,e,n),n},Ss=(s,t,e)=>(Cs(s,t+"",e),e);const _e={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function lt(){return function(s,t){Object.defineProperty(s.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 rt extends DataView{constructor(t,e,r,n){super(xs(t),e,r),this.littleEndian=n,Ss(this,"cursor",0)}readColumn(t){if(t.size){const e=Array.from({length:t.size},(r,n)=>this.read(t.type,t.offset+n));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,n)=>{this.write(t.type,e[n],t.offset+n)}):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 n=`get${t.replace(/^\S/,o=>o.toUpperCase())}`,i=this[n](e,r);return this.cursor+=_e[t],i}readUint24(t=this.cursor){const[e,r,n]=this.readBytes(t,3);return(e<<16)+(r<<8)+n}readBytes(t,e){e==null&&(e=t,t=this.cursor);const r=[];for(let n=0;n<e;++n)r.push(this.getUint8(t+n));return this.cursor=t+e,r}readString(t,e){const r=this.readBytes(t,e);let n="";for(let i=0,o=r.length;i<o;i++)n+=String.fromCharCode(r[i]);return n}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),n=new Date;return n.setTime(r*1e3+-20775456e5),n}readChar(t){return this.readString(t,1)}write(t,e,r=this.cursor,n=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 i=`set${t.replace(/^\S/,a=>a.toUpperCase())}`,o=this[i](r,e,n);return this.cursor+=_e[t.toLowerCase()],o}writeString(t="",e=this.cursor){const r=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let n=0,i=t.length,o;n<i;++n)o=t.charCodeAt(n)||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 n=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(n,e+4),this}writeBytes(t,e=this.cursor){let r;if(Array.isArray(t)){r=t.length;for(let n=0;n<r;++n)this.setUint8(e+n,t[n])}else{const n=Gt(t);r=n.byteLength;for(let i=0;i<r;++i)this.setUint8(e+i,n.getUint8(i))}return this.cursor=e+r,this}seek(t){return this.cursor=t,this}}at([lt()],rt.prototype,"readInt8"),at([lt()],rt.prototype,"readInt16"),at([lt()],rt.prototype,"readInt32"),at([lt()],rt.prototype,"readUint8"),at([lt()],rt.prototype,"readUint16"),at([lt()],rt.prototype,"readUint32"),at([lt()],rt.prototype,"readFloat32"),at([lt()],rt.prototype,"readFloat64"),at([lt()],rt.prototype,"writeInt8"),at([lt()],rt.prototype,"writeInt16"),at([lt()],rt.prototype,"writeInt32"),at([lt()],rt.prototype,"writeUint8"),at([lt()],rt.prototype,"writeUint16"),at([lt()],rt.prototype,"writeUint32"),at([lt()],rt.prototype,"writeFloat32"),at([lt()],rt.prototype,"writeFloat64");var Ps=Object.defineProperty,_s=(s,t,e)=>t in s?Ps(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Ts=(s,t,e)=>(_s(s,t+"",e),e);const qr=new WeakMap;function m(s){const t=typeof s=="object"?s:{type:s},{size:e=1,type:r}=t;return(n,i)=>{if(typeof i!="string")return;let o=qr.get(n);o||(o={columns:[],byteLength:0},qr.set(n,o));const a={...t,name:i,byteLength:e*_e[r],offset:t.offset??o.columns.reduce((h,l)=>h+l.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((h,l)=>h+_e[l.type]*(l.size??1),0),Object.defineProperty(n.constructor.prototype,i,{get(){return this.view.readColumn(a)},set(h){this.view.writeColumn(a,h)},configurable:!0,enumerable:!0})}}class Mt{constructor(t,e,r,n){Ts(this,"view"),this.view=new rt(t,e,r,n)}}function Os(s){let t="";for(let e=0,r=s.length,n;e<r;e++)n=s.charCodeAt(e),n!==0&&(t+=String.fromCharCode(n));return t}function Te(s){s=Os(s);const t=[];for(let e=0,r=s.length,n;e<r;e++)n=s.charCodeAt(e),t.push(n>>8),t.push(n&255);return t}function Is(s){let t="";for(let e=0,r=s.length;e<r;e++)s[e]<127?t+=String.fromCharCode(s[e]):t+=`%${(256+s[e]).toString(16).slice(1)}`;return unescape(t)}function As(s){let t="";for(let e=0,r=s.length;e<r;e+=2)t+=String.fromCharCode((s[e]<<8)+s[e+1]);return t}class Oe extends Mt{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 Hr=Object.defineProperty,Ds=(s,t,e)=>t in s?Hr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ft=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&Hr(t,e,n),n},Qr=(s,t,e)=>(Ds(s,typeof t!="symbol"?t+"":t,e),e);const ht=class Kn extends Oe{constructor(){super(...arguments),Qr(this,"format","EmbeddedOpenType"),Qr(this,"mimeType","application/vnd.ms-fontobject")}static from(t){const e=t.sfnt,n=e.name.names,i=Te(n.fontFamily||""),o=i.length,a=Te(n.fontStyle||""),h=a.length,l=Te(n.version||""),u=l.length,c=Te(n.fullName||""),p=c.length,g=86+o+4+h+4+u+4+p+2+t.view.byteLength,y=new Kn(new ArrayBuffer(g),0,g,!0);y.EOTSize=y.view.byteLength,y.FontDataSize=t.view.byteLength,y.Version=131073,y.Flags=0,y.Charset=1,y.MagicNumber=20556,y.Padding1=0,y.CheckSumAdjustment=e.head.checkSumAdjustment;const w=e.os2;return w&&(y.FontPANOSE=w.fontPANOSE,y.Italic=w.fsSelection,y.Weight=w.usWeightClass,y.fsType=w.fsType,y.UnicodeRange=w.ulUnicodeRange,y.CodePageRange=w.ulCodePageRange),y.view.writeUint16(o),y.view.writeBytes(i),y.view.writeUint16(0),y.view.writeUint16(h),y.view.writeBytes(a),y.view.writeUint16(0),y.view.writeUint16(u),y.view.writeBytes(l),y.view.writeUint16(0),y.view.writeUint16(p),y.view.writeBytes(c),y.view.writeUint16(0),y.view.writeUint16(0),y.view.writeBytes(t.view),y}};ft([m("uint32")],ht.prototype,"EOTSize"),ft([m("uint32")],ht.prototype,"FontDataSize"),ft([m("uint32")],ht.prototype,"Version"),ft([m("uint32")],ht.prototype,"Flags"),ft([m({type:"uint8",size:10})],ht.prototype,"FontPANOSE"),ft([m("uint8")],ht.prototype,"Charset"),ft([m("uint8")],ht.prototype,"Italic"),ft([m("uint32")],ht.prototype,"Weight"),ft([m("uint16")],ht.prototype,"fsType"),ft([m("uint16")],ht.prototype,"MagicNumber"),ft([m({type:"uint8",size:16})],ht.prototype,"UnicodeRange"),ft([m({type:"uint8",size:8})],ht.prototype,"CodePageRange"),ft([m("uint32")],ht.prototype,"CheckSumAdjustment"),ft([m({type:"uint8",size:16})],ht.prototype,"Reserved"),ft([m("uint16")],ht.prototype,"Padding1");let Ns=ht;var zs=Object.defineProperty,Ie=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&zs(t,e,n),n};class Yt extends Mt{constructor(t,e){super(t,e,16)}}Ie([m({type:"char",size:4})],Yt.prototype,"tag"),Ie([m("uint32")],Yt.prototype,"checkSum"),Ie([m("uint32")],Yt.prototype,"offset"),Ie([m("uint32")],Yt.prototype,"length");const tr=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Es=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"];var Us=Object.defineProperty,Ls=(s,t,e)=>t in s?Us(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,le=(s,t,e)=>(Ls(s,typeof t!="symbol"?t+"":t,e),e);class er{constructor(t){le(this,"index"),le(this,"name"),le(this,"isComposite",!1),le(this,"components",[]),le(this,"pathCommands",[]);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,n={},i){const o=1/((i==null?void 0:i.unitsPerEm)??1e3)*r,{xScale:a=o,yScale:h=o}=n,l=this.pathCommands,u=[];for(let c=0,p=l.length;c<p;c+=1){const g=l[c];g.type==="M"?u.push({type:"M",x:t+g.x*a,y:e+-g.y*h}):g.type==="L"?u.push({type:"L",x:t+g.x*a,y:e+-g.y*h}):g.type==="Q"?u.push({type:"Q",x1:t+g.x1*a,y1:e+-g.y1*h,x:t+g.x*a,y:e+-g.y*h}):g.type==="C"?u.push({type:"C",x1:t+g.x1*a,y1:e+-g.y1*h,x2:t+g.x2*a,y2:e+-g.y2*h,x:t+g.x*a,y:e+-g.y*h}):g.type==="Z"&&u.push({type:"Z"})}return u}}class $s extends er{parse(t,e,r){const n=this,{nominalWidthX:i,defaultWidthX:o,gsubrsBias:a,subrsBias:h}=t,l=t.topDict.paintType,u=this.index;let c,p,g,y;const w=[],d=[];let P=0,C=!1,x=!1,T=o,v=0,b=0;function A(O,N){w.push({type:"L",x:O,y:N})}function S(O,N,R,U,J,W){w.push({type:"C",x1:O,y1:N,x2:R,y2:U,x:J,y:W})}function _(O,N){x&&l!==2&&k(),x=!0,w.push({type:"M",x:O,y:N})}function k(){w.push({type:"Z"})}function L(O){w.push(...O)}function V(){d.length%2!==0&&!C&&(T=d.shift()+i),P+=d.length>>1,d.length=0,C=!0}function mt(O){let N,R,U,J,W,xt,B,K,$,F,D,X,q=0;for(;q<O.length;){let tt=O[q++];switch(tt){case 1:V();break;case 3:V();break;case 4:d.length>1&&!C&&(T=d.shift()+i,C=!0),b+=d.pop(),_(v,b);break;case 5:for(;d.length>0;)v+=d.shift(),b+=d.shift(),A(v,b);break;case 6:for(;d.length>0&&(v+=d.shift(),A(v,b),d.length!==0);)b+=d.shift(),A(v,b);break;case 7:for(;d.length>0&&(b+=d.shift(),A(v,b),d.length!==0);)v+=d.shift(),A(v,b);break;case 8:for(;d.length>0;)c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y+d.shift(),S(c,p,g,y,v,b);break;case 10:W=d.pop()+h,xt=t.subrs[W],xt&&mt(xt);break;case 11:return;case 12:switch(tt=O[q],q+=1,tt){case 35:c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),B=g+d.shift(),K=y+d.shift(),$=B+d.shift(),F=K+d.shift(),D=$+d.shift(),X=F+d.shift(),v=D+d.shift(),b=X+d.shift(),d.shift(),S(c,p,g,y,B,K),S($,F,D,X,v,b);break;case 34:c=v+d.shift(),p=b,g=c+d.shift(),y=p+d.shift(),B=g+d.shift(),K=y,$=B+d.shift(),F=y,D=$+d.shift(),X=b,v=D+d.shift(),S(c,p,g,y,B,K),S($,F,D,X,v,b);break;case 36:c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),B=g+d.shift(),K=y,$=B+d.shift(),F=y,D=$+d.shift(),X=F+d.shift(),v=D+d.shift(),S(c,p,g,y,B,K),S($,F,D,X,v,b);break;case 37:c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),B=g+d.shift(),K=y+d.shift(),$=B+d.shift(),F=K+d.shift(),D=$+d.shift(),X=F+d.shift(),Math.abs(D-v)>Math.abs(X-b)?v=D+d.shift():b=X+d.shift(),S(c,p,g,y,B,K),S($,F,D,X,v,b);break;default:console.warn(`Glyph ${u}: unknown operator ${1200+tt}`),d.length=0}break;case 14:if(d.length>=4){const Qt=tr[d.pop()],Xt=tr[d.pop()],Dt=d.pop(),Nt=d.pop();if(Qt&&Xt){n.isComposite=!0,n.components=[];const Lt=t.charset.indexOf(Qt),ne=t.charset.indexOf(Xt);n.components.push({glyphIndex:ne,dx:0,dy:0}),n.components.push({glyphIndex:Lt,dx:Nt,dy:Dt}),L(r.get(ne).pathCommands);const Or=JSON.parse(JSON.stringify(r.get(Lt).pathCommands));for(let Ir=0;Ir<Or.length;Ir+=1){const zt=Or[Ir];zt.type!=="Z"&&(zt.x+=Nt,zt.y+=Dt),(zt.type==="Q"||zt.type==="C")&&(zt.x1+=Nt,zt.y1+=Dt),zt.type==="C"&&(zt.x2+=Nt,zt.y2+=Dt)}L(Or)}}else d.length>0&&!C&&(T=d.shift()+i,C=!0);x&&l!==2&&(k(),x=!1);break;case 18:V();break;case 19:case 20:V(),q+=P+7>>3;break;case 21:d.length>2&&!C&&(T=d.shift()+i,C=!0),b+=d.pop(),v+=d.pop(),_(v,b);break;case 22:d.length>1&&!C&&(T=d.shift()+i,C=!0),v+=d.pop(),_(v,b);break;case 23:V();break;case 24:for(;d.length>2;)c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y+d.shift(),S(c,p,g,y,v,b);v+=d.shift(),b+=d.shift(),A(v,b);break;case 25:for(;d.length>6;)v+=d.shift(),b+=d.shift(),A(v,b);c=v+d.shift(),p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y+d.shift(),S(c,p,g,y,v,b);break;case 26:for(d.length%2&&(v+=d.shift());d.length>0;)c=v,p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g,b=y+d.shift(),S(c,p,g,y,v,b);break;case 27:for(d.length%2&&(b+=d.shift());d.length>0;)c=v+d.shift(),p=b,g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y,S(c,p,g,y,v,b);break;case 28:N=O[q],R=O[q+1],d.push((N<<24|R<<16)>>16),q+=2;break;case 29:W=d.pop()+a,xt=t.gsubrs[W],xt&&mt(xt);break;case 30:for(;d.length>0&&(c=v,p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y+(d.length===1?d.shift():0),S(c,p,g,y,v,b),d.length!==0);)c=v+d.shift(),p=b,g=c+d.shift(),y=p+d.shift(),b=y+d.shift(),v=g+(d.length===1?d.shift():0),S(c,p,g,y,v,b);break;case 31:for(;d.length>0&&(c=v+d.shift(),p=b,g=c+d.shift(),y=p+d.shift(),b=y+d.shift(),v=g+(d.length===1?d.shift():0),S(c,p,g,y,v,b),d.length!==0);)c=v,p=b+d.shift(),g=c+d.shift(),y=p+d.shift(),v=g+d.shift(),b=y+(d.length===1?d.shift():0),S(c,p,g,y,v,b);break;default:tt<32?console.warn(`Glyph ${u}: unknown operator ${tt}`):tt<247?d.push(tt-139):tt<251?(N=O[q],q+=1,d.push((tt-247)*256+N+108)):tt<255?(N=O[q],q+=1,d.push(-(tt-251)*256-N-108)):(N=O[q],R=O[q+1],U=O[q+2],J=O[q+3],q+=4,d.push((N<<24|R<<16|U<<8|J)/65536))}}}mt(e),this.pathCommands=w,C&&(this.advanceWidth=T)}}var js=Object.defineProperty,ks=(s,t,e)=>t in s?js(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Bs=(s,t,e)=>(ks(s,t+"",e),e);class rr{constructor(t){this._sfnt=t,Bs(this,"_items",[])}get(t){const e=this._items[t];let r;if(e)r=e;else{r=this._get(t);const n=this._sfnt.hmtx.metrics[t];n&&(r.advanceWidth=r.advanceWidth||n.advanceWidth,r.leftSideBearing=r.leftSideBearing||n.leftSideBearing);const i=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);i&&(r.unicode??(r.unicode=i[0]),r.unicodes??(r.unicodes=i)),this._items[t]=r}return r}}class Fs extends rr{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,r=new $s({index:t});return r.parse(e,e.charStringsIndex.get(t),this),r.name=e.charset[t],r}}var Xr=Object.defineProperty,Gs=(s,t,e)=>t in s?Xr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Yr=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&Xr(t,e,n),n},Ae=(s,t,e)=>(Gs(s,typeof t!="symbol"?t+"":t,e),e);class De extends Mt{constructor(t,e,r,n){super(t,e,r,n),Ae(this,"_offsets"),Ae(this,"_objects"),this._init()}get offsets(){return this._offsets??(this._offsets=this.readOffsets())}get objects(){return this._objects??(this._objects=this.readObjects())}_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 n=[];for(let i=0,o=e+1;i<o;i++){const a=this.view;let h=0;for(let l=0;l<r;l++)h<<=8,h+=a.readUint8();n.push(h)}return n}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,n=r+e[t],o=r+e[t+1]-n;return this._isString?this.view.readString(n,o):this.view.readBytes(n,o)}}Yr([m("uint16")],De.prototype,"count"),Yr([m("uint8")],De.prototype,"offsetSize");class Ne extends De{constructor(){super(...arguments),Ae(this,"_isString",!1)}}class Zr extends De{constructor(){super(...arguments),Ae(this,"_isString",!0)}}const Vs=[".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"],Rs=[".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"],Ws=[".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"],qs=[".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 ze(s,t){return t<=390?Vs[t]:s[t-391]}var Hs=Object.defineProperty,Qs=(s,t,e)=>t in s?Hs(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Kr=(s,t,e)=>(Qs(s,typeof t!="symbol"?t+"":t,e),e);function G(s,t="number",e){return(r,n)=>{if(typeof n!="string")return;const i={type:t,operator:s,default:e??t==="number"?0:void 0};Object.defineProperty(r.constructor.prototype,n,{get(){return this._getProp(i)},set(o){this._setProp(i,o)},configurable:!0,enumerable:!0})}}class Jr extends Mt{constructor(){super(...arguments),Kr(this,"_dict"),Kr(this,"_stringIndex")}get dict(){return this._dict??(this._dict=this._readDict())}setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const r=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const i=t.readUint8(),o=i>>4,a=i&15;if(o===r||(e+=n[o],a===r))break;e+=n[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let r,n,i,o;if(t===28)return r=e.readUint8(),n=e.readUint8(),r<<8|n;if(t===29)return r=e.readUint8(),n=e.readUint8(),i=e.readUint8(),o=e.readUint8(),r<<24|n<<16|i<<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,n={};for(;t.cursor<r;){let i=t.readUint8();i<=21?(i===12&&(i=1200+t.readUint8()),n[i]=e,e=[]):e.push(this._readOperand(i))}return n}_getProp(t){var r;const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return ze(((r=this._stringIndex)==null?void 0:r.objects)??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var Xs=Object.defineProperty,nr=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&Xs(t,e,n),n};class Ee extends Jr{}nr([G(19)],Ee.prototype,"subrs"),nr([G(20)],Ee.prototype,"defaultWidthX"),nr([G(21)],Ee.prototype,"nominalWidthX");var Ys=Object.defineProperty,Y=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&Ys(t,e,n),n};class H extends Jr{}Y([G(0,"string")],H.prototype,"version"),Y([G(1,"string")],H.prototype,"notice"),Y([G(1200,"string")],H.prototype,"copyright"),Y([G(2,"string")],H.prototype,"fullName"),Y([G(3,"string")],H.prototype,"familyName"),Y([G(4,"string")],H.prototype,"weight"),Y([G(1201)],H.prototype,"isFixedPitch"),Y([G(1202)],H.prototype,"italicAngle"),Y([G(1203,"number",-100)],H.prototype,"underlinePosition"),Y([G(1204,"number",50)],H.prototype,"underlineThickness"),Y([G(1205)],H.prototype,"paintType"),Y([G(1206,"number",2)],H.prototype,"charstringType"),Y([G(1207,"number[]",[.001,0,0,.001,0,0])],H.prototype,"fontMatrix"),Y([G(13)],H.prototype,"uniqueId"),Y([G(5,"number[]",[0,0,0,0])],H.prototype,"fontBBox"),Y([G(1208)],H.prototype,"strokeWidth"),Y([G(14)],H.prototype,"xuid"),Y([G(15)],H.prototype,"charset"),Y([G(16)],H.prototype,"encoding"),Y([G(17)],H.prototype,"charStrings"),Y([G(18,"number[]",[0,0])],H.prototype,"private");var Zs=Object.defineProperty,Ks=(s,t,e)=>t in s?Zs(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,sr=(s,t,e)=>(Ks(s,typeof t!="symbol"?t+"":t,e),e);function nt(s,t=s){return e=>{he.tableDefinitions.set(s,{tag:s,prop:t,class:e}),Object.defineProperty(he.prototype,t,{get(){return this.get(s)},set(r){return this.set(s,r)},configurable:!0,enumerable:!0})}}const tn=class xe{constructor(t){sr(this,"tables",new Map),sr(this,"tableViews",new Map),(t instanceof Map?t:new Map(Object.entries(t))).forEach((r,n)=>{this.tableViews.set(n,new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)))})}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 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:n}=this.cff;e=n.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),n=r.length,i=Array.from({length:n}),o=e.get(0);for(let a=0;a<n;a+=1)i[a]=e.get(r[a])||o;return i}getPathCommands(t,e,r,n,i){var o;return(o=this.charToGlyph(t))==null?void 0:o.getPathCommands(e,r,n,i,this)}getAdvanceWidth(t,e,r){return this.forEachGlyph(t,0,0,e,r,()=>{})}forEachGlyph(t,e=0,r=0,n=72,i={},o){const a=1/this.unitsPerEm*n,h=this.textToGlyphs(t);for(let l=0;l<h.length;l+=1){const u=h[l];o.call(this,u,e,r,n,i),u.advanceWidth&&(e+=u.advanceWidth*a),i.letterSpacing?e+=i.letterSpacing*n:i.tracking&&(e+=i.tracking/1e3*n)}return e}clone(){return new xe(this.tableViews)}delete(t){const e=xe.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const r=xe.tableDefinitions.get(t);return r&&this.tables.set(r.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=xe.tableDefinitions.get(t);if(!e)return;let r=this.tables.get(e.prop);if(!r){const n=e.class;if(n){const i=this.tableViews.get(t);if(!i)return;r=new n(i.buffer,i.byteOffset,i.byteLength).setSfnt(this),this.tables.set(e.prop,r)}}return r}};sr(tn,"tableDefinitions",new Map);let he=tn;class ct extends Mt{setSfnt(t){return this._sfnt=t,this}getSfnt(){return this._sfnt}}var en=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,ti=(s,t,e)=>t in s?en(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ce=(s,t,e,r)=>{for(var n=r>1?void 0:r?Js(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&en(t,e,n),n},ir=(s,t,e)=>(ti(s,typeof t!="symbol"?t+"":t,e),e);f.Cff=class extends ct{constructor(t,e,r,n){super(t,e,r,n),ir(this,"_glyphs"),ir(this,"privateDict"),ir(this,"subrsIndex"),this._init()}get glyphs(){return this._glyphs??(this._glyphs=new Fs(this._sfnt))}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}get defaultWidthX(){var t;return((t=this.privateDict)==null?void 0:t.defaultWidthX)??0}get nominalWidthX(){var t;return((t=this.privateDict)==null?void 0:t.nominalWidthX)??0}get subrs(){var t;return((t=this.subrsIndex)==null?void 0:t.objects)??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}_init(){const t=this.view,{buffer:e,byteOffset:r}=t,n=r+4;this.nameIndex=new Zr(e,n),this.topDictIndex=new Ne(e,this.nameIndex.endOffset),this.stringIndex=new Zr(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Ne(e,this.stringIndex.endOffset),this.topDict=new H(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 Ee(e,r+o,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Ne(e,r+o+this.privateDict.subrs))),this.charStringsIndex=new Ne(e,r+this.topDict.charStrings);const a=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Rs:this.topDict.charset===1?this.charset=Ws:this.topDict.charset===2?this.charset=qs:this.charset=this._readCharset(r+this.topDict.charset,a,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=tr:this.topDict.encoding===1?this.encoding=Es:this.encoding=this._readEncoding(r+this.topDict.encoding)}_readCharset(t,e,r){const n=this.view;n.seek(t);let i,o,a;e-=1;const h=[".notdef"],l=n.readUint8();if(l===0)for(i=0;i<e;i+=1)o=n.readUint16(),h.push(ze(r,o));else if(l===1)for(;h.length<=e;)for(o=n.readUint16(),a=n.readUint8(),i=0;i<=a;i+=1)h.push(ze(r,o)),o+=1;else if(l===2)for(;h.length<=e;)for(o=n.readUint16(),a=n.readUint16(),i=0;i<=a;i+=1)h.push(ze(r,o)),o+=1;else throw new Error(`Unknown charset format ${l}`);return h}_readEncoding(t){const e=this.view;e.seek(t);let r,n;const i={},o=e.readUint8();if(o===0){const a=e.readUint8();for(r=0;r<a;r+=1)n=e.readUint8(),i[n]=r}else if(o===1){const a=e.readUint8();for(n=1,r=0;r<a;r+=1){const h=e.readUint8(),l=e.readUint8();for(let u=h;u<=h+l;u+=1)i[u]=n,n+=1}}else console.warn(`unknown encoding format:${o}`);return i}_calcSubroutineBias(t){let e;return t.length<1240?e=107:t.length<33900?e=1131:e=32768,e}},ce([m("uint8")],f.Cff.prototype,"majorVersion",2),ce([m("uint8")],f.Cff.prototype,"minorVersion",2),ce([m("uint8")],f.Cff.prototype,"headerSize",2),ce([m("uint8")],f.Cff.prototype,"offsetSize",2),f.Cff=ce([nt("CFF ","cff")],f.Cff);var ei=Object.defineProperty,Ue=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&ei(t,e,n),n};const ue=class Jn extends Mt{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Jn;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((r,n)=>{n<256&&r<256&&e.view.writeUint8(r,6+n)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,r)=>{t.set(r,e)}),t}};Ue([m("uint16")],ue.prototype,"format"),Ue([m("uint16")],ue.prototype,"length"),Ue([m("uint16")],ue.prototype,"language"),Ue([m({type:"uint8",size:256})],ue.prototype,"glyphIndexArray");let or=ue;var ri=Object.defineProperty,ar=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&ri(t,e,n),n};class fe extends Mt{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,n=this.maxSubHeaderKey,i=this.subHeaders,o=this.glyphIndexArray,a=r.findIndex(l=>l===n);let h=0;for(let l=0;l<256;l++)if(r[l]===0)l>=a||l<i[0].firstCode||l>=i[0].firstCode+i[0].entryCount||i[0].idRangeOffset+(l-i[0].firstCode)>=o.length?h=0:(h=o[i[0].idRangeOffset+(l-i[0].firstCode)],h!==0&&(h=h+i[0].idDelta)),h!==0&&h<t&&e.set(l,h);else{const u=r[l];for(let c=0,p=i[u].entryCount;c<p;c++)if(i[u].idRangeOffset+c>=o.length?h=0:(h=o[i[u].idRangeOffset+c],h!==0&&(h=h+i[u].idDelta)),h!==0&&h<t){const g=(l<<8|c+i[u].firstCode)%65535;e.set(g,h)}}return e}}ar([m("uint16")],fe.prototype,"format"),ar([m("uint16")],fe.prototype,"length"),ar([m("uint16")],fe.prototype,"language");function rn(s){return s>32767?s-65536:s<-32767?s+65536:s}function lr(s,t){let e;const r=[];let n={};return s.forEach((i,o)=>{t&&o>t||((!e||o!==e.unicode+1||i!==e.glyphIndex+1)&&(e?(n.end=e.unicode,r.push(n),n={start:o,startId:i,delta:rn(i-o)}):(n.start=Number(o),n.startId=i,n.delta=rn(i-o))),e={unicode:o,glyphIndex:i})}),e&&(n.end=e.unicode,r.push(n)),r}var ni=Object.defineProperty,Vt=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&ni(t,e,n),n};const kt=class ts extends Mt{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=lr(t,65535),r=e.length+1,n=Math.floor(Math.log(r)/Math.LN2),i=2*2**n,o=new ts(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=r*2,o.searchRange=i,o.entrySelector=n,o.rangeShift=2*r-i,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,n=this.startCode,i=this.endCode,o=this.idRangeOffset,a=this.idDelta,h=this.glyphIndexArray;for(let l=0;l<e;++l)for(let u=n[l],c=i[l];u<=c;++u)if(o[l]===0)t.set(u,(u+a[l])%65536);else{const p=l+o[l]/2+(u-n[l])-r,g=h[p];g!==0?t.set(u,(g+a[l])%65536):t.set(u,0)}return t.delete(65535),t}};Vt([m("uint16")],kt.prototype,"format"),Vt([m("uint16")],kt.prototype,"length"),Vt([m("uint16")],kt.prototype,"language"),Vt([m("uint16")],kt.prototype,"segCountX2"),Vt([m("uint16")],kt.prototype,"searchRange"),Vt([m("uint16")],kt.prototype,"entrySelector"),Vt([m("uint16")],kt.prototype,"rangeShift");let hr=kt;var si=Object.defineProperty,pe=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&si(t,e,n),n};class Rt extends Mt{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,n)=>{e.set(n,r)}),e}}pe([m("uint16")],Rt.prototype,"format"),pe([m("uint16")],Rt.prototype,"length"),pe([m("uint16")],Rt.prototype,"language"),pe([m("uint16")],Rt.prototype,"firstCode"),pe([m("uint16")],Rt.prototype,"entryCount");var ii=Object.defineProperty,de=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&ii(t,e,n),n};const Zt=class es extends Mt{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=lr(t),r=new es(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(n=>{r.view.writeUint32(n.start),r.view.writeUint32(n.end),r.view.writeUint32(n.startId)}),r}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let r=0,n=e.length;r<n;r++){const i=e[r];let o=i.startGlyphCode,a=i.startCharCode;const h=i.endCharCode;for(;a<=h;)t.set(a++,o++)}return t}};de([m("uint16")],Zt.prototype,"format"),de([m("uint16")],Zt.prototype,"reserved"),de([m("uint32")],Zt.prototype,"length"),de([m("uint32")],Zt.prototype,"language"),de([m("uint32")],Zt.prototype,"nGroups");let cr=Zt;var oi=Object.defineProperty,ur=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&oi(t,e,n),n};class ge extends Mt{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,n=e.length;r<n;r++){const{uVSMappings:i}=e[r];i.forEach(o=>{t.set(o.unicodeValue,o.glyphID)})}return t}}ur([m("uint16")],ge.prototype,"format"),ur([m("uint32")],ge.prototype,"length"),ur([m("uint32")],ge.prototype,"numVarSelectorRecords");var nn=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,li=(s,t,e)=>t in s?nn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,fr=(s,t,e,r)=>{for(var n=r>1?void 0:r?ai(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&nn(t,e,n),n},sn=(s,t,e)=>(li(s,typeof t!="symbol"?t+"":t,e),e);f.Cmap=class extends ct{constructor(){super(...arguments),sn(this,"_unicodeToGlyphIndexMap"),sn(this,"_glyphIndexToUnicodesMap")}static from(t){const e=Array.from(t.keys()).some(c=>c>65535),r=hr.from(t),n=or.from(t),i=e?cr.from(t):void 0,o=4+(i?32:24),a=o+r.view.byteLength,h=a+n.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:o},{platformID:1,platformSpecificID:0,offset:a},{platformID:3,platformSpecificID:1,offset:o},i&&{platformID:3,platformSpecificID:10,offset:h}].filter(Boolean),u=new f.Cmap(new ArrayBuffer(4+8*l.length+r.view.byteLength+n.view.byteLength+((i==null?void 0:i.view.byteLength)??0)));return u.numberSubtables=l.length,u.view.seek(4),l.forEach(c=>{u.view.writeUint16(c.platformID),u.view.writeUint16(c.platformSpecificID),u.view.writeUint32(c.offset)}),u.view.writeBytes(r.view,o),u.view.writeBytes(n.view,a),i&&u.view.writeBytes(i.view,h),u}get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??(this._unicodeToGlyphIndexMap=this.readunicodeToGlyphIndexMap())}get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const t=new Map,e=this.unicodeToGlyphIndexMap,r=Array.from(e.keys());for(let n=0,i=r.length;n<i;n++){const o=r[n],a=e.get(o);t.has(a)?t.get(a).push(o):t.set(a,[o])}this._glyphIndexToUnicodesMap=t}return this._glyphIndexToUnicodesMap}readSubtables(){const t=this.numberSubtables;return this.view.seek(4),Array.from({length:t},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const r=this.view.readUint16();let n;switch(r){case 0:n=new or(this.view.buffer,e.offset);break;case 2:n=new fe(this.view.buffer,e.offset,this.view.readUint16());break;case 4:n=new hr(this.view.buffer,e.offset,this.view.readUint16());break;case 6:n=new Rt(this.view.buffer,e.offset,this.view.readUint16());break;case 12:n=new cr(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:n=new ge(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:r,view:n}})}readunicodeToGlyphIndexMap(){var a,h,l,u,c;const t=this.readSubtables(),e=(a=t.find(p=>p.format===0))==null?void 0:a.view,r=(h=t.find(p=>p.platformID===3&&p.platformSpecificID===3&&p.format===2))==null?void 0:h.view,n=(l=t.find(p=>p.platformID===3&&p.platformSpecificID===1&&p.format===4))==null?void 0:l.view,i=(u=t.find(p=>p.platformID===3&&p.platformSpecificID===10&&p.format===12))==null?void 0:u.view,o=(c=t.find(p=>p.platformID===0&&p.platformSpecificID===5&&p.format===14))==null?void 0:c.view;return new Map([...(e==null?void 0:e.getUnicodeToGlyphIndexMap())??[],...(r==null?void 0:r.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs))??[],...(n==null?void 0:n.getUnicodeToGlyphIndexMap())??[],...(i==null?void 0:i.getUnicodeToGlyphIndexMap())??[],...(o==null?void 0:o.getUnicodeToGlyphIndexMap())??[]])}},fr([m("uint16")],f.Cmap.prototype,"version",2),fr([m("uint16")],f.Cmap.prototype,"numberSubtables",2),f.Cmap=fr([nt("cmap")],f.Cmap);class hi extends er{_parseContours(t){const e=[];let r=[];for(let n=0;n<t.length;n+=1){const i=t[n];r.push(i),i.lastPointOfContour&&(e.push(r),r=[])}return ae(r.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const r=[];for(let n=0;n<t.length;n+=1){const i=t[n],o={x:e.xScale*i.x+e.scale10*i.y+e.dx,y:e.scale01*i.x+e.yScale*i.y+e.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};r.push(o)}return r}_parseGlyphCoordinate(t,e,r,n,i){let o;return(e&n)>0?(o=t.view.readUint8(),e&i||(o=-o),o=r+o):(e&i)>0?o=r:o=r+t.view.readInt16(),o}parse(t,e,r){t.view.seek(e);const n=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(),n>0){const a=this.endPointIndices=[];for(let w=0;w<n;w++)a.push(t.view.readUint16());const h=this.instructionLength=t.view.readUint16();ae(h<5e3,`Bad instructionLength:${h}`);const l=this.instructions=[];for(let w=0;w<h;++w)l.push(t.view.readUint8());const u=t.view.byteOffset,c=a[a.length-1]+1;ae(c<2e4,`Bad numberOfCoordinates:${u}`);const p=[];let g,y=0;for(;y<c;)if(g=t.view.readUint8(),p.push(g),y++,g&8&&y<c){const w=t.view.readUint8();for(let d=0;d<w;d++)p.push(g),y++}if(ae(p.length===c,`Bad flags length: ${p.length}, numberOfCoordinates: ${c}`),a.length>0){const w=[];let d;if(c>0){for(let x=0;x<c;x+=1)g=p[x],d={},d.onCurve=!!(g&1),d.lastPointOfContour=a.includes(x),w.push(d);let P=0;for(let x=0;x<c;x+=1)g=p[x],d=w[x],d.x=this._parseGlyphCoordinate(t,g,P,2,16),P=d.x;let C=0;for(let x=0;x<c;x+=1)g=p[x],d=w[x],d.y=this._parseGlyphCoordinate(t,g,C,4,32),C=d.y}this.points=w}else this.points=[]}else if(n===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,h=!0;for(;h;){a=t.view.readUint16();const l={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(l.dx=t.view.readInt16(),l.dy=t.view.readInt16()):l.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(l.dx=t.view.readInt8(),l.dy=t.view.readInt8()):l.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?l.xScale=l.yScale=t.view.readInt16()/16384:(a&64)>0?(l.xScale=t.view.readInt16()/16384,l.yScale=t.view.readInt16()/16384):(a&128)>0&&(l.xScale=t.view.readInt16()/16384,l.scale01=t.view.readInt16()/16384,l.scale10=t.view.readInt16()/16384,l.yScale=t.view.readInt16()/16384),this.components.push(l),h=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let l=0;l<this.instructionLength;l+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const h=this.components[a],l=r.get(h.glyphIndex);if(l.getPathCommands(),l.points){let u;if(h.matchedPoints===void 0)u=this._transformPoints(l.points,h);else{ae(h.matchedPoints[0]>this.points.length-1||h.matchedPoints[1]>l.points.length-1,`Matched points out of range in ${this.name}`);const c=this.points[h.matchedPoints[0]];let p=l.points[h.matchedPoints[1]];const g={xScale:h.xScale,scale01:h.scale01,scale10:h.scale10,yScale:h.yScale,dx:0,dy:0};p=this._transformPoints([p],g)[0],g.dx=c.x-p.x,g.dy=c.y-p.y,u=this._transformPoints(l.points,g)}this.points=this.points.concat(u)}}const i=[],o=this._parseContours(this.points);for(let a=0,h=o.length;a<h;++a){const l=o[a];let u=l[l.length-1],c=l[0];u.onCurve?i.push({type:"M",x:u.x,y:u.y}):c.onCurve?i.push({type:"M",x:c.x,y:c.y}):i.push({type:"M",x:(u.x+c.x)*.5,y:(u.y+c.y)*.5});for(let p=0,g=l.length;p<g;++p)if(u=c,c=l[(p+1)%g],u.onCurve)i.push({type:"L",x:u.x,y:u.y});else{let y=c;c.onCurve||(y={x:(u.x+c.x)*.5,y:(u.y+c.y)*.5}),i.push({type:"Q",x1:u.x,y1:u.y,x:y.x,y:y.y})}i.push({type:"Z"})}this.pathCommands=i}}class ci extends rr{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,r=e[t],n=new hi({index:t});return r!==e[t+1]&&n.parse(this._sfnt.glyf,r,this),n}}var on=Object.defineProperty,ui=Object.getOwnPropertyDescriptor,fi=(s,t,e)=>t in s?on(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,pi=(s,t,e,r)=>{for(var n=r>1?void 0:r?ui(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&on(t,e,n),n},di=(s,t,e)=>(fi(s,t+"",e),e);const Kt={ARG_1_AND_2_ARE_WORDS:1,ARGS_ARE_XY_VALUES:2,ROUND_XY_TO_GRID:4,WE_HAVE_A_SCALE:8,RESERVED:16,MORE_COMPONENTS:32,WE_HAVE_AN_X_AND_Y_SCALE:64,WE_HAVE_A_TWO_BY_TWO:128,WE_HAVE_INSTRUCTIONS:256,USE_MY_METRICS:512,OVERLAP_COMPOUND:1024,SCALED_COMPONENT_OFFSET:2048,UNSCALED_COMPONENT_OFFSET:4096};f.Glyf=class extends ct{constructor(){super(...arguments),di(this,"_glyphs")}static from(t){const e=t.reduce((n,i)=>n+i.byteLength,0),r=new f.Glyf(new ArrayBuffer(e));return t.forEach(n=>{r.view.writeBytes(n)}),r}get glyphs(){return this._glyphs??(this._glyphs=new ci(this._sfnt))}},f.Glyf=pi([nt("glyf")],f.Glyf);var gi=Object.defineProperty,yi=Object.getOwnPropertyDescriptor,mi=(s,t,e,r)=>{for(var n=r>1?void 0:r?yi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&gi(t,e,n),n};f.Gpos=class extends ct{},f.Gpos=mi([nt("GPOS","gpos")],f.Gpos);var wi=Object.defineProperty,vi=Object.getOwnPropertyDescriptor,Wt=(s,t,e,r)=>{for(var n=r>1?void 0:r?vi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&wi(t,e,n),n};f.Gsub=class extends ct{},Wt([m("uint16")],f.Gsub.prototype,"majorVersion",2),Wt([m("uint16")],f.Gsub.prototype,"minorVersion",2),Wt([m("uint16")],f.Gsub.prototype,"scriptListOffset",2),Wt([m("uint16")],f.Gsub.prototype,"featureListOffset",2),Wt([m("uint16")],f.Gsub.prototype,"lookupListOffset",2),Wt([m("uint16")],f.Gsub.prototype,"featureVariationsOffset",2),f.Gsub=Wt([nt("GSUB","gsub")],f.Gsub);var bi=Object.defineProperty,Mi=Object.getOwnPropertyDescriptor,et=(s,t,e,r)=>{for(var n=r>1?void 0:r?Mi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&bi(t,e,n),n};f.Head=class extends ct{constructor(t=new ArrayBuffer(54),e){super(t,e,Math.min(54,t.byteLength-(e??0)))}},et([m("fixed")],f.Head.prototype,"version",2),et([m("fixed")],f.Head.prototype,"fontRevision",2),et([m("uint32")],f.Head.prototype,"checkSumAdjustment",2),et([m("uint32")],f.Head.prototype,"magickNumber",2),et([m("uint16")],f.Head.prototype,"flags",2),et([m("uint16")],f.Head.prototype,"unitsPerEm",2),et([m({type:"longDateTime"})],f.Head.prototype,"created",2),et([m({type:"longDateTime"})],f.Head.prototype,"modified",2),et([m("int16")],f.Head.prototype,"xMin",2),et([m("int16")],f.Head.prototype,"yMin",2),et([m("int16")],f.Head.prototype,"xMax",2),et([m("int16")],f.Head.prototype,"yMax",2),et([m("uint16")],f.Head.prototype,"macStyle",2),et([m("uint16")],f.Head.prototype,"lowestRecPPEM",2),et([m("int16")],f.Head.prototype,"fontDirectionHint",2),et([m("int16")],f.Head.prototype,"indexToLocFormat",2),et([m("int16")],f.Head.prototype,"glyphDataFormat",2),f.Head=et([nt("head")],f.Head);var xi=Object.defineProperty,Ci=Object.getOwnPropertyDescriptor,pt=(s,t,e,r)=>{for(var n=r>1?void 0:r?Ci(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&xi(t,e,n),n};f.Hhea=class extends ct{constructor(t=new ArrayBuffer(36),e){super(t,e,Math.min(36,t.byteLength-(e??0)))}},pt([m("fixed")],f.Hhea.prototype,"version",2),pt([m("int16")],f.Hhea.prototype,"ascent",2),pt([m("int16")],f.Hhea.prototype,"descent",2),pt([m("int16")],f.Hhea.prototype,"lineGap",2),pt([m("uint16")],f.Hhea.prototype,"advanceWidthMax",2),pt([m("int16")],f.Hhea.prototype,"minLeftSideBearing",2),pt([m("int16")],f.Hhea.prototype,"minRightSideBearing",2),pt([m("int16")],f.Hhea.prototype,"xMaxExtent",2),pt([m("int16")],f.Hhea.prototype,"caretSlopeRise",2),pt([m("int16")],f.Hhea.prototype,"caretSlopeRun",2),pt([m("int16")],f.Hhea.prototype,"caretOffset",2),pt([m({type:"int16",size:4})],f.Hhea.prototype,"reserved",2),pt([m("int16")],f.Hhea.prototype,"metricDataFormat",2),pt([m("uint16")],f.Hhea.prototype,"numOfLongHorMetrics",2),f.Hhea=pt([nt("hhea")],f.Hhea);var an=Object.defineProperty,Si=Object.getOwnPropertyDescriptor,Pi=(s,t,e)=>t in s?an(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,_i=(s,t,e,r)=>{for(var n=r>1?void 0:r?Si(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&an(t,e,n),n},Ti=(s,t,e)=>(Pi(s,t+"",e),e);f.Hmtx=class extends ct{constructor(){super(...arguments),Ti(this,"_metrics")}static from(t){const e=t.length*4,r=new f.Hmtx(new ArrayBuffer(e));return t.forEach(n=>{r.view.writeUint16(n.advanceWidth),r.view.writeUint16(n.leftSideBearing)}),r}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){const t=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let r=0;const n=this.view;return n.seek(0),Array.from({length:t}).map((i,o)=>(o<e&&(r=n.readUint16()),{advanceWidth:r,leftSideBearing:n.readUint16()}))}},f.Hmtx=_i([nt("hmtx")],f.Hmtx);var Oi=Object.defineProperty,Ii=Object.getOwnPropertyDescriptor,Ai=(s,t,e,r)=>{for(var n=r>1?void 0:r?Ii(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Oi(t,e,n),n};f.Kern=class extends ct{},f.Kern=Ai([nt("kern","kern")],f.Kern);var ln=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,Ni=(s,t,e)=>t in s?ln(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,zi=(s,t,e,r)=>{for(var n=r>1?void 0:r?Di(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&ln(t,e,n),n},Ei=(s,t,e)=>(Ni(s,t+"",e),e);f.Loca=class extends ct{constructor(){super(...arguments),Ei(this,"_locations")}static from(t,e=1){const r=t.length*(e?4:2),n=new f.Loca(new ArrayBuffer(r));return t.forEach(i=>{e?n.view.writeUint32(i):n.view.writeUint16(i/2)}),n}get locations(){return this._locations??(this._locations=this.readLocations())}readLocations(){const t=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,r=this.view;return r.seek(0),Array.from({length:t}).map(()=>e?r.readUint32():r.readUint16()*2)}},f.Loca=zi([nt("loca")],f.Loca);var Ui=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,ut=(s,t,e,r)=>{for(var n=r>1?void 0:r?Li(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Ui(t,e,n),n};f.Maxp=class extends ct{constructor(t=new ArrayBuffer(32),e){super(t,e,Math.min(32,t.byteLength-(e??0)))}},ut([m("fixed")],f.Maxp.prototype,"version",2),ut([m("uint16")],f.Maxp.prototype,"numGlyphs",2),ut([m("uint16")],f.Maxp.prototype,"maxPoints",2),ut([m("uint16")],f.Maxp.prototype,"maxContours",2),ut([m("uint16")],f.Maxp.prototype,"maxComponentPoints",2),ut([m("uint16")],f.Maxp.prototype,"maxComponentContours",2),ut([m("uint16")],f.Maxp.prototype,"maxZones",2),ut([m("uint16")],f.Maxp.prototype,"maxTwilightPoints",2),ut([m("uint16")],f.Maxp.prototype,"maxStorage",2),ut([m("uint16")],f.Maxp.prototype,"maxFunctionDefs",2),ut([m("uint16")],f.Maxp.prototype,"maxInstructionDefs",2),ut([m("uint16")],f.Maxp.prototype,"maxStackElements",2),ut([m("uint16")],f.Maxp.prototype,"maxSizeOfInstructions",2),ut([m("uint16")],f.Maxp.prototype,"maxComponentElements",2),ut([m("uint16")],f.Maxp.prototype,"maxComponentDepth",2),f.Maxp=ut([nt("maxp")],f.Maxp);var hn=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,ji=(s,t,e)=>t in s?hn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Le=(s,t,e,r)=>{for(var n=r>1?void 0:r?$i(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&hn(t,e,n),n},ki=(s,t,e)=>(ji(s,t+"",e),e);const cn={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"},pr={Unicode:0,Macintosh:1,reserved:2,Microsoft:3},Bi={Default:0,"Version1.1":1,ISO10646:2,UnicodeBMP:3,UnicodenonBMP:4,UnicodeVariationSequences:5,FullUnicodecoverage:6},un={Symbol:0,UCS2:1,ShiftJIS:2,PRC:3,BigFive:4,Johab:5,UCS4:6};f.Name=class extends ct{constructor(){super(...arguments),ki(this,"_names")}get names(){return this._names??(this._names=this.readNames())}readNames(){const t=this.count;this.view.seek(6);const e=[];for(let h=0;h<t;++h)e.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 r=this.stringOffset;for(let h=0;h<t;++h){const l=e[h];l.name=this.view.readBytes(r+l.offset,l.length)}let n=pr.Macintosh,i=Bi.Default,o=0;e.some(h=>h.platform===pr.Microsoft&&h.encoding===un.UCS2&&h.language===1033)&&(n=pr.Microsoft,i=un.UCS2,o=1033);const a={};for(let h=0;h<t;++h){const l=e[h];l.platform===n&&l.encoding===i&&l.language===o&&cn[l.nameId]&&(a[cn[l.nameId]]=o===0?Is(l.name):As(l.name))}return a}},Le([m("uint16")],f.Name.prototype,"format",2),Le([m("uint16")],f.Name.prototype,"count",2),Le([m("uint16")],f.Name.prototype,"stringOffset",2),f.Name=Le([nt("name")],f.Name);var Fi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,I=(s,t,e,r)=>{for(var n=r>1?void 0:r?Gi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Fi(t,e,n),n};f.Os2=class extends ct{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}},I([m("uint16")],f.Os2.prototype,"version",2),I([m("int16")],f.Os2.prototype,"xAvgCharWidth",2),I([m("uint16")],f.Os2.prototype,"usWeightClass",2),I([m("uint16")],f.Os2.prototype,"usWidthClass",2),I([m("uint16")],f.Os2.prototype,"fsType",2),I([m("uint16")],f.Os2.prototype,"ySubscriptXSize",2),I([m("uint16")],f.Os2.prototype,"ySubscriptYSize",2),I([m("uint16")],f.Os2.prototype,"ySubscriptXOffset",2),I([m("uint16")],f.Os2.prototype,"ySubscriptYOffset",2),I([m("uint16")],f.Os2.prototype,"ySuperscriptXSize",2),I([m("uint16")],f.Os2.prototype,"ySuperscriptYSize",2),I([m("uint16")],f.Os2.prototype,"ySuperscriptXOffset",2),I([m("uint16")],f.Os2.prototype,"ySuperscriptYOffset",2),I([m("uint16")],f.Os2.prototype,"yStrikeoutSize",2),I([m("uint16")],f.Os2.prototype,"yStrikeoutPosition",2),I([m("uint16")],f.Os2.prototype,"sFamilyClass",2),I([m({type:"uint8"})],f.Os2.prototype,"bFamilyType",2),I([m({type:"uint8"})],f.Os2.prototype,"bSerifStyle",2),I([m({type:"uint8"})],f.Os2.prototype,"bWeight",2),I([m({type:"uint8"})],f.Os2.prototype,"bProportion",2),I([m({type:"uint8"})],f.Os2.prototype,"bContrast",2),I([m({type:"uint8"})],f.Os2.prototype,"bStrokeVariation",2),I([m({type:"uint8"})],f.Os2.prototype,"bArmStyle",2),I([m({type:"uint8"})],f.Os2.prototype,"bLetterform",2),I([m({type:"uint8"})],f.Os2.prototype,"bMidline",2),I([m({type:"uint8"})],f.Os2.prototype,"bXHeight",2),I([m({type:"uint8",size:16})],f.Os2.prototype,"ulUnicodeRange",2),I([m({type:"char",size:4})],f.Os2.prototype,"achVendID",2),I([m("uint16")],f.Os2.prototype,"fsSelection",2),I([m("uint16")],f.Os2.prototype,"usFirstCharIndex",2),I([m("uint16")],f.Os2.prototype,"usLastCharIndex",2),I([m("int16")],f.Os2.prototype,"sTypoAscender",2),I([m("int16")],f.Os2.prototype,"sTypoDescender",2),I([m("int16")],f.Os2.prototype,"sTypoLineGap",2),I([m("uint16")],f.Os2.prototype,"usWinAscent",2),I([m("uint16")],f.Os2.prototype,"usWinDescent",2),I([m({offset:72,type:"uint8",size:8})],f.Os2.prototype,"ulCodePageRange",2),I([m({offset:72,type:"int16"})],f.Os2.prototype,"sxHeight",2),I([m("int16")],f.Os2.prototype,"sCapHeight",2),I([m("uint16")],f.Os2.prototype,"usDefaultChar",2),I([m("uint16")],f.Os2.prototype,"usBreakChar",2),I([m("uint16")],f.Os2.prototype,"usMaxContext",2),f.Os2=I([nt("OS/2","os2")],f.Os2);var Vi=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,It=(s,t,e,r)=>{for(var n=r>1?void 0:r?Ri(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Vi(t,e,n),n};f.Post=class extends ct{constructor(t=new ArrayBuffer(32),e,r){super(t,e,r)}},It([m("fixed")],f.Post.prototype,"format",2),It([m("fixed")],f.Post.prototype,"italicAngle",2),It([m("int16")],f.Post.prototype,"underlinePosition",2),It([m("int16")],f.Post.prototype,"underlineThickness",2),It([m("uint32")],f.Post.prototype,"isFixedPitch",2),It([m("uint32")],f.Post.prototype,"minMemType42",2),It([m("uint32")],f.Post.prototype,"maxMemType42",2),It([m("uint32")],f.Post.prototype,"minMemType1",2),It([m("uint32")],f.Post.prototype,"maxMemType1",2),f.Post=It([nt("post")],f.Post);var Wi=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,dt=(s,t,e,r)=>{for(var n=r>1?void 0:r?qi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&Wi(t,e,n),n};f.Vhea=class extends ct{constructor(t=new ArrayBuffer(36),e){super(t,e,Math.min(36,t.byteLength-(e??0)))}},dt([m("fixed")],f.Vhea.prototype,"version",2),dt([m("int16")],f.Vhea.prototype,"vertTypoAscender",2),dt([m("int16")],f.Vhea.prototype,"vertTypoDescender",2),dt([m("int16")],f.Vhea.prototype,"vertTypoLineGap",2),dt([m("int16")],f.Vhea.prototype,"advanceHeightMax",2),dt([m("int16")],f.Vhea.prototype,"minTopSideBearing",2),dt([m("int16")],f.Vhea.prototype,"minBottomSideBearing",2),dt([m("int16")],f.Vhea.prototype,"yMaxExtent",2),dt([m("int16")],f.Vhea.prototype,"caretSlopeRise",2),dt([m("int16")],f.Vhea.prototype,"caretSlopeRun",2),dt([m("int16")],f.Vhea.prototype,"caretOffset",2),dt([m({type:"int16",size:4})],f.Vhea.prototype,"reserved",2),dt([m("int16")],f.Vhea.prototype,"metricDataFormat",2),dt([m("int16")],f.Vhea.prototype,"numOfLongVerMetrics",2),f.Vhea=dt([nt("vhea")],f.Vhea);var fn=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Qi=(s,t,e)=>t in s?fn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Xi=(s,t,e,r)=>{for(var n=r>1?void 0:r?Hi(t,e):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=(r?o(t,e,n):o(n))||n);return r&&n&&fn(t,e,n),n},Yi=(s,t,e)=>(Qi(s,t+"",e),e);f.Vmtx=class extends ct{constructor(){super(...arguments),Yi(this,"_metrics")}static from(t){const e=t.length*4,r=new f.Vmtx(new ArrayBuffer(e));return t.forEach(n=>{r.view.writeUint16(n.advanceHeight),r.view.writeInt16(n.topSideBearing)}),r}get metrics(){return this._metrics??(this._metrics=this.readMetrics())}readMetrics(){var i;const t=this._sfnt.maxp.numGlyphs,e=((i=this._sfnt.vhea)==null?void 0:i.numOfLongVerMetrics)??0,r=this.view;r.seek(0);let n=0;return Array.from({length:t}).map((o,a)=>(a<e&&(n=r.readUint16()),{advanceHeight:n,topSideBearing:r.readUint8()}))}},f.Vmtx=Xi([nt("vmtx")],f.Vmtx);var pn=Object.defineProperty,Zi=(s,t,e)=>t in s?pn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ye=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&pn(t,e,n),n},$e=(s,t,e)=>(Zi(s,typeof t!="symbol"?t+"":t,e),e);class st extends Oe{constructor(){super(...arguments),$e(this,"format","TrueType"),$e(this,"mimeType","font/ttf"),$e(this,"_sfnt")}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(Gt(t).getUint32(0))}static checksum(t){const e=Gt(t);let r=e.byteLength;for(;r%4;)r++;let n=0;for(let i=0,o=r/4;i<o;i+=4)i*4<r-4&&(n+=e.getUint32(i*4,!1));return n&4294967295}static from(t){const e=c=>c+3&-4,r=t.tableViews.size,n=t.tableViews.values().reduce((c,p)=>c+e(p.byteLength),0),i=new this(new ArrayBuffer(12+r*16+n));i.scalerType=65536,i.numTables=r;const o=Math.log(2);i.searchRange=Math.floor(Math.log(r)/o)*16,i.entrySelector=Math.floor(i.searchRange/o),i.rangeShift=r*16-i.searchRange;let a=12+r*16,h=0;const l=i.getDirectories();t.tableViews.forEach((c,p)=>{const g=l[h++];g.tag=p,g.checkSum=this.checksum(c),g.offset=a,g.length=c.byteLength,i.view.writeBytes(c,a),a+=e(g.length)});const u=i.createSfnt().head;return u.checkSumAdjustment=0,u.checkSumAdjustment=2981146554-this.checksum(i.view),i}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Yt(this.view.buffer,t);return t+=e.view.byteLength,e})}createSfnt(){return new he(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}$e(st,"signature",new Set([65536,1953658213,1954115633])),ye([m("uint32")],st.prototype,"scalerType"),ye([m("uint16")],st.prototype,"numTables"),ye([m("uint16")],st.prototype,"searchRange"),ye([m("uint16")],st.prototype,"entrySelector"),ye([m("uint16")],st.prototype,"rangeShift");var Ki=Object.defineProperty,Ji=(s,t,e)=>t in s?Ki(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,dr=(s,t,e)=>(Ji(s,typeof t!="symbol"?t+"":t,e),e);class je extends st{constructor(){super(...arguments),dr(this,"format","OpenType"),dr(this,"mimeType","font/otf")}static from(t){return super.from(t)}}dr(je,"signature",new Set([1330926671]));var to=Object.defineProperty,me=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&to(t,e,n),n};class qt extends Mt{constructor(t,e){super(t,e,20)}}me([m({type:"char",size:4})],qt.prototype,"tag"),me([m("uint32")],qt.prototype,"offset"),me([m("uint32")],qt.prototype,"compLength"),me([m("uint32")],qt.prototype,"origLength"),me([m("uint32")],qt.prototype,"origChecksum");var dn=Object.defineProperty,eo=(s,t,e)=>t in s?dn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,vt=(s,t,e,r)=>{for(var n=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(n=o(t,e,n)||n);return n&&dn(t,e,n),n},ke=(s,t,e)=>(eo(s,typeof t!="symbol"?t+"":t,e),e);const gt=class Ar extends Oe{constructor(){super(...arguments),ke(this,"format","WOFF"),ke(this,"mimeType","font/woff"),ke(this,"_sfnt")}get subfontFormat(){return st.is(this.flavor)?"TrueType":je.is(this.flavor)?"OpenType":"Open"}get sfnt(){return this._sfnt||(this._sfnt=this.createSfnt()),this._sfnt}static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(Gt(t).getUint32(0))}static checkSum(t){const e=Gt(t),r=e.byteLength,n=Math.floor(r/4);let i=0,o=0;for(;o<n;)i+=e.getUint32(4*o++,!1);let a=r-n*4;if(a){let h=n*4;for(;a>0;)i+=e.getUint8(h)<<a*8,h++,a--}return i%4294967296}static from(t,e=new ArrayBuffer(0)){const r=c=>c+3&-4,n=[];t.tableViews.forEach((c,p)=>{const g=Gt(ms(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)));n.push({tag:p,view:g.byteLength<c.byteLength?g:c,rawView:c})});const i=n.length,o=n.reduce((c,p)=>c+r(p.view.byteLength),0),a=new Ar(new ArrayBuffer(44+20*i+o+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=i,a.totalSfntSize=12+16*i+n.reduce((c,p)=>c+r(p.rawView.byteLength),0);let h=44+i*20,l=0;const u=a.getDirectories();return n.forEach(c=>{const p=u[l++];p.tag=c.tag,p.offset=h,p.compLength=c.view.byteLength,p.origChecksum=Ar.checkSum(c.rawView),p.origLength=c.rawView.byteLength,a.view.writeBytes(c.view,h),h+=r(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new qt(this.view.buffer,t);return t+=e.view.byteLength,e})}createSfnt(){return new he(this.getDirectories().reduce((t,e)=>{const r=e.tag,n=this.view.byteOffset+e.offset,i=e.compLength,o=e.origLength,a=n+i;return t[r]=i>=o?new DataView(this.view.buffer,n,i):new DataView(ws(new Uint8Array(this.view.buffer.slice(n,a))).buffer),t},{}))}};ke(gt,"signature",new Set([2001684038])),vt([m("uint32")],gt.prototype,"signature"),vt([m("uint32")],gt.prototype,"flavor"),vt([m("uint32")],gt.prototype,"length"),vt([m("uint16")],gt.prototype,"numTables"),vt([m("uint16")],gt.prototype,"reserved"),vt([m("uint32")],gt.prototype,"totalSfntSize"),vt([m("uint16")],gt.prototype,"majorVersion"),vt([m("uint16")],gt.prototype,"minorVersion"),vt([m("uint32")],gt.prototype,"metaOffset"),vt([m("uint32")],gt.prototype,"metaLength"),vt([m("uint32")],gt.prototype,"metaOrigLength"),vt([m("uint32")],gt.prototype,"privOffset"),vt([m("uint32")],gt.prototype,"privLength");let Ut=gt;function gn(s){if(st.is(s))return new st(s);if(je.is(s))return new je(s);if(Ut.is(s))return new Ut(s)}var ro=Object.defineProperty,no=(s,t,e)=>t in s?ro(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t,e)=>(no(s,typeof t!="symbol"?t+"":t,e),e);const yn=class rs{constructor(){we(this,"fallbackFont"),we(this,"_loading",new Map),we(this,"_loaded",new Map),we(this,"_namesUrls",new Map)}_createRequest(t,e){const r=new AbortController;return{url:t,when:fetch(t,{...rs.defaultRequestInit,...e,signal:r.signal}).then(n=>n.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}get(t){let e;if(t){const r=this._namesUrls.get(t)??t;e=this._loaded.get(r)}return e??this.fallbackFont}set(t,e){return this._namesUrls.set(t,e.url),this._loaded.set(e.url,e),this}delete(t){const e=this._namesUrls.get(t)??t;return this._namesUrls.delete(t),this._loaded.delete(e),this}clear(){return this._namesUrls.clear(),this._loaded.clear(),this}async waitUntilLoad(){await Promise.all(Array.from(this._loading.values()).map(t=>t.when))}async load(t,e={}){const{cancelOther:r,injectFontFace:n=!0,injectStyleTag:i=!0,...o}=e,{family:a,url:h}=t;if(this._loaded.has(h))return r&&(this._loading.forEach(u=>u.cancel()),this._loading.clear()),this._loaded.get(h);let l=this._loading.get(h);return l||(l=this._createRequest(h,o),this._loading.set(h,l)),r&&this._loading.forEach((u,c)=>{u!==l&&(u.cancel(),this._loading.delete(c))}),l.when.then(u=>{const c={...t,font:gn(u)??u};return this._loaded.has(h)||(this._loaded.set(h,c),new Set(Array.isArray(a)?a:[a]).forEach(p=>{this._namesUrls.set(p,h),typeof document<"u"&&(n&&this.injectFontFace(p,u),i&&this.injectStyleTag(p,h))})),c}).catch(u=>{if(u instanceof DOMException&&u.message==="The user aborted a request.")return{...t,font:new ArrayBuffer(0)};throw u}).finally(()=>{this._loading.delete(h)})}};we(yn,"defaultRequestInit",{cache:"force-cache"});let mn=yn;const wn=new mn;function vn(s,t){const{cmap:e,loca:r,hmtx:n,vmtx:i,glyf:o}=s,a=e.unicodeToGlyphIndexMap,h=r.locations,l=n.metrics,u=i==null?void 0:i.metrics,c=Array.from(new Set(t.split("").map(w=>w.codePointAt(0)).filter(w=>w!==void 0&&a.has(w)))).sort((w,d)=>w-d),p=new Map;c.forEach(w=>{const d=a.get(w)??0;let P=p.get(d);P||p.set(d,P=new Set),P.add(w)});const g=[],y=w=>{const d=l[w],P=(u==null?void 0:u[w])??{advanceHeight:0,topSideBearing:0},C=h[w],x=h[w+1]??C,T={...d,...P,rawGlyphIndex:w,glyphIndex:g.length,unicodes:Array.from(p.get(w)??[]),view:new DataView(o.view.buffer,o.view.byteOffset+C,x-C)};return g.push(T),T};return y(0),c.forEach(w=>y(a.get(w))),g.slice().forEach(w=>{const{view:d}=w;if(!d.byteLength||d.getInt16(0)>=0)return;let C=10,x;do{x=d.getUint16(C);const T=C+2,v=d.getUint16(T);C+=4,Kt.ARG_1_AND_2_ARE_WORDS&x?C+=4:C+=2,Kt.WE_HAVE_A_SCALE&x?C+=2:Kt.WE_HAVE_AN_X_AND_Y_SCALE&x?C+=4:Kt.WE_HAVE_A_TWO_BY_TWO&x&&(C+=8);const b=y(v);d.setUint16(T,b.glyphIndex)}while(Kt.MORE_COMPONENTS&x)}),g}function bn(s,t){const e=vn(s,t),r=e.length,{head:n,maxp:i,hhea:o,vhea:a}=s;n.checkSumAdjustment=0,n.magickNumber=1594834165,n.indexToLocFormat=1,i.numGlyphs=r;let h=0;s.loca=f.Loca.from([...e.map(p=>{const g=h;return h+=p.view.byteLength,g}),h],n.indexToLocFormat);const l=e.reduce((p,g,y)=>(g.unicodes.forEach(w=>p.set(w,y)),p),new Map);s.cmap=f.Cmap.from(l),s.glyf=f.Glyf.from(e.map(p=>p.view)),o.numOfLongHorMetrics=r,s.hmtx=f.Hmtx.from(e.map(p=>({advanceWidth:p.advanceWidth,leftSideBearing:p.leftSideBearing}))),a&&(a.numOfLongVerMetrics=r),s.vmtx&&(s.vmtx=f.Vmtx.from(e.map(p=>({advanceHeight:p.advanceHeight,topSideBearing:p.topSideBearing}))));const c=new f.Post;return c.format=3,c.italicAngle=0,c.underlinePosition=0,c.underlineThickness=0,c.isFixedPitch=0,c.minMemType42=0,c.minMemType42=0,c.minMemType1=0,c.maxMemType1=r,s.post=c,s.delete("GPOS"),s.delete("GSUB"),s.delete("hdmx"),s}function so(s,t){let e,r;if(s instanceof st)e=s.sfnt.clone(),r="ttf";else if(s instanceof Ut)e=s.sfnt.clone(),r="woff";else{const i=Gt(s);if(st.is(i))e=new st(i).sfnt,r="ttf-buffer";else if(Ut.is(i))e=new Ut(i).sfnt,r="woff-buffer";else throw new Error("Failed to minify, only support ttf、woff source")}const n=bn(e,t);switch(r){case"ttf":return st.from(n);case"woff":return Ut.from(n);case"ttf-buffer":return st.from(n).view.buffer;case"woff-buffer":default:return Ut.from(n).view.buffer}}const io={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function gr(s,t){const{fill:e="#000",stroke:r="none",strokeWidth:n=r==="none"?0:1,strokeLinecap:i="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:h=[],strokeDashoffset:l=0,shadowOffsetX:u=0,shadowOffsetY:c=0,shadowBlur:p=0,shadowColor:g="rgba(0, 0, 0, 0)"}=t;s.fillStyle=e,s.strokeStyle=r,s.lineWidth=n,s.lineCap=i,s.lineJoin=io[o],s.miterLimit=a,s.setLineDash(h),s.lineDashOffset=l,s.shadowOffsetX=u,s.shadowOffsetY=c,s.shadowBlur=p,s.shadowColor=g}class M{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new M(1/0,1/0)}static get MIN(){return new M(-1/0,-1/0)}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,n=this.x-e.x,i=-(this.y-e.y),o=Math.sin(r),a=Math.cos(r);return this.set(e.x+(n*a-i*o),e.y-(n*o+i*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 n=t<0?r.x-this.x+r.x:this.x,i=e<0?r.y-this.y+r.y:this.y;return this.x=n*Math.abs(t),this.y=i*Math.abs(e),this}skew(t,e=0,r={x:0,y:0}){const n=this.x-r.x,i=this.y-r.y;return this.x=r.x+(n+Math.tan(t)*i),this.y=r.y+(i+Math.tan(e)*n),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,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6],this.y=n[1]*e+n[4]*r+n[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new M(this.x,this.y)}}class Q{constructor(t=0,e=0,r=0,n=0){this.left=t,this.top=e,this.width=r,this.height=n}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}static from(...t){if(t.length===0)return new Q;if(t.length===1)return t[0].clone();const e=t[0],r=t.slice(1).reduce((n,i)=>(n.left=Math.min(n.left,i.left),n.top=Math.min(n.top,i.top),n.right=Math.max(n.right,i.right),n.bottom=Math.max(n.bottom,i.bottom),n),{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0});return new Q(r.left,r.top,r.right-r.left,r.bottom-r.top)}translate(t,e){return this.left+=t,this.top+=e,this}getCenterPoint(){return new M((this.left+this.right)/2,(this.top+this.bottom)/2)}clone(){return new Q(this.left,this.top,this.width,this.height)}toArray(){return[this.left,this.top,this.width,this.height]}}var oo=Object.defineProperty,ao=(s,t,e)=>t in s?oo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,lo=(s,t,e)=>(ao(s,t+"",e),e);class yt{constructor(t=1,e=0,r=0,n=0,i=1,o=0,a=0,h=0,l=1){lo(this,"elements",[]),this.set(t,e,r,n,i,o,a,h,l)}set(t,e,r,n,i,o,a,h,l){const u=this.elements;return u[0]=t,u[1]=n,u[2]=a,u[3]=e,u[4]=i,u[5]=h,u[6]=r,u[7]=o,u[8]=l,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,n=e.elements,i=this.elements,o=r[0],a=r[3],h=r[6],l=r[1],u=r[4],c=r[7],p=r[2],g=r[5],y=r[8],w=n[0],d=n[3],P=n[6],C=n[1],x=n[4],T=n[7],v=n[2],b=n[5],A=n[8];return i[0]=o*w+a*C+h*v,i[3]=o*d+a*x+h*b,i[6]=o*P+a*T+h*A,i[1]=l*w+u*C+c*v,i[4]=l*d+u*x+c*b,i[7]=l*P+u*T+c*A,i[2]=p*w+g*C+y*v,i[5]=p*d+g*x+y*b,i[8]=p*P+g*T+y*A,this}invert(){const t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=u*o-a*l,p=a*h-u*i,g=l*i-o*h,y=e*c+r*p+n*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/y;return t[0]=c*w,t[1]=(n*l-u*r)*w,t[2]=(a*r-n*o)*w,t[3]=p*w,t[4]=(u*e-n*h)*w,t[5]=(n*i-a*e)*w,t[6]=g*w,t[7]=(r*h-l*e)*w,t[8]=(o*e-r*i)*w,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(yr.makeScale(t,e)),this}rotate(t){return this.premultiply(yr.makeRotation(-t)),this}translate(t,e){return this.premultiply(yr.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 yr=new yt;function Mn(s,t,e,r){const n=s*e+t*r,i=Math.sqrt(s*s+t*t)*Math.sqrt(e*e+r*r);let o=Math.acos(Math.max(-1,Math.min(1,n/i)));return s*r-t*e<0&&(o=-o),o}function xn(s,t,e,r,n,i,o,a){if(t===0||e===0){s.lineTo(a.x,a.y);return}r=r*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const h=(o.x-a.x)/2,l=(o.y-a.y)/2,u=Math.cos(r)*h+Math.sin(r)*l,c=-Math.sin(r)*h+Math.cos(r)*l;let p=t*t,g=e*e;const y=u*u,w=c*c,d=y/p+w/g;if(d>1){const k=Math.sqrt(d);t=k*t,e=k*e,p=t*t,g=e*e}const P=p*w+g*y,C=(p*g-P)/P;let x=Math.sqrt(Math.max(0,C));n===i&&(x=-x);const T=x*t*c/e,v=-x*e*u/t,b=Math.cos(r)*T-Math.sin(r)*v+(o.x+a.x)/2,A=Math.sin(r)*T+Math.cos(r)*v+(o.y+a.y)/2,S=Mn(1,0,(u-T)/t,(c-v)/e),_=Mn((u-T)/t,(c-v)/e,(-u-T)/t,(-c-v)/e)%(Math.PI*2);s.ellipse(b,A,t,e,r,S,S+_,i===1)}function Jt(s,t){return s-(t-s)}function mr(s,t){const e=new M,r=new M;for(let n=0,i=s.length;n<i;n++){const o=s[n];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(Jt(e.x,r.x),Jt(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(Jt(e.x,r.x),Jt(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=Jt(e.x,r.x),h=Jt(e.y,r.y);r.x=a,r.y=h,o.type==="t"?(t.quadraticCurveTo(a,h,e.x+o.x,e.y+o.y),e.add(o)):(t.quadraticCurveTo(a,h,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),xn(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)}}const Z={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Pt(s,t,e=0){let a=0,h=!0,l="",u="";const c=[];function p(d,P,C){const x=new SyntaxError(`Unexpected character "${d}" at index ${P}.`);throw x.partial=C,x}function g(){l!==""&&(u===""?c.push(Number(l)):c.push(Number(l)*10**Number(u))),l="",u=""}let y;const w=s.length;for(let d=0;d<w;d++){if(y=s[d],Array.isArray(t)&&t.includes(c.length%e)&&Z.FLAGS.test(y)){a=1,l=y,g();continue}if(a===0){if(Z.WHITESPACE.test(y))continue;if(Z.DIGIT.test(y)||Z.SIGN.test(y)){a=1,l=y;continue}if(Z.POINT.test(y)){a=2,l=y;continue}Z.COMMA.test(y)&&(h&&p(y,d,c),h=!0)}if(a===1){if(Z.DIGIT.test(y)){l+=y;continue}if(Z.POINT.test(y)){l+=y,a=2;continue}if(Z.EXP.test(y)){a=3;continue}Z.SIGN.test(y)&&l.length===1&&Z.SIGN.test(l[0])&&p(y,d,c)}if(a===2){if(Z.DIGIT.test(y)){l+=y;continue}if(Z.EXP.test(y)){a=3;continue}Z.POINT.test(y)&&l[l.length-1]==="."&&p(y,d,c)}if(a===3){if(Z.DIGIT.test(y)){u+=y;continue}if(Z.SIGN.test(y)){if(u===""){u+=y;continue}u.length===1&&Z.SIGN.test(u)&&p(y,d,c)}}Z.WHITESPACE.test(y)?(g(),a=0,h=!1):Z.COMMA.test(y)?(g(),a=0,h=!0):Z.SIGN.test(y)?(g(),a=1,l=y):Z.POINT.test(y)?(g(),a=2,l=y):p(y,d,c)}return g(),c}function ho(s){switch(s.type){case"m":case"M":return`${s.type} ${s.x} ${s.y}`;case"h":case"H":return`${s.type} ${s.x}`;case"v":case"V":return`${s.type} ${s.y}`;case"l":case"L":return`${s.type} ${s.x} ${s.y}`;case"c":case"C":return`${s.type} ${s.x1} ${s.y1} ${s.x2} ${s.y2} ${s.x} ${s.y}`;case"s":case"S":return`${s.type} ${s.x2} ${s.y2} ${s.x} ${s.y}`;case"q":case"Q":return`${s.type} ${s.x1} ${s.y1} ${s.x} ${s.y}`;case"t":case"T":return`${s.type} ${s.x} ${s.y}`;case"a":case"A":return`${s.type} ${s.rx} ${s.ry} ${s.angle} ${s.largeArcFlag} ${s.sweepFlag} ${s.x} ${s.y}`;case"z":case"Z":return s.type;default:return""}}function Cn(s){let t="";for(let e=0,r=s.length;e<r;e++)t+=`${ho(s[e])} `;return t}const co=/[a-df-z][^a-df-z]*/gi;function wr(s){const t=[],e=s.match(co);if(!e)return t;for(let r=0,n=e.length;r<n;r++){const i=e[r],o=i.charAt(0),a=i.slice(1).trim();let h;switch(o){case"m":case"M":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)l===0?t.push({type:o,x:h[l],y:h[l+1]}):t.push({type:o==="m"?"l":"L",x:h[l],y:h[l+1]});break;case"h":case"H":h=Pt(a);for(let l=0,u=h.length;l<u;l++)t.push({type:o,x:h[l]});break;case"v":case"V":h=Pt(a);for(let l=0,u=h.length;l<u;l++)t.push({type:o,y:h[l]});break;case"l":case"L":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)t.push({type:o,x:h[l],y:h[l+1]});break;case"c":case"C":h=Pt(a);for(let l=0,u=h.length;l<u;l+=6)t.push({type:o,x1:h[l],y1:h[l+1],x2:h[l+2],y2:h[l+3],x:h[l+4],y:h[l+5]});break;case"s":case"S":h=Pt(a);for(let l=0,u=h.length;l<u;l+=4)t.push({type:o,x2:h[l],y2:h[l+1],x:h[l+2],y:h[l+3]});break;case"q":case"Q":h=Pt(a);for(let l=0,u=h.length;l<u;l+=4)t.push({type:o,x1:h[l],y1:h[l+1],x:h[l+2],y:h[l+3]});break;case"t":case"T":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)t.push({type:o,x:h[l],y:h[l+1]});break;case"a":case"A":h=Pt(a,[3,4],7);for(let l=0,u=h.length;l<u;l+=7)t.push({type:o,rx:h[l],ry:h[l+1],angle:h[l+2],largeArcFlag:h[l+3],sweepFlag:h[l+4],x:h[l+5],y:h[l+6]});break;case"z":case"Z":t.push({type:o});break;default:console.warn(i)}}return t}var uo=Object.defineProperty,fo=(s,t,e)=>t in s?uo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,vr=(s,t,e)=>(fo(s,typeof t!="symbol"?t+"":t,e),e);class _t{constructor(){vr(this,"arcLengthDivisions",200),vr(this,"_cacheArcLengths"),vr(this,"_needsUpdate",!1)}isClockwise(){const t=this.getPoint(1),e=this.getPoint(.5),r=this.getPoint(1);return(e.x-t.x)*(r.y-e.y)-(e.y-t.y)*(r.x-e.x)<0}getPointAt(t,e=new M){return this.getPoint(this.getUToTMapping(t),e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}forEachControlPoints(t){return this.getControlPoints().forEach(t),this}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this._cacheArcLengths&&this._cacheArcLengths.length===t+1&&!this._needsUpdate)return this._cacheArcLengths;this._needsUpdate=!1;const e=[];let r,n=this.getPoint(0),i=0;e.push(0);for(let o=1;o<=t;o++)r=this.getPoint(o/t),i+=r.distanceTo(n),e.push(i),n=r;return this._cacheArcLengths=e,e}updateArcLengths(){this._needsUpdate=!0,this.getLengths()}getUToTMapping(t,e){const r=this.getLengths();let n=0;const i=r.length;let o;e?o=e:o=t*r[i-1];let a=0,h=i-1,l;for(;a<=h;)if(n=Math.floor(a+(h-a)/2),l=r[n]-o,l<0)a=n+1;else if(l>0)h=n-1;else{h=n;break}if(n=h,r[n]===o)return n/(i-1);const u=r[n],p=r[n+1]-u,g=(o-u)/p;return(n+g)/(i-1)}getTangent(t,e=new M){const n=Math.max(0,t-1e-4),i=Math.min(1,t+1e-4);return e.copy(this.getPoint(i).sub(this.getPoint(n)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new M){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,n=1,i=(r+n)/2;for(;n-r>e;){i=(r+n)/2;const o=this.getPoint(i);if(o.distanceTo(t)<e)return i;o.x<t.x?r=i:n=i}return i}matrix(t){return this.forEachControlPoints(e=>e.applyMatrix3(t)),this}getMinMax(t=M.MAX,e=M.MIN){return this.getPoints().forEach(r=>{t.x=Math.min(t.x,r.x),t.y=Math.min(t.y,r.y),e.x=Math.max(e.x,r.x),e.y=Math.max(e.y,r.y)}),{min:t,max:e}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new Q(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.getPoints().map((t,e)=>e===0?{type:"M",x:t.x,y:t.y}:{type:"L",x:t.x,y:t.y})}toData(){return Cn(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.arcLengthDivisions=t.arcLengthDivisions,this}clone(){return new this.constructor().copy(this)}}class Be extends _t{constructor(t,e,r=0,n=Math.PI*2){super(),this.center=t,this.radius=e,this.start=r,this.end=n}getPoint(t){const{radius:e,center:r}=this;return r.clone().add(this.getNormal(t).clone().scale(e))}getTangent(t,e=new M){const{x:r,y:n}=this.getNormal(t);return e.set(-n,r)}getNormal(t,e=new M){const{start:r,end:n}=this,i=t*(n-r)+r-.5*Math.PI;return e.set(Math.cos(i),Math.sin(i))}getControlPoints(){return[this.center]}getMinMax(t=M.MAX,e=M.MIN){return t.x=Math.min(t.x,this.center.x-this.radius),t.y=Math.min(t.y,this.center.y-this.radius),e.x=Math.max(e.x,this.center.x+this.radius),e.y=Math.max(e.y,this.center.y+this.radius),{min:t,max:e}}}function Sn(s,t,e,r,n){const i=(r-t)*.5,o=(n-e)*.5,a=s*s,h=s*a;return(2*e-2*r+i+o)*h+(-3*e+3*r-2*i-o)*a+i*s+e}function po(s,t){const e=1-s;return e*e*t}function go(s,t){return 2*(1-s)*s*t}function yo(s,t){return s*s*t}function Pn(s,t,e,r){return po(s,t)+go(s,e)+yo(s,r)}function mo(s,t){const e=1-s;return e*e*e*t}function wo(s,t){const e=1-s;return 3*e*e*s*t}function vo(s,t){return 3*(1-s)*s*s*t}function bo(s,t){return s*s*s*t}function _n(s,t,e,r,n){return mo(s,t)+wo(s,e)+vo(s,r)+bo(s,n)}class Tn extends _t{constructor(t=new M,e=new M,r=new M,n=new M){super(),this.start=t,this.startControl=e,this.endControl=r,this.end=n}getPoint(t,e=new M){const{start:r,startControl:n,endControl:i,end:o}=this;return e.set(_n(t,r.x,n.x,i.x,o.x),_n(t,r.y,n.y,i.y,o.y))}getControlPoints(){return[this.start,this.startControl,this.endControl,this.end]}_solveQuadratic(t,e,r){const n=e*e-4*t*r;if(n<0)return[];const i=Math.sqrt(n),o=(-e+i)/(2*t),a=(-e-i)/(2*t);return[o,a].filter(h=>h>=0&&h<=1)}getMinMax(t=M.MAX,e=M.MIN){const r=this.start,n=this.startControl,i=this.endControl,o=this.end,a=this._solveQuadratic(3*(n.x-r.x),6*(i.x-n.x),3*(o.x-i.x)),h=this._solveQuadratic(3*(n.y-r.y),6*(i.y-n.y),3*(o.y-i.y)),l=[0,1,...a,...h];return((c,p)=>{for(const g of c)for(let y=0;y<=p;y++){const w=y/p-.5,d=Math.min(1,Math.max(0,g+w)),P=this.getPoint(d);t.x=Math.min(t.x,P.x),t.y=Math.min(t.y,P.y),e.x=Math.max(e.x,P.x),e.y=Math.max(e.y,P.y)}})(l,10),{min:t,max:e}}toCommands(){const{start:t,startControl:e,endControl:r,end:n}=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:n.x,y:n.y}]}drawTo(t){const{start:e,startControl:r,endControl:n,end:i}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(r.x,r.y,n.x,n.y,i.x,i.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.startControl.copy(t.startControl),this.endControl.copy(t.endControl),this.end.copy(t.end),this}}const Mo=new yt,On=new yt,In=new yt,Fe=new M;class An extends _t{constructor(t=new M,e=1,r=1,n=0,i=0,o=Math.PI*2,a=!1){super(),this.center=t,this.radiusX=e,this.radiusY=r,this.rotation=n,this.startAngle=i,this.endAngle=o,this.clockwise=a}isClockwise(){return this.clockwise}getPoint(t,e=new M){const r=Math.PI*2;let n=this.endAngle-this.startAngle;const i=Math.abs(n)<Number.EPSILON;for(;n<0;)n+=r;for(;n>r;)n-=r;n<Number.EPSILON&&(i?n=0:n=r),this.clockwise&&!i&&(n===r?n=-r:n=n-r);const o=this.startAngle+t*n;let a=this.center.x+this.radiusX*Math.cos(o),h=this.center.y+this.radiusY*Math.sin(o);if(this.rotation!==0){const l=Math.cos(this.rotation),u=Math.sin(this.rotation),c=a-this.center.x,p=h-this.center.y;a=c*l-p*u+this.center.x,h=c*u+p*l+this.center.y}return e.set(a,h)}toCommands(){const{center:t,radiusX:e,radiusY:r,startAngle:n,endAngle:i,clockwise:o,rotation:a}=this,{x:h,y:l}=t,u=h+e*Math.cos(n)*Math.cos(a)-r*Math.sin(n)*Math.sin(a),c=l+e*Math.cos(n)*Math.sin(a)+r*Math.sin(n)*Math.cos(a),p=Math.abs(n-i),g=p>Math.PI?1:0,y=o?1:0,w=a*180/Math.PI;if(p>=2*Math.PI){const d=n+Math.PI,P=h+e*Math.cos(d)*Math.cos(a)-r*Math.sin(d)*Math.sin(a),C=l+e*Math.cos(d)*Math.sin(a)+r*Math.sin(d)*Math.cos(a);return[{type:"M",x:u,y:c},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:0,sweepFlag:y,x:P,y:C},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:0,sweepFlag:y,x:u,y:c}]}else{const d=h+e*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a),P=l+e*Math.cos(i)*Math.sin(a)+r*Math.sin(i)*Math.cos(a);return[{type:"M",x:u,y:c},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:g,sweepFlag:y,x:d,y:P}]}}drawTo(t){const{center:e,radiusX:r,radiusY:n,rotation:i,startAngle:o,endAngle:a,clockwise:h}=this;return t.ellipse(e.x,e.y,r,n,i,o,a,!h),this}matrix(t){return Fe.set(this.center.x,this.center.y),Fe.applyMatrix3(t),this.center.x=Fe.x,this.center.y=Fe.y,So(t)?xo(this,t):Co(this,t),this}getControlPoints(){return[this.center]}getMinMax(t=M.MAX,e=M.MIN){const{center:r,radiusX:n,radiusY:i,rotation:o}=this,{x:a,y:h}=r,l=Math.cos(o),u=Math.sin(o),c=Math.sqrt(n*n*l*l+i*i*u*u),p=Math.sqrt(n*n*u*u+i*i*l*l);return t.x=Math.min(t.x,a-c),t.y=Math.min(t.y,h-p),e.x=Math.max(e.x,a+c),e.y=Math.max(e.y,h+p),{min:t,max:e}}copy(t){return super.copy(t),this.center.x=t.center.x,this.center.y=t.center.y,this.radiusX=t.radiusX,this.radiusY=t.radiusY,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotation=t.rotation,this}}function xo(s,t){const e=s.radiusX,r=s.radiusY,n=Math.cos(s.rotation),i=Math.sin(s.rotation),o=new M(e*n,e*i),a=new M(-r*i,r*n),h=o.applyMatrix3(t),l=a.applyMatrix3(t),u=Mo.set(h.x,l.x,0,h.y,l.y,0,0,0,1),c=On.copy(u).invert(),y=In.copy(c).transpose().multiply(c).elements,w=Po(y[0],y[1],y[4]),d=Math.sqrt(w.rt1),P=Math.sqrt(w.rt2);if(s.radiusX=1/d,s.radiusY=1/P,s.rotation=Math.atan2(w.sn,w.cs),!((s.endAngle-s.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=On.set(d,0,0,0,P,0,0,0,1),T=In.set(w.cs,w.sn,0,-w.sn,w.cs,0,0,0,1),v=x.multiply(T).multiply(u),b=A=>{const{x:S,y:_}=new M(Math.cos(A),Math.sin(A)).applyMatrix3(v);return Math.atan2(_,S)};s.startAngle=b(s.startAngle),s.endAngle=b(s.endAngle),Dn(t)&&(s.clockwise=!s.clockwise)}}function Co(s,t){const e=Nn(t),r=zn(t);s.radiusX*=e,s.radiusY*=r;const n=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);s.rotation+=n,Dn(t)&&(s.startAngle*=-1,s.endAngle*=-1,s.clockwise=!s.clockwise)}function Dn(s){const t=s.elements;return t[0]*t[4]-t[1]*t[3]<0}function So(s){const t=s.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const r=Nn(s),n=zn(s);return Math.abs(e/(r*n))>Number.EPSILON}function Nn(s){const t=s.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zn(s){const t=s.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function Po(s,t,e){let r,n,i,o,a;const h=s+e,l=s-e,u=Math.sqrt(l*l+4*t*t);return h>0?(r=.5*(h+u),a=1/r,n=s*a*e-t*a*t):h<0?n=.5*(h-u):(r=.5*u,n=-.5*u),l>0?i=l+u:i=l-u,Math.abs(i)>2*Math.abs(t)?(a=-2*t/i,o=1/Math.sqrt(1+a*a),i=a*o):Math.abs(t)===0?(i=1,o=0):(a=-.5*i/t,i=1/Math.sqrt(1+a*a),o=a*i),l>0&&(a=i,i=-o,o=a),{rt1:r,rt2:n,cs:i,sn:o}}class Ht extends _t{constructor(t=new M,e=new M){super(),this.start=t,this.end=e}getPoint(t,e=new M){return t===1?e.copy(this.end):e.copy(this.end).sub(this.start).scale(t).add(this.start),e}getPointAt(t,e=new M){return this.getPoint(t,e)}getTangent(t,e=new M){return e.subVectors(this.end,this.start).normalize()}getTangentAt(t,e=new M){return this.getTangent(t,e)}getControlPoints(){return[this.start,this.end]}getMinMax(t=M.MAX,e=M.MIN){const{start:r,end:n}=this;return t.x=Math.min(t.x,r.x,n.x),t.y=Math.min(t.y,r.y,n.y),e.x=Math.max(e.x,r.x,n.x),e.y=Math.max(e.y,r.y,n.y),{min:t,max:e}}toCommands(){const{start:t,end:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}drawTo(t){const{start:e,end:r}=this;return t.lineTo(e.x,e.y),t.lineTo(r.x,r.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.end.copy(t.end),this}}var _o=Object.defineProperty,To=(s,t,e)=>t in s?_o(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Oo=(s,t,e)=>(To(s,t+"",e),e);class Io extends _t{constructor(t,e,r=0,n=1){super(),this.center=t,this.size=e,this.start=r,this.end=n,Oo(this,"curveT",0),this.update()}update(){const{x:t,y:e}=this.center,r=new M(t+.5*this.size,e-.5*this.size),n=new M(t-.5*this.size,e-.5*this.size),i=new M(t,e+.5*this.size),o=new Be(r,Math.SQRT1_2*this.size,-.25*Math.PI,.75*Math.PI),a=new Be(n,Math.SQRT1_2*this.size,-.75*Math.PI,.25*Math.PI),h=new Be(i,.5*Math.SQRT1_2*this.size,.75*Math.PI,1.25*Math.PI),l=new M(t,e+this.size),u=new M(t+this.size,e),c=new M().lerpVectors(u,l,.75),p=new M(t-this.size,e),g=new M().lerpVectors(p,l,.75),y=new Ht(u,c),w=new Ht(g,p);return this.curves=[o,y,h,w,a],this}getPoint(t){return this.getCurve(t).getPoint(this.curveT)}getPointAt(t){return this.getPoint(t)}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1),e*=9*Math.PI/8+1.5;let r;const n=.5*Math.PI;return e<n?(r=0,this.curveT=e/n):e<n+.75?(r=1,this.curveT=(e-n)/.75):e<5*Math.PI/8+.75?(r=2,this.curveT=(e-n-.75)/(Math.PI/8)):e<5*Math.PI/8+1.5?(r=3,this.curveT=(e-5*Math.PI/8-.75)/.75):(r=4,this.curveT=(e-5*Math.PI/8-1.5)/n),this.curves[r]}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}var Ao=Object.defineProperty,Do=(s,t,e)=>t in s?Ao(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,br=(s,t,e)=>(Do(s,typeof t!="symbol"?t+"":t,e),e);class No extends _t{constructor(t,e=0,r=0,n=0,i=1){super(),this.center=t,this.radius=e,this.number=r,this.start=n,this.end=i,br(this,"curves",[]),br(this,"curveT",0),br(this,"points",[]),this.update()}update(){for(let t=0;t<this.number;t++){let e=t*2*Math.PI/this.number;e-=.5*Math.PI,this.points.push(new M(this.radius*Math.cos(e),this.radius*Math.sin(e)).add(this.center))}for(let t=0;t<this.number;t++)this.curves.push(new Ht(this.points[t],this.points[(t+1)%this.number]));return this}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1);const r=e*this.number,n=Math.floor(r);return this.curveT=r-n,this.curves[n]}getPoint(t,e){return this.getCurve(t).getPoint(this.curveT,e)}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}class En extends _t{constructor(t=new M,e=new M,r=new M){super(),this.start=t,this.control=e,this.end=r}getPoint(t,e=new M){const{start:r,control:n,end:i}=this;return e.set(Pn(t,r.x,n.x,i.x),Pn(t,r.y,n.y,i.y)),e}getControlPoints(){return[this.start,this.control,this.end]}getMinMax(t=M.MAX,e=M.MIN){const{start:r,control:n,end:i}=this,o=.5*(r.x+n.x),a=.5*(r.y+n.y),h=.5*(r.x+i.x),l=.5*(r.y+i.y);return t.x=Math.min(t.x,r.x,i.x,o,h),t.y=Math.min(t.y,r.y,i.y,a,l),e.x=Math.max(e.x,r.x,i.x,o,h),e.y=Math.max(e.y,r.y,i.y,a,l),{min:t,max:e}}toCommands(){const{start:t,control:e,end: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{start:e,control:r,end:n}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,n.x,n.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.control.copy(t.control),this.end.copy(t.end),this}}var zo=Object.defineProperty,Eo=(s,t,e)=>t in s?zo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Un=(s,t,e)=>(Eo(s,typeof t!="symbol"?t+"":t,e),e);class Ln extends _t{constructor(t,e,r=1,n=0,i=1){super(),this.center=t,this.rx=e,this.aspectRatio=r,this.start=n,this.end=i,Un(this,"curves",[]),Un(this,"curveT",0),this.update()}get x(){return this.center.x-this.rx}get y(){return this.center.y-this.rx/this.aspectRatio}get width(){return this.rx*2}get height(){return this.rx/this.aspectRatio*2}update(){const{x:t,y:e}=this.center,r=this.rx,n=this.rx/this.aspectRatio,i=[new M(t-r,e-n),new M(t+r,e-n),new M(t+r,e+n),new M(t-r,e+n)];for(let o=0;o<4;o++)this.curves.push(new Ht(i[o].clone(),i[(o+1)%4].clone()));return this}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1),e*=(1+this.aspectRatio)*2;let r;return e<this.aspectRatio?(r=0,this.curveT=e/this.aspectRatio):e<this.aspectRatio+1?(r=1,this.curveT=(e-this.aspectRatio)/1):e<2*this.aspectRatio+1?(r=2,this.curveT=(e-this.aspectRatio-1)/this.aspectRatio):(r=3,this.curveT=(e-2*this.aspectRatio-1)/1),this.curves[r]}getPoint(t,e){return this.getCurve(t).getPoint(this.curveT,e)}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}class $n extends _t{constructor(t=[]){super(),this.points=t}getPoint(t,e=new M){const{points:r}=this,n=(r.length-1)*t,i=Math.floor(n),o=n-i,a=r[i===0?i:i-1],h=r[i],l=r[i>r.length-2?r.length-1:i+1],u=r[i>r.length-3?r.length-1:i+2];return e.set(Sn(o,a.x,h.x,l.x,u.x),Sn(o,a.y,h.y,l.y,u.y)),e}getControlPoints(){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}}var Uo=Object.defineProperty,Lo=(s,t,e)=>t in s?Uo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ve=(s,t,e)=>(Lo(s,typeof t!="symbol"?t+"":t,e),e);class te extends _t{constructor(t){super(),ve(this,"curves",[]),ve(this,"startPoint"),ve(this,"currentPoint",new M),ve(this,"autoClose",!1),ve(this,"_cacheLengths",[]),t&&this.addPoints(t)}addCurve(t){return this.curves.push(t),this}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++){const{x:n,y:i}=t[e];this.lineTo(n,i)}return this}addCommands(t){return mr(t,this),this}addData(t){return this.addCommands(wr(t)),this}getPoint(t,e=new M){const r=t*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=r){const o=n[i]-r,a=this.curves[i],h=a.getLength();return a.getPointAt(h===0?0:1-o/h,e)}i++}return e}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){super.updateArcLengths(),this._cacheLengths=[],this.getCurveLengths()}getCurveLengths(){if(this._cacheLengths.length===this.curves.length)return this._cacheLengths;const t=[];let e=0;for(let r=0,n=this.curves.length;r<n;r++)e+=this.curves[r].getLength(),t.push(e);return this._cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[],r=this.curves;let n;for(let i=0,o=r.length;i<o;i++){const h=r[i].getPoints(t);for(let l=0;l<h.length;l++){const u=h[l];n!=null&&n.equals(u)||(e.push(u),n=u)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}_setCurrentPoint(t){return this.currentPoint.copy(t),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;t.equals(e)||(this.curves.push(new Ht(e.clone(),t)),this.currentPoint.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint.set(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){return this.currentPoint.equals({x:t,y:e})||this.curves.push(new Ht(this.currentPoint.clone(),new M(t,e))),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,r,n,i,o){return this.currentPoint.equals({x:i,y:o})||this.curves.push(new Tn(this.currentPoint.clone(),new M(t,e),new M(r,n),new M(i,o))),this._setCurrentPoint({x:i,y:o}),this}quadraticCurveTo(t,e,r,n){return this.currentPoint.equals({x:r,y:n})||this.curves.push(new En(this.currentPoint.clone(),new M(t,e),new M(r,n))),this._setCurrentPoint({x:r,y:n}),this}arc(t,e,r,n,i,o){return this.ellipse(t,e,r,r,0,n,i,o),this}relativeArc(t,e,r,n,i,o){const a=this.currentPoint;return this.arc(t+a.x,e+a.y,r,n,i,o),this}arcTo(t,e,r,n,i){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,r,n,i,o,a,h=!0){const l=new An(new M(t,e),r,n,i,o,a,!h);if(this.curves.length>0){const u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}return this.curves.push(l),this._setCurrentPoint(l.getPoint(1)),this}relativeEllipse(t,e,r,n,i,o,a,h){const l=this.currentPoint;return this.ellipse(t+l.x,e+l.y,r,n,i,o,a,h),this}rect(t,e,r,n){return this.curves.push(new Ln(new M(t+r/2,e+n/2),r/2,r/n)),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){return this.curves.push(new $n([this.currentPoint.clone()].concat(t))),this._setCurrentPoint(t[t.length-1]),this}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new Q(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){var r;const e=(r=this.curves[0])==null?void 0:r.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e<r;e++)this.curves.push(t.curves[e].clone());return this.autoClose=t.autoClose,this.currentPoint.copy(t.currentPoint),this}}function $o(s){return s.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function jo(s,t,e,r){const n=t.clone().sub(s),i=r.clone().sub(e),o=e.clone().sub(s),a=n.cross(i);if(a===0)return new M((s.x+e.x)/2,(s.y+e.y)/2);const h=o.cross(i)/a;return Math.abs(h)>1?new M((s.x+e.x)/2,(s.y+e.y)/2):new M(s.x+h*n.x,s.y+h*n.y)}var ko=Object.defineProperty,Bo=(s,t,e)=>t in s?ko(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Mr=(s,t,e)=>(Bo(s,typeof t!="symbol"?t+"":t,e),e);class bt{constructor(t){Mr(this,"currentPath",new te),Mr(this,"paths",[this.currentPath]),Mr(this,"style",{}),t&&(t instanceof bt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}get startPoint(){return this.currentPath.startPoint}get currentPoint(){return this.currentPath.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}addPath(t){return t instanceof bt?this.paths.push(...t.paths.map(e=>e.clone())):this.paths.push(t),this}closePath(){const t=this.startPoint;return t&&(this.currentPath.closePath(),this.currentPath.curves.length>0&&(this.currentPath=new te().moveTo(t.x,t.y),this.paths.push(this.currentPath))),this}moveTo(t,e){const{currentPoint:r,curves:n}=this.currentPath;return r.equals({x:t,y:e})||(n.length?(this.currentPath=new te().moveTo(t,e),this.paths.push(this.currentPath)):this.currentPath.moveTo(t,e)),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}bezierCurveTo(t,e,r,n,i,o){return this.currentPath.bezierCurveTo(t,e,r,n,i,o),this}quadraticCurveTo(t,e,r,n){return this.currentPath.quadraticCurveTo(t,e,r,n),this}arc(t,e,r,n,i,o){return this.currentPath.arc(t,e,r,n,i,o),this}arcTo(t,e,r,n,i){return this.currentPath.arcTo(t,e,r,n,i),this}ellipse(t,e,r,n,i,o,a,h){return this.currentPath.ellipse(t,e,r,n,i,o,a,h),this}rect(t,e,r,n){return this.currentPath.rect(t,e,r,n),this}addCommands(t){return mr(t,this),this}addData(t){return this.addCommands(wr(t)),this}splineThru(t){return this.currentPath.splineThru(t),this}getControlPoints(){return this.paths.flatMap(t=>t.getControlPoints())}getCurves(){return this.paths.flatMap(t=>t.curves)}scale(t,e=t,r={x:0,y:0}){return this.getControlPoints().forEach(n=>{n.scale(t,e,r)}),this}skew(t,e=0,r={x:0,y:0}){return this.getControlPoints().forEach(n=>{n.skew(t,e,r)}),this}rotate(t,e={x:0,y:0}){return this.getControlPoints().forEach(r=>{r.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getCurves(),r=[],n=[],i=[];e.forEach((a,h)=>{const l=a.getControlPoints(),u=a.isClockwise();i[h]=l,n[h]=u;const c=l[0],p=l[l.length-1]??c;r.push({start:u?p:c,end:u?c:p,index:h})});const o=[];return r.forEach((a,h)=>{o[h]=[],r.forEach((l,u)=>{u!==h&&l.start.equals(a.end)&&o[h].push(l.index)})}),e.forEach((a,h)=>{const l=n[h];i[h].forEach(c=>{const p=a.getTForPoint(c),g=a.getNormal(p).scale(l?t:-t);c.add(g)})}),o.forEach((a,h)=>{const l=i[h];a.forEach(u=>{const c=i[u],p=jo(l[l.length-1],l[l.length-2]??l[l.length-1],c[0],c[1]??c[0]);p&&(l[l.length-1].copy(p),c[0].copy(p))})}),this}matrix(t){return this.getCurves().forEach(e=>e.matrix(t)),this}getMinMax(t=M.MAX,e=M.MIN,r=!0){if(this.getCurves().forEach(n=>n.getMinMax(t,e)),r){const n=this.strokeWidth/2;t.x-=n,t.y-=n,e.x+=n,e.y+=n}return{min:t,max:e}}getBoundingBox(t=!0){const{min:e,max:r}=this.getMinMax(void 0,void 0,t);return new Q(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:n="none"}=e;return t.beginPath(),t.save(),gr(t,e),this.paths.forEach(i=>{i.drawTo(t)}),r!=="none"&&t.fill(),n!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:n="none"}=e;return t.beginPath(),t.save(),gr(t,e),this.getControlPoints().forEach(i=>{t.moveTo(i.x,i.y),t.arc(i.x,i.y,4,0,Math.PI*2)}),r!=="none"&&t.fill(),n!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.paths.flatMap(t=>t.toCommands())}toData(){return this.paths.map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const n in t)t[n]!==void 0&&(e[$o(n)]=t[n]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let r="";for(const n in e)e[n]!==void 0&&(r+=`${n}:${e[n]};`);return`<path d="${this.toData()}" style="${r}"></path>`}toSvgString(){const{x:t,y:e,width:r,height:n}=this.getBoundingBox(),i=this.toSvgPathString();return`<svg viewBox="${t} ${e} ${r} ${n}" width="${r}px" height="${n}px" xmlns="http://www.w3.org/2000/svg">${i}</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:n,top:i,width:o,height:a}=this.getBoundingBox(),h=document.createElement("canvas");h.width=o*e,h.height=a*e,h.style.width=`${o}px`,h.style.height=`${a}px`;const l=h.getContext("2d");return l&&(l.scale(e,e),l.translate(-n,-i),this.drawTo(l,r)),h}copy(t){return this.currentPath=t.currentPath.clone(),this.paths=t.paths.map(e=>e.clone()),this.style={...t.style},this}clone(){return new this.constructor().copy(this)}}const xr="px",jn=90,kn=["mm","cm","in","pt","pc","px"],Cr={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 E(s){let t="px";if(typeof s=="string"||s instanceof String)for(let r=0,n=kn.length;r<n;r++){const i=kn[r];if(s.endsWith(i)){t=i,s=s.substring(0,s.length-i.length);break}}let e;return t==="px"&&xr!=="px"?e=Cr.in[xr]/jn:(e=Cr[t][xr],e<0&&(e=Cr[t].in*jn)),e*Number.parseFloat(s)}const Fo=new yt,Ge=new yt,Bn=new yt,Fn=new yt;function Go(s,t,e){if(!(s.hasAttribute("transform")||s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))))return null;const r=Vo(s);return e.length>0&&r.premultiply(e[e.length-1]),t.copy(r),e.push(r),r}function Vo(s){const t=new yt,e=Fo;if(s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))&&t.translate(E(s.getAttribute("x")),E(s.getAttribute("y"))),s.hasAttribute("transform")){const r=s.getAttribute("transform").split(")");for(let n=r.length-1;n>=0;n--){const i=r[n].trim();if(i==="")continue;const o=i.indexOf("("),a=i.length;if(o>0&&o<a){const h=i.slice(0,o),l=Pt(i.slice(o+1));switch(e.identity(),h){case"translate":if(l.length>=1){const u=l[0];let c=0;l.length>=2&&(c=l[1]),e.translate(u,c)}break;case"rotate":if(l.length>=1){let u=0,c=0,p=0;u=l[0]*Math.PI/180,l.length>=3&&(c=l[1],p=l[2]),Ge.makeTranslation(-c,-p),Bn.makeRotation(u),Fn.multiplyMatrices(Bn,Ge),Ge.makeTranslation(c,p),e.multiplyMatrices(Ge,Fn)}break;case"scale":l.length>=1&&e.scale(l[0],l[1]??l[0]);break;case"skewX":l.length===1&&e.set(1,Math.tan(l[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":l.length===1&&e.set(1,0,0,Math.tan(l[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":l.length===6&&e.set(l[0],l[2],l[4],l[1],l[3],l[5],0,0,1);break}}t.premultiply(e)}}return t}function Ro(s){return new bt().addPath(new te().arc(E(s.getAttribute("cx")||0),E(s.getAttribute("cy")||0),E(s.getAttribute("r")||0),0,Math.PI*2))}function Wo(s,t){if(!(!s.sheet||!s.sheet.cssRules||!s.sheet.cssRules.length))for(let e=0;e<s.sheet.cssRules.length;e++){const r=s.sheet.cssRules[e];if(r.type!==1)continue;const n=r.selectorText.split(/,/g).filter(Boolean).map(i=>i.trim());for(let i=0;i<n.length;i++){const o=Object.fromEntries(Object.entries(r.style).filter(([,a])=>a!==""));t[n[i]]=Object.assign(t[n[i]]||{},o)}}}function qo(s){return new bt().addPath(new te().ellipse(E(s.getAttribute("cx")||0),E(s.getAttribute("cy")||0),E(s.getAttribute("rx")||0),E(s.getAttribute("ry")||0),0,0,Math.PI*2))}function Ho(s){return new bt().moveTo(E(s.getAttribute("x1")||0),E(s.getAttribute("y1")||0)).lineTo(E(s.getAttribute("x2")||0),E(s.getAttribute("y2")||0))}function Qo(s){const t=new bt,e=s.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const Xo=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Yo(s){var r;const t=new bt;let e=0;return(r=s.getAttribute("points"))==null||r.replace(Xo,(n,i,o)=>{const a=E(i),h=E(o);return e===0?t.moveTo(a,h):t.lineTo(a,h),e++,n}),t.currentPath.autoClose=!0,t}const Zo=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ko(s){var r;const t=new bt;let e=0;return(r=s.getAttribute("points"))==null||r.replace(Zo,(n,i,o)=>{const a=E(i),h=E(o);return e===0?t.moveTo(a,h):t.lineTo(a,h),e++,n}),t.currentPath.autoClose=!1,t}function Jo(s){const t=E(s.getAttribute("x")||0),e=E(s.getAttribute("y")||0),r=E(s.getAttribute("rx")||s.getAttribute("ry")||0),n=E(s.getAttribute("ry")||s.getAttribute("rx")||0),i=E(s.getAttribute("width")),o=E(s.getAttribute("height")),a=1-.551915024494,h=new bt;return h.moveTo(t+r,e),h.lineTo(t+i-r,e),(r!==0||n!==0)&&h.bezierCurveTo(t+i-r*a,e,t+i,e+n*a,t+i,e+n),h.lineTo(t+i,e+o-n),(r!==0||n!==0)&&h.bezierCurveTo(t+i,e+o-n*a,t+i-r*a,e+o,t+i-r,e+o),h.lineTo(t+r,e+o),(r!==0||n!==0)&&h.bezierCurveTo(t+r*a,e+o,t,e+o-n*a,t,e+o-n),h.lineTo(t,e+n),(r!==0||n!==0)&&h.bezierCurveTo(t,e+n*a,t+r*a,e,t+r,e),h}function At(s,t,e){t=Object.assign({},t);let r={};if(s.hasAttribute("class")){const h=s.getAttribute("class").split(/\s/).filter(Boolean).map(l=>l.trim());for(let l=0;l<h.length;l++)r=Object.assign(r,e[`.${h[l]}`])}s.hasAttribute("id")&&(r=Object.assign(r,e[`#${s.getAttribute("id")}`]));function n(h,l,u){u===void 0&&(u=function(p){return p.startsWith("url")&&console.warn("url access in attributes is not implemented."),p}),s.hasAttribute(h)&&(t[l]=u(s.getAttribute(h))),r[h]&&(t[l]=u(r[h])),s.style&&s.style[h]!==""&&(t[l]=u(s.style[h]))}function i(h){return Math.max(0,Math.min(1,E(h)))}function o(h){return Math.max(0,E(h))}function a(h){return h.split(" ").filter(l=>l!=="").map(l=>E(l))}return n("fill","fill"),n("fill-opacity","fillOpacity",i),n("fill-rule","fillRule"),n("opacity","opacity",i),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",i),n("stroke-width","strokeWidth",o),n("stroke-linecap","strokeLinecap"),n("stroke-linejoin","strokeLinejoin"),n("stroke-miterlimit","strokeMiterlimit",o),n("stroke-dasharray","strokeDasharray",a),n("stroke-dashoffset","strokeDashoffset",E),n("visibility","visibility"),t}function Sr(s,t,e=[]){var u;if(s.nodeType!==1)return e;let r=!1,n=null;const i={};switch(s.nodeName){case"svg":t=At(s,t,i);break;case"style":Wo(s,i);break;case"g":t=At(s,t,i);break;case"path":t=At(s,t,i),s.hasAttribute("d")&&(n=Qo(s));break;case"rect":t=At(s,t,i),n=Jo(s);break;case"polygon":t=At(s,t,i),n=Yo(s);break;case"polyline":t=At(s,t,i),n=Ko(s);break;case"circle":t=At(s,t,i),n=Ro(s);break;case"ellipse":t=At(s,t,i),n=qo(s);break;case"line":t=At(s,t,i),n=Ho(s);break;case"defs":r=!0;break;case"use":{t=At(s,t,i);const p=(s.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),g=(u=s.viewportElement)==null?void 0:u.getElementById(p);g?Sr(g,t,e):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(s);break}const o=new yt,a=[],h=Go(s,o,a);n&&(n.matrix(o),e.push(n),n.style=t);const l=s.childNodes;for(let c=0,p=l.length;c<p;c++){const g=l[c];r&&g.nodeName!=="style"&&g.nodeName!=="defs"||Sr(g,t,e)}return h&&(a.pop(),a.length>0?o.copy(a[a.length-1]):o.identity()),e}const Gn="data:image/svg+xml;",Vn=`${Gn}base64,`,Rn=`${Gn}charset=utf8,`;function Pr(s){if(typeof s=="string"){let t;return s.startsWith(Vn)?(s=s.substring(Vn.length,s.length),t=atob(s)):s.startsWith(Rn)?(s=s.substring(Rn.length,s.length),t=decodeURIComponent(s)):t=s,new DOMParser().parseFromString(t,"image/svg+xml").documentElement}else return s}function Ve(s){return Sr(Pr(s),{})}function be(s){if(!s.length)return;const t=M.MAX,e=M.MIN;return s.forEach(r=>r.getMinMax(t,e)),new Q(t.x,t.y,e.x-t.x,e.y-t.y)}const ta=new Set(["©","®","÷"]),ea=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),ra={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class Wn{constructor(t,e,r){z(this,"boundingBox",new Q);z(this,"textWidth",0);z(this,"textHeight",0);z(this,"glyphHeight",0);z(this,"glyphWidth",0);z(this,"underlinePosition",0);z(this,"underlineThickness",0);z(this,"yStrikeoutPosition",0);z(this,"yStrikeoutSize",0);z(this,"baseline",0);z(this,"centerDiviation",0);z(this,"path",new bt);z(this,"glyphBox",new Q);z(this,"center",new M);this.content=t,this.index=e,this.parent=r}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}_font(){var e;const t=(e=wn.get(this.computedStyle.fontFamily))==null?void 0:e.font;if(t instanceof Ut||t instanceof st)return t.sfnt}updateGlyph(t=this._font()){if(!t)return this;const{unitsPerEm:e,ascender:r,descender:n,os2:i,post:o}=t,{content:a,computedStyle:h,boundingBox:l}=this,{height:u}=l,{fontSize:c}=h,p=e/c,g=t.getAdvanceWidth(a,c),y=(r+Math.abs(n))/p,w=r/p,d=(r-i.yStrikeoutPosition)/p,P=i.yStrikeoutSize/p,C=(r-o.underlinePosition)/p,x=o.underlineThickness/p;return this.glyphWidth=g,this.glyphHeight=y,this.underlinePosition=C,this.underlineThickness=x,this.yStrikeoutPosition=d,this.yStrikeoutSize=P,this.baseline=w,this.centerDiviation=.5*u-w,this}updatePath(){const t=this._font();if(!t)return this;const{isVertical:e,content:r,textWidth:n,textHeight:i,boundingBox:o,computedStyle:a,baseline:h,glyphHeight:l,glyphWidth:u}=this.updateGlyph(t),{os2:c,ascender:p,descender:g}=t,y=p,w=g,d=c.sTypoAscender,{left:P,top:C}=o,{fontSize:x,fontStyle:T}=a;let v=P,b=C+h,A;const S=new bt;if(e&&(v+=(l-u)/2,Math.abs(n-i)>.1&&(b-=(y-d)/(y+Math.abs(w))*l),A=void 0),e&&!ta.has(r)&&(r.codePointAt(0)<=256||ea.has(r))){S.addCommands(t.getPathCommands(r,v,C+h-(l-u)/2,x)??[]);const _={y:C-(l-u)/2+l/2,x:v+u/2};T==="italic"&&this._italic(S,e?{x:_.x,y:C-(l-u)/2+h}:void 0),S.rotate(90,_)}else A!==void 0?(S.addCommands(t.glyphs.get(A).getPathCommands(v,b,x)),T==="italic"&&this._italic(S,e?{x:v+u/2,y:C+d/(y+Math.abs(w))*l}:void 0)):(S.addCommands(t.getPathCommands(r,v,b,x)??[]),T==="italic"&&this._italic(S,e?{x:v+l/2,y:b}:void 0));return S.addCommands(this._decoration()),S.bold(ra[a.fontWeight??400]*x*.05),S.style={fill:a.color,stroke:a.textStrokeWidth?a.textStrokeColor:"none",strokeWidth:a.textStrokeWidth?a.textStrokeWidth*x*.03:0},this.path=S,this.glyphBox=this.getGlyphBoundingBox(),this.center=this.glyphBox.getCenterPoint(),this}update(){return this.updatePath(),this}_decoration(){const{isVertical:t,underlinePosition:e,yStrikeoutPosition:r}=this,{textDecoration:n,fontSize:i}=this.computedStyle,{left:o,top:a,width:h,height:l}=this.boundingBox,u=.1*i;let c;switch(n){case"underline":t?c=o:c=a+e;break;case"line-through":t?c=o+h/2:c=a+r;break;case"none":default:return[]}return t?[{type:"M",x:c,y:a},{type:"L",x:c,y:a+l},{type:"L",x:c+u,y:a+l},{type:"L",x:c+u,y:a},{type:"Z"}]:[{type:"M",x:o,y:c},{type:"L",x:o+h,y:c},{type:"L",x:o+h,y:c+u},{type:"L",x:o,y:c+u},{type:"Z"}]}_italic(t,e){t.skew(-.24,0,e||{y:this.boundingBox.top+this.baseline,x:this.boundingBox.left+this.glyphWidth/2})}getGlyphMinMax(t,e,r){var n;return(n=this.path.paths[0])!=null&&n.curves.length?this.path.getMinMax(t,e,r):(t??(t=M.MAX),e??(e=M.MIN),{min:t,max:e})}getGlyphBoundingBox(t){const{min:e,max:r}=this.getGlyphMinMax(void 0,void 0,t);return new Q(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){Ce({ctx:t,path:this.path,fontSize:this.computedStyle.fontSize,color:this.computedStyle.color,...e})}}function Me(s){return!s||s==="none"}function Re(s){if(!s)return s;const t={};for(const e in s)s[e]!==""&&s[e]!==void 0&&(t[e]=s[e]);return t}class qn{constructor(t,e={},r){z(this,"boundingBox",new Q);this.content=t,this.style=e,this.parent=r,this.updateComputedStyle().initCharacters()}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,...Re(this.style)},this}initCharacters(){const t=[];let e=0;for(const r of this.computedContent)t.push(new Wn(r,e++,this));return this.characters=t,this}}class ee{constructor(t,e){z(this,"boundingBox",new Q);z(this,"fragments",[]);this.style=t,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...Re(this.parentStyle),...Re(this.style)},this}addFragment(t,e){const r=new qn(t,e,this);return this.fragments.push(r),r}}class Hn{constructor(t){this._text=t}_styleToDomStyle(t){const e={...t};for(const r in t)["width","height","fontSize","letterSpacing","textStrokeWidth","shadowOffsetX","shadowOffsetY","shadowBlur"].includes(r)?e[r]=`${t[r]}px`:e[r]=t[r];return e}createDom(){const{paragraphs:t,computedStyle:e}=this._text,r=document.createDocumentFragment(),n=document.createElement("section");Object.assign(n.style,{width:"max-content",height:"max-content",...this._styleToDomStyle(e),position:"absolute",visibility:"hidden"});const i=document.createElement("ul");return Object.assign(i.style,{listStyleType:"inherit",padding:"0",margin:"0"}),t.forEach(o=>{const a=document.createElement("li");Object.assign(a.style,this._styleToDomStyle(o.style)),o.fragments.forEach(h=>{const l=document.createElement("span");Object.assign(l.style,this._styleToDomStyle(h.style)),l.appendChild(document.createTextNode(h.content)),a.appendChild(l)}),i.appendChild(a)}),n.appendChild(i),r.appendChild(n),document.body.appendChild(r),{dom:n,destory:()=>{var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}}}_measureDom(t){const e=[],r=[],n=[];return t.querySelectorAll("li").forEach((i,o)=>{const a=i.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),i.querySelectorAll("span").forEach((h,l)=>{var p;const u=i.getBoundingClientRect();r.push({paragraphIndex:o,fragmentIndex:l,left:u.left,top:u.top,width:u.width,height:u.height});const c=h.firstChild;if(c instanceof window.Text){const g=document.createRange();g.selectNodeContents(c);const y=c.data?c.data.length:0;let w=0;for(;w<=y;){g.setStart(c,Math.max(w-1,0)),g.setEnd(c,w);const d=((p=g.getClientRects)==null?void 0:p.call(g))??[g.getBoundingClientRect()];let P=d[d.length-1];d.length>1&&P.width<2&&(P=d[d.length-2]);const C=g.toString();C!==""&&P&&P.width+P.height!==0&&n.push({content:C,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:l,characterIndex:w-1,top:P.top,left:P.left,height:P.height,width:P.width,textWidth:-1,textHeight:-1}),w++}}})}),{paragraphs:e,fragments:r,characters:n}}measureDom(t){const{paragraphs:e}=this._text,r=t.getBoundingClientRect(),n=t.querySelector("ul"),i=window.getComputedStyle(t).writingMode.includes("vertical"),o=n.style.lineHeight;n.style.lineHeight="4000px";const a=[[]];let h=a[0];const{characters:l}=this._measureDom(t);l.length>0&&(h.push(l[0]),l.reduce((g,y)=>{const w=i?"left":"top";return Math.abs(y[w]-g[w])>4e3/2&&(h=[],a.push(h)),h.push(y),y})),n.style.lineHeight=o;const u=this._measureDom(t);u.paragraphs.forEach(g=>{const y=e[g.paragraphIndex];y.boundingBox.left=g.left-r.left,y.boundingBox.top=g.top-r.top,y.boundingBox.width=g.width,y.boundingBox.height=g.height}),u.fragments.forEach(g=>{const y=e[g.paragraphIndex].fragments[g.fragmentIndex];y.boundingBox.left=g.left-r.left,y.boundingBox.top=g.top-r.top,y.boundingBox.width=g.width,y.boundingBox.height=g.height});const c=[];let p=0;return a.forEach(g=>{g.forEach(y=>{const w=u.characters[p],{paragraphIndex:d,fragmentIndex:P,characterIndex:C}=w;c.push({...w,newParagraphIndex:d,textWidth:y.width,textHeight:y.height,left:w.left-r.left,top:w.top-r.top});const x=e[d].fragments[P].characters[C];x.boundingBox.left=c[p].left,x.boundingBox.top=c[p].top,x.boundingBox.width=c[p].width,x.boundingBox.height=c[p].height,x.textWidth=c[p].textWidth,x.textHeight=c[p].textHeight,p++})}),{paragraphs:e,boundingBox:new Q(0,0,r.width,r.height)}}measure(t){let e;t||({dom:t,destory:e}=this.createDom());const r=this.measureDom(t);return e==null||e(),r}}class Qn{constructor(t){this._text=t}parse(){let{content:t,computedStyle:e}=this._text;const r=[];if(typeof t=="string"){const n=new ee({},e);n.addFragment(t),r.push(n)}else{t=Array.isArray(t)?t:[t];for(const n of t)if(typeof n=="string"){const i=new ee({},e);i.addFragment(n),r.push(i)}else if(Array.isArray(n)){const i=new ee({},e);n.forEach(o=>{if(typeof o=="string")i.addFragment(o);else{const{content:a,...h}=o;a!==void 0&&i.addFragment(a,h)}}),r.push(i)}else if("fragments"in n){const{fragments:i,...o}=n,a=new ee(o,e);i.forEach(h=>{const{content:l,...u}=h;l!==void 0&&a.addFragment(l,u)}),r.push(a)}else if("content"in n){const{content:i,...o}=n;if(i!==void 0){const a=new ee(o,e);a.addFragment(i),r.push(a)}}}return r}}function na(s){return s}const Bt=new M,re=new yt,Ft=new yt;function Xn(s){return{name:"effect",getBoundingBox:t=>{const{characters:e,fontSize:r}=t,n=[];return e.forEach(i=>{s==null||s.forEach(o=>{const a=i.glyphBox.clone(),h=_r(t,o);Bt.set(a.left,a.top),Bt.applyMatrix3(h),a.left=Bt.x,a.top=Bt.y,Bt.set(a.right,a.bottom),Bt.applyMatrix3(h),a.width=Bt.x-a.left,a.height=Bt.y-a.top;const l=(o.shadowOffsetX??0)*r,u=(o.shadowOffsetY??0)*r,c=Math.max(.1,o.textStrokeWidth??0)*r;a.left+=l-c,a.top+=u-c,a.width+=c*2,a.height+=c*2,n.push(a)})}),n.length?Q.from(...n):void 0},render:(t,e)=>{const{characters:r,renderBoundingBox:n}=e;s?s.forEach(i=>{Tt(i,n,t),t.save();const[o,a,h,l,u,c]=_r(e,i).transpose().elements;t.transform(o,l,a,u,h,c),r.forEach(p=>{p.drawTo(t,i)}),t.restore()}):r.forEach(i=>{i.drawTo(t)})}}}function _r(s,t){const{fontSize:e,renderBoundingBox:r}=s,n=(t.offsetX??0)*e,i=(t.offsetY??0)*e,o=Math.PI*2,a=(t.skewX??0)/360*o,h=(t.skewY??0)/360*o,{left:l,top:u,width:c,height:p}=r,g=l+c/2,y=u+p/2;return re.identity(),Ft.makeTranslation(n,i),re.multiply(Ft),Ft.makeTranslation(g,y),re.multiply(Ft),Ft.set(1,Math.tan(a),0,Math.tan(h),1,0,0,0,1),re.multiply(Ft),Ft.makeTranslation(-g,-y),re.multiply(Ft),re.clone()}const sa={referImage:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3MiIgaGVpZ2h0PSI3MiIgdmlld0JveD0iMCAwIDcyIDcyIiBmaWxsPSJub25lIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMyLjQwMjkgMjhIMzUuMTU5NFYzMy4xNzcxQzM1Ljk4MjEgMzIuMzExNSAzNi45NzEgMzEuODczNyAzOC4wOTQ4IDMxLjg3MzdDMzkuNjY3NiAzMS44NzM3IDQwLjkxNjYgMzIuNDI5NSA0MS44MzkgMzMuNTQzN0w0MS44NDAzIDMzLjU0NTNDNDIuNjcxNyAzNC41NzA1IDQzLjA5MTUgMzUuODU1OSA0My4wOTE1IDM3LjM4NzdDNDMuMDkxNSAzOC45NzYxIDQyLjY3MjkgNDAuMzAyOCA0MS44MTgzIDQxLjMzMDRMNDEuODE3MSA0MS4zMzE4QzQwLjg3MzEgNDIuNDQ2MSAzOS41ODMyIDQzIDM3Ljk3MjEgNDNDMzYuNzQ3NyA0MyAzNS43NDg4IDQyLjY1OTkgMzQuOTk1OCA0MS45NjkzVjQyLjcyNDdIMzIuNDAyOVYyOFpNMzcuNTQyOCAzNC4wOTI0QzM2Ljg1NDkgMzQuMDkyNCAzNi4zMDE0IDM0LjM1NjEgMzUuODQ4NyAzNC45MDA0TDM1Ljg0NTIgMzQuOTA0NkMzNS4zMzU4IDM1LjQ4NTMgMzUuMDc3NiAzNi4yOTc2IDM1LjA3NzYgMzcuMzQ4NFYzNy41MDU3QzM1LjA3NzYgMzguNDY0IDM1LjI3NzIgMzkuMjQ0MyAzNS42OTQzIDM5LjgyNzlDMzYuMTQ0MSA0MC40NTg3IDM2Ljc3MjYgNDAuNzgxMyAzNy42MjQ1IDQwLjc4MTNDMzguNTg3NCA0MC43ODEzIDM5LjI3MDcgNDAuNDUyNyAzOS43MTUyIDM5LjgxMjdDNDAuMDcyOCAzOS4yNjg0IDQwLjI3MzcgMzguNDY3MyA0MC4yNzM3IDM3LjM4NzdDNDAuMjczNyAzNi4zMTA1IDQwLjA1MzMgMzUuNTMxMyAzOS42NzgzIDM1LjAwNzdDMzkuMjM3MSAzNC40MDcxIDM4LjUzNDIgMzQuMDkyNCAzNy41NDI4IDM0LjA5MjRaIiBmaWxsPSIjMjIyNTI5Ii8+PHBhdGggZD0iTTQ5Ljg2MTQgMzEuODczN0M0OC4xNTM1IDMxLjg3MzcgNDYuODAxNiAzMi40MjM5IDQ1LjgzNDggMzMuNTM5MkM0NC45MzcgMzQuNTQ3MiA0NC40OTY2IDM1Ljg1NiA0NC40OTY2IDM3LjQyN0M0NC40OTY2IDM5LjAzNjggNDQuOTM2NyA0MC4zNjU5IDQ1Ljg1NTkgNDEuMzk0M0M0Ni44MDMxIDQyLjQ3MDYgNDguMTM0OCA0MyA0OS44MjA1IDQzQzUxLjIyNiA0MyA1Mi4zODI2IDQyLjY1NjMgNTMuMjQ3OSA0MS45Njk3QzU0LjEzNTkgNDEuMjYxNCA1NC43MDYxIDQwLjE4ODcgNTQuOTU3MyAzOC43NzkxTDU1IDM4LjUzOTdINTIuMjQ4NEw1Mi4yMjU5IDM4LjcyMDFDNTIuMTM3OSAzOS40MjUxIDUxLjg5MjUgMzkuOTI3OCA1MS41MTA5IDQwLjI1NThDNTEuMTI5NSA0MC41ODM1IDUwLjU4MzEgNDAuNzYxNiA0OS44NDA5IDQwLjc2MTZDNDkuMDAwMSA0MC43NjE2IDQ4LjM5NDkgNDAuNDcxNSA0Ny45OTA3IDM5LjkyMzdMNDcuOTg3NCAzOS45MTk0QzQ3LjUzNTYgMzkuMzQwMSA0Ny4zMTQ0IDM4LjUwNjIgNDcuMzE0NCAzNy40MDc0QzQ3LjMxNDQgMzYuMzMyMiA0Ny41NTQ0IDM1LjUxNzcgNDguMDA1OCAzNC45NTY4TDQ4LjAwNzggMzQuOTU0M0M0OC40NTM3IDM0LjM4MjUgNDkuMDYxOCAzNC4xMTIxIDQ5Ljg2MTQgMzQuMTEyMUM1MC41MjMgMzQuMTEyMSA1MS4wNDUxIDM0LjI2MTUgNTEuNDI3MiAzNC41NDA3QzUxLjc4ODQgMzQuODE5NCA1Mi4wNTMgMzUuMjQ0NyA1Mi4xODgxIDM1Ljg1NzFMNTIuMjIzOSAzNi4wMTk0SDU0Ljk1NDhMNTQuOTE3IDM1Ljc4MzVDNTQuNzA2MyAzNC40NjYgNTQuMTUzNiAzMy40NzAxIDUzLjI2MzQgMzIuODAxOUw1My4yNjAyIDMyLjc5OTVDNTIuMzk1MSAzMi4xNzU1IDUxLjI2MjEgMzEuODczNyA0OS44NjE0IDMxLjg3MzdaIiBmaWxsPSIjMjIyNTI5Ii8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNS43NTYxIDI4LjI3NTNIMjIuNzQ0TDE3IDQyLjcyNDdIMjAuMDE0MUwyMS4zNDI5IDM5LjIwNDlIMjcuMTU3MkwyOC40ODYgNDIuNzI0N0gzMS41MDAxTDI1Ljc1NjEgMjguMjc1M1pNMjIuMjEyNSAzNi45MDc2TDI0LjI1OTYgMzEuNDUzOUwyNi4yODg1IDM2LjkwNzZIMjIuMjEyNVoiIGZpbGw9IiMyMjI1MjkiLz48L3N2Zz4="};function ia(s,t,e){if(s==="cover")return 0;if(typeof s=="string")if(s.endsWith("%")){const r=Number(s.substring(0,s.length-1))/100;return Math.ceil(r*e/t)}else return s.endsWith("rem")?Number(s.substring(0,s.length-3)):Math.ceil(Number(s)/t);else return Math.ceil(s/t)}function oa(s,t,e){return typeof s=="string"?s.endsWith("%")?Number(s.substring(0,s.length-1))/100:s.endsWith("rem")?Number(s.substring(0,s.length-3))*t/e:Number(s)/e:s/e}function Yn(s={}){const t={...sa,...s},e=Ve(t.referImage),r=[],n=[];return{name:"highlight",paths:r,update:i=>{r.length=0;const{characters:o}=i;let a;const h=[];let l;o.forEach(u=>{const c=u.computedStyle;Me(c.highlightImage)||(c.highlightSize!=="1rem"&&(l==null?void 0:l.highlightImage)===c.highlightImage&&(l==null?void 0:l.highlightSize)===c.highlightSize&&(l==null?void 0:l.highlightStrokeWidth)===c.highlightStrokeWidth&&(l==null?void 0:l.highlightOverflow)===c.highlightOverflow&&a.length&&a[0].boundingBox.top===u.boundingBox.top&&a[0].fontSize===u.fontSize?a.push(u):(a=[],a.push(u),h.push(a))),l=c}),h.filter(u=>u.length).map(u=>({style:u[0].computedStyle,box:Q.from(...u.map(c=>c.glyphBox))})).forEach(u=>{const{style:c,box:p}=u,{fontSize:g}=c,y=oa(c.highlightStrokeWidth,g,p.width),w=ia(c.highlightSize,g,p.width),d=Me(c.highlightOverflow)?w?"hidden":"visible":c.highlightOverflow,P=Pr(c.highlightImage),C=Ve(P),x=be(C),T=be(e),v={x:w?g*w*(x.width/T.width)/x.width:p.width*(x.width/T.width)/x.width,y:p.height*(x.height/T.height)/x.height},b=g/x.width*2,A=x.width*v.x,S=Math.ceil(p.width/A),_={x:(x.left-T.left)*v.x,y:(x.top-T.top)*v.y},k=new yt().translate(-x.left,-x.top).scale(v.x,v.y).translate(p.left,p.top).translate(_.x,_.y);for(let L=0;L<S;L++){const V=k.clone().translate(L*A,0);C.forEach(mt=>{const O=mt.clone().matrix(V);O.style.strokeWidth&&(O.style.strokeWidth*=b*y),O.style.strokeMiterlimit&&(O.style.strokeMiterlimit*=b),O.style.strokeDashoffset&&(O.style.strokeDashoffset*=b),O.style.strokeDasharray&&(O.style.strokeDasharray=O.style.strokeDasharray.map(N=>N*b)),r.push(O),n[r.length-1]=d==="hidden"?new Q(p.left,p.top-p.height,p.width,p.height*3):void 0})}})},renderOrder:-1,render:(i,o)=>{r.forEach((a,h)=>{Ce({ctx:i,path:a,clipRect:n[h],fontSize:o.computedStyle.fontSize})})}}}function aa(s,t,e){return s==="cover"?1:typeof s=="string"?s.endsWith("%")?Number(s.substring(0,s.length-1))/100:s.endsWith("rem")?Number(s.substring(0,s.length-3))*t/e:Number(s)/e:s/e}function Zn(){const s=[];return{name:"listStyle",update:t=>{const{paragraphs:e,computedStyle:r,fontSize:n}=t;let i=r.listStyleSize,o;if(!Me(r.listStyleImage))o=r.listStyleImage;else if(!Me(r.listStyleType)){const u=n*.38/2;switch(i=i==="cover"?u*2:i,r.listStyleType){case"disc":o=`<svg width="${u*2}" height="${u*2}" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
}`)),document.head.appendChild(r),this}get(t){let e;if(t){const r=this._namesUrls.get(t)??t;e=this._loaded.get(r)}return e??this.fallbackFont}set(t,e){return this._namesUrls.set(t,e.url),this._loaded.set(e.url,e),this}delete(t){const e=this._namesUrls.get(t)??t;return this._namesUrls.delete(t),this._loaded.delete(e),this}clear(){return this._namesUrls.clear(),this._loaded.clear(),this}async waitUntilLoad(){await Promise.all(Array.from(this._loading.values()).map(t=>t.when))}async load(t,e={}){const{cancelOther:r,injectFontFace:n=!0,injectStyleTag:i=!0,...o}=e,{family:a,url:h}=t;if(this._loaded.has(h))return r&&(this._loading.forEach(u=>u.cancel()),this._loading.clear()),this._loaded.get(h);let l=this._loading.get(h);return l||(l=this._createRequest(h,o),this._loading.set(h,l)),r&&this._loading.forEach((u,c)=>{u!==l&&(u.cancel(),this._loading.delete(c))}),l.when.then(u=>{const c={...t,font:gn(u)??u};return this._loaded.has(h)||(this._loaded.set(h,c),new Set(Array.isArray(a)?a:[a]).forEach(p=>{this._namesUrls.set(p,h),typeof document<"u"&&(n&&this.injectFontFace(p,u),i&&this.injectStyleTag(p,h))})),c}).catch(u=>{if(u instanceof DOMException&&u.message==="The user aborted a request.")return{...t,font:new ArrayBuffer(0)};throw u}).finally(()=>{this._loading.delete(h)})}};we(yn,"defaultRequestInit",{cache:"force-cache"});let mn=yn;const wn=new mn;function vn(s,t){const{cmap:e,loca:r,hmtx:n,vmtx:i,glyf:o}=s,a=e.unicodeToGlyphIndexMap,h=r.locations,l=n.metrics,u=i==null?void 0:i.metrics,c=Array.from(new Set(t.split("").map(w=>w.codePointAt(0)).filter(w=>w!==void 0&&a.has(w)))).sort((w,d)=>w-d),p=new Map;c.forEach(w=>{const d=a.get(w)??0;let P=p.get(d);P||p.set(d,P=new Set),P.add(w)});const g=[],y=w=>{const d=l[w],P=(u==null?void 0:u[w])??{advanceHeight:0,topSideBearing:0},C=h[w],x=h[w+1]??C,T={...d,...P,rawGlyphIndex:w,glyphIndex:g.length,unicodes:Array.from(p.get(w)??[]),view:new DataView(o.view.buffer,o.view.byteOffset+C,x-C)};return g.push(T),T};return y(0),c.forEach(w=>y(a.get(w))),g.slice().forEach(w=>{const{view:d}=w;if(!d.byteLength||d.getInt16(0)>=0)return;let C=10,x;do{x=d.getUint16(C);const T=C+2,v=d.getUint16(T);C+=4,Kt.ARG_1_AND_2_ARE_WORDS&x?C+=4:C+=2,Kt.WE_HAVE_A_SCALE&x?C+=2:Kt.WE_HAVE_AN_X_AND_Y_SCALE&x?C+=4:Kt.WE_HAVE_A_TWO_BY_TWO&x&&(C+=8);const b=y(v);d.setUint16(T,b.glyphIndex)}while(Kt.MORE_COMPONENTS&x)}),g}function bn(s,t){const e=vn(s,t),r=e.length,{head:n,maxp:i,hhea:o,vhea:a}=s;n.checkSumAdjustment=0,n.magickNumber=1594834165,n.indexToLocFormat=1,i.numGlyphs=r;let h=0;s.loca=f.Loca.from([...e.map(p=>{const g=h;return h+=p.view.byteLength,g}),h],n.indexToLocFormat);const l=e.reduce((p,g,y)=>(g.unicodes.forEach(w=>p.set(w,y)),p),new Map);s.cmap=f.Cmap.from(l),s.glyf=f.Glyf.from(e.map(p=>p.view)),o.numOfLongHorMetrics=r,s.hmtx=f.Hmtx.from(e.map(p=>({advanceWidth:p.advanceWidth,leftSideBearing:p.leftSideBearing}))),a&&(a.numOfLongVerMetrics=r),s.vmtx&&(s.vmtx=f.Vmtx.from(e.map(p=>({advanceHeight:p.advanceHeight,topSideBearing:p.topSideBearing}))));const c=new f.Post;return c.format=3,c.italicAngle=0,c.underlinePosition=0,c.underlineThickness=0,c.isFixedPitch=0,c.minMemType42=0,c.minMemType42=0,c.minMemType1=0,c.maxMemType1=r,s.post=c,s.delete("GPOS"),s.delete("GSUB"),s.delete("hdmx"),s}function so(s,t){let e,r;if(s instanceof st)e=s.sfnt.clone(),r="ttf";else if(s instanceof Ut)e=s.sfnt.clone(),r="woff";else{const i=Gt(s);if(st.is(i))e=new st(i).sfnt,r="ttf-buffer";else if(Ut.is(i))e=new Ut(i).sfnt,r="woff-buffer";else throw new Error("Failed to minify, only support ttf、woff source")}const n=bn(e,t);switch(r){case"ttf":return st.from(n);case"woff":return Ut.from(n);case"ttf-buffer":return st.from(n).view.buffer;case"woff-buffer":default:return Ut.from(n).view.buffer}}const io={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function gr(s,t){const{fill:e="#000",stroke:r="none",strokeWidth:n=r==="none"?0:1,strokeLinecap:i="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:h=[],strokeDashoffset:l=0,shadowOffsetX:u=0,shadowOffsetY:c=0,shadowBlur:p=0,shadowColor:g="rgba(0, 0, 0, 0)"}=t;s.fillStyle=e,s.strokeStyle=r,s.lineWidth=n,s.lineCap=i,s.lineJoin=io[o],s.miterLimit=a,s.setLineDash(h),s.lineDashOffset=l,s.shadowOffsetX=u,s.shadowOffsetY=c,s.shadowBlur=p,s.shadowColor=g}class M{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new M(1/0,1/0)}static get MIN(){return new M(-1/0,-1/0)}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,n=this.x-e.x,i=-(this.y-e.y),o=Math.sin(r),a=Math.cos(r);return this.set(e.x+(n*a-i*o),e.y-(n*o+i*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 n=t<0?r.x-this.x+r.x:this.x,i=e<0?r.y-this.y+r.y:this.y;return this.x=n*Math.abs(t),this.y=i*Math.abs(e),this}skew(t,e=0,r={x:0,y:0}){const n=this.x-r.x,i=this.y-r.y;return this.x=r.x+(n+Math.tan(t)*i),this.y=r.y+(i+Math.tan(e)*n),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,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6],this.y=n[1]*e+n[4]*r+n[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new M(this.x,this.y)}}class Q{constructor(t=0,e=0,r=0,n=0){this.left=t,this.top=e,this.width=r,this.height=n}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}static from(...t){if(t.length===0)return new Q;if(t.length===1)return t[0].clone();const e=t[0],r=t.slice(1).reduce((n,i)=>(n.left=Math.min(n.left,i.left),n.top=Math.min(n.top,i.top),n.right=Math.max(n.right,i.right),n.bottom=Math.max(n.bottom,i.bottom),n),{left:(e==null?void 0:e.left)??0,top:(e==null?void 0:e.top)??0,right:(e==null?void 0:e.right)??0,bottom:(e==null?void 0:e.bottom)??0});return new Q(r.left,r.top,r.right-r.left,r.bottom-r.top)}translate(t,e){return this.left+=t,this.top+=e,this}getCenterPoint(){return new M((this.left+this.right)/2,(this.top+this.bottom)/2)}clone(){return new Q(this.left,this.top,this.width,this.height)}toArray(){return[this.left,this.top,this.width,this.height]}}var oo=Object.defineProperty,ao=(s,t,e)=>t in s?oo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,lo=(s,t,e)=>(ao(s,t+"",e),e);class yt{constructor(t=1,e=0,r=0,n=0,i=1,o=0,a=0,h=0,l=1){lo(this,"elements",[]),this.set(t,e,r,n,i,o,a,h,l)}set(t,e,r,n,i,o,a,h,l){const u=this.elements;return u[0]=t,u[1]=n,u[2]=a,u[3]=e,u[4]=i,u[5]=h,u[6]=r,u[7]=o,u[8]=l,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,n=e.elements,i=this.elements,o=r[0],a=r[3],h=r[6],l=r[1],u=r[4],c=r[7],p=r[2],g=r[5],y=r[8],w=n[0],d=n[3],P=n[6],C=n[1],x=n[4],T=n[7],v=n[2],b=n[5],A=n[8];return i[0]=o*w+a*C+h*v,i[3]=o*d+a*x+h*b,i[6]=o*P+a*T+h*A,i[1]=l*w+u*C+c*v,i[4]=l*d+u*x+c*b,i[7]=l*P+u*T+c*A,i[2]=p*w+g*C+y*v,i[5]=p*d+g*x+y*b,i[8]=p*P+g*T+y*A,this}invert(){const t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=u*o-a*l,p=a*h-u*i,g=l*i-o*h,y=e*c+r*p+n*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/y;return t[0]=c*w,t[1]=(n*l-u*r)*w,t[2]=(a*r-n*o)*w,t[3]=p*w,t[4]=(u*e-n*h)*w,t[5]=(n*i-a*e)*w,t[6]=g*w,t[7]=(r*h-l*e)*w,t[8]=(o*e-r*i)*w,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(yr.makeScale(t,e)),this}rotate(t){return this.premultiply(yr.makeRotation(-t)),this}translate(t,e){return this.premultiply(yr.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 yr=new yt;function Mn(s,t,e,r){const n=s*e+t*r,i=Math.sqrt(s*s+t*t)*Math.sqrt(e*e+r*r);let o=Math.acos(Math.max(-1,Math.min(1,n/i)));return s*r-t*e<0&&(o=-o),o}function xn(s,t,e,r,n,i,o,a){if(t===0||e===0){s.lineTo(a.x,a.y);return}r=r*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const h=(o.x-a.x)/2,l=(o.y-a.y)/2,u=Math.cos(r)*h+Math.sin(r)*l,c=-Math.sin(r)*h+Math.cos(r)*l;let p=t*t,g=e*e;const y=u*u,w=c*c,d=y/p+w/g;if(d>1){const k=Math.sqrt(d);t=k*t,e=k*e,p=t*t,g=e*e}const P=p*w+g*y,C=(p*g-P)/P;let x=Math.sqrt(Math.max(0,C));n===i&&(x=-x);const T=x*t*c/e,v=-x*e*u/t,b=Math.cos(r)*T-Math.sin(r)*v+(o.x+a.x)/2,A=Math.sin(r)*T+Math.cos(r)*v+(o.y+a.y)/2,S=Mn(1,0,(u-T)/t,(c-v)/e),_=Mn((u-T)/t,(c-v)/e,(-u-T)/t,(-c-v)/e)%(Math.PI*2);s.ellipse(b,A,t,e,r,S,S+_,i===1)}function Jt(s,t){return s-(t-s)}function mr(s,t){const e=new M,r=new M;for(let n=0,i=s.length;n<i;n++){const o=s[n];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(Jt(e.x,r.x),Jt(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(Jt(e.x,r.x),Jt(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=Jt(e.x,r.x),h=Jt(e.y,r.y);r.x=a,r.y=h,o.type==="t"?(t.quadraticCurveTo(a,h,e.x+o.x,e.y+o.y),e.add(o)):(t.quadraticCurveTo(a,h,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),xn(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)}}const Z={SEPARATOR:/[ \t\r\n,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Pt(s,t,e=0){let a=0,h=!0,l="",u="";const c=[];function p(d,P,C){const x=new SyntaxError(`Unexpected character "${d}" at index ${P}.`);throw x.partial=C,x}function g(){l!==""&&(u===""?c.push(Number(l)):c.push(Number(l)*10**Number(u))),l="",u=""}let y;const w=s.length;for(let d=0;d<w;d++){if(y=s[d],Array.isArray(t)&&t.includes(c.length%e)&&Z.FLAGS.test(y)){a=1,l=y,g();continue}if(a===0){if(Z.WHITESPACE.test(y))continue;if(Z.DIGIT.test(y)||Z.SIGN.test(y)){a=1,l=y;continue}if(Z.POINT.test(y)){a=2,l=y;continue}Z.COMMA.test(y)&&(h&&p(y,d,c),h=!0)}if(a===1){if(Z.DIGIT.test(y)){l+=y;continue}if(Z.POINT.test(y)){l+=y,a=2;continue}if(Z.EXP.test(y)){a=3;continue}Z.SIGN.test(y)&&l.length===1&&Z.SIGN.test(l[0])&&p(y,d,c)}if(a===2){if(Z.DIGIT.test(y)){l+=y;continue}if(Z.EXP.test(y)){a=3;continue}Z.POINT.test(y)&&l[l.length-1]==="."&&p(y,d,c)}if(a===3){if(Z.DIGIT.test(y)){u+=y;continue}if(Z.SIGN.test(y)){if(u===""){u+=y;continue}u.length===1&&Z.SIGN.test(u)&&p(y,d,c)}}Z.WHITESPACE.test(y)?(g(),a=0,h=!1):Z.COMMA.test(y)?(g(),a=0,h=!0):Z.SIGN.test(y)?(g(),a=1,l=y):Z.POINT.test(y)?(g(),a=2,l=y):p(y,d,c)}return g(),c}function ho(s){switch(s.type){case"m":case"M":return`${s.type} ${s.x} ${s.y}`;case"h":case"H":return`${s.type} ${s.x}`;case"v":case"V":return`${s.type} ${s.y}`;case"l":case"L":return`${s.type} ${s.x} ${s.y}`;case"c":case"C":return`${s.type} ${s.x1} ${s.y1} ${s.x2} ${s.y2} ${s.x} ${s.y}`;case"s":case"S":return`${s.type} ${s.x2} ${s.y2} ${s.x} ${s.y}`;case"q":case"Q":return`${s.type} ${s.x1} ${s.y1} ${s.x} ${s.y}`;case"t":case"T":return`${s.type} ${s.x} ${s.y}`;case"a":case"A":return`${s.type} ${s.rx} ${s.ry} ${s.angle} ${s.largeArcFlag} ${s.sweepFlag} ${s.x} ${s.y}`;case"z":case"Z":return s.type;default:return""}}function Cn(s){let t="";for(let e=0,r=s.length;e<r;e++)t+=`${ho(s[e])} `;return t}const co=/[a-df-z][^a-df-z]*/gi;function wr(s){const t=[],e=s.match(co);if(!e)return t;for(let r=0,n=e.length;r<n;r++){const i=e[r],o=i.charAt(0),a=i.slice(1).trim();let h;switch(o){case"m":case"M":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)l===0?t.push({type:o,x:h[l],y:h[l+1]}):t.push({type:o==="m"?"l":"L",x:h[l],y:h[l+1]});break;case"h":case"H":h=Pt(a);for(let l=0,u=h.length;l<u;l++)t.push({type:o,x:h[l]});break;case"v":case"V":h=Pt(a);for(let l=0,u=h.length;l<u;l++)t.push({type:o,y:h[l]});break;case"l":case"L":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)t.push({type:o,x:h[l],y:h[l+1]});break;case"c":case"C":h=Pt(a);for(let l=0,u=h.length;l<u;l+=6)t.push({type:o,x1:h[l],y1:h[l+1],x2:h[l+2],y2:h[l+3],x:h[l+4],y:h[l+5]});break;case"s":case"S":h=Pt(a);for(let l=0,u=h.length;l<u;l+=4)t.push({type:o,x2:h[l],y2:h[l+1],x:h[l+2],y:h[l+3]});break;case"q":case"Q":h=Pt(a);for(let l=0,u=h.length;l<u;l+=4)t.push({type:o,x1:h[l],y1:h[l+1],x:h[l+2],y:h[l+3]});break;case"t":case"T":h=Pt(a);for(let l=0,u=h.length;l<u;l+=2)t.push({type:o,x:h[l],y:h[l+1]});break;case"a":case"A":h=Pt(a,[3,4],7);for(let l=0,u=h.length;l<u;l+=7)t.push({type:o,rx:h[l],ry:h[l+1],angle:h[l+2],largeArcFlag:h[l+3],sweepFlag:h[l+4],x:h[l+5],y:h[l+6]});break;case"z":case"Z":t.push({type:o});break;default:console.warn(i)}}return t}var uo=Object.defineProperty,fo=(s,t,e)=>t in s?uo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,vr=(s,t,e)=>(fo(s,typeof t!="symbol"?t+"":t,e),e);class _t{constructor(){vr(this,"arcLengthDivisions",200),vr(this,"_cacheArcLengths"),vr(this,"_needsUpdate",!1)}isClockwise(){const t=this.getPoint(1),e=this.getPoint(.5),r=this.getPoint(1);return(e.x-t.x)*(r.y-e.y)-(e.y-t.y)*(r.x-e.x)<0}getPointAt(t,e=new M){return this.getPoint(this.getUToTMapping(t),e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}forEachControlPoints(t){return this.getControlPoints().forEach(t),this}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this._cacheArcLengths&&this._cacheArcLengths.length===t+1&&!this._needsUpdate)return this._cacheArcLengths;this._needsUpdate=!1;const e=[];let r,n=this.getPoint(0),i=0;e.push(0);for(let o=1;o<=t;o++)r=this.getPoint(o/t),i+=r.distanceTo(n),e.push(i),n=r;return this._cacheArcLengths=e,e}updateArcLengths(){this._needsUpdate=!0,this.getLengths()}getUToTMapping(t,e){const r=this.getLengths();let n=0;const i=r.length;let o;e?o=e:o=t*r[i-1];let a=0,h=i-1,l;for(;a<=h;)if(n=Math.floor(a+(h-a)/2),l=r[n]-o,l<0)a=n+1;else if(l>0)h=n-1;else{h=n;break}if(n=h,r[n]===o)return n/(i-1);const u=r[n],p=r[n+1]-u,g=(o-u)/p;return(n+g)/(i-1)}getTangent(t,e=new M){const n=Math.max(0,t-1e-4),i=Math.min(1,t+1e-4);return e.copy(this.getPoint(i).sub(this.getPoint(n)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new M){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,n=1,i=(r+n)/2;for(;n-r>e;){i=(r+n)/2;const o=this.getPoint(i);if(o.distanceTo(t)<e)return i;o.x<t.x?r=i:n=i}return i}matrix(t){return this.forEachControlPoints(e=>e.applyMatrix3(t)),this}getMinMax(t=M.MAX,e=M.MIN){return this.getPoints().forEach(r=>{t.x=Math.min(t.x,r.x),t.y=Math.min(t.y,r.y),e.x=Math.max(e.x,r.x),e.y=Math.max(e.y,r.y)}),{min:t,max:e}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new Q(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.getPoints().map((t,e)=>e===0?{type:"M",x:t.x,y:t.y}:{type:"L",x:t.x,y:t.y})}toData(){return Cn(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.arcLengthDivisions=t.arcLengthDivisions,this}clone(){return new this.constructor().copy(this)}}class Be extends _t{constructor(t,e,r=0,n=Math.PI*2){super(),this.center=t,this.radius=e,this.start=r,this.end=n}getPoint(t){const{radius:e,center:r}=this;return r.clone().add(this.getNormal(t).clone().scale(e))}getTangent(t,e=new M){const{x:r,y:n}=this.getNormal(t);return e.set(-n,r)}getNormal(t,e=new M){const{start:r,end:n}=this,i=t*(n-r)+r-.5*Math.PI;return e.set(Math.cos(i),Math.sin(i))}getControlPoints(){return[this.center]}getMinMax(t=M.MAX,e=M.MIN){return t.x=Math.min(t.x,this.center.x-this.radius),t.y=Math.min(t.y,this.center.y-this.radius),e.x=Math.max(e.x,this.center.x+this.radius),e.y=Math.max(e.y,this.center.y+this.radius),{min:t,max:e}}}function Sn(s,t,e,r,n){const i=(r-t)*.5,o=(n-e)*.5,a=s*s,h=s*a;return(2*e-2*r+i+o)*h+(-3*e+3*r-2*i-o)*a+i*s+e}function po(s,t){const e=1-s;return e*e*t}function go(s,t){return 2*(1-s)*s*t}function yo(s,t){return s*s*t}function Pn(s,t,e,r){return po(s,t)+go(s,e)+yo(s,r)}function mo(s,t){const e=1-s;return e*e*e*t}function wo(s,t){const e=1-s;return 3*e*e*s*t}function vo(s,t){return 3*(1-s)*s*s*t}function bo(s,t){return s*s*s*t}function _n(s,t,e,r,n){return mo(s,t)+wo(s,e)+vo(s,r)+bo(s,n)}class Tn extends _t{constructor(t=new M,e=new M,r=new M,n=new M){super(),this.start=t,this.startControl=e,this.endControl=r,this.end=n}getPoint(t,e=new M){const{start:r,startControl:n,endControl:i,end:o}=this;return e.set(_n(t,r.x,n.x,i.x,o.x),_n(t,r.y,n.y,i.y,o.y))}getControlPoints(){return[this.start,this.startControl,this.endControl,this.end]}_solveQuadratic(t,e,r){const n=e*e-4*t*r;if(n<0)return[];const i=Math.sqrt(n),o=(-e+i)/(2*t),a=(-e-i)/(2*t);return[o,a].filter(h=>h>=0&&h<=1)}getMinMax(t=M.MAX,e=M.MIN){const r=this.start,n=this.startControl,i=this.endControl,o=this.end,a=this._solveQuadratic(3*(n.x-r.x),6*(i.x-n.x),3*(o.x-i.x)),h=this._solveQuadratic(3*(n.y-r.y),6*(i.y-n.y),3*(o.y-i.y)),l=[0,1,...a,...h];return((c,p)=>{for(const g of c)for(let y=0;y<=p;y++){const w=y/p-.5,d=Math.min(1,Math.max(0,g+w)),P=this.getPoint(d);t.x=Math.min(t.x,P.x),t.y=Math.min(t.y,P.y),e.x=Math.max(e.x,P.x),e.y=Math.max(e.y,P.y)}})(l,10),{min:t,max:e}}toCommands(){const{start:t,startControl:e,endControl:r,end:n}=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:n.x,y:n.y}]}drawTo(t){const{start:e,startControl:r,endControl:n,end:i}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(r.x,r.y,n.x,n.y,i.x,i.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.startControl.copy(t.startControl),this.endControl.copy(t.endControl),this.end.copy(t.end),this}}const Mo=new yt,On=new yt,In=new yt,Fe=new M;class An extends _t{constructor(t=new M,e=1,r=1,n=0,i=0,o=Math.PI*2,a=!1){super(),this.center=t,this.radiusX=e,this.radiusY=r,this.rotation=n,this.startAngle=i,this.endAngle=o,this.clockwise=a}isClockwise(){return this.clockwise}getPoint(t,e=new M){const r=Math.PI*2;let n=this.endAngle-this.startAngle;const i=Math.abs(n)<Number.EPSILON;for(;n<0;)n+=r;for(;n>r;)n-=r;n<Number.EPSILON&&(i?n=0:n=r),this.clockwise&&!i&&(n===r?n=-r:n=n-r);const o=this.startAngle+t*n;let a=this.center.x+this.radiusX*Math.cos(o),h=this.center.y+this.radiusY*Math.sin(o);if(this.rotation!==0){const l=Math.cos(this.rotation),u=Math.sin(this.rotation),c=a-this.center.x,p=h-this.center.y;a=c*l-p*u+this.center.x,h=c*u+p*l+this.center.y}return e.set(a,h)}toCommands(){const{center:t,radiusX:e,radiusY:r,startAngle:n,endAngle:i,clockwise:o,rotation:a}=this,{x:h,y:l}=t,u=h+e*Math.cos(n)*Math.cos(a)-r*Math.sin(n)*Math.sin(a),c=l+e*Math.cos(n)*Math.sin(a)+r*Math.sin(n)*Math.cos(a),p=Math.abs(n-i),g=p>Math.PI?1:0,y=o?1:0,w=a*180/Math.PI;if(p>=2*Math.PI){const d=n+Math.PI,P=h+e*Math.cos(d)*Math.cos(a)-r*Math.sin(d)*Math.sin(a),C=l+e*Math.cos(d)*Math.sin(a)+r*Math.sin(d)*Math.cos(a);return[{type:"M",x:u,y:c},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:0,sweepFlag:y,x:P,y:C},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:0,sweepFlag:y,x:u,y:c}]}else{const d=h+e*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a),P=l+e*Math.cos(i)*Math.sin(a)+r*Math.sin(i)*Math.cos(a);return[{type:"M",x:u,y:c},{type:"A",rx:e,ry:r,angle:w,largeArcFlag:g,sweepFlag:y,x:d,y:P}]}}drawTo(t){const{center:e,radiusX:r,radiusY:n,rotation:i,startAngle:o,endAngle:a,clockwise:h}=this;return t.ellipse(e.x,e.y,r,n,i,o,a,!h),this}matrix(t){return Fe.set(this.center.x,this.center.y),Fe.applyMatrix3(t),this.center.x=Fe.x,this.center.y=Fe.y,So(t)?xo(this,t):Co(this,t),this}getControlPoints(){return[this.center]}getMinMax(t=M.MAX,e=M.MIN){const{center:r,radiusX:n,radiusY:i,rotation:o}=this,{x:a,y:h}=r,l=Math.cos(o),u=Math.sin(o),c=Math.sqrt(n*n*l*l+i*i*u*u),p=Math.sqrt(n*n*u*u+i*i*l*l);return t.x=Math.min(t.x,a-c),t.y=Math.min(t.y,h-p),e.x=Math.max(e.x,a+c),e.y=Math.max(e.y,h+p),{min:t,max:e}}copy(t){return super.copy(t),this.center.x=t.center.x,this.center.y=t.center.y,this.radiusX=t.radiusX,this.radiusY=t.radiusY,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotation=t.rotation,this}}function xo(s,t){const e=s.radiusX,r=s.radiusY,n=Math.cos(s.rotation),i=Math.sin(s.rotation),o=new M(e*n,e*i),a=new M(-r*i,r*n),h=o.applyMatrix3(t),l=a.applyMatrix3(t),u=Mo.set(h.x,l.x,0,h.y,l.y,0,0,0,1),c=On.copy(u).invert(),y=In.copy(c).transpose().multiply(c).elements,w=Po(y[0],y[1],y[4]),d=Math.sqrt(w.rt1),P=Math.sqrt(w.rt2);if(s.radiusX=1/d,s.radiusY=1/P,s.rotation=Math.atan2(w.sn,w.cs),!((s.endAngle-s.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=On.set(d,0,0,0,P,0,0,0,1),T=In.set(w.cs,w.sn,0,-w.sn,w.cs,0,0,0,1),v=x.multiply(T).multiply(u),b=A=>{const{x:S,y:_}=new M(Math.cos(A),Math.sin(A)).applyMatrix3(v);return Math.atan2(_,S)};s.startAngle=b(s.startAngle),s.endAngle=b(s.endAngle),Dn(t)&&(s.clockwise=!s.clockwise)}}function Co(s,t){const e=Nn(t),r=zn(t);s.radiusX*=e,s.radiusY*=r;const n=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);s.rotation+=n,Dn(t)&&(s.startAngle*=-1,s.endAngle*=-1,s.clockwise=!s.clockwise)}function Dn(s){const t=s.elements;return t[0]*t[4]-t[1]*t[3]<0}function So(s){const t=s.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const r=Nn(s),n=zn(s);return Math.abs(e/(r*n))>Number.EPSILON}function Nn(s){const t=s.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zn(s){const t=s.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function Po(s,t,e){let r,n,i,o,a;const h=s+e,l=s-e,u=Math.sqrt(l*l+4*t*t);return h>0?(r=.5*(h+u),a=1/r,n=s*a*e-t*a*t):h<0?n=.5*(h-u):(r=.5*u,n=-.5*u),l>0?i=l+u:i=l-u,Math.abs(i)>2*Math.abs(t)?(a=-2*t/i,o=1/Math.sqrt(1+a*a),i=a*o):Math.abs(t)===0?(i=1,o=0):(a=-.5*i/t,i=1/Math.sqrt(1+a*a),o=a*i),l>0&&(a=i,i=-o,o=a),{rt1:r,rt2:n,cs:i,sn:o}}class Ht extends _t{constructor(t=new M,e=new M){super(),this.start=t,this.end=e}getPoint(t,e=new M){return t===1?e.copy(this.end):e.copy(this.end).sub(this.start).scale(t).add(this.start),e}getPointAt(t,e=new M){return this.getPoint(t,e)}getTangent(t,e=new M){return e.subVectors(this.end,this.start).normalize()}getTangentAt(t,e=new M){return this.getTangent(t,e)}getControlPoints(){return[this.start,this.end]}getMinMax(t=M.MAX,e=M.MIN){const{start:r,end:n}=this;return t.x=Math.min(t.x,r.x,n.x),t.y=Math.min(t.y,r.y,n.y),e.x=Math.max(e.x,r.x,n.x),e.y=Math.max(e.y,r.y,n.y),{min:t,max:e}}toCommands(){const{start:t,end:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}drawTo(t){const{start:e,end:r}=this;return t.lineTo(e.x,e.y),t.lineTo(r.x,r.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.end.copy(t.end),this}}var _o=Object.defineProperty,To=(s,t,e)=>t in s?_o(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Oo=(s,t,e)=>(To(s,t+"",e),e);class Io extends _t{constructor(t,e,r=0,n=1){super(),this.center=t,this.size=e,this.start=r,this.end=n,Oo(this,"curveT",0),this.update()}update(){const{x:t,y:e}=this.center,r=new M(t+.5*this.size,e-.5*this.size),n=new M(t-.5*this.size,e-.5*this.size),i=new M(t,e+.5*this.size),o=new Be(r,Math.SQRT1_2*this.size,-.25*Math.PI,.75*Math.PI),a=new Be(n,Math.SQRT1_2*this.size,-.75*Math.PI,.25*Math.PI),h=new Be(i,.5*Math.SQRT1_2*this.size,.75*Math.PI,1.25*Math.PI),l=new M(t,e+this.size),u=new M(t+this.size,e),c=new M().lerpVectors(u,l,.75),p=new M(t-this.size,e),g=new M().lerpVectors(p,l,.75),y=new Ht(u,c),w=new Ht(g,p);return this.curves=[o,y,h,w,a],this}getPoint(t){return this.getCurve(t).getPoint(this.curveT)}getPointAt(t){return this.getPoint(t)}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1),e*=9*Math.PI/8+1.5;let r;const n=.5*Math.PI;return e<n?(r=0,this.curveT=e/n):e<n+.75?(r=1,this.curveT=(e-n)/.75):e<5*Math.PI/8+.75?(r=2,this.curveT=(e-n-.75)/(Math.PI/8)):e<5*Math.PI/8+1.5?(r=3,this.curveT=(e-5*Math.PI/8-.75)/.75):(r=4,this.curveT=(e-5*Math.PI/8-1.5)/n),this.curves[r]}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}var Ao=Object.defineProperty,Do=(s,t,e)=>t in s?Ao(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,br=(s,t,e)=>(Do(s,typeof t!="symbol"?t+"":t,e),e);class No extends _t{constructor(t,e=0,r=0,n=0,i=1){super(),this.center=t,this.radius=e,this.number=r,this.start=n,this.end=i,br(this,"curves",[]),br(this,"curveT",0),br(this,"points",[]),this.update()}update(){for(let t=0;t<this.number;t++){let e=t*2*Math.PI/this.number;e-=.5*Math.PI,this.points.push(new M(this.radius*Math.cos(e),this.radius*Math.sin(e)).add(this.center))}for(let t=0;t<this.number;t++)this.curves.push(new Ht(this.points[t],this.points[(t+1)%this.number]));return this}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1);const r=e*this.number,n=Math.floor(r);return this.curveT=r-n,this.curves[n]}getPoint(t,e){return this.getCurve(t).getPoint(this.curveT,e)}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}class En extends _t{constructor(t=new M,e=new M,r=new M){super(),this.start=t,this.control=e,this.end=r}getPoint(t,e=new M){const{start:r,control:n,end:i}=this;return e.set(Pn(t,r.x,n.x,i.x),Pn(t,r.y,n.y,i.y)),e}getControlPoints(){return[this.start,this.control,this.end]}getMinMax(t=M.MAX,e=M.MIN){const{start:r,control:n,end:i}=this,o=.5*(r.x+n.x),a=.5*(r.y+n.y),h=.5*(r.x+i.x),l=.5*(r.y+i.y);return t.x=Math.min(t.x,r.x,i.x,o,h),t.y=Math.min(t.y,r.y,i.y,a,l),e.x=Math.max(e.x,r.x,i.x,o,h),e.y=Math.max(e.y,r.y,i.y,a,l),{min:t,max:e}}toCommands(){const{start:t,control:e,end: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{start:e,control:r,end:n}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(r.x,r.y,n.x,n.y),this}copy(t){return super.copy(t),this.start.copy(t.start),this.control.copy(t.control),this.end.copy(t.end),this}}var zo=Object.defineProperty,Eo=(s,t,e)=>t in s?zo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Un=(s,t,e)=>(Eo(s,typeof t!="symbol"?t+"":t,e),e);class Ln extends _t{constructor(t,e,r=1,n=0,i=1){super(),this.center=t,this.rx=e,this.aspectRatio=r,this.start=n,this.end=i,Un(this,"curves",[]),Un(this,"curveT",0),this.update()}get x(){return this.center.x-this.rx}get y(){return this.center.y-this.rx/this.aspectRatio}get width(){return this.rx*2}get height(){return this.rx/this.aspectRatio*2}update(){const{x:t,y:e}=this.center,r=this.rx,n=this.rx/this.aspectRatio,i=[new M(t-r,e-n),new M(t+r,e-n),new M(t+r,e+n),new M(t-r,e+n)];for(let o=0;o<4;o++)this.curves.push(new Ht(i[o].clone(),i[(o+1)%4].clone()));return this}getCurve(t){let e=(t*(this.end-this.start)+this.start)%1;e<0&&(e+=1),e*=(1+this.aspectRatio)*2;let r;return e<this.aspectRatio?(r=0,this.curveT=e/this.aspectRatio):e<this.aspectRatio+1?(r=1,this.curveT=(e-this.aspectRatio)/1):e<2*this.aspectRatio+1?(r=2,this.curveT=(e-this.aspectRatio-1)/this.aspectRatio):(r=3,this.curveT=(e-2*this.aspectRatio-1)/1),this.curves[r]}getPoint(t,e){return this.getCurve(t).getPoint(this.curveT,e)}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){return this.getCurve(t).getTangent(this.curveT,e)}getNormal(t,e){return this.getCurve(t).getNormal(this.curveT,e)}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){return this.curves.forEach(e=>e.drawTo(t)),this}}class $n extends _t{constructor(t=[]){super(),this.points=t}getPoint(t,e=new M){const{points:r}=this,n=(r.length-1)*t,i=Math.floor(n),o=n-i,a=r[i===0?i:i-1],h=r[i],l=r[i>r.length-2?r.length-1:i+1],u=r[i>r.length-3?r.length-1:i+2];return e.set(Sn(o,a.x,h.x,l.x,u.x),Sn(o,a.y,h.y,l.y,u.y)),e}getControlPoints(){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}}var Uo=Object.defineProperty,Lo=(s,t,e)=>t in s?Uo(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,ve=(s,t,e)=>(Lo(s,typeof t!="symbol"?t+"":t,e),e);class te extends _t{constructor(t){super(),ve(this,"curves",[]),ve(this,"startPoint"),ve(this,"currentPoint",new M),ve(this,"autoClose",!1),ve(this,"_cacheLengths",[]),t&&this.addPoints(t)}addCurve(t){return this.curves.push(t),this}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,r=t.length;e<r;e++){const{x:n,y:i}=t[e];this.lineTo(n,i)}return this}addCommands(t){return mr(t,this),this}addData(t){return this.addCommands(wr(t)),this}getPoint(t,e=new M){const r=t*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=r){const o=n[i]-r,a=this.curves[i],h=a.getLength();return a.getPointAt(h===0?0:1-o/h,e)}i++}return e}getControlPoints(){return this.curves.flatMap(t=>t.getControlPoints())}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){super.updateArcLengths(),this._cacheLengths=[],this.getCurveLengths()}getCurveLengths(){if(this._cacheLengths.length===this.curves.length)return this._cacheLengths;const t=[];let e=0;for(let r=0,n=this.curves.length;r<n;r++)e+=this.curves[r].getLength(),t.push(e);return this._cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[],r=this.curves;let n;for(let i=0,o=r.length;i<o;i++){const h=r[i].getPoints(t);for(let l=0;l<h.length;l++){const u=h[l];n!=null&&n.equals(u)||(e.push(u),n=u)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}_setCurrentPoint(t){return this.currentPoint.copy(t),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;t.equals(e)||(this.curves.push(new Ht(e.clone(),t)),this.currentPoint.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint.set(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){return this.currentPoint.equals({x:t,y:e})||this.curves.push(new Ht(this.currentPoint.clone(),new M(t,e))),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,r,n,i,o){return this.currentPoint.equals({x:i,y:o})||this.curves.push(new Tn(this.currentPoint.clone(),new M(t,e),new M(r,n),new M(i,o))),this._setCurrentPoint({x:i,y:o}),this}quadraticCurveTo(t,e,r,n){return this.currentPoint.equals({x:r,y:n})||this.curves.push(new En(this.currentPoint.clone(),new M(t,e),new M(r,n))),this._setCurrentPoint({x:r,y:n}),this}arc(t,e,r,n,i,o){return this.ellipse(t,e,r,r,0,n,i,o),this}relativeArc(t,e,r,n,i,o){const a=this.currentPoint;return this.arc(t+a.x,e+a.y,r,n,i,o),this}arcTo(t,e,r,n,i){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,r,n,i,o,a,h=!0){const l=new An(new M(t,e),r,n,i,o,a,!h);if(this.curves.length>0){const u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}return this.curves.push(l),this._setCurrentPoint(l.getPoint(1)),this}relativeEllipse(t,e,r,n,i,o,a,h){const l=this.currentPoint;return this.ellipse(t+l.x,e+l.y,r,n,i,o,a,h),this}rect(t,e,r,n){return this.curves.push(new Ln(new M(t+r/2,e+n/2),r/2,r/n)),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){return this.curves.push(new $n([this.currentPoint.clone()].concat(t))),this._setCurrentPoint(t[t.length-1]),this}getMinMax(t=M.MAX,e=M.MIN){return this.curves.forEach(r=>r.getMinMax(t,e)),{min:t,max:e}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new Q(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){var r;const e=(r=this.curves[0])==null?void 0:r.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e<r;e++)this.curves.push(t.curves[e].clone());return this.autoClose=t.autoClose,this.currentPoint.copy(t.currentPoint),this}}function $o(s){return s.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function jo(s,t,e,r){const n=t.clone().sub(s),i=r.clone().sub(e),o=e.clone().sub(s),a=n.cross(i);if(a===0)return new M((s.x+e.x)/2,(s.y+e.y)/2);const h=o.cross(i)/a;return Math.abs(h)>1?new M((s.x+e.x)/2,(s.y+e.y)/2):new M(s.x+h*n.x,s.y+h*n.y)}var ko=Object.defineProperty,Bo=(s,t,e)=>t in s?ko(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,Mr=(s,t,e)=>(Bo(s,typeof t!="symbol"?t+"":t,e),e);class bt{constructor(t){Mr(this,"currentPath",new te),Mr(this,"paths",[this.currentPath]),Mr(this,"style",{}),t&&(t instanceof bt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}get startPoint(){return this.currentPath.startPoint}get currentPoint(){return this.currentPath.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}addPath(t){return t instanceof bt?this.paths.push(...t.paths.map(e=>e.clone())):this.paths.push(t),this}closePath(){const t=this.startPoint;return t&&(this.currentPath.closePath(),this.currentPath.curves.length>0&&(this.currentPath=new te().moveTo(t.x,t.y),this.paths.push(this.currentPath))),this}moveTo(t,e){const{currentPoint:r,curves:n}=this.currentPath;return r.equals({x:t,y:e})||(n.length?(this.currentPath=new te().moveTo(t,e),this.paths.push(this.currentPath)):this.currentPath.moveTo(t,e)),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}bezierCurveTo(t,e,r,n,i,o){return this.currentPath.bezierCurveTo(t,e,r,n,i,o),this}quadraticCurveTo(t,e,r,n){return this.currentPath.quadraticCurveTo(t,e,r,n),this}arc(t,e,r,n,i,o){return this.currentPath.arc(t,e,r,n,i,o),this}arcTo(t,e,r,n,i){return this.currentPath.arcTo(t,e,r,n,i),this}ellipse(t,e,r,n,i,o,a,h){return this.currentPath.ellipse(t,e,r,n,i,o,a,h),this}rect(t,e,r,n){return this.currentPath.rect(t,e,r,n),this}addCommands(t){return mr(t,this),this}addData(t){return this.addCommands(wr(t)),this}splineThru(t){return this.currentPath.splineThru(t),this}getControlPoints(){return this.paths.flatMap(t=>t.getControlPoints())}getCurves(){return this.paths.flatMap(t=>t.curves)}scale(t,e=t,r={x:0,y:0}){return this.getControlPoints().forEach(n=>{n.scale(t,e,r)}),this}skew(t,e=0,r={x:0,y:0}){return this.getControlPoints().forEach(n=>{n.skew(t,e,r)}),this}rotate(t,e={x:0,y:0}){return this.getControlPoints().forEach(r=>{r.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getCurves(),r=[],n=[],i=[];e.forEach((a,h)=>{const l=a.getControlPoints(),u=a.isClockwise();i[h]=l,n[h]=u;const c=l[0],p=l[l.length-1]??c;r.push({start:u?p:c,end:u?c:p,index:h})});const o=[];return r.forEach((a,h)=>{o[h]=[],r.forEach((l,u)=>{u!==h&&l.start.equals(a.end)&&o[h].push(l.index)})}),e.forEach((a,h)=>{const l=n[h];i[h].forEach(c=>{const p=a.getTForPoint(c),g=a.getNormal(p).scale(l?t:-t);c.add(g)})}),o.forEach((a,h)=>{const l=i[h];a.forEach(u=>{const c=i[u],p=jo(l[l.length-1],l[l.length-2]??l[l.length-1],c[0],c[1]??c[0]);p&&(l[l.length-1].copy(p),c[0].copy(p))})}),this}matrix(t){return this.getCurves().forEach(e=>e.matrix(t)),this}getMinMax(t=M.MAX,e=M.MIN,r=!0){if(this.getCurves().forEach(n=>n.getMinMax(t,e)),r){const n=this.strokeWidth/2;t.x-=n,t.y-=n,e.x+=n,e.y+=n}return{min:t,max:e}}getBoundingBox(t=!0){const{min:e,max:r}=this.getMinMax(void 0,void 0,t);return new Q(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:n="none"}=e;return t.beginPath(),t.save(),gr(t,e),this.paths.forEach(i=>{i.drawTo(t)}),r!=="none"&&t.fill(),n!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:r="#000",stroke:n="none"}=e;return t.beginPath(),t.save(),gr(t,e),this.getControlPoints().forEach(i=>{t.moveTo(i.x,i.y),t.arc(i.x,i.y,4,0,Math.PI*2)}),r!=="none"&&t.fill(),n!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.paths.flatMap(t=>t.toCommands())}toData(){return this.paths.map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const n in t)t[n]!==void 0&&(e[$o(n)]=t[n]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let r="";for(const n in e)e[n]!==void 0&&(r+=`${n}:${e[n]};`);return`<path d="${this.toData()}" style="${r}"></path>`}toSvgString(){const{x:t,y:e,width:r,height:n}=this.getBoundingBox(),i=this.toSvgPathString();return`<svg viewBox="${t} ${e} ${r} ${n}" width="${r}px" height="${n}px" xmlns="http://www.w3.org/2000/svg">${i}</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:n,top:i,width:o,height:a}=this.getBoundingBox(),h=document.createElement("canvas");h.width=o*e,h.height=a*e,h.style.width=`${o}px`,h.style.height=`${a}px`;const l=h.getContext("2d");return l&&(l.scale(e,e),l.translate(-n,-i),this.drawTo(l,r)),h}copy(t){return this.currentPath=t.currentPath.clone(),this.paths=t.paths.map(e=>e.clone()),this.style={...t.style},this}clone(){return new this.constructor().copy(this)}}const xr="px",jn=90,kn=["mm","cm","in","pt","pc","px"],Cr={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 E(s){let t="px";if(typeof s=="string"||s instanceof String)for(let r=0,n=kn.length;r<n;r++){const i=kn[r];if(s.endsWith(i)){t=i,s=s.substring(0,s.length-i.length);break}}let e;return t==="px"&&xr!=="px"?e=Cr.in[xr]/jn:(e=Cr[t][xr],e<0&&(e=Cr[t].in*jn)),e*Number.parseFloat(s)}const Fo=new yt,Ge=new yt,Bn=new yt,Fn=new yt;function Go(s,t,e){if(!(s.hasAttribute("transform")||s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))))return null;const r=Vo(s);return e.length>0&&r.premultiply(e[e.length-1]),t.copy(r),e.push(r),r}function Vo(s){const t=new yt,e=Fo;if(s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))&&t.translate(E(s.getAttribute("x")),E(s.getAttribute("y"))),s.hasAttribute("transform")){const r=s.getAttribute("transform").split(")");for(let n=r.length-1;n>=0;n--){const i=r[n].trim();if(i==="")continue;const o=i.indexOf("("),a=i.length;if(o>0&&o<a){const h=i.slice(0,o),l=Pt(i.slice(o+1));switch(e.identity(),h){case"translate":if(l.length>=1){const u=l[0];let c=0;l.length>=2&&(c=l[1]),e.translate(u,c)}break;case"rotate":if(l.length>=1){let u=0,c=0,p=0;u=l[0]*Math.PI/180,l.length>=3&&(c=l[1],p=l[2]),Ge.makeTranslation(-c,-p),Bn.makeRotation(u),Fn.multiplyMatrices(Bn,Ge),Ge.makeTranslation(c,p),e.multiplyMatrices(Ge,Fn)}break;case"scale":l.length>=1&&e.scale(l[0],l[1]??l[0]);break;case"skewX":l.length===1&&e.set(1,Math.tan(l[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":l.length===1&&e.set(1,0,0,Math.tan(l[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":l.length===6&&e.set(l[0],l[2],l[4],l[1],l[3],l[5],0,0,1);break}}t.premultiply(e)}}return t}function Ro(s){return new bt().addPath(new te().arc(E(s.getAttribute("cx")||0),E(s.getAttribute("cy")||0),E(s.getAttribute("r")||0),0,Math.PI*2))}function Wo(s,t){if(!(!s.sheet||!s.sheet.cssRules||!s.sheet.cssRules.length))for(let e=0;e<s.sheet.cssRules.length;e++){const r=s.sheet.cssRules[e];if(r.type!==1)continue;const n=r.selectorText.split(/,/g).filter(Boolean).map(i=>i.trim());for(let i=0;i<n.length;i++){const o=Object.fromEntries(Object.entries(r.style).filter(([,a])=>a!==""));t[n[i]]=Object.assign(t[n[i]]||{},o)}}}function qo(s){return new bt().addPath(new te().ellipse(E(s.getAttribute("cx")||0),E(s.getAttribute("cy")||0),E(s.getAttribute("rx")||0),E(s.getAttribute("ry")||0),0,0,Math.PI*2))}function Ho(s){return new bt().moveTo(E(s.getAttribute("x1")||0),E(s.getAttribute("y1")||0)).lineTo(E(s.getAttribute("x2")||0),E(s.getAttribute("y2")||0))}function Qo(s){const t=new bt,e=s.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const Xo=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Yo(s){var r;const t=new bt;let e=0;return(r=s.getAttribute("points"))==null||r.replace(Xo,(n,i,o)=>{const a=E(i),h=E(o);return e===0?t.moveTo(a,h):t.lineTo(a,h),e++,n}),t.currentPath.autoClose=!0,t}const Zo=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ko(s){var r;const t=new bt;let e=0;return(r=s.getAttribute("points"))==null||r.replace(Zo,(n,i,o)=>{const a=E(i),h=E(o);return e===0?t.moveTo(a,h):t.lineTo(a,h),e++,n}),t.currentPath.autoClose=!1,t}function Jo(s){const t=E(s.getAttribute("x")||0),e=E(s.getAttribute("y")||0),r=E(s.getAttribute("rx")||s.getAttribute("ry")||0),n=E(s.getAttribute("ry")||s.getAttribute("rx")||0),i=E(s.getAttribute("width")),o=E(s.getAttribute("height")),a=1-.551915024494,h=new bt;return h.moveTo(t+r,e),h.lineTo(t+i-r,e),(r!==0||n!==0)&&h.bezierCurveTo(t+i-r*a,e,t+i,e+n*a,t+i,e+n),h.lineTo(t+i,e+o-n),(r!==0||n!==0)&&h.bezierCurveTo(t+i,e+o-n*a,t+i-r*a,e+o,t+i-r,e+o),h.lineTo(t+r,e+o),(r!==0||n!==0)&&h.bezierCurveTo(t+r*a,e+o,t,e+o-n*a,t,e+o-n),h.lineTo(t,e+n),(r!==0||n!==0)&&h.bezierCurveTo(t,e+n*a,t+r*a,e,t+r,e),h}function At(s,t,e){t=Object.assign({},t);let r={};if(s.hasAttribute("class")){const h=s.getAttribute("class").split(/\s/).filter(Boolean).map(l=>l.trim());for(let l=0;l<h.length;l++)r=Object.assign(r,e[`.${h[l]}`])}s.hasAttribute("id")&&(r=Object.assign(r,e[`#${s.getAttribute("id")}`]));function n(h,l,u){u===void 0&&(u=function(p){return p.startsWith("url")&&console.warn("url access in attributes is not implemented."),p}),s.hasAttribute(h)&&(t[l]=u(s.getAttribute(h))),r[h]&&(t[l]=u(r[h])),s.style&&s.style[h]!==""&&(t[l]=u(s.style[h]))}function i(h){return Math.max(0,Math.min(1,E(h)))}function o(h){return Math.max(0,E(h))}function a(h){return h.split(" ").filter(l=>l!=="").map(l=>E(l))}return n("fill","fill"),n("fill-opacity","fillOpacity",i),n("fill-rule","fillRule"),n("opacity","opacity",i),n("stroke","stroke"),n("stroke-opacity","strokeOpacity",i),n("stroke-width","strokeWidth",o),n("stroke-linecap","strokeLinecap"),n("stroke-linejoin","strokeLinejoin"),n("stroke-miterlimit","strokeMiterlimit",o),n("stroke-dasharray","strokeDasharray",a),n("stroke-dashoffset","strokeDashoffset",E),n("visibility","visibility"),t}function Sr(s,t,e=[]){var u;if(s.nodeType!==1)return e;let r=!1,n=null;const i={};switch(s.nodeName){case"svg":t=At(s,t,i);break;case"style":Wo(s,i);break;case"g":t=At(s,t,i);break;case"path":t=At(s,t,i),s.hasAttribute("d")&&(n=Qo(s));break;case"rect":t=At(s,t,i),n=Jo(s);break;case"polygon":t=At(s,t,i),n=Yo(s);break;case"polyline":t=At(s,t,i),n=Ko(s);break;case"circle":t=At(s,t,i),n=Ro(s);break;case"ellipse":t=At(s,t,i),n=qo(s);break;case"line":t=At(s,t,i),n=Ho(s);break;case"defs":r=!0;break;case"use":{t=At(s,t,i);const p=(s.getAttributeNS("http://www.w3.org/1999/xlink","href")||"").substring(1),g=(u=s.viewportElement)==null?void 0:u.getElementById(p);g?Sr(g,t,e):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(s);break}const o=new yt,a=[],h=Go(s,o,a);n&&(n.matrix(o),e.push(n),n.style=t);const l=s.childNodes;for(let c=0,p=l.length;c<p;c++){const g=l[c];r&&g.nodeName!=="style"&&g.nodeName!=="defs"||Sr(g,t,e)}return h&&(a.pop(),a.length>0?o.copy(a[a.length-1]):o.identity()),e}const Gn="data:image/svg+xml;",Vn=`${Gn}base64,`,Rn=`${Gn}charset=utf8,`;function Pr(s){if(typeof s=="string"){let t;return s.startsWith(Vn)?(s=s.substring(Vn.length,s.length),t=atob(s)):s.startsWith(Rn)?(s=s.substring(Rn.length,s.length),t=decodeURIComponent(s)):t=s,new DOMParser().parseFromString(t,"image/svg+xml").documentElement}else return s}function Ve(s){return Sr(Pr(s),{})}function be(s){if(!s.length)return;const t=M.MAX,e=M.MIN;return s.forEach(r=>r.getMinMax(t,e)),new Q(t.x,t.y,e.x-t.x,e.y-t.y)}const ta=new Set(["©","®","÷"]),ea=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),ra={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class Wn{constructor(t,e,r){z(this,"boundingBox",new Q);z(this,"textWidth",0);z(this,"textHeight",0);z(this,"glyphHeight",0);z(this,"glyphWidth",0);z(this,"underlinePosition",0);z(this,"underlineThickness",0);z(this,"yStrikeoutPosition",0);z(this,"yStrikeoutSize",0);z(this,"baseline",0);z(this,"centerDiviation",0);z(this,"path",new bt);z(this,"glyphBox",new Q);z(this,"center",new M);this.content=t,this.index=e,this.parent=r}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}_font(){var e;const t=(e=wn.get(this.computedStyle.fontFamily))==null?void 0:e.font;if(t instanceof Ut||t instanceof st)return t.sfnt}updateGlyph(t=this._font()){if(!t)return this;const{unitsPerEm:e,ascender:r,descender:n,os2:i,post:o}=t,{content:a,computedStyle:h,boundingBox:l}=this,{height:u}=l,{fontSize:c}=h,p=e/c,g=t.getAdvanceWidth(a,c),y=(r+Math.abs(n))/p,w=r/p,d=(r-i.yStrikeoutPosition)/p,P=i.yStrikeoutSize/p,C=(r-o.underlinePosition)/p,x=o.underlineThickness/p;return this.glyphWidth=g,this.glyphHeight=y,this.underlinePosition=C,this.underlineThickness=x,this.yStrikeoutPosition=d,this.yStrikeoutSize=P,this.baseline=w,this.centerDiviation=.5*u-w,this}updatePath(){const t=this._font();if(!t)return this;const{isVertical:e,content:r,textWidth:n,textHeight:i,boundingBox:o,computedStyle:a,baseline:h,glyphHeight:l,glyphWidth:u}=this.updateGlyph(t),{os2:c,ascender:p,descender:g}=t,y=p,w=g,d=c.sTypoAscender,{left:P,top:C}=o,{fontSize:x,fontStyle:T}=a;let v=P,b=C+h,A;const S=new bt;if(e&&(v+=(l-u)/2,Math.abs(n-i)>.1&&(b-=(y-d)/(y+Math.abs(w))*l),A=void 0),e&&!ta.has(r)&&(r.codePointAt(0)<=256||ea.has(r))){S.addCommands(t.getPathCommands(r,v,C+h-(l-u)/2,x)??[]);const _={y:C-(l-u)/2+l/2,x:v+u/2};T==="italic"&&this._italic(S,e?{x:_.x,y:C-(l-u)/2+h}:void 0),S.rotate(90,_)}else A!==void 0?(S.addCommands(t.glyphs.get(A).getPathCommands(v,b,x)),T==="italic"&&this._italic(S,e?{x:v+u/2,y:C+d/(y+Math.abs(w))*l}:void 0)):(S.addCommands(t.getPathCommands(r,v,b,x)??[]),T==="italic"&&this._italic(S,e?{x:v+l/2,y:b}:void 0));return S.addCommands(this._decoration()),S.bold(ra[a.fontWeight??400]*x*.05),S.style={fill:a.color,stroke:a.textStrokeWidth?a.textStrokeColor:"none",strokeWidth:a.textStrokeWidth?a.textStrokeWidth*x*.03:0},this.path=S,this.glyphBox=this.getGlyphBoundingBox(),this.center=this.glyphBox.getCenterPoint(),this}update(){return this.updatePath(),this}_decoration(){const{isVertical:t,underlinePosition:e,yStrikeoutPosition:r}=this,{textDecoration:n,fontSize:i}=this.computedStyle,{left:o,top:a,width:h,height:l}=this.boundingBox,u=.1*i;let c;switch(n){case"underline":t?c=o:c=a+e;break;case"line-through":t?c=o+h/2:c=a+r;break;case"none":default:return[]}return t?[{type:"M",x:c,y:a},{type:"L",x:c,y:a+l},{type:"L",x:c+u,y:a+l},{type:"L",x:c+u,y:a},{type:"Z"}]:[{type:"M",x:o,y:c},{type:"L",x:o+h,y:c},{type:"L",x:o+h,y:c+u},{type:"L",x:o,y:c+u},{type:"Z"}]}_italic(t,e){t.skew(-.24,0,e||{y:this.boundingBox.top+this.baseline,x:this.boundingBox.left+this.glyphWidth/2})}getGlyphMinMax(t,e,r){var n;return(n=this.path.paths[0])!=null&&n.curves.length?this.path.getMinMax(t,e,r):(t??(t=M.MAX),e??(e=M.MIN),{min:t,max:e})}getGlyphBoundingBox(t){const{min:e,max:r}=this.getGlyphMinMax(void 0,void 0,t);return new Q(e.x,e.y,r.x-e.x,r.y-e.y)}drawTo(t,e={}){Ce({ctx:t,path:this.path,fontSize:this.computedStyle.fontSize,color:this.computedStyle.color,...e})}}function Me(s){return!s||s==="none"}function Re(s){if(!s)return s;const t={};for(const e in s)s[e]!==""&&s[e]!==void 0&&(t[e]=s[e]);return t}class qn{constructor(t,e={},r){z(this,"boundingBox",new Q);this.content=t,this.style=e,this.parent=r,this.updateComputedStyle().initCharacters()}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,...Re(this.style)},this}initCharacters(){const t=[];let e=0;for(const r of this.computedContent)t.push(new Wn(r,e++,this));return this.characters=t,this}}class ee{constructor(t,e){z(this,"boundingBox",new Q);z(this,"fragments",[]);this.style=t,this.parentStyle=e,this.updateComputedStyle()}updateComputedStyle(){return this.computedStyle={...Re(this.parentStyle),...Re(this.style)},this}addFragment(t,e){const r=new qn(t,e,this);return this.fragments.push(r),r}}class Hn{constructor(t){this._text=t}_styleToDomStyle(t){const e={...t};for(const r in t)["width","height","fontSize","letterSpacing","textStrokeWidth","shadowOffsetX","shadowOffsetY","shadowBlur"].includes(r)?e[r]=`${t[r]}px`:e[r]=t[r];return e}createDom(){const{paragraphs:t,computedStyle:e}=this._text,r=document.createDocumentFragment(),n=document.createElement("section");Object.assign(n.style,{width:"max-content",height:"max-content",...this._styleToDomStyle(e),position:"absolute",visibility:"hidden"});const i=document.createElement("ul");return Object.assign(i.style,{listStyleType:"inherit",padding:"0",margin:"0"}),t.forEach(o=>{const a=document.createElement("li");Object.assign(a.style,this._styleToDomStyle(o.style)),o.fragments.forEach(h=>{const l=document.createElement("span");Object.assign(l.style,this._styleToDomStyle(h.style)),l.appendChild(document.createTextNode(h.content)),a.appendChild(l)}),i.appendChild(a)}),n.appendChild(i),r.appendChild(n),document.body.appendChild(r),{dom:n,destory:()=>{var o;return(o=n.parentNode)==null?void 0:o.removeChild(n)}}}_measureDom(t){const e=[],r=[],n=[];return t.querySelectorAll("li").forEach((i,o)=>{const a=i.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),i.querySelectorAll("span").forEach((h,l)=>{var p;const u=i.getBoundingClientRect();r.push({paragraphIndex:o,fragmentIndex:l,left:u.left,top:u.top,width:u.width,height:u.height});const c=h.firstChild;if(c instanceof window.Text){const g=document.createRange();g.selectNodeContents(c);const y=c.data?c.data.length:0;let w=0;for(;w<=y;){g.setStart(c,Math.max(w-1,0)),g.setEnd(c,w);const d=((p=g.getClientRects)==null?void 0:p.call(g))??[g.getBoundingClientRect()];let P=d[d.length-1];d.length>1&&P.width<2&&(P=d[d.length-2]);const C=g.toString();C!==""&&P&&P.width+P.height!==0&&n.push({content:C,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:l,characterIndex:w-1,top:P.top,left:P.left,height:P.height,width:P.width,textWidth:-1,textHeight:-1}),w++}}})}),{paragraphs:e,fragments:r,characters:n}}measureDom(t){const{paragraphs:e}=this._text,r=t.getBoundingClientRect(),n=t.querySelector("ul"),i=window.getComputedStyle(t).writingMode.includes("vertical"),o=n.style.lineHeight;n.style.lineHeight="4000px";const a=[[]];let h=a[0];const{characters:l}=this._measureDom(t);l.length>0&&(h.push(l[0]),l.reduce((g,y)=>{const w=i?"left":"top";return Math.abs(y[w]-g[w])>4e3/2&&(h=[],a.push(h)),h.push(y),y})),n.style.lineHeight=o;const u=this._measureDom(t);u.paragraphs.forEach(g=>{const y=e[g.paragraphIndex];y.boundingBox.left=g.left-r.left,y.boundingBox.top=g.top-r.top,y.boundingBox.width=g.width,y.boundingBox.height=g.height}),u.fragments.forEach(g=>{const y=e[g.paragraphIndex].fragments[g.fragmentIndex];y.boundingBox.left=g.left-r.left,y.boundingBox.top=g.top-r.top,y.boundingBox.width=g.width,y.boundingBox.height=g.height});const c=[];let p=0;return a.forEach(g=>{g.forEach(y=>{const w=u.characters[p],{paragraphIndex:d,fragmentIndex:P,characterIndex:C}=w;c.push({...w,newParagraphIndex:d,textWidth:y.width,textHeight:y.height,left:w.left-r.left,top:w.top-r.top});const x=e[d].fragments[P].characters[C];x.boundingBox.left=c[p].left,x.boundingBox.top=c[p].top,x.boundingBox.width=c[p].width,x.boundingBox.height=c[p].height,x.textWidth=c[p].textWidth,x.textHeight=c[p].textHeight,p++})}),{paragraphs:e,boundingBox:new Q(0,0,r.width,r.height)}}measure(t){let e;t||({dom:t,destory:e}=this.createDom());const r=this.measureDom(t);return e==null||e(),r}}class Qn{constructor(t){this._text=t}parse(){let{content:t,computedStyle:e}=this._text;const r=[];if(typeof t=="string"){const n=new ee({},e);n.addFragment(t),r.push(n)}else{t=Array.isArray(t)?t:[t];for(const n of t)if(typeof n=="string"){const i=new ee({},e);i.addFragment(n),r.push(i)}else if(Array.isArray(n)){const i=new ee({},e);n.forEach(o=>{if(typeof o=="string")i.addFragment(o);else{const{content:a,...h}=o;a!==void 0&&i.addFragment(a,h)}}),r.push(i)}else if("fragments"in n){const{fragments:i,...o}=n,a=new ee(o,e);i.forEach(h=>{const{content:l,...u}=h;l!==void 0&&a.addFragment(l,u)}),r.push(a)}else if("content"in n){const{content:i,...o}=n;if(i!==void 0){const a=new ee(o,e);a.addFragment(i),r.push(a)}}}return r}}function na(s){return s}const Bt=new M,re=new yt,Ft=new yt;function Xn(){return{name:"effect",getBoundingBox:s=>{const{characters:t,fontSize:e,effects:r}=s,n=[];return t.forEach(i=>{r==null||r.forEach(o=>{const a=i.glyphBox.clone(),h=_r(s,o);Bt.set(a.left,a.top),Bt.applyMatrix3(h),a.left=Bt.x,a.top=Bt.y,Bt.set(a.right,a.bottom),Bt.applyMatrix3(h),a.width=Bt.x-a.left,a.height=Bt.y-a.top;const l=(o.shadowOffsetX??0)*e,u=(o.shadowOffsetY??0)*e,c=Math.max(.1,o.textStrokeWidth??0)*e;a.left+=l-c,a.top+=u-c,a.width+=c*2,a.height+=c*2,n.push(a)})}),n.length?Q.from(...n):void 0},render:(s,t)=>{const{characters:e,renderBoundingBox:r,effects:n}=t;n?n.forEach(i=>{Tt(i,r,s),s.save();const[o,a,h,l,u,c]=_r(t,i).transpose().elements;s.transform(o,l,a,u,h,c),e.forEach(p=>{p.drawTo(s,i)}),s.restore()}):e.forEach(i=>{i.drawTo(s)})}}}function _r(s,t){const{fontSize:e,renderBoundingBox:r}=s,n=(t.offsetX??0)*e,i=(t.offsetY??0)*e,o=Math.PI*2,a=(t.skewX??0)/360*o,h=(t.skewY??0)/360*o,{left:l,top:u,width:c,height:p}=r,g=l+c/2,y=u+p/2;return re.identity(),Ft.makeTranslation(n,i),re.multiply(Ft),Ft.makeTranslation(g,y),re.multiply(Ft),Ft.set(1,Math.tan(a),0,Math.tan(h),1,0,0,0,1),re.multiply(Ft),Ft.makeTranslation(-g,-y),re.multiply(Ft),re.clone()}const sa={referImage:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3MiIgaGVpZ2h0PSI3MiIgdmlld0JveD0iMCAwIDcyIDcyIiBmaWxsPSJub25lIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMyLjQwMjkgMjhIMzUuMTU5NFYzMy4xNzcxQzM1Ljk4MjEgMzIuMzExNSAzNi45NzEgMzEuODczNyAzOC4wOTQ4IDMxLjg3MzdDMzkuNjY3NiAzMS44NzM3IDQwLjkxNjYgMzIuNDI5NSA0MS44MzkgMzMuNTQzN0w0MS44NDAzIDMzLjU0NTNDNDIuNjcxNyAzNC41NzA1IDQzLjA5MTUgMzUuODU1OSA0My4wOTE1IDM3LjM4NzdDNDMuMDkxNSAzOC45NzYxIDQyLjY3MjkgNDAuMzAyOCA0MS44MTgzIDQxLjMzMDRMNDEuODE3MSA0MS4zMzE4QzQwLjg3MzEgNDIuNDQ2MSAzOS41ODMyIDQzIDM3Ljk3MjEgNDNDMzYuNzQ3NyA0MyAzNS43NDg4IDQyLjY1OTkgMzQuOTk1OCA0MS45NjkzVjQyLjcyNDdIMzIuNDAyOVYyOFpNMzcuNTQyOCAzNC4wOTI0QzM2Ljg1NDkgMzQuMDkyNCAzNi4zMDE0IDM0LjM1NjEgMzUuODQ4NyAzNC45MDA0TDM1Ljg0NTIgMzQuOTA0NkMzNS4zMzU4IDM1LjQ4NTMgMzUuMDc3NiAzNi4yOTc2IDM1LjA3NzYgMzcuMzQ4NFYzNy41MDU3QzM1LjA3NzYgMzguNDY0IDM1LjI3NzIgMzkuMjQ0MyAzNS42OTQzIDM5LjgyNzlDMzYuMTQ0MSA0MC40NTg3IDM2Ljc3MjYgNDAuNzgxMyAzNy42MjQ1IDQwLjc4MTNDMzguNTg3NCA0MC43ODEzIDM5LjI3MDcgNDAuNDUyNyAzOS43MTUyIDM5LjgxMjdDNDAuMDcyOCAzOS4yNjg0IDQwLjI3MzcgMzguNDY3MyA0MC4yNzM3IDM3LjM4NzdDNDAuMjczNyAzNi4zMTA1IDQwLjA1MzMgMzUuNTMxMyAzOS42NzgzIDM1LjAwNzdDMzkuMjM3MSAzNC40MDcxIDM4LjUzNDIgMzQuMDkyNCAzNy41NDI4IDM0LjA5MjRaIiBmaWxsPSIjMjIyNTI5Ii8+PHBhdGggZD0iTTQ5Ljg2MTQgMzEuODczN0M0OC4xNTM1IDMxLjg3MzcgNDYuODAxNiAzMi40MjM5IDQ1LjgzNDggMzMuNTM5MkM0NC45MzcgMzQuNTQ3MiA0NC40OTY2IDM1Ljg1NiA0NC40OTY2IDM3LjQyN0M0NC40OTY2IDM5LjAzNjggNDQuOTM2NyA0MC4zNjU5IDQ1Ljg1NTkgNDEuMzk0M0M0Ni44MDMxIDQyLjQ3MDYgNDguMTM0OCA0MyA0OS44MjA1IDQzQzUxLjIyNiA0MyA1Mi4zODI2IDQyLjY1NjMgNTMuMjQ3OSA0MS45Njk3QzU0LjEzNTkgNDEuMjYxNCA1NC43MDYxIDQwLjE4ODcgNTQuOTU3MyAzOC43NzkxTDU1IDM4LjUzOTdINTIuMjQ4NEw1Mi4yMjU5IDM4LjcyMDFDNTIuMTM3OSAzOS40MjUxIDUxLjg5MjUgMzkuOTI3OCA1MS41MTA5IDQwLjI1NThDNTEuMTI5NSA0MC41ODM1IDUwLjU4MzEgNDAuNzYxNiA0OS44NDA5IDQwLjc2MTZDNDkuMDAwMSA0MC43NjE2IDQ4LjM5NDkgNDAuNDcxNSA0Ny45OTA3IDM5LjkyMzdMNDcuOTg3NCAzOS45MTk0QzQ3LjUzNTYgMzkuMzQwMSA0Ny4zMTQ0IDM4LjUwNjIgNDcuMzE0NCAzNy40MDc0QzQ3LjMxNDQgMzYuMzMyMiA0Ny41NTQ0IDM1LjUxNzcgNDguMDA1OCAzNC45NTY4TDQ4LjAwNzggMzQuOTU0M0M0OC40NTM3IDM0LjM4MjUgNDkuMDYxOCAzNC4xMTIxIDQ5Ljg2MTQgMzQuMTEyMUM1MC41MjMgMzQuMTEyMSA1MS4wNDUxIDM0LjI2MTUgNTEuNDI3MiAzNC41NDA3QzUxLjc4ODQgMzQuODE5NCA1Mi4wNTMgMzUuMjQ0NyA1Mi4xODgxIDM1Ljg1NzFMNTIuMjIzOSAzNi4wMTk0SDU0Ljk1NDhMNTQuOTE3IDM1Ljc4MzVDNTQuNzA2MyAzNC40NjYgNTQuMTUzNiAzMy40NzAxIDUzLjI2MzQgMzIuODAxOUw1My4yNjAyIDMyLjc5OTVDNTIuMzk1MSAzMi4xNzU1IDUxLjI2MjEgMzEuODczNyA0OS44NjE0IDMxLjg3MzdaIiBmaWxsPSIjMjIyNTI5Ii8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNS43NTYxIDI4LjI3NTNIMjIuNzQ0TDE3IDQyLjcyNDdIMjAuMDE0MUwyMS4zNDI5IDM5LjIwNDlIMjcuMTU3MkwyOC40ODYgNDIuNzI0N0gzMS41MDAxTDI1Ljc1NjEgMjguMjc1M1pNMjIuMjEyNSAzNi45MDc2TDI0LjI1OTYgMzEuNDUzOUwyNi4yODg1IDM2LjkwNzZIMjIuMjEyNVoiIGZpbGw9IiMyMjI1MjkiLz48L3N2Zz4="};function ia(s,t,e){if(s==="cover")return 0;if(typeof s=="string")if(s.endsWith("%")){const r=Number(s.substring(0,s.length-1))/100;return Math.ceil(r*e/t)}else return s.endsWith("rem")?Number(s.substring(0,s.length-3)):Math.ceil(Number(s)/t);else return Math.ceil(s/t)}function oa(s,t,e){return typeof s=="string"?s.endsWith("%")?Number(s.substring(0,s.length-1))/100:s.endsWith("rem")?Number(s.substring(0,s.length-3))*t/e:Number(s)/e:s/e}function Yn(s={}){const t={...sa,...s},e=Ve(t.referImage),r=[],n=[];return{name:"highlight",paths:r,update:i=>{r.length=0;const{characters:o}=i;let a;const h=[];let l;o.forEach(u=>{const c=u.computedStyle;Me(c.highlightImage)||(c.highlightSize!=="1rem"&&(l==null?void 0:l.highlightImage)===c.highlightImage&&(l==null?void 0:l.highlightSize)===c.highlightSize&&(l==null?void 0:l.highlightStrokeWidth)===c.highlightStrokeWidth&&(l==null?void 0:l.highlightOverflow)===c.highlightOverflow&&a.length&&a[0].boundingBox.top===u.boundingBox.top&&a[0].fontSize===u.fontSize?a.push(u):(a=[],a.push(u),h.push(a))),l=c}),h.filter(u=>u.length).map(u=>({style:u[0].computedStyle,box:Q.from(...u.map(c=>c.glyphBox))})).forEach(u=>{const{style:c,box:p}=u,{fontSize:g}=c,y=oa(c.highlightStrokeWidth,g,p.width),w=ia(c.highlightSize,g,p.width),d=Me(c.highlightOverflow)?w?"hidden":"visible":c.highlightOverflow,P=Pr(c.highlightImage),C=Ve(P),x=be(C),T=be(e),v={x:w?g*w*(x.width/T.width)/x.width:p.width*(x.width/T.width)/x.width,y:p.height*(x.height/T.height)/x.height},b=g/x.width*2,A=x.width*v.x,S=Math.ceil(p.width/A),_={x:(x.left-T.left)*v.x,y:(x.top-T.top)*v.y},k=new yt().translate(-x.left,-x.top).scale(v.x,v.y).translate(p.left,p.top).translate(_.x,_.y);for(let L=0;L<S;L++){const V=k.clone().translate(L*A,0);C.forEach(mt=>{const O=mt.clone().matrix(V);O.style.strokeWidth&&(O.style.strokeWidth*=b*y),O.style.strokeMiterlimit&&(O.style.strokeMiterlimit*=b),O.style.strokeDashoffset&&(O.style.strokeDashoffset*=b),O.style.strokeDasharray&&(O.style.strokeDasharray=O.style.strokeDasharray.map(N=>N*b)),r.push(O),n[r.length-1]=d==="hidden"?new Q(p.left,p.top-p.height,p.width,p.height*3):void 0})}})},renderOrder:-1,render:(i,o)=>{r.forEach((a,h)=>{Ce({ctx:i,path:a,clipRect:n[h],fontSize:o.computedStyle.fontSize})})}}}function aa(s,t,e){return s==="cover"?1:typeof s=="string"?s.endsWith("%")?Number(s.substring(0,s.length-1))/100:s.endsWith("rem")?Number(s.substring(0,s.length-3))*t/e:Number(s)/e:s/e}function Zn(){const s=[];return{name:"listStyle",paths:s,update:t=>{s.length=0;const{paragraphs:e,computedStyle:r,fontSize:n}=t;let i=r.listStyleSize,o;if(!Me(r.listStyleImage))o=r.listStyleImage;else if(!Me(r.listStyleType)){const u=n*.38/2;switch(i=i==="cover"?u*2:i,r.listStyleType){case"disc":o=`<svg width="${u*2}" height="${u*2}" xmlns="http://www.w3.org/2000/svg">
|
|
5
5
|
<circle cx="${u}" cy="${u}" r="${u}" fill="${r.color}" />
|
|
6
|
-
</svg>`;break}}if(!o)return;const a=n*.45,h=Ve(o),l=be(h);e.forEach(u=>{var p,g;const c=(g=(p=u.fragments[0])==null?void 0:p.characters[0])==null?void 0:g.getGlyphBoundingBox();if(c){const y=aa(i,r.fontSize,c.height),w=c.height/l.height*y,d=new yt;d.translate(-l.left-l.width,-l.top),d.scale(w,w),d.translate(0,c.height/2-l.height*w/2),d.translate(c.left-a,c.top),s.push(...h.map(P=>P.clone().matrix(d)))}})}
|
|
6
|
+
</svg>`;break}}if(!o)return;const a=n*.45,h=Ve(o),l=be(h);e.forEach(u=>{var p,g;const c=(g=(p=u.fragments[0])==null?void 0:p.characters[0])==null?void 0:g.getGlyphBoundingBox();if(c){const y=aa(i,r.fontSize,c.height),w=c.height/l.height*y,d=new yt;d.translate(-l.left-l.width,-l.top),d.scale(w,w),d.translate(0,c.height/2-l.height*w/2),d.translate(c.left-a,c.top),s.push(...h.map(P=>P.clone().matrix(d)))}})}}}const Tr={writingMode:"horizontal-tb",verticalAlign:"baseline",lineHeight:1,letterSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"_fallback",fontStyle:"normal",fontKerning:"normal",textWrap:"wrap",textAlign:"start",textTransform:"none",textOrientation:"mixed",color:"#000",backgroundColor:"rgba(0, 0, 0, 0)",textDecoration:"none",textStrokeWidth:0,textStrokeColor:"#000",shadowColor:"rgba(0, 0, 0, 0)",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,listStyleType:"none",listStyleImage:"none",listStyleSize:"cover",listStylePosition:"outside",highlightImage:"none",highlightSize:"cover",highlightStrokeWidth:"100%",highlightOverflow:"none"};class la{constructor(t={}){z(this,"content");z(this,"style");z(this,"effects");z(this,"measureDom");z(this,"needsUpdate",!0);z(this,"computedStyle",{...Tr});z(this,"paragraphs",[]);z(this,"boundingBox",new Q);z(this,"renderBoundingBox",new Q);z(this,"parser",new Qn(this));z(this,"measurer",new Hn(this));z(this,"plugins",new Map);const{content:e="",style:r={},measureDom:n,effects:i}=t;this.content=e,this.style=r,this.measureDom=n,this.effects=i,this.use(Xn()).use(Yn(t.highlight)).use(Zn())}get fontSize(){return this.computedStyle.fontSize}get characters(){return this.paragraphs.flatMap(t=>t.fragments.flatMap(e=>e.characters))}use(t){return this.plugins.set(t.name,t),this}measure(t=this.measureDom){this.computedStyle={...Tr,...this.style};const e=this.paragraphs;this.paragraphs=this.parser.parse();const r=this.measurer.measure(t);return this.paragraphs=e,r}requestUpdate(){return this.needsUpdate=!0,this}update(){const{paragraphs:t,boundingBox:e}=this.measure();this.paragraphs=t,this.boundingBox=e;const r=this.characters;r.forEach(a=>a.update());const n=[...this.plugins.values()];n.sort((a,h)=>(a.updateOrder??0)-(h.updateOrder??0)).forEach(a=>{var h;(h=a.update)==null||h.call(a,this)});const i=M.MAX,o=M.MIN;return r.forEach(a=>a.getGlyphMinMax(i,o)),this.renderBoundingBox=new Q(i.x,i.y,o.x-i.x,o.y-i.y),this.renderBoundingBox=Q.from(this.renderBoundingBox,...n.map(a=>a.getBoundingBox?a.getBoundingBox(this):be(a.paths??[])).filter(Boolean)),this}render(t){const{view:e,pixelRatio:r=2}=t,n=e.getContext("2d");return n?(this.needsUpdate&&this.update(),Dr(n,r,this.renderBoundingBox),Nr(n,this),[...this.plugins.values()].sort((o,a)=>(o.renderOrder??0)-(a.renderOrder??0)).forEach(o=>{var a;o.render?(a=o.render)==null||a.call(o,n,this):o.paths&&o.paths.forEach(h=>{Ce({ctx:n,path:h,fontSize:this.computedStyle.fontSize})})}),this):this}}f.BoundingBox=Q,f.Character=Wn,f.CircleCurve=Be,f.CmapSubtableFormat0=or,f.CmapSubtableFormat12=cr,f.CmapSubtableFormat14=ge,f.CmapSubtableFormat2=fe,f.CmapSubtableFormat4=hr,f.CmapSubtableFormat6=Rt,f.CubicBezierCurve=Tn,f.Curve=_t,f.CurvePath=te,f.EllipseCurve=An,f.Eot=Ns,f.Font=Oe,f.Fonts=mn,f.Fragment=qn,f.Glyph=er,f.GlyphSet=rr,f.HeartCurve=Io,f.LineCurve=Ht,f.Matrix3=yt,f.Measurer=Hn,f.Paragraph=ee,f.Parser=Qn,f.Path2D=bt,f.PloygonCurve=No,f.QuadraticBezierCurve=En,f.RectangularCurve=Ln,f.Sfnt=he,f.SplineCurve=$n,f.TableDirectory=Yt,f.Text=la,f.Ttf=st,f.Vector2=M,f.Woff=Ut,f.WoffTableDirectoryEntry=qt,f.addPathCommandsToPath2D=mr,f.componentFlags=Kt,f.createCmapSegments=lr,f.defaultTextStyles=Tr,f.definePlugin=na,f.defineSfntTable=nt,f.drawPath=Ce,f.effect=Xn,f.fillBackground=ss,f.filterEmpty=Re,f.fonts=wn,f.getPathsBoundingBox=be,f.getTransform2D=_r,f.highlight=Yn,f.isNone=Me,f.listStyle=Zn,f.minify=so,f.minifyGlyphs=vn,f.minifySfnt=bn,f.parse=gn,f.parseArcCommand=xn,f.parseColor=it,f.parsePathDataArgs=Pt,f.parseSvg=Ve,f.parseSvgToDom=Pr,f.pathCommandsToPathData=Cn,f.pathDataToPathCommands=wr,f.setCanvasContext=gr,f.setupView=Dr,f.uploadColor=Tt,f.uploadColors=Nr,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.mjs
CHANGED
|
@@ -732,18 +732,18 @@ class Parser {
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
|
|
735
|
-
function
|
|
735
|
+
function definePlugin(options) {
|
|
736
736
|
return options;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
739
|
const tempV1 = new Vector2();
|
|
740
740
|
const tempM1 = new Matrix3();
|
|
741
741
|
const tempM2 = new Matrix3();
|
|
742
|
-
function effect(
|
|
743
|
-
return
|
|
742
|
+
function effect() {
|
|
743
|
+
return definePlugin({
|
|
744
744
|
name: "effect",
|
|
745
745
|
getBoundingBox: (text) => {
|
|
746
|
-
const { characters, fontSize } = text;
|
|
746
|
+
const { characters, fontSize, effects } = text;
|
|
747
747
|
const boxes = [];
|
|
748
748
|
characters.forEach((character) => {
|
|
749
749
|
effects?.forEach((style) => {
|
|
@@ -770,7 +770,7 @@ function effect(effects) {
|
|
|
770
770
|
return boxes.length ? BoundingBox.from(...boxes) : void 0;
|
|
771
771
|
},
|
|
772
772
|
render: (ctx, text) => {
|
|
773
|
-
const { characters, renderBoundingBox } = text;
|
|
773
|
+
const { characters, renderBoundingBox, effects } = text;
|
|
774
774
|
if (effects) {
|
|
775
775
|
effects.forEach((style) => {
|
|
776
776
|
uploadColor(style, renderBoundingBox, ctx);
|
|
@@ -850,7 +850,7 @@ function highlight(options = {}) {
|
|
|
850
850
|
const referPaths = parseSvg(config.referImage);
|
|
851
851
|
const paths = [];
|
|
852
852
|
const clipRects = [];
|
|
853
|
-
return
|
|
853
|
+
return definePlugin({
|
|
854
854
|
name: "highlight",
|
|
855
855
|
paths,
|
|
856
856
|
update: (text) => {
|
|
@@ -958,9 +958,11 @@ function parseScale(size, fontSize, total) {
|
|
|
958
958
|
}
|
|
959
959
|
function listStyle() {
|
|
960
960
|
const paths = [];
|
|
961
|
-
return
|
|
961
|
+
return definePlugin({
|
|
962
962
|
name: "listStyle",
|
|
963
|
+
paths,
|
|
963
964
|
update: (text) => {
|
|
965
|
+
paths.length = 0;
|
|
964
966
|
const { paragraphs, computedStyle: style, fontSize } = text;
|
|
965
967
|
let listStyleSize = style.listStyleSize;
|
|
966
968
|
let image;
|
|
@@ -996,8 +998,7 @@ function listStyle() {
|
|
|
996
998
|
paths.push(...imagePaths.map((p) => p.clone().matrix(m)));
|
|
997
999
|
}
|
|
998
1000
|
});
|
|
999
|
-
}
|
|
1000
|
-
paths
|
|
1001
|
+
}
|
|
1001
1002
|
});
|
|
1002
1003
|
}
|
|
1003
1004
|
|
|
@@ -1051,6 +1052,7 @@ class Text {
|
|
|
1051
1052
|
constructor(options = {}) {
|
|
1052
1053
|
__publicField(this, "content");
|
|
1053
1054
|
__publicField(this, "style");
|
|
1055
|
+
__publicField(this, "effects");
|
|
1054
1056
|
__publicField(this, "measureDom");
|
|
1055
1057
|
__publicField(this, "needsUpdate", true);
|
|
1056
1058
|
__publicField(this, "computedStyle", { ...defaultTextStyles });
|
|
@@ -1060,11 +1062,12 @@ class Text {
|
|
|
1060
1062
|
__publicField(this, "parser", new Parser(this));
|
|
1061
1063
|
__publicField(this, "measurer", new Measurer(this));
|
|
1062
1064
|
__publicField(this, "plugins", /* @__PURE__ */ new Map());
|
|
1063
|
-
const { content = "", style = {}, measureDom } = options;
|
|
1065
|
+
const { content = "", style = {}, measureDom, effects } = options;
|
|
1064
1066
|
this.content = content;
|
|
1065
1067
|
this.style = style;
|
|
1066
1068
|
this.measureDom = measureDom;
|
|
1067
|
-
this.
|
|
1069
|
+
this.effects = effects;
|
|
1070
|
+
this.use(effect()).use(highlight(options.highlight)).use(listStyle());
|
|
1068
1071
|
}
|
|
1069
1072
|
get fontSize() {
|
|
1070
1073
|
return this.computedStyle.fontSize;
|
|
@@ -1142,4 +1145,4 @@ class Text {
|
|
|
1142
1145
|
}
|
|
1143
1146
|
}
|
|
1144
1147
|
|
|
1145
|
-
export { Character, Fragment, Measurer, Paragraph, Parser, Text, defaultTextStyles, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor,
|
|
1148
|
+
export { Character, Fragment, Measurer, Paragraph, Parser, Text, defaultTextStyles, definePlugin, drawPath, effect, fillBackground, filterEmpty, getTransform2D, highlight, isNone, listStyle, parseColor, setupView, uploadColor, uploadColors };
|