@mlightcad/mtext-renderer 0.12.10 → 0.12.12

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as I from "three";
2
- import { BufferGeometry as Oo, BufferAttribute as Lo, ShapePath as Qi, ShapeUtils as ea, Shape as Io, LineCurve as $n, QuadraticBezierCurve as fs, CubicBezierCurve as ps, EllipseCurve as ds } from "three";
2
+ import { BufferGeometry as Lo, BufferAttribute as Oo, ShapePath as Qi, ShapeUtils as ea, Shape as Io, LineCurve as $n, QuadraticBezierCurve as fs, CubicBezierCurve as ps, EllipseCurve as ds } from "three";
3
3
  class gs {
4
4
  constructor() {
5
5
  this.listeners = [];
@@ -321,7 +321,7 @@ function Do(t) {
321
321
  function sa(t) {
322
322
  return t instanceof ArrayBuffer || ArrayBuffer.isView(t) ? t.byteLength : 0;
323
323
  }
324
- function Le(t) {
324
+ function Oe(t) {
325
325
  if (!Number.isFinite(t) || t < 0)
326
326
  return "0 B";
327
327
  if (t < 1024)
@@ -522,7 +522,7 @@ class aa extends I.Shape {
522
522
  return this.width > 0;
523
523
  }
524
524
  }
525
- class Fe {
525
+ class Te {
526
526
  /**
527
527
  * Converts an unsigned byte to a signed byte as used in SHX format.
528
528
  * Values > 127 are converted to their signed equivalent (-128 to -1).
@@ -1005,7 +1005,7 @@ class Vo {
1005
1005
  return !1;
1006
1006
  }
1007
1007
  }
1008
- class Fn extends Vo {
1008
+ class Tn extends Vo {
1009
1009
  constructor(e = ms) {
1010
1010
  super(), this.cellWidthFactor = e;
1011
1011
  }
@@ -1027,17 +1027,17 @@ class Fn extends Vo {
1027
1027
  if (!e.polylines.some((a) => a.length >= 2))
1028
1028
  return n * r;
1029
1029
  const s = n * r, { maxX: i } = e.bbox;
1030
- return Fn.isCenterOriginGlyph(e) ? Math.max(i, n / 2) + s : i + s;
1030
+ return Tn.isCenterOriginGlyph(e) ? Math.max(i, n / 2) + s : i + s;
1031
1031
  }
1032
1032
  resolve(e, n) {
1033
1033
  var r;
1034
- return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 : Fn.computeAdvance(e, n, this.cellWidthFactor);
1034
+ return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 : Tn.computeAdvance(e, n, this.cellWidthFactor);
1035
1035
  }
1036
1036
  markAlignedAdvanceExplicit(e) {
1037
1037
  return !0;
1038
1038
  }
1039
1039
  }
1040
- const Nn = new Fn();
1040
+ const Nn = new Tn();
1041
1041
  class se {
1042
1042
  /**
1043
1043
  * Creates a new Point instance.
@@ -1271,7 +1271,7 @@ class Bt {
1271
1271
  } = i, y = ua(i), m = this.bbox;
1272
1272
  let b = y;
1273
1273
  u && qo(m) && !jo(y, m) && (b = $o(y, m));
1274
- const v = b.maxX - b.minX, w = b.maxY - b.minY, C = v * l, T = w * l, E = b.minX - C, R = b.maxX + C, P = b.minY - T, W = b.maxY + T;
1274
+ const v = b.maxX - b.minX, w = b.maxY - b.minY, C = v * l, F = w * l, E = b.minX - C, R = b.maxX + C, P = b.minY - F, W = b.maxY + F;
1275
1275
  o = c((N) => ({
1276
1276
  x: N.x,
1277
1277
  y: -N.y
@@ -1837,7 +1837,7 @@ class ac {
1837
1837
  return s;
1838
1838
  if (this.isVerticalDualBigfontMarker(e, s, "close"))
1839
1839
  return s + 1;
1840
- i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x = Fe.byteToSByte(e[s++]) * r.scale, l.y = Fe.byteToSByte(e[s++]) * r.scale, this.fontData.content.isExtended ? (c = e[s++] * r.scale, o = e[s] * r.scale) : (o = e[s] * r.scale, c = o));
1840
+ i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x = Te.byteToSByte(e[s++]) * r.scale, l.y = Te.byteToSByte(e[s++]) * r.scale, this.fontData.content.isExtended ? (c = e[s++] * r.scale, o = e[s] * r.scale) : (o = e[s] * r.scale, c = o));
1841
1841
  break;
1842
1842
  case K.UNIFONT:
1843
1843
  s++, i = e[s++] << 8 | e[s++], s--;
@@ -1877,13 +1877,13 @@ class ac {
1877
1877
  handleXYDisplacement(e, n, r) {
1878
1878
  let s = n;
1879
1879
  const i = new se();
1880
- return i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r), s;
1880
+ return i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r), s;
1881
1881
  }
1882
1882
  handleMultipleXYDisplacements(e, n, r) {
1883
1883
  let s = n;
1884
1884
  for (; !(s + 1 >= e.length); ) {
1885
1885
  const i = new se();
1886
- if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0)
1886
+ if (i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), i.x === 0 && i.y === 0)
1887
1887
  break;
1888
1888
  r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r);
1889
1889
  }
@@ -1891,14 +1891,14 @@ class ac {
1891
1891
  }
1892
1892
  handleOctantArc(e, n, r) {
1893
1893
  let s = n;
1894
- const i = e[++s] * r.scale, a = Fe.byteToSByte(e[++s]), o = (a & 112) >> 4;
1894
+ const i = e[++s] * r.scale, a = Te.byteToSByte(e[++s]), o = (a & 112) >> 4;
1895
1895
  let c = a & 7;
1896
1896
  const l = a < 0, u = Math.PI / 4 * o, f = r.currentPoint.clone().subtract(new se(Math.cos(u) * i, Math.sin(u) * i)), h = Zt.fromOctant(f, i, o, c, l).tessellate();
1897
1897
  return r.isPenDown && (r.currentPolyline.pop(), r.currentPolyline.push(...h.slice())), r.currentPoint = h[h.length - 1].clone(), s;
1898
1898
  }
1899
1899
  handleFractionalArc(e, n, r) {
1900
1900
  let s = n;
1901
- const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u = Fe.byteToSByte(e[++s]), f = (u & 112) >> 4;
1901
+ const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u = Te.byteToSByte(e[++s]), f = (u & 112) >> 4;
1902
1902
  let h = u & 7;
1903
1903
  h === 0 && (h = 8), a !== 0 && h--;
1904
1904
  const p = Math.PI / 4;
@@ -1908,19 +1908,19 @@ class ac {
1908
1908
  v += p * i / 256 * b, w += p * a / 256 * b;
1909
1909
  const C = r.currentPoint.clone().subtract(new se(l * Math.cos(v), l * Math.sin(v)));
1910
1910
  if (r.currentPoint = C.clone().add(new se(l * Math.cos(w), l * Math.sin(w))), r.isPenDown) {
1911
- let T = v;
1911
+ let F = v;
1912
1912
  const E = [];
1913
1913
  if (E.push(
1914
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1914
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1915
1915
  ), m > 0)
1916
- for (; T + m < w; )
1917
- T += m, E.push(
1918
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1916
+ for (; F + m < w; )
1917
+ F += m, E.push(
1918
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1919
1919
  );
1920
1920
  else
1921
- for (; T + m > w; )
1922
- T += m, E.push(
1923
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1921
+ for (; F + m > w; )
1922
+ F += m, E.push(
1923
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1924
1924
  );
1925
1925
  E.push(C.clone().add(new se(l * Math.cos(w), l * Math.sin(w)))), r.currentPolyline.push(...E);
1926
1926
  }
@@ -1929,8 +1929,8 @@ class ac {
1929
1929
  handleBulgeArc(e, n, r) {
1930
1930
  let s = n;
1931
1931
  const i = new se();
1932
- i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]);
1933
- const a = Fe.byteToSByte(e[++s]);
1932
+ i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]);
1933
+ const a = Te.byteToSByte(e[++s]);
1934
1934
  return r.currentPoint = this.handleArcSegment(
1935
1935
  r.currentPoint,
1936
1936
  i,
@@ -1944,9 +1944,9 @@ class ac {
1944
1944
  let s = n;
1945
1945
  for (; !(s + 1 >= e.length); ) {
1946
1946
  const i = new se();
1947
- if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0 || s + 1 >= e.length)
1947
+ if (i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), i.x === 0 && i.y === 0 || s + 1 >= e.length)
1948
1948
  break;
1949
- const a = Fe.byteToSByte(e[++s]);
1949
+ const a = Te.byteToSByte(e[++s]);
1950
1950
  r.currentPoint = this.handleArcSegment(
1951
1951
  r.currentPoint,
1952
1952
  i,
@@ -2078,7 +2078,7 @@ class oc {
2078
2078
  */
2079
2079
  constructor(e) {
2080
2080
  if (e instanceof ArrayBuffer) {
2081
- const n = new Fe(e), r = new Po().parse(n), s = Wo.createParser(r.fontType).parse(n);
2081
+ const n = new Te(e), r = new Po().parse(n), s = Wo.createParser(r.fontType).parse(n);
2082
2082
  this.fontData = {
2083
2083
  header: r,
2084
2084
  content: s
@@ -2245,13 +2245,13 @@ function uc() {
2245
2245
  IDBCursor.prototype.continuePrimaryKey
2246
2246
  ]);
2247
2247
  }
2248
- const Tr = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap();
2248
+ const Fr = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap();
2249
2249
  function hc(t) {
2250
2250
  const e = new Promise((n, r) => {
2251
2251
  const s = () => {
2252
2252
  t.removeEventListener("success", i), t.removeEventListener("error", a);
2253
2253
  }, i = () => {
2254
- n(Tt(t.result)), s();
2254
+ n(Ft(t.result)), s();
2255
2255
  }, a = () => {
2256
2256
  r(t.error), s();
2257
2257
  };
@@ -2260,7 +2260,7 @@ function hc(t) {
2260
2260
  return Hn.set(e, t), e;
2261
2261
  }
2262
2262
  function fc(t) {
2263
- if (Tr.has(t))
2263
+ if (Fr.has(t))
2264
2264
  return;
2265
2265
  const e = new Promise((n, r) => {
2266
2266
  const s = () => {
@@ -2272,17 +2272,17 @@ function fc(t) {
2272
2272
  };
2273
2273
  t.addEventListener("complete", i), t.addEventListener("error", a), t.addEventListener("abort", a);
2274
2274
  });
2275
- Tr.set(t, e);
2275
+ Fr.set(t, e);
2276
2276
  }
2277
- let Fr = {
2277
+ let Tr = {
2278
2278
  get(t, e, n) {
2279
2279
  if (t instanceof IDBTransaction) {
2280
2280
  if (e === "done")
2281
- return Tr.get(t);
2281
+ return Fr.get(t);
2282
2282
  if (e === "store")
2283
2283
  return n.objectStoreNames[1] ? void 0 : n.objectStore(n.objectStoreNames[0]);
2284
2284
  }
2285
- return Tt(t[e]);
2285
+ return Ft(t[e]);
2286
2286
  },
2287
2287
  set(t, e, n) {
2288
2288
  return t[e] = n, !0;
@@ -2292,19 +2292,19 @@ let Fr = {
2292
2292
  }
2293
2293
  };
2294
2294
  function fa(t) {
2295
- Fr = t(Fr);
2295
+ Tr = t(Tr);
2296
2296
  }
2297
2297
  function pc(t) {
2298
2298
  return uc().includes(t) ? function(...e) {
2299
- return t.apply(kr(this), e), Tt(this.request);
2299
+ return t.apply(kr(this), e), Ft(this.request);
2300
2300
  } : function(...e) {
2301
- return Tt(t.apply(kr(this), e));
2301
+ return Ft(t.apply(kr(this), e));
2302
2302
  };
2303
2303
  }
2304
2304
  function dc(t) {
2305
- return typeof t == "function" ? pc(t) : (t instanceof IDBTransaction && fc(t), Cr(t, lc()) ? new Proxy(t, Fr) : t);
2305
+ return typeof t == "function" ? pc(t) : (t instanceof IDBTransaction && fc(t), Cr(t, lc()) ? new Proxy(t, Tr) : t);
2306
2306
  }
2307
- function Tt(t) {
2307
+ function Ft(t) {
2308
2308
  if (t instanceof IDBRequest)
2309
2309
  return hc(t);
2310
2310
  if (Yn.has(t))
@@ -2314,9 +2314,9 @@ function Tt(t) {
2314
2314
  }
2315
2315
  const kr = (t) => Hn.get(t);
2316
2316
  function gc(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
2317
- const a = indexedDB.open(t, e), o = Tt(a);
2317
+ const a = indexedDB.open(t, e), o = Ft(a);
2318
2318
  return r && a.addEventListener("upgradeneeded", (c) => {
2319
- r(Tt(a.result), c.oldVersion, c.newVersion, Tt(a.transaction), c);
2319
+ r(Ft(a.result), c.oldVersion, c.newVersion, Ft(a.transaction), c);
2320
2320
  }), n && a.addEventListener("blocked", (c) => n(
2321
2321
  // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
2322
2322
  c.oldVersion,
@@ -2354,12 +2354,12 @@ fa((t) => ({
2354
2354
  get: (e, n, r) => Cs(e, n) || t.get(e, n, r),
2355
2355
  has: (e, n) => !!Cs(e, n) || t.has(e, n)
2356
2356
  }));
2357
- const bc = ["continue", "continuePrimaryKey", "advance"], Ts = {}, Er = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), xc = {
2357
+ const bc = ["continue", "continuePrimaryKey", "advance"], Fs = {}, Er = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), xc = {
2358
2358
  get(t, e) {
2359
2359
  if (!bc.includes(e))
2360
2360
  return t[e];
2361
- let n = Ts[e];
2362
- return n || (n = Ts[e] = function(...r) {
2361
+ let n = Fs[e];
2362
+ return n || (n = Fs[e] = function(...r) {
2363
2363
  Er.set(this, pa.get(this)[e](...r));
2364
2364
  }), n;
2365
2365
  }
@@ -2373,16 +2373,16 @@ async function* vc(...t) {
2373
2373
  for (pa.set(n, e), Hn.set(n, kr(e)); e; )
2374
2374
  yield n, e = await (Er.get(n) || e.continue()), Er.delete(n);
2375
2375
  }
2376
- function Fs(t, e) {
2376
+ function Ts(t, e) {
2377
2377
  return e === Symbol.asyncIterator && Cr(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Cr(t, [IDBIndex, IDBObjectStore]);
2378
2378
  }
2379
2379
  fa((t) => ({
2380
2380
  ...t,
2381
2381
  get(e, n, r) {
2382
- return Fs(e, n) ? vc : t.get(e, n, r);
2382
+ return Ts(e, n) ? vc : t.get(e, n, r);
2383
2383
  },
2384
2384
  has(e, n) {
2385
- return Fs(e, n) || t.has(e, n);
2385
+ return Ts(e, n) || t.has(e, n);
2386
2386
  }
2387
2387
  }));
2388
2388
  const St = {
@@ -2560,12 +2560,12 @@ const St = {
2560
2560
  }
2561
2561
  };
2562
2562
  Be.DATABASE_NAME = "mlightcad", Be.DATABASE_VERSION = Kn[Kn.length - 1].version;
2563
- let ze = Be;
2563
+ let Ue = Be;
2564
2564
  const Sc = 512;
2565
2565
  function wc(t, e) {
2566
2566
  return (t + e) * Sc;
2567
2567
  }
2568
- const Cc = 2.5, Tc = 1.5;
2568
+ const Cc = 2.5, Fc = 1.5;
2569
2569
  function da() {
2570
2570
  return {
2571
2571
  meshCount: 0,
@@ -2578,6 +2578,8 @@ const Ar = {
2578
2578
  r12r14: ["txt", "simplex", "romans", "gbcbig", "simsun"],
2579
2579
  // Mesh/TTF first so missing style fonts (e.g. "标准") get correct Latin metrics.
2580
2580
  // BIGFONT SHX stays available via glyph fallback for CJK coverage.
2581
+ // Korean/Japanese faces are not in this preset — load on demand via style
2582
+ // names (e.g. `malgun`) or switch to the `korean` / `cjk` presets.
2581
2583
  modern: ["simsun", "hztxt"],
2582
2584
  international: ["txt", "simplex", "romans", "simsun"],
2583
2585
  // Full CJK: mesh faces for CN/KR/JP, then matching SHX big fonts.
@@ -2613,7 +2615,7 @@ var Wr = 0, ga = -3;
2613
2615
  function Jt() {
2614
2616
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
2615
2617
  }
2616
- function Fc(t, e) {
2618
+ function Tc(t, e) {
2617
2619
  this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Jt(), this.dtree = new Jt();
2618
2620
  }
2619
2621
  var ma = new Jt(), ya = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(30), ba = new Uint8Array(30), xa = new Uint16Array(30), kc = new Uint8Array([
@@ -2677,7 +2679,7 @@ function Xe(t, e, n) {
2677
2679
  var r = t.tag & 65535 >>> 16 - e;
2678
2680
  return t.tag >>>= e, t.bitcount -= e, r + n;
2679
2681
  }
2680
- function Or(t, e) {
2682
+ function Lr(t, e) {
2681
2683
  for (; t.bitcount < 24; )
2682
2684
  t.tag |= t.source[t.sourceIndex++] << t.bitcount, t.bitcount += 8;
2683
2685
  var n = 0, r = 0, s = 0, i = t.tag;
@@ -2686,7 +2688,7 @@ function Or(t, e) {
2686
2688
  while (r >= 0);
2687
2689
  return t.tag = i, t.bitcount -= s, e.trans[n + r];
2688
2690
  }
2689
- function Oc(t, e, n) {
2691
+ function Lc(t, e, n) {
2690
2692
  var r, s, i, a, o, c;
2691
2693
  for (r = Xe(t, 5, 257), s = Xe(t, 5, 1), i = Xe(t, 4, 4), a = 0; a < 19; ++a) $e[a] = 0;
2692
2694
  for (a = 0; a < i; ++a) {
@@ -2694,7 +2696,7 @@ function Oc(t, e, n) {
2694
2696
  $e[kc[a]] = l;
2695
2697
  }
2696
2698
  for (Jn(Es, $e, 0, 19), o = 0; o < r + s; ) {
2697
- var u = Or(t, Es);
2699
+ var u = Lr(t, Es);
2698
2700
  switch (u) {
2699
2701
  case 16:
2700
2702
  var f = $e[o - 1];
@@ -2716,21 +2718,21 @@ function Oc(t, e, n) {
2716
2718
  }
2717
2719
  Jn(e, $e, 0, r), Jn(n, $e, r, s);
2718
2720
  }
2719
- function Os(t, e, n) {
2721
+ function Ls(t, e, n) {
2720
2722
  for (; ; ) {
2721
- var r = Or(t, e);
2723
+ var r = Lr(t, e);
2722
2724
  if (r === 256)
2723
2725
  return Wr;
2724
2726
  if (r < 256)
2725
2727
  t.dest[t.destLen++] = r;
2726
2728
  else {
2727
2729
  var s, i, a, o;
2728
- for (r -= 257, s = Xe(t, Vr[r], qr[r]), i = Or(t, n), a = t.destLen - Xe(t, ba[i], xa[i]), o = a; o < a + s; ++o)
2730
+ for (r -= 257, s = Xe(t, Vr[r], qr[r]), i = Lr(t, n), a = t.destLen - Xe(t, ba[i], xa[i]), o = a; o < a + s; ++o)
2729
2731
  t.dest[t.destLen++] = t.dest[o];
2730
2732
  }
2731
2733
  }
2732
2734
  }
2733
- function Lc(t) {
2735
+ function Oc(t) {
2734
2736
  for (var e, n, r; t.bitcount > 8; )
2735
2737
  t.sourceIndex--, t.bitcount -= 8;
2736
2738
  if (e = t.source[t.sourceIndex + 1], e = 256 * e + t.source[t.sourceIndex], n = t.source[t.sourceIndex + 3], n = 256 * n + t.source[t.sourceIndex + 2], e !== (~n & 65535))
@@ -2740,17 +2742,17 @@ function Lc(t) {
2740
2742
  return t.bitcount = 0, Wr;
2741
2743
  }
2742
2744
  function Sa(t, e) {
2743
- var n = new Fc(t, e), r, s, i;
2745
+ var n = new Tc(t, e), r, s, i;
2744
2746
  do {
2745
2747
  switch (r = Ac(n), s = Xe(n, 2, 0), s) {
2746
2748
  case 0:
2747
- i = Lc(n);
2749
+ i = Oc(n);
2748
2750
  break;
2749
2751
  case 1:
2750
- i = Os(n, ma, ya);
2752
+ i = Ls(n, ma, ya);
2751
2753
  break;
2752
2754
  case 2:
2753
- Oc(n, n.ltree, n.dtree), i = Os(n, n.ltree, n.dtree);
2755
+ Lc(n, n.ltree, n.dtree), i = Ls(n, n.ltree, n.dtree);
2754
2756
  break;
2755
2757
  default:
2756
2758
  i = ga;
@@ -2765,7 +2767,7 @@ va(Vr, qr, 4, 3);
2765
2767
  va(ba, xa, 2, 1);
2766
2768
  Vr[28] = 0;
2767
2769
  qr[28] = 258;
2768
- function Ot(t, e, n, r, s) {
2770
+ function Lt(t, e, n, r, s) {
2769
2771
  return Math.pow(1 - s, 3) * t + 3 * Math.pow(1 - s, 2) * s * e + 3 * (1 - s) * Math.pow(s, 2) * n + Math.pow(s, 3) * r;
2770
2772
  }
2771
2773
  function kt() {
@@ -2791,15 +2793,15 @@ kt.prototype.addBezier = function(t, e, n, r, s, i, a, o) {
2791
2793
  if (y === 0) {
2792
2794
  if (p === 0) continue;
2793
2795
  const C = -m / p;
2794
- 0 < C && C < 1 && (h === 0 && this.addX(Ot(c[h], l[h], u[h], f[h], C)), h === 1 && this.addY(Ot(c[h], l[h], u[h], f[h], C)));
2796
+ 0 < C && C < 1 && (h === 0 && this.addX(Lt(c[h], l[h], u[h], f[h], C)), h === 1 && this.addY(Lt(c[h], l[h], u[h], f[h], C)));
2795
2797
  continue;
2796
2798
  }
2797
2799
  const b = Math.pow(p, 2) - 4 * m * y;
2798
2800
  if (b < 0) continue;
2799
2801
  const v = (-p + Math.sqrt(b)) / (2 * y);
2800
- 0 < v && v < 1 && (h === 0 && this.addX(Ot(c[h], l[h], u[h], f[h], v)), h === 1 && this.addY(Ot(c[h], l[h], u[h], f[h], v)));
2802
+ 0 < v && v < 1 && (h === 0 && this.addX(Lt(c[h], l[h], u[h], f[h], v)), h === 1 && this.addY(Lt(c[h], l[h], u[h], f[h], v)));
2801
2803
  const w = (-p - Math.sqrt(b)) / (2 * y);
2802
- 0 < w && w < 1 && (h === 0 && this.addX(Ot(c[h], l[h], u[h], f[h], w)), h === 1 && this.addY(Ot(c[h], l[h], u[h], f[h], w)));
2804
+ 0 < w && w < 1 && (h === 0 && this.addX(Lt(c[h], l[h], u[h], f[h], w)), h === 1 && this.addY(Lt(c[h], l[h], u[h], f[h], w)));
2803
2805
  }
2804
2806
  };
2805
2807
  kt.prototype.addQuad = function(t, e, n, r, s, i) {
@@ -2820,7 +2822,7 @@ function Ca(t, e) {
2820
2822
  const s = +(Math.round(r + "e+" + e) + "e-" + e);
2821
2823
  return Vt[e][r] = s, n + s;
2822
2824
  }
2823
- function Ta(t) {
2825
+ function Fa(t) {
2824
2826
  let e = [[]], n = 0, r = 0;
2825
2827
  for (let s = 0; s < t.length; s += 1) {
2826
2828
  const i = e[e.length - 1], a = t[s], o = i[0], c = i[1], l = i[i.length - 1], u = t[s + 1];
@@ -2883,14 +2885,14 @@ de.prototype.fromSVG = function(t, e = {}) {
2883
2885
  break;
2884
2886
  case "V":
2885
2887
  for (let C = 0; C < b.length; C++) {
2886
- let T = 0;
2887
- m && (T = this.commands.length && this.commands[this.commands.length - 1].y || 0), this.lineTo(v, b[C] + T);
2888
+ let F = 0;
2889
+ m && (F = this.commands.length && this.commands[this.commands.length - 1].y || 0), this.lineTo(v, b[C] + F);
2888
2890
  }
2889
2891
  break;
2890
2892
  case "H":
2891
2893
  for (let C = 0; C < b.length; C++) {
2892
- let T = 0;
2893
- m && (T = this.commands.length && this.commands[this.commands.length - 1].x || 0), this.lineTo(b[C] + T, w);
2894
+ let F = 0;
2895
+ m && (F = this.commands.length && this.commands[this.commands.length - 1].x || 0), this.lineTo(b[C] + F, w);
2894
2896
  }
2895
2897
  break;
2896
2898
  case "C":
@@ -2929,7 +2931,7 @@ de.prototype.fromSVG = function(t, e = {}) {
2929
2931
  if (c)
2930
2932
  throw new Error("Unexpected character: " + m + " at offset " + y);
2931
2933
  }
2932
- f.apply(this), e.optimize && (this.commands = Ta(this.commands));
2934
+ f.apply(this), e.optimize && (this.commands = Fa(this.commands));
2933
2935
  const h = e.flipY;
2934
2936
  let p = e.flipYBase;
2935
2937
  if (h === !0 && e.flipYBase === void 0) {
@@ -3056,7 +3058,7 @@ de.prototype.toPathData = function(t) {
3056
3058
  return o;
3057
3059
  }
3058
3060
  let r = this.commands;
3059
- t.optimize && (r = JSON.parse(JSON.stringify(this.commands)), r = Ta(r));
3061
+ t.optimize && (r = JSON.parse(JSON.stringify(this.commands)), r = Fa(r));
3060
3062
  const s = t.flipY;
3061
3063
  let i = t.flipYBase;
3062
3064
  if (s === !0 && i === void 0) {
@@ -3101,13 +3103,13 @@ de.prototype.toDOMElement = function(t, e) {
3101
3103
  return n.setAttribute("d", e), this.fill !== void 0 && this.fill !== "black" && (this.fill === null ? n.setAttribute("fill", "none") : n.setAttribute("fill", this.fill)), this.stroke && (n.setAttribute("stroke", this.stroke), n.setAttribute("stroke-width", this.strokeWidth)), n;
3102
3104
  };
3103
3105
  var Pt = de;
3104
- function Fa(t) {
3106
+ function Ta(t) {
3105
3107
  throw new Error(t);
3106
3108
  }
3107
- function Ls(t, e) {
3108
- t || Fa(e);
3109
+ function Os(t, e) {
3110
+ t || Ta(e);
3109
3111
  }
3110
- var H = { fail: Fa, argument: Ls, assert: Ls }, Is = 32768, Rs = 2147483648, Bc = -32768, Mc = 32767 + 1 / 65536, Nt = {}, B = {}, z = {};
3112
+ var H = { fail: Ta, argument: Os, assert: Os }, Is = 32768, Rs = 2147483648, Bc = -32768, Mc = 32767 + 1 / 65536, Nt = {}, B = {}, z = {};
3111
3113
  function je(t) {
3112
3114
  return function() {
3113
3115
  return t;
@@ -3343,7 +3345,7 @@ z.MACSTRING = function(t, e) {
3343
3345
  const n = B.MACSTRING(t, e);
3344
3346
  return n !== void 0 ? n.length : 0;
3345
3347
  };
3346
- function Lr(t) {
3348
+ function Or(t) {
3347
3349
  return t >= -128 && t <= 127;
3348
3350
  }
3349
3351
  function _c(t, e, n) {
@@ -3359,7 +3361,7 @@ function Uc(t, e, n) {
3359
3361
  let i = e;
3360
3362
  for (; i < s && r < 64; ) {
3361
3363
  const a = t[i];
3362
- if (!Lr(a) || a === 0 && i + 1 < s && t[i + 1] === 0)
3364
+ if (!Or(a) || a === 0 && i + 1 < s && t[i + 1] === 0)
3363
3365
  break;
3364
3366
  ++i, ++r;
3365
3367
  }
@@ -3374,7 +3376,7 @@ function Pc(t, e, n) {
3374
3376
  let i = e;
3375
3377
  for (; i < s && r < 64; ) {
3376
3378
  const a = t[i];
3377
- if (a === 0 || Lr(a) && i + 1 < s && Lr(t[i + 1]))
3379
+ if (a === 0 || Or(a) && i + 1 < s && Or(t[i + 1]))
3378
3380
  break;
3379
3381
  ++i, ++r;
3380
3382
  }
@@ -3628,7 +3630,7 @@ function An(t) {
3628
3630
  }
3629
3631
  An.prototype = Object.create(fe.prototype);
3630
3632
  An.prototype.constructor = An;
3631
- function On(t) {
3633
+ function Ln(t) {
3632
3634
  fe.call(
3633
3635
  this,
3634
3636
  "featureListTable",
@@ -3643,9 +3645,9 @@ function On(t) {
3643
3645
  })
3644
3646
  );
3645
3647
  }
3646
- On.prototype = Object.create(fe.prototype);
3647
- On.prototype.constructor = On;
3648
- function Ln(t, e) {
3648
+ Ln.prototype = Object.create(fe.prototype);
3649
+ Ln.prototype.constructor = Ln;
3650
+ function On(t, e) {
3649
3651
  fe.call(this, "lookupListTable", Ir("lookup", t, function(n) {
3650
3652
  let r = e[n.lookupType];
3651
3653
  return H.assert(!!r, "Unable to write GSUB lookup type " + n.lookupType + " tables."), new fe("lookupTable", [
@@ -3654,8 +3656,8 @@ function Ln(t, e) {
3654
3656
  ].concat(Ir("subtable", n.subtables, r)));
3655
3657
  }));
3656
3658
  }
3657
- Ln.prototype = Object.create(fe.prototype);
3658
- Ln.prototype.constructor = Ln;
3659
+ On.prototype = Object.create(fe.prototype);
3660
+ On.prototype.constructor = On;
3659
3661
  function In(t) {
3660
3662
  t.format === 1 ? fe.call(
3661
3663
  this,
@@ -3678,14 +3680,14 @@ function In(t) {
3678
3680
  }
3679
3681
  In.prototype = Object.create(fe.prototype);
3680
3682
  In.prototype.constructor = In;
3681
- var O = {
3683
+ var L = {
3682
3684
  Table: fe,
3683
3685
  Record: fe,
3684
3686
  Coverage: En,
3685
3687
  ClassDef: In,
3686
3688
  ScriptList: An,
3687
- FeatureList: On,
3688
- LookupList: Ln,
3689
+ FeatureList: Ln,
3690
+ LookupList: On,
3689
3691
  ushortList: Gt,
3690
3692
  tableList: Ir,
3691
3693
  recordList: Ht
@@ -3763,51 +3765,51 @@ var qc = {
3763
3765
  INNER_INDEX_BIT_COUNT_MASK: 15,
3764
3766
  MAP_ENTRY_SIZE_MASK: 48
3765
3767
  };
3766
- function F(t, e) {
3768
+ function T(t, e) {
3767
3769
  this.data = t, this.offset = e, this.relativeOffset = 0;
3768
3770
  }
3769
- F.prototype.parseByte = function() {
3771
+ T.prototype.parseByte = function() {
3770
3772
  const t = this.data.getUint8(this.offset + this.relativeOffset);
3771
3773
  return this.relativeOffset += 1, t;
3772
3774
  };
3773
- F.prototype.parseChar = function() {
3775
+ T.prototype.parseChar = function() {
3774
3776
  const t = this.data.getInt8(this.offset + this.relativeOffset);
3775
3777
  return this.relativeOffset += 1, t;
3776
3778
  };
3777
- F.prototype.parseCard8 = F.prototype.parseByte;
3778
- F.prototype.parseUShort = function() {
3779
+ T.prototype.parseCard8 = T.prototype.parseByte;
3780
+ T.prototype.parseUShort = function() {
3779
3781
  const t = this.data.getUint16(this.offset + this.relativeOffset);
3780
3782
  return this.relativeOffset += 2, t;
3781
3783
  };
3782
- F.prototype.parseCard16 = F.prototype.parseUShort;
3783
- F.prototype.parseSID = F.prototype.parseUShort;
3784
- F.prototype.parseOffset16 = F.prototype.parseUShort;
3785
- F.prototype.parseShort = function() {
3784
+ T.prototype.parseCard16 = T.prototype.parseUShort;
3785
+ T.prototype.parseSID = T.prototype.parseUShort;
3786
+ T.prototype.parseOffset16 = T.prototype.parseUShort;
3787
+ T.prototype.parseShort = function() {
3786
3788
  const t = this.data.getInt16(this.offset + this.relativeOffset);
3787
3789
  return this.relativeOffset += 2, t;
3788
3790
  };
3789
- F.prototype.parseF2Dot14 = function() {
3791
+ T.prototype.parseF2Dot14 = function() {
3790
3792
  const t = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
3791
3793
  return this.relativeOffset += 2, t;
3792
3794
  };
3793
- F.prototype.parseUInt24 = function() {
3795
+ T.prototype.parseUInt24 = function() {
3794
3796
  const t = ka(this.data, this.offset + this.relativeOffset);
3795
3797
  return this.relativeOffset += 3, t;
3796
3798
  };
3797
- F.prototype.parseULong = function() {
3799
+ T.prototype.parseULong = function() {
3798
3800
  const t = jr(this.data, this.offset + this.relativeOffset);
3799
3801
  return this.relativeOffset += 4, t;
3800
3802
  };
3801
- F.prototype.parseLong = function() {
3803
+ T.prototype.parseLong = function() {
3802
3804
  const t = Gc(this.data, this.offset + this.relativeOffset);
3803
3805
  return this.relativeOffset += 4, t;
3804
3806
  };
3805
- F.prototype.parseOffset32 = F.prototype.parseULong;
3806
- F.prototype.parseFixed = function() {
3807
+ T.prototype.parseOffset32 = T.prototype.parseULong;
3808
+ T.prototype.parseFixed = function() {
3807
3809
  const t = Ea(this.data, this.offset + this.relativeOffset);
3808
3810
  return this.relativeOffset += 4, t;
3809
3811
  };
3810
- F.prototype.parseString = function(t) {
3812
+ T.prototype.parseString = function(t) {
3811
3813
  const e = this.data, n = this.offset + this.relativeOffset;
3812
3814
  let r = "";
3813
3815
  this.relativeOffset += t;
@@ -3815,21 +3817,21 @@ F.prototype.parseString = function(t) {
3815
3817
  r += String.fromCharCode(e.getUint8(n + s));
3816
3818
  return r;
3817
3819
  };
3818
- F.prototype.parseTag = function() {
3820
+ T.prototype.parseTag = function() {
3819
3821
  return this.parseString(4);
3820
3822
  };
3821
- F.prototype.parseLongDateTime = function() {
3823
+ T.prototype.parseLongDateTime = function() {
3822
3824
  let t = jr(this.data, this.offset + this.relativeOffset + 4);
3823
3825
  return t -= 2082844800, this.relativeOffset += 8, t;
3824
3826
  };
3825
- F.prototype.parseVersion = function(t) {
3827
+ T.prototype.parseVersion = function(t) {
3826
3828
  const e = Rn(this.data, this.offset + this.relativeOffset), n = Rn(this.data, this.offset + this.relativeOffset + 2);
3827
3829
  return this.relativeOffset += 4, t === void 0 && (t = 4096), e + n / t / 10;
3828
3830
  };
3829
- F.prototype.skip = function(t, e) {
3831
+ T.prototype.skip = function(t, e) {
3830
3832
  e === void 0 && (e = 1), this.relativeOffset += qc[t] * e;
3831
3833
  };
3832
- F.prototype.parseULongList = function(t) {
3834
+ T.prototype.parseULongList = function(t) {
3833
3835
  t === void 0 && (t = this.parseULong());
3834
3836
  const e = new Array(t), n = this.data;
3835
3837
  let r = this.offset + this.relativeOffset;
@@ -3837,7 +3839,7 @@ F.prototype.parseULongList = function(t) {
3837
3839
  e[s] = n.getUint32(r), r += 4;
3838
3840
  return this.relativeOffset += t * 4, e;
3839
3841
  };
3840
- F.prototype.parseOffset16List = F.prototype.parseUShortList = function(t) {
3842
+ T.prototype.parseOffset16List = T.prototype.parseUShortList = function(t) {
3841
3843
  t === void 0 && (t = this.parseUShort());
3842
3844
  const e = new Array(t), n = this.data;
3843
3845
  let r = this.offset + this.relativeOffset;
@@ -3845,35 +3847,35 @@ F.prototype.parseOffset16List = F.prototype.parseUShortList = function(t) {
3845
3847
  e[s] = n.getUint16(r), r += 2;
3846
3848
  return this.relativeOffset += t * 2, e;
3847
3849
  };
3848
- F.prototype.parseShortList = function(t) {
3850
+ T.prototype.parseShortList = function(t) {
3849
3851
  const e = new Array(t), n = this.data;
3850
3852
  let r = this.offset + this.relativeOffset;
3851
3853
  for (let s = 0; s < t; s++)
3852
3854
  e[s] = n.getInt16(r), r += 2;
3853
3855
  return this.relativeOffset += t * 2, e;
3854
3856
  };
3855
- F.prototype.parseByteList = function(t) {
3857
+ T.prototype.parseByteList = function(t) {
3856
3858
  const e = new Array(t), n = this.data;
3857
3859
  let r = this.offset + this.relativeOffset;
3858
3860
  for (let s = 0; s < t; s++)
3859
3861
  e[s] = n.getUint8(r++);
3860
3862
  return this.relativeOffset += t, e;
3861
3863
  };
3862
- F.prototype.parseList = function(t, e) {
3864
+ T.prototype.parseList = function(t, e) {
3863
3865
  e || (e = t, t = this.parseUShort());
3864
3866
  const n = new Array(t);
3865
3867
  for (let r = 0; r < t; r++)
3866
3868
  n[r] = e.call(this);
3867
3869
  return n;
3868
3870
  };
3869
- F.prototype.parseList32 = function(t, e) {
3871
+ T.prototype.parseList32 = function(t, e) {
3870
3872
  e || (e = t, t = this.parseULong());
3871
3873
  const n = new Array(t);
3872
3874
  for (let r = 0; r < t; r++)
3873
3875
  n[r] = e.call(this);
3874
3876
  return n;
3875
3877
  };
3876
- F.prototype.parseRecordList = function(t, e) {
3878
+ T.prototype.parseRecordList = function(t, e) {
3877
3879
  e || (e = t, t = this.parseUShort());
3878
3880
  const n = new Array(t), r = Object.keys(e);
3879
3881
  for (let s = 0; s < t; s++) {
@@ -3886,7 +3888,7 @@ F.prototype.parseRecordList = function(t, e) {
3886
3888
  }
3887
3889
  return n;
3888
3890
  };
3889
- F.prototype.parseRecordList32 = function(t, e) {
3891
+ T.prototype.parseRecordList32 = function(t, e) {
3890
3892
  e || (e = t, t = this.parseULong());
3891
3893
  const n = new Array(t), r = Object.keys(e);
3892
3894
  for (let s = 0; s < t; s++) {
@@ -3899,7 +3901,7 @@ F.prototype.parseRecordList32 = function(t, e) {
3899
3901
  }
3900
3902
  return n;
3901
3903
  };
3902
- F.prototype.parseTupleRecords = function(t, e) {
3904
+ T.prototype.parseTupleRecords = function(t, e) {
3903
3905
  let n = [];
3904
3906
  for (let r = 0; r < t; r++) {
3905
3907
  let s = [];
@@ -3909,7 +3911,7 @@ F.prototype.parseTupleRecords = function(t, e) {
3909
3911
  }
3910
3912
  return n;
3911
3913
  };
3912
- F.prototype.parseStruct = function(t) {
3914
+ T.prototype.parseStruct = function(t) {
3913
3915
  if (typeof t == "function")
3914
3916
  return t.call(this);
3915
3917
  {
@@ -3921,29 +3923,29 @@ F.prototype.parseStruct = function(t) {
3921
3923
  return n;
3922
3924
  }
3923
3925
  };
3924
- F.prototype.parseValueRecord = function(t) {
3926
+ T.prototype.parseValueRecord = function(t) {
3925
3927
  if (t === void 0 && (t = this.parseUShort()), t === 0)
3926
3928
  return;
3927
3929
  const e = {};
3928
3930
  return t & 1 && (e.xPlacement = this.parseShort()), t & 2 && (e.yPlacement = this.parseShort()), t & 4 && (e.xAdvance = this.parseShort()), t & 8 && (e.yAdvance = this.parseShort()), t & 16 && (e.xPlaDevice = void 0, this.parseShort()), t & 32 && (e.yPlaDevice = void 0, this.parseShort()), t & 64 && (e.xAdvDevice = void 0, this.parseShort()), t & 128 && (e.yAdvDevice = void 0, this.parseShort()), e;
3929
3931
  };
3930
- F.prototype.parseValueRecordList = function() {
3932
+ T.prototype.parseValueRecordList = function() {
3931
3933
  const t = this.parseUShort(), e = this.parseUShort(), n = new Array(e);
3932
3934
  for (let r = 0; r < e; r++)
3933
3935
  n[r] = this.parseValueRecord(t);
3934
3936
  return n;
3935
3937
  };
3936
- F.prototype.parsePointer = function(t) {
3938
+ T.prototype.parsePointer = function(t) {
3937
3939
  const e = this.parseOffset16();
3938
3940
  if (e > 0)
3939
- return new F(this.data, this.offset + e).parseStruct(t);
3941
+ return new T(this.data, this.offset + e).parseStruct(t);
3940
3942
  };
3941
- F.prototype.parsePointer32 = function(t) {
3943
+ T.prototype.parsePointer32 = function(t) {
3942
3944
  const e = this.parseOffset32();
3943
3945
  if (e > 0)
3944
- return new F(this.data, this.offset + e).parseStruct(t);
3946
+ return new T(this.data, this.offset + e).parseStruct(t);
3945
3947
  };
3946
- F.prototype.parseListOfLists = function(t) {
3948
+ T.prototype.parseListOfLists = function(t) {
3947
3949
  const e = this.parseOffset16List(), n = e.length, r = this.relativeOffset, s = new Array(n);
3948
3950
  for (let i = 0; i < n; i++) {
3949
3951
  const a = e[i];
@@ -3961,7 +3963,7 @@ F.prototype.parseListOfLists = function(t) {
3961
3963
  }
3962
3964
  return this.relativeOffset = r, s;
3963
3965
  };
3964
- F.prototype.parseCoverage = function() {
3966
+ T.prototype.parseCoverage = function() {
3965
3967
  const t = this.offset + this.relativeOffset, e = this.parseUShort(), n = this.parseUShort();
3966
3968
  if (e === 1)
3967
3969
  return {
@@ -3983,7 +3985,7 @@ F.prototype.parseCoverage = function() {
3983
3985
  }
3984
3986
  throw new Error("0x" + t.toString(16) + ": Coverage format must be 1 or 2.");
3985
3987
  };
3986
- F.prototype.parseClassDef = function() {
3988
+ T.prototype.parseClassDef = function() {
3987
3989
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
3988
3990
  return e === 1 ? {
3989
3991
  format: 1,
@@ -3992,111 +3994,111 @@ F.prototype.parseClassDef = function() {
3992
3994
  } : e === 2 ? {
3993
3995
  format: 2,
3994
3996
  ranges: this.parseRecordList({
3995
- start: F.uShort,
3996
- end: F.uShort,
3997
- classId: F.uShort
3997
+ start: T.uShort,
3998
+ end: T.uShort,
3999
+ classId: T.uShort
3998
4000
  })
3999
4001
  } : (console.warn(`0x${t.toString(16)}: This font file uses an invalid ClassDef format of ${e}. It might be corrupted and should be reacquired if it doesn't display as intended.`), {
4000
4002
  format: e
4001
4003
  });
4002
4004
  };
4003
- F.list = function(t, e) {
4005
+ T.list = function(t, e) {
4004
4006
  return function() {
4005
4007
  return this.parseList(t, e);
4006
4008
  };
4007
4009
  };
4008
- F.list32 = function(t, e) {
4010
+ T.list32 = function(t, e) {
4009
4011
  return function() {
4010
4012
  return this.parseList32(t, e);
4011
4013
  };
4012
4014
  };
4013
- F.recordList = function(t, e) {
4015
+ T.recordList = function(t, e) {
4014
4016
  return function() {
4015
4017
  return this.parseRecordList(t, e);
4016
4018
  };
4017
4019
  };
4018
- F.recordList32 = function(t, e) {
4020
+ T.recordList32 = function(t, e) {
4019
4021
  return function() {
4020
4022
  return this.parseRecordList32(t, e);
4021
4023
  };
4022
4024
  };
4023
- F.pointer = function(t) {
4025
+ T.pointer = function(t) {
4024
4026
  return function() {
4025
4027
  return this.parsePointer(t);
4026
4028
  };
4027
4029
  };
4028
- F.pointer32 = function(t) {
4030
+ T.pointer32 = function(t) {
4029
4031
  return function() {
4030
4032
  return this.parsePointer32(t);
4031
4033
  };
4032
4034
  };
4033
- F.tag = F.prototype.parseTag;
4034
- F.byte = F.prototype.parseByte;
4035
- F.uShort = F.offset16 = F.prototype.parseUShort;
4036
- F.uShortList = F.prototype.parseUShortList;
4037
- F.uInt24 = F.prototype.parseUInt24;
4038
- F.uLong = F.offset32 = F.prototype.parseULong;
4039
- F.uLongList = F.prototype.parseULongList;
4040
- F.fixed = F.prototype.parseFixed;
4041
- F.f2Dot14 = F.prototype.parseF2Dot14;
4042
- F.struct = F.prototype.parseStruct;
4043
- F.coverage = F.prototype.parseCoverage;
4044
- F.classDef = F.prototype.parseClassDef;
4035
+ T.tag = T.prototype.parseTag;
4036
+ T.byte = T.prototype.parseByte;
4037
+ T.uShort = T.offset16 = T.prototype.parseUShort;
4038
+ T.uShortList = T.prototype.parseUShortList;
4039
+ T.uInt24 = T.prototype.parseUInt24;
4040
+ T.uLong = T.offset32 = T.prototype.parseULong;
4041
+ T.uLongList = T.prototype.parseULongList;
4042
+ T.fixed = T.prototype.parseFixed;
4043
+ T.f2Dot14 = T.prototype.parseF2Dot14;
4044
+ T.struct = T.prototype.parseStruct;
4045
+ T.coverage = T.prototype.parseCoverage;
4046
+ T.classDef = T.prototype.parseClassDef;
4045
4047
  var Ms = {
4046
- reserved: F.uShort,
4047
- reqFeatureIndex: F.uShort,
4048
- featureIndexes: F.uShortList
4049
- };
4050
- F.prototype.parseScriptList = function() {
4051
- return this.parsePointer(F.recordList({
4052
- tag: F.tag,
4053
- script: F.pointer({
4054
- defaultLangSys: F.pointer(Ms),
4055
- langSysRecords: F.recordList({
4056
- tag: F.tag,
4057
- langSys: F.pointer(Ms)
4048
+ reserved: T.uShort,
4049
+ reqFeatureIndex: T.uShort,
4050
+ featureIndexes: T.uShortList
4051
+ };
4052
+ T.prototype.parseScriptList = function() {
4053
+ return this.parsePointer(T.recordList({
4054
+ tag: T.tag,
4055
+ script: T.pointer({
4056
+ defaultLangSys: T.pointer(Ms),
4057
+ langSysRecords: T.recordList({
4058
+ tag: T.tag,
4059
+ langSys: T.pointer(Ms)
4058
4060
  })
4059
4061
  })
4060
4062
  })) || [];
4061
4063
  };
4062
- F.prototype.parseFeatureList = function() {
4063
- return this.parsePointer(F.recordList({
4064
- tag: F.tag,
4065
- feature: F.pointer({
4066
- featureParams: F.offset16,
4067
- lookupListIndexes: F.uShortList
4064
+ T.prototype.parseFeatureList = function() {
4065
+ return this.parsePointer(T.recordList({
4066
+ tag: T.tag,
4067
+ feature: T.pointer({
4068
+ featureParams: T.offset16,
4069
+ lookupListIndexes: T.uShortList
4068
4070
  })
4069
4071
  })) || [];
4070
4072
  };
4071
- F.prototype.parseLookupList = function(t) {
4072
- return this.parsePointer(F.list(F.pointer(function() {
4073
+ T.prototype.parseLookupList = function(t) {
4074
+ return this.parsePointer(T.list(T.pointer(function() {
4073
4075
  const e = this.parseUShort();
4074
4076
  H.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
4075
4077
  const n = this.parseUShort(), r = n & 16;
4076
4078
  return {
4077
4079
  lookupType: e,
4078
4080
  lookupFlag: n,
4079
- subtables: this.parseList(F.pointer(t[e])),
4081
+ subtables: this.parseList(T.pointer(t[e])),
4080
4082
  markFilteringSet: r ? this.parseUShort() : void 0
4081
4083
  };
4082
4084
  }))) || [];
4083
4085
  };
4084
- F.prototype.parseFeatureVariationsList = function() {
4086
+ T.prototype.parseFeatureVariationsList = function() {
4085
4087
  return this.parsePointer32(function() {
4086
4088
  const t = this.parseUShort(), e = this.parseUShort();
4087
4089
  return H.argument(t === 1 && e < 1, "GPOS/GSUB feature variations table unknown."), this.parseRecordList32({
4088
- conditionSetOffset: F.offset32,
4089
- featureTableSubstitutionOffset: F.offset32
4090
+ conditionSetOffset: T.offset32,
4091
+ featureTableSubstitutionOffset: T.offset32
4090
4092
  });
4091
4093
  }) || [];
4092
4094
  };
4093
- F.prototype.parseVariationStore = function() {
4095
+ T.prototype.parseVariationStore = function() {
4094
4096
  const t = this.relativeOffset, e = this.parseUShort(), n = {
4095
4097
  itemVariationStore: this.parseItemVariationStore()
4096
4098
  };
4097
4099
  return this.relativeOffset = t + e + 2, n;
4098
4100
  };
4099
- F.prototype.parseItemVariationStore = function() {
4101
+ T.prototype.parseItemVariationStore = function() {
4100
4102
  const t = this.relativeOffset, e = {
4101
4103
  format: this.parseUShort(),
4102
4104
  variationRegions: [],
@@ -4109,24 +4111,24 @@ F.prototype.parseItemVariationStore = function() {
4109
4111
  }
4110
4112
  return e;
4111
4113
  };
4112
- F.prototype.parseVariationRegionList = function() {
4114
+ T.prototype.parseVariationRegionList = function() {
4113
4115
  const t = this.parseUShort(), e = this.parseUShort();
4114
4116
  return this.parseRecordList(e, {
4115
- regionAxes: F.recordList(t, {
4116
- startCoord: F.f2Dot14,
4117
- peakCoord: F.f2Dot14,
4118
- endCoord: F.f2Dot14
4117
+ regionAxes: T.recordList(t, {
4118
+ startCoord: T.f2Dot14,
4119
+ peakCoord: T.f2Dot14,
4120
+ endCoord: T.f2Dot14
4119
4121
  })
4120
4122
  });
4121
4123
  };
4122
- F.prototype.parseItemVariationSubtable = function() {
4124
+ T.prototype.parseItemVariationSubtable = function() {
4123
4125
  const t = this.parseUShort(), e = this.parseUShort(), n = this.parseUShortList(), r = n.length;
4124
4126
  return {
4125
4127
  regionIndexes: n,
4126
4128
  deltaSets: t && r ? this.parseDeltaSets(t, e, r) : []
4127
4129
  };
4128
4130
  };
4129
- F.prototype.parseDeltaSetIndexMap = function() {
4131
+ T.prototype.parseDeltaSetIndexMap = function() {
4130
4132
  const t = this.parseByte(), e = this.parseByte(), n = [];
4131
4133
  let r = 0;
4132
4134
  switch (t) {
@@ -4165,7 +4167,7 @@ F.prototype.parseDeltaSetIndexMap = function() {
4165
4167
  map: n
4166
4168
  };
4167
4169
  };
4168
- F.prototype.parseDeltaSets = function(t, e, n) {
4170
+ T.prototype.parseDeltaSets = function(t, e, n) {
4169
4171
  const r = Array.from({ length: t }, () => []), s = e & we.LONG_WORDS, i = e & we.WORD_DELTA_COUNT_MASK;
4170
4172
  if (i > n)
4171
4173
  throw Error("wordCount must be less than or equal to regionIndexCount");
@@ -4175,7 +4177,7 @@ F.prototype.parseDeltaSets = function(t, e, n) {
4175
4177
  l < i ? r[c].push(a()) : r[c].push(o());
4176
4178
  return r;
4177
4179
  };
4178
- F.prototype.parseTupleVariationStoreList = function(t, e, n) {
4180
+ T.prototype.parseTupleVariationStoreList = function(t, e, n) {
4179
4181
  const r = this.parseUShort(), i = this.parseUShort() & 1, a = this.parseOffset32(), o = (i ? this.parseULong : this.parseUShort).bind(this), c = {};
4180
4182
  let l = o();
4181
4183
  i || (l *= 2);
@@ -4193,7 +4195,7 @@ F.prototype.parseTupleVariationStoreList = function(t, e, n) {
4193
4195
  }
4194
4196
  return c;
4195
4197
  };
4196
- F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4198
+ T.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4197
4199
  const i = this.relativeOffset;
4198
4200
  this.relativeOffset = t, n === "cvar" && (this.relativeOffset += 4);
4199
4201
  const a = this.parseUShort(), o = !!(a & we.SHARED_POINT_NUMBERS), c = a & we.COUNT_MASK;
@@ -4210,7 +4212,7 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4210
4212
  const m = u[y];
4211
4213
  m.privatePoints = [], this.relativeOffset = h, n === "cvar" && !m.peakTuple && console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."), m.flags.privatePointNumbers && (m.privatePoints = this.parsePackedPointNumbers()), delete m.flags;
4212
4214
  const b = this.offset, v = this.relativeOffset, w = (C) => {
4213
- let T, E;
4215
+ let F, E;
4214
4216
  const R = () => {
4215
4217
  let P = 0;
4216
4218
  if (n === "gvar") {
@@ -4219,15 +4221,15 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4219
4221
  W.path, P = W.points.length, P += 4;
4220
4222
  }
4221
4223
  } else n === "cvar" && (P = r.length);
4222
- this.offset = b, this.relativeOffset = v, T = this.parsePackedDeltas(P), n === "gvar" && (E = this.parsePackedDeltas(P));
4224
+ this.offset = b, this.relativeOffset = v, F = this.parsePackedDeltas(P), n === "gvar" && (E = this.parsePackedDeltas(P));
4223
4225
  };
4224
4226
  return {
4225
4227
  configurable: !0,
4226
4228
  get: function() {
4227
- return T === void 0 && R(), C === "deltasY" ? E : T;
4229
+ return F === void 0 && R(), C === "deltasY" ? E : F;
4228
4230
  },
4229
4231
  set: function(P) {
4230
- T === void 0 && R(), C === "deltasY" ? E = P : T = P;
4232
+ F === void 0 && R(), C === "deltasY" ? E = P : F = P;
4231
4233
  }
4232
4234
  };
4233
4235
  };
@@ -4239,7 +4241,7 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4239
4241
  };
4240
4242
  return p.sharedPoints = f, p;
4241
4243
  };
4242
- F.prototype.parseTupleVariationHeader = function(t, e) {
4244
+ T.prototype.parseTupleVariationHeader = function(t, e) {
4243
4245
  const n = this.parseUShort(), r = this.parseUShort(), s = !!(r & we.EMBEDDED_PEAK_TUPLE), i = !!(r & we.INTERMEDIATE_REGION), a = !!(r & we.PRIVATE_POINT_NUMBERS), o = s ? void 0 : r & we.TUPLE_INDEX_MASK, c = s ? this.parseTupleRecords(1, t)[0] : void 0, l = i ? this.parseTupleRecords(1, t)[0] : void 0, u = i ? this.parseTupleRecords(1, t)[0] : void 0, f = {
4244
4246
  variationDataSize: n,
4245
4247
  peakTuple: c,
@@ -4253,7 +4255,7 @@ F.prototype.parseTupleVariationHeader = function(t, e) {
4253
4255
  };
4254
4256
  return e === "gvar" && (f.sharedTupleRecordsIndex = o), f;
4255
4257
  };
4256
- F.prototype.parsePackedPointNumbers = function() {
4258
+ T.prototype.parsePackedPointNumbers = function() {
4257
4259
  const t = this.parseByte(), e = [];
4258
4260
  let n = t;
4259
4261
  if (t >= 128) {
@@ -4271,7 +4273,7 @@ F.prototype.parsePackedPointNumbers = function() {
4271
4273
  }
4272
4274
  return e;
4273
4275
  };
4274
- F.prototype.parsePackedDeltas = function(t) {
4276
+ T.prototype.parsePackedDeltas = function(t) {
4275
4277
  const e = [];
4276
4278
  for (; e.length < t; ) {
4277
4279
  const n = this.parseByte(), r = !!(n & we.DELTAS_ARE_ZERO), s = !!(n & we.DELTAS_ARE_WORDS), i = (n & we.DELTA_RUN_COUNT_MASK) + 1;
@@ -4293,7 +4295,7 @@ var D = {
4293
4295
  getOffset: zc,
4294
4296
  getBytes: Wc,
4295
4297
  bytesToString: Vc,
4296
- Parser: F
4298
+ Parser: T
4297
4299
  }, Bn = [
4298
4300
  "copyright",
4299
4301
  // 0
@@ -4700,7 +4702,7 @@ var D = {
4700
4702
  // langAzerbaijanRoman → smRoman
4701
4703
  151: 0
4702
4704
  // langNynorsk → smRoman
4703
- }, Oa = {
4705
+ }, La = {
4704
4706
  1078: "af",
4705
4707
  1052: "sq",
4706
4708
  1156: "gsw",
@@ -4925,7 +4927,7 @@ function $c(t, e, n) {
4925
4927
  case 1:
4926
4928
  return Aa[e];
4927
4929
  case 3:
4928
- return Oa[e];
4930
+ return La[e];
4929
4931
  }
4930
4932
  }
4931
4933
  var Rr = "utf-16", Yc = {
@@ -5031,14 +5033,14 @@ function $r(t, e, n) {
5031
5033
  break;
5032
5034
  }
5033
5035
  }
5034
- var La = {
5036
+ var Oa = {
5035
5037
  0: "unicode",
5036
5038
  1: "macintosh",
5037
5039
  2: "reserved",
5038
5040
  3: "windows"
5039
5041
  };
5040
5042
  function Kc(t) {
5041
- return La[t];
5043
+ return Oa[t];
5042
5044
  }
5043
5045
  function Zc(t, e, n) {
5044
5046
  const r = {}, s = new D.Parser(t, e), i = s.parseUShort(), a = s.parseUShort(), o = s.offset + s.parseUShort();
@@ -5047,10 +5049,10 @@ function Zc(t, e, n) {
5047
5049
  if (v !== void 0 && b !== void 0 && w !== void 0) {
5048
5050
  let C;
5049
5051
  if (v === Rr ? C = Nt.UTF16(t, o + m, y) : C = Nt.MACSTRING(t, o + m, y, v), C) {
5050
- let T = r[w];
5051
- T === void 0 && (T = r[w] = {});
5052
- let E = T[p];
5053
- E === void 0 && (E = T[p] = {}), E[b] = C;
5052
+ let F = r[w];
5053
+ F === void 0 && (F = r[w] = {});
5054
+ let E = F[p];
5055
+ E === void 0 && (E = F[p] = {}), E[b] = C;
5054
5056
  }
5055
5057
  }
5056
5058
  }
@@ -5063,7 +5065,7 @@ function dn(t) {
5063
5065
  return e;
5064
5066
  }
5065
5067
  function Ds(t, e, n, r, s, i) {
5066
- return new O.Record("NameRecord", [
5068
+ return new L.Record("NameRecord", [
5067
5069
  { name: "platformID", type: "USHORT", value: t },
5068
5070
  { name: "encodingID", type: "USHORT", value: e },
5069
5071
  { name: "languageID", type: "USHORT", value: n },
@@ -5096,7 +5098,7 @@ function _s(t, e) {
5096
5098
  return n;
5097
5099
  }
5098
5100
  function Qc(t, e) {
5099
- const n = dn(La), r = dn(Aa), s = dn(Oa), i = [], a = [];
5101
+ const n = dn(Oa), r = dn(Aa), s = dn(La), i = [], a = [];
5100
5102
  for (let c in t) {
5101
5103
  let l;
5102
5104
  const u = [], f = {}, h = dn(Bn), p = n[c];
@@ -5113,8 +5115,8 @@ function Qc(t, e) {
5113
5115
  const v = m[b];
5114
5116
  if (p === 1 || p === 0) {
5115
5117
  let w = r[b], C = jc[w];
5116
- const T = $r(p, C, w);
5117
- let E = B.MACSTRING(v, T);
5118
+ const F = $r(p, C, w);
5119
+ let E = B.MACSTRING(v, F);
5118
5120
  if (p === 0 && (w = e.indexOf(b), w < 0 && (w = e.length, e.push(b)), C = 4, E = B.UTF16(v)), E !== void 0) {
5119
5121
  const R = _s(E, a);
5120
5122
  i.push(Ds(
@@ -5130,14 +5132,14 @@ function Qc(t, e) {
5130
5132
  if (p === 3) {
5131
5133
  const w = s[b];
5132
5134
  if (w !== void 0) {
5133
- const C = B.UTF16(v), T = _s(C, a);
5135
+ const C = B.UTF16(v), F = _s(C, a);
5134
5136
  i.push(Ds(
5135
5137
  3,
5136
5138
  1,
5137
5139
  w,
5138
5140
  l,
5139
5141
  C.length,
5140
- T
5142
+ F
5141
5143
  ));
5142
5144
  }
5143
5145
  }
@@ -5147,7 +5149,7 @@ function Qc(t, e) {
5147
5149
  i.sort(function(c, l) {
5148
5150
  return c.platformID - l.platformID || c.encodingID - l.encodingID || c.languageID - l.languageID || c.nameID - l.nameID;
5149
5151
  });
5150
- const o = new O.Table("name", [
5152
+ const o = new L.Table("name", [
5151
5153
  { name: "format", type: "USHORT", value: 0 },
5152
5154
  { name: "count", type: "USHORT", value: i.length },
5153
5155
  { name: "stringOffset", type: "USHORT", value: 6 + i.length * 12 }
@@ -5316,7 +5318,7 @@ function cl(t) {
5316
5318
  { name: "entrySelector", type: "USHORT", value: 0 },
5317
5319
  { name: "rangeShift", type: "USHORT", value: 0 }
5318
5320
  );
5319
- const s = new O.Table("cmap", r);
5321
+ const s = new L.Table("cmap", r);
5320
5322
  for (s.segments = [], n = 0; n < t.length; n += 1) {
5321
5323
  const p = t.get(n);
5322
5324
  for (let y = 0; y < p.unicodes.length; y += 1)
@@ -7085,7 +7087,7 @@ function ml(t, e, n, r, s) {
7085
7087
  }
7086
7088
  var vt = { line: ml };
7087
7089
  function yl(t, e) {
7088
- const n = new F(t, e), r = n.parseShort();
7090
+ const n = new T(t, e), r = n.parseShort();
7089
7091
  r !== 0 && console.warn("Only CPALv0 is currently fully supported.");
7090
7092
  const s = n.parseShort(), i = n.parseShort(), a = n.parseShort(), o = n.parseOffset32(), c = n.parseUShortList(i);
7091
7093
  n.relativeOffset = o;
@@ -7098,7 +7100,7 @@ function yl(t, e) {
7098
7100
  };
7099
7101
  }
7100
7102
  function bl({ version: t = 0, numPaletteEntries: e = 0, colorRecords: n = [], colorRecordIndices: r = [0] }) {
7101
- return H.argument(t === 0, "Only CPALv0 are supported."), H.argument(n.length, "No colorRecords given."), H.argument(r.length, "No colorRecordIndices given."), r.length > 1 && H.argument(e, "Can't infer numPaletteEntries on multiple colorRecordIndices"), new O.Table("CPAL", [
7103
+ return H.argument(t === 0, "Only CPALv0 are supported."), H.argument(n.length, "No colorRecords given."), H.argument(r.length, "No colorRecordIndices given."), r.length > 1 && H.argument(e, "Can't infer numPaletteEntries on multiple colorRecordIndices"), new L.Table("CPAL", [
7102
7104
  { name: "version", type: "USHORT", value: t },
7103
7105
  { name: "numPaletteEntries", type: "USHORT", value: e || n.length },
7104
7106
  { name: "numPalettes", type: "USHORT", value: r.length },
@@ -7458,7 +7460,7 @@ Ce.prototype.toDOMElement = function(t, e) {
7458
7460
  return e && e.variation && (n = e.variation.getTransform(this, t.variation).path), n.toDOMElement(t);
7459
7461
  };
7460
7462
  var Qt = Ce;
7461
- function Lt(t, e, n) {
7463
+ function Ot(t, e, n) {
7462
7464
  Object.defineProperty(t, e, {
7463
7465
  get: function() {
7464
7466
  return typeof t[n] > "u" && t.path, t[n];
@@ -7513,10 +7515,10 @@ function Cl(t, e, n, r, s, i) {
7513
7515
  n(a, r, s);
7514
7516
  const o = i(t.glyphs, a);
7515
7517
  return o.unitsPerEm = t.unitsPerEm, o;
7516
- }, Lt(a, "numberOfContours", "_numberOfContours"), Lt(a, "xMin", "_xMin"), Lt(a, "xMax", "_xMax"), Lt(a, "yMin", "_yMin"), Lt(a, "yMax", "_yMax"), Lt(a, "points", "_points"), a;
7518
+ }, Ot(a, "numberOfContours", "_numberOfContours"), Ot(a, "xMin", "_xMin"), Ot(a, "xMax", "_xMax"), Ot(a, "yMin", "_yMin"), Ot(a, "yMax", "_yMax"), Ot(a, "points", "_points"), a;
7517
7519
  };
7518
7520
  }
7519
- function Tl(t, e, n, r, s) {
7521
+ function Fl(t, e, n, r, s) {
7520
7522
  return function() {
7521
7523
  const i = new Qt({ index: e, font: t });
7522
7524
  return i.path = function() {
@@ -7525,7 +7527,7 @@ function Tl(t, e, n, r, s) {
7525
7527
  }, i;
7526
7528
  };
7527
7529
  }
7528
- var Qe = { GlyphSet: zn, glyphLoader: wl, ttfGlyphLoader: Cl, cffGlyphLoader: Tl };
7530
+ var Qe = { GlyphSet: zn, glyphLoader: wl, ttfGlyphLoader: Cl, cffGlyphLoader: Fl };
7529
7531
  function Na(t, e) {
7530
7532
  if (t === e)
7531
7533
  return !0;
@@ -7562,7 +7564,7 @@ function Ye(t, e, n, r) {
7562
7564
  }
7563
7565
  return { objects: i, startOffset: e, endOffset: l };
7564
7566
  }
7565
- function Fl(t, e, n) {
7567
+ function Tl(t, e, n) {
7566
7568
  const r = [], s = n > 1 ? D.getULong(t, e) : D.getCard16(t, e), i = n > 1 ? 4 : 2;
7567
7569
  let a, o;
7568
7570
  if (s !== 0) {
@@ -7612,7 +7614,7 @@ function Al(t, e) {
7612
7614
  return n = t.parseByte(), -(e - 251) * 256 - n - 108;
7613
7615
  throw new Error("Invalid b0 " + e);
7614
7616
  }
7615
- function Ol(t) {
7617
+ function Ll(t) {
7616
7618
  const e = {};
7617
7619
  for (let n = 0; n < t.length; n += 1) {
7618
7620
  const r = t[n][0], s = t[n][1];
@@ -7640,7 +7642,7 @@ function Kr(t, e, n, r) {
7640
7642
  } else
7641
7643
  a.push(Al(s, c));
7642
7644
  }
7643
- return Ol(i);
7645
+ return Ll(i);
7644
7646
  }
7645
7647
  function Xt(t, e) {
7646
7648
  return e <= 390 ? e = xn[e] : t ? e = t[e - 391] : e = void 0, e;
@@ -7661,7 +7663,7 @@ function Zr(t, e, n) {
7661
7663
  }
7662
7664
  return r;
7663
7665
  }
7664
- function Ll(t, e) {
7666
+ function Ol(t, e) {
7665
7667
  const n = {};
7666
7668
  if (n.formatMajor = D.getCard8(t, e), n.formatMinor = D.getCard8(t, e + 1), n.formatMajor > 2)
7667
7669
  throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);
@@ -7839,13 +7841,13 @@ function za(t, e) {
7839
7841
  function Mr(t, e, n, r, s) {
7840
7842
  let i, a, o, c;
7841
7843
  const l = new Pt(), u = [];
7842
- let f = 0, h = !1, p = !1, y = 0, m = 0, b, v, w, C, T = 0, E = [], R, P = 0;
7844
+ let f = 0, h = !1, p = !1, y = 0, m = 0, b, v, w, C, F = 0, E = [], R, P = 0;
7843
7845
  const W = t.tables.cff2 || t.tables.cff;
7844
7846
  if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(M) {
7845
7847
  return Mr(t, e, n, r, M);
7846
7848
  }), t.isCIDFont || r > 1) {
7847
7849
  const M = W.topDict._fdSelect ? W.topDict._fdSelect[e.index] : 0, _ = W.topDict._fdArray[M];
7848
- b = _._subrs, v = _._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, T = _._privateDict.vsindex) : (w = _._defaultWidthX, C = _._nominalWidthX);
7850
+ b = _._subrs, v = _._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, F = _._privateDict.vsindex) : (w = _._defaultWidthX, C = _._nominalWidthX);
7849
7851
  } else
7850
7852
  b = W.topDict._subrs, v = W.topDict._subrsBias;
7851
7853
  const j = za(t, l);
@@ -7858,7 +7860,7 @@ function Mr(t, e, n, r, s) {
7858
7860
  M = (u.length & 1) !== 0, M && !h && (N = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
7859
7861
  }
7860
7862
  function U(M) {
7861
- let _, re, Te, et, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
7863
+ let _, re, Fe, et, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
7862
7864
  for (; ce < M.length; ) {
7863
7865
  let ve = M[ce];
7864
7866
  switch (ce += 1, ve) {
@@ -7939,12 +7941,12 @@ function Mr(t, e, n, r, s) {
7939
7941
  dx: g,
7940
7942
  dy: d
7941
7943
  }), l.extend(t.glyphs.get(k).path);
7942
- const A = t.glyphs.get(S), L = JSON.parse(JSON.stringify(A.path.commands));
7943
- for (let q = 0; q < L.length; q += 1) {
7944
- const V = L[q];
7944
+ const A = t.glyphs.get(S), O = JSON.parse(JSON.stringify(A.path.commands));
7945
+ for (let q = 0; q < O.length; q += 1) {
7946
+ const V = O[q];
7945
7947
  V.type !== "Z" && (V.x += g, V.y += d), (V.type === "Q" || V.type === "C") && (V.x1 += g, V.y1 += d), V.type === "C" && (V.x2 += g, V.y2 += d);
7946
7948
  }
7947
- l.extend(L);
7949
+ l.extend(O);
7948
7950
  }
7949
7951
  } else u.length > 0 && !h && (N = u.shift() + C, h = !0);
7950
7952
  p && j !== 2 && (l.closePath(), p = !1);
@@ -7954,21 +7956,21 @@ function Mr(t, e, n, r, s) {
7954
7956
  console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");
7955
7957
  break;
7956
7958
  }
7957
- T = u.pop();
7959
+ F = u.pop();
7958
7960
  break;
7959
7961
  case 16:
7960
7962
  if (r < 2) {
7961
7963
  console.error("CFF2 CharString operator blend (16) is not supported in CFF");
7962
7964
  break;
7963
7965
  }
7964
- R || (R = t.variation && s && t.variation.process.getBlendVector(E, T, s));
7965
- var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Oe = Ae - Z;
7966
+ R || (R = t.variation && s && t.variation.process.getBlendVector(E, F, s));
7967
+ var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[F].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Le = Ae - Z;
7966
7968
  if (R)
7967
7969
  for (let tt = 0; tt < Z; tt++) {
7968
- var Re = u[Oe + tt];
7970
+ var Re = u[Le + tt];
7969
7971
  for (let x = 0; x < xe; x++)
7970
7972
  Re += R[x] * u[Ae++];
7971
- u[Oe + tt] = Re;
7973
+ u[Le + tt] = Re;
7972
7974
  }
7973
7975
  for (; Ee--; )
7974
7976
  u.pop();
@@ -8028,15 +8030,15 @@ function Mr(t, e, n, r, s) {
8028
8030
  i = y, a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c + (u.length === 1 ? u.shift() : 0), l.curveTo(i, a, o, c, y, m);
8029
8031
  break;
8030
8032
  default:
8031
- ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Te = M[ce + 2], et = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Te << 8 | et) / 65536));
8033
+ ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Fe = M[ce + 2], et = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Fe << 8 | et) / 65536));
8032
8034
  }
8033
8035
  }
8034
8036
  }
8035
8037
  return U(n), t.variation && s && (l.commands = l.commands.map((M) => {
8036
8038
  const _ = Object.keys(M);
8037
8039
  for (let re = 0; re < _.length; re++) {
8038
- const Te = _[re];
8039
- Te !== "type" && (M[Te] = Math.round(M[Te]));
8040
+ const Fe = _[re];
8041
+ Fe !== "type" && (M[Fe] = Math.round(M[Fe]));
8040
8042
  }
8041
8043
  return M;
8042
8044
  })), h && (e.advanceWidth = N), l;
@@ -8074,7 +8076,7 @@ function Ps(t, e, n, r, s) {
8074
8076
  }
8075
8077
  function Gl(t, e, n, r) {
8076
8078
  let s;
8077
- const i = Ll(t, e);
8079
+ const i = Ol(t, e);
8078
8080
  i.formatMajor === 2 ? s = n.tables.cff2 = {} : s = n.tables.cff = {};
8079
8081
  const a = i.formatMajor > 1 ? null : Ye(t, i.endOffset, D.bytesToString), o = i.formatMajor > 1 ? null : Ye(t, a.endOffset), c = i.formatMajor > 1 ? null : Ye(t, o.endOffset, D.bytesToString), l = Ye(t, i.formatMajor > 1 ? e + i.size + i.topDictLength : c.endOffset, void 0, i.formatMajor);
8080
8082
  n.gsubrs = l.objects, n.gsubrsBias = _n(n.gsubrs);
@@ -8111,7 +8113,7 @@ function Gl(t, e, n, r) {
8111
8113
  n.subrs = [], n.subrsBias = 0;
8112
8114
  }
8113
8115
  let f;
8114
- if (r.lowMemory ? (f = Fl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = Ye(t, e + u.charStrings, null, i.formatMajor), n.nGlyphs = f.objects.length), i.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), i.formatMajor < 2) {
8116
+ if (r.lowMemory ? (f = Tl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = Ye(t, e + u.charStrings, null, i.formatMajor), n.nGlyphs = f.objects.length), i.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), i.formatMajor < 2) {
8115
8117
  let h = [], p = [];
8116
8118
  u.charset === 0 ? h = ll : u.charset === 1 ? h = ul : u.charset === 2 ? h = hl : h = Ul(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = fl : p = Pl(t, e + u.encoding), n.cffEncoding = new Da(p, h), n.encoding = n.encoding || n.cffEncoding;
8117
8119
  }
@@ -8135,7 +8137,7 @@ function Wa(t, e) {
8135
8137
  return r >= 0 && (n = r), r = e.indexOf(t), r >= 0 ? n = r + xn.length : (n = xn.length + e.length, e.push(t)), n;
8136
8138
  }
8137
8139
  function Hl() {
8138
- return new O.Record("Header", [
8140
+ return new L.Record("Header", [
8139
8141
  { name: "major", type: "Card8", value: 1 },
8140
8142
  { name: "minor", type: "Card8", value: 0 },
8141
8143
  { name: "hdrSize", type: "Card8", value: 4 },
@@ -8143,7 +8145,7 @@ function Hl() {
8143
8145
  ]);
8144
8146
  }
8145
8147
  function zl(t) {
8146
- const e = new O.Record("Name INDEX", [
8148
+ const e = new L.Record("Name INDEX", [
8147
8149
  { name: "names", type: "INDEX", value: [] }
8148
8150
  ]);
8149
8151
  e.names = [];
@@ -8161,19 +8163,19 @@ function Va(t, e, n) {
8161
8163
  return r;
8162
8164
  }
8163
8165
  function Ns(t, e, n) {
8164
- const r = new O.Record("Top DICT", [
8166
+ const r = new L.Record("Top DICT", [
8165
8167
  { name: "dict", type: "DICT", value: {} }
8166
8168
  ]);
8167
8169
  return r.dict = Va(Ga, t, e), r;
8168
8170
  }
8169
8171
  function Gs(t) {
8170
- const e = new O.Record("Top DICT INDEX", [
8172
+ const e = new L.Record("Top DICT INDEX", [
8171
8173
  { name: "topDicts", type: "INDEX", value: [] }
8172
8174
  ]);
8173
8175
  return e.topDicts = [{ name: "topDict_0", type: "TABLE", value: t }], e;
8174
8176
  }
8175
8177
  function Wl(t) {
8176
- const e = new O.Record("String INDEX", [
8178
+ const e = new L.Record("String INDEX", [
8177
8179
  { name: "strings", type: "INDEX", value: [] }
8178
8180
  ]);
8179
8181
  e.strings = [];
@@ -8182,12 +8184,12 @@ function Wl(t) {
8182
8184
  return e;
8183
8185
  }
8184
8186
  function Vl() {
8185
- return new O.Record("Global Subr INDEX", [
8187
+ return new L.Record("Global Subr INDEX", [
8186
8188
  { name: "subrs", type: "INDEX", value: [] }
8187
8189
  ]);
8188
8190
  }
8189
8191
  function ql(t, e) {
8190
- const n = new O.Record("Charsets", [
8192
+ const n = new L.Record("Charsets", [
8191
8193
  { name: "format", type: "Card8", value: 0 }
8192
8194
  ]);
8193
8195
  for (let r = 0; r < t.length; r += 1) {
@@ -8226,7 +8228,7 @@ function jl(t, e) {
8226
8228
  return n.push({ name: "endchar", type: "OP", value: 14 }), n;
8227
8229
  }
8228
8230
  function $l(t, e) {
8229
- const n = new O.Record("CharStrings INDEX", [
8231
+ const n = new L.Record("CharStrings INDEX", [
8230
8232
  { name: "charStrings", type: "INDEX", value: [] }
8231
8233
  ]);
8232
8234
  for (let r = 0; r < t.length; r += 1) {
@@ -8236,13 +8238,13 @@ function $l(t, e) {
8236
8238
  return n;
8237
8239
  }
8238
8240
  function Yl(t, e, n) {
8239
- const r = new O.Record("Private DICT", [
8241
+ const r = new L.Record("Private DICT", [
8240
8242
  { name: "dict", type: "DICT", value: {} }
8241
8243
  ]);
8242
8244
  return r.dict = Va(Ha, t, e), r;
8243
8245
  }
8244
8246
  function Xl(t, e) {
8245
- const n = new O.Table("CFF ", [
8247
+ const n = new L.Table("CFF ", [
8246
8248
  { name: "header", type: "RECORD" },
8247
8249
  { name: "nameIndex", type: "RECORD" },
8248
8250
  { name: "topDictIndex", type: "RECORD" },
@@ -8283,7 +8285,7 @@ function Kl(t, e) {
8283
8285
  function Zl(t) {
8284
8286
  const e = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800;
8285
8287
  let n = e, r = t.macStyle || 0;
8286
- return t.createdTimestamp && (n = t.createdTimestamp + 2082844800), new O.Table("head", [
8288
+ return t.createdTimestamp && (n = t.createdTimestamp + 2082844800), new L.Table("head", [
8287
8289
  { name: "version", type: "FIXED", value: 65536 },
8288
8290
  { name: "fontRevision", type: "FIXED", value: 65536 },
8289
8291
  { name: "checkSumAdjustment", type: "ULONG", value: 0 },
@@ -8309,7 +8311,7 @@ function Jl(t, e) {
8309
8311
  return n.version = r.parseVersion(), n.ascender = r.parseShort(), n.descender = r.parseShort(), n.lineGap = r.parseShort(), n.advanceWidthMax = r.parseUShort(), n.minLeftSideBearing = r.parseShort(), n.minRightSideBearing = r.parseShort(), n.xMaxExtent = r.parseShort(), n.caretSlopeRise = r.parseShort(), n.caretSlopeRun = r.parseShort(), n.caretOffset = r.parseShort(), r.relativeOffset += 8, n.metricDataFormat = r.parseShort(), n.numberOfHMetrics = r.parseUShort(), n;
8310
8312
  }
8311
8313
  function Ql(t) {
8312
- return new O.Table("hhea", [
8314
+ return new L.Table("hhea", [
8313
8315
  { name: "version", type: "FIXED", value: 65536 },
8314
8316
  { name: "ascender", type: "FWORD", value: 0 },
8315
8317
  { name: "descender", type: "FWORD", value: 0 },
@@ -8353,7 +8355,7 @@ function nu(t, e, n, r, s, i, a) {
8353
8355
  a.lowMemory ? tu(t, e, n, r, s) : eu(e, n, r, s, i);
8354
8356
  }
8355
8357
  function ru(t) {
8356
- const e = new O.Table("hmtx", []);
8358
+ const e = new L.Table("hmtx", []);
8357
8359
  for (let n = 0; n < t.length; n += 1) {
8358
8360
  const r = t.get(n), s = r.advanceWidth || 0, i = r.leftSideBearing || 0;
8359
8361
  e.fields.push({ name: "advanceWidth_" + n, type: "USHORT", value: s }), e.fields.push({ name: "leftSideBearing_" + n, type: "SHORT", value: i });
@@ -8362,7 +8364,7 @@ function ru(t) {
8362
8364
  }
8363
8365
  var $a = { parse: nu, make: ru };
8364
8366
  function su(t) {
8365
- const e = new O.Table("ltag", [
8367
+ const e = new L.Table("ltag", [
8366
8368
  { name: "version", type: "ULONG", value: 1 },
8367
8369
  { name: "flags", type: "ULONG", value: 0 },
8368
8370
  { name: "numTags", type: "ULONG", value: t.length }
@@ -8394,7 +8396,7 @@ function au(t, e) {
8394
8396
  return n.version = r.parseVersion(), n.numGlyphs = r.parseUShort(), n.version === 1 && (n.maxPoints = r.parseUShort(), n.maxContours = r.parseUShort(), n.maxCompositePoints = r.parseUShort(), n.maxCompositeContours = r.parseUShort(), n.maxZones = r.parseUShort(), n.maxTwilightPoints = r.parseUShort(), n.maxStorage = r.parseUShort(), n.maxFunctionDefs = r.parseUShort(), n.maxInstructionDefs = r.parseUShort(), n.maxStackElements = r.parseUShort(), n.maxSizeOfInstructions = r.parseUShort(), n.maxComponentElements = r.parseUShort(), n.maxComponentDepth = r.parseUShort()), n;
8395
8397
  }
8396
8398
  function ou(t) {
8397
- return new O.Table("maxp", [
8399
+ return new L.Table("maxp", [
8398
8400
  { name: "version", type: "FIXED", value: 20480 },
8399
8401
  { name: "numGlyphs", type: "USHORT", value: t }
8400
8402
  ]);
@@ -8663,7 +8665,7 @@ function lu(t, e) {
8663
8665
  return n.ulUnicodeRange1 = r.parseULong(), n.ulUnicodeRange2 = r.parseULong(), n.ulUnicodeRange3 = r.parseULong(), n.ulUnicodeRange4 = r.parseULong(), n.achVendID = String.fromCharCode(r.parseByte(), r.parseByte(), r.parseByte(), r.parseByte()), n.fsSelection = r.parseUShort(), n.usFirstCharIndex = r.parseUShort(), n.usLastCharIndex = r.parseUShort(), n.sTypoAscender = r.parseShort(), n.sTypoDescender = r.parseShort(), n.sTypoLineGap = r.parseShort(), n.usWinAscent = r.parseUShort(), n.usWinDescent = r.parseUShort(), n.version >= 1 && (n.ulCodePageRange1 = r.parseULong(), n.ulCodePageRange2 = r.parseULong()), n.version >= 2 && (n.sxHeight = r.parseShort(), n.sCapHeight = r.parseShort(), n.usDefaultChar = r.parseUShort(), n.usBreakChar = r.parseUShort(), n.usMaxContent = r.parseUShort()), n;
8664
8666
  }
8665
8667
  function uu(t) {
8666
- return new O.Table("OS/2", [
8668
+ return new L.Table("OS/2", [
8667
8669
  { name: "version", type: "USHORT", value: 3 },
8668
8670
  { name: "xAvgCharWidth", type: "SHORT", value: 0 },
8669
8671
  { name: "usWeightClass", type: "USHORT", value: 0 },
@@ -8749,7 +8751,7 @@ function fu(t) {
8749
8751
  minMemType1: o = 0,
8750
8752
  maxMemType1: c = 0
8751
8753
  } = t.tables.post || {};
8752
- return new O.Table("post", [
8754
+ return new L.Table("post", [
8753
8755
  { name: "version", type: "FIXED", value: 196608 },
8754
8756
  { name: "italicAngle", type: "FIXED", value: e },
8755
8757
  { name: "underlinePosition", type: "FWORD", value: n },
@@ -8767,13 +8769,13 @@ Ve[1] = function() {
8767
8769
  if (n === 1)
8768
8770
  return {
8769
8771
  substFormat: 1,
8770
- coverage: this.parsePointer(F.coverage),
8772
+ coverage: this.parsePointer(T.coverage),
8771
8773
  deltaGlyphId: this.parseShort()
8772
8774
  };
8773
8775
  if (n === 2)
8774
8776
  return {
8775
8777
  substFormat: 2,
8776
- coverage: this.parsePointer(F.coverage),
8778
+ coverage: this.parsePointer(T.coverage),
8777
8779
  substitute: this.parseOffset16List()
8778
8780
  };
8779
8781
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
@@ -8782,7 +8784,7 @@ Ve[2] = function() {
8782
8784
  const e = this.parseUShort();
8783
8785
  return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
8784
8786
  substFormat: e,
8785
- coverage: this.parsePointer(F.coverage),
8787
+ coverage: this.parsePointer(T.coverage),
8786
8788
  sequences: this.parseListOfLists()
8787
8789
  };
8788
8790
  };
@@ -8790,7 +8792,7 @@ Ve[3] = function() {
8790
8792
  const e = this.parseUShort();
8791
8793
  return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
8792
8794
  substFormat: e,
8793
- coverage: this.parsePointer(F.coverage),
8795
+ coverage: this.parsePointer(T.coverage),
8794
8796
  alternateSets: this.parseListOfLists()
8795
8797
  };
8796
8798
  };
@@ -8798,7 +8800,7 @@ Ve[4] = function() {
8798
8800
  const e = this.parseUShort();
8799
8801
  return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
8800
8802
  substFormat: e,
8801
- coverage: this.parsePointer(F.coverage),
8803
+ coverage: this.parsePointer(T.coverage),
8802
8804
  ligatureSets: this.parseListOfLists(function() {
8803
8805
  return {
8804
8806
  ligGlyph: this.parseUShort(),
@@ -8808,15 +8810,15 @@ Ve[4] = function() {
8808
8810
  };
8809
8811
  };
8810
8812
  var Mt = {
8811
- sequenceIndex: F.uShort,
8812
- lookupListIndex: F.uShort
8813
+ sequenceIndex: T.uShort,
8814
+ lookupListIndex: T.uShort
8813
8815
  };
8814
8816
  Ve[5] = function() {
8815
8817
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8816
8818
  if (n === 1)
8817
8819
  return {
8818
8820
  substFormat: n,
8819
- coverage: this.parsePointer(F.coverage),
8821
+ coverage: this.parsePointer(T.coverage),
8820
8822
  ruleSets: this.parseListOfLists(function() {
8821
8823
  const r = this.parseUShort(), s = this.parseUShort();
8822
8824
  return {
@@ -8828,8 +8830,8 @@ Ve[5] = function() {
8828
8830
  if (n === 2)
8829
8831
  return {
8830
8832
  substFormat: n,
8831
- coverage: this.parsePointer(F.coverage),
8832
- classDef: this.parsePointer(F.classDef),
8833
+ coverage: this.parsePointer(T.coverage),
8834
+ classDef: this.parsePointer(T.classDef),
8833
8835
  classSets: this.parseListOfLists(function() {
8834
8836
  const r = this.parseUShort(), s = this.parseUShort();
8835
8837
  return {
@@ -8842,7 +8844,7 @@ Ve[5] = function() {
8842
8844
  const r = this.parseUShort(), s = this.parseUShort();
8843
8845
  return {
8844
8846
  substFormat: n,
8845
- coverages: this.parseList(r, F.pointer(F.coverage)),
8847
+ coverages: this.parseList(r, T.pointer(T.coverage)),
8846
8848
  lookupRecords: this.parseRecordList(s, Mt)
8847
8849
  };
8848
8850
  }
@@ -8853,7 +8855,7 @@ Ve[6] = function() {
8853
8855
  if (n === 1)
8854
8856
  return {
8855
8857
  substFormat: 1,
8856
- coverage: this.parsePointer(F.coverage),
8858
+ coverage: this.parsePointer(T.coverage),
8857
8859
  chainRuleSets: this.parseListOfLists(function() {
8858
8860
  return {
8859
8861
  backtrack: this.parseUShortList(),
@@ -8866,10 +8868,10 @@ Ve[6] = function() {
8866
8868
  if (n === 2)
8867
8869
  return {
8868
8870
  substFormat: 2,
8869
- coverage: this.parsePointer(F.coverage),
8870
- backtrackClassDef: this.parsePointer(F.classDef),
8871
- inputClassDef: this.parsePointer(F.classDef),
8872
- lookaheadClassDef: this.parsePointer(F.classDef),
8871
+ coverage: this.parsePointer(T.coverage),
8872
+ backtrackClassDef: this.parsePointer(T.classDef),
8873
+ inputClassDef: this.parsePointer(T.classDef),
8874
+ lookaheadClassDef: this.parsePointer(T.classDef),
8873
8875
  chainClassSet: this.parseListOfLists(function() {
8874
8876
  return {
8875
8877
  backtrack: this.parseUShortList(),
@@ -8882,9 +8884,9 @@ Ve[6] = function() {
8882
8884
  if (n === 3)
8883
8885
  return {
8884
8886
  substFormat: 3,
8885
- backtrackCoverage: this.parseList(F.pointer(F.coverage)),
8886
- inputCoverage: this.parseList(F.pointer(F.coverage)),
8887
- lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
8887
+ backtrackCoverage: this.parseList(T.pointer(T.coverage)),
8888
+ inputCoverage: this.parseList(T.pointer(T.coverage)),
8889
+ lookaheadCoverage: this.parseList(T.pointer(T.coverage)),
8888
8890
  lookupRecords: this.parseRecordList(Mt)
8889
8891
  };
8890
8892
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
@@ -8892,7 +8894,7 @@ Ve[6] = function() {
8892
8894
  Ve[7] = function() {
8893
8895
  const e = this.parseUShort();
8894
8896
  H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
8895
- const n = this.parseUShort(), r = new F(this.data, this.offset + this.parseULong());
8897
+ const n = this.parseUShort(), r = new T(this.data, this.offset + this.parseULong());
8896
8898
  return {
8897
8899
  substFormat: 1,
8898
8900
  lookupType: n,
@@ -8903,15 +8905,15 @@ Ve[8] = function() {
8903
8905
  const e = this.parseUShort();
8904
8906
  return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
8905
8907
  substFormat: e,
8906
- coverage: this.parsePointer(F.coverage),
8907
- backtrackCoverage: this.parseList(F.pointer(F.coverage)),
8908
- lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
8908
+ coverage: this.parsePointer(T.coverage),
8909
+ backtrackCoverage: this.parseList(T.pointer(T.coverage)),
8910
+ lookaheadCoverage: this.parseList(T.pointer(T.coverage)),
8909
8911
  substitutes: this.parseUShortList()
8910
8912
  };
8911
8913
  };
8912
8914
  function pu(t, e) {
8913
8915
  e = e || 0;
8914
- const n = new F(t, e), r = n.parseVersion(1);
8916
+ const n = new T(t, e), r = n.parseVersion(1);
8915
8917
  return H.argument(r === 1 || r === 1.1, "Unsupported GSUB table version."), r === 1 ? {
8916
8918
  version: r,
8917
8919
  scripts: n.parseScriptList(),
@@ -8928,77 +8930,77 @@ function pu(t, e) {
8928
8930
  var Et = new Array(9);
8929
8931
  Et[1] = function(e) {
8930
8932
  if (e.substFormat === 1)
8931
- return new O.Table("substitutionTable", [
8933
+ return new L.Table("substitutionTable", [
8932
8934
  { name: "substFormat", type: "USHORT", value: 1 },
8933
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) },
8935
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) },
8934
8936
  { name: "deltaGlyphID", type: "SHORT", value: e.deltaGlyphId }
8935
8937
  ]);
8936
8938
  if (e.substFormat === 2)
8937
- return new O.Table("substitutionTable", [
8939
+ return new L.Table("substitutionTable", [
8938
8940
  { name: "substFormat", type: "USHORT", value: 2 },
8939
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
8940
- ].concat(O.ushortList("substitute", e.substitute)));
8941
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
8942
+ ].concat(L.ushortList("substitute", e.substitute)));
8941
8943
  H.fail("Lookup type 1 substFormat must be 1 or 2.");
8942
8944
  };
8943
8945
  Et[2] = function(e) {
8944
- return H.assert(e.substFormat === 1, "Lookup type 2 substFormat must be 1."), new O.Table("substitutionTable", [
8946
+ return H.assert(e.substFormat === 1, "Lookup type 2 substFormat must be 1."), new L.Table("substitutionTable", [
8945
8947
  { name: "substFormat", type: "USHORT", value: 1 },
8946
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
8947
- ].concat(O.tableList("seqSet", e.sequences, function(n) {
8948
- return new O.Table("sequenceSetTable", O.ushortList("sequence", n));
8948
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
8949
+ ].concat(L.tableList("seqSet", e.sequences, function(n) {
8950
+ return new L.Table("sequenceSetTable", L.ushortList("sequence", n));
8949
8951
  })));
8950
8952
  };
8951
8953
  Et[3] = function(e) {
8952
- return H.assert(e.substFormat === 1, "Lookup type 3 substFormat must be 1."), new O.Table("substitutionTable", [
8954
+ return H.assert(e.substFormat === 1, "Lookup type 3 substFormat must be 1."), new L.Table("substitutionTable", [
8953
8955
  { name: "substFormat", type: "USHORT", value: 1 },
8954
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
8955
- ].concat(O.tableList("altSet", e.alternateSets, function(n) {
8956
- return new O.Table("alternateSetTable", O.ushortList("alternate", n));
8956
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
8957
+ ].concat(L.tableList("altSet", e.alternateSets, function(n) {
8958
+ return new L.Table("alternateSetTable", L.ushortList("alternate", n));
8957
8959
  })));
8958
8960
  };
8959
8961
  Et[4] = function(e) {
8960
- return H.assert(e.substFormat === 1, "Lookup type 4 substFormat must be 1."), new O.Table("substitutionTable", [
8962
+ return H.assert(e.substFormat === 1, "Lookup type 4 substFormat must be 1."), new L.Table("substitutionTable", [
8961
8963
  { name: "substFormat", type: "USHORT", value: 1 },
8962
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
8963
- ].concat(O.tableList("ligSet", e.ligatureSets, function(n) {
8964
- return new O.Table("ligatureSetTable", O.tableList("ligature", n, function(r) {
8965
- return new O.Table(
8964
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
8965
+ ].concat(L.tableList("ligSet", e.ligatureSets, function(n) {
8966
+ return new L.Table("ligatureSetTable", L.tableList("ligature", n, function(r) {
8967
+ return new L.Table(
8966
8968
  "ligatureTable",
8967
- [{ name: "ligGlyph", type: "USHORT", value: r.ligGlyph }].concat(O.ushortList("component", r.components, r.components.length + 1))
8969
+ [{ name: "ligGlyph", type: "USHORT", value: r.ligGlyph }].concat(L.ushortList("component", r.components, r.components.length + 1))
8968
8970
  );
8969
8971
  }));
8970
8972
  })));
8971
8973
  };
8972
8974
  Et[5] = function(e) {
8973
8975
  if (e.substFormat === 1)
8974
- return new O.Table("contextualSubstitutionTable", [
8976
+ return new L.Table("contextualSubstitutionTable", [
8975
8977
  { name: "substFormat", type: "USHORT", value: e.substFormat },
8976
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
8977
- ].concat(O.tableList("sequenceRuleSet", e.ruleSets, function(n) {
8978
- return n ? new O.Table("sequenceRuleSetTable", O.tableList("sequenceRule", n, function(r) {
8979
- let s = O.ushortList("seqLookup", [], r.lookupRecords.length).concat(O.ushortList("inputSequence", r.input, r.input.length + 1));
8978
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
8979
+ ].concat(L.tableList("sequenceRuleSet", e.ruleSets, function(n) {
8980
+ return n ? new L.Table("sequenceRuleSetTable", L.tableList("sequenceRule", n, function(r) {
8981
+ let s = L.ushortList("seqLookup", [], r.lookupRecords.length).concat(L.ushortList("inputSequence", r.input, r.input.length + 1));
8980
8982
  [s[0], s[1]] = [s[1], s[0]];
8981
8983
  for (let i = 0; i < r.lookupRecords.length; i++) {
8982
8984
  const a = r.lookupRecords[i];
8983
8985
  s = s.concat({ name: "sequenceIndex" + i, type: "USHORT", value: a.sequenceIndex }).concat({ name: "lookupListIndex" + i, type: "USHORT", value: a.lookupListIndex });
8984
8986
  }
8985
- return new O.Table("sequenceRuleTable", s);
8986
- })) : new O.Table("NULL", null);
8987
+ return new L.Table("sequenceRuleTable", s);
8988
+ })) : new L.Table("NULL", null);
8987
8989
  })));
8988
8990
  if (e.substFormat === 2)
8989
- return new O.Table("contextualSubstitutionTable", [
8991
+ return new L.Table("contextualSubstitutionTable", [
8990
8992
  { name: "substFormat", type: "USHORT", value: e.substFormat },
8991
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) },
8992
- { name: "classDef", type: "TABLE", value: new O.ClassDef(e.classDef) }
8993
- ].concat(O.tableList("classSeqRuleSet", e.classSets, function(n) {
8994
- return n ? new O.Table("classSeqRuleSetTable", O.tableList("classSeqRule", n, function(r) {
8995
- let s = O.ushortList("classes", r.classes, r.classes.length + 1).concat(O.ushortList("seqLookupCount", [], r.lookupRecords.length));
8993
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) },
8994
+ { name: "classDef", type: "TABLE", value: new L.ClassDef(e.classDef) }
8995
+ ].concat(L.tableList("classSeqRuleSet", e.classSets, function(n) {
8996
+ return n ? new L.Table("classSeqRuleSetTable", L.tableList("classSeqRule", n, function(r) {
8997
+ let s = L.ushortList("classes", r.classes, r.classes.length + 1).concat(L.ushortList("seqLookupCount", [], r.lookupRecords.length));
8996
8998
  for (let i = 0; i < r.lookupRecords.length; i++) {
8997
8999
  const a = r.lookupRecords[i];
8998
9000
  s = s.concat({ name: "sequenceIndex" + i, type: "USHORT", value: a.sequenceIndex }).concat({ name: "lookupListIndex" + i, type: "USHORT", value: a.lookupListIndex });
8999
9001
  }
9000
- return new O.Table("classSeqRuleTable", s);
9001
- })) : new O.Table("NULL", null);
9002
+ return new L.Table("classSeqRuleTable", s);
9003
+ })) : new L.Table("NULL", null);
9002
9004
  })));
9003
9005
  if (e.substFormat === 3) {
9004
9006
  let n = [
@@ -9007,29 +9009,29 @@ Et[5] = function(e) {
9007
9009
  n.push({ name: "inputGlyphCount", type: "USHORT", value: e.coverages.length }), n.push({ name: "substitutionCount", type: "USHORT", value: e.lookupRecords.length });
9008
9010
  for (let s = 0; s < e.coverages.length; s++) {
9009
9011
  const i = e.coverages[s];
9010
- n.push({ name: "inputCoverage" + s, type: "TABLE", value: new O.Coverage(i) });
9012
+ n.push({ name: "inputCoverage" + s, type: "TABLE", value: new L.Coverage(i) });
9011
9013
  }
9012
9014
  for (let s = 0; s < e.lookupRecords.length; s++) {
9013
9015
  const i = e.lookupRecords[s];
9014
9016
  n = n.concat({ name: "sequenceIndex" + s, type: "USHORT", value: i.sequenceIndex }).concat({ name: "lookupListIndex" + s, type: "USHORT", value: i.lookupListIndex });
9015
9017
  }
9016
- return new O.Table("contextualSubstitutionTable", n);
9018
+ return new L.Table("contextualSubstitutionTable", n);
9017
9019
  }
9018
9020
  H.assert(!1, "lookup type 5 format must be 1, 2 or 3.");
9019
9021
  };
9020
9022
  Et[6] = function(e) {
9021
9023
  if (e.substFormat === 1)
9022
- return new O.Table("chainContextTable", [
9024
+ return new L.Table("chainContextTable", [
9023
9025
  { name: "substFormat", type: "USHORT", value: e.substFormat },
9024
- { name: "coverage", type: "TABLE", value: new O.Coverage(e.coverage) }
9025
- ].concat(O.tableList("chainRuleSet", e.chainRuleSets, function(r) {
9026
- return new O.Table("chainRuleSetTable", O.tableList("chainRule", r, function(s) {
9027
- let i = O.ushortList("backtrackGlyph", s.backtrack, s.backtrack.length).concat(O.ushortList("inputGlyph", s.input, s.input.length + 1)).concat(O.ushortList("lookaheadGlyph", s.lookahead, s.lookahead.length)).concat(O.ushortList("substitution", [], s.lookupRecords.length));
9026
+ { name: "coverage", type: "TABLE", value: new L.Coverage(e.coverage) }
9027
+ ].concat(L.tableList("chainRuleSet", e.chainRuleSets, function(r) {
9028
+ return new L.Table("chainRuleSetTable", L.tableList("chainRule", r, function(s) {
9029
+ let i = L.ushortList("backtrackGlyph", s.backtrack, s.backtrack.length).concat(L.ushortList("inputGlyph", s.input, s.input.length + 1)).concat(L.ushortList("lookaheadGlyph", s.lookahead, s.lookahead.length)).concat(L.ushortList("substitution", [], s.lookupRecords.length));
9028
9030
  for (let a = 0; a < s.lookupRecords.length; a++) {
9029
9031
  const o = s.lookupRecords[a];
9030
9032
  i = i.concat({ name: "sequenceIndex" + a, type: "USHORT", value: o.sequenceIndex }).concat({ name: "lookupListIndex" + a, type: "USHORT", value: o.lookupListIndex });
9031
9033
  }
9032
- return new O.Table("chainRuleTable", i);
9034
+ return new L.Table("chainRuleTable", i);
9033
9035
  }));
9034
9036
  })));
9035
9037
  if (e.substFormat === 2)
@@ -9041,33 +9043,33 @@ Et[6] = function(e) {
9041
9043
  n.push({ name: "backtrackGlyphCount", type: "USHORT", value: e.backtrackCoverage.length });
9042
9044
  for (let s = 0; s < e.backtrackCoverage.length; s++) {
9043
9045
  const i = e.backtrackCoverage[s];
9044
- n.push({ name: "backtrackCoverage" + s, type: "TABLE", value: new O.Coverage(i) });
9046
+ n.push({ name: "backtrackCoverage" + s, type: "TABLE", value: new L.Coverage(i) });
9045
9047
  }
9046
9048
  n.push({ name: "inputGlyphCount", type: "USHORT", value: e.inputCoverage.length });
9047
9049
  for (let s = 0; s < e.inputCoverage.length; s++) {
9048
9050
  const i = e.inputCoverage[s];
9049
- n.push({ name: "inputCoverage" + s, type: "TABLE", value: new O.Coverage(i) });
9051
+ n.push({ name: "inputCoverage" + s, type: "TABLE", value: new L.Coverage(i) });
9050
9052
  }
9051
9053
  n.push({ name: "lookaheadGlyphCount", type: "USHORT", value: e.lookaheadCoverage.length });
9052
9054
  for (let s = 0; s < e.lookaheadCoverage.length; s++) {
9053
9055
  const i = e.lookaheadCoverage[s];
9054
- n.push({ name: "lookaheadCoverage" + s, type: "TABLE", value: new O.Coverage(i) });
9056
+ n.push({ name: "lookaheadCoverage" + s, type: "TABLE", value: new L.Coverage(i) });
9055
9057
  }
9056
9058
  n.push({ name: "substitutionCount", type: "USHORT", value: e.lookupRecords.length });
9057
9059
  for (let s = 0; s < e.lookupRecords.length; s++) {
9058
9060
  const i = e.lookupRecords[s];
9059
9061
  n = n.concat({ name: "sequenceIndex" + s, type: "USHORT", value: i.sequenceIndex }).concat({ name: "lookupListIndex" + s, type: "USHORT", value: i.lookupListIndex });
9060
9062
  }
9061
- return new O.Table("chainContextTable", n);
9063
+ return new L.Table("chainContextTable", n);
9062
9064
  }
9063
9065
  H.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
9064
9066
  };
9065
9067
  function du(t) {
9066
- return new O.Table("GSUB", [
9068
+ return new L.Table("GSUB", [
9067
9069
  { name: "version", type: "ULONG", value: 65536 },
9068
- { name: "scripts", type: "TABLE", value: new O.ScriptList(t.scripts) },
9069
- { name: "features", type: "TABLE", value: new O.FeatureList(t.features) },
9070
- { name: "lookups", type: "TABLE", value: new O.LookupList(t.lookups, Et) }
9070
+ { name: "scripts", type: "TABLE", value: new L.ScriptList(t.scripts) },
9071
+ { name: "features", type: "TABLE", value: new L.FeatureList(t.features) },
9072
+ { name: "lookups", type: "TABLE", value: new L.LookupList(t.lookups, Et) }
9071
9073
  ]);
9072
9074
  }
9073
9075
  var Za = { parse: pu, make: du };
@@ -9087,7 +9089,7 @@ function gu(t, e) {
9087
9089
  function mu(t) {
9088
9090
  const e = Object.keys(t).length;
9089
9091
  let n = "";
9090
- const r = 16 + e * 12, s = new O.Table("meta", [
9092
+ const r = 16 + e * 12, s = new L.Table("meta", [
9091
9093
  { name: "version", type: "ULONG", value: 1 },
9092
9094
  { name: "flags", type: "ULONG", value: 0 },
9093
9095
  { name: "offset", type: "ULONG", value: r },
@@ -9101,19 +9103,19 @@ function mu(t) {
9101
9103
  }
9102
9104
  var Ja = { parse: gu, make: mu };
9103
9105
  function yu(t, e) {
9104
- const n = new F(t, e), r = n.parseUShort();
9106
+ const n = new T(t, e), r = n.parseUShort();
9105
9107
  r !== 0 && console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");
9106
9108
  const s = n.parseUShort(), i = n.parseOffset32(), a = n.parseOffset32(), o = n.parseUShort();
9107
9109
  n.relativeOffset = i;
9108
9110
  const c = n.parseRecordList(s, {
9109
- glyphID: F.uShort,
9110
- firstLayerIndex: F.uShort,
9111
- numLayers: F.uShort
9111
+ glyphID: T.uShort,
9112
+ firstLayerIndex: T.uShort,
9113
+ numLayers: T.uShort
9112
9114
  });
9113
9115
  n.relativeOffset = a;
9114
9116
  const l = n.parseRecordList(o, {
9115
- glyphID: F.uShort,
9116
- paletteIndex: F.uShort
9117
+ glyphID: T.uShort,
9118
+ paletteIndex: T.uShort
9117
9119
  });
9118
9120
  return {
9119
9121
  version: r,
@@ -9124,7 +9126,7 @@ function yu(t, e) {
9124
9126
  function bu({ version: t = 0, baseGlyphRecords: e = [], layerRecords: n = [] }) {
9125
9127
  H.argument(t === 0, "Only COLRv0 supported.");
9126
9128
  const r = 14, s = r + e.length * 6;
9127
- return new O.Table("COLR", [
9129
+ return new L.Table("COLR", [
9128
9130
  { name: "version", type: "USHORT", value: t },
9129
9131
  { name: "numBaseGlyphRecords", type: "USHORT", value: e.length },
9130
9132
  { name: "baseGlyphRecordsOffset", type: "ULONG", value: r },
@@ -9188,7 +9190,7 @@ function wu(t, e, n, r, s) {
9188
9190
  return i.postScriptNameID = c == 65535 ? void 0 : c, i.postScriptName = i.postScriptNameID !== void 0 ? Mn(r, c, [6]) : "", i;
9189
9191
  }
9190
9192
  function Cu(t, e) {
9191
- const n = new O.Table("fvar", [
9193
+ const n = new L.Table("fvar", [
9192
9194
  { name: "version", type: "ULONG", value: 65536 },
9193
9195
  { name: "offsetToData", type: "USHORT", value: 0 },
9194
9196
  { name: "countSizePairs", type: "USHORT", value: 2 },
@@ -9215,7 +9217,7 @@ function Cu(t, e) {
9215
9217
  ));
9216
9218
  return n;
9217
9219
  }
9218
- function Tu(t, e, n) {
9220
+ function Fu(t, e, n) {
9219
9221
  const r = new D.Parser(t, e), s = r.parseULong();
9220
9222
  H.argument(s === 65536, "Unsupported fvar table version.");
9221
9223
  const i = r.parseOffset16();
@@ -9228,10 +9230,10 @@ function Tu(t, e, n) {
9228
9230
  f.push(wu(t, h + p * l, u, n, l));
9229
9231
  return { axes: u, instances: f };
9230
9232
  }
9231
- var eo = { make: Cu, parse: Tu }, Fu = {
9232
- tag: F.tag,
9233
- nameID: F.uShort,
9234
- ordering: F.uShort
9233
+ var eo = { make: Cu, parse: Fu }, Tu = {
9234
+ tag: T.tag,
9235
+ nameID: T.uShort,
9236
+ ordering: T.uShort
9235
9237
  }, nn = new Array(5);
9236
9238
  nn[1] = function() {
9237
9239
  return {
@@ -9290,7 +9292,7 @@ function Eu(t, e, n) {
9290
9292
  n !== void 0 && H.argument(c >= n.axes.length, "STAT axis count must be greater than or equal to fvar axis count"), u > 0 && H.argument(c >= 0, "STAT axis count must be greater than 0 if STAT axis value count is greater than 0");
9291
9293
  const p = [];
9292
9294
  for (let b = 0; b < c; b++)
9293
- r.offset = e + l, r.relativeOffset = b * o, p.push(r.parseStruct(Fu));
9295
+ r.offset = e + l, r.relativeOffset = b * o, p.push(r.parseStruct(Tu));
9294
9296
  r.offset = e, r.relativeOffset = f;
9295
9297
  const y = r.parseUShortList(u), m = [];
9296
9298
  for (let b = 0; b < u; b++)
@@ -9348,20 +9350,20 @@ rn[4] = function(e, n) {
9348
9350
  return r;
9349
9351
  };
9350
9352
  function Au(t, e) {
9351
- return new O.Record("axisRecord_" + t, [
9353
+ return new L.Record("axisRecord_" + t, [
9352
9354
  { name: "axisTag_" + t, type: "TAG", value: e.tag },
9353
9355
  { name: "axisNameID_" + t, type: "USHORT", value: e.nameID },
9354
9356
  { name: "axisOrdering_" + t, type: "USHORT", value: e.ordering }
9355
9357
  ]);
9356
9358
  }
9357
- function Ou(t, e) {
9359
+ function Lu(t, e) {
9358
9360
  const n = e.format, r = rn[n];
9359
9361
  H.argument(r !== void 0, `Unknown axis value table format ${n}`);
9360
9362
  const s = r(t, e);
9361
- return new O.Table("axisValueTable_" + t, s);
9363
+ return new L.Table("axisValueTable_" + t, s);
9362
9364
  }
9363
- function Lu(t) {
9364
- const e = new O.Table("STAT", [
9365
+ function Ou(t) {
9366
+ const e = new L.Table("STAT", [
9365
9367
  { name: "majorVersion", type: "USHORT", value: 1 },
9366
9368
  { name: "minorVersion", type: "USHORT", value: 2 },
9367
9369
  { name: "designAxisSize", type: "USHORT", value: 8 },
@@ -9379,7 +9381,7 @@ function Lu(t) {
9379
9381
  const n = [];
9380
9382
  let r = [], s = t.values.length * 2;
9381
9383
  for (let i = 0; i < t.values.length; i++) {
9382
- const a = Ou(i, t.values[i]);
9384
+ const a = Lu(i, t.values[i]);
9383
9385
  n.push({
9384
9386
  name: "offset_" + i,
9385
9387
  type: "USHORT",
@@ -9388,15 +9390,15 @@ function Lu(t) {
9388
9390
  }
9389
9391
  return e.fields = e.fields.concat(n), e.fields = e.fields.concat(r), e;
9390
9392
  }
9391
- var to = { make: Lu, parse: Eu };
9393
+ var to = { make: Ou, parse: Eu };
9392
9394
  function Iu(t, e) {
9393
- return new O.Record("axisValueMap_" + t, [
9395
+ return new L.Record("axisValueMap_" + t, [
9394
9396
  { name: "fromCoordinate_" + t, type: "F2DOT14", value: e.fromCoordinate },
9395
9397
  { name: "toCoordinate_" + t, type: "F2DOT14", value: e.toCoordinate }
9396
9398
  ]);
9397
9399
  }
9398
9400
  function Ru(t, e) {
9399
- const n = new O.Record("segmentMap_" + t, [
9401
+ const n = new L.Record("segmentMap_" + t, [
9400
9402
  { name: "positionMapCount_" + t, type: "USHORT", value: e.axisValueMaps.length }
9401
9403
  ]);
9402
9404
  let r = [];
@@ -9408,7 +9410,7 @@ function Ru(t, e) {
9408
9410
  }
9409
9411
  function Bu(t, e) {
9410
9412
  H.argument(t.axisSegmentMaps.length === e.axes.length, "avar axis count must correspond to fvar axis count");
9411
- const n = new O.Table("avar", [
9413
+ const n = new L.Table("avar", [
9412
9414
  { name: "majorVersion", type: "USHORT", value: 1 },
9413
9415
  { name: "minorVersion", type: "USHORT", value: 0 },
9414
9416
  { name: "reserved", type: "USHORT", value: 0 },
@@ -9422,7 +9424,7 @@ function Bu(t, e) {
9422
9424
  }
9423
9425
  function Mu(t, e, n) {
9424
9426
  e || (e = 0);
9425
- const r = new F(t, e), s = r.parseUShort(), i = r.parseUShort();
9427
+ const r = new T(t, e), s = r.parseUShort(), i = r.parseUShort();
9426
9428
  s !== 1 && console.warn(`Unsupported avar table version ${s}.${i}`), r.skip("uShort", 1);
9427
9429
  const a = r.parseUShort();
9428
9430
  H.argument(a === n.axes.length, "avar axis count must correspond to fvar axis count");
@@ -9491,7 +9493,7 @@ function Nu(t, e) {
9491
9493
  return n;
9492
9494
  }
9493
9495
  function Gu(t) {
9494
- const e = new O.Table("gasp", [
9496
+ const e = new L.Table("gasp", [
9495
9497
  { name: "version", type: "USHORT", value: 1 },
9496
9498
  { name: "numRanges", type: "USHORT", value: t.numRanges }
9497
9499
  ]);
@@ -9501,7 +9503,7 @@ function Gu(t) {
9501
9503
  }
9502
9504
  var io = { parse: Nu, make: Gu };
9503
9505
  function Hu(t, e) {
9504
- const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new F(t, e);
9506
+ const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new T(t, e);
9505
9507
  if (s.parseUShort() !== 0) return n;
9506
9508
  s.relativeOffset = s.parseOffset32();
9507
9509
  const a = t.byteOffset + e + s.relativeOffset, o = s.parseUShort(), c = /* @__PURE__ */ new Map();
@@ -9536,7 +9538,7 @@ function zu(t) {
9536
9538
  }
9537
9539
  for (let h = 0; h < c; h++)
9538
9540
  u[f++] = { name: "svgDoc_" + h, type: "LITERAL", value: r[h] };
9539
- return new O.Table("SVG ", u);
9541
+ return new L.Table("SVG ", u);
9540
9542
  }
9541
9543
  var ao = {
9542
9544
  make: zu,
@@ -9554,7 +9556,7 @@ function Qr(t) {
9554
9556
  return e %= Math.pow(2, 32), e;
9555
9557
  }
9556
9558
  function zs(t, e, n, r) {
9557
- return new O.Record("Table Record", [
9559
+ return new L.Record("Table Record", [
9558
9560
  { name: "tag", type: "TAG", value: t !== void 0 ? t : "" },
9559
9561
  { name: "checkSum", type: "ULONG", value: e !== void 0 ? e : 0 },
9560
9562
  { name: "offset", type: "ULONG", value: n !== void 0 ? n : 0 },
@@ -9562,7 +9564,7 @@ function zs(t, e, n, r) {
9562
9564
  ]);
9563
9565
  }
9564
9566
  function oo(t) {
9565
- const e = new O.Table("sfnt", [
9567
+ const e = new L.Table("sfnt", [
9566
9568
  { name: "version", type: "TAG", value: "OTTO" },
9567
9569
  { name: "numTables", type: "USHORT", value: 0 },
9568
9570
  { name: "searchRange", type: "USHORT", value: 0 },
@@ -9621,8 +9623,8 @@ function Vu(t) {
9621
9623
  else
9622
9624
  throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
9623
9625
  if (xe.name === ".notdef") continue;
9624
- const Oe = xe.getMetrics();
9625
- e.push(Oe.xMin), n.push(Oe.yMin), r.push(Oe.xMax), s.push(Oe.yMax), a.push(Oe.leftSideBearing), o.push(Oe.rightSideBearing), i.push(xe.advanceWidth);
9626
+ const Le = xe.getMetrics();
9627
+ e.push(Le.xMin), n.push(Le.yMin), r.push(Le.xMax), s.push(Le.yMax), a.push(Le.leftSideBearing), o.push(Le.rightSideBearing), i.push(xe.advanceWidth);
9626
9628
  }
9627
9629
  const y = {
9628
9630
  xMin: Math.min.apply(null, e),
@@ -9682,7 +9684,7 @@ function Vu(t) {
9682
9684
  // Use space as the default character, if available.
9683
9685
  usBreakChar: t.hasChar(" ") ? 32 : 0
9684
9686
  // Use space as the break character, if available.
9685
- }, t.tables.os2)), T = $a.make(t.glyphs), E = Ra.make(t.glyphs), R = t.getEnglishName("fontFamily"), P = t.getEnglishName("fontSubfamily"), W = R + " " + P;
9687
+ }, t.tables.os2)), F = $a.make(t.glyphs), E = Ra.make(t.glyphs), R = t.getEnglishName("fontFamily"), P = t.getEnglishName("fontSubfamily"), W = R + " " + P;
9686
9688
  let j = t.getEnglishName("postScriptName");
9687
9689
  j || (j = R.replace(/\s/g, "") + "-" + P);
9688
9690
  const N = {};
@@ -9698,7 +9700,7 @@ function Vu(t) {
9698
9700
  N[Z].postScriptName || (N[Z].postScriptName = { en: j });
9699
9701
  }
9700
9702
  N.unicode.preferredFamily || (N.unicode.preferredFamily = X.fontFamily || ie.fontFamily || U.fontFamily), N.macintosh.preferredFamily || (N.macintosh.preferredFamily = ie.fontFamily || X.fontFamily || U.fontFamily), N.windows.preferredFamily || (N.windows.preferredFamily = U.fontFamily || X.fontFamily || ie.fontFamily), N.unicode.preferredSubfamily || (N.unicode.preferredSubfamily = X.fontSubfamily || ie.fontSubfamily || U.fontSubfamily), N.macintosh.preferredSubfamily || (N.macintosh.preferredSubfamily = ie.fontSubfamily || X.fontSubfamily || U.fontSubfamily), N.windows.preferredSubfamily || (N.windows.preferredSubfamily = U.fontSubfamily || X.fontSubfamily || ie.fontSubfamily);
9701
- const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Te = Ka.make(t), et = Dr.make(t.glyphs, {
9703
+ const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Fe = Ka.make(t), et = Dr.make(t.glyphs, {
9702
9704
  version: t.getEnglishName("version"),
9703
9705
  fullName: W,
9704
9706
  familyName: R,
@@ -9707,7 +9709,7 @@ function Vu(t) {
9707
9709
  unitsPerEm: t.unitsPerEm,
9708
9710
  fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax],
9709
9711
  topDict: t.tables.cff && t.tables.cff.topDict || {}
9710
- }), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Te, et, T];
9712
+ }), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Fe, et, F];
9711
9713
  re && me.push(re);
9712
9714
  const Y = {
9713
9715
  gsub: Za,
@@ -11356,7 +11358,7 @@ var po = { getPath: ts, parse: fh }, ph = class {
11356
11358
  hvar() {
11357
11359
  return this.font.tables.hvar;
11358
11360
  }
11359
- }, Ys = 1e6, Un = 64, Pn = 1e4, go, Ft, mo, Pr;
11361
+ }, Ys = 1e6, Un = 64, Pn = 1e4, go, Tt, mo, Pr;
11360
11362
  function yo(t) {
11361
11363
  this.font = t, this.getCommands = function(e) {
11362
11364
  return po.getPath(e).commands;
@@ -11586,7 +11588,7 @@ yo.prototype.exec = function(t, e) {
11586
11588
  if (!s) {
11587
11589
  pt.prototype = vh, s = this._fpgmState = new pt("fpgm", n.tables.fpgm), s.funcs = [], s.font = n, s.instructionCount = 0, s.callDepth = 0;
11588
11590
  try {
11589
- Ft(s);
11591
+ Tt(s);
11590
11592
  } catch (a) {
11591
11593
  console.log("Hinting error in FPGM:" + a), this._errorState = 3;
11592
11594
  return;
@@ -11601,7 +11603,7 @@ yo.prototype.exec = function(t, e) {
11601
11603
  } else
11602
11604
  r.cvt = [];
11603
11605
  try {
11604
- Ft(r);
11606
+ Tt(r);
11605
11607
  } catch (a) {
11606
11608
  this._errorState < 2 && console.log("Hinting error in PREP:" + a), this._errorState = 2;
11607
11609
  }
@@ -11638,7 +11640,7 @@ mo = function(t, e) {
11638
11640
  t.instructions && !o.inhibitGridFit && (o = new pt("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = a, o.contours = i, a.push(
11639
11641
  new at(0, 0),
11640
11642
  new at(Math.round(t.advanceWidth * n), 0)
11641
- ), Ft(o), a.length -= 2);
11643
+ ), Tt(o), a.length -= 2);
11642
11644
  }
11643
11645
  return a;
11644
11646
  };
@@ -11658,9 +11660,9 @@ Pr = function(t, e, n, r) {
11658
11660
  e.inhibitGridFit || (a.push(
11659
11661
  new at(0, 0),
11660
11662
  new at(Math.round(t.advanceWidth * n), 0)
11661
- ), Ft(e), a.length -= 2);
11663
+ ), Tt(e), a.length -= 2);
11662
11664
  };
11663
- Ft = function(t) {
11665
+ Tt = function(t) {
11664
11666
  let e = t.prog;
11665
11667
  if (!e) return;
11666
11668
  const n = e.length;
@@ -11734,16 +11736,16 @@ function Ch(t) {
11734
11736
  const e = t.stack, n = t.pv;
11735
11737
  e.push(n.x * 16384), e.push(n.y * 16384);
11736
11738
  }
11737
- function Th(t) {
11739
+ function Fh(t) {
11738
11740
  const e = t.stack, n = t.fv;
11739
11741
  e.push(n.x * 16384), e.push(n.y * 16384);
11740
11742
  }
11741
- function Fh(t) {
11743
+ function Th(t) {
11742
11744
  t.fv = t.pv;
11743
11745
  }
11744
11746
  function kh(t) {
11745
- const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], f = c[s], h = c[i], p = t.z2[a], y = l.x, m = l.y, b = u.x, v = u.y, w = f.x, C = f.y, T = h.x, E = h.y, R = (y - b) * (C - E) - (m - v) * (w - T), P = y * v - m * b, W = w * E - C * T;
11746
- p.x = (P * (w - T) - W * (y - b)) / R, p.y = (P * (C - E) - W * (m - v)) / R;
11747
+ const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], f = c[s], h = c[i], p = t.z2[a], y = l.x, m = l.y, b = u.x, v = u.y, w = f.x, C = f.y, F = h.x, E = h.y, R = (y - b) * (C - E) - (m - v) * (w - F), P = y * v - m * b, W = w * E - C * F;
11748
+ p.x = (P * (w - F) - W * (y - b)) / R, p.y = (P * (C - E) - W * (m - v)) / R;
11747
11749
  }
11748
11750
  function Eh(t) {
11749
11751
  t.rp0 = t.stack.pop();
@@ -11751,10 +11753,10 @@ function Eh(t) {
11751
11753
  function Ah(t) {
11752
11754
  t.rp1 = t.stack.pop();
11753
11755
  }
11754
- function Oh(t) {
11756
+ function Lh(t) {
11755
11757
  t.rp2 = t.stack.pop();
11756
11758
  }
11757
- function Lh(t) {
11759
+ function Oh(t) {
11758
11760
  const e = t.stack.pop();
11759
11761
  switch (t.zp0 = e, e) {
11760
11762
  case 0:
@@ -11856,7 +11858,7 @@ function qh(t) {
11856
11858
  const s = t.ip, i = t.prog;
11857
11859
  t.prog = t.funcs[n];
11858
11860
  for (let a = 0; a < r; a++)
11859
- Ft(t);
11861
+ Tt(t);
11860
11862
  t.ip = s, t.prog = i, t.callDepth--;
11861
11863
  }
11862
11864
  function jh(t) {
@@ -11864,7 +11866,7 @@ function jh(t) {
11864
11866
  if (++t.callDepth > Un)
11865
11867
  throw new Error("Hinting call depth exceeded maximum of " + Un);
11866
11868
  const n = t.ip, r = t.prog;
11867
- t.prog = t.funcs[e], Ft(t), t.ip = n, t.prog = r, t.callDepth--;
11869
+ t.prog = t.funcs[e], Tt(t), t.ip = n, t.prog = r, t.callDepth--;
11868
11870
  }
11869
11871
  function $h(t) {
11870
11872
  const e = t.stack, n = e.pop();
@@ -12088,11 +12090,11 @@ function Cf(t) {
12088
12090
  const n = t.stack.pop();
12089
12091
  t.deltaShift = Math.pow(0.5, n);
12090
12092
  }
12091
- function Tf(t) {
12093
+ function Ff(t) {
12092
12094
  const e = t.stack, n = e.pop(), r = e.pop();
12093
12095
  e.push(r + n);
12094
12096
  }
12095
- function Ff(t) {
12097
+ function Tf(t) {
12096
12098
  const e = t.stack, n = e.pop(), r = e.pop();
12097
12099
  e.push(r - n);
12098
12100
  }
@@ -12108,12 +12110,12 @@ function Af(t) {
12108
12110
  const e = t.stack, n = e.pop();
12109
12111
  e.push(Math.abs(n));
12110
12112
  }
12111
- function Of(t) {
12113
+ function Lf(t) {
12112
12114
  const e = t.stack;
12113
12115
  let n = e.pop();
12114
12116
  e.push(-n);
12115
12117
  }
12116
- function Lf(t) {
12118
+ function Of(t) {
12117
12119
  const e = t.stack, n = e.pop();
12118
12120
  e.push(Math.floor(n / 64) * 64);
12119
12121
  }
@@ -12309,9 +12311,9 @@ go = [
12309
12311
  /* 0x0C */
12310
12312
  Ch,
12311
12313
  /* 0x0D */
12312
- Th,
12313
- /* 0x0E */
12314
12314
  Fh,
12315
+ /* 0x0E */
12316
+ Th,
12315
12317
  /* 0x0F */
12316
12318
  kh,
12317
12319
  /* 0x10 */
@@ -12319,9 +12321,9 @@ go = [
12319
12321
  /* 0x11 */
12320
12322
  Ah,
12321
12323
  /* 0x12 */
12322
- Oh,
12323
- /* 0x13 */
12324
12324
  Lh,
12325
+ /* 0x13 */
12326
+ Oh,
12325
12327
  /* 0x14 */
12326
12328
  Ih,
12327
12329
  /* 0x15 */
@@ -12484,9 +12486,9 @@ go = [
12484
12486
  /* 0x5F */
12485
12487
  Cf,
12486
12488
  /* 0x60 */
12487
- Tf,
12488
- /* 0x61 */
12489
12489
  Ff,
12490
+ /* 0x61 */
12491
+ Tf,
12490
12492
  /* 0x62 */
12491
12493
  kf,
12492
12494
  /* 0x63 */
@@ -12494,9 +12496,9 @@ go = [
12494
12496
  /* 0x64 */
12495
12497
  Af,
12496
12498
  /* 0x65 */
12497
- Of,
12498
- /* 0x66 */
12499
12499
  Lf,
12500
+ /* 0x66 */
12501
+ Of,
12500
12502
  /* 0x67 */
12501
12503
  If,
12502
12504
  /* 0x68 */
@@ -13154,15 +13156,15 @@ function Jf(t, e) {
13154
13156
  for (let p = 0; p < e.lookupRecords.length; p++) {
13155
13157
  const y = e.lookupRecords[p], m = y.lookupListIndex, b = this.getLookupByIndex(m);
13156
13158
  for (let v = 0; v < b.subtables.length; v++) {
13157
- let w = b.subtables[v], C, T = this.getSubstitutionType(b, w);
13158
- if (T === "71" ? (T = this.getSubstitutionType(w, w.extension), C = this.getLookupMethod(w, w.extension), w = w.extension) : C = this.getLookupMethod(b, w), T === "12") {
13159
+ let w = b.subtables[v], C, F = this.getSubstitutionType(b, w);
13160
+ if (F === "71" ? (F = this.getSubstitutionType(w, w.extension), C = this.getLookupMethod(w, w.extension), w = w.extension) : C = this.getLookupMethod(b, w), F === "12") {
13159
13161
  const E = t.get(y.sequenceIndex), R = C(E);
13160
13162
  R && h.push(R);
13161
- } else if (T === "21") {
13163
+ } else if (F === "21") {
13162
13164
  const E = t.get(y.sequenceIndex), R = C(E);
13163
13165
  R && h.push(R);
13164
13166
  } else
13165
- throw new Error(`Substitution type ${T} is not supported in chaining substitution`);
13167
+ throw new Error(`Substitution type ${F} is not supported in chaining substitution`);
13166
13168
  }
13167
13169
  }
13168
13170
  return h;
@@ -13634,8 +13636,8 @@ function Cp(t) {
13634
13636
  }
13635
13637
  }
13636
13638
  }
13637
- var Tp = Cp;
13638
- function Fp(t) {
13639
+ var Fp = Cp;
13640
+ function Tp(t) {
13639
13641
  const e = t.current, n = t.get(-1);
13640
13642
  return (
13641
13643
  // ? latin first char
@@ -13652,7 +13654,7 @@ function kp(t) {
13652
13654
  );
13653
13655
  }
13654
13656
  var Ep = {
13655
- startCheck: Fp,
13657
+ startCheck: Tp,
13656
13658
  endCheck: kp
13657
13659
  };
13658
13660
  function pi(t, e) {
@@ -13678,8 +13680,8 @@ function Ap(t) {
13678
13680
  }
13679
13681
  }
13680
13682
  }
13681
- var Op = Ap;
13682
- function Lp(t) {
13683
+ var Lp = Ap;
13684
+ function Op(t) {
13683
13685
  const e = t.current, n = t.get(-1);
13684
13686
  return (
13685
13687
  // ? thai first char
@@ -13696,7 +13698,7 @@ function Ip(t) {
13696
13698
  );
13697
13699
  }
13698
13700
  var Rp = {
13699
- startCheck: Lp,
13701
+ startCheck: Op,
13700
13702
  endCheck: Ip
13701
13703
  };
13702
13704
  function di(t, e) {
@@ -13807,13 +13809,13 @@ function zp(t) {
13807
13809
  }
13808
13810
  }
13809
13811
  var Wp = zp;
13810
- function He(t) {
13812
+ function ze(t) {
13811
13813
  this.baseDir = t || "ltr", this.tokenizer = new Yf(), this.featuresTags = {};
13812
13814
  }
13813
- He.prototype.setText = function(t) {
13815
+ ze.prototype.setText = function(t) {
13814
13816
  this.text = t;
13815
13817
  };
13816
- He.prototype.contextChecks = {
13818
+ ze.prototype.contextChecks = {
13817
13819
  ccmpReplacementCheck: wp,
13818
13820
  latinWordCheck: Ep,
13819
13821
  arabicWordCheck: ap,
@@ -13844,13 +13846,13 @@ function qp() {
13844
13846
  );
13845
13847
  }
13846
13848
  }
13847
- He.prototype.registerFeatures = function(t, e) {
13849
+ ze.prototype.registerFeatures = function(t, e) {
13848
13850
  const n = e.filter(
13849
13851
  (r) => this.query.supports({ script: t, tag: r })
13850
13852
  );
13851
13853
  Object.prototype.hasOwnProperty.call(this.featuresTags, t) ? this.featuresTags[t] = this.featuresTags[t].concat(n) : this.featuresTags[t] = n;
13852
13854
  };
13853
- He.prototype.applyFeatures = function(t, e) {
13855
+ ze.prototype.applyFeatures = function(t, e) {
13854
13856
  if (!t) throw new Error(
13855
13857
  "No valid font was provided to apply features"
13856
13858
  );
@@ -13860,7 +13862,7 @@ He.prototype.applyFeatures = function(t, e) {
13860
13862
  this.query.supports({ script: r.script }) && this.registerFeatures(r.script, r.tags);
13861
13863
  }
13862
13864
  };
13863
- He.prototype.registerModifier = function(t, e, n) {
13865
+ ze.prototype.registerModifier = function(t, e, n) {
13864
13866
  this.tokenizer.registerModifier(t, e, n);
13865
13867
  };
13866
13868
  function cn() {
@@ -13883,7 +13885,7 @@ function $p() {
13883
13885
  const t = this.tokenizer.getContextRanges("ccmpReplacement");
13884
13886
  for (let e = 0; e < t.length; e++) {
13885
13887
  const n = t[e];
13886
- Tp.call(this, n);
13888
+ Fp.call(this, n);
13887
13889
  }
13888
13890
  }
13889
13891
  function Yp() {
@@ -13901,7 +13903,7 @@ function Xp() {
13901
13903
  const t = this.tokenizer.getContextRanges("latinWord");
13902
13904
  for (let e = 0; e < t.length; e++) {
13903
13905
  const n = t[e];
13904
- Op.call(this, n);
13906
+ Lp.call(this, n);
13905
13907
  }
13906
13908
  }
13907
13909
  function Kp() {
@@ -13919,22 +13921,22 @@ function Zp() {
13919
13921
  this.hasFeatureEnabled("thai", "liga") && _p.call(this, n), this.hasFeatureEnabled("thai", "rlig") && Pp.call(this, n), this.hasFeatureEnabled("thai", "ccmp") && Mp.call(this, n);
13920
13922
  }
13921
13923
  }
13922
- He.prototype.checkContextReady = function(t) {
13924
+ ze.prototype.checkContextReady = function(t) {
13923
13925
  return !!this.tokenizer.getContext(t);
13924
13926
  };
13925
- He.prototype.applyFeaturesToContexts = function() {
13927
+ ze.prototype.applyFeaturesToContexts = function() {
13926
13928
  this.checkContextReady("ccmpReplacement") && $p.call(this), this.checkContextReady("arabicWord") && (jp.call(this), Yp.call(this)), this.checkContextReady("latinWord") && Xp.call(this), this.checkContextReady("arabicSentence") && qp.call(this), this.checkContextReady("thaiWord") && Zp.call(this), this.checkContextReady("unicodeVariationSequence") && Kp.call(this);
13927
13929
  };
13928
- He.prototype.hasFeatureEnabled = function(t, e) {
13930
+ ze.prototype.hasFeatureEnabled = function(t, e) {
13929
13931
  return (this.featuresTags[t] || []).indexOf(e) !== -1;
13930
13932
  };
13931
- He.prototype.processText = function(t) {
13933
+ ze.prototype.processText = function(t) {
13932
13934
  (!this.text || this.text !== t) && (this.setText(t), Vp.call(this), this.applyFeaturesToContexts());
13933
13935
  };
13934
- He.prototype.getBidiText = function(t) {
13936
+ ze.prototype.getBidiText = function(t) {
13935
13937
  return this.processText(t), this.tokenizer.getText();
13936
13938
  };
13937
- He.prototype.getTextGlyphs = function(t) {
13939
+ ze.prototype.getTextGlyphs = function(t) {
13938
13940
  this.processText(t);
13939
13941
  let e = [];
13940
13942
  for (let n = 0; n < this.tokenizer.tokens.length; n++) {
@@ -13945,7 +13947,7 @@ He.prototype.getTextGlyphs = function(t) {
13945
13947
  }
13946
13948
  return e;
13947
13949
  };
13948
- var Jp = He;
13950
+ var Jp = ze;
13949
13951
  function or(t) {
13950
13952
  return {
13951
13953
  fontFamily: { en: t.familyName || " " },
@@ -14261,8 +14263,8 @@ function td() {
14261
14263
  }
14262
14264
  var nd = { make: td, parse: ed }, rd = function() {
14263
14265
  return {
14264
- coverage: this.parsePointer(F.coverage),
14265
- attachPoints: this.parseList(F.pointer(F.uShortList))
14266
+ coverage: this.parsePointer(T.coverage),
14267
+ attachPoints: this.parseList(T.pointer(T.uShortList))
14266
14268
  };
14267
14269
  }, sd = function() {
14268
14270
  var t = this.parseUShort();
@@ -14276,28 +14278,28 @@ var nd = { make: td, parse: ed }, rd = function() {
14276
14278
  if (t === 3)
14277
14279
  return { coordinate: this.parseShort() };
14278
14280
  }, id = function() {
14279
- return this.parseList(F.pointer(sd));
14281
+ return this.parseList(T.pointer(sd));
14280
14282
  }, ad = function() {
14281
14283
  return {
14282
- coverage: this.parsePointer(F.coverage),
14283
- ligGlyphs: this.parseList(F.pointer(id))
14284
+ coverage: this.parsePointer(T.coverage),
14285
+ ligGlyphs: this.parseList(T.pointer(id))
14284
14286
  };
14285
14287
  }, od = function() {
14286
- return this.parseUShort(), this.parseList(F.pointer(F.coverage));
14288
+ return this.parseUShort(), this.parseList(T.pointer(T.coverage));
14287
14289
  };
14288
14290
  function cd(t, e) {
14289
14291
  e = e || 0;
14290
- const n = new F(t, e), r = n.parseVersion(1);
14292
+ const n = new T(t, e), r = n.parseVersion(1);
14291
14293
  H.argument(
14292
14294
  r === 1 || r === 1.2 || r === 1.3,
14293
14295
  "Unsupported GDEF table version."
14294
14296
  );
14295
14297
  var s = {
14296
14298
  version: r,
14297
- classDef: n.parsePointer(F.classDef),
14299
+ classDef: n.parsePointer(T.classDef),
14298
14300
  attachList: n.parsePointer(rd),
14299
14301
  ligCaretList: n.parsePointer(ad),
14300
- markAttachClassDef: n.parsePointer(F.classDef)
14302
+ markAttachClassDef: n.parsePointer(T.classDef)
14301
14303
  };
14302
14304
  return r >= 1.2 && (s.markGlyphSets = n.parsePointer(od)), s;
14303
14305
  }
@@ -14307,13 +14309,13 @@ qe[1] = function() {
14307
14309
  if (n === 1)
14308
14310
  return {
14309
14311
  posFormat: 1,
14310
- coverage: this.parsePointer(F.coverage),
14312
+ coverage: this.parsePointer(T.coverage),
14311
14313
  value: this.parseValueRecord()
14312
14314
  };
14313
14315
  if (n === 2)
14314
14316
  return {
14315
14317
  posFormat: 2,
14316
- coverage: this.parsePointer(F.coverage),
14318
+ coverage: this.parsePointer(T.coverage),
14317
14319
  values: this.parseValueRecordList()
14318
14320
  };
14319
14321
  H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
@@ -14321,14 +14323,14 @@ qe[1] = function() {
14321
14323
  qe[2] = function() {
14322
14324
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
14323
14325
  H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
14324
- const r = this.parsePointer(F.coverage), s = this.parseUShort(), i = this.parseUShort();
14326
+ const r = this.parsePointer(T.coverage), s = this.parseUShort(), i = this.parseUShort();
14325
14327
  if (n === 1)
14326
14328
  return {
14327
14329
  posFormat: n,
14328
14330
  coverage: r,
14329
14331
  valueFormat1: s,
14330
14332
  valueFormat2: i,
14331
- pairSets: this.parseList(F.pointer(F.list(function() {
14333
+ pairSets: this.parseList(T.pointer(T.list(function() {
14332
14334
  return {
14333
14335
  // pairValueRecord
14334
14336
  secondGlyph: this.parseUShort(),
@@ -14338,7 +14340,7 @@ qe[2] = function() {
14338
14340
  })))
14339
14341
  };
14340
14342
  if (n === 2) {
14341
- const a = this.parsePointer(F.classDef), o = this.parsePointer(F.classDef), c = this.parseUShort(), l = this.parseUShort();
14343
+ const a = this.parsePointer(T.classDef), o = this.parsePointer(T.classDef), c = this.parseUShort(), l = this.parseUShort();
14342
14344
  return {
14343
14345
  // Class Pair Adjustment
14344
14346
  posFormat: n,
@@ -14349,7 +14351,7 @@ qe[2] = function() {
14349
14351
  classDef2: o,
14350
14352
  class1Count: c,
14351
14353
  class2Count: l,
14352
- classRecords: this.parseList(c, F.list(l, function() {
14354
+ classRecords: this.parseList(c, T.list(l, function() {
14353
14355
  return {
14354
14356
  value1: this.parseValueRecord(s),
14355
14357
  value2: this.parseValueRecord(i)
@@ -14381,7 +14383,7 @@ qe[9] = function() {
14381
14383
  };
14382
14384
  function ud(t, e) {
14383
14385
  e = e || 0;
14384
- const n = new F(t, e), r = n.parseVersion(1);
14386
+ const n = new T(t, e), r = n.parseVersion(1);
14385
14387
  return H.argument(r === 1 || r === 1.1, "Unsupported GPOS table version " + r), r === 1 ? {
14386
14388
  version: r,
14387
14389
  scripts: n.parseScriptList(),
@@ -14397,11 +14399,11 @@ function ud(t, e) {
14397
14399
  }
14398
14400
  var hd = new Array(10);
14399
14401
  function fd(t) {
14400
- return new O.Table("GPOS", [
14402
+ return new L.Table("GPOS", [
14401
14403
  { name: "version", type: "ULONG", value: 65536 },
14402
- { name: "scripts", type: "TABLE", value: new O.ScriptList(t.scripts) },
14403
- { name: "features", type: "TABLE", value: new O.FeatureList(t.features) },
14404
- { name: "lookups", type: "TABLE", value: new O.LookupList(t.lookups, hd) }
14404
+ { name: "scripts", type: "TABLE", value: new L.ScriptList(t.scripts) },
14405
+ { name: "features", type: "TABLE", value: new L.FeatureList(t.features) },
14406
+ { name: "lookups", type: "TABLE", value: new L.LookupList(t.lookups, hd) }
14405
14407
  ]);
14406
14408
  }
14407
14409
  var pd = { parse: ud, make: fd };
@@ -14509,7 +14511,7 @@ function Sd(t, e = {}) {
14509
14511
  throw new Error("WOFF2 require an external decompressor library, see examples at: " + U);
14510
14512
  } else
14511
14513
  throw new Error("Unsupported OpenType signature " + c);
14512
- let l, u, f, h, p, y, m, b, v, w, C, T, E, R, P, W, j, N;
14514
+ let l, u, f, h, p, y, m, b, v, w, C, F, E, R, P, W, j, N;
14513
14515
  for (let U = 0; U < a; U += 1) {
14514
14516
  const M = o[U];
14515
14517
  let _;
@@ -14548,7 +14550,7 @@ function Sd(t, e = {}) {
14548
14550
  E = M;
14549
14551
  break;
14550
14552
  case "hmtx":
14551
- T = M;
14553
+ F = M;
14552
14554
  break;
14553
14555
  case "ltag":
14554
14556
  _ = J(i, M), r = Ya.parse(_.data, _.offset);
@@ -14625,7 +14627,7 @@ function Sd(t, e = {}) {
14625
14627
  Dr.parse(U.data, U.offset, s, e);
14626
14628
  } else
14627
14629
  throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
14628
- const ie = J(i, T);
14630
+ const ie = J(i, F);
14629
14631
  if ($a.parse(s, ie.data, ie.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), gl(s, e), R) {
14630
14632
  const U = J(i, R);
14631
14633
  s.kerningPairs = yd.parse(U.data, U.offset);
@@ -14667,7 +14669,7 @@ function Sd(t, e = {}) {
14667
14669
  s.tables.avar = no.parse(U.data, U.offset, s.tables.fvar);
14668
14670
  }
14669
14671
  if (E) {
14670
- f || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), T || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
14672
+ f || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), F || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
14671
14673
  const U = J(i, E);
14672
14674
  s.tables.hvar = nd.parse(U.data, U.offset, s.tables.fvar);
14673
14675
  }
@@ -14677,12 +14679,12 @@ function Sd(t, e = {}) {
14677
14679
  }
14678
14680
  return s.palettes = new uo(s), s;
14679
14681
  }
14680
- const wd = 1.15, Cd = 0.9, Td = ["国", "中", "永"];
14682
+ const wd = 1.15, Cd = 0.9, Fd = ["国", "中", "永"];
14681
14683
  function bi(t, e) {
14682
14684
  const n = t.charToGlyphIndex(e);
14683
14685
  return n != null && n > 0;
14684
14686
  }
14685
- function Fd(t) {
14687
+ function Td(t) {
14686
14688
  var a;
14687
14689
  const e = t.unitsPerEm || 1e3;
14688
14690
  if (!bi(t, "A"))
@@ -14692,7 +14694,7 @@ function Fd(t) {
14692
14694
  return 1;
14693
14695
  const s = e / r;
14694
14696
  let i = 0;
14695
- for (const o of Td)
14697
+ for (const o of Fd)
14696
14698
  if (bi(t, o)) {
14697
14699
  i = ((a = t.charToGlyph(o)) == null ? void 0 : a.advanceWidth) ?? 0;
14698
14700
  break;
@@ -14700,7 +14702,7 @@ function Fd(t) {
14700
14702
  return i >= e * Cd && s > wd ? 1 : s;
14701
14703
  }
14702
14704
  function kd(t, e = !1) {
14703
- const n = t[0].index !== null, r = new Set(Object.keys(t[0].attributes)), s = new Set(Object.keys(t[0].morphAttributes)), i = {}, a = {}, o = t[0].morphTargetsRelative, c = new Oo();
14705
+ const n = t[0].index !== null, r = new Set(Object.keys(t[0].attributes)), s = new Set(Object.keys(t[0].morphAttributes)), i = {}, a = {}, o = t[0].morphTargetsRelative, c = new Lo();
14704
14706
  let l = 0;
14705
14707
  for (let u = 0; u < t.length; ++u) {
14706
14708
  const f = t[u];
@@ -14779,7 +14781,7 @@ function xi(t) {
14779
14781
  return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
14780
14782
  i += u.count * n;
14781
14783
  }
14782
- const a = new e(i), o = new Lo(a, n, r);
14784
+ const a = new e(i), o = new Oo(a, n, r);
14783
14785
  let c = 0;
14784
14786
  for (let l = 0; l < t.length; ++l) {
14785
14787
  const u = t[l];
@@ -14802,40 +14804,40 @@ function Ed(t, e = 1e-4) {
14802
14804
  let a = 0;
14803
14805
  const o = Object.keys(t.attributes), c = {}, l = {}, u = [], f = ["getX", "getY", "getZ", "getW"], h = ["setX", "setY", "setZ", "setW"];
14804
14806
  for (let w = 0, C = o.length; w < C; w++) {
14805
- const T = o[w], E = t.attributes[T];
14806
- c[T] = new E.constructor(
14807
+ const F = o[w], E = t.attributes[F];
14808
+ c[F] = new E.constructor(
14807
14809
  new E.array.constructor(E.count * E.itemSize),
14808
14810
  E.itemSize,
14809
14811
  E.normalized
14810
14812
  );
14811
- const R = t.morphAttributes[T];
14812
- R && (l[T] || (l[T] = []), R.forEach((P, W) => {
14813
+ const R = t.morphAttributes[F];
14814
+ R && (l[F] || (l[F] = []), R.forEach((P, W) => {
14813
14815
  const j = new P.array.constructor(P.count * P.itemSize);
14814
- l[T][W] = new P.constructor(j, P.itemSize, P.normalized);
14816
+ l[F][W] = new P.constructor(j, P.itemSize, P.normalized);
14815
14817
  }));
14816
14818
  }
14817
14819
  const p = e * 0.5, y = Math.log10(1 / e), m = Math.pow(10, y), b = p * m;
14818
14820
  for (let w = 0; w < i; w++) {
14819
14821
  const C = r ? r.getX(w) : w;
14820
- let T = "";
14822
+ let F = "";
14821
14823
  for (let E = 0, R = o.length; E < R; E++) {
14822
14824
  const P = o[E], W = t.getAttribute(P), j = W.itemSize;
14823
14825
  for (let N = 0; N < j; N++)
14824
- T += `${~~(W[f[N]](C) * m + b)},`;
14826
+ F += `${~~(W[f[N]](C) * m + b)},`;
14825
14827
  }
14826
- if (T in n)
14827
- u.push(n[T]);
14828
+ if (F in n)
14829
+ u.push(n[F]);
14828
14830
  else {
14829
14831
  for (let E = 0, R = o.length; E < R; E++) {
14830
14832
  const P = o[E], W = t.getAttribute(P), j = t.morphAttributes[P], N = W.itemSize, X = c[P], ie = l[P];
14831
14833
  for (let U = 0; U < N; U++) {
14832
14834
  const M = f[U], _ = h[U];
14833
14835
  if (X[_](a, W[M](C)), j)
14834
- for (let re = 0, Te = j.length; re < Te; re++)
14836
+ for (let re = 0, Fe = j.length; re < Fe; re++)
14835
14837
  ie[re][_](a, j[re][M](C));
14836
14838
  }
14837
14839
  }
14838
- n[T] = a, u.push(a), a++;
14840
+ n[F] = a, u.push(a), a++;
14839
14841
  }
14840
14842
  }
14841
14843
  const v = t.clone();
@@ -14846,9 +14848,9 @@ function Ed(t, e = 1e-4) {
14846
14848
  C.itemSize,
14847
14849
  C.normalized
14848
14850
  )), w in l)
14849
- for (let T = 0; T < l[w].length; T++) {
14850
- const E = l[w][T];
14851
- v.morphAttributes[w][T] = new E.constructor(
14851
+ for (let F = 0; F < l[w].length; F++) {
14852
+ const E = l[w][F];
14853
+ v.morphAttributes[w][F] = new E.constructor(
14852
14854
  E.array.slice(0, a * E.itemSize),
14853
14855
  E.itemSize,
14854
14856
  E.normalized
@@ -14906,18 +14908,18 @@ class Ad extends aa {
14906
14908
  return s ? (this.isFound = !0, s.ha * n / r.data.resolution) : (this.isFound = !1, 0);
14907
14909
  }
14908
14910
  }
14909
- class Od {
14911
+ class Ld {
14910
14912
  constructor(e) {
14911
14913
  this.isFont = !0, this.type = "Font", this.data = e;
14912
14914
  }
14913
14915
  generateShapes(e, n = 100) {
14914
- const r = [], s = Ld(e, n, this.data);
14916
+ const r = [], s = Od(e, n, this.data);
14915
14917
  for (let i = 0, a = s.length; i < a; i++)
14916
14918
  r.push(...s[i].toShapes());
14917
14919
  return r;
14918
14920
  }
14919
14921
  }
14920
- function Ld(t, e, n) {
14922
+ function Od(t, e, n) {
14921
14923
  const r = Array.from(t), s = e / n.resolution, i = (n.boundingBox.yMax - n.boundingBox.yMin + n.underlineThickness) * s, a = [];
14922
14924
  let o = 0, c = 0;
14923
14925
  for (let l = 0; l < r.length; l++) {
@@ -14960,7 +14962,7 @@ function Id(t, e, n, r, s) {
14960
14962
  }
14961
14963
  return { offsetX: i.ha * e, path: a };
14962
14964
  }
14963
- class Rd extends Od {
14965
+ class Rd extends Ld {
14964
14966
  /**
14965
14967
  * Generates geometry shapes from the given text and size.
14966
14968
  *
@@ -15187,7 +15189,7 @@ class zd extends ia {
15187
15189
  * @returns An object containing the opentype font and parsed metadata
15188
15190
  */
15189
15191
  parseMeshFont(e) {
15190
- const n = Sd(e), r = Math.round, s = Fd(n), i = {
15192
+ const n = Sd(e), r = Math.round, s = Td(n), i = {
15191
15193
  glyphs: {},
15192
15194
  // Lazy loaded later
15193
15195
  familyName: n.getEnglishName("fullName"),
@@ -15390,11 +15392,11 @@ var wo = { exports: {} }, rs = {}, jn = {};
15390
15392
  jn.byteLength = $d;
15391
15393
  jn.toByteArray = Xd;
15392
15394
  jn.fromByteArray = Jd;
15393
- var Ke = [], Ue = [], qd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15395
+ var Ke = [], Pe = [], qd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15394
15396
  for (var Rt = 0, jd = cr.length; Rt < jd; ++Rt)
15395
- Ke[Rt] = cr[Rt], Ue[cr.charCodeAt(Rt)] = Rt;
15396
- Ue[45] = 62;
15397
- Ue[95] = 63;
15397
+ Ke[Rt] = cr[Rt], Pe[cr.charCodeAt(Rt)] = Rt;
15398
+ Pe[45] = 62;
15399
+ Pe[95] = 63;
15398
15400
  function Co(t) {
15399
15401
  var e = t.length;
15400
15402
  if (e % 4 > 0)
@@ -15414,8 +15416,8 @@ function Yd(t, e, n) {
15414
15416
  function Xd(t) {
15415
15417
  var e, n = Co(t), r = n[0], s = n[1], i = new qd(Yd(t, r, s)), a = 0, o = s > 0 ? r - 4 : r, c;
15416
15418
  for (c = 0; c < o; c += 4)
15417
- e = Ue[t.charCodeAt(c)] << 18 | Ue[t.charCodeAt(c + 1)] << 12 | Ue[t.charCodeAt(c + 2)] << 6 | Ue[t.charCodeAt(c + 3)], i[a++] = e >> 16 & 255, i[a++] = e >> 8 & 255, i[a++] = e & 255;
15418
- return s === 2 && (e = Ue[t.charCodeAt(c)] << 2 | Ue[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Ue[t.charCodeAt(c)] << 10 | Ue[t.charCodeAt(c + 1)] << 4 | Ue[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
15419
+ e = Pe[t.charCodeAt(c)] << 18 | Pe[t.charCodeAt(c + 1)] << 12 | Pe[t.charCodeAt(c + 2)] << 6 | Pe[t.charCodeAt(c + 3)], i[a++] = e >> 16 & 255, i[a++] = e >> 8 & 255, i[a++] = e & 255;
15420
+ return s === 2 && (e = Pe[t.charCodeAt(c)] << 2 | Pe[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Pe[t.charCodeAt(c)] << 10 | Pe[t.charCodeAt(c + 1)] << 4 | Pe[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
15419
15421
  }
15420
15422
  function Kd(t) {
15421
15423
  return Ke[t >> 18 & 63] + Ke[t >> 12 & 63] + Ke[t >> 6 & 63] + Ke[t & 63];
@@ -15617,7 +15619,7 @@ ss.write = function(t, e, n, r, s, i) {
15617
15619
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
15618
15620
  );
15619
15621
  if (d === g) return 0;
15620
- for (var S = d.length, k = g.length, A = 0, L = Math.min(S, k); A < L; ++A)
15622
+ for (var S = d.length, k = g.length, A = 0, O = Math.min(S, k); A < O; ++A)
15621
15623
  if (d[A] !== g[A]) {
15622
15624
  S = d[A], k = g[A];
15623
15625
  break;
@@ -15651,18 +15653,18 @@ ss.write = function(t, e, n, r, s, i) {
15651
15653
  g += d[S].length;
15652
15654
  var k = o.allocUnsafe(g), A = 0;
15653
15655
  for (S = 0; S < d.length; ++S) {
15654
- var L = d[S];
15655
- if (Re(L, Uint8Array))
15656
- A + L.length > k.length ? o.from(L).copy(k, A) : Uint8Array.prototype.set.call(
15656
+ var O = d[S];
15657
+ if (Re(O, Uint8Array))
15658
+ A + O.length > k.length ? o.from(O).copy(k, A) : Uint8Array.prototype.set.call(
15657
15659
  k,
15658
- L,
15660
+ O,
15659
15661
  A
15660
15662
  );
15661
- else if (o.isBuffer(L))
15662
- L.copy(k, A);
15663
+ else if (o.isBuffer(O))
15664
+ O.copy(k, A);
15663
15665
  else
15664
15666
  throw new TypeError('"list" argument must be an Array of Buffers');
15665
- A += L.length;
15667
+ A += O.length;
15666
15668
  }
15667
15669
  return k;
15668
15670
  };
@@ -15702,7 +15704,7 @@ ss.write = function(t, e, n, r, s, i) {
15702
15704
  }
15703
15705
  }
15704
15706
  o.byteLength = C;
15705
- function T(x, d, g) {
15707
+ function F(x, d, g) {
15706
15708
  var S = !1;
15707
15709
  if ((d === void 0 || d < 0) && (d = 0), d > this.length || ((g === void 0 || g > this.length) && (g = this.length), g <= 0) || (g >>>= 0, d >>>= 0, g <= d))
15708
15710
  return "";
@@ -15714,7 +15716,7 @@ ss.write = function(t, e, n, r, s, i) {
15714
15716
  case "utf-8":
15715
15717
  return M(this, d, g);
15716
15718
  case "ascii":
15717
- return Te(this, d, g);
15719
+ return Fe(this, d, g);
15718
15720
  case "latin1":
15719
15721
  case "binary":
15720
15722
  return et(this, d, g);
@@ -15758,7 +15760,7 @@ ss.write = function(t, e, n, r, s, i) {
15758
15760
  return this;
15759
15761
  }, o.prototype.toString = function() {
15760
15762
  var d = this.length;
15761
- return d === 0 ? "" : arguments.length === 0 ? M(this, 0, d) : T.apply(this, arguments);
15763
+ return d === 0 ? "" : arguments.length === 0 ? M(this, 0, d) : F.apply(this, arguments);
15762
15764
  }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(d) {
15763
15765
  if (!o.isBuffer(d)) throw new TypeError("Argument must be a Buffer");
15764
15766
  return this === d ? !0 : o.compare(this, d) === 0;
@@ -15779,12 +15781,12 @@ ss.write = function(t, e, n, r, s, i) {
15779
15781
  if (g >= S)
15780
15782
  return 1;
15781
15783
  if (g >>>= 0, S >>>= 0, k >>>= 0, A >>>= 0, this === d) return 0;
15782
- for (var L = A - k, q = S - g, V = Math.min(L, q), ae = this.slice(k, A), Se = d.slice(g, S), le = 0; le < V; ++le)
15784
+ for (var O = A - k, q = S - g, V = Math.min(O, q), ae = this.slice(k, A), Se = d.slice(g, S), le = 0; le < V; ++le)
15783
15785
  if (ae[le] !== Se[le]) {
15784
- L = ae[le], q = Se[le];
15786
+ O = ae[le], q = Se[le];
15785
15787
  break;
15786
15788
  }
15787
- return L < q ? -1 : q < L ? 1 : 0;
15789
+ return O < q ? -1 : q < O ? 1 : 0;
15788
15790
  };
15789
15791
  function R(x, d, g, S, k) {
15790
15792
  if (x.length === 0) return -1;
@@ -15801,11 +15803,11 @@ ss.write = function(t, e, n, r, s, i) {
15801
15803
  throw new TypeError("val must be string, number or Buffer");
15802
15804
  }
15803
15805
  function P(x, d, g, S, k) {
15804
- var A = 1, L = x.length, q = d.length;
15806
+ var A = 1, O = x.length, q = d.length;
15805
15807
  if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) {
15806
15808
  if (x.length < 2 || d.length < 2)
15807
15809
  return -1;
15808
- A = 2, L /= 2, q /= 2, g /= 2;
15810
+ A = 2, O /= 2, q /= 2, g /= 2;
15809
15811
  }
15810
15812
  function V(us, hs) {
15811
15813
  return A === 1 ? us[hs] : us.readUInt16BE(hs * A);
@@ -15813,13 +15815,13 @@ ss.write = function(t, e, n, r, s, i) {
15813
15815
  var ae;
15814
15816
  if (k) {
15815
15817
  var Se = -1;
15816
- for (ae = g; ae < L; ae++)
15818
+ for (ae = g; ae < O; ae++)
15817
15819
  if (V(x, ae) === V(d, Se === -1 ? 0 : ae - Se)) {
15818
15820
  if (Se === -1 && (Se = ae), ae - Se + 1 === q) return Se * A;
15819
15821
  } else
15820
15822
  Se !== -1 && (ae -= ae - Se), Se = -1;
15821
15823
  } else
15822
- for (g + q > L && (g = L - q), ae = g; ae >= 0; ae--) {
15824
+ for (g + q > O && (g = O - q), ae = g; ae >= 0; ae--) {
15823
15825
  for (var le = !0, un = 0; un < q; un++)
15824
15826
  if (V(x, ae + un) !== V(d, un)) {
15825
15827
  le = !1;
@@ -15842,24 +15844,24 @@ ss.write = function(t, e, n, r, s, i) {
15842
15844
  S ? (S = Number(S), S > k && (S = k)) : S = k;
15843
15845
  var A = d.length;
15844
15846
  S > A / 2 && (S = A / 2);
15845
- for (var L = 0; L < S; ++L) {
15846
- var q = parseInt(d.substr(L * 2, 2), 16);
15847
- if (ve(q)) return L;
15848
- x[g + L] = q;
15847
+ for (var O = 0; O < S; ++O) {
15848
+ var q = parseInt(d.substr(O * 2, 2), 16);
15849
+ if (ve(q)) return O;
15850
+ x[g + O] = q;
15849
15851
  }
15850
- return L;
15852
+ return O;
15851
15853
  }
15852
15854
  function j(x, d, g, S) {
15853
- return Oe(Z(d, x.length - g), x, g, S);
15855
+ return Le(Z(d, x.length - g), x, g, S);
15854
15856
  }
15855
15857
  function N(x, d, g, S) {
15856
- return Oe(xe(d), x, g, S);
15858
+ return Le(xe(d), x, g, S);
15857
15859
  }
15858
15860
  function X(x, d, g, S) {
15859
- return Oe(Ae(d), x, g, S);
15861
+ return Le(Ae(d), x, g, S);
15860
15862
  }
15861
15863
  function ie(x, d, g, S) {
15862
- return Oe(Ee(d, x.length - g), x, g, S);
15864
+ return Le(Ee(d, x.length - g), x, g, S);
15863
15865
  }
15864
15866
  o.prototype.write = function(d, g, S, k) {
15865
15867
  if (g === void 0)
@@ -15876,7 +15878,7 @@ ss.write = function(t, e, n, r, s, i) {
15876
15878
  if ((S === void 0 || S > A) && (S = A), d.length > 0 && (S < 0 || g < 0) || g > this.length)
15877
15879
  throw new RangeError("Attempt to write outside buffer bounds");
15878
15880
  k || (k = "utf8");
15879
- for (var L = !1; ; )
15881
+ for (var O = !1; ; )
15880
15882
  switch (k) {
15881
15883
  case "hex":
15882
15884
  return W(this, d, g, S);
@@ -15895,8 +15897,8 @@ ss.write = function(t, e, n, r, s, i) {
15895
15897
  case "utf-16le":
15896
15898
  return ie(this, d, g, S);
15897
15899
  default:
15898
- if (L) throw new TypeError("Unknown encoding: " + k);
15899
- k = ("" + k).toLowerCase(), L = !0;
15900
+ if (O) throw new TypeError("Unknown encoding: " + k);
15901
+ k = ("" + k).toLowerCase(), O = !0;
15900
15902
  }
15901
15903
  }, o.prototype.toJSON = function() {
15902
15904
  return {
@@ -15910,24 +15912,24 @@ ss.write = function(t, e, n, r, s, i) {
15910
15912
  function M(x, d, g) {
15911
15913
  g = Math.min(x.length, g);
15912
15914
  for (var S = [], k = d; k < g; ) {
15913
- var A = x[k], L = null, q = A > 239 ? 4 : A > 223 ? 3 : A > 191 ? 2 : 1;
15915
+ var A = x[k], O = null, q = A > 239 ? 4 : A > 223 ? 3 : A > 191 ? 2 : 1;
15914
15916
  if (k + q <= g) {
15915
15917
  var V, ae, Se, le;
15916
15918
  switch (q) {
15917
15919
  case 1:
15918
- A < 128 && (L = A);
15920
+ A < 128 && (O = A);
15919
15921
  break;
15920
15922
  case 2:
15921
- V = x[k + 1], (V & 192) === 128 && (le = (A & 31) << 6 | V & 63, le > 127 && (L = le));
15923
+ V = x[k + 1], (V & 192) === 128 && (le = (A & 31) << 6 | V & 63, le > 127 && (O = le));
15922
15924
  break;
15923
15925
  case 3:
15924
- V = x[k + 1], ae = x[k + 2], (V & 192) === 128 && (ae & 192) === 128 && (le = (A & 15) << 12 | (V & 63) << 6 | ae & 63, le > 2047 && (le < 55296 || le > 57343) && (L = le));
15926
+ V = x[k + 1], ae = x[k + 2], (V & 192) === 128 && (ae & 192) === 128 && (le = (A & 15) << 12 | (V & 63) << 6 | ae & 63, le > 2047 && (le < 55296 || le > 57343) && (O = le));
15925
15927
  break;
15926
15928
  case 4:
15927
- V = x[k + 1], ae = x[k + 2], Se = x[k + 3], (V & 192) === 128 && (ae & 192) === 128 && (Se & 192) === 128 && (le = (A & 15) << 18 | (V & 63) << 12 | (ae & 63) << 6 | Se & 63, le > 65535 && le < 1114112 && (L = le));
15929
+ V = x[k + 1], ae = x[k + 2], Se = x[k + 3], (V & 192) === 128 && (ae & 192) === 128 && (Se & 192) === 128 && (le = (A & 15) << 18 | (V & 63) << 12 | (ae & 63) << 6 | Se & 63, le > 65535 && le < 1114112 && (O = le));
15928
15930
  }
15929
15931
  }
15930
- L === null ? (L = 65533, q = 1) : L > 65535 && (L -= 65536, S.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), S.push(L), k += q;
15932
+ O === null ? (O = 65533, q = 1) : O > 65535 && (O -= 65536, S.push(O >>> 10 & 1023 | 55296), O = 56320 | O & 1023), S.push(O), k += q;
15931
15933
  }
15932
15934
  return re(S);
15933
15935
  }
@@ -15943,7 +15945,7 @@ ss.write = function(t, e, n, r, s, i) {
15943
15945
  );
15944
15946
  return g;
15945
15947
  }
15946
- function Te(x, d, g) {
15948
+ function Fe(x, d, g) {
15947
15949
  var S = "";
15948
15950
  g = Math.min(x.length, g);
15949
15951
  for (var k = d; k < g; ++k)
@@ -15981,8 +15983,8 @@ ss.write = function(t, e, n, r, s, i) {
15981
15983
  }
15982
15984
  o.prototype.readUintLE = o.prototype.readUIntLE = function(d, g, S) {
15983
15985
  d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
15984
- for (var k = this[d], A = 1, L = 0; ++L < g && (A *= 256); )
15985
- k += this[d + L] * A;
15986
+ for (var k = this[d], A = 1, O = 0; ++O < g && (A *= 256); )
15987
+ k += this[d + O] * A;
15986
15988
  return k;
15987
15989
  }, o.prototype.readUintBE = o.prototype.readUIntBE = function(d, g, S) {
15988
15990
  d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
@@ -16001,14 +16003,14 @@ ss.write = function(t, e, n, r, s, i) {
16001
16003
  return d = d >>> 0, g || Y(d, 4, this.length), this[d] * 16777216 + (this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3]);
16002
16004
  }, o.prototype.readIntLE = function(d, g, S) {
16003
16005
  d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
16004
- for (var k = this[d], A = 1, L = 0; ++L < g && (A *= 256); )
16005
- k += this[d + L] * A;
16006
+ for (var k = this[d], A = 1, O = 0; ++O < g && (A *= 256); )
16007
+ k += this[d + O] * A;
16006
16008
  return A *= 128, k >= A && (k -= Math.pow(2, 8 * g)), k;
16007
16009
  }, o.prototype.readIntBE = function(d, g, S) {
16008
16010
  d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
16009
- for (var k = g, A = 1, L = this[d + --k]; k > 0 && (A *= 256); )
16010
- L += this[d + --k] * A;
16011
- return A *= 128, L >= A && (L -= Math.pow(2, 8 * g)), L;
16011
+ for (var k = g, A = 1, O = this[d + --k]; k > 0 && (A *= 256); )
16012
+ O += this[d + --k] * A;
16013
+ return A *= 128, O >= A && (O -= Math.pow(2, 8 * g)), O;
16012
16014
  }, o.prototype.readInt8 = function(d, g) {
16013
16015
  return d = d >>> 0, g || Y(d, 1, this.length), this[d] & 128 ? (255 - this[d] + 1) * -1 : this[d];
16014
16016
  }, o.prototype.readInt16LE = function(d, g) {
@@ -16042,18 +16044,18 @@ ss.write = function(t, e, n, r, s, i) {
16042
16044
  var A = Math.pow(2, 8 * S) - 1;
16043
16045
  ne(this, d, g, S, A, 0);
16044
16046
  }
16045
- var L = 1, q = 0;
16046
- for (this[g] = d & 255; ++q < S && (L *= 256); )
16047
- this[g + q] = d / L & 255;
16047
+ var O = 1, q = 0;
16048
+ for (this[g] = d & 255; ++q < S && (O *= 256); )
16049
+ this[g + q] = d / O & 255;
16048
16050
  return g + S;
16049
16051
  }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(d, g, S, k) {
16050
16052
  if (d = +d, g = g >>> 0, S = S >>> 0, !k) {
16051
16053
  var A = Math.pow(2, 8 * S) - 1;
16052
16054
  ne(this, d, g, S, A, 0);
16053
16055
  }
16054
- var L = S - 1, q = 1;
16055
- for (this[g + L] = d & 255; --L >= 0 && (q *= 256); )
16056
- this[g + L] = d / q & 255;
16056
+ var O = S - 1, q = 1;
16057
+ for (this[g + O] = d & 255; --O >= 0 && (q *= 256); )
16058
+ this[g + O] = d / q & 255;
16057
16059
  return g + S;
16058
16060
  }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(d, g, S) {
16059
16061
  return d = +d, g = g >>> 0, S || ne(this, d, g, 1, 255, 0), this[g] = d & 255, g + 1;
@@ -16070,18 +16072,18 @@ ss.write = function(t, e, n, r, s, i) {
16070
16072
  var A = Math.pow(2, 8 * S - 1);
16071
16073
  ne(this, d, g, S, A - 1, -A);
16072
16074
  }
16073
- var L = 0, q = 1, V = 0;
16074
- for (this[g] = d & 255; ++L < S && (q *= 256); )
16075
- d < 0 && V === 0 && this[g + L - 1] !== 0 && (V = 1), this[g + L] = (d / q >> 0) - V & 255;
16075
+ var O = 0, q = 1, V = 0;
16076
+ for (this[g] = d & 255; ++O < S && (q *= 256); )
16077
+ d < 0 && V === 0 && this[g + O - 1] !== 0 && (V = 1), this[g + O] = (d / q >> 0) - V & 255;
16076
16078
  return g + S;
16077
16079
  }, o.prototype.writeIntBE = function(d, g, S, k) {
16078
16080
  if (d = +d, g = g >>> 0, !k) {
16079
16081
  var A = Math.pow(2, 8 * S - 1);
16080
16082
  ne(this, d, g, S, A - 1, -A);
16081
16083
  }
16082
- var L = S - 1, q = 1, V = 0;
16083
- for (this[g + L] = d & 255; --L >= 0 && (q *= 256); )
16084
- d < 0 && V === 0 && this[g + L + 1] !== 0 && (V = 1), this[g + L] = (d / q >> 0) - V & 255;
16084
+ var O = S - 1, q = 1, V = 0;
16085
+ for (this[g + O] = d & 255; --O >= 0 && (q *= 256); )
16086
+ d < 0 && V === 0 && this[g + O + 1] !== 0 && (V = 1), this[g + O] = (d / q >> 0) - V & 255;
16085
16087
  return g + S;
16086
16088
  }, o.prototype.writeInt8 = function(d, g, S) {
16087
16089
  return d = +d, g = g >>> 0, S || ne(this, d, g, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[g] = d & 255, g + 1;
@@ -16143,16 +16145,16 @@ ss.write = function(t, e, n, r, s, i) {
16143
16145
  if (S <= g)
16144
16146
  return this;
16145
16147
  g = g >>> 0, S = S === void 0 ? this.length : S >>> 0, d || (d = 0);
16146
- var L;
16148
+ var O;
16147
16149
  if (typeof d == "number")
16148
- for (L = g; L < S; ++L)
16149
- this[L] = d;
16150
+ for (O = g; O < S; ++O)
16151
+ this[O] = d;
16150
16152
  else {
16151
16153
  var q = o.isBuffer(d) ? d : o.from(d, k), V = q.length;
16152
16154
  if (V === 0)
16153
16155
  throw new TypeError('The value "' + d + '" is invalid for argument "value"');
16154
- for (L = 0; L < S - g; ++L)
16155
- this[L + g] = q[L % V];
16156
+ for (O = 0; O < S - g; ++O)
16157
+ this[O + g] = q[O % V];
16156
16158
  }
16157
16159
  return this;
16158
16160
  };
@@ -16165,13 +16167,13 @@ ss.write = function(t, e, n, r, s, i) {
16165
16167
  }
16166
16168
  function Z(x, d) {
16167
16169
  d = d || 1 / 0;
16168
- for (var g, S = x.length, k = null, A = [], L = 0; L < S; ++L) {
16169
- if (g = x.charCodeAt(L), g > 55295 && g < 57344) {
16170
+ for (var g, S = x.length, k = null, A = [], O = 0; O < S; ++O) {
16171
+ if (g = x.charCodeAt(O), g > 55295 && g < 57344) {
16170
16172
  if (!k) {
16171
16173
  if (g > 56319) {
16172
16174
  (d -= 3) > -1 && A.push(239, 191, 189);
16173
16175
  continue;
16174
- } else if (L + 1 === S) {
16176
+ } else if (O + 1 === S) {
16175
16177
  (d -= 3) > -1 && A.push(239, 191, 189);
16176
16178
  continue;
16177
16179
  }
@@ -16219,14 +16221,14 @@ ss.write = function(t, e, n, r, s, i) {
16219
16221
  return d;
16220
16222
  }
16221
16223
  function Ee(x, d) {
16222
- for (var g, S, k, A = [], L = 0; L < x.length && !((d -= 2) < 0); ++L)
16223
- g = x.charCodeAt(L), S = g >> 8, k = g % 256, A.push(k), A.push(S);
16224
+ for (var g, S, k, A = [], O = 0; O < x.length && !((d -= 2) < 0); ++O)
16225
+ g = x.charCodeAt(O), S = g >> 8, k = g % 256, A.push(k), A.push(S);
16224
16226
  return A;
16225
16227
  }
16226
16228
  function Ae(x) {
16227
16229
  return e.toByteArray(ce(x));
16228
16230
  }
16229
- function Oe(x, d, g, S) {
16231
+ function Le(x, d, g, S) {
16230
16232
  for (var k = 0; k < S && !(k + g >= d.length || k >= x.length); ++k)
16231
16233
  d[k + g] = x[k];
16232
16234
  return k;
@@ -16244,13 +16246,13 @@ ss.write = function(t, e, n, r, s, i) {
16244
16246
  return d;
16245
16247
  }();
16246
16248
  })(rs);
16247
- var Cn = rs, Dt = Cn.Buffer, Pe = {}, Ne;
16248
- for (Ne in Cn)
16249
- Cn.hasOwnProperty(Ne) && (Ne === "SlowBuffer" || Ne === "Buffer" || (Pe[Ne] = Cn[Ne]));
16250
- var _t = Pe.Buffer = {};
16251
- for (Ne in Dt)
16252
- Dt.hasOwnProperty(Ne) && (Ne === "allocUnsafe" || Ne === "allocUnsafeSlow" || (_t[Ne] = Dt[Ne]));
16253
- Pe.Buffer.prototype = Dt.prototype;
16249
+ var Cn = rs, Dt = Cn.Buffer, Ne = {}, Ge;
16250
+ for (Ge in Cn)
16251
+ Cn.hasOwnProperty(Ge) && (Ge === "SlowBuffer" || Ge === "Buffer" || (Ne[Ge] = Cn[Ge]));
16252
+ var _t = Ne.Buffer = {};
16253
+ for (Ge in Dt)
16254
+ Dt.hasOwnProperty(Ge) && (Ge === "allocUnsafe" || Ge === "allocUnsafeSlow" || (_t[Ge] = Dt[Ge]));
16255
+ Ne.Buffer.prototype = Dt.prototype;
16254
16256
  (!_t.from || _t.from === Uint8Array.from) && (_t.from = function(t, e, n) {
16255
16257
  if (typeof t == "number")
16256
16258
  throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof t);
@@ -16266,21 +16268,21 @@ _t.alloc || (_t.alloc = function(t, e, n) {
16266
16268
  var r = Dt(t);
16267
16269
  return !e || e.length === 0 ? r.fill(0) : typeof n == "string" ? r.fill(e, n) : r.fill(e), r;
16268
16270
  });
16269
- if (!Pe.kStringMaxLength)
16271
+ if (!Ne.kStringMaxLength)
16270
16272
  try {
16271
- Pe.kStringMaxLength = process.binding("buffer").kStringMaxLength;
16273
+ Ne.kStringMaxLength = process.binding("buffer").kStringMaxLength;
16272
16274
  } catch {
16273
16275
  }
16274
- Pe.constants || (Pe.constants = {
16275
- MAX_LENGTH: Pe.kMaxLength
16276
- }, Pe.kStringMaxLength && (Pe.constants.MAX_STRING_LENGTH = Pe.kStringMaxLength));
16277
- var xt = Pe, is = {}, To = "\uFEFF";
16276
+ Ne.constants || (Ne.constants = {
16277
+ MAX_LENGTH: Ne.kMaxLength
16278
+ }, Ne.kStringMaxLength && (Ne.constants.MAX_STRING_LENGTH = Ne.kStringMaxLength));
16279
+ var xt = Ne, is = {}, Fo = "\uFEFF";
16278
16280
  is.PrependBOM = as;
16279
16281
  function as(t, e) {
16280
16282
  this.encoder = t, this.addBOM = !0;
16281
16283
  }
16282
16284
  as.prototype.write = function(t) {
16283
- return this.addBOM && (t = To + t, this.addBOM = !1), this.encoder.write(t);
16285
+ return this.addBOM && (t = Fo + t, this.addBOM = !1), this.encoder.write(t);
16284
16286
  };
16285
16287
  as.prototype.end = function() {
16286
16288
  return this.encoder.end();
@@ -16291,7 +16293,7 @@ function os(t, e) {
16291
16293
  }
16292
16294
  os.prototype.write = function(t) {
16293
16295
  var e = this.decoder.write(t);
16294
- return this.pass || !e || (e[0] === To && (e = e.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), e;
16296
+ return this.pass || !e || (e[0] === Fo && (e = e.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), e;
16295
16297
  };
16296
16298
  os.prototype.end = function() {
16297
16299
  return this.decoder.end();
@@ -16301,7 +16303,7 @@ function e0(t, e) {
16301
16303
  for (var n in e)
16302
16304
  Qd(e, n) && (t[n] = e[n]);
16303
16305
  }
16304
- var Fo = e0, lr = {}, ur = {}, mn = { exports: {} };
16306
+ var To = e0, lr = {}, ur = {}, mn = { exports: {} };
16305
16307
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
16306
16308
  var wi;
16307
16309
  function t0() {
@@ -16424,10 +16426,10 @@ function n0() {
16424
16426
  return v <= 127 ? 0 : v >> 5 === 6 ? 2 : v >> 4 === 14 ? 3 : v >> 3 === 30 ? 4 : v >> 6 === 2 ? -1 : -2;
16425
16427
  }
16426
16428
  function a(v, w, C) {
16427
- var T = w.length - 1;
16428
- if (T < C) return 0;
16429
- var E = i(w[T]);
16430
- return E >= 0 ? (E > 0 && (v.lastNeed = E - 1), E) : --T < C || E === -2 ? 0 : (E = i(w[T]), E >= 0 ? (E > 0 && (v.lastNeed = E - 2), E) : --T < C || E === -2 ? 0 : (E = i(w[T]), E >= 0 ? (E > 0 && (E === 2 ? E = 0 : v.lastNeed = E - 3), E) : 0));
16429
+ var F = w.length - 1;
16430
+ if (F < C) return 0;
16431
+ var E = i(w[F]);
16432
+ return E >= 0 ? (E > 0 && (v.lastNeed = E - 1), E) : --F < C || E === -2 ? 0 : (E = i(w[F]), E >= 0 ? (E > 0 && (v.lastNeed = E - 2), E) : --F < C || E === -2 ? 0 : (E = i(w[F]), E >= 0 ? (E > 0 && (E === 2 ? E = 0 : v.lastNeed = E - 3), E) : 0));
16431
16433
  }
16432
16434
  function o(v, w, C) {
16433
16435
  if ((w[0] & 192) !== 128)
@@ -16450,8 +16452,8 @@ function n0() {
16450
16452
  var C = a(this, v, w);
16451
16453
  if (!this.lastNeed) return v.toString("utf8", w);
16452
16454
  this.lastTotal = C;
16453
- var T = v.length - (C - this.lastNeed);
16454
- return v.copy(this.lastChar, 0, T), v.toString("utf8", w, T);
16455
+ var F = v.length - (C - this.lastNeed);
16456
+ return v.copy(this.lastChar, 0, F), v.toString("utf8", w, F);
16455
16457
  }
16456
16458
  function u(v) {
16457
16459
  var w = v && v.length ? this.write(v) : "";
@@ -16461,8 +16463,8 @@ function n0() {
16461
16463
  if ((v.length - w) % 2 === 0) {
16462
16464
  var C = v.toString("utf16le", w);
16463
16465
  if (C) {
16464
- var T = C.charCodeAt(C.length - 1);
16465
- if (T >= 55296 && T <= 56319)
16466
+ var F = C.charCodeAt(C.length - 1);
16467
+ if (F >= 55296 && F <= 56319)
16466
16468
  return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = v[v.length - 2], this.lastChar[1] = v[v.length - 1], C.slice(0, -1);
16467
16469
  }
16468
16470
  return C;
@@ -16493,10 +16495,10 @@ function n0() {
16493
16495
  }
16494
16496
  return ur;
16495
16497
  }
16496
- var hr, Ti;
16498
+ var hr, Fi;
16497
16499
  function r0() {
16498
- if (Ti) return hr;
16499
- Ti = 1;
16500
+ if (Fi) return hr;
16501
+ Fi = 1;
16500
16502
  var t = xt.Buffer;
16501
16503
  hr = {
16502
16504
  // Encodings
@@ -16580,10 +16582,10 @@ function r0() {
16580
16582
  }
16581
16583
  }, hr;
16582
16584
  }
16583
- var nt = {}, Fi;
16585
+ var nt = {}, Ti;
16584
16586
  function s0() {
16585
- if (Fi) return nt;
16586
- Fi = 1;
16587
+ if (Ti) return nt;
16588
+ Ti = 1;
16587
16589
  var t = xt.Buffer;
16588
16590
  nt._utf32 = e;
16589
16591
  function e(l, u) {
@@ -16812,17 +16814,17 @@ function a0() {
16812
16814
  a[o] = i.test(String.fromCharCode(o));
16813
16815
  var c = 43, l = 45, u = 38;
16814
16816
  s.prototype.write = function(m) {
16815
- for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, T = 0; T < m.length; T++)
16817
+ for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, F = 0; F < m.length; F++)
16816
16818
  if (!w)
16817
- m[T] == c && (b += this.iconv.decode(m.slice(v, T), "ascii"), v = T + 1, w = !0);
16818
- else if (!a[m[T]]) {
16819
- if (T == v && m[T] == l)
16819
+ m[F] == c && (b += this.iconv.decode(m.slice(v, F), "ascii"), v = F + 1, w = !0);
16820
+ else if (!a[m[F]]) {
16821
+ if (F == v && m[F] == l)
16820
16822
  b += "+";
16821
16823
  else {
16822
- var E = C + this.iconv.decode(m.slice(v, T), "ascii");
16824
+ var E = C + this.iconv.decode(m.slice(v, F), "ascii");
16823
16825
  b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16824
16826
  }
16825
- m[T] != l && T--, v = T + 1, w = !1, C = "";
16827
+ m[F] != l && F--, v = F + 1, w = !1, C = "";
16826
16828
  }
16827
16829
  if (!w)
16828
16830
  b += this.iconv.decode(m.slice(v), "ascii");
@@ -16843,11 +16845,11 @@ function a0() {
16843
16845
  this.iconv = b.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
16844
16846
  }
16845
16847
  h.prototype.write = function(m) {
16846
- for (var b = this.inBase64, v = this.base64Accum, w = this.base64AccumIdx, C = t.alloc(m.length * 5 + 10), T = 0, E = 0; E < m.length; E++) {
16848
+ for (var b = this.inBase64, v = this.base64Accum, w = this.base64AccumIdx, C = t.alloc(m.length * 5 + 10), F = 0, E = 0; E < m.length; E++) {
16847
16849
  var R = m.charCodeAt(E);
16848
- R >= 32 && R <= 126 ? (b && (w > 0 && (T += C.write(v.slice(0, w).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), T), w = 0), C[T++] = l, b = !1), b || (C[T++] = R, R === u && (C[T++] = l))) : (b || (C[T++] = u, b = !0), b && (v[w++] = R >> 8, v[w++] = R & 255, w == v.length && (T += C.write(v.toString("base64").replace(/\//g, ","), T), w = 0)));
16850
+ R >= 32 && R <= 126 ? (b && (w > 0 && (F += C.write(v.slice(0, w).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), F), w = 0), C[F++] = l, b = !1), b || (C[F++] = R, R === u && (C[F++] = l))) : (b || (C[F++] = u, b = !0), b && (v[w++] = R >> 8, v[w++] = R & 255, w == v.length && (F += C.write(v.toString("base64").replace(/\//g, ","), F), w = 0)));
16849
16851
  }
16850
- return this.inBase64 = b, this.base64AccumIdx = w, C.slice(0, T);
16852
+ return this.inBase64 = b, this.base64AccumIdx = w, C.slice(0, F);
16851
16853
  }, h.prototype.end = function() {
16852
16854
  var m = t.alloc(10), b = 0;
16853
16855
  return this.inBase64 && (this.base64AccumIdx > 0 && (b += m.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), b), this.base64AccumIdx = 0), m[b++] = l, this.inBase64 = !1), m.slice(0, b);
@@ -16857,17 +16859,17 @@ function a0() {
16857
16859
  }
16858
16860
  var y = a.slice();
16859
16861
  return y[44] = !0, p.prototype.write = function(m) {
16860
- for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, T = 0; T < m.length; T++)
16862
+ for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, F = 0; F < m.length; F++)
16861
16863
  if (!w)
16862
- m[T] == u && (b += this.iconv.decode(m.slice(v, T), "ascii"), v = T + 1, w = !0);
16863
- else if (!y[m[T]]) {
16864
- if (T == v && m[T] == l)
16864
+ m[F] == u && (b += this.iconv.decode(m.slice(v, F), "ascii"), v = F + 1, w = !0);
16865
+ else if (!y[m[F]]) {
16866
+ if (F == v && m[F] == l)
16865
16867
  b += "&";
16866
16868
  else {
16867
- var E = C + this.iconv.decode(m.slice(v, T), "ascii").replace(/,/g, "/");
16869
+ var E = C + this.iconv.decode(m.slice(v, F), "ascii").replace(/,/g, "/");
16868
16870
  b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16869
16871
  }
16870
- m[T] != l && T--, v = T + 1, w = !1, C = "";
16872
+ m[F] != l && F--, v = F + 1, w = !1, C = "";
16871
16873
  }
16872
16874
  if (!w)
16873
16875
  b += this.iconv.decode(m.slice(v), "ascii");
@@ -16922,9 +16924,9 @@ function o0() {
16922
16924
  }, r.prototype.end = function() {
16923
16925
  }, fr;
16924
16926
  }
16925
- var pr, Oi;
16927
+ var pr, Li;
16926
16928
  function c0() {
16927
- return Oi || (Oi = 1, pr = {
16929
+ return Li || (Li = 1, pr = {
16928
16930
  // Not supported by iconv, not sure why.
16929
16931
  10029: "maccenteuro",
16930
16932
  maccenteuro: {
@@ -17071,9 +17073,9 @@ function c0() {
17071
17073
  csmacintosh: "macintosh"
17072
17074
  }), pr;
17073
17075
  }
17074
- var dr, Li;
17076
+ var dr, Oi;
17075
17077
  function l0() {
17076
- return Li || (Li = 1, dr = {
17078
+ return Oi || (Oi = 1, dr = {
17077
17079
  437: "cp437",
17078
17080
  737: "cp737",
17079
17081
  775: "cp775",
@@ -17551,12 +17553,12 @@ function u0() {
17551
17553
  var v = this.decodeTables.length;
17552
17554
  this.decodeTables.push(i.slice(0));
17553
17555
  for (var w = this.decodeTables[0], m = 129; m <= 254; m++)
17554
- for (var C = this.decodeTables[s - w[m]], T = 48; T <= 57; T++) {
17555
- if (C[T] === e)
17556
- C[T] = s - b;
17557
- else if (C[T] > s)
17556
+ for (var C = this.decodeTables[s - w[m]], F = 48; F <= 57; F++) {
17557
+ if (C[F] === e)
17558
+ C[F] = s - b;
17559
+ else if (C[F] > s)
17558
17560
  throw new Error("gb18030 decode tables conflict at byte 2");
17559
- for (var E = this.decodeTables[s - C[T]], R = 129; R <= 254; R++) {
17561
+ for (var E = this.decodeTables[s - C[F]], R = 129; R <= 254; R++) {
17560
17562
  if (E[R] === e)
17561
17563
  E[R] = s - v;
17562
17564
  else {
@@ -17578,8 +17580,8 @@ function u0() {
17578
17580
  if (typeof N == "number")
17579
17581
  j[N] = !0;
17580
17582
  else
17581
- for (var T = N.from; T <= N.to; T++)
17582
- j[T] = !0;
17583
+ for (var F = N.from; F <= N.to; F++)
17584
+ j[F] = !0;
17583
17585
  }
17584
17586
  if (this._fillEncodeTable(0, 0, j), h.encodeAdd)
17585
17587
  for (var X in h.encodeAdd)
@@ -17615,7 +17617,7 @@ function u0() {
17615
17617
  else
17616
17618
  throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + h[0]);
17617
17619
  } else if (w > 4080 && w <= 4095) {
17618
- for (var T = 4095 - w + 2, E = [], R = 0; R < T; R++)
17620
+ for (var F = 4095 - w + 2, E = [], R = 0; R < F; R++)
17619
17621
  E.push(b.charCodeAt(v++));
17620
17622
  y[p++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(E);
17621
17623
  } else
@@ -17645,17 +17647,17 @@ function u0() {
17645
17647
  y = h[h.length - 1], v[y] = p;
17646
17648
  }, c.prototype._fillEncodeTable = function(h, p, y) {
17647
17649
  for (var m = this.decodeTables[h], b = !1, v = {}, w = 0; w < 256; w++) {
17648
- var C = m[w], T = p + w;
17649
- if (!y[T])
17650
+ var C = m[w], F = p + w;
17651
+ if (!y[F])
17650
17652
  if (C >= 0)
17651
- this._setEncodeChar(C, T), b = !0;
17653
+ this._setEncodeChar(C, F), b = !0;
17652
17654
  else if (C <= s) {
17653
17655
  var E = s - C;
17654
17656
  if (!v[E]) {
17655
- var R = T << 8 >>> 0;
17657
+ var R = F << 8 >>> 0;
17656
17658
  this._fillEncodeTable(E, R, y) ? b = !0 : v[E] = !0;
17657
17659
  }
17658
- } else C <= r && (this._setEncodeSequence(this.decodeTableSeq[r - C], T), b = !0);
17660
+ } else C <= r && (this._setEncodeSequence(this.decodeTableSeq[r - C], F), b = !0);
17659
17661
  }
17660
17662
  return b;
17661
17663
  };
@@ -17681,30 +17683,30 @@ function u0() {
17681
17683
  else
17682
17684
  y !== -1 ? (C = 65536 + (y - 55296) * 1024 + (C - 56320), y = -1) : C = e;
17683
17685
  else y !== -1 && (b = C, C = e, y = -1);
17684
- var T = e;
17686
+ var F = e;
17685
17687
  if (m !== void 0 && C != e) {
17686
17688
  var E = m[C];
17687
17689
  if (typeof E == "object") {
17688
17690
  m = E;
17689
17691
  continue;
17690
- } else typeof E == "number" ? T = E : E == null && (E = m[a], E !== void 0 && (T = E, b = C));
17692
+ } else typeof E == "number" ? F = E : E == null && (E = m[a], E !== void 0 && (F = E, b = C));
17691
17693
  m = void 0;
17692
17694
  } else if (C >= 0) {
17693
17695
  var R = this.encodeTable[C >> 8];
17694
- if (R !== void 0 && (T = R[C & 255]), T <= r) {
17695
- m = this.encodeTableSeq[r - T];
17696
+ if (R !== void 0 && (F = R[C & 255]), F <= r) {
17697
+ m = this.encodeTableSeq[r - F];
17696
17698
  continue;
17697
17699
  }
17698
- if (T == e && this.gb18030) {
17700
+ if (F == e && this.gb18030) {
17699
17701
  var P = f(this.gb18030.uChars, C);
17700
17702
  if (P != -1) {
17701
- var T = this.gb18030.gbChars[P] + (C - this.gb18030.uChars[P]);
17702
- p[w++] = 129 + Math.floor(T / 12600), T = T % 12600, p[w++] = 48 + Math.floor(T / 1260), T = T % 1260, p[w++] = 129 + Math.floor(T / 10), T = T % 10, p[w++] = 48 + T;
17703
+ var F = this.gb18030.gbChars[P] + (C - this.gb18030.uChars[P]);
17704
+ p[w++] = 129 + Math.floor(F / 12600), F = F % 12600, p[w++] = 48 + Math.floor(F / 1260), F = F % 1260, p[w++] = 129 + Math.floor(F / 10), F = F % 10, p[w++] = 48 + F;
17703
17705
  continue;
17704
17706
  }
17705
17707
  }
17706
17708
  }
17707
- T === e && (T = this.defaultCharSingleByte), T < 256 ? p[w++] = T : T < 65536 ? (p[w++] = T >> 8, p[w++] = T & 255) : T < 16777216 ? (p[w++] = T >> 16, p[w++] = T >> 8 & 255, p[w++] = T & 255) : (p[w++] = T >>> 24, p[w++] = T >>> 16 & 255, p[w++] = T >>> 8 & 255, p[w++] = T & 255);
17709
+ F === e && (F = this.defaultCharSingleByte), F < 256 ? p[w++] = F : F < 65536 ? (p[w++] = F >> 8, p[w++] = F & 255) : F < 16777216 ? (p[w++] = F >> 16, p[w++] = F >> 8 & 255, p[w++] = F & 255) : (p[w++] = F >>> 24, p[w++] = F >>> 16 & 255, p[w++] = F >>> 8 & 255, p[w++] = F & 255);
17708
17710
  }
17709
17711
  return this.seqObj = m, this.leadSurrogate = y, p.slice(0, w);
17710
17712
  }, l.prototype.end = function() {
@@ -17721,7 +17723,7 @@ function u0() {
17721
17723
  this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = p.decodeTables, this.decodeTableSeq = p.decodeTableSeq, this.defaultCharUnicode = p.defaultCharUnicode, this.gb18030 = p.gb18030;
17722
17724
  }
17723
17725
  u.prototype.write = function(h) {
17724
- for (var p = t.alloc(h.length * 2), y = this.nodeIdx, m = this.prevBytes, b = this.prevBytes.length, v = -this.prevBytes.length, w, C = 0, T = 0; C < h.length; C++) {
17726
+ for (var p = t.alloc(h.length * 2), y = this.nodeIdx, m = this.prevBytes, b = this.prevBytes.length, v = -this.prevBytes.length, w, C = 0, F = 0; C < h.length; C++) {
17725
17727
  var E = C >= 0 ? h[C] : m[C + b], w = this.decodeTables[y][E];
17726
17728
  if (!(w >= 0)) if (w === e)
17727
17729
  w = this.defaultCharUnicode.charCodeAt(0), C = v;
@@ -17737,18 +17739,18 @@ function u0() {
17737
17739
  continue;
17738
17740
  } else if (w <= r) {
17739
17741
  for (var W = this.decodeTableSeq[r - w], j = 0; j < W.length - 1; j++)
17740
- w = W[j], p[T++] = w & 255, p[T++] = w >> 8;
17742
+ w = W[j], p[F++] = w & 255, p[F++] = w >> 8;
17741
17743
  w = W[W.length - 1];
17742
17744
  } else
17743
17745
  throw new Error("iconv-lite internal error: invalid decoding table value " + w + " at " + y + "/" + E);
17744
17746
  if (w >= 65536) {
17745
17747
  w -= 65536;
17746
17748
  var N = 55296 | w >> 10;
17747
- p[T++] = N & 255, p[T++] = N >> 8, w = 56320 | w & 1023;
17749
+ p[F++] = N & 255, p[F++] = N >> 8, w = 56320 | w & 1023;
17748
17750
  }
17749
- p[T++] = w & 255, p[T++] = w >> 8, y = 0, v = C + 1;
17751
+ p[F++] = w & 255, p[F++] = w >> 8, y = 0, v = C + 1;
17750
17752
  }
17751
- return this.nodeIdx = y, this.prevBytes = v >= 0 ? Array.prototype.slice.call(h, v) : m.slice(v + b).concat(Array.prototype.slice.call(h)), p.slice(0, T).toString("ucs2");
17753
+ return this.nodeIdx = y, this.prevBytes = v >= 0 ? Array.prototype.slice.call(h, v) : m.slice(v + b).concat(Array.prototype.slice.call(h)), p.slice(0, F).toString("ucs2");
17752
17754
  }, u.prototype.end = function() {
17753
17755
  for (var h = ""; this.prevBytes.length > 0; ) {
17754
17756
  h += this.defaultCharUnicode;
@@ -26283,7 +26285,7 @@ function b0() {
26283
26285
  var Di;
26284
26286
  function x0() {
26285
26287
  return Di || (Di = 1, function(t) {
26286
- for (var e = Fo, n = [
26288
+ for (var e = To, n = [
26287
26289
  r0(),
26288
26290
  s0(),
26289
26291
  i0(),
@@ -26374,7 +26376,7 @@ const S0 = {}, w0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
26374
26376
  default: S0
26375
26377
  }, Symbol.toStringTag, { value: "Module" })), C0 = /* @__PURE__ */ Vd(w0);
26376
26378
  (function(t) {
26377
- var e = xt.Buffer, n = is, r = Fo, s = t.exports;
26379
+ var e = xt.Buffer, n = is, r = To, s = t.exports;
26378
26380
  s.encodings = null, s.defaultCharUnicode = "�", s.defaultCharSingleByte = "?", s.encode = function(o, c, l) {
26379
26381
  o = "" + (o || "");
26380
26382
  var u = s.getEncoder(c, l), f = u.write(o), h = u.end();
@@ -26441,8 +26443,8 @@ const S0 = {}, w0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
26441
26443
  throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
26442
26444
  };
26443
26445
  })(wo);
26444
- var T0 = wo.exports;
26445
- const Ui = /* @__PURE__ */ Wd(T0);
26446
+ var F0 = wo.exports;
26447
+ const Ui = /* @__PURE__ */ Wd(F0);
26446
26448
  class cs extends aa {
26447
26449
  /**
26448
26450
  * Creates a new SHX text shape wrapper.
@@ -26647,7 +26649,7 @@ const ft = class ft extends ia {
26647
26649
  maxEntries: this.layoutShapeCache.capacity,
26648
26650
  estimatedBytes: n
26649
26651
  }, s = Math.round(
26650
- this.sourceByteLength * Tc
26652
+ this.sourceByteLength * Fc
26651
26653
  ), i = s + e.estimatedBytes + r.estimatedBytes;
26652
26654
  return {
26653
26655
  names: Array.from(this.names),
@@ -26745,7 +26747,7 @@ class $ {
26745
26747
  fontNotFound: new gs(),
26746
26748
  /** Event triggered when a font is successfully loaded */
26747
26749
  fontLoaded: new gs()
26748
- }, this.fontRequestInFlight = /* @__PURE__ */ new Map(), this.fontRequestFailed = /* @__PURE__ */ new Set(), this.loadEpoch = 0, this.loader = new I.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new F0();
26750
+ }, this.fontRequestInFlight = /* @__PURE__ */ new Map(), this.fontRequestFailed = /* @__PURE__ */ new Set(), this.loadEpoch = 0, this.loader = new I.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new T0();
26749
26751
  }
26750
26752
  /**
26751
26753
  * Gets the singleton instance of the FontManager
@@ -26829,7 +26831,7 @@ class $ {
26829
26831
  const i = lt(s.file).toLowerCase();
26830
26832
  n.set(i, { ...s, source: "remote" });
26831
26833
  }
26832
- const r = await ze.instance.getAll();
26834
+ const r = await Ue.instance.getAll();
26833
26835
  for (const s of r) {
26834
26836
  const i = s.name.toLowerCase();
26835
26837
  n.has(i) || n.set(i, this.cachedFontDataToFontInfo(s));
@@ -26888,7 +26890,7 @@ class $ {
26888
26890
  const r = this.fontRequestInFlight.get(n);
26889
26891
  if (r)
26890
26892
  return r;
26891
- const s = this.loadEpoch, i = this.loadFontsByNames(n).then((a) => (s !== this.loadEpoch || (this.isFontLoaded(n) ? this.fontRequestFailed.delete(n) : this.fontRequestFailed.add(n)), a)).catch(() => (s === this.loadEpoch && this.fontRequestFailed.add(n), [
26893
+ const s = this.loadEpoch, i = this.loadFontsByNames(n).then((a) => (s !== this.loadEpoch || (this.isFontLoaded(n) ? this.fontRequestFailed.delete(n) : a.some((c) => c.status === "FailedToLoad") && this.fontRequestFailed.add(n)), a)).catch(() => (s === this.loadEpoch && this.fontRequestFailed.add(n), [
26892
26894
  {
26893
26895
  fontName: n,
26894
26896
  url: "",
@@ -26914,7 +26916,7 @@ class $ {
26914
26916
  return "";
26915
26917
  let n = String(e);
26916
26918
  const r = n.lastIndexOf(".");
26917
- return (r > 0 && r == n.length - 4 || r == n.length - 5) && (n = n.substring(0, r)), n.toLowerCase();
26919
+ return r > 0 && (r === n.length - 4 || r === n.length - 5) && (n = n.substring(0, r)), n.toLowerCase();
26918
26920
  }
26919
26921
  /**
26920
26922
  * Parses a user-uploaded font file, registers it for rendering, and stores
@@ -26965,7 +26967,7 @@ class $ {
26965
26967
  };
26966
26968
  try {
26967
26969
  const f = Ze.instance.createFont(u);
26968
- return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await ze.instance.set(o, u), this.events.fontLoaded.dispatch({ fontName: o }), {
26970
+ return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await Ue.instance.set(o, u), this.events.fontLoaded.dispatch({ fontName: o }), {
26969
26971
  fontName: o,
26970
26972
  url: "",
26971
26973
  status: "Success"
@@ -26992,7 +26994,7 @@ class $ {
26992
26994
  const n = lt(e).toLowerCase();
26993
26995
  if (this.isFontLoaded(n))
26994
26996
  return !0;
26995
- const r = await ze.instance.find(e);
26997
+ const r = await Ue.instance.find(e);
26996
26998
  if (!r)
26997
26999
  return !1;
26998
27000
  try {
@@ -27017,12 +27019,12 @@ class $ {
27017
27019
  s.forEach((i, a) => {
27018
27020
  const o = e[a].url, c = lt(
27019
27021
  e[a].file || o
27020
- ).toLowerCase(), l = i.status === "fulfilled" && this.isFontLoaded(c);
27022
+ ).toLowerCase(), l = e[a].name ?? [], u = i.status === "fulfilled" && (this.isFontLoaded(c) || l.some((f) => this.isFontLoaded(f)));
27021
27023
  r.push({
27022
27024
  fontName: c,
27023
27025
  url: o,
27024
- status: l ? "Success" : "FailedToLoad"
27025
- }), l && this.fileNames.push(c);
27026
+ status: u ? "Success" : "FailedToLoad"
27027
+ }), u && this.fileNames.push(c);
27026
27028
  });
27027
27029
  }), r;
27028
27030
  }
@@ -27046,7 +27048,7 @@ class $ {
27046
27048
  return s = this.loadedFontMap.get(c.toLowerCase()), !s && this.lazyFontLoading && this.requestFont(c), this.recordMissedFonts(r, !1), c;
27047
27049
  }
27048
27050
  if (s)
27049
- return n;
27051
+ return r || n;
27050
27052
  this.recordMissedFonts(r, !0);
27051
27053
  const i = this.pickLoadedDefaultFont(!0);
27052
27054
  if (i)
@@ -27081,7 +27083,7 @@ class $ {
27081
27083
  getFontByName(e, n = !0) {
27082
27084
  e == null && (e = "");
27083
27085
  const r = e.lastIndexOf(".");
27084
- (r > 0 && r == e.length - 4 || r == e.length - 5) && (e = e.substring(0, r));
27086
+ r > 0 && (r === e.length - 4 || r === e.length - 5) && (e = e.substring(0, r));
27085
27087
  const s = this.loadedFontMap.get(e.toLowerCase());
27086
27088
  if (!s) {
27087
27089
  n && this.recordMissedFonts(e);
@@ -27162,7 +27164,7 @@ class $ {
27162
27164
  * @returns The scale factor for the font, or 1 if the font is not found
27163
27165
  */
27164
27166
  getFontScaleFactor(e) {
27165
- const n = this.loadedFontMap.get(e.toLowerCase());
27167
+ const n = this.getFontByName(e, !1);
27166
27168
  return n ? n.getScaleFactor() : 1;
27167
27169
  }
27168
27170
  /**
@@ -27171,8 +27173,8 @@ class $ {
27171
27173
  * @returns The type of the font. If the specified font can't be found, `undefined` is returned
27172
27174
  */
27173
27175
  getFontType(e) {
27174
- const n = this.loadedFontMap.get(e.toLowerCase());
27175
- return n == null ? void 0 : n.type;
27176
+ var n;
27177
+ return (n = this.getFontByName(e, !1)) == null ? void 0 : n.type;
27176
27178
  }
27177
27179
  /**
27178
27180
  * Gets the type of the SHX font. Such as BIGFONT, SHAPES, UNIFONT.
@@ -27180,7 +27182,7 @@ class $ {
27180
27182
  * @returns The type of the SHX font, or undefined if the specified font is not a SHX font
27181
27183
  */
27182
27184
  getShxFontType(e) {
27183
- const n = this.loadedFontMap.get(e.toLowerCase());
27185
+ const n = this.getFontByName(e, !1);
27184
27186
  return (n == null ? void 0 : n.type) === "shx" ? n.data.header.fontType : void 0;
27185
27187
  }
27186
27188
  /**
@@ -27200,7 +27202,8 @@ class $ {
27200
27202
  * @returns True if the font is loaded, false otherwise
27201
27203
  */
27202
27204
  isFontLoaded(e) {
27203
- return this.loadedFontMap.has(e.toLowerCase());
27205
+ const n = this.normalizeFontName(e);
27206
+ return !!n && this.loadedFontMap.has(n);
27204
27207
  }
27205
27208
  /**
27206
27209
  * Applies a missed-font report from another isolate (e.g. a web worker).
@@ -27247,7 +27250,7 @@ class $ {
27247
27250
  if (!e)
27248
27251
  return e;
27249
27252
  const n = e.lastIndexOf(".");
27250
- return n > 0 && n == e.length - 4 || n == e.length - 5 ? e.substring(0, n) : e;
27253
+ return n > 0 && (n === e.length - 4 || n === e.length - 5) ? e.substring(0, n) : e;
27251
27254
  }
27252
27255
  /**
27253
27256
  * Removes {@link missedFonts} entries whose name matches `fontName`
@@ -27294,13 +27297,13 @@ class $ {
27294
27297
  async persistCatalogAliases(e, n) {
27295
27298
  if (!this.enableFontCache)
27296
27299
  return;
27297
- const r = await ze.instance.get(e);
27300
+ const r = await Ue.instance.get(e);
27298
27301
  if (!r)
27299
27302
  return;
27300
27303
  const s = [
27301
27304
  .../* @__PURE__ */ new Set([...r.alias ?? [], ...n, e])
27302
27305
  ], i = r.alias ?? [];
27303
- s.length === i.length && s.every((a) => i.includes(a)) || await ze.instance.set(e, {
27306
+ s.length === i.length && s.every((a) => i.includes(a)) || await Ue.instance.set(e, {
27304
27307
  ...r,
27305
27308
  alias: s
27306
27309
  });
@@ -27326,32 +27329,41 @@ class $ {
27326
27329
  this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27327
27330
  return;
27328
27331
  }
27329
- const a = this.loadEpoch, o = await ze.instance.get(s);
27330
- if (a === this.loadEpoch) {
27331
- if (o) {
27332
- if (await new Promise((l) => setTimeout(l, 0)), a !== this.loadEpoch)
27333
- return;
27334
- if (this.isFontLoaded(s)) {
27335
- this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27336
- return;
27337
- }
27338
- const c = Ze.instance.createFont(o);
27339
- c && (this.applyCatalogNames(c, i), this.registerFontInMap(s, c), await this.persistCatalogAliases(s, i));
27340
- } else {
27341
- const c = await this.loader.loadAsync(e.url);
27342
- if (a !== this.loadEpoch || (r.data = c, await new Promise((u) => setTimeout(u, 0)), a !== this.loadEpoch))
27343
- return;
27344
- if (this.isFontLoaded(s)) {
27345
- this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27346
- return;
27332
+ const a = this.loadEpoch, o = this.enableFontCache ? await Ue.instance.get(s) : void 0;
27333
+ if (a !== this.loadEpoch)
27334
+ return;
27335
+ let c = !1;
27336
+ if (o) {
27337
+ if (await new Promise((l) => setTimeout(l, 0)), a !== this.loadEpoch)
27338
+ return;
27339
+ if (this.isFontLoaded(s)) {
27340
+ this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27341
+ return;
27342
+ }
27343
+ try {
27344
+ const l = Ze.instance.createFont(o);
27345
+ l && (this.applyCatalogNames(l, i), this.registerFontInMap(s, l), await this.persistCatalogAliases(s, i), c = !0);
27346
+ } catch {
27347
+ try {
27348
+ await Ue.instance.delete(s);
27349
+ } catch {
27347
27350
  }
27348
- const l = Ze.instance.createFont(r);
27349
- l && (this.applyCatalogNames(l, i), this.registerFontInMap(s, l), this.enableFontCache && await ze.instance.set(s, r));
27350
27351
  }
27351
- a !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearRequestStateForNames([s, ...i]), this.events.fontLoaded.dispatch({
27352
- fontName: s
27353
- }));
27354
27352
  }
27353
+ if (!c && !this.isFontLoaded(s)) {
27354
+ const l = await this.loader.loadAsync(e.url);
27355
+ if (a !== this.loadEpoch || (r.data = l, await new Promise((f) => setTimeout(f, 0)), a !== this.loadEpoch))
27356
+ return;
27357
+ if (this.isFontLoaded(s)) {
27358
+ this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27359
+ return;
27360
+ }
27361
+ const u = Ze.instance.createFont(r);
27362
+ u && (this.applyCatalogNames(u, i), this.registerFontInMap(s, u), this.enableFontCache && await Ue.instance.set(s, r));
27363
+ }
27364
+ a !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearRequestStateForNames([s, ...i]), this.events.fontLoaded.dispatch({
27365
+ fontName: s
27366
+ }));
27355
27367
  }
27356
27368
  fontInfoToFontData(e) {
27357
27369
  const n = lt(e.file).toLowerCase(), r = ["ttf", "otf", "woff"].includes(e.type) ? "mesh" : e.type;
@@ -27368,7 +27380,7 @@ class $ {
27368
27380
  async getAllFontsFromCache() {
27369
27381
  if (this.loadedFontMap.size !== 0)
27370
27382
  return;
27371
- const e = await ze.instance.getAll();
27383
+ const e = await Ue.instance.getAll();
27372
27384
  for (const n of e) {
27373
27385
  const { name: r } = n;
27374
27386
  if (this.fileNames && !this.fileNames.includes(r))
@@ -27461,7 +27473,9 @@ class $ {
27461
27473
  const n = /* @__PURE__ */ new Set();
27462
27474
  for (const a of this.loadedFontMap.values())
27463
27475
  n.add(a);
27464
- const r = Array.from(n).map((a) => a.estimateMemoryUsage()), s = (e == null ? void 0 : e.materials) ?? da(), i = r.reduce((a, o) => a + o.estimatedBytes, 0);
27476
+ const r = Array.from(n).map(
27477
+ (a) => a.estimateMemoryUsage()
27478
+ ), s = (e == null ? void 0 : e.materials) ?? da(), i = r.reduce((a, o) => a + o.estimatedBytes, 0);
27465
27479
  return {
27466
27480
  id: (e == null ? void 0 : e.id) ?? "main",
27467
27481
  inFlightRequests: e == null ? void 0 : e.inFlightRequests,
@@ -27471,12 +27485,12 @@ class $ {
27471
27485
  };
27472
27486
  }
27473
27487
  }
27474
- class F0 {
27488
+ class T0 {
27475
27489
  /**
27476
27490
  * Creates a new instance of DefaultFontLoader
27477
27491
  */
27478
27492
  constructor() {
27479
- this._availableFontsPromise = null, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
27493
+ this._availableFontsPromise = null, this._catalogRefreshAttempted = !1, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
27480
27494
  }
27481
27495
  /**
27482
27496
  * Base URL to load fonts
@@ -27485,7 +27499,7 @@ class F0 {
27485
27499
  return this._baseUrl;
27486
27500
  }
27487
27501
  set baseUrl(e) {
27488
- this._baseUrl !== e && (this._baseUrl = e, this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null, this.onFontUrlChanged(e));
27502
+ this._baseUrl !== e && (this._baseUrl = e, this.clearAvailableFontsCache(), this._catalogRefreshAttempted = !1, this.onFontUrlChanged(e));
27489
27503
  }
27490
27504
  /**
27491
27505
  * Gets the list of available fonts
@@ -27528,81 +27542,99 @@ class F0 {
27528
27542
  async load(e) {
27529
27543
  if (e == null || e.length === 0)
27530
27544
  return [];
27531
- await this.getAvailableFonts();
27532
- const n = [], r = [], s = /* @__PURE__ */ new Map();
27533
- e.forEach((c) => {
27534
- const l = c.toLowerCase(), u = this._avaiableFontMap.get(l);
27535
- u && (s.set(l, u), $.instance.isFontLoaded(l) && n.push({
27536
- fontName: l,
27537
- url: u.url,
27545
+ await this.getAvailableFonts(), e.some(
27546
+ (l) => !this._avaiableFontMap.has(l.toLowerCase())
27547
+ ) && !this._catalogRefreshAttempted && (this._catalogRefreshAttempted = !0, await this.refreshAvailableFontsFromNetwork());
27548
+ const r = [], s = [], i = /* @__PURE__ */ new Map();
27549
+ e.forEach((l) => {
27550
+ const u = l.toLowerCase(), f = this._avaiableFontMap.get(u);
27551
+ f && (i.set(u, f), $.instance.isFontLoaded(u) && r.push({
27552
+ fontName: u,
27553
+ url: f.url,
27538
27554
  status: "Success"
27539
- }), r.push(u));
27555
+ }), s.push(f));
27540
27556
  });
27541
- const i = await $.instance.loadFonts(r), a = {};
27542
- [...n, ...i].forEach((c) => {
27543
- a[c.fontName] = c;
27557
+ const a = await $.instance.loadFonts(s), o = {};
27558
+ [...r, ...a].forEach((l) => {
27559
+ o[l.fontName] = l;
27544
27560
  });
27545
- const o = [];
27546
- for (const c of e) {
27547
- const l = c.toLowerCase(), u = a[l];
27548
- if (u) {
27549
- o.push(u);
27561
+ const c = [];
27562
+ for (const l of e) {
27563
+ const u = l.toLowerCase(), f = o[u];
27564
+ if (f) {
27565
+ c.push(f);
27550
27566
  continue;
27551
27567
  }
27552
- const f = s.get(l);
27553
- if (f) {
27554
- if ($.instance.isFontLoaded(l)) {
27555
- o.push({
27556
- fontName: l,
27557
- url: f.url,
27568
+ const h = i.get(u);
27569
+ if (h) {
27570
+ if ($.instance.isFontLoaded(u)) {
27571
+ c.push({
27572
+ fontName: u,
27573
+ url: h.url,
27558
27574
  status: "Success"
27559
27575
  });
27560
27576
  continue;
27561
27577
  }
27562
- const h = lt(
27563
- f.file
27564
- ).toLowerCase(), p = a[h];
27565
- if (p) {
27566
- o.push({
27567
- fontName: l,
27568
- url: f.url,
27569
- status: p.status
27578
+ const p = lt(
27579
+ h.file
27580
+ ).toLowerCase(), y = o[p];
27581
+ if (y) {
27582
+ c.push({
27583
+ fontName: u,
27584
+ url: h.url,
27585
+ status: y.status
27570
27586
  });
27571
27587
  continue;
27572
27588
  }
27573
27589
  }
27574
- if (await $.instance.loadFontFromCache(c)) {
27575
- o.push({
27576
- fontName: l,
27590
+ if (await $.instance.loadFontFromCache(l)) {
27591
+ c.push({
27592
+ fontName: u,
27577
27593
  url: "",
27578
27594
  status: "Success"
27579
27595
  });
27580
27596
  continue;
27581
27597
  }
27582
- o.push({
27583
- fontName: l,
27598
+ c.push({
27599
+ fontName: u,
27584
27600
  url: "",
27585
27601
  status: "NotFound"
27586
27602
  });
27587
27603
  }
27588
- return o;
27604
+ return c;
27605
+ }
27606
+ clearAvailableFontsCache() {
27607
+ this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null;
27608
+ }
27609
+ /**
27610
+ * Drops the in-memory catalog and refetches `fonts.json`, bypassing the HTTP
27611
+ * cache so CDN updates are visible after a miss.
27612
+ */
27613
+ async refreshAvailableFontsFromNetwork() {
27614
+ this.clearAvailableFontsCache();
27615
+ const e = this._baseUrl, n = this.fetchAvailableFonts(e, {
27616
+ bypassHttpCache: !0
27617
+ }).finally(() => {
27618
+ this._availableFontsPromise === n && (this._availableFontsPromise = null);
27619
+ });
27620
+ return this._availableFontsPromise = n, n;
27589
27621
  }
27590
27622
  /**
27591
27623
  * Fetches and caches remote font metadata for the given base URL.
27592
27624
  */
27593
- async fetchAvailableFonts(e) {
27594
- const n = e + "fonts.json";
27595
- let r;
27625
+ async fetchAvailableFonts(e, n) {
27626
+ const r = e + "fonts.json";
27627
+ let s;
27596
27628
  try {
27597
- r = await (await fetch(n)).json();
27598
- } catch (s) {
27629
+ s = await (n != null && n.bypassHttpCache ? await fetch(r, { cache: "no-cache" }) : await fetch(r)).json();
27630
+ } catch (i) {
27599
27631
  throw new Error(
27600
- `Filed to get avaiable font from '${n}' due to ${s}!`
27632
+ `Filed to get avaiable font from '${r}' due to ${i}!`
27601
27633
  );
27602
27634
  }
27603
- return this._baseUrl !== e ? this.getAvailableFonts() : (r.forEach((s) => {
27604
- s.url = e + s.file;
27605
- }), this._avaiableFonts = r, this.buildFontMap(), this._avaiableFonts);
27635
+ return this._baseUrl !== e ? this.getAvailableFonts() : (s.forEach((i) => {
27636
+ i.url = e + i.file;
27637
+ }), this._avaiableFonts = s, this.buildFontMap(), this._avaiableFonts);
27606
27638
  }
27607
27639
  /**
27608
27640
  * Build one font map. The key is font name. The value is font info.
@@ -27638,24 +27670,24 @@ function E0() {
27638
27670
  }
27639
27671
  function Pi(t, e = "") {
27640
27672
  const n = [
27641
- `${e}${t.id}: ${Le(t.totalEstimatedBytes)}` + (t.inFlightRequests != null ? ` (in-flight: ${t.inFlightRequests})` : "")
27673
+ `${e}${t.id}: ${Oe(t.totalEstimatedBytes)}` + (t.inFlightRequests != null ? ` (in-flight: ${t.inFlightRequests})` : "")
27642
27674
  ];
27643
27675
  if (n.push(
27644
- `${e} materials: mesh=${t.materials.meshCount}, line=${t.materials.lineCount}, ~${Le(t.materials.estimatedBytes)}`
27676
+ `${e} materials: mesh=${t.materials.meshCount}, line=${t.materials.lineCount}, ~${Oe(t.materials.estimatedBytes)}`
27645
27677
  ), t.fonts.length === 0)
27646
27678
  return n.push(`${e} fonts: (none)`), n;
27647
27679
  for (const r of t.fonts) {
27648
27680
  const s = r.names[0] ?? "(unnamed)";
27649
27681
  n.push(
27650
- `${e} font "${s}" [${r.type}]: ~${Le(r.estimatedBytes)}`
27682
+ `${e} font "${s}" [${r.type}]: ~${Oe(r.estimatedBytes)}`
27651
27683
  ), n.push(
27652
- `${e} source=${Le(r.sourceByteLength)}, parsed~=${Le(r.parsedFontEstimatedBytes)}`
27684
+ `${e} source=${Oe(r.sourceByteLength)}, parsed~=${Oe(r.parsedFontEstimatedBytes)}`
27653
27685
  ), n.push(
27654
- `${e} charGeometry: ${r.charGeometryCache.entries}/${r.charGeometryCache.maxEntries} ~${Le(r.charGeometryCache.estimatedBytes)}`
27686
+ `${e} charGeometry: ${r.charGeometryCache.entries}/${r.charGeometryCache.maxEntries} ~${Oe(r.charGeometryCache.estimatedBytes)}`
27655
27687
  ), r.meshGlyphs && n.push(
27656
- `${e} meshGlyphs: ${r.meshGlyphs.glyphCount} glyphs, outlines=${Le(r.meshGlyphs.outlineStringBytes)}`
27688
+ `${e} meshGlyphs: ${r.meshGlyphs.glyphCount} glyphs, outlines=${Oe(r.meshGlyphs.outlineStringBytes)}`
27657
27689
  ), r.shxLayoutCache && n.push(
27658
- `${e} shxLayout: ${r.shxLayoutCache.entries}/${r.shxLayoutCache.maxEntries} ~${Le(r.shxLayoutCache.estimatedBytes)}`
27690
+ `${e} shxLayout: ${r.shxLayoutCache.entries}/${r.shxLayoutCache.maxEntries} ~${Oe(r.shxLayoutCache.estimatedBytes)}`
27659
27691
  );
27660
27692
  }
27661
27693
  return n;
@@ -27663,10 +27695,10 @@ function Pi(t, e = "") {
27663
27695
  function r1(t) {
27664
27696
  const e = [
27665
27697
  `mtext-renderer memory estimate @ ${new Date(t.collectedAt).toISOString()}`,
27666
- `total (live isolates): ${Le(t.totalEstimatedBytes)}`
27698
+ `total (live isolates): ${Oe(t.totalEstimatedBytes)}`
27667
27699
  ];
27668
27700
  if (t.jsHeap && e.push(
27669
- `jsHeap: used=${Le(t.jsHeap.usedJSHeapSize)}, total=${Le(t.jsHeap.totalJSHeapSize)}, limit=${Le(t.jsHeap.jsHeapSizeLimit)}`
27701
+ `jsHeap: used=${Oe(t.jsHeap.usedJSHeapSize)}, total=${Oe(t.jsHeap.totalJSHeapSize)}, limit=${Oe(t.jsHeap.jsHeapSizeLimit)}`
27670
27702
  ), e.push(...Pi(t.mainThread)), t.workers.length === 0)
27671
27703
  e.push("workers: (none)");
27672
27704
  else {
@@ -27676,10 +27708,10 @@ function r1(t) {
27676
27708
  }
27677
27709
  const n = t.indexedDbFontCache;
27678
27710
  e.push(
27679
- `indexedDbFontCache (not in total): ${n.fontCount} fonts, ${Le(n.totalBytes)}`
27711
+ `indexedDbFontCache (not in total): ${n.fontCount} fonts, ${Oe(n.totalBytes)}`
27680
27712
  );
27681
27713
  for (const r of n.fonts)
27682
- e.push(` ${r.name} [${r.type}]: ${Le(r.bytes)}`);
27714
+ e.push(` ${r.name} [${r.type}]: ${Oe(r.bytes)}`);
27683
27715
  return e.join(`
27684
27716
  `);
27685
27717
  }
@@ -27704,14 +27736,14 @@ const A0 = {
27704
27736
  d: "°",
27705
27737
  p: "±",
27706
27738
  "%": "%"
27707
- }, O0 = {
27739
+ }, L0 = {
27708
27740
  l: oe.LEFT,
27709
27741
  r: oe.RIGHT,
27710
27742
  c: oe.CENTER,
27711
27743
  j: oe.JUSTIFIED,
27712
27744
  d: oe.DISTRIBUTED
27713
27745
  };
27714
- function L0(t) {
27746
+ function O0(t) {
27715
27747
  const [e, n, r] = t;
27716
27748
  return e << 16 | n << 8 | r;
27717
27749
  }
@@ -27769,7 +27801,7 @@ function B0(t) {
27769
27801
  const u = Number.parseFloat(l);
27770
27802
  return Ni(u);
27771
27803
  }, a = i(s[0]), o = i(s[1]), c = i(s[2]);
27772
- return L0([a, o, c]);
27804
+ return O0([a, o, c]);
27773
27805
  }
27774
27806
  function i1(t) {
27775
27807
  return t.replace(/\r\n|\r|\n/g, "\\P");
@@ -28266,7 +28298,7 @@ class _0 {
28266
28298
  break;
28267
28299
  case "q": {
28268
28300
  const u = n.get();
28269
- for (a = O0[u] || oe.DEFAULT; n.peek() === ","; )
28301
+ for (a = L0[u] || oe.DEFAULT; n.peek() === ","; )
28270
28302
  n.consume(1);
28271
28303
  break;
28272
28304
  }
@@ -28931,8 +28963,8 @@ function P0(t, e, n, r) {
28931
28963
  };
28932
28964
  }
28933
28965
  const N0 = 5 / 3, Gi = 1, bn = 0.3;
28934
- var Ge = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(Ge || {}), Q = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t[t.BaselineLeft = 10] = "BaselineLeft", t[t.BaselineCenter = 11] = "BaselineCenter", t[t.BaselineRight = 12] = "BaselineRight", t))(Q || {}), ue = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.STACK = "STACK", t))(ue || {});
28935
- const Tn = "", Ie = () => ({
28966
+ var He = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(He || {}), Q = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t[t.BaselineLeft = 10] = "BaselineLeft", t[t.BaselineCenter = 11] = "BaselineCenter", t[t.BaselineRight = 12] = "BaselineRight", t))(Q || {}), ue = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.STACK = "STACK", t))(ue || {});
28967
+ const Fn = "", Ie = () => ({
28936
28968
  byLayerColor: 16777215,
28937
28969
  byBlockColor: 16777215,
28938
28970
  layer: "0",
@@ -28951,7 +28983,7 @@ function G0(t) {
28951
28983
  }
28952
28984
  function Hr(t, e, n) {
28953
28985
  const r = [];
28954
- if (t.filter((h) => h.char !== Tn).forEach((h) => {
28986
+ if (t.filter((h) => h.char !== Fn).forEach((h) => {
28955
28987
  const p = G0(
28956
28988
  new I.Box3().copy(h.box).applyMatrix4(e)
28957
28989
  );
@@ -29552,7 +29584,7 @@ class $i {
29552
29584
  if (!r)
29553
29585
  return;
29554
29586
  this._lineBatchEntries = [];
29555
- const s = [], i = [], a = [], o = [], c = this.flowDirection === Ge.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, l = this.buildShapeGeometry(
29587
+ const s = [], i = [], a = [], o = [], c = this.flowDirection === He.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, l = this.buildShapeGeometry(
29556
29588
  r.shape,
29557
29589
  r.label,
29558
29590
  0,
@@ -29878,20 +29910,20 @@ class $i {
29878
29910
  this._hOffset = l, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
29879
29911
  let y = 0;
29880
29912
  for (const C of a) {
29881
- const T = this.getCharShape(C);
29882
- T && (y += T.width * this.currentWidthFactor);
29913
+ const F = this.getCharShape(C);
29914
+ F && (y += F.width * this.currentWidthFactor);
29883
29915
  }
29884
29916
  this._hOffset = l;
29885
29917
  let m = 0;
29886
29918
  for (const C of o) {
29887
- const T = this.getCharShape(C);
29888
- T && (m += T.width * this.currentWidthFactor);
29919
+ const F = this.getCharShape(C);
29920
+ F && (m += F.width * this.currentWidthFactor);
29889
29921
  }
29890
29922
  const b = Math.max(y, m), v = (b - y) / 2, w = (b - m) / 2;
29891
29923
  if (c === "^") {
29892
29924
  if (a && !o) {
29893
29925
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29894
- const C = [], T = [], E = [], R = [];
29926
+ const C = [], F = [], E = [], R = [];
29895
29927
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29896
29928
  u + h * 0.1,
29897
29929
  this.currentFontSize
@@ -29900,14 +29932,14 @@ class $i {
29900
29932
  this.processChar(
29901
29933
  P,
29902
29934
  C,
29903
- T,
29935
+ F,
29904
29936
  E,
29905
29937
  R
29906
29938
  );
29907
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29939
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29908
29940
  } else if (!a && o) {
29909
29941
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29910
- const C = [], T = [], E = [], R = [];
29942
+ const C = [], F = [], E = [], R = [];
29911
29943
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29912
29944
  u - h * 0.6,
29913
29945
  this.currentFontSize
@@ -29916,15 +29948,15 @@ class $i {
29916
29948
  this.processChar(
29917
29949
  P,
29918
29950
  C,
29919
- T,
29951
+ F,
29920
29952
  E,
29921
29953
  R
29922
29954
  );
29923
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + m, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29955
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), this._hOffset = l + m, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29924
29956
  } else if (a && o) {
29925
- const C = this._currentContext.fontScaleFactor || 1, T = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - T) < 1e-6;
29957
+ const C = this._currentContext.fontScaleFactor || 1, F = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - F) < 1e-6;
29926
29958
  E && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
29927
- const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j, X = N + this.currentFontSize, ie = [], U = [], M = [], _ = [];
29959
+ const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - F + j, X = N + this.currentFontSize, ie = [], U = [], M = [], _ = [];
29928
29960
  this._hOffset = l + P, this._vOffset = X;
29929
29961
  for (const me of a)
29930
29962
  this.processChar(
@@ -29935,20 +29967,20 @@ class $i {
29935
29967
  _
29936
29968
  );
29937
29969
  n.push(...ie), r.push(...U), s.push(...M), i.push(..._);
29938
- const re = [], Te = [], et = [], _e = [];
29970
+ const re = [], Fe = [], et = [], _e = [];
29939
29971
  this._hOffset = l + W, this._vOffset = N;
29940
29972
  for (const me of o)
29941
29973
  this.processChar(
29942
29974
  me,
29943
29975
  re,
29944
- Te,
29976
+ Fe,
29945
29977
  et,
29946
29978
  _e
29947
29979
  );
29948
- n.push(...re), r.push(...Te), s.push(...et), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29980
+ n.push(...re), r.push(...Fe), s.push(...et), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29949
29981
  }
29950
29982
  } else {
29951
- const C = [], T = [], E = [], R = [];
29983
+ const C = [], F = [], E = [], R = [];
29952
29984
  this._hOffset = l + v, this._vOffset = this.convertTopAlignedVOffset(
29953
29985
  u + this.currentFontSize * 0.3,
29954
29986
  this.currentFontSize
@@ -29957,11 +29989,11 @@ class $i {
29957
29989
  this.processChar(
29958
29990
  X,
29959
29991
  C,
29960
- T,
29992
+ F,
29961
29993
  E,
29962
29994
  R
29963
29995
  );
29964
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), (c === "/" || c === "#") && this.recordStackDivider(
29996
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), (c === "/" || c === "#") && this.recordStackDivider(
29965
29997
  l,
29966
29998
  u,
29967
29999
  b,
@@ -30020,12 +30052,12 @@ class $i {
30020
30052
  this.resolveCharBoxTarget(s, i) === "mesh" ? s.push({
30021
30053
  type: ue.CHAR,
30022
30054
  box: o,
30023
- char: Tn,
30055
+ char: Fn,
30024
30056
  children: []
30025
30057
  }) : i.push({
30026
30058
  type: ue.CHAR,
30027
30059
  box: o,
30028
- char: Tn,
30060
+ char: Fn,
30029
30061
  children: []
30030
30062
  });
30031
30063
  }
@@ -30048,7 +30080,7 @@ class $i {
30048
30080
  */
30049
30081
  processBlank(e, n) {
30050
30082
  if (this._options.collectCharBoxes !== !1) {
30051
- const r = this._hOffset, s = this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new I.Box3(
30083
+ const r = this._hOffset, s = this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new I.Box3(
30052
30084
  new I.Vector3(r, s, 0),
30053
30085
  new I.Vector3(
30054
30086
  r + this.currentBlankAdvance,
@@ -30088,7 +30120,7 @@ class $i {
30088
30120
  * Appends vertical layout metadata for the current visual line to {@link _lineLayouts}.
30089
30121
  */
30090
30122
  recordCurrentLineLayout() {
30091
- const e = this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, n = this.currentLineHeight;
30123
+ const e = this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, n = this.currentLineHeight;
30092
30124
  this._lineLayouts.push({
30093
30125
  y: e + n / 2,
30094
30126
  height: n
@@ -30138,7 +30170,7 @@ class $i {
30138
30170
  return;
30139
30171
  }
30140
30172
  this._lineHasRenderableChar || this.applyPendingEmptyLineYAdjust(), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(s, i), this.advanceToNextLine(!1));
30141
- const l = this.hOffset, u = this.flowDirection == Ge.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, f = this.currentLayoutFontSize, h = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: y } = this.buildCharTransformMatrix(
30173
+ const l = this.hOffset, u = this.flowDirection == He.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, f = this.currentLayoutFontSize, h = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: y } = this.buildCharTransformMatrix(
30142
30174
  l,
30143
30175
  u,
30144
30176
  f
@@ -30325,7 +30357,7 @@ class $i {
30325
30357
  * @param collectBreakIndex When `true`, records a char index for automatic wrapping.
30326
30358
  */
30327
30359
  advanceToNextLine(e = !0) {
30328
- e && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
30360
+ e && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
30329
30361
  }
30330
30362
  /**
30331
30363
  * Updates {@link _maxLineAdvance} from the current line's horizontal pen position.
@@ -30345,7 +30377,7 @@ class $i {
30345
30377
  */
30346
30378
  countFinalCharBoxes(e, n, r) {
30347
30379
  const s = [...e, ...n].filter(
30348
- (f) => f.char !== Tn
30380
+ (f) => f.char !== Fn
30349
30381
  );
30350
30382
  if (r !== ue.STACK)
30351
30383
  return s.length;
@@ -30367,7 +30399,7 @@ class $i {
30367
30399
  applyPendingEmptyLineYAdjust() {
30368
30400
  if (this._pendingEmptyLineFontSizeAdjust === void 0) return;
30369
30401
  const e = this.currentFontSize - this._pendingEmptyLineFontSizeAdjust;
30370
- e !== 0 && (this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset += e : this._vOffset -= e), this._pendingEmptyLineFontSizeAdjust = void 0;
30402
+ e !== 0 && (this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset += e : this._vOffset -= e), this._pendingEmptyLineFontSizeAdjust = void 0;
30371
30403
  }
30372
30404
  /**
30373
30405
  * Chooses whether subsequent char boxes should attach to mesh or line geometry owners.
@@ -30639,20 +30671,31 @@ class tn extends I.Object3D {
30639
30671
  const n = Array.from(tn.getFonts(this._mtextData.text || "", !0));
30640
30672
  if (!this._fontsInStyleLoaded) {
30641
30673
  if (this._style.font) {
30642
- const i = this.getFontName(this._style.font);
30643
- i && n.push(i);
30674
+ const o = this.getFontName(this._style.font);
30675
+ o && n.push(o);
30644
30676
  }
30645
30677
  if (this._style.bigFont) {
30646
- const i = this.getFontName(this._style.bigFont);
30647
- i && n.push(i);
30678
+ const o = this.getFontName(this._style.bigFont);
30679
+ o && n.push(o);
30648
30680
  }
30649
30681
  if (this._style.extendedFont) {
30650
- const i = this.getFontName(this._style.extendedFont);
30651
- i && n.push(i);
30682
+ const o = this.getFontName(this._style.extendedFont);
30683
+ o && n.push(o);
30652
30684
  }
30653
30685
  }
30654
- const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = r ? [.../* @__PURE__ */ new Set([...n, ...this._fontManager.getFontsToLoad()])] : n;
30655
- s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0 && (this._fontsInStyleLoaded = !0)), this.syncDraw();
30686
+ const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = [...new Set(n)], i = new Set(s.map((o) => o.toLowerCase())), a = this._fontManager.getFontsToLoad().filter((o) => !i.has(o.toLowerCase()));
30687
+ if (this._fontManager.lazyFontLoading ? s.length > 0 && (r && a.length > 0 && this._fontManager.requestFonts(a), r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s)) : (s.length > 0 || a.length > 0) && await this._fontManager.loadFontsByNames([
30688
+ ...s,
30689
+ ...a
30690
+ ]), n.length > 0) {
30691
+ const o = [
30692
+ this._style.font ? this.getFontName(this._style.font) : void 0,
30693
+ this._style.bigFont ? this.getFontName(this._style.bigFont) : void 0,
30694
+ this._style.extendedFont ? this.getFontName(this._style.extendedFont) : void 0
30695
+ ].filter((l) => !!l);
30696
+ (o.length === 0 || o.every((l) => this._fontManager.isFontLoaded(l))) && (this._fontsInStyleLoaded = !0);
30697
+ }
30698
+ this.syncDraw();
30656
30699
  }
30657
30700
  /**
30658
30701
  * Draw the MText object. This method assumes that fonts needed are loaded. If font needed
@@ -30760,18 +30803,15 @@ class tn extends I.Object3D {
30760
30803
  position: e.position,
30761
30804
  rotation: e.rotation,
30762
30805
  directionVector: e.directionVector,
30763
- drawingDirection: Ge.BOTTOM_TO_TOP,
30806
+ drawingDirection: He.BOTTOM_TO_TOP,
30764
30807
  collectCharBoxes: !1
30765
30808
  };
30766
- return this.finalizePlacement(
30767
- r,
30768
- i,
30769
- s,
30770
- { shxFontType: this._fontManager.getShxFontType(n.font) }
30771
- );
30809
+ return this.finalizePlacement(r, i, s, {
30810
+ shxFontType: this._fontManager.getShxFontType(n.font)
30811
+ });
30772
30812
  }
30773
30813
  /**
30774
- *
30814
+ *
30775
30815
  * @param options.shxFontType The type of SHX font.
30776
30816
  */
30777
30817
  finalizePlacement(e, n, r, s) {
@@ -30791,7 +30831,10 @@ class tn extends I.Object3D {
30791
30831
  n.drawingDirection
30792
30832
  );
30793
30833
  let c = { x: 0, y: 0 };
30794
- (s == null ? void 0 : s.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(o, n.attachmentPoint), e.userData.logicalBounds = {
30834
+ (s == null ? void 0 : s.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(
30835
+ o,
30836
+ n.attachmentPoint
30837
+ ), e.userData.logicalBounds = {
30795
30838
  minX: o.minX + c.x,
30796
30839
  maxX: o.maxX + c.x,
30797
30840
  minY: o.minY + c.y,
@@ -30836,7 +30879,7 @@ class tn extends I.Object3D {
30836
30879
  lineSpaceFactor: Gi,
30837
30880
  horizontalAlignment: oe.LEFT,
30838
30881
  maxWidth: 0,
30839
- flowDirection: Ge.BOTTOM_TO_TOP,
30882
+ flowDirection: He.BOTTOM_TO_TOP,
30840
30883
  byBlockColor: this._colorSettings.byBlockColor,
30841
30884
  byLayerColor: this._colorSettings.byLayerColor,
30842
30885
  removeFontExtension: !0,
@@ -30895,7 +30938,7 @@ class tn extends I.Object3D {
30895
30938
  Q.MiddleCenter,
30896
30939
  Q.MiddleRight
30897
30940
  ].includes(e.attachmentPoint) ? a = dt.MIDDLE : a = dt.BOTTOM);
30898
- const o = e.height || n.fixedTextHeight || 0, c = e.widthFactor || n.widthFactor || 1, l = e.lineSpaceFactor ?? Gi, u = e.drawingDirection ?? Ge.LEFT_TO_RIGHT, f = {
30941
+ const o = e.height || n.fixedTextHeight || 0, c = e.widthFactor || n.widthFactor || 1, l = e.lineSpaceFactor ?? Gi, u = e.drawingDirection ?? He.LEFT_TO_RIGHT, f = {
30899
30942
  fontSize: o,
30900
30943
  widthFactor: c,
30901
30944
  lineSpaceFactor: l,
@@ -30969,15 +31012,15 @@ class tn extends I.Object3D {
30969
31012
  var v;
30970
31013
  const b = (v = m.userData) == null ? void 0 : v.lineLayouts;
30971
31014
  !b || b.length === 0 || b.forEach((w) => {
30972
- const C = w.y - w.height / 2, T = w.y + w.height / 2;
30973
- a.hasLine = !0, a.minY = Math.min(a.minY, C), a.maxY = Math.max(a.maxY, T), o || (a.baselineY = C, o = !0);
31015
+ const C = w.y - w.height / 2, F = w.y + w.height / 2;
31016
+ a.hasLine = !0, a.minY = Math.min(a.minY, C), a.maxY = Math.max(a.maxY, F), o || (a.baselineY = C, o = !0);
30974
31017
  });
30975
31018
  });
30976
31019
  const c = s.isEmpty() ? 0 : s.max.y - s.min.y, l = Number.isFinite(c) && c > 0 ? c : Number.isFinite(r) && r > 0 ? r : 0;
30977
31020
  let u = 0, f = Number.isFinite(n) && n > 0 ? n : 0;
30978
31021
  f <= u && !s.isEmpty() && (u = s.min.x, f = s.max.x);
30979
31022
  let h = 0, p = 0;
30980
- i == Ge.BOTTOM_TO_TOP ? (h = s.isEmpty() ? 0 : s.min.y, p = h + l) : (p = s.isEmpty() ? 0 : s.max.y, h = p - l);
31023
+ i == He.BOTTOM_TO_TOP ? (h = s.isEmpty() ? 0 : s.min.y, p = h + l) : (p = s.isEmpty() ? 0 : s.max.y, h = p - l);
30981
31024
  const y = a.hasLine ? a.baselineY : h;
30982
31025
  return { minX: u, maxX: f, minY: h, maxY: p, baselineY: y };
30983
31026
  }
@@ -31218,12 +31261,17 @@ class Xi extends I.Object3D {
31218
31261
  async asyncDraw(e) {
31219
31262
  const n = [];
31220
31263
  if (!this._fontsInStyleLoaded)
31221
- for (const i of ["font", "bigFont", "extendedFont"]) {
31222
- const a = this.getFontName(this._style[i]);
31223
- a && n.push(a);
31264
+ for (const o of ["font", "bigFont", "extendedFont"]) {
31265
+ const c = this.getFontName(this._style[o]);
31266
+ c && n.push(c);
31224
31267
  }
31225
- const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = r ? [.../* @__PURE__ */ new Set([...n, ...this._fontManager.getFontsToLoad()])] : n;
31226
- s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0 && (this._fontsInStyleLoaded = !0)), this.syncDraw();
31268
+ const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = [...new Set(n)], i = new Set(s.map((o) => o.toLowerCase())), a = this._fontManager.getFontsToLoad().filter((o) => !i.has(o.toLowerCase()));
31269
+ this._fontManager.lazyFontLoading ? s.length > 0 && (r && a.length > 0 && this._fontManager.requestFonts(a), r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s)) : (s.length > 0 || a.length > 0) && await this._fontManager.loadFontsByNames([
31270
+ ...s,
31271
+ ...a
31272
+ ]), n.length > 0 && n.every(
31273
+ (c) => this._fontManager.isFontLoaded(c)
31274
+ ) && (this._fontsInStyleLoaded = !0), this.syncDraw();
31227
31275
  }
31228
31276
  syncDraw() {
31229
31277
  const n = new tn(
@@ -31248,7 +31296,7 @@ class Xi extends I.Object3D {
31248
31296
  position: this._shapeData.position,
31249
31297
  rotation: this._shapeData.rotation,
31250
31298
  directionVector: this._shapeData.directionVector,
31251
- drawingDirection: Ge.BOTTOM_TO_TOP,
31299
+ drawingDirection: He.BOTTOM_TO_TOP,
31252
31300
  collectCharBoxes: !1
31253
31301
  };
31254
31302
  }
@@ -31781,6 +31829,10 @@ class t1 {
31781
31829
  */
31782
31830
  async setFontUrl(e) {
31783
31831
  this.fontManager.baseUrl = e;
31832
+ try {
31833
+ await this.fontManager.getAvailableFonts();
31834
+ } catch {
31835
+ }
31784
31836
  }
31785
31837
  /**
31786
31838
  * Render MText directly in the main thread asynchronously. Fonts referenced by
@@ -31861,7 +31913,13 @@ class t1 {
31861
31913
  destroy() {
31862
31914
  }
31863
31915
  async ensureInitialized() {
31864
- this.isInitialized || (this.fontManager.lazyFontLoading || await this.loadFonts(this.fontManager.getFontsToLoad()), this.isInitialized = !0);
31916
+ if (!this.isInitialized) {
31917
+ try {
31918
+ await this.fontManager.getAvailableFonts();
31919
+ } catch {
31920
+ }
31921
+ this.fontManager.lazyFontLoading || await this.loadFonts(this.fontManager.getFontsToLoad()), this.isInitialized = !0;
31922
+ }
31865
31923
  }
31866
31924
  }
31867
31925
  class c1 {
@@ -31873,7 +31931,7 @@ class c1 {
31873
31931
  * when render mode is 'worker'.
31874
31932
  */
31875
31933
  constructor(e = "main", n = {}) {
31876
- this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new t1(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31934
+ this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.workerFontUrl = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new t1(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31877
31935
  }
31878
31936
  ensureWebWorkerRenderer() {
31879
31937
  return this.webWorkerRenderer || (this.webWorkerRenderer = new e1(this.workerConfig), this.webWorkerRenderer.styleManager = this.mainThreadRenderer.styleManager, this.webWorkerConfigured = !1), this.webWorkerRenderer;
@@ -31884,10 +31942,12 @@ class c1 {
31884
31942
  [...$.instance.defaultFonts],
31885
31943
  [...$.instance.symbolFonts]
31886
31944
  ), this.webWorkerConfigured = !0);
31887
- const n = $.instance.lazyFontLoading;
31888
- this.workerLazyFontLoading !== n && (await e.setLazyFontLoading(n), this.workerLazyFontLoading = n);
31889
- const r = $.instance.awaitFontsBeforeDraw;
31890
- return this.workerAwaitFontsBeforeDraw !== r && (await e.setAwaitFontsBeforeDraw(r), this.workerAwaitFontsBeforeDraw = r), e;
31945
+ const n = $.instance.baseUrl;
31946
+ n && this.workerFontUrl !== n && (await e.setFontUrl(n), this.workerFontUrl = n);
31947
+ const r = $.instance.lazyFontLoading;
31948
+ this.workerLazyFontLoading !== r && (await e.setLazyFontLoading(r), this.workerLazyFontLoading = r);
31949
+ const s = $.instance.awaitFontsBeforeDraw;
31950
+ return this.workerAwaitFontsBeforeDraw !== s && (await e.setAwaitFontsBeforeDraw(s), this.workerAwaitFontsBeforeDraw = s), e;
31891
31951
  }
31892
31952
  /**
31893
31953
  * Sets one new style manager to override the default style manager.
@@ -31913,8 +31973,8 @@ class c1 {
31913
31973
  * Set URL to load fonts
31914
31974
  * @param value - URL to load fonts
31915
31975
  */
31916
- setFontUrl(e) {
31917
- return this.renderer.setFontUrl(e);
31976
+ async setFontUrl(e) {
31977
+ await this.mainThreadRenderer.setFontUrl(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setFontUrl(e), this.workerFontUrl = e);
31918
31978
  }
31919
31979
  /**
31920
31980
  * Get the default rendering mode
@@ -32046,7 +32106,7 @@ class c1 {
32046
32106
  fonts: []
32047
32107
  };
32048
32108
  try {
32049
- r = await ze.instance.getStorageStats();
32109
+ r = await Ue.instance.getStorageStats();
32050
32110
  } catch {
32051
32111
  }
32052
32112
  const s = e.totalEstimatedBytes + n.reduce((i, a) => i + a.totalEstimatedBytes, 0);
@@ -32076,7 +32136,7 @@ class c1 {
32076
32136
  */
32077
32137
  terminateWorkers() {
32078
32138
  var e;
32079
- (e = this.webWorkerRenderer) == null || e.terminate(), this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.renderer = this.mainThreadRenderer;
32139
+ (e = this.webWorkerRenderer) == null || e.terminate(), this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.workerFontUrl = null, this.renderer = this.mainThreadRenderer;
32080
32140
  }
32081
32141
  /**
32082
32142
  * Clean up resources
@@ -32092,7 +32152,7 @@ export {
32092
32152
  ue as CharBoxType,
32093
32153
  Ar as DEFAULT_FONTS_PRESETS,
32094
32154
  Gi as DEFAULT_LINE_SPACE_FACTOR,
32095
- F0 as DefaultFontLoader,
32155
+ T0 as DefaultFontLoader,
32096
32156
  gs as EventManager,
32097
32157
  Ze as FontFactory,
32098
32158
  $ as FontManager,
@@ -32106,15 +32166,15 @@ export {
32106
32166
  Q as MTextAttachmentPoint,
32107
32167
  bt as MTextColor,
32108
32168
  ln as MTextContext,
32109
- Ge as MTextFlowDirection,
32169
+ He as MTextFlowDirection,
32110
32170
  dt as MTextLineAlignment,
32111
32171
  oe as MTextParagraphAlignment,
32112
32172
  _0 as MTextParser,
32113
32173
  ht as MTextStroke,
32114
32174
  vr as MTextToken,
32115
32175
  t1 as MainThreadRenderer,
32116
- Tc as SHX_PARSED_FONT_OVERHEAD,
32117
- Tn as STACK_DIVIDER_CHAR,
32176
+ Fc as SHX_PARSED_FONT_OVERHEAD,
32177
+ Fn as STACK_DIVIDER_CHAR,
32118
32178
  bn as STACK_VERTICAL_SHIFT_FACTOR,
32119
32179
  Zn as SYMBOL_FONTS_PRESETS,
32120
32180
  Xi as Shape,
@@ -32133,7 +32193,7 @@ export {
32133
32193
  Hi as estimateMTextWrapWidth,
32134
32194
  wc as estimateMaterialBytes,
32135
32195
  Do as estimateStringBytes,
32136
- Le as formatBytes,
32196
+ Oe as formatBytes,
32137
32197
  r1 as formatMemoryUsageReport,
32138
32198
  na as getColorByIndex,
32139
32199
  M0 as getFonts,
@@ -32145,6 +32205,6 @@ export {
32145
32205
  E0 as readJsHeapStats,
32146
32206
  Kt as resolveMTextColor,
32147
32207
  zi as resolveMTextWrapWidth,
32148
- L0 as rgb2int,
32208
+ O0 as rgb2int,
32149
32209
  o1 as serializeMTextColor
32150
32210
  };