dielines 0.9.1 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dielines.js CHANGED
@@ -1,13 +1,13 @@
1
- var zi = Object.defineProperty;
2
- var Di = (i, t, e) => t in i ? zi(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var St = (i, t, e) => Di(i, typeof t != "symbol" ? t + "" : t, e);
4
- var Ui = Object.defineProperty, ni = (i) => {
1
+ var Di = Object.defineProperty;
2
+ var Ui = (i, t, e) => t in i ? Di(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var St = (i, t, e) => Ui(i, typeof t != "symbol" ? t + "" : t, e);
4
+ var Yi = Object.defineProperty, si = (i) => {
5
5
  throw TypeError(i);
6
- }, Yi = (i, t, e) => t in i ? Ui(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, F = (i, t, e) => Yi(i, typeof t != "symbol" ? t + "" : t, e), tn = (i, t, e) => t.has(i) || ni("Cannot " + e), Mt = (i, t, e) => (tn(i, t, "read from private field"), e ? e.call(i) : t.get(i)), ii = (i, t, e) => t.has(i) ? ni("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), Ne = (i, t, e, n) => (tn(i, t, "write to private field"), t.set(i, e), e), dn = (i, t, e) => (tn(i, t, "access private method"), e);
6
+ }, Xi = (i, t, e) => t in i ? Yi(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, F = (i, t, e) => Xi(i, typeof t != "symbol" ? t + "" : t, e), en = (i, t, e) => t.has(i) || si("Cannot " + e), Mt = (i, t, e) => (en(i, t, "read from private field"), e ? e.call(i) : t.get(i)), ri = (i, t, e) => t.has(i) ? si("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), Oe = (i, t, e, n) => (en(i, t, "write to private field"), t.set(i, e), e), Mn = (i, t, e) => (en(i, t, "access private method"), e);
7
7
  function me(i, t, e, n) {
8
8
  return i <= n && t >= e;
9
9
  }
10
- let re = class Qt {
10
+ let oe = class Qt {
11
11
  constructor(t = 1 / 0, e = 1 / 0, n = -1 / 0, s = -1 / 0) {
12
12
  F(this, "xMin"), F(this, "yMin"), F(this, "xMax"), F(this, "yMax"), this.xMin = t, this.yMin = e, this.xMax = n, this.yMax = s;
13
13
  }
@@ -61,10 +61,10 @@ let re = class Qt {
61
61
  );
62
62
  }
63
63
  };
64
- function en(i) {
65
- return i.reduce((t, e) => t.addPoint(e), new re());
64
+ function nn(i) {
65
+ return i.reduce((t, e) => t.addPoint(e), new oe());
66
66
  }
67
- const Pn = (i, t = 1e-9) => {
67
+ const yn = (i, t = 1e-9) => {
68
68
  let e = i;
69
69
  return Math.abs(i) < t && (e = 0), e.toFixed(-Math.log10(t));
70
70
  };
@@ -72,17 +72,17 @@ function At(i, t = 1e-9) {
72
72
  return Array.from(
73
73
  new Map(
74
74
  i.map(([e, n]) => [
75
- `[${Pn(e, t)},${Pn(n, t)}]`,
75
+ `[${yn(e, t)},${yn(n, t)}]`,
76
76
  [e, n]
77
77
  ])
78
78
  ).values()
79
79
  );
80
80
  }
81
- const _t = Math.PI / 180, nn = 180 / Math.PI, it = (i) => `[${i[0]}, ${i[1]}]`, k = ([i, t], [e, n], s = 1e-9) => Math.abs(i - e) <= s && Math.abs(t - n) <= s, X = ([i, t], [e, n]) => [i + e, t + n], q = ([i, t], [e, n]) => [i - e, t - n], yt = ([i, t]) => i * i + t * t, Xi = ([i, t]) => Math.sqrt(yt([i, t])), Q = ([i, t], e) => [i * e, t * e], Ft = ([i, t], [e, n] = [0, 0]) => (i - e) ** 2 + (t - n) ** 2, J = (i, t = [0, 0]) => Math.sqrt(Ft(i, t));
81
+ const $t = Math.PI / 180, sn = 180 / Math.PI, it = (i) => `[${i[0]}, ${i[1]}]`, R = ([i, t], [e, n], s = 1e-9) => Math.abs(i - e) <= s && Math.abs(t - n) <= s, X = ([i, t], [e, n]) => [i + e, t + n], q = ([i, t], [e, n]) => [i - e, t - n], yt = ([i, t]) => i * i + t * t, Wi = ([i, t]) => Math.sqrt(yt([i, t])), Q = ([i, t], e) => [i * e, t * e], _t = ([i, t], [e, n] = [0, 0]) => (i - e) ** 2 + (t - n) ** 2, J = (i, t = [0, 0]) => Math.sqrt(_t(i, t));
82
82
  function bt([i, t], [e, n]) {
83
83
  return i * n - t * e;
84
84
  }
85
- function Se([i, t], [e, n]) {
85
+ function ke([i, t], [e, n]) {
86
86
  return i * e + t * n;
87
87
  }
88
88
  function ot([i, t]) {
@@ -93,25 +93,25 @@ function vt(i, t) {
93
93
  const e = Math.cos(t) * i, n = Math.sin(t) * i;
94
94
  return [e, n];
95
95
  }
96
- function Wi([i, t]) {
96
+ function Hi([i, t]) {
97
97
  return Math.atan2(t, i);
98
98
  }
99
- function si(i) {
100
- const t = J(i), e = Wi(i);
99
+ function oi(i) {
100
+ const t = J(i), e = Hi(i);
101
101
  return [t, e];
102
102
  }
103
- function sn(i, t, e = 1e-9) {
103
+ function rn(i, t, e = 1e-9) {
104
104
  const n = bt(i, t), s = yt(i), r = yt(t);
105
105
  return n * n < s * r * e * e;
106
106
  }
107
107
  function nt(i) {
108
108
  return [-i[1], i[0]];
109
109
  }
110
- function Zt(i) {
110
+ function Kt(i) {
111
111
  return [i[1], -i[0]];
112
112
  }
113
- function Hi(i, t, e) {
114
- return k(e, i) || sn(q(e, i), t);
113
+ function Qi(i, t, e) {
114
+ return R(e, i) || rn(q(e, i), t);
115
115
  }
116
116
  const Bt = (i, t) => {
117
117
  const [e, n, s, r, o, a, h, l, c] = i, [u, m, w, g, p, M, f, P, b] = t;
@@ -126,7 +126,7 @@ const Bt = (i, t) => {
126
126
  h * m + l * p + c * P,
127
127
  h * w + l * M + c * b
128
128
  ];
129
- }, Qi = (i) => {
129
+ }, Gi = (i) => {
130
130
  const [t, e, n, s, r, o, a, h, l] = i, c = t * (r * l - o * h) - e * (s * l - o * a) + n * (s * h - r * a);
131
131
  return [
132
132
  (r * l - o * h) / c,
@@ -139,22 +139,22 @@ const Bt = (i, t) => {
139
139
  (e * a - t * h) / c,
140
140
  (t * r - e * s) / c
141
141
  ];
142
- }, Gi = (i) => {
142
+ }, Ji = (i) => {
143
143
  const [t, e, n, s, r, o, a, h, l] = i;
144
144
  return [t, s, a, e, r, h, n, o, l];
145
145
  };
146
- let ct = class ri {
146
+ let ct = class ai {
147
147
  constructor(t) {
148
148
  F(this, "_matrix", [1, 0, 0, 0, 1, 0, 0, 0, 1]), t && (this._matrix = [...t]);
149
149
  }
150
150
  clone() {
151
- return new ri(this._matrix);
151
+ return new ai(this._matrix);
152
152
  }
153
153
  transpose() {
154
- return this._matrix = Gi(this._matrix), this;
154
+ return this._matrix = Ji(this._matrix), this;
155
155
  }
156
156
  inverse() {
157
- return this._matrix = Qi(this._matrix), this;
157
+ return this._matrix = Gi(this._matrix), this;
158
158
  }
159
159
  translate(t, e) {
160
160
  return this._matrix = Bt([1, 0, t, 0, 1, e, 0, 0, 1], this._matrix), this;
@@ -196,7 +196,7 @@ let ct = class ri {
196
196
  return Math.sqrt(t * t + e * e);
197
197
  }
198
198
  };
199
- class Lt {
199
+ class Ft {
200
200
  translateX(t) {
201
201
  const e = new ct().translate(t, 0);
202
202
  return this.transform(e);
@@ -215,7 +215,7 @@ class Lt {
215
215
  }
216
216
  rotate(t, e) {
217
217
  const n = new ct().rotate(
218
- t * _t,
218
+ t * $t,
219
219
  e
220
220
  );
221
221
  return this.transform(n);
@@ -233,7 +233,7 @@ class Lt {
233
233
  return t === "x" ? n.mirrorX() : t === "y" ? n.mirrorY() : n.mirrorLine(t, e), this.transform(n);
234
234
  }
235
235
  }
236
- let oe = class extends Lt {
236
+ let ae = class extends Ft {
237
237
  constructor(t, e) {
238
238
  super(), F(this, "precision", 1e-9), this.firstPoint = t, this.lastPoint = e, this.firstPoint = t, this.lastPoint = e;
239
239
  }
@@ -248,7 +248,7 @@ let oe = class extends Lt {
248
248
  [Symbol.for("nodejs.util.inspect.custom")]() {
249
249
  return this.repr;
250
250
  }
251
- }, D = class jt extends oe {
251
+ }, D = class jt extends ae {
252
252
  constructor() {
253
253
  super(...arguments), F(this, "segmentType", "LINE"), F(this, "_V", null), F(this, "_slope", null), F(this, "_yIntercept", null), F(this, "_boundingBox", null);
254
254
  }
@@ -263,7 +263,7 @@ let oe = class extends Lt {
263
263
  return J(this.firstPoint, this.lastPoint);
264
264
  }
265
265
  get squareLength() {
266
- return Ft(this.firstPoint, this.lastPoint);
266
+ return _t(this.firstPoint, this.lastPoint);
267
267
  }
268
268
  get V() {
269
269
  return this._V === null && (this._V = q(this.lastPoint, this.firstPoint)), this._V;
@@ -282,7 +282,7 @@ let oe = class extends Lt {
282
282
  return X(this.firstPoint, Q(this.V, 0.5));
283
283
  }
284
284
  isSame(t) {
285
- return t instanceof jt ? k(this.firstPoint, t.firstPoint) && k(this.lastPoint, t.lastPoint) || k(this.lastPoint, t.firstPoint) && k(this.firstPoint, t.lastPoint) : !1;
285
+ return t instanceof jt ? R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) || R(this.lastPoint, t.firstPoint) && R(this.firstPoint, t.lastPoint) : !1;
286
286
  }
287
287
  clone() {
288
288
  return new jt(this.firstPoint, this.lastPoint);
@@ -291,7 +291,7 @@ let oe = class extends Lt {
291
291
  return new jt(this.lastPoint, this.firstPoint);
292
292
  }
293
293
  get boundingBox() {
294
- return this._boundingBox === null && (this._boundingBox = new re(
294
+ return this._boundingBox === null && (this._boundingBox = new oe(
295
295
  Math.min(this.firstPoint[0], this.lastPoint[0]) - this.precision,
296
296
  Math.min(this.firstPoint[1], this.lastPoint[1]) - this.precision,
297
297
  Math.max(this.firstPoint[0], this.lastPoint[0]) + this.precision,
@@ -299,7 +299,7 @@ let oe = class extends Lt {
299
299
  )), this._boundingBox;
300
300
  }
301
301
  distanceFrom(t) {
302
- const e = q(t, this.firstPoint), n = Se(e, this.V) / this.squareLength;
302
+ const e = q(t, this.firstPoint), n = ke(e, this.V) / this.squareLength;
303
303
  if (n < 0)
304
304
  return J(t, this.firstPoint);
305
305
  if (n > 1)
@@ -308,10 +308,10 @@ let oe = class extends Lt {
308
308
  return J(t, s);
309
309
  }
310
310
  isOnSegment(t) {
311
- if (k(t, this.firstPoint, this.precision)) return !0;
311
+ if (R(t, this.firstPoint, this.precision)) return !0;
312
312
  const e = q(t, this.firstPoint);
313
- if (!sn(this.V, e)) return !1;
314
- const n = Se(e, this.V) / this.squareLength;
313
+ if (!rn(this.V, e)) return !1;
314
+ const n = ke(e, this.V) / this.squareLength;
315
315
  return this.isValidParameter(n);
316
316
  }
317
317
  gradientAt(t) {
@@ -353,21 +353,21 @@ let oe = class extends Lt {
353
353
  );
354
354
  }
355
355
  };
356
- function Ji(i) {
356
+ function Zi(i) {
357
357
  return Array.from(Array(i).keys());
358
358
  }
359
359
  function Pt(i) {
360
360
  const t = Math.min(...i.map((e) => e.length));
361
- return Ji(t).map((e) => i.map((n) => n[e]));
361
+ return Zi(t).map((e) => i.map((n) => n[e]));
362
362
  }
363
- function $t(i, t = 1e-9) {
363
+ function Tt(i, t = 1e-9) {
364
364
  return i < 0 ? i + 2 * Math.PI : i >= 2 * Math.PI ? i % (2 * Math.PI) : i > 2 * Math.PI - t ? 0 : i;
365
365
  }
366
- function ke(i, t, e, n = 1e-9) {
366
+ function Re(i, t, e, n = 1e-9) {
367
367
  let s = t - i;
368
368
  return e && (s = -s), s < 0 && (s += 2 * Math.PI), s > 2 * Math.PI - n ? 0 : s;
369
369
  }
370
- const Ie = (i, t, e) => {
370
+ const _e = (i, t, e) => {
371
371
  const n = bt(i.V, t.V), s = yt(i.V), r = yt(t.V), o = e ? e * e : i.precision * t.precision;
372
372
  if (n * n < s * r * o)
373
373
  return "parallel";
@@ -377,8 +377,8 @@ const Ie = (i, t, e) => {
377
377
  intersectionParam2: l
378
378
  };
379
379
  };
380
- function oi(i, t, e = !1, n) {
381
- const s = Ie(i, t, n);
380
+ function hi(i, t, e = !1, n) {
381
+ const s = _e(i, t, n);
382
382
  if (s === "parallel") {
383
383
  if (!e) return null;
384
384
  if (i.isSame(t)) return i;
@@ -401,12 +401,12 @@ function oi(i, t, e = !1, n) {
401
401
  }
402
402
  const ge = (i, t) => {
403
403
  const e = q(i, t);
404
- return si(e);
404
+ return oi(e);
405
405
  };
406
- let z = class qt extends oe {
406
+ let z = class qt extends ae {
407
407
  constructor(t, e, n, s = !1, { ignoreChecks: r = !1 } = {}) {
408
408
  if (super(t, e), F(this, "segmentType", "ARC"), F(this, "center"), F(this, "clockwise"), F(this, "_coefficients", null), F(this, "_angularLength", null), F(this, "_radius", null), F(this, "_firstAngle", null), F(this, "_lastAngle", null), F(this, "_boundingBox", null), this.center = n, this.clockwise = s, !r) {
409
- if (k(t, e))
409
+ if (R(t, e))
410
410
  throw new Error("Invalid arc, cannot be a full circle");
411
411
  if (Math.abs(this.radius - J(this.lastPoint, this.center)) > this.precision)
412
412
  throw new Error(
@@ -439,10 +439,10 @@ let z = class qt extends oe {
439
439
  return 1 - t >= -this.precision && t >= -this.precision;
440
440
  }
441
441
  angleToParam(t) {
442
- return ke(this.firstAngle, $t(t), this.clockwise) / this.angularLength;
442
+ return Re(this.firstAngle, Tt(t), this.clockwise) / this.angularLength;
443
443
  }
444
444
  get angularLength() {
445
- return this._angularLength || (this._angularLength = ke(
445
+ return this._angularLength || (this._angularLength = Re(
446
446
  this.firstAngle,
447
447
  this.lastAngle,
448
448
  this.clockwise
@@ -476,14 +476,14 @@ let z = class qt extends oe {
476
476
  get firstAngle() {
477
477
  if (this._firstAngle === null) {
478
478
  const [t, e] = q(this.firstPoint, this.center);
479
- this._firstAngle = $t(Math.atan2(e, t));
479
+ this._firstAngle = Tt(Math.atan2(e, t));
480
480
  }
481
481
  return this._firstAngle;
482
482
  }
483
483
  get lastAngle() {
484
484
  if (this._lastAngle === null) {
485
485
  const [t, e] = q(this.lastPoint, this.center);
486
- this._lastAngle = $t(Math.atan2(e, t));
486
+ this._lastAngle = Tt(Math.atan2(e, t));
487
487
  }
488
488
  return this._lastAngle;
489
489
  }
@@ -497,7 +497,7 @@ let z = class qt extends oe {
497
497
  return this.paramPoint(0.5);
498
498
  }
499
499
  isSame(t) {
500
- return !(t instanceof qt) || !k(this.center, t.center) ? !1 : k(this.firstPoint, t.firstPoint) && k(this.lastPoint, t.lastPoint) && this.clockwise === t.clockwise || k(this.lastPoint, t.firstPoint) && k(this.firstPoint, t.lastPoint) && this.clockwise === !t.clockwise;
500
+ return !(t instanceof qt) || !R(this.center, t.center) ? !1 : R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) && this.clockwise === t.clockwise || R(this.lastPoint, t.firstPoint) && R(this.firstPoint, t.lastPoint) && this.clockwise === !t.clockwise;
501
501
  }
502
502
  clone() {
503
503
  return new qt(
@@ -518,7 +518,7 @@ let z = class qt extends oe {
518
518
  get boundingBox() {
519
519
  if (this._boundingBox === null) {
520
520
  const t = this.radius + this.precision, e = (n) => this.isValidParameter(this.angleToParam(n));
521
- this._boundingBox = new re(
521
+ this._boundingBox = new oe(
522
522
  e(Math.PI) ? this.center[0] - t : Math.min(this.firstPoint[0], this.lastPoint[0]) - this.precision,
523
523
  e(Math.PI * 1.5) ? this.center[1] - t : Math.min(this.firstPoint[1], this.lastPoint[1]) - this.precision,
524
524
  e(0) ? this.center[0] + t : Math.max(this.firstPoint[0], this.lastPoint[0]) + this.precision,
@@ -531,13 +531,13 @@ let z = class qt extends oe {
531
531
  const [e, n] = ge(t, this.center);
532
532
  return this.isValidParameter(this.angleToParam(n)) ? Math.abs(e - this.radius) : Math.sqrt(
533
533
  Math.min(
534
- Ft(t, this.firstPoint),
535
- Ft(t, this.lastPoint)
534
+ _t(t, this.firstPoint),
535
+ _t(t, this.lastPoint)
536
536
  )
537
537
  );
538
538
  }
539
539
  isOnSegment(t) {
540
- if (k(t, this.firstPoint) || k(t, this.lastPoint))
540
+ if (R(t, this.firstPoint) || R(t, this.lastPoint))
541
541
  return !0;
542
542
  const [e, n] = ge(t, this.center);
543
543
  if (Math.abs(e - this.radius) > this.precision) return !1;
@@ -556,15 +556,15 @@ let z = class qt extends oe {
556
556
  if (!this.isValidParameter(s))
557
557
  throw new Error("Point is not on the arc");
558
558
  const r = vt(1, n);
559
- return (this.clockwise ? Zt : nt)(ot(r));
559
+ return (this.clockwise ? Kt : nt)(ot(r));
560
560
  }
561
561
  get tangentAtFirstPoint() {
562
562
  const t = vt(1, this.firstAngle);
563
- return (this.clockwise ? Zt : nt)(ot(t));
563
+ return (this.clockwise ? Kt : nt)(ot(t));
564
564
  }
565
565
  get tangentAtLastPoint() {
566
566
  const t = vt(1, this.lastAngle);
567
- return (this.clockwise ? Zt : nt)(ot(t));
567
+ return (this.clockwise ? Kt : nt)(ot(t));
568
568
  }
569
569
  splitAt(t) {
570
570
  let e;
@@ -599,8 +599,8 @@ let z = class qt extends oe {
599
599
  );
600
600
  }
601
601
  };
602
- function Zi(i, t, e) {
603
- const n = new D(t, i), s = new D(t, e), r = nt(n.tangentAtFirstPoint), o = nt(s.tangentAtLastPoint), a = Ie(
602
+ function Ki(i, t, e) {
603
+ const n = new D(t, i), s = new D(t, e), r = nt(n.tangentAtFirstPoint), o = nt(s.tangentAtLastPoint), a = _e(
604
604
  { firstPoint: n.midPoint, V: r, precision: 1e-9 },
605
605
  { firstPoint: s.midPoint, V: o, precision: 1e-9 }
606
606
  );
@@ -618,8 +618,8 @@ function Zi(i, t, e) {
618
618
  { ignoreChecks: !0 }
619
619
  );
620
620
  }
621
- function ai(i, t, e) {
622
- const n = new D(i, t), s = nt(n.tangentAtFirstPoint), r = Ie(
621
+ function li(i, t, e) {
622
+ const n = new D(i, t), s = nt(n.tangentAtFirstPoint), r = _e(
623
623
  { firstPoint: n.midPoint, V: s, precision: 1e-9 },
624
624
  {
625
625
  firstPoint: i,
@@ -640,11 +640,11 @@ function ai(i, t, e) {
640
640
  ignoreChecks: !0
641
641
  });
642
642
  }
643
- const Mn = 1e-21, pe = 1.618034;
644
- function yn(i, t = 0, e = 1, n = 110, s = 1e3) {
643
+ const bn = 1e-21, pe = 1.618034;
644
+ function xn(i, t = 0, e = 1, n = 110, s = 1e3) {
645
645
  let r, o, a, h, l, c, u, m, w, g, p, M, f;
646
646
  for (o = i(t), a = i(e), o < a && ([t, e] = [e, t], [o, a] = [a, o]), f = e + pe * (e - t), h = i(f), l = 3, u = 0; h < a; ) {
647
- if (m = (e - t) * (a - h), w = (e - f) * (a - o), g = w - m, Math.abs(g) < Mn ? r = 2 * Mn : r = 2 * g, p = e - ((e - f) * w - (e - t) * m) / r, M = e + n * (f - e), u > s)
647
+ if (m = (e - t) * (a - h), w = (e - f) * (a - o), g = w - m, Math.abs(g) < bn ? r = 2 * bn : r = 2 * g, p = e - ((e - f) * w - (e - t) * m) / r, M = e + n * (f - e), u > s)
648
648
  throw new Error("Too many iterations.");
649
649
  if (u += 1, (p - f) * (e - p) > 0) {
650
650
  if (c = i(p), l += 1, c < h)
@@ -658,8 +658,8 @@ function yn(i, t = 0, e = 1, n = 110, s = 1e3) {
658
658
  }
659
659
  return [t, e, f, o, a, h, l];
660
660
  }
661
- const bn = 0.381966, Ki = 1e-11;
662
- class ts {
661
+ const vn = 0.381966, ts = 1e-11;
662
+ class es {
663
663
  constructor(t, e = 148e-10, n = 500) {
664
664
  F(this, "xmin"), F(this, "fval"), F(this, "iter"), F(this, "funcalls"), F(this, "brack"), this.func = t, this.tol = e, this.maxiter = n, this.func = t, this.tol = e, this.maxiter = n, this.xmin = 1 / 0, this.fval = 1 / 0, this.iter = 0, this.funcalls = 0, this.brack = null;
665
665
  }
@@ -670,9 +670,9 @@ class ts {
670
670
  let t, e, n, s, r, o, a;
671
671
  const h = this.func, l = this.brack;
672
672
  if (l === null)
673
- [r, o, a, t, e, n, s] = yn(h);
673
+ [r, o, a, t, e, n, s] = xn(h);
674
674
  else if (l.length === 2)
675
- [r, o, a, t, e, n, s] = yn(h, l[0], l[1]);
675
+ [r, o, a, t, e, n, s] = xn(h, l[0], l[1]);
676
676
  else if (l.length === 3) {
677
677
  if ([r, o, a] = l, r > a && ([a, r] = [r, a]), !(r < o && o < a))
678
678
  throw new Error("Not a bracketing interval.");
@@ -693,17 +693,17 @@ class ts {
693
693
  r = 1;
694
694
  let p = 0, M = 0, f;
695
695
  for (; p < this.maxiter; ) {
696
- const P = this.tol * Math.abs(o) + Ki, b = 2 * P, R = 0.5 * (m + w);
697
- if (Math.abs(o - R) < b - 0.5 * (w - m))
696
+ const P = this.tol * Math.abs(o) + ts, b = 2 * P, S = 0.5 * (m + w);
697
+ if (Math.abs(o - S) < b - 0.5 * (w - m))
698
698
  break;
699
699
  if (Math.abs(g) <= P)
700
- o >= R ? g = m - o : g = w - o, M = bn * g;
700
+ o >= S ? g = m - o : g = w - o, M = vn * g;
701
701
  else {
702
702
  const V = (o - a) * (u - c);
703
- let v = (o - h) * (u - l), S = (o - h) * v - (o - a) * V;
704
- v = 2 * (v - V), v > 0 && (S = -S), v = Math.abs(v);
703
+ let v = (o - h) * (u - l), k = (o - h) * v - (o - a) * V;
704
+ v = 2 * (v - V), v > 0 && (k = -k), v = Math.abs(v);
705
705
  const j = g;
706
- g = M, S > v * (m - o) && S < v * (w - o) && Math.abs(S) < Math.abs(0.5 * v * j) ? (M = S * 1 / v, f = o + M, (f - m < b || w - f < b) && (R - o >= 0 ? M = P : M = -P)) : (o >= R ? g = m - o : g = w - o, M = bn * g);
706
+ g = M, k > v * (m - o) && k < v * (w - o) && Math.abs(k) < Math.abs(0.5 * v * j) ? (M = k * 1 / v, f = o + M, (f - m < b || w - f < b) && (S - o >= 0 ? M = P : M = -P)) : (o >= S ? g = m - o : g = w - o, M = vn * g);
707
707
  }
708
708
  Math.abs(M) < P ? M >= 0 ? f = o + P : f = o - P : f = o + M;
709
709
  const C = t(f);
@@ -723,11 +723,11 @@ class ts {
723
723
  return this.optimize(), this.results();
724
724
  }
725
725
  }
726
- function hi(i, t = 1e-8, e = 1e3) {
727
- const n = new ts(i, t, e);
726
+ function ui(i, t = 1e-8, e = 1e3) {
727
+ const n = new es(i, t, e);
728
728
  return n.setBracket([0, 1]), n.run();
729
729
  }
730
- function li(i) {
730
+ function ci(i) {
731
731
  if (i.__esModule) return i;
732
732
  var t = i.default;
733
733
  if (typeof t == "function") {
@@ -747,18 +747,18 @@ function li(i) {
747
747
  }), e;
748
748
  }
749
749
  var O = {};
750
- const es = Object.prototype.toString;
751
- function ee(i) {
752
- const t = es.call(i);
750
+ const ns = Object.prototype.toString;
751
+ function ne(i) {
752
+ const t = ns.call(i);
753
753
  return t.endsWith("Array]") && !t.includes("Big");
754
754
  }
755
- const ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
755
+ const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
756
756
  __proto__: null,
757
- isAnyArray: ee
758
- }, Symbol.toStringTag, { value: "Module" })), is = /* @__PURE__ */ li(ns);
759
- function ss(i) {
757
+ isAnyArray: ne
758
+ }, Symbol.toStringTag, { value: "Module" })), ss = /* @__PURE__ */ ci(is);
759
+ function rs(i) {
760
760
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
761
- if (!ee(i))
761
+ if (!ne(i))
762
762
  throw new TypeError("input must be an array");
763
763
  if (i.length === 0)
764
764
  throw new TypeError("input must not be empty");
@@ -771,9 +771,9 @@ function ss(i) {
771
771
  i[a] > o && (o = i[a]);
772
772
  return o;
773
773
  }
774
- function rs(i) {
774
+ function os(i) {
775
775
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
776
- if (!ee(i))
776
+ if (!ne(i))
777
777
  throw new TypeError("input must be an array");
778
778
  if (i.length === 0)
779
779
  throw new TypeError("input must not be empty");
@@ -786,20 +786,20 @@ function rs(i) {
786
786
  i[a] < o && (o = i[a]);
787
787
  return o;
788
788
  }
789
- function os(i) {
789
+ function as(i) {
790
790
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
791
- if (ee(i)) {
791
+ if (ne(i)) {
792
792
  if (i.length === 0)
793
793
  throw new TypeError("input must not be empty");
794
794
  } else throw new TypeError("input must be an array");
795
795
  var e;
796
796
  if (t.output !== void 0) {
797
- if (!ee(t.output))
797
+ if (!ne(t.output))
798
798
  throw new TypeError("output option must be an array if specified");
799
799
  e = t.output;
800
800
  } else
801
801
  e = new Array(i.length);
802
- var n = rs(i), s = ss(i);
802
+ var n = os(i), s = rs(i);
803
803
  if (n === s)
804
804
  throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");
805
805
  var r = t.min, o = r === void 0 ? t.autoMinMax ? n : 0 : r, a = t.max, h = a === void 0 ? t.autoMinMax ? s : 1 : a;
@@ -809,17 +809,17 @@ function os(i) {
809
809
  e[c] = (i[c] - n) * l + o;
810
810
  return e;
811
811
  }
812
- const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
812
+ const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
813
813
  __proto__: null,
814
- default: os
815
- }, Symbol.toStringTag, { value: "Module" })), hs = /* @__PURE__ */ li(as);
814
+ default: as
815
+ }, Symbol.toStringTag, { value: "Module" })), ls = /* @__PURE__ */ ci(hs);
816
816
  Object.defineProperty(O, "__esModule", { value: !0 });
817
- var ft = is, xn = hs;
818
- const we = " ".repeat(2), ui = " ".repeat(4);
819
- function ls() {
820
- return ci(this);
817
+ var ft = ss, An = ls;
818
+ const we = " ".repeat(2), fi = " ".repeat(4);
819
+ function us() {
820
+ return mi(this);
821
821
  }
822
- function ci(i, t = {}) {
822
+ function mi(i, t = {}) {
823
823
  const {
824
824
  maxRows: e = 15,
825
825
  maxColumns: n = 10,
@@ -828,13 +828,13 @@ function ci(i, t = {}) {
828
828
  } = t;
829
829
  return `${i.constructor.name} {
830
830
  ${we}[
831
- ${ui}${us(i, e, n, s, r)}
831
+ ${fi}${cs(i, e, n, s, r)}
832
832
  ${we}]
833
833
  ${we}rows: ${i.rows}
834
834
  ${we}columns: ${i.columns}
835
835
  }`;
836
836
  }
837
- function us(i, t, e, n, s) {
837
+ function cs(i, t, e, n, s) {
838
838
  const { rows: r, columns: o } = i, a = Math.min(r, t), h = Math.min(o, e), l = [];
839
839
  if (s === "auto") {
840
840
  s = !1;
@@ -848,16 +848,16 @@ function us(i, t, e, n, s) {
848
848
  for (let c = 0; c < a; c++) {
849
849
  let u = [];
850
850
  for (let m = 0; m < h; m++)
851
- u.push(cs(i.get(c, m), n, s));
851
+ u.push(fs(i.get(c, m), n, s));
852
852
  l.push(`${u.join(" ")}`);
853
853
  }
854
854
  return h !== o && (l[l.length - 1] += ` ... ${o - e} more columns`), a !== r && l.push(`... ${r - t} more rows`), l.join(`
855
- ${ui}`);
855
+ ${fi}`);
856
856
  }
857
- function cs(i, t, e) {
858
- return (i >= 0 && e ? ` ${vn(i, t - 1)}` : vn(i, t)).padEnd(t);
857
+ function fs(i, t, e) {
858
+ return (i >= 0 && e ? ` ${En(i, t - 1)}` : En(i, t)).padEnd(t);
859
859
  }
860
- function vn(i, t) {
860
+ function En(i, t) {
861
861
  let e = i.toString();
862
862
  if (e.length <= t) return e;
863
863
  let n = i.toFixed(t);
@@ -866,7 +866,7 @@ function vn(i, t) {
866
866
  let s = i.toExponential(t);
867
867
  return s.length > t && (s = i.toExponential(Math.max(0, t - (s.length - t)))), s.slice(0);
868
868
  }
869
- function fs(i, t) {
869
+ function ms(i, t) {
870
870
  i.prototype.add = function(e) {
871
871
  return typeof e == "number" ? this.addS(e) : this.addM(e);
872
872
  }, i.prototype.addS = function(e) {
@@ -1286,27 +1286,27 @@ function Ot(i, t) {
1286
1286
  throw new RangeError("vector size must be the same as the number of rows");
1287
1287
  return t;
1288
1288
  }
1289
- function rn(i, t) {
1289
+ function on(i, t) {
1290
1290
  if (!ft.isAnyArray(t))
1291
1291
  throw new TypeError("row indices must be an array");
1292
1292
  for (let e = 0; e < t.length; e++)
1293
1293
  if (t[e] < 0 || t[e] >= i.rows)
1294
1294
  throw new RangeError("row indices are out of range");
1295
1295
  }
1296
- function on(i, t) {
1296
+ function an(i, t) {
1297
1297
  if (!ft.isAnyArray(t))
1298
1298
  throw new TypeError("column indices must be an array");
1299
1299
  for (let e = 0; e < t.length; e++)
1300
1300
  if (t[e] < 0 || t[e] >= i.columns)
1301
1301
  throw new RangeError("column indices are out of range");
1302
1302
  }
1303
- function Ye(i, t, e, n, s) {
1303
+ function Xe(i, t, e, n, s) {
1304
1304
  if (arguments.length !== 5)
1305
1305
  throw new RangeError("expected 4 arguments");
1306
1306
  if (de("startRow", t), de("endRow", e), de("startColumn", n), de("endColumn", s), t > e || n > s || t < 0 || t >= i.rows || e < 0 || e >= i.rows || n < 0 || n >= i.columns || s < 0 || s >= i.columns)
1307
1307
  throw new RangeError("Submatrix indices are out of range");
1308
1308
  }
1309
- function _e(i, t = 0) {
1309
+ function Fe(i, t = 0) {
1310
1310
  let e = [];
1311
1311
  for (let n = 0; n < i; n++)
1312
1312
  e.push(t);
@@ -1320,49 +1320,49 @@ function Vt(i) {
1320
1320
  if (i.isEmpty())
1321
1321
  throw new Error("Empty matrix has no elements to index");
1322
1322
  }
1323
- function ms(i) {
1324
- let t = _e(i.rows);
1323
+ function gs(i) {
1324
+ let t = Fe(i.rows);
1325
1325
  for (let e = 0; e < i.rows; ++e)
1326
1326
  for (let n = 0; n < i.columns; ++n)
1327
1327
  t[e] += i.get(e, n);
1328
1328
  return t;
1329
1329
  }
1330
- function gs(i) {
1331
- let t = _e(i.columns);
1330
+ function ps(i) {
1331
+ let t = Fe(i.columns);
1332
1332
  for (let e = 0; e < i.rows; ++e)
1333
1333
  for (let n = 0; n < i.columns; ++n)
1334
1334
  t[n] += i.get(e, n);
1335
1335
  return t;
1336
1336
  }
1337
- function ps(i) {
1337
+ function ws(i) {
1338
1338
  let t = 0;
1339
1339
  for (let e = 0; e < i.rows; e++)
1340
1340
  for (let n = 0; n < i.columns; n++)
1341
1341
  t += i.get(e, n);
1342
1342
  return t;
1343
1343
  }
1344
- function ws(i) {
1345
- let t = _e(i.rows, 1);
1344
+ function ds(i) {
1345
+ let t = Fe(i.rows, 1);
1346
1346
  for (let e = 0; e < i.rows; ++e)
1347
1347
  for (let n = 0; n < i.columns; ++n)
1348
1348
  t[e] *= i.get(e, n);
1349
1349
  return t;
1350
1350
  }
1351
- function ds(i) {
1352
- let t = _e(i.columns, 1);
1351
+ function Ps(i) {
1352
+ let t = Fe(i.columns, 1);
1353
1353
  for (let e = 0; e < i.rows; ++e)
1354
1354
  for (let n = 0; n < i.columns; ++n)
1355
1355
  t[n] *= i.get(e, n);
1356
1356
  return t;
1357
1357
  }
1358
- function Ps(i) {
1358
+ function Ms(i) {
1359
1359
  let t = 1;
1360
1360
  for (let e = 0; e < i.rows; e++)
1361
1361
  for (let n = 0; n < i.columns; n++)
1362
1362
  t *= i.get(e, n);
1363
1363
  return t;
1364
1364
  }
1365
- function Ms(i, t, e) {
1365
+ function ys(i, t, e) {
1366
1366
  const n = i.rows, s = i.columns, r = [];
1367
1367
  for (let o = 0; o < n; o++) {
1368
1368
  let a = 0, h = 0, l = 0;
@@ -1372,7 +1372,7 @@ function Ms(i, t, e) {
1372
1372
  }
1373
1373
  return r;
1374
1374
  }
1375
- function ys(i, t, e) {
1375
+ function bs(i, t, e) {
1376
1376
  const n = i.rows, s = i.columns, r = [];
1377
1377
  for (let o = 0; o < s; o++) {
1378
1378
  let a = 0, h = 0, l = 0;
@@ -1382,7 +1382,7 @@ function ys(i, t, e) {
1382
1382
  }
1383
1383
  return r;
1384
1384
  }
1385
- function bs(i, t, e) {
1385
+ function xs(i, t, e) {
1386
1386
  const n = i.rows, s = i.columns, r = n * s;
1387
1387
  let o = 0, a = 0, h = 0;
1388
1388
  for (let l = 0; l < n; l++)
@@ -1390,22 +1390,22 @@ function bs(i, t, e) {
1390
1390
  h = i.get(l, c) - e, o += h, a += h * h;
1391
1391
  return t ? (a - o * o / r) / (r - 1) : (a - o * o / r) / r;
1392
1392
  }
1393
- function xs(i, t) {
1393
+ function vs(i, t) {
1394
1394
  for (let e = 0; e < i.rows; e++)
1395
1395
  for (let n = 0; n < i.columns; n++)
1396
1396
  i.set(e, n, i.get(e, n) - t[e]);
1397
1397
  }
1398
- function vs(i, t) {
1398
+ function As(i, t) {
1399
1399
  for (let e = 0; e < i.rows; e++)
1400
1400
  for (let n = 0; n < i.columns; n++)
1401
1401
  i.set(e, n, i.get(e, n) - t[n]);
1402
1402
  }
1403
- function As(i, t) {
1403
+ function Es(i, t) {
1404
1404
  for (let e = 0; e < i.rows; e++)
1405
1405
  for (let n = 0; n < i.columns; n++)
1406
1406
  i.set(e, n, i.get(e, n) - t);
1407
1407
  }
1408
- function Es(i) {
1408
+ function Ss(i) {
1409
1409
  const t = [];
1410
1410
  for (let e = 0; e < i.rows; e++) {
1411
1411
  let n = 0;
@@ -1415,12 +1415,12 @@ function Es(i) {
1415
1415
  }
1416
1416
  return t;
1417
1417
  }
1418
- function Ss(i, t) {
1418
+ function ks(i, t) {
1419
1419
  for (let e = 0; e < i.rows; e++)
1420
1420
  for (let n = 0; n < i.columns; n++)
1421
1421
  i.set(e, n, i.get(e, n) / t[e]);
1422
1422
  }
1423
- function ks(i) {
1423
+ function Rs(i) {
1424
1424
  const t = [];
1425
1425
  for (let e = 0; e < i.columns; e++) {
1426
1426
  let n = 0;
@@ -1430,12 +1430,12 @@ function ks(i) {
1430
1430
  }
1431
1431
  return t;
1432
1432
  }
1433
- function Rs(i, t) {
1433
+ function Cs(i, t) {
1434
1434
  for (let e = 0; e < i.rows; e++)
1435
1435
  for (let n = 0; n < i.columns; n++)
1436
1436
  i.set(e, n, i.get(e, n) / t[n]);
1437
1437
  }
1438
- function Cs(i) {
1438
+ function Ts(i) {
1439
1439
  const t = i.size - 1;
1440
1440
  let e = 0;
1441
1441
  for (let n = 0; n < i.columns; n++)
@@ -1443,7 +1443,7 @@ function Cs(i) {
1443
1443
  e += i.get(s, n) ** 2 / t;
1444
1444
  return Math.sqrt(e);
1445
1445
  }
1446
- function Ts(i, t) {
1446
+ function Is(i, t) {
1447
1447
  for (let e = 0; e < i.rows; e++)
1448
1448
  for (let n = 0; n < i.columns; n++)
1449
1449
  i.set(e, n, i.get(e, n) / t);
@@ -2003,14 +2003,14 @@ let Z = class st {
2003
2003
  strassen2x2(t) {
2004
2004
  t = E.checkMatrix(t);
2005
2005
  let e = new E(2, 2);
2006
- const n = this.get(0, 0), s = t.get(0, 0), r = this.get(0, 1), o = t.get(0, 1), a = this.get(1, 0), h = t.get(1, 0), l = this.get(1, 1), c = t.get(1, 1), u = (n + l) * (s + c), m = (a + l) * s, w = n * (o - c), g = l * (h - s), p = (n + r) * c, M = (a - n) * (s + o), f = (r - l) * (h + c), P = u + g - p + f, b = w + p, R = m + g, C = u - m + w + M;
2007
- return e.set(0, 0, P), e.set(0, 1, b), e.set(1, 0, R), e.set(1, 1, C), e;
2006
+ const n = this.get(0, 0), s = t.get(0, 0), r = this.get(0, 1), o = t.get(0, 1), a = this.get(1, 0), h = t.get(1, 0), l = this.get(1, 1), c = t.get(1, 1), u = (n + l) * (s + c), m = (a + l) * s, w = n * (o - c), g = l * (h - s), p = (n + r) * c, M = (a - n) * (s + o), f = (r - l) * (h + c), P = u + g - p + f, b = w + p, S = m + g, C = u - m + w + M;
2007
+ return e.set(0, 0, P), e.set(0, 1, b), e.set(1, 0, S), e.set(1, 1, C), e;
2008
2008
  }
2009
2009
  strassen3x3(t) {
2010
2010
  t = E.checkMatrix(t);
2011
2011
  let e = new E(3, 3);
2012
- const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), R = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + R), S = (-n + o + a) * (m - w + M), j = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), $ = (n + s + r - a - h - l - c) * f, I = c * (-m + g + p - M - f - P + b), _ = (-r + c + u) * (M + P - b), W = (r - u) * (M - b), L = r * P, N = (c + u) * (-P + b), B = (-r + a + h) * (f + P - R), Y = (r - h) * (f - R), H = (a + h) * (-P + R), T = s * p, U = h * b, tt = o * g, K = l * w, G = u * R, Be = d + L + T, Ve = C + S + j + d + _ + L + N, je = d + x + y + $ + L + B + H, qe = V + v + S + d + L + B + Y, he = V + S + j + d + U, le = L + B + Y + H + tt, ue = d + x + A + I + _ + W + L, ce = _ + W + L + N + K, fe = d + x + A + y + G;
2013
- return e.set(0, 0, Be), e.set(0, 1, Ve), e.set(0, 2, je), e.set(1, 0, qe), e.set(1, 1, he), e.set(1, 2, le), e.set(2, 0, ue), e.set(2, 1, ce), e.set(2, 2, fe), e;
2012
+ const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), S = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + S), k = (-n + o + a) * (m - w + M), j = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), I = (n + s + r - a - h - l - c) * f, $ = c * (-m + g + p - M - f - P + b), _ = (-r + c + u) * (M + P - b), W = (r - u) * (M - b), L = r * P, N = (c + u) * (-P + b), B = (-r + a + h) * (f + P - S), Y = (r - h) * (f - S), H = (a + h) * (-P + S), T = s * p, U = h * b, tt = o * g, K = l * w, G = u * S, Ve = d + L + T, je = C + k + j + d + _ + L + N, qe = d + x + y + I + L + B + H, Ne = V + v + k + d + L + B + Y, he = V + k + j + d + U, le = L + B + Y + H + tt, ue = d + x + A + $ + _ + W + L, ce = _ + W + L + N + K, fe = d + x + A + y + G;
2013
+ return e.set(0, 0, Ve), e.set(0, 1, je), e.set(0, 2, qe), e.set(1, 0, Ne), e.set(1, 1, he), e.set(1, 2, le), e.set(2, 0, ue), e.set(2, 1, ce), e.set(2, 2, fe), e;
2014
2014
  }
2015
2015
  mmulStrassen(t) {
2016
2016
  t = E.checkMatrix(t);
@@ -2033,25 +2033,25 @@ let Z = class st {
2033
2033
  if (w <= 512 || g <= 512)
2034
2034
  return u.mmul(m);
2035
2035
  w % 2 === 1 && g % 2 === 1 ? (u = a(u, w + 1, g + 1), m = a(m, w + 1, g + 1)) : w % 2 === 1 ? (u = a(u, w + 1, g), m = a(m, w + 1, g)) : g % 2 === 1 && (u = a(u, w, g + 1), m = a(m, w, g + 1));
2036
- let p = parseInt(u.rows / 2, 10), M = parseInt(u.columns / 2, 10), f = u.subMatrix(0, p - 1, 0, M - 1), P = m.subMatrix(0, p - 1, 0, M - 1), b = u.subMatrix(0, p - 1, M, u.columns - 1), R = m.subMatrix(0, p - 1, M, m.columns - 1), C = u.subMatrix(p, u.rows - 1, 0, M - 1), V = m.subMatrix(p, m.rows - 1, 0, M - 1), v = u.subMatrix(p, u.rows - 1, M, u.columns - 1), S = m.subMatrix(p, m.rows - 1, M, m.columns - 1), j = c(
2036
+ let p = parseInt(u.rows / 2, 10), M = parseInt(u.columns / 2, 10), f = u.subMatrix(0, p - 1, 0, M - 1), P = m.subMatrix(0, p - 1, 0, M - 1), b = u.subMatrix(0, p - 1, M, u.columns - 1), S = m.subMatrix(0, p - 1, M, m.columns - 1), C = u.subMatrix(p, u.rows - 1, 0, M - 1), V = m.subMatrix(p, m.rows - 1, 0, M - 1), v = u.subMatrix(p, u.rows - 1, M, u.columns - 1), k = m.subMatrix(p, m.rows - 1, M, m.columns - 1), j = c(
2037
2037
  st.add(f, v),
2038
- st.add(P, S),
2038
+ st.add(P, k),
2039
2039
  p,
2040
2040
  M
2041
- ), d = c(st.add(C, v), P, p, M), x = c(f, st.sub(R, S), p, M), A = c(v, st.sub(V, P), p, M), y = c(st.add(f, b), S, p, M), $ = c(
2041
+ ), d = c(st.add(C, v), P, p, M), x = c(f, st.sub(S, k), p, M), A = c(v, st.sub(V, P), p, M), y = c(st.add(f, b), k, p, M), I = c(
2042
2042
  st.sub(C, f),
2043
- st.add(P, R),
2043
+ st.add(P, S),
2044
2044
  p,
2045
2045
  M
2046
- ), I = c(
2046
+ ), $ = c(
2047
2047
  st.sub(b, v),
2048
- st.add(V, S),
2048
+ st.add(V, k),
2049
2049
  p,
2050
2050
  M
2051
2051
  ), _ = st.add(j, A);
2052
- _.sub(y), _.add(I);
2052
+ _.sub(y), _.add($);
2053
2053
  let W = st.add(x, y), L = st.add(d, A), N = st.sub(j, d);
2054
- N.add(x), N.add($);
2054
+ N.add(x), N.add(I);
2055
2055
  let B = st.zeros(2 * _.rows, 2 * _.columns);
2056
2056
  return B = B.setSubMatrix(_, 0, 0), B = B.setSubMatrix(W, _.rows, 0), B = B.setSubMatrix(L, 0, _.columns), B = B.setSubMatrix(N, _.rows, _.columns), B.subMatrix(0, w - 1, 0, g - 1);
2057
2057
  }
@@ -2067,7 +2067,7 @@ let Z = class st {
2067
2067
  let s = new E(this.rows, this.columns);
2068
2068
  for (let r = 0; r < this.rows; r++) {
2069
2069
  const o = this.getRow(r);
2070
- o.length > 0 && xn(o, { min: e, max: n, output: o }), s.setRow(r, o);
2070
+ o.length > 0 && An(o, { min: e, max: n, output: o }), s.setRow(r, o);
2071
2071
  }
2072
2072
  return s;
2073
2073
  }
@@ -2081,7 +2081,7 @@ let Z = class st {
2081
2081
  let s = new E(this.rows, this.columns);
2082
2082
  for (let r = 0; r < this.columns; r++) {
2083
2083
  const o = this.getColumn(r);
2084
- o.length && xn(o, {
2084
+ o.length && An(o, {
2085
2085
  min: e,
2086
2086
  max: n,
2087
2087
  output: o
@@ -2130,18 +2130,18 @@ let Z = class st {
2130
2130
  t.set(n, e, this.get(e, n));
2131
2131
  return t;
2132
2132
  }
2133
- sortRows(t = An) {
2133
+ sortRows(t = Sn) {
2134
2134
  for (let e = 0; e < this.rows; e++)
2135
2135
  this.setRow(e, this.getRow(e).sort(t));
2136
2136
  return this;
2137
2137
  }
2138
- sortColumns(t = An) {
2138
+ sortColumns(t = Sn) {
2139
2139
  for (let e = 0; e < this.columns; e++)
2140
2140
  this.setColumn(e, this.getColumn(e).sort(t));
2141
2141
  return this;
2142
2142
  }
2143
2143
  subMatrix(t, e, n, s) {
2144
- Ye(this, t, e, n, s);
2144
+ Xe(this, t, e, n, s);
2145
2145
  let r = new E(
2146
2146
  e - t + 1,
2147
2147
  s - n + 1
@@ -2179,14 +2179,14 @@ let Z = class st {
2179
2179
  if (t = E.checkMatrix(t), t.isEmpty())
2180
2180
  return this;
2181
2181
  let s = e + t.rows - 1, r = n + t.columns - 1;
2182
- Ye(this, e, s, n, r);
2182
+ Xe(this, e, s, n, r);
2183
2183
  for (let o = 0; o < t.rows; o++)
2184
2184
  for (let a = 0; a < t.columns; a++)
2185
2185
  this.set(e + o, n + a, t.get(o, a));
2186
2186
  return this;
2187
2187
  }
2188
2188
  selection(t, e) {
2189
- rn(this, t), on(this, e);
2189
+ on(this, t), an(this, e);
2190
2190
  let n = new E(t.length, e.length);
2191
2191
  for (let s = 0; s < t.length; s++) {
2192
2192
  let r = t[s];
@@ -2220,11 +2220,11 @@ let Z = class st {
2220
2220
  sum(t) {
2221
2221
  switch (t) {
2222
2222
  case "row":
2223
- return ms(this);
2224
- case "column":
2225
2223
  return gs(this);
2226
- case void 0:
2224
+ case "column":
2227
2225
  return ps(this);
2226
+ case void 0:
2227
+ return ws(this);
2228
2228
  default:
2229
2229
  throw new Error(`invalid option: ${t}`);
2230
2230
  }
@@ -2232,11 +2232,11 @@ let Z = class st {
2232
2232
  product(t) {
2233
2233
  switch (t) {
2234
2234
  case "row":
2235
- return ws(this);
2236
- case "column":
2237
2235
  return ds(this);
2238
- case void 0:
2236
+ case "column":
2239
2237
  return Ps(this);
2238
+ case void 0:
2239
+ return Ms(this);
2240
2240
  default:
2241
2241
  throw new Error(`invalid option: ${t}`);
2242
2242
  }
@@ -2270,17 +2270,17 @@ let Z = class st {
2270
2270
  case "row": {
2271
2271
  if (!ft.isAnyArray(s))
2272
2272
  throw new TypeError("mean must be an array");
2273
- return Ms(this, n, s);
2273
+ return ys(this, n, s);
2274
2274
  }
2275
2275
  case "column": {
2276
2276
  if (!ft.isAnyArray(s))
2277
2277
  throw new TypeError("mean must be an array");
2278
- return ys(this, n, s);
2278
+ return bs(this, n, s);
2279
2279
  }
2280
2280
  case void 0: {
2281
2281
  if (typeof s != "number")
2282
2282
  throw new TypeError("mean must be a number");
2283
- return bs(this, n, s);
2283
+ return xs(this, n, s);
2284
2284
  }
2285
2285
  default:
2286
2286
  throw new Error(`invalid option: ${t}`);
@@ -2303,17 +2303,17 @@ let Z = class st {
2303
2303
  case "row": {
2304
2304
  if (!ft.isAnyArray(n))
2305
2305
  throw new TypeError("center must be an array");
2306
- return xs(this, n), this;
2306
+ return vs(this, n), this;
2307
2307
  }
2308
2308
  case "column": {
2309
2309
  if (!ft.isAnyArray(n))
2310
2310
  throw new TypeError("center must be an array");
2311
- return vs(this, n), this;
2311
+ return As(this, n), this;
2312
2312
  }
2313
2313
  case void 0: {
2314
2314
  if (typeof n != "number")
2315
2315
  throw new TypeError("center must be a number");
2316
- return As(this, n), this;
2316
+ return Es(this, n), this;
2317
2317
  }
2318
2318
  default:
2319
2319
  throw new Error(`invalid option: ${t}`);
@@ -2326,31 +2326,31 @@ let Z = class st {
2326
2326
  switch (t) {
2327
2327
  case "row": {
2328
2328
  if (n === void 0)
2329
- n = Es(this);
2329
+ n = Ss(this);
2330
2330
  else if (!ft.isAnyArray(n))
2331
2331
  throw new TypeError("scale must be an array");
2332
- return Ss(this, n), this;
2332
+ return ks(this, n), this;
2333
2333
  }
2334
2334
  case "column": {
2335
2335
  if (n === void 0)
2336
- n = ks(this);
2336
+ n = Rs(this);
2337
2337
  else if (!ft.isAnyArray(n))
2338
2338
  throw new TypeError("scale must be an array");
2339
- return Rs(this, n), this;
2339
+ return Cs(this, n), this;
2340
2340
  }
2341
2341
  case void 0: {
2342
2342
  if (n === void 0)
2343
- n = Cs(this);
2343
+ n = Ts(this);
2344
2344
  else if (typeof n != "number")
2345
2345
  throw new TypeError("scale must be a number");
2346
- return Ts(this, n), this;
2346
+ return Is(this, n), this;
2347
2347
  }
2348
2348
  default:
2349
2349
  throw new Error(`invalid option: ${t}`);
2350
2350
  }
2351
2351
  }
2352
2352
  toString(t) {
2353
- return ci(this, t);
2353
+ return mi(this, t);
2354
2354
  }
2355
2355
  [Symbol.iterator]() {
2356
2356
  return this.entries();
@@ -2377,8 +2377,8 @@ let Z = class st {
2377
2377
  }
2378
2378
  };
2379
2379
  Z.prototype.klass = "Matrix";
2380
- typeof Symbol < "u" && (Z.prototype[Symbol.for("nodejs.util.inspect.custom")] = ls);
2381
- function An(i, t) {
2380
+ typeof Symbol < "u" && (Z.prototype[Symbol.for("nodejs.util.inspect.custom")] = us);
2381
+ function Sn(i, t) {
2382
2382
  return i - t;
2383
2383
  }
2384
2384
  function $s(i) {
@@ -2391,13 +2391,13 @@ Z.prototype.diagonal = Z.prototype.diag;
2391
2391
  Z.identity = Z.eye;
2392
2392
  Z.prototype.negate = Z.prototype.neg;
2393
2393
  Z.prototype.tensorProduct = Z.prototype.kroneckerProduct;
2394
- var Pe, Oe, Me;
2394
+ var Pe, ze, Me;
2395
2395
  let E = (Me = class extends Z {
2396
2396
  constructor(i, t) {
2397
- if (super(), ii(this, Pe), F(this, "data"), Me.isMatrix(i))
2398
- dn(this, Pe, Oe).call(this, i.rows, i.columns), Me.copy(i, this);
2397
+ if (super(), ri(this, Pe), F(this, "data"), Me.isMatrix(i))
2398
+ Mn(this, Pe, ze).call(this, i.rows, i.columns), Me.copy(i, this);
2399
2399
  else if (Number.isInteger(i) && i >= 0)
2400
- dn(this, Pe, Oe).call(this, i, t);
2400
+ Mn(this, Pe, ze).call(this, i, t);
2401
2401
  else if (ft.isAnyArray(i)) {
2402
2402
  const e = i;
2403
2403
  if (i = e.length, t = i ? e[0].length : 0, typeof t != "number")
@@ -2460,7 +2460,7 @@ let E = (Me = class extends Z {
2460
2460
  * @param {number} nRows
2461
2461
  * @param {number} nColumns
2462
2462
  */
2463
- Oe = function(i, t) {
2463
+ ze = function(i, t) {
2464
2464
  if (this.data = [], Number.isInteger(t) && t >= 0)
2465
2465
  for (let e = 0; e < i; e++)
2466
2466
  this.data.push(new Float64Array(t));
@@ -2468,24 +2468,24 @@ Oe = function(i, t) {
2468
2468
  throw new TypeError("nColumns must be a positive integer");
2469
2469
  this.rows = i, this.columns = t;
2470
2470
  }, Me);
2471
- fs(Z, E);
2471
+ ms(Z, E);
2472
2472
  var ht;
2473
- const Is = class Xe extends Z {
2473
+ const _s = class We extends Z {
2474
2474
  /**
2475
2475
  * @param {number | AbstractMatrix | ArrayLike<ArrayLike<number>>} diagonalSize
2476
2476
  * @return {this}
2477
2477
  */
2478
2478
  constructor(t) {
2479
- if (super(), ii(this, ht), E.isMatrix(t)) {
2479
+ if (super(), ri(this, ht), E.isMatrix(t)) {
2480
2480
  if (!t.isSymmetric())
2481
2481
  throw new TypeError("not symmetric data");
2482
- Ne(this, ht, E.copy(
2482
+ Oe(this, ht, E.copy(
2483
2483
  t,
2484
2484
  new E(t.rows, t.rows)
2485
2485
  ));
2486
2486
  } else if (Number.isInteger(t) && t >= 0)
2487
- Ne(this, ht, new E(t, t));
2488
- else if (Ne(this, ht, new E(t)), !this.isSymmetric())
2487
+ Oe(this, ht, new E(t, t));
2488
+ else if (Oe(this, ht, new E(t)), !this.isSymmetric())
2489
2489
  throw new TypeError("not symmetric data");
2490
2490
  }
2491
2491
  get size() {
@@ -2525,7 +2525,7 @@ const Is = class Xe extends Z {
2525
2525
  return new this(t).fill(1);
2526
2526
  }
2527
2527
  clone() {
2528
- const t = new Xe(this.diagonalSize);
2528
+ const t = new We(this.diagonalSize);
2529
2529
  for (const [e, n, s] of this.upperRightEntries())
2530
2530
  t.set(e, n, s);
2531
2531
  return t;
@@ -2597,7 +2597,7 @@ const Is = class Xe extends Z {
2597
2597
  t
2598
2598
  )}`
2599
2599
  );
2600
- const s = new Xe(n);
2600
+ const s = new We(n);
2601
2601
  for (let r = 0, o = 0, a = 0; a < e; a++)
2602
2602
  s.set(r, o, t[a]), ++r >= n && (r = ++o);
2603
2603
  return s;
@@ -2626,9 +2626,9 @@ const Is = class Xe extends Z {
2626
2626
  }
2627
2627
  };
2628
2628
  ht = /* @__PURE__ */ new WeakMap();
2629
- let Kt = Is;
2630
- Kt.prototype.klassType = "SymmetricMatrix";
2631
- let fi = class mi extends Kt {
2629
+ let te = _s;
2630
+ te.prototype.klassType = "SymmetricMatrix";
2631
+ let gi = class pi extends te {
2632
2632
  /**
2633
2633
  * not the same as matrix.isSymmetric()
2634
2634
  * Here is to check if it's instanceof SymmetricMatrix without bundling issues
@@ -2637,7 +2637,7 @@ let fi = class mi extends Kt {
2637
2637
  * @returns {boolean}
2638
2638
  */
2639
2639
  static isDistanceMatrix(t) {
2640
- return Kt.isSymmetricMatrix(t) && t.klassSubType === "DistanceMatrix";
2640
+ return te.isSymmetricMatrix(t) && t.klassSubType === "DistanceMatrix";
2641
2641
  }
2642
2642
  constructor(t) {
2643
2643
  if (super(t), !this.isDistance())
@@ -2650,10 +2650,10 @@ let fi = class mi extends Kt {
2650
2650
  return e === void 0 && (e = t, t = this.diagonalSize), e = e.slice(), e[t] = 0, super.addCross(t, e);
2651
2651
  }
2652
2652
  toSymmetricMatrix() {
2653
- return new Kt(this);
2653
+ return new te(this);
2654
2654
  }
2655
2655
  clone() {
2656
- const t = new mi(this.diagonalSize);
2656
+ const t = new pi(this.diagonalSize);
2657
2657
  for (const [e, n, s] of this.upperRightEntries())
2658
2658
  e !== n && t.set(e, n, s);
2659
2659
  return t;
@@ -2703,13 +2703,13 @@ let fi = class mi extends Kt {
2703
2703
  return s;
2704
2704
  }
2705
2705
  };
2706
- fi.prototype.klassSubType = "DistanceMatrix";
2706
+ gi.prototype.klassSubType = "DistanceMatrix";
2707
2707
  let Et = class extends Z {
2708
2708
  constructor(t, e, n) {
2709
2709
  super(), this.matrix = t, this.rows = e, this.columns = n;
2710
2710
  }
2711
2711
  };
2712
- class _s extends Et {
2712
+ class Fs extends Et {
2713
2713
  constructor(t, e) {
2714
2714
  wt(t, e), super(t, t.rows, 1), this.column = e;
2715
2715
  }
@@ -2720,9 +2720,9 @@ class _s extends Et {
2720
2720
  return this.matrix.get(t, this.column);
2721
2721
  }
2722
2722
  }
2723
- class Fs extends Et {
2723
+ class Ls extends Et {
2724
2724
  constructor(t, e) {
2725
- on(t, e), super(t, t.rows, e.length), this.columnIndices = e;
2725
+ an(t, e), super(t, t.rows, e.length), this.columnIndices = e;
2726
2726
  }
2727
2727
  set(t, e, n) {
2728
2728
  return this.matrix.set(t, this.columnIndices[e], n), this;
@@ -2731,7 +2731,7 @@ class Fs extends Et {
2731
2731
  return this.matrix.get(t, this.columnIndices[e]);
2732
2732
  }
2733
2733
  }
2734
- class Ls extends Et {
2734
+ class Bs extends Et {
2735
2735
  constructor(t) {
2736
2736
  super(t, t.rows, t.columns);
2737
2737
  }
@@ -2742,7 +2742,7 @@ class Ls extends Et {
2742
2742
  return this.matrix.get(t, this.columns - e - 1);
2743
2743
  }
2744
2744
  }
2745
- class Bs extends Et {
2745
+ class Vs extends Et {
2746
2746
  constructor(t) {
2747
2747
  super(t, t.rows, t.columns);
2748
2748
  }
@@ -2753,7 +2753,7 @@ class Bs extends Et {
2753
2753
  return this.matrix.get(this.rows - t - 1, e);
2754
2754
  }
2755
2755
  }
2756
- class Vs extends Et {
2756
+ class js extends Et {
2757
2757
  constructor(t, e) {
2758
2758
  pt(t, e), super(t, 1, t.columns), this.row = e;
2759
2759
  }
@@ -2764,9 +2764,9 @@ class Vs extends Et {
2764
2764
  return this.matrix.get(this.row, e);
2765
2765
  }
2766
2766
  }
2767
- class js extends Et {
2767
+ class qs extends Et {
2768
2768
  constructor(t, e) {
2769
- rn(t, e), super(t, e.length, t.columns), this.rowIndices = e;
2769
+ on(t, e), super(t, e.length, t.columns), this.rowIndices = e;
2770
2770
  }
2771
2771
  set(t, e, n) {
2772
2772
  return this.matrix.set(this.rowIndices[t], e, n), this;
@@ -2775,9 +2775,9 @@ class js extends Et {
2775
2775
  return this.matrix.get(this.rowIndices[t], e);
2776
2776
  }
2777
2777
  }
2778
- let ve = class extends Et {
2778
+ let Ae = class extends Et {
2779
2779
  constructor(t, e, n) {
2780
- rn(t, e), on(t, n), super(t, e.length, n.length), this.rowIndices = e, this.columnIndices = n;
2780
+ on(t, e), an(t, n), super(t, e.length, n.length), this.rowIndices = e, this.columnIndices = n;
2781
2781
  }
2782
2782
  set(t, e, n) {
2783
2783
  return this.matrix.set(
@@ -2793,9 +2793,9 @@ let ve = class extends Et {
2793
2793
  );
2794
2794
  }
2795
2795
  };
2796
- class qs extends Et {
2796
+ class Ns extends Et {
2797
2797
  constructor(t, e, n, s, r) {
2798
- Ye(t, e, n, s, r), super(t, n - e + 1, r - s + 1), this.startRow = e, this.startColumn = s;
2798
+ Xe(t, e, n, s, r), super(t, n - e + 1, r - s + 1), this.startRow = e, this.startColumn = s;
2799
2799
  }
2800
2800
  set(t, e, n) {
2801
2801
  return this.matrix.set(
@@ -2811,7 +2811,7 @@ class qs extends Et {
2811
2811
  );
2812
2812
  }
2813
2813
  }
2814
- class Ns extends Et {
2814
+ class Os extends Et {
2815
2815
  constructor(t) {
2816
2816
  super(t, t.columns, t.rows);
2817
2817
  }
@@ -2822,7 +2822,7 @@ class Ns extends Et {
2822
2822
  return this.matrix.get(e, t);
2823
2823
  }
2824
2824
  }
2825
- class gi extends Z {
2825
+ class wi extends Z {
2826
2826
  constructor(t, e = {}) {
2827
2827
  const { rows: n = 1 } = e;
2828
2828
  if (t.length % n !== 0)
@@ -2852,12 +2852,12 @@ let gt = class extends Z {
2852
2852
  return this.data[t][e];
2853
2853
  }
2854
2854
  };
2855
- function Os(i, t) {
2855
+ function zs(i, t) {
2856
2856
  if (ft.isAnyArray(i))
2857
- return i[0] && ft.isAnyArray(i[0]) ? new gt(i) : new gi(i, t);
2857
+ return i[0] && ft.isAnyArray(i[0]) ? new gt(i) : new wi(i, t);
2858
2858
  throw new Error("the argument is not an array");
2859
2859
  }
2860
- let Fe = class {
2860
+ let Le = class {
2861
2861
  constructor(t) {
2862
2862
  t = gt.checkMatrix(t);
2863
2863
  let e = t.clone(), n = e.rows, s = e.columns, r = new Float64Array(n), o = 1, a, h, l, c, u, m, w, g, p;
@@ -2943,7 +2943,7 @@ function xt(i, t) {
2943
2943
  let e = 0;
2944
2944
  return Math.abs(i) > Math.abs(t) ? (e = t / i, Math.abs(i) * Math.sqrt(1 + e * e)) : t !== 0 ? (e = i / t, Math.abs(t) * Math.sqrt(1 + e * e)) : 0;
2945
2945
  }
2946
- class an {
2946
+ class hn {
2947
2947
  constructor(t) {
2948
2948
  t = gt.checkMatrix(t);
2949
2949
  let e = t.clone(), n = t.rows, s = t.columns, r = new Float64Array(s), o, a, h, l;
@@ -3044,9 +3044,9 @@ let Wt = class {
3044
3044
  u = t.clone();
3045
3045
  let m = Math.min(n, s), w = Math.min(n + 1, s), g = new Float64Array(w), p = new E(n, m), M = new E(s, s), f = new Float64Array(s), P = new Float64Array(n), b = new Float64Array(w);
3046
3046
  for (let d = 0; d < w; d++) b[d] = d;
3047
- let R = Math.min(n - 1, s), C = Math.max(0, Math.min(s - 2, n)), V = Math.max(R, C);
3047
+ let S = Math.min(n - 1, s), C = Math.max(0, Math.min(s - 2, n)), V = Math.max(S, C);
3048
3048
  for (let d = 0; d < V; d++) {
3049
- if (d < R) {
3049
+ if (d < S) {
3050
3050
  g[d] = 0;
3051
3051
  for (let x = d; x < n; x++)
3052
3052
  g[d] = xt(g[d], u.get(x, d));
@@ -3059,7 +3059,7 @@ let Wt = class {
3059
3059
  g[d] = -g[d];
3060
3060
  }
3061
3061
  for (let x = d + 1; x < s; x++) {
3062
- if (d < R && g[d] !== 0) {
3062
+ if (d < S && g[d] !== 0) {
3063
3063
  let A = 0;
3064
3064
  for (let y = d; y < n; y++)
3065
3065
  A += u.get(y, d) * u.get(y, x);
@@ -3069,7 +3069,7 @@ let Wt = class {
3069
3069
  }
3070
3070
  f[x] = u.get(d, x);
3071
3071
  }
3072
- if (h && d < R)
3072
+ if (h && d < S)
3073
3073
  for (let x = d; x < n; x++)
3074
3074
  p.set(x, d, u.get(x, d));
3075
3075
  if (d < C) {
@@ -3100,13 +3100,13 @@ let Wt = class {
3100
3100
  }
3101
3101
  }
3102
3102
  let v = Math.min(s, n + 1);
3103
- if (R < s && (g[R] = u.get(R, R)), n < v && (g[v - 1] = 0), C + 1 < v && (f[C] = u.get(C, v - 1)), f[v - 1] = 0, h) {
3104
- for (let d = R; d < m; d++) {
3103
+ if (S < s && (g[S] = u.get(S, S)), n < v && (g[v - 1] = 0), C + 1 < v && (f[C] = u.get(C, v - 1)), f[v - 1] = 0, h) {
3104
+ for (let d = S; d < m; d++) {
3105
3105
  for (let x = 0; x < n; x++)
3106
3106
  p.set(x, d, 0);
3107
3107
  p.set(d, d, 1);
3108
3108
  }
3109
- for (let d = R - 1; d >= 0; d--)
3109
+ for (let d = S - 1; d >= 0; d--)
3110
3110
  if (g[d] !== 0) {
3111
3111
  for (let x = d + 1; x < m; x++) {
3112
3112
  let A = 0;
@@ -3142,7 +3142,7 @@ let Wt = class {
3142
3142
  M.set(x, d, 0);
3143
3143
  M.set(d, d, 1);
3144
3144
  }
3145
- let S = v - 1, j = Number.EPSILON;
3145
+ let k = v - 1, j = Number.EPSILON;
3146
3146
  for (; v > 0; ) {
3147
3147
  let d, x;
3148
3148
  for (d = v - 2; d >= -1 && d !== -1; d--) {
@@ -3170,10 +3170,10 @@ let Wt = class {
3170
3170
  let A = f[v - 2];
3171
3171
  f[v - 2] = 0;
3172
3172
  for (let y = v - 2; y >= d; y--) {
3173
- let $ = xt(g[y], A), I = g[y] / $, _ = A / $;
3174
- if (g[y] = $, y !== d && (A = -_ * f[y - 1], f[y - 1] = I * f[y - 1]), l)
3173
+ let I = xt(g[y], A), $ = g[y] / I, _ = A / I;
3174
+ if (g[y] = I, y !== d && (A = -_ * f[y - 1], f[y - 1] = $ * f[y - 1]), l)
3175
3175
  for (let W = 0; W < s; W++)
3176
- $ = I * M.get(W, y) + _ * M.get(W, v - 1), M.set(W, v - 1, -_ * M.get(W, y) + I * M.get(W, v - 1)), M.set(W, y, $);
3176
+ I = $ * M.get(W, y) + _ * M.get(W, v - 1), M.set(W, v - 1, -_ * M.get(W, y) + $ * M.get(W, v - 1)), M.set(W, y, I);
3177
3177
  }
3178
3178
  break;
3179
3179
  }
@@ -3181,10 +3181,10 @@ let Wt = class {
3181
3181
  let A = f[d - 1];
3182
3182
  f[d - 1] = 0;
3183
3183
  for (let y = d; y < v; y++) {
3184
- let $ = xt(g[y], A), I = g[y] / $, _ = A / $;
3185
- if (g[y] = $, A = -_ * f[y], f[y] = I * f[y], h)
3184
+ let I = xt(g[y], A), $ = g[y] / I, _ = A / I;
3185
+ if (g[y] = I, A = -_ * f[y], f[y] = $ * f[y], h)
3186
3186
  for (let W = 0; W < n; W++)
3187
- $ = I * p.get(W, y) + _ * p.get(W, d - 1), p.set(W, d - 1, -_ * p.get(W, y) + I * p.get(W, d - 1)), p.set(W, y, $);
3187
+ I = $ * p.get(W, y) + _ * p.get(W, d - 1), p.set(W, d - 1, -_ * p.get(W, y) + $ * p.get(W, d - 1)), p.set(W, y, I);
3188
3188
  }
3189
3189
  break;
3190
3190
  }
@@ -3195,7 +3195,7 @@ let Wt = class {
3195
3195
  Math.abs(f[v - 2]),
3196
3196
  Math.abs(g[d]),
3197
3197
  Math.abs(f[d])
3198
- ), y = g[v - 1] / A, $ = g[v - 2] / A, I = f[v - 2] / A, _ = g[d] / A, W = f[d] / A, L = (($ + y) * ($ - y) + I * I) / 2, N = y * I * (y * I);
3198
+ ), y = g[v - 1] / A, I = g[v - 2] / A, $ = f[v - 2] / A, _ = g[d] / A, W = f[d] / A, L = ((I + y) * (I - y) + $ * $) / 2, N = y * $ * (y * $);
3199
3199
  let B = 0;
3200
3200
  (L !== 0 || N !== 0) && (L < 0 ? B = 0 - Math.sqrt(L * L + N) : B = Math.sqrt(L * L + N), B = N / (L + B));
3201
3201
  let Y = (_ + y) * (_ - y) + B, H = _ * W;
@@ -3215,9 +3215,9 @@ let Wt = class {
3215
3215
  }
3216
3216
  case 4: {
3217
3217
  if (g[d] <= 0 && (g[d] = g[d] < 0 ? -g[d] : 0, l))
3218
- for (let A = 0; A <= S; A++)
3218
+ for (let A = 0; A <= k; A++)
3219
3219
  M.set(A, d, -M.get(A, d));
3220
- for (; d < S && !(g[d] >= g[d + 1]); ) {
3220
+ for (; d < k && !(g[d] >= g[d + 1]); ) {
3221
3221
  let A = g[d];
3222
3222
  if (g[d] = g[d + 1], g[d + 1] = A, l && d < s - 1)
3223
3223
  for (let y = 0; y < s; y++)
@@ -3298,13 +3298,13 @@ let Wt = class {
3298
3298
  return E.diag(this.s);
3299
3299
  }
3300
3300
  };
3301
- function zs(i, t = !1) {
3302
- return i = gt.checkMatrix(i), t ? new Wt(i).inverse() : pi(i, E.eye(i.rows));
3301
+ function Ds(i, t = !1) {
3302
+ return i = gt.checkMatrix(i), t ? new Wt(i).inverse() : di(i, E.eye(i.rows));
3303
3303
  }
3304
- function pi(i, t, e = !1) {
3305
- return i = gt.checkMatrix(i), t = gt.checkMatrix(t), e ? new Wt(i).solve(t) : i.isSquare() ? new Fe(i).solve(t) : new an(i).solve(t);
3304
+ function di(i, t, e = !1) {
3305
+ return i = gt.checkMatrix(i), t = gt.checkMatrix(t), e ? new Wt(i).solve(t) : i.isSquare() ? new Le(i).solve(t) : new hn(i).solve(t);
3306
3306
  }
3307
- function Ae(i) {
3307
+ function Ee(i) {
3308
3308
  if (i = E.checkMatrix(i), i.isSquare()) {
3309
3309
  if (i.columns === 0)
3310
3310
  return 1;
@@ -3313,19 +3313,19 @@ function Ae(i) {
3313
3313
  return t = i.get(0, 0), e = i.get(0, 1), n = i.get(1, 0), s = i.get(1, 1), t * s - e * n;
3314
3314
  if (i.columns === 3) {
3315
3315
  let r, o, a;
3316
- return r = new ve(i, [1, 2], [1, 2]), o = new ve(i, [1, 2], [0, 2]), a = new ve(i, [1, 2], [0, 1]), t = i.get(0, 0), e = i.get(0, 1), n = i.get(0, 2), t * Ae(r) - e * Ae(o) + n * Ae(a);
3316
+ return r = new Ae(i, [1, 2], [1, 2]), o = new Ae(i, [1, 2], [0, 2]), a = new Ae(i, [1, 2], [0, 1]), t = i.get(0, 0), e = i.get(0, 1), n = i.get(0, 2), t * Ee(r) - e * Ee(o) + n * Ee(a);
3317
3317
  } else
3318
- return new Fe(i).determinant;
3318
+ return new Le(i).determinant;
3319
3319
  } else
3320
3320
  throw Error("determinant can only be calculated for a square matrix");
3321
3321
  }
3322
- function Ds(i, t) {
3322
+ function Us(i, t) {
3323
3323
  let e = [];
3324
3324
  for (let n = 0; n < i; n++)
3325
3325
  n !== t && e.push(n);
3326
3326
  return e;
3327
3327
  }
3328
- function Us(i, t, e, n = 1e-9, s = 1e-9) {
3328
+ function Ys(i, t, e, n = 1e-9, s = 1e-9) {
3329
3329
  if (i > s)
3330
3330
  return new Array(t.rows + 1).fill(0);
3331
3331
  {
@@ -3335,20 +3335,20 @@ function Us(i, t, e, n = 1e-9, s = 1e-9) {
3335
3335
  return r.to1DArray();
3336
3336
  }
3337
3337
  }
3338
- function Ys(i, t = {}) {
3338
+ function Xs(i, t = {}) {
3339
3339
  const { thresholdValue: e = 1e-9, thresholdError: n = 1e-9 } = t;
3340
3340
  i = E.checkMatrix(i);
3341
3341
  let s = i.rows, r = new E(s, s);
3342
3342
  for (let o = 0; o < s; o++) {
3343
- let a = E.columnVector(i.getRow(o)), h = i.subMatrixRow(Ds(s, o)).transpose(), l = new Wt(h).solve(a), c = E.sub(a, h.mmul(l)).abs().max();
3343
+ let a = E.columnVector(i.getRow(o)), h = i.subMatrixRow(Us(s, o)).transpose(), l = new Wt(h).solve(a), c = E.sub(a, h.mmul(l)).abs().max();
3344
3344
  r.setRow(
3345
3345
  o,
3346
- Us(c, l, o, e, n)
3346
+ Ys(c, l, o, e, n)
3347
3347
  );
3348
3348
  }
3349
3349
  return r;
3350
3350
  }
3351
- function Xs(i, t = Number.EPSILON) {
3351
+ function Ws(i, t = Number.EPSILON) {
3352
3352
  if (i = E.checkMatrix(i), i.isEmpty())
3353
3353
  return i.transpose();
3354
3354
  let e = new Wt(i, { autoTranspose: !0 }), n = e.leftSingularVectors, s = e.rightSingularVectors, r = e.diagonal;
@@ -3356,7 +3356,7 @@ function Xs(i, t = Number.EPSILON) {
3356
3356
  Math.abs(r[o]) > t ? r[o] = 1 / r[o] : r[o] = 0;
3357
3357
  return s.mmul(E.diag(r).mmul(n.transpose()));
3358
3358
  }
3359
- function Ws(i, t = i, e = {}) {
3359
+ function Hs(i, t = i, e = {}) {
3360
3360
  i = new E(i);
3361
3361
  let n = !1;
3362
3362
  if (typeof t == "object" && !E.isMatrix(t) && !ft.isAnyArray(t) ? (e = t, t = i, n = !0) : t = new E(t), i.rows !== t.rows)
@@ -3369,7 +3369,7 @@ function Ws(i, t = i, e = {}) {
3369
3369
  r.set(o, a, r.get(o, a) * (1 / (i.rows - 1)));
3370
3370
  return r;
3371
3371
  }
3372
- function Hs(i, t = i, e = {}) {
3372
+ function Qs(i, t = i, e = {}) {
3373
3373
  i = new E(i);
3374
3374
  let n = !1;
3375
3375
  if (typeof t == "object" && !E.isMatrix(t) && !ft.isAnyArray(t) ? (e = t, t = i, n = !0) : t = new E(t), i.rows !== t.rows)
@@ -3386,7 +3386,7 @@ function Hs(i, t = i, e = {}) {
3386
3386
  );
3387
3387
  return h;
3388
3388
  }
3389
- let wi = class {
3389
+ let Pi = class {
3390
3390
  constructor(i, t = {}) {
3391
3391
  const { assumeSymmetric: e = !1 } = t;
3392
3392
  if (i = gt.checkMatrix(i), !i.isSquare())
@@ -3398,13 +3398,13 @@ let wi = class {
3398
3398
  for (h = 0; h < n; h++)
3399
3399
  for (l = 0; l < n; l++)
3400
3400
  s.set(h, l, a.get(h, l));
3401
- Qs(n, o, r, s), Gs(n, o, r, s);
3401
+ Gs(n, o, r, s), Js(n, o, r, s);
3402
3402
  } else {
3403
3403
  let u = new E(n, n), m = new Float64Array(n);
3404
3404
  for (l = 0; l < n; l++)
3405
3405
  for (h = 0; h < n; h++)
3406
3406
  u.set(h, l, a.get(h, l));
3407
- Js(n, u, m, s), Zs(n, o, r, s, u);
3407
+ Zs(n, u, m, s), Ks(n, o, r, s, u);
3408
3408
  }
3409
3409
  this.n = n, this.e = o, this.d = r, this.V = s;
3410
3410
  }
@@ -3427,7 +3427,7 @@ let wi = class {
3427
3427
  return n;
3428
3428
  }
3429
3429
  };
3430
- function Qs(i, t, e, n) {
3430
+ function Gs(i, t, e, n) {
3431
3431
  let s, r, o, a, h, l, c, u;
3432
3432
  for (h = 0; h < i; h++)
3433
3433
  e[h] = n.get(i - 1, h);
@@ -3477,12 +3477,12 @@ function Qs(i, t, e, n) {
3477
3477
  e[h] = n.get(i - 1, h), n.set(i - 1, h, 0);
3478
3478
  n.set(i - 1, i - 1, 1), t[0] = 0;
3479
3479
  }
3480
- function Gs(i, t, e, n) {
3480
+ function Js(i, t, e, n) {
3481
3481
  let s, r, o, a, h, l, c, u, m, w, g, p, M, f, P, b;
3482
3482
  for (o = 1; o < i; o++)
3483
3483
  t[o - 1] = t[o];
3484
3484
  t[i - 1] = 0;
3485
- let R = 0, C = 0, V = Number.EPSILON;
3485
+ let S = 0, C = 0, V = Number.EPSILON;
3486
3486
  for (l = 0; l < i; l++) {
3487
3487
  for (C = Math.max(C, Math.abs(e[l]) + Math.abs(t[l])), c = l; c < i && !(Math.abs(t[c]) <= V * C); )
3488
3488
  c++;
@@ -3490,12 +3490,12 @@ function Gs(i, t, e, n) {
3490
3490
  do {
3491
3491
  for (s = e[l], u = (e[l + 1] - s) / (2 * t[l]), m = xt(u, 1), u < 0 && (m = -m), e[l] = t[l] / (u + m), e[l + 1] = t[l] * (u + m), w = e[l + 1], r = s - e[l], o = l + 2; o < i; o++)
3492
3492
  e[o] -= r;
3493
- for (R = R + r, u = e[c], g = 1, p = g, M = g, f = t[l + 1], P = 0, b = 0, o = c - 1; o >= l; o--)
3493
+ for (S = S + r, u = e[c], g = 1, p = g, M = g, f = t[l + 1], P = 0, b = 0, o = c - 1; o >= l; o--)
3494
3494
  for (M = p, p = g, b = P, s = g * t[o], r = g * u, m = xt(u, t[o]), t[o + 1] = P * m, P = t[o] / m, g = u / m, u = g * e[o] - P * s, e[o + 1] = r + P * (g * s + P * e[o]), h = 0; h < i; h++)
3495
3495
  r = n.get(h, o + 1), n.set(h, o + 1, P * n.get(h, o) + g * r), n.set(h, o, g * n.get(h, o) - P * r);
3496
3496
  u = -P * b * M * f * t[l] / w, t[l] = P * u, e[l] = g * u;
3497
3497
  } while (Math.abs(t[l]) > V * C);
3498
- e[l] = e[l] + R, t[l] = 0;
3498
+ e[l] = e[l] + S, t[l] = 0;
3499
3499
  }
3500
3500
  for (o = 0; o < i - 1; o++) {
3501
3501
  for (h = o, u = e[o], a = o + 1; a < i; a++)
@@ -3505,7 +3505,7 @@ function Gs(i, t, e, n) {
3505
3505
  u = n.get(a, o), n.set(a, o, n.get(a, h)), n.set(a, h, u);
3506
3506
  }
3507
3507
  }
3508
- function Js(i, t, e, n) {
3508
+ function Zs(i, t, e, n) {
3509
3509
  let s = 0, r = i - 1, o, a, h, l, c, u, m;
3510
3510
  for (u = s + 1; u <= r - 1; u++) {
3511
3511
  for (m = 0, l = u; l <= r; l++)
@@ -3543,94 +3543,94 @@ function Js(i, t, e, n) {
3543
3543
  }
3544
3544
  }
3545
3545
  }
3546
- function Zs(i, t, e, n, s) {
3547
- let r = i - 1, o = 0, a = i - 1, h = Number.EPSILON, l = 0, c = 0, u = 0, m = 0, w = 0, g = 0, p = 0, M = 0, f, P, b, R, C, V, v, S, j, d, x, A, y, $, I;
3546
+ function Ks(i, t, e, n, s) {
3547
+ let r = i - 1, o = 0, a = i - 1, h = Number.EPSILON, l = 0, c = 0, u = 0, m = 0, w = 0, g = 0, p = 0, M = 0, f, P, b, S, C, V, v, k, j, d, x, A, y, I, $;
3548
3548
  for (f = 0; f < i; f++)
3549
3549
  for ((f < o || f > a) && (e[f] = s.get(f, f), t[f] = 0), P = Math.max(f - 1, 0); P < i; P++)
3550
3550
  c = c + Math.abs(s.get(f, P));
3551
3551
  for (; r >= o; ) {
3552
- for (R = r; R > o && (g = Math.abs(s.get(R - 1, R - 1)) + Math.abs(s.get(R, R)), g === 0 && (g = c), !(Math.abs(s.get(R, R - 1)) < h * g)); )
3553
- R--;
3554
- if (R === r)
3552
+ for (S = r; S > o && (g = Math.abs(s.get(S - 1, S - 1)) + Math.abs(s.get(S, S)), g === 0 && (g = c), !(Math.abs(s.get(S, S - 1)) < h * g)); )
3553
+ S--;
3554
+ if (S === r)
3555
3555
  s.set(r, r, s.get(r, r) + l), e[r] = s.get(r, r), t[r] = 0, r--, M = 0;
3556
- else if (R === r - 1) {
3557
- if (v = s.get(r, r - 1) * s.get(r - 1, r), u = (s.get(r - 1, r - 1) - s.get(r, r)) / 2, m = u * u + v, p = Math.sqrt(Math.abs(m)), s.set(r, r, s.get(r, r) + l), s.set(r - 1, r - 1, s.get(r - 1, r - 1) + l), S = s.get(r, r), m >= 0) {
3558
- for (p = u >= 0 ? u + p : u - p, e[r - 1] = S + p, e[r] = e[r - 1], p !== 0 && (e[r] = S - v / p), t[r - 1] = 0, t[r] = 0, S = s.get(r, r - 1), g = Math.abs(S) + Math.abs(p), u = S / g, m = p / g, w = Math.sqrt(u * u + m * m), u = u / w, m = m / w, P = r - 1; P < i; P++)
3556
+ else if (S === r - 1) {
3557
+ if (v = s.get(r, r - 1) * s.get(r - 1, r), u = (s.get(r - 1, r - 1) - s.get(r, r)) / 2, m = u * u + v, p = Math.sqrt(Math.abs(m)), s.set(r, r, s.get(r, r) + l), s.set(r - 1, r - 1, s.get(r - 1, r - 1) + l), k = s.get(r, r), m >= 0) {
3558
+ for (p = u >= 0 ? u + p : u - p, e[r - 1] = k + p, e[r] = e[r - 1], p !== 0 && (e[r] = k - v / p), t[r - 1] = 0, t[r] = 0, k = s.get(r, r - 1), g = Math.abs(k) + Math.abs(p), u = k / g, m = p / g, w = Math.sqrt(u * u + m * m), u = u / w, m = m / w, P = r - 1; P < i; P++)
3559
3559
  p = s.get(r - 1, P), s.set(r - 1, P, m * p + u * s.get(r, P)), s.set(r, P, m * s.get(r, P) - u * p);
3560
3560
  for (f = 0; f <= r; f++)
3561
3561
  p = s.get(f, r - 1), s.set(f, r - 1, m * p + u * s.get(f, r)), s.set(f, r, m * s.get(f, r) - u * p);
3562
3562
  for (f = o; f <= a; f++)
3563
3563
  p = n.get(f, r - 1), n.set(f, r - 1, m * p + u * n.get(f, r)), n.set(f, r, m * n.get(f, r) - u * p);
3564
3564
  } else
3565
- e[r - 1] = S + u, e[r] = S + u, t[r - 1] = p, t[r] = -p;
3565
+ e[r - 1] = k + u, e[r] = k + u, t[r - 1] = p, t[r] = -p;
3566
3566
  r = r - 2, M = 0;
3567
3567
  } else {
3568
- if (S = s.get(r, r), j = 0, v = 0, R < r && (j = s.get(r - 1, r - 1), v = s.get(r, r - 1) * s.get(r - 1, r)), M === 10) {
3569
- for (l += S, f = o; f <= r; f++)
3570
- s.set(f, f, s.get(f, f) - S);
3571
- g = Math.abs(s.get(r, r - 1)) + Math.abs(s.get(r - 1, r - 2)), S = j = 0.75 * g, v = -0.4375 * g * g;
3568
+ if (k = s.get(r, r), j = 0, v = 0, S < r && (j = s.get(r - 1, r - 1), v = s.get(r, r - 1) * s.get(r - 1, r)), M === 10) {
3569
+ for (l += k, f = o; f <= r; f++)
3570
+ s.set(f, f, s.get(f, f) - k);
3571
+ g = Math.abs(s.get(r, r - 1)) + Math.abs(s.get(r - 1, r - 2)), k = j = 0.75 * g, v = -0.4375 * g * g;
3572
3572
  }
3573
- if (M === 30 && (g = (j - S) / 2, g = g * g + v, g > 0)) {
3574
- for (g = Math.sqrt(g), j < S && (g = -g), g = S - v / ((j - S) / 2 + g), f = o; f <= r; f++)
3573
+ if (M === 30 && (g = (j - k) / 2, g = g * g + v, g > 0)) {
3574
+ for (g = Math.sqrt(g), j < k && (g = -g), g = k - v / ((j - k) / 2 + g), f = o; f <= r; f++)
3575
3575
  s.set(f, f, s.get(f, f) - g);
3576
- l += g, S = j = v = 0.964;
3576
+ l += g, k = j = v = 0.964;
3577
3577
  }
3578
- for (M = M + 1, C = r - 2; C >= R && (p = s.get(C, C), w = S - p, g = j - p, u = (w * g - v) / s.get(C + 1, C) + s.get(C, C + 1), m = s.get(C + 1, C + 1) - p - w - g, w = s.get(C + 2, C + 1), g = Math.abs(u) + Math.abs(m) + Math.abs(w), u = u / g, m = m / g, w = w / g, !(C === R || Math.abs(s.get(C, C - 1)) * (Math.abs(m) + Math.abs(w)) < h * (Math.abs(u) * (Math.abs(s.get(C - 1, C - 1)) + Math.abs(p) + Math.abs(s.get(C + 1, C + 1)))))); )
3578
+ for (M = M + 1, C = r - 2; C >= S && (p = s.get(C, C), w = k - p, g = j - p, u = (w * g - v) / s.get(C + 1, C) + s.get(C, C + 1), m = s.get(C + 1, C + 1) - p - w - g, w = s.get(C + 2, C + 1), g = Math.abs(u) + Math.abs(m) + Math.abs(w), u = u / g, m = m / g, w = w / g, !(C === S || Math.abs(s.get(C, C - 1)) * (Math.abs(m) + Math.abs(w)) < h * (Math.abs(u) * (Math.abs(s.get(C - 1, C - 1)) + Math.abs(p) + Math.abs(s.get(C + 1, C + 1)))))); )
3579
3579
  C--;
3580
3580
  for (f = C + 2; f <= r; f++)
3581
3581
  s.set(f, f - 2, 0), f > C + 2 && s.set(f, f - 3, 0);
3582
- for (b = C; b <= r - 1 && ($ = b !== r - 1, b !== C && (u = s.get(b, b - 1), m = s.get(b + 1, b - 1), w = $ ? s.get(b + 2, b - 1) : 0, S = Math.abs(u) + Math.abs(m) + Math.abs(w), S !== 0 && (u = u / S, m = m / S, w = w / S)), S !== 0); b++)
3582
+ for (b = C; b <= r - 1 && (I = b !== r - 1, b !== C && (u = s.get(b, b - 1), m = s.get(b + 1, b - 1), w = I ? s.get(b + 2, b - 1) : 0, k = Math.abs(u) + Math.abs(m) + Math.abs(w), k !== 0 && (u = u / k, m = m / k, w = w / k)), k !== 0); b++)
3583
3583
  if (g = Math.sqrt(u * u + m * m + w * w), u < 0 && (g = -g), g !== 0) {
3584
- for (b !== C ? s.set(b, b - 1, -g * S) : R !== C && s.set(b, b - 1, -s.get(b, b - 1)), u = u + g, S = u / g, j = m / g, p = w / g, m = m / u, w = w / u, P = b; P < i; P++)
3585
- u = s.get(b, P) + m * s.get(b + 1, P), $ && (u = u + w * s.get(b + 2, P), s.set(b + 2, P, s.get(b + 2, P) - u * p)), s.set(b, P, s.get(b, P) - u * S), s.set(b + 1, P, s.get(b + 1, P) - u * j);
3584
+ for (b !== C ? s.set(b, b - 1, -g * k) : S !== C && s.set(b, b - 1, -s.get(b, b - 1)), u = u + g, k = u / g, j = m / g, p = w / g, m = m / u, w = w / u, P = b; P < i; P++)
3585
+ u = s.get(b, P) + m * s.get(b + 1, P), I && (u = u + w * s.get(b + 2, P), s.set(b + 2, P, s.get(b + 2, P) - u * p)), s.set(b, P, s.get(b, P) - u * k), s.set(b + 1, P, s.get(b + 1, P) - u * j);
3586
3586
  for (f = 0; f <= Math.min(r, b + 3); f++)
3587
- u = S * s.get(f, b) + j * s.get(f, b + 1), $ && (u = u + p * s.get(f, b + 2), s.set(f, b + 2, s.get(f, b + 2) - u * w)), s.set(f, b, s.get(f, b) - u), s.set(f, b + 1, s.get(f, b + 1) - u * m);
3587
+ u = k * s.get(f, b) + j * s.get(f, b + 1), I && (u = u + p * s.get(f, b + 2), s.set(f, b + 2, s.get(f, b + 2) - u * w)), s.set(f, b, s.get(f, b) - u), s.set(f, b + 1, s.get(f, b + 1) - u * m);
3588
3588
  for (f = o; f <= a; f++)
3589
- u = S * n.get(f, b) + j * n.get(f, b + 1), $ && (u = u + p * n.get(f, b + 2), n.set(f, b + 2, n.get(f, b + 2) - u * w)), n.set(f, b, n.get(f, b) - u), n.set(f, b + 1, n.get(f, b + 1) - u * m);
3589
+ u = k * n.get(f, b) + j * n.get(f, b + 1), I && (u = u + p * n.get(f, b + 2), n.set(f, b + 2, n.get(f, b + 2) - u * w)), n.set(f, b, n.get(f, b) - u), n.set(f, b + 1, n.get(f, b + 1) - u * m);
3590
3590
  }
3591
3591
  }
3592
3592
  }
3593
3593
  if (c !== 0) {
3594
3594
  for (r = i - 1; r >= 0; r--)
3595
3595
  if (u = e[r], m = t[r], m === 0)
3596
- for (R = r, s.set(r, r, 1), f = r - 1; f >= 0; f--) {
3597
- for (v = s.get(f, f) - u, w = 0, P = R; P <= r; P++)
3596
+ for (S = r, s.set(r, r, 1), f = r - 1; f >= 0; f--) {
3597
+ for (v = s.get(f, f) - u, w = 0, P = S; P <= r; P++)
3598
3598
  w = w + s.get(f, P) * s.get(P, r);
3599
3599
  if (t[f] < 0)
3600
3600
  p = v, g = w;
3601
- else if (R = f, t[f] === 0 ? s.set(f, r, v !== 0 ? -w / v : -w / (h * c)) : (S = s.get(f, f + 1), j = s.get(f + 1, f), m = (e[f] - u) * (e[f] - u) + t[f] * t[f], V = (S * g - p * w) / m, s.set(f, r, V), s.set(
3601
+ else if (S = f, t[f] === 0 ? s.set(f, r, v !== 0 ? -w / v : -w / (h * c)) : (k = s.get(f, f + 1), j = s.get(f + 1, f), m = (e[f] - u) * (e[f] - u) + t[f] * t[f], V = (k * g - p * w) / m, s.set(f, r, V), s.set(
3602
3602
  f + 1,
3603
3603
  r,
3604
- Math.abs(S) > Math.abs(p) ? (-w - v * V) / S : (-g - j * V) / p
3604
+ Math.abs(k) > Math.abs(p) ? (-w - v * V) / k : (-g - j * V) / p
3605
3605
  )), V = Math.abs(s.get(f, r)), h * V * V > 1)
3606
3606
  for (P = f; P <= r; P++)
3607
3607
  s.set(P, r, s.get(P, r) / V);
3608
3608
  }
3609
3609
  else if (m < 0)
3610
- for (R = r - 1, Math.abs(s.get(r, r - 1)) > Math.abs(s.get(r - 1, r)) ? (s.set(r - 1, r - 1, m / s.get(r, r - 1)), s.set(r - 1, r, -(s.get(r, r) - u) / s.get(r, r - 1))) : (I = ye(0, -s.get(r - 1, r), s.get(r - 1, r - 1) - u, m), s.set(r - 1, r - 1, I[0]), s.set(r - 1, r, I[1])), s.set(r, r - 1, 0), s.set(r, r, 1), f = r - 2; f >= 0; f--) {
3611
- for (d = 0, x = 0, P = R; P <= r; P++)
3610
+ for (S = r - 1, Math.abs(s.get(r, r - 1)) > Math.abs(s.get(r - 1, r)) ? (s.set(r - 1, r - 1, m / s.get(r, r - 1)), s.set(r - 1, r, -(s.get(r, r) - u) / s.get(r, r - 1))) : ($ = ye(0, -s.get(r - 1, r), s.get(r - 1, r - 1) - u, m), s.set(r - 1, r - 1, $[0]), s.set(r - 1, r, $[1])), s.set(r, r - 1, 0), s.set(r, r, 1), f = r - 2; f >= 0; f--) {
3611
+ for (d = 0, x = 0, P = S; P <= r; P++)
3612
3612
  d = d + s.get(f, P) * s.get(P, r - 1), x = x + s.get(f, P) * s.get(P, r);
3613
3613
  if (v = s.get(f, f) - u, t[f] < 0)
3614
3614
  p = v, w = d, g = x;
3615
- else if (R = f, t[f] === 0 ? (I = ye(-d, -x, v, m), s.set(f, r - 1, I[0]), s.set(f, r, I[1])) : (S = s.get(f, f + 1), j = s.get(f + 1, f), A = (e[f] - u) * (e[f] - u) + t[f] * t[f] - m * m, y = (e[f] - u) * 2 * m, A === 0 && y === 0 && (A = h * c * (Math.abs(v) + Math.abs(m) + Math.abs(S) + Math.abs(j) + Math.abs(p))), I = ye(
3616
- S * w - p * d + m * x,
3617
- S * g - p * x - m * d,
3615
+ else if (S = f, t[f] === 0 ? ($ = ye(-d, -x, v, m), s.set(f, r - 1, $[0]), s.set(f, r, $[1])) : (k = s.get(f, f + 1), j = s.get(f + 1, f), A = (e[f] - u) * (e[f] - u) + t[f] * t[f] - m * m, y = (e[f] - u) * 2 * m, A === 0 && y === 0 && (A = h * c * (Math.abs(v) + Math.abs(m) + Math.abs(k) + Math.abs(j) + Math.abs(p))), $ = ye(
3616
+ k * w - p * d + m * x,
3617
+ k * g - p * x - m * d,
3618
3618
  A,
3619
3619
  y
3620
- ), s.set(f, r - 1, I[0]), s.set(f, r, I[1]), Math.abs(S) > Math.abs(p) + Math.abs(m) ? (s.set(
3620
+ ), s.set(f, r - 1, $[0]), s.set(f, r, $[1]), Math.abs(k) > Math.abs(p) + Math.abs(m) ? (s.set(
3621
3621
  f + 1,
3622
3622
  r - 1,
3623
- (-d - v * s.get(f, r - 1) + m * s.get(f, r)) / S
3623
+ (-d - v * s.get(f, r - 1) + m * s.get(f, r)) / k
3624
3624
  ), s.set(
3625
3625
  f + 1,
3626
3626
  r,
3627
- (-x - v * s.get(f, r) - m * s.get(f, r - 1)) / S
3628
- )) : (I = ye(
3627
+ (-x - v * s.get(f, r) - m * s.get(f, r - 1)) / k
3628
+ )) : ($ = ye(
3629
3629
  -w - j * s.get(f, r - 1),
3630
3630
  -g - j * s.get(f, r),
3631
3631
  p,
3632
3632
  m
3633
- ), s.set(f + 1, r - 1, I[0]), s.set(f + 1, r, I[1]))), V = Math.max(Math.abs(s.get(f, r - 1)), Math.abs(s.get(f, r))), h * V * V > 1)
3633
+ ), s.set(f + 1, r - 1, $[0]), s.set(f + 1, r, $[1]))), V = Math.max(Math.abs(s.get(f, r - 1)), Math.abs(s.get(f, r))), h * V * V > 1)
3634
3634
  for (P = f; P <= r; P++)
3635
3635
  s.set(P, r - 1, s.get(P, r - 1) / V), s.set(P, r, s.get(P, r) / V);
3636
3636
  }
@@ -3650,7 +3650,7 @@ function ye(i, t, e, n) {
3650
3650
  let s, r;
3651
3651
  return Math.abs(e) > Math.abs(n) ? (s = n / e, r = e + s * n, [(i + s * t) / r, (t - s * i) / r]) : (s = e / n, r = n + s * e, [(s * i + t) / r, (s * t - i) / r]);
3652
3652
  }
3653
- class di {
3653
+ class Mi {
3654
3654
  constructor(t) {
3655
3655
  if (t = gt.checkMatrix(t), !t.isSymmetric())
3656
3656
  throw new Error("Matrix is not symmetric");
@@ -3697,7 +3697,7 @@ class di {
3697
3697
  return this.L;
3698
3698
  }
3699
3699
  }
3700
- class Pi {
3700
+ class yi {
3701
3701
  constructor(t, e = {}) {
3702
3702
  t = gt.checkMatrix(t);
3703
3703
  let { Y: n } = e;
@@ -3728,44 +3728,44 @@ class Pi {
3728
3728
  }
3729
3729
  }
3730
3730
  O.AbstractMatrix = Z;
3731
- O.CHO = di;
3732
- O.CholeskyDecomposition = di;
3733
- O.DistanceMatrix = fi;
3734
- O.EVD = wi;
3735
- var Ks = O.EigenvalueDecomposition = wi;
3736
- O.LU = Fe;
3737
- O.LuDecomposition = Fe;
3738
- var tr = O.Matrix = E;
3739
- O.MatrixColumnSelectionView = Fs;
3740
- O.MatrixColumnView = _s;
3741
- O.MatrixFlipColumnView = Ls;
3742
- O.MatrixFlipRowView = Bs;
3743
- O.MatrixRowSelectionView = js;
3744
- O.MatrixRowView = Vs;
3745
- O.MatrixSelectionView = ve;
3746
- O.MatrixSubView = qs;
3747
- O.MatrixTransposeView = Ns;
3748
- O.NIPALS = Pi;
3749
- O.Nipals = Pi;
3750
- O.QR = an;
3751
- O.QrDecomposition = an;
3731
+ O.CHO = Mi;
3732
+ O.CholeskyDecomposition = Mi;
3733
+ O.DistanceMatrix = gi;
3734
+ O.EVD = Pi;
3735
+ var tr = O.EigenvalueDecomposition = Pi;
3736
+ O.LU = Le;
3737
+ O.LuDecomposition = Le;
3738
+ var er = O.Matrix = E;
3739
+ O.MatrixColumnSelectionView = Ls;
3740
+ O.MatrixColumnView = Fs;
3741
+ O.MatrixFlipColumnView = Bs;
3742
+ O.MatrixFlipRowView = Vs;
3743
+ O.MatrixRowSelectionView = qs;
3744
+ O.MatrixRowView = js;
3745
+ O.MatrixSelectionView = Ae;
3746
+ O.MatrixSubView = Ns;
3747
+ O.MatrixTransposeView = Os;
3748
+ O.NIPALS = yi;
3749
+ O.Nipals = yi;
3750
+ O.QR = hn;
3751
+ O.QrDecomposition = hn;
3752
3752
  O.SVD = Wt;
3753
3753
  O.SingularValueDecomposition = Wt;
3754
- O.SymmetricMatrix = Kt;
3755
- O.WrapperMatrix1D = gi;
3754
+ O.SymmetricMatrix = te;
3755
+ O.WrapperMatrix1D = wi;
3756
3756
  O.WrapperMatrix2D = gt;
3757
- O.correlation = Hs;
3758
- O.covariance = Ws;
3759
- var En = O.default = E;
3760
- O.determinant = Ae;
3761
- O.inverse = zs;
3762
- O.linearDependencies = Ys;
3763
- O.pseudoInverse = Xs;
3764
- O.solve = pi;
3765
- O.wrap = Os;
3766
- const er = Ks, nr = tr;
3767
- En.Matrix && En.Matrix;
3768
- function ne(i, t, e) {
3757
+ O.correlation = Qs;
3758
+ O.covariance = Hs;
3759
+ var kn = O.default = E;
3760
+ O.determinant = Ee;
3761
+ O.inverse = Ds;
3762
+ O.linearDependencies = Xs;
3763
+ O.pseudoInverse = Ws;
3764
+ O.solve = di;
3765
+ O.wrap = zs;
3766
+ const nr = tr, ir = er;
3767
+ kn.Matrix && kn.Matrix;
3768
+ function ie(i, t, e) {
3769
3769
  const n = i / e, s = t / e;
3770
3770
  if (!(isFinite(n) && isFinite(s))) {
3771
3771
  const h = -i / t;
@@ -3784,10 +3784,10 @@ function ne(i, t, e) {
3784
3784
  const a = n / o;
3785
3785
  return isFinite(a) ? a > o ? [o, a] : [a, o] : [o];
3786
3786
  }
3787
- function Mi(i, t, e, n) {
3787
+ function bi(i, t, e, n) {
3788
3788
  const s = e / (3 * n), r = t / (3 * n), o = i / n;
3789
3789
  if (!(isFinite(o) && isFinite(r) && isFinite(s)))
3790
- return ne(i, t, e);
3790
+ return ie(i, t, e);
3791
3791
  const a = -s * s + r, h = -r * s + o, l = s * o - r * r, c = 4 * a * l - h * h, u = -2 * s * a + h;
3792
3792
  if (c < 0) {
3793
3793
  const m = Math.sqrt(-0.25 * c), w = -0.5 * u;
@@ -3800,16 +3800,16 @@ function Mi(i, t, e, n) {
3800
3800
  return [f * w - s, f * p - s, f * M - s];
3801
3801
  }
3802
3802
  }
3803
- function ir(i, t, e, n, s) {
3803
+ function sr(i, t, e, n, s) {
3804
3804
  if (s == 0)
3805
- return Mi(i, t, e, n);
3805
+ return bi(i, t, e, n);
3806
3806
  const r = n / s, o = e / s, a = t / s, h = i / s;
3807
- let l = Sn(r, o, a, h, !1);
3807
+ let l = Rn(r, o, a, h, !1);
3808
3808
  if (l !== null)
3809
3809
  return l;
3810
3810
  const c = 716e74;
3811
3811
  for (let u = 0; u < 2; u++)
3812
- if (l = Sn(
3812
+ if (l = Rn(
3813
3813
  r / c,
3814
3814
  o / (c * c),
3815
3815
  a / (c * c * c),
@@ -3825,19 +3825,19 @@ function ir(i, t, e, n, s) {
3825
3825
  function Ct(i, t) {
3826
3826
  return t == 0 ? Math.abs(i) : Math.abs((i - t) / t);
3827
3827
  }
3828
- function Sn(i, t, e, n, s) {
3829
- const r = sr(i, t, e, n, s);
3828
+ function Rn(i, t, e, n, s) {
3829
+ const r = rr(i, t, e, n, s);
3830
3830
  if (r !== null && r.length == 4) {
3831
3831
  let o = [];
3832
3832
  for (let a = 0; a < 2; a++) {
3833
3833
  const h = r[a * 2], l = r[a * 2 + 1];
3834
- o = o.concat(ne(l, h, 1));
3834
+ o = o.concat(ie(l, h, 1));
3835
3835
  }
3836
3836
  return o;
3837
3837
  }
3838
3838
  return null;
3839
3839
  }
3840
- function sr(i, t, e, n, s) {
3840
+ function rr(i, t, e, n, s) {
3841
3841
  function r(L, N, B, Y) {
3842
3842
  const H = Ct(L + B, i), T = Ct(N + L * B + Y, t), U = Ct(N * B + L * Y, e);
3843
3843
  return H + T + U;
@@ -3855,55 +3855,55 @@ function sr(i, t, e, n, s) {
3855
3855
  w = l * u - 4 * m - 1 / 3 * c * c, g = (l * u + 8 * m - 2 / 9 * c * c) * (1 / 3) * c - u * u - l * l * m;
3856
3856
  if (!isFinite(w) && isFinite(g))
3857
3857
  return null;
3858
- let M = rr(w, g);
3858
+ let M = or(w, g);
3859
3859
  s && (M *= p);
3860
- const f = i * 0.5, P = 1 / 6 * t + 0.5 * M, b = e - i * P, R = 2 / 3 * t - M - f * f, C = 0.5 * b / R, V = 2 * (n - P * P) / b, v = 0.5 * b / V;
3861
- let S = 0, j = 0, d = 0;
3860
+ const f = i * 0.5, P = 1 / 6 * t + 0.5 * M, b = e - i * P, S = 2 / 3 * t - M - f * f, C = 0.5 * b / S, V = 2 * (n - P * P) / b, v = 0.5 * b / V;
3861
+ let k = 0, j = 0, d = 0;
3862
3862
  for (let L = 0; L < 3; L++) {
3863
- const N = L == 1 ? v : R, B = L == 0 ? C : V, Y = Ct(N + f * f + 2 * P, t), H = Ct(2 * (N * B + f * P), e), T = Ct(N * B * B + P * P, n), U = Y + H + T;
3864
- (L == 0 || U < d) && (S = N, j = B, d = U);
3863
+ const N = L == 1 ? v : S, B = L == 0 ? C : V, Y = Ct(N + f * f + 2 * P, t), H = Ct(2 * (N * B + f * P), e), T = Ct(N * B * B + P * P, n), U = Y + H + T;
3864
+ (L == 0 || U < d) && (k = N, j = B, d = U);
3865
3865
  }
3866
- const x = S, A = j;
3867
- let y = 0, $ = 0, I = 0, _ = 0;
3866
+ const x = k, A = j;
3867
+ let y = 0, I = 0, $ = 0, _ = 0;
3868
3868
  if (x < 0) {
3869
3869
  const L = Math.sqrt(-x);
3870
- if (y = f + L, $ = P + L * A, I = f - L, _ = P - L * A, Math.abs(_) < Math.abs($) ? _ = n / $ : Math.abs(_) > Math.abs($) && ($ = n / _), Math.abs(y) != Math.abs(I)) {
3870
+ if (y = f + L, I = P + L * A, $ = f - L, _ = P - L * A, Math.abs(_) < Math.abs(I) ? _ = n / I : Math.abs(_) > Math.abs(I) && (I = n / _), Math.abs(y) != Math.abs($)) {
3871
3871
  let N = null, B = null;
3872
- if (Math.abs(y) < Math.abs(I)) {
3873
- const H = (e - $ * I) / _, T = (t - _ - $) / I;
3874
- N = [i - I, H, T], B = [I, I, I];
3872
+ if (Math.abs(y) < Math.abs($)) {
3873
+ const H = (e - I * $) / _, T = (t - _ - I) / $;
3874
+ N = [i - $, H, T], B = [$, $, $];
3875
3875
  } else {
3876
- const H = (e - y * _) / $, T = (t - _ - $) / y, U = i - y;
3876
+ const H = (e - y * _) / I, T = (t - _ - I) / y, U = i - y;
3877
3877
  N = [y, y, y], B = [U, H, T];
3878
3878
  }
3879
3879
  let Y = 0;
3880
3880
  for (let H = 0; H < 3; H++) {
3881
3881
  const T = N[H], U = B[H];
3882
3882
  if (isFinite(T) && isFinite(U)) {
3883
- const tt = r(T, $, U, _);
3884
- (H == 0 || tt < Y) && (y = T, I = U, Y = tt);
3883
+ const tt = r(T, I, U, _);
3884
+ (H == 0 || tt < Y) && (y = T, $ = U, Y = tt);
3885
3885
  }
3886
3886
  }
3887
3887
  }
3888
3888
  } else if (x == 0) {
3889
3889
  const L = n - P * P;
3890
- y = f, $ = P + Math.sqrt(-L), I = f, _ = P - Math.sqrt(-L), Math.abs($) > Math.abs(_) ? _ = n / $ : Math.abs(_) > Math.abs($) && ($ = n / _);
3890
+ y = f, I = P + Math.sqrt(-L), $ = f, _ = P - Math.sqrt(-L), Math.abs(I) > Math.abs(_) ? _ = n / I : Math.abs(_) > Math.abs(I) && (I = n / _);
3891
3891
  } else
3892
3892
  return [];
3893
- let W = o(y, $, I, _);
3893
+ let W = o(y, I, $, _);
3894
3894
  for (let L = 0; L < 8 && W != 0; L++) {
3895
- const N = $ * _ - n, B = $ * I + y * _ - e, Y = $ + y * I + _ - t, H = y + I - i, T = y - I, U = $ * $ - $ * (I * T + 2 * _) + _ * (y * T + _);
3895
+ const N = I * _ - n, B = I * $ + y * _ - e, Y = I + y * $ + _ - t, H = y + $ - i, T = y - $, U = I * I - I * ($ * T + 2 * _) + _ * (y * T + _);
3896
3896
  if (U == 0)
3897
3897
  break;
3898
- const tt = 1 / U, K = _ - $, G = $ * I - y * _, Be = T * N + K * B + G * Y - ($ * K + y * G) * H, Ve = (y * T + K) * N - $ * (T * B + K * Y + G * H), je = -T * N - K * B - G * Y + (I * G + _ * K) * H, qe = -(I * T + K) * N + _ * (T * B + K * Y + G * H), he = y - tt * Be, le = $ - tt * Ve, ue = I - tt * je, ce = _ - tt * qe, fe = o(he, le, ue, ce);
3898
+ const tt = 1 / U, K = _ - I, G = I * $ - y * _, Ve = T * N + K * B + G * Y - (I * K + y * G) * H, je = (y * T + K) * N - I * (T * B + K * Y + G * H), qe = -T * N - K * B - G * Y + ($ * G + _ * K) * H, Ne = -($ * T + K) * N + _ * (T * B + K * Y + G * H), he = y - tt * Ve, le = I - tt * je, ue = $ - tt * qe, ce = _ - tt * Ne, fe = o(he, le, ue, ce);
3899
3899
  if (fe < W)
3900
- y = he, $ = le, I = ue, _ = ce, W = fe;
3900
+ y = he, I = le, $ = ue, _ = ce, W = fe;
3901
3901
  else
3902
3902
  break;
3903
3903
  }
3904
- return [y, $, I, _];
3904
+ return [y, I, $, _];
3905
3905
  }
3906
- function rr(i, t) {
3906
+ function or(i, t) {
3907
3907
  const e = -0.3333333333333333 * i, n = 0.5 * t;
3908
3908
  let s, r = null;
3909
3909
  if ((Math.abs(e) >= 1e102 || Math.abs(n) >= 1e164) && (Math.abs(e) < Math.abs(n) ? r = 1 - e * (e / n) * (e / n) : r = Math.sign(e) * (n / e * (n / e) / e - 1)), r !== null && n == 0)
@@ -3937,32 +3937,32 @@ function Yt(i, t) {
3937
3937
  const e = Math.abs(i);
3938
3938
  return t < 0 ? -e : e;
3939
3939
  }
3940
- function hn(i, t = 1e-9) {
3940
+ function ln(i, t = 1e-9) {
3941
3941
  if (i[i.length - 1] == 0)
3942
- return hn(i.slice(0, -1), t);
3943
- const e = new nr([
3942
+ return ln(i.slice(0, -1), t);
3943
+ const e = new ir([
3944
3944
  i.slice(0, -1).reverse().map((s) => -s / i[i.length - 1]),
3945
3945
  ...Array.from({ length: i.length - 2 }, (s, r) => {
3946
3946
  const o = new Array(i.length - 1).fill(0);
3947
3947
  return o[r] = 1, o;
3948
3948
  })
3949
- ]), n = new er(e);
3949
+ ]), n = new nr(e);
3950
3950
  return n.realEigenvalues.filter(
3951
3951
  (s, r) => Math.abs(n.imaginaryEigenvalues[r]) < t
3952
3952
  );
3953
3953
  }
3954
- const or = (i, t, e) => [i[0] * (1 - e) + t[0] * e, i[1] * (1 - e) + t[1] * e];
3955
- function ar(i) {
3954
+ const ar = (i, t, e) => [i[0] * (1 - e) + t[0] * e, i[1] * (1 - e) + t[1] * e];
3955
+ function hr(i) {
3956
3956
  const t = [];
3957
3957
  for (let e = 0; e < i.length - 1; e++)
3958
3958
  t.push([i[e], i[e + 1]]);
3959
3959
  return t;
3960
3960
  }
3961
- function ln(i, t) {
3962
- const e = ar(i).map(([n, s]) => or(n, s, t));
3963
- return i.length === 2 ? [e] : [...ln(e, t), e];
3961
+ function un(i, t) {
3962
+ const e = hr(i).map(([n, s]) => ar(n, s, t));
3963
+ return i.length === 2 ? [e] : [...un(e, t), e];
3964
3964
  }
3965
- let rt = class zt extends oe {
3965
+ let rt = class zt extends ae {
3966
3966
  constructor(t, e, n, s) {
3967
3967
  super(t, e), F(this, "segmentType", "CUBIC_BEZIER"), F(this, "firstControlPoint"), F(this, "lastControlPoint"), F(this, "_boundingBox", null), F(this, "_polynomialCoefficients", null), this.firstControlPoint = n, this.lastControlPoint = s;
3968
3968
  }
@@ -3976,7 +3976,7 @@ let rt = class zt extends oe {
3976
3976
  this.lastControlPoint[t],
3977
3977
  this.lastPoint[t]
3978
3978
  ], o = -e + 3 * n - 3 * s + r, a = 2 * e - 4 * n + 2 * s, h = -e + n;
3979
- return ne(h, a, o).filter(
3979
+ return ie(h, a, o).filter(
3980
3980
  (l) => l >= -this.precision && l <= 1 + this.precision
3981
3981
  );
3982
3982
  }
@@ -3991,10 +3991,10 @@ let rt = class zt extends oe {
3991
3991
  }
3992
3992
  getInflexionParameters() {
3993
3993
  const t = this.alignedCurve, [e, n] = t.firstControlPoint, [s, r] = t.lastControlPoint, [o, a] = t.lastPoint, h = s * n, l = o * n, c = e * r, u = o * r, m = -3 * h + 2 * l + 3 * c - u, w = 3 * h - l - 3 * c, g = c - h;
3994
- return ne(g, w, m).filter((p) => p >= 0 && p <= 1);
3994
+ return ie(g, w, m).filter((p) => p >= 0 && p <= 1);
3995
3995
  }
3996
3996
  get boundingBox() {
3997
- return this._boundingBox === null && (this._boundingBox = en([
3997
+ return this._boundingBox === null && (this._boundingBox = nn([
3998
3998
  this.firstPoint,
3999
3999
  ...this.getParametersOfExtrema().map((t) => this.paramPoint(t)),
4000
4000
  this.lastPoint
@@ -4017,10 +4017,10 @@ let rt = class zt extends oe {
4017
4017
  );
4018
4018
  }
4019
4019
  isSame(t) {
4020
- return t.segmentType !== "CUBIC_BEZIER" ? !1 : k(this.firstPoint, t.firstPoint) && k(this.lastPoint, t.lastPoint) && k(this.firstControlPoint, t.firstControlPoint) && k(this.lastControlPoint, t.lastControlPoint);
4020
+ return t.segmentType !== "CUBIC_BEZIER" ? !1 : R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) && R(this.firstControlPoint, t.firstControlPoint) && R(this.lastControlPoint, t.lastControlPoint);
4021
4021
  }
4022
4022
  distanceFrom(t) {
4023
- const e = hi((n) => Ft(this.paramPoint(n), t), this.precision);
4023
+ const e = ui((n) => _t(this.paramPoint(n), t), this.precision);
4024
4024
  return e.argMin < -this.precision || e.argMin > 1 + this.precision ? Math.min(
4025
4025
  J(this.firstPoint, t),
4026
4026
  J(this.lastPoint, t)
@@ -4082,7 +4082,7 @@ let rt = class zt extends oe {
4082
4082
  return [];
4083
4083
  let a = !1;
4084
4084
  r > 1 - this.precision && (a = !0);
4085
- const h = (r - s.originalParam) / (1 - s.originalParam), l = ln(
4085
+ const h = (r - s.originalParam) / (1 - s.originalParam), l = un(
4086
4086
  [
4087
4087
  s.p0,
4088
4088
  s.p1,
@@ -4150,11 +4150,11 @@ let rt = class zt extends oe {
4150
4150
  }
4151
4151
  paramsAtY(t) {
4152
4152
  const [e, n, s, r] = this.polynomialCoefficients[1];
4153
- return Mi(e - t, n, s, r).filter((o) => o >= -this.precision && o <= 1 + this.precision);
4153
+ return bi(e - t, n, s, r).filter((o) => o >= -this.precision && o <= 1 + this.precision);
4154
4154
  }
4155
4155
  pointToParam(t) {
4156
- if (k(t, this.firstPoint, this.precision)) return 0;
4157
- if (k(t, this.lastPoint, this.precision)) return 1;
4156
+ if (R(t, this.firstPoint, this.precision)) return 0;
4157
+ if (R(t, this.lastPoint, this.precision)) return 1;
4158
4158
  const e = this.paramsAtY(t[1]);
4159
4159
  if (e.length === 0)
4160
4160
  throw new Error("Point is not on the curve");
@@ -4163,7 +4163,7 @@ let rt = class zt extends oe {
4163
4163
  throw new Error("Point is not on the curve");
4164
4164
  return s;
4165
4165
  }
4166
- }, at = class Gt extends oe {
4166
+ }, at = class Gt extends ae {
4167
4167
  constructor(t, e, n, s, r, o, a = !1, {
4168
4168
  ignoreChecks: h = !1,
4169
4169
  angleUnits: l = "deg"
@@ -4171,11 +4171,11 @@ let rt = class zt extends oe {
4171
4171
  super(t, e), F(this, "segmentType", "ELLIPSE_ARC"), F(this, "precision", 1e-6), F(this, "majorRadius"), F(this, "minorRadius"), F(this, "center"), F(this, "tiltAngle"), F(this, "clockwise"), F(this, "_coefficients", null), F(this, "_boundingBox"), F(this, "_linearExentricity"), F(this, "_exentricity"), F(this, "_focals"), F(this, "_ellipseReferenceFrameTransform"), F(this, "_reverseEllipseReferenceFrameTransform"), F(this, "_rotateFromEllipseReferenceFrame"), F(this, "_firstAngle"), F(this, "_lastAngle"), F(this, "_deltaAngle"), this.center = n;
4172
4172
  const c = s >= r;
4173
4173
  this.majorRadius = c ? s : r, this.minorRadius = c ? r : s;
4174
- const u = l === "deg" ? o * _t : o;
4175
- if (this.tiltAngle = $t(
4174
+ const u = l === "deg" ? o * $t : o;
4175
+ if (this.tiltAngle = Tt(
4176
4176
  c ? u : u + Math.PI / 2
4177
4177
  ), this.clockwise = a, !h) {
4178
- if (k(t, e))
4178
+ if (R(t, e))
4179
4179
  throw new Error("Invalid arc, cannot be a full circle");
4180
4180
  if (!this.isPointOnEllipse(t))
4181
4181
  throw new Error(
@@ -4210,7 +4210,7 @@ let rt = class zt extends oe {
4210
4210
  get info() {
4211
4211
  return `ELLIPSE_ARC(${it(this.firstPoint)}, ${it(
4212
4212
  this.lastPoint
4213
- )}, ${it(this.center)}, ${this.majorRadius}, ${this.minorRadius}, ${this.tiltAngle * nn}, ${this.clockwise ? "CW" : "CCW"})`;
4213
+ )}, ${it(this.center)}, ${this.majorRadius}, ${this.minorRadius}, ${this.tiltAngle * sn}, ${this.clockwise ? "CW" : "CCW"})`;
4214
4214
  }
4215
4215
  reverse() {
4216
4216
  return new Gt(
@@ -4247,7 +4247,7 @@ let rt = class zt extends oe {
4247
4247
  this.lastPoint,
4248
4248
  ...t
4249
4249
  ];
4250
- this._boundingBox = en(e).grow(this.precision);
4250
+ this._boundingBox = nn(e).grow(this.precision);
4251
4251
  }
4252
4252
  return this._boundingBox;
4253
4253
  }
@@ -4298,17 +4298,17 @@ let rt = class zt extends oe {
4298
4298
  return 1 - t >= -this.precision && t >= -this.precision;
4299
4299
  }
4300
4300
  isSame(t) {
4301
- return k(this.center, t.center) && Math.abs(this.majorRadius - t.majorRadius) < this.precision && Math.abs(this.minorRadius - t.minorRadius) < this.precision && (Math.abs(this.tiltAngle - t.tiltAngle) < this.precision || Math.abs(Math.abs(this.tiltAngle - t.tiltAngle) - Math.PI) < this.precision) && (k(this.firstPoint, t.firstPoint) && this.clockwise === t.clockwise || k(this.firstPoint, t.lastPoint) && this.clockwise !== t.clockwise);
4301
+ return R(this.center, t.center) && Math.abs(this.majorRadius - t.majorRadius) < this.precision && Math.abs(this.minorRadius - t.minorRadius) < this.precision && (Math.abs(this.tiltAngle - t.tiltAngle) < this.precision || Math.abs(Math.abs(this.tiltAngle - t.tiltAngle) - Math.PI) < this.precision) && (R(this.firstPoint, t.firstPoint) && this.clockwise === t.clockwise || R(this.firstPoint, t.lastPoint) && this.clockwise !== t.clockwise);
4302
4302
  }
4303
4303
  pointTheta(t) {
4304
4304
  const e = this.ellipseReferenceFrameTransform.transform(t), n = Math.atan2(
4305
4305
  e[1] / this.minorRadius,
4306
4306
  e[0] / this.majorRadius
4307
4307
  );
4308
- return $t(n);
4308
+ return Tt(n);
4309
4309
  }
4310
4310
  thetaToParam(t) {
4311
- return ke(this.firstAngle, $t(t), this.clockwise) / this.deltaAngle;
4311
+ return Re(this.firstAngle, Tt(t), this.clockwise) / this.deltaAngle;
4312
4312
  }
4313
4313
  isPointOnEllipse(t) {
4314
4314
  const [e, n] = this.focals, s = J(t, e), r = J(t, n);
@@ -4319,19 +4319,19 @@ let rt = class zt extends oe {
4319
4319
  }
4320
4320
  distanceFrom(t) {
4321
4321
  let e;
4322
- if (k(t, this.center) ? e = X(
4322
+ if (R(t, this.center) ? e = X(
4323
4323
  this.center,
4324
4324
  Q(nt(this.majorAxis), this.minorRadius)
4325
4325
  ) : e = this.reverseEllipseReferenceFrameTransform.transform(
4326
- ur(
4326
+ cr(
4327
4327
  this.majorRadius,
4328
4328
  this.minorRadius,
4329
4329
  this.ellipseReferenceFrameTransform.transform(t)
4330
4330
  )
4331
4331
  ), this.isValidParameter(this.thetaToParam(this.pointTheta(t))))
4332
4332
  return J(t, e);
4333
- if (Hi(t, this.majorAxis, this.center)) {
4334
- const n = $t(
4333
+ if (Qi(t, this.majorAxis, this.center)) {
4334
+ const n = Tt(
4335
4335
  2 * Math.PI - this.pointTheta(t)
4336
4336
  ), s = this.thetaToParam(n);
4337
4337
  if (this.isValidParameter(s))
@@ -4360,7 +4360,7 @@ let rt = class zt extends oe {
4360
4360
  return this._lastAngle === void 0 && (this._lastAngle = this.pointTheta(this.lastPoint)), this._lastAngle;
4361
4361
  }
4362
4362
  get deltaAngle() {
4363
- return this._deltaAngle === void 0 && (this._deltaAngle = ke(
4363
+ return this._deltaAngle === void 0 && (this._deltaAngle = Re(
4364
4364
  this.firstAngle,
4365
4365
  this.lastAngle,
4366
4366
  this.clockwise
@@ -4368,7 +4368,7 @@ let rt = class zt extends oe {
4368
4368
  }
4369
4369
  normalAt(t) {
4370
4370
  const e = this.tangentAt(t);
4371
- return this.clockwise ? nt(e) : Zt(e);
4371
+ return this.clockwise ? nt(e) : Kt(e);
4372
4372
  }
4373
4373
  gradientAt(t) {
4374
4374
  const e = this.firstAngle + t * this.deltaAngle * (this.clockwise ? -1 : 1), n = -this.majorRadius * this.deltaAngle * Math.sin(e), s = this.minorRadius * this.deltaAngle * Math.cos(e), r = this.clockwise ? [-n, -s] : [n, s];
@@ -4428,48 +4428,48 @@ let rt = class zt extends oe {
4428
4428
  });
4429
4429
  }
4430
4430
  };
4431
- function hr(i, t, e, n, s, r, o) {
4432
- const { center: a, rx: h, ry: l } = lr(
4431
+ function lr(i, t, e, n, s, r, o) {
4432
+ const { center: a, rx: h, ry: l } = ur(
4433
4433
  i,
4434
4434
  t,
4435
4435
  e,
4436
4436
  n,
4437
- s * _t,
4437
+ s * $t,
4438
4438
  !r,
4439
4439
  o
4440
4440
  );
4441
4441
  return Math.abs(h - l) < 1e-9 ? new z(i, t, a, o) : new at(i, t, a, h, l, s, o);
4442
4442
  }
4443
- function lr([i, t], [e, n], s, r, o, a, h) {
4443
+ function ur([i, t], [e, n], s, r, o, a, h) {
4444
4444
  if (s < 0 && (s = -s), r < 0 && (r = -r), s == 0 || r == 0)
4445
4445
  throw Error("rx and ry can not be 0");
4446
4446
  const l = Math.sin(o), c = Math.cos(o), u = (i - e) / 2, m = (t - n) / 2, w = (i + e) / 2, g = (t + n) / 2, p = c * u + l * m, M = c * m - l * u, f = p * p / (s * s) + M * M / (r * r);
4447
4447
  f > 1 && (s = s * Math.sqrt(f), r = r * Math.sqrt(f));
4448
- const P = s * r, b = s * M, R = r * p, C = b * b + R * R;
4448
+ const P = s * r, b = s * M, S = r * p, C = b * b + S * S;
4449
4449
  if (!C)
4450
4450
  throw Error("start point can not be same as end point");
4451
4451
  let V = Math.sqrt(Math.abs((P * P - C) / C));
4452
4452
  a == h && (V = -V);
4453
- const v = V * b / r, S = -V * R / s, j = c * v - l * S + w, d = l * v + c * S + g;
4453
+ const v = V * b / r, k = -V * S / s, j = c * v - l * k + w, d = l * v + c * k + g;
4454
4454
  return {
4455
4455
  center: [j, d],
4456
4456
  rx: s,
4457
4457
  ry: r
4458
4458
  };
4459
4459
  }
4460
- function ur(i, t, e) {
4460
+ function cr(i, t, e) {
4461
4461
  const n = Math.abs(e[0]), s = Math.abs(e[1]);
4462
4462
  let r = 0.707, o = 0.707;
4463
4463
  const a = i, h = t;
4464
4464
  for (let l = 0; l < 3; l++) {
4465
4465
  const c = a * r, u = h * o, m = (a * a - h * h) * r ** 3 / a, w = (h * h - a * a) * o ** 3 / h, g = c - m, p = u - w, M = n - m, f = s - w, P = Math.hypot(g, p), b = Math.hypot(M, f);
4466
4466
  r = Math.min(1, Math.max(0, (M * P / b + m) / a)), o = Math.min(1, Math.max(0, (f * P / b + w) / h));
4467
- const R = Math.hypot(r, o);
4468
- r /= R, o /= R;
4467
+ const S = Math.hypot(r, o);
4468
+ r /= S, o /= S;
4469
4469
  }
4470
4470
  return [a * r * Math.sign(e[0]), h * o * Math.sign(e[1])];
4471
4471
  }
4472
- let et = class Dt extends oe {
4472
+ let et = class Dt extends ae {
4473
4473
  constructor(t, e, n) {
4474
4474
  super(t, e), F(this, "segmentType", "QUADRATIC_BEZIER"), F(this, "controlPoint"), F(this, "_boundingBox", null), F(this, "_polynomialCoefficients", null), this.controlPoint = n;
4475
4475
  }
@@ -4493,7 +4493,7 @@ let et = class Dt extends oe {
4493
4493
  );
4494
4494
  }
4495
4495
  get boundingBox() {
4496
- return this._boundingBox === null && (this._boundingBox = en([
4496
+ return this._boundingBox === null && (this._boundingBox = nn([
4497
4497
  this.firstPoint,
4498
4498
  // There is either one or zero extrema in each direction
4499
4499
  ...this.getParametersOfExtrema().map((t) => this.paramPoint(t)),
@@ -4515,10 +4515,10 @@ let et = class Dt extends oe {
4515
4515
  );
4516
4516
  }
4517
4517
  isSame(t) {
4518
- return t.segmentType !== "QUADRATIC_BEZIER" ? !1 : k(this.firstPoint, t.firstPoint) && k(this.lastPoint, t.lastPoint) && k(this.controlPoint, t.controlPoint);
4518
+ return t.segmentType !== "QUADRATIC_BEZIER" ? !1 : R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) && R(this.controlPoint, t.controlPoint);
4519
4519
  }
4520
4520
  distanceFrom(t) {
4521
- const e = hi((n) => Ft(this.paramPoint(n), t), this.precision);
4521
+ const e = ui((n) => _t(this.paramPoint(n), t), this.precision);
4522
4522
  return e.argMin < -this.precision || e.argMin > 1 + this.precision ? Math.min(
4523
4523
  J(this.firstPoint, t),
4524
4524
  J(this.lastPoint, t)
@@ -4584,7 +4584,7 @@ let et = class Dt extends oe {
4584
4584
  return [];
4585
4585
  let a = !1;
4586
4586
  r > 1 - this.precision && (a = !0);
4587
- const h = (r - s.originalParam) / (1 - s.originalParam), l = ln(
4587
+ const h = (r - s.originalParam) / (1 - s.originalParam), l = un(
4588
4588
  [s.p0, s.p1, this.lastPoint],
4589
4589
  a ? 1 : h
4590
4590
  ), c = a ? this.lastPoint : (e == null ? void 0 : e.get(r)) ?? l[0][0], u = l[1][0], m = l[1][1], w = new Dt(
@@ -4643,7 +4643,7 @@ let et = class Dt extends oe {
4643
4643
  }
4644
4644
  paramsAtY(t) {
4645
4645
  const [e, n, s] = this.polynomialCoefficients[1];
4646
- return ne(e - t, n, s).filter(
4646
+ return ie(e - t, n, s).filter(
4647
4647
  (r) => r >= -this.precision && r <= 1 + this.precision
4648
4648
  );
4649
4649
  }
@@ -4657,13 +4657,13 @@ let et = class Dt extends oe {
4657
4657
  return s;
4658
4658
  }
4659
4659
  };
4660
- var cr = Object.defineProperty, fr = (i, t, e) => t in i ? cr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, ut = (i, t, e) => fr(i, typeof t != "symbol" ? t + "" : t, e);
4661
- function mr(i, t) {
4662
- const e = q(t, i.firstPoint), n = Se(e, i.V) / i.squareLength;
4660
+ var fr = Object.defineProperty, mr = (i, t, e) => t in i ? fr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, ut = (i, t, e) => mr(i, typeof t != "symbol" ? t + "" : t, e);
4661
+ function gr(i, t) {
4662
+ const e = q(t, i.firstPoint), n = ke(e, i.V) / i.squareLength;
4663
4663
  return i.paramPoint(n);
4664
4664
  }
4665
- function Re(i, t, e) {
4666
- const n = e || i.precision, s = mr(i, t.center), r = J(s, t.center);
4665
+ function Ce(i, t, e) {
4666
+ const n = e || i.precision, s = gr(i, t.center), r = J(s, t.center);
4667
4667
  if (r > t.radius + n) return [];
4668
4668
  if (Math.abs(r - t.radius) < n) {
4669
4669
  const u = s;
@@ -4676,12 +4676,12 @@ function Re(i, t, e) {
4676
4676
  const c = X(s, Q(h, -a));
4677
4677
  return i.isOnSegment(c) && t.isOnSegment(c) && o.push(c), o;
4678
4678
  }
4679
- const gr = (i) => {
4679
+ const pr = (i) => {
4680
4680
  const { firstPoint: t, lastPoint: e, center: n, clockwise: s } = i;
4681
4681
  return new z(e, t, n, s, {
4682
4682
  ignoreChecks: !0
4683
4683
  });
4684
- }, pr = (i, t) => {
4684
+ }, wr = (i, t) => {
4685
4685
  if (i.isSame(t))
4686
4686
  return [i];
4687
4687
  const e = At(
@@ -4697,9 +4697,9 @@ const gr = (i) => {
4697
4697
  if (e.length === 0) return [];
4698
4698
  if (e.length === 1) return [];
4699
4699
  if (e.length === 2)
4700
- return i.isSame(gr(t)) ? [] : [new z(e[0], e[1], i.center, i.clockwise)];
4700
+ return i.isSame(pr(t)) ? [] : [new z(e[0], e[1], i.center, i.clockwise)];
4701
4701
  if (e.length === 3) {
4702
- const n = k(e[0], t.lastPoint) || k(e[0], t.firstPoint) ? 1 : 0;
4702
+ const n = R(e[0], t.lastPoint) || R(e[0], t.firstPoint) ? 1 : 0;
4703
4703
  return [
4704
4704
  new z(
4705
4705
  e[0 + n],
@@ -4715,7 +4715,7 @@ const gr = (i) => {
4715
4715
  ];
4716
4716
  throw new Error("Bug in the arc arc overlap algorithm");
4717
4717
  };
4718
- function yi(i, t, e = !1, n) {
4718
+ function xi(i, t, e = !1, n) {
4719
4719
  const s = n || i.precision, r = J(i.center, t.center), o = i.radius + t.radius;
4720
4720
  if (r > o + s)
4721
4721
  return [];
@@ -4723,7 +4723,7 @@ function yi(i, t, e = !1, n) {
4723
4723
  if (r < a - s)
4724
4724
  return [];
4725
4725
  if (r < s)
4726
- return a > s ? [] : e ? pr(i, t) : [];
4726
+ return a > s ? [] : e ? wr(i, t) : [];
4727
4727
  const h = ot(q(t.center, i.center)), l = r > o - s;
4728
4728
  if (
4729
4729
  // circles are outside each other
@@ -4744,7 +4744,7 @@ function yi(i, t, e = !1, n) {
4744
4744
  ), w = nt(h), g = X(u, Q(w, m)), p = X(u, Q(w, -m)), M = [];
4745
4745
  return i.isOnSegment(g) && t.isOnSegment(g) && M.push(g), i.isOnSegment(p) && t.isOnSegment(p) && M.push(p), M;
4746
4746
  }
4747
- function We(i, t, e = 1e-9) {
4747
+ function He(i, t, e = 1e-9) {
4748
4748
  const n = i.transform(t.ellipseReferenceFrameTransform), s = n.slope, r = n.yIntercept, o = t.majorRadius * t.majorRadius, a = t.minorRadius * t.minorRadius, h = t.majorRadius * t.minorRadius, l = n.slope * n.slope, c = n.yIntercept * n.yIntercept, u = (f) => f.map(
4749
4749
  (P) => t.reverseEllipseReferenceFrameTransform.transform(P)
4750
4750
  ).filter((P) => i.isOnSegment(P) && t.isOnSegment(P));
@@ -4753,8 +4753,8 @@ function We(i, t, e = 1e-9) {
4753
4753
  if (Math.abs(f) - t.majorRadius > e) return [];
4754
4754
  if (Math.abs(Math.abs(f) - t.majorRadius) < e)
4755
4755
  return u([[f, 0]]);
4756
- const P = t.minorRadius * Math.sqrt(1 - f * f / o), b = [f, P], R = [f, -P];
4757
- return u([b, R]);
4756
+ const P = t.minorRadius * Math.sqrt(1 - f * f / o), b = [f, P], S = [f, -P];
4757
+ return u([b, S]);
4758
4758
  }
4759
4759
  const m = o * l + a - c;
4760
4760
  if (m < -e)
@@ -4773,35 +4773,35 @@ function We(i, t, e = 1e-9) {
4773
4773
  ];
4774
4774
  return u([p, M]);
4775
4775
  }
4776
- function bi(i, t) {
4776
+ function vi(i, t) {
4777
4777
  const e = Math.max(i.precision, t.precision), n = i.coefficients, s = n.x2, r = n.xy, o = n.y2, a = n.x, h = n.y, l = n.c, c = t.coefficients, u = c.x2, m = c.xy, w = c.y2, g = c.x, p = c.y, M = c.c, f = {
4778
4778
  z0: l * s * g * g + s * s * M * M - a * s * g * M + u * u * l * l - 2 * s * M * u * l - a * g * u * l + u * a * a * M,
4779
4779
  z1: p * a * a * u - M * g * s * r - 2 * s * M * u * h - l * u * m * a + 2 * g * m * s * l + 2 * p * M * s * s + g * g * s * h - p * g * s * a - 2 * s * p * u * l - l * u * g * r + 2 * l * h * u * u - M * m * s * a - h * u * g * a + 2 * M * r * u * a,
4780
4780
  z2: p * p * s * s + 2 * w * M * s * s - h * u * g * r + M * u * r * r - h * u * m * a - M * m * s * r - 2 * s * p * u * h + 2 * g * m * s * h - w * g * s * a - 2 * s * w * u * l + m * m * s * l + 2 * p * r * u * a + h * h * u * u - o * u * g * a - p * m * s * a + 2 * l * o * u * u - l * u * m * r + w * a * a * u + g * g * s * o - p * g * s * r - 2 * s * M * u * o,
4781
4781
  z3: -2 * s * u * o * p + p * u * r * r + 2 * w * r * u * a - o * u * m * a + m * m * s * h - p * m * s * r - 2 * s * w * u * h - h * u * m * r - w * m * s * a + 2 * p * w * s * s + 2 * h * o * u * u - o * u * g * r + 2 * g * m * s * o - w * g * s * r,
4782
4782
  z4: s * s * w * w - 2 * s * w * u * o + u * u * o * o - r * s * m * w - r * m * u * o + r * r * u * w + o * s * m * m
4783
- }, P = hn(
4783
+ }, P = ln(
4784
4784
  [f.z0, f.z1, f.z2, f.z3, f.z4],
4785
4785
  e
4786
4786
  ).flatMap((b) => {
4787
- const R = s * m * b + s * g - u * r * b - u * a;
4788
- if (R)
4789
- return [[-(s * M + s * w * b * b - u * o * b * b + s * p * b - u * h * b - u * l) / R, b]];
4790
- const C = r * b + a, V = -C / (2 * s), v = o * b * b + h * b + l, S = C * C / (4 * s * s) - v / s;
4791
- if (Math.abs(S) < e)
4787
+ const S = s * m * b + s * g - u * r * b - u * a;
4788
+ if (S)
4789
+ return [[-(s * M + s * w * b * b - u * o * b * b + s * p * b - u * h * b - u * l) / S, b]];
4790
+ const C = r * b + a, V = -C / (2 * s), v = o * b * b + h * b + l, k = C * C / (4 * s * s) - v / s;
4791
+ if (Math.abs(k) < e)
4792
4792
  return [[V, b]];
4793
- if (S > 0) {
4794
- const j = Math.sqrt(S);
4793
+ if (k > 0) {
4794
+ const j = Math.sqrt(k);
4795
4795
  return [[V + j, b], [V - j, b]];
4796
4796
  }
4797
4797
  return [];
4798
4798
  });
4799
4799
  return At(P, e);
4800
4800
  }
4801
- function kn(i, t) {
4802
- return bi(i, t).filter((e) => i.isOnSegment(e) && t.isOnSegment(e));
4801
+ function Cn(i, t) {
4802
+ return vi(i, t).filter((e) => i.isOnSegment(e) && t.isOnSegment(e));
4803
4803
  }
4804
- const wr = (i) => {
4804
+ const dr = (i) => {
4805
4805
  const {
4806
4806
  firstPoint: t,
4807
4807
  lastPoint: e,
@@ -4824,7 +4824,7 @@ const wr = (i) => {
4824
4824
  angleUnits: "rad"
4825
4825
  }
4826
4826
  );
4827
- }, dr = (i, t) => {
4827
+ }, Pr = (i, t) => {
4828
4828
  if (i.isSame(t))
4829
4829
  return [i];
4830
4830
  const e = (s, r) => new at(
@@ -4849,52 +4849,52 @@ const wr = (i) => {
4849
4849
  if (n.length === 0) return [];
4850
4850
  if (n.length === 1) return [];
4851
4851
  if (n.length === 2)
4852
- return i.isSame(wr(t)) ? [] : [e(n[0], n[1])];
4852
+ return i.isSame(dr(t)) ? [] : [e(n[0], n[1])];
4853
4853
  if (n.length === 3) {
4854
- const s = k(n[0], t.lastPoint) || k(n[0], t.firstPoint) ? 1 : 0;
4854
+ const s = R(n[0], t.lastPoint) || R(n[0], t.firstPoint) ? 1 : 0;
4855
4855
  return [e(n[0 + s], n[1 + s])];
4856
4856
  } else if (n.length === 4)
4857
4857
  return [e(n[0], n[1]), e(n[2], n[3])];
4858
4858
  throw new Error("Bug in the ellipse arc ellipse arc overlap algorithm");
4859
4859
  };
4860
- function Pr(i, t, e = !1) {
4860
+ function Mr(i, t, e = !1) {
4861
4861
  const n = Math.max(i.precision, t.precision);
4862
- return k(i.center, t.center) && Math.abs(i.majorRadius - t.majorRadius) < n && Math.abs(i.minorRadius - t.minorRadius) < n && (Math.abs(i.tiltAngle - t.tiltAngle) < n || Math.abs(Math.abs(i.tiltAngle - t.tiltAngle) - Math.PI) < n) ? e ? dr(i, t) : [] : bi(i, t).filter((s) => i.isOnSegment(s) && t.isOnSegment(s));
4862
+ return R(i.center, t.center) && Math.abs(i.majorRadius - t.majorRadius) < n && Math.abs(i.minorRadius - t.minorRadius) < n && (Math.abs(i.tiltAngle - t.tiltAngle) < n || Math.abs(Math.abs(i.tiltAngle - t.tiltAngle) - Math.PI) < n) ? e ? Pr(i, t) : [] : vi(i, t).filter((s) => i.isOnSegment(s) && t.isOnSegment(s));
4863
4863
  }
4864
- function Rn(i, t) {
4864
+ function Tn(i, t) {
4865
4865
  const [e, n] = i.firstPoint, [s, r] = i.lastPoint, o = new ct().translate(-e, -n).rotate(-Math.atan2(r - n, s - e)), a = o.clone().inverse(), h = t.transform(o);
4866
4866
  return h.paramsAtY(0).map((l) => h.paramPoint(l)).map((l) => a.transform(l)).filter((l) => i.isOnSegment(l));
4867
4867
  }
4868
- const Mr = (i, t = 1e-9) => {
4868
+ const yr = (i, t = 1e-9) => {
4869
4869
  let e = i;
4870
4870
  return Math.abs(i) < t && (e = 0), e.toFixed(-Math.log10(t));
4871
4871
  };
4872
- function xi(i, t = 1e-9) {
4872
+ function Ai(i, t = 1e-9) {
4873
4873
  return Array.from(
4874
- new Map(i.map((e) => [Mr(e, t), e])).values()
4874
+ new Map(i.map((e) => [yr(e, t), e])).values()
4875
4875
  );
4876
4876
  }
4877
- const yr = (i, t) => {
4878
- const [[e, n, s, r], [o, a, h, l]] = t.polynomialCoefficients, c = i.coefficients, u = c.x2, m = c.xy, w = c.y2, g = c.x, p = c.y, M = c.c, f = e * e, P = n * n, b = s * s, R = r * r, C = o * o, V = a * a, v = h * h, S = l * l, j = M + g * e + u * f + p * o + m * e * o + w * C, d = g * n + 2 * u * e * n + m * n * o + p * a + m * e * a + 2 * w * o * a, x = u * P + g * s + 2 * u * e * s + m * s * o + m * n * a + w * V + p * h + m * e * h + 2 * w * o * h, A = 2 * u * n * s + g * r + 2 * u * e * r + m * r * o + m * s * a + m * n * h + 2 * w * a * h + p * l + m * e * l + 2 * w * o * l, y = u * b + 2 * u * n * r + m * r * a + m * s * h + w * v + m * n * l + 2 * w * a * l, $ = 2 * u * s * r + m * r * h + m * s * l + 2 * w * h * l, I = u * R + m * r * l + w * S;
4879
- return [j, d, x, A, y, $, I];
4877
+ const br = (i, t) => {
4878
+ const [[e, n, s, r], [o, a, h, l]] = t.polynomialCoefficients, c = i.coefficients, u = c.x2, m = c.xy, w = c.y2, g = c.x, p = c.y, M = c.c, f = e * e, P = n * n, b = s * s, S = r * r, C = o * o, V = a * a, v = h * h, k = l * l, j = M + g * e + u * f + p * o + m * e * o + w * C, d = g * n + 2 * u * e * n + m * n * o + p * a + m * e * a + 2 * w * o * a, x = u * P + g * s + 2 * u * e * s + m * s * o + m * n * a + w * V + p * h + m * e * h + 2 * w * o * h, A = 2 * u * n * s + g * r + 2 * u * e * r + m * r * o + m * s * a + m * n * h + 2 * w * a * h + p * l + m * e * l + 2 * w * o * l, y = u * b + 2 * u * n * r + m * r * a + m * s * h + w * v + m * n * l + 2 * w * a * l, I = 2 * u * s * r + m * r * h + m * s * l + 2 * w * h * l, $ = u * S + m * r * l + w * k;
4879
+ return [j, d, x, A, y, I, $];
4880
4880
  };
4881
- function Cn(i, t) {
4882
- const e = Math.max(i.precision, t.precision), n = yr(i, t), s = hn(n, e).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4883
- return xi(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4881
+ function In(i, t) {
4882
+ const e = Math.max(i.precision, t.precision), n = br(i, t), s = ln(n, e).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4883
+ return Ai(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4884
4884
  }
4885
- const br = (i, t) => {
4886
- const [[e, n, s], [r, o, a]] = t.polynomialCoefficients, h = i.coefficients, l = h.x2, c = h.xy, u = h.y2, m = h.x, w = h.y, g = h.c, p = e * e, M = n * n, f = s * s, P = r * r, b = o * o, R = a * a, C = l * p + c * e * r + u * P + m * e + w * r + g, V = 2 * l * e * n + c * e * o + c * n * r + 2 * u * r * o + m * n + w * o, v = 2 * l * e * s + l * M + c * e * a + c * n * o + c * s * r + 2 * u * r * a + u * b + m * s + w * a, S = 2 * l * n * s + c * n * a + c * s * o + 2 * u * o * a, j = l * f + c * s * a + u * R;
4887
- return [C, V, v, S, j];
4885
+ const xr = (i, t) => {
4886
+ const [[e, n, s], [r, o, a]] = t.polynomialCoefficients, h = i.coefficients, l = h.x2, c = h.xy, u = h.y2, m = h.x, w = h.y, g = h.c, p = e * e, M = n * n, f = s * s, P = r * r, b = o * o, S = a * a, C = l * p + c * e * r + u * P + m * e + w * r + g, V = 2 * l * e * n + c * e * o + c * n * r + 2 * u * r * o + m * n + w * o, v = 2 * l * e * s + l * M + c * e * a + c * n * o + c * s * r + 2 * u * r * a + u * b + m * s + w * a, k = 2 * l * n * s + c * n * a + c * s * o + 2 * u * o * a, j = l * f + c * s * a + u * S;
4887
+ return [C, V, v, k, j];
4888
4888
  };
4889
- function Tn(i, t) {
4890
- const e = Math.max(i.precision, t.precision), n = br(i, t), s = ir(...n).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4891
- return xi(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4889
+ function $n(i, t) {
4890
+ const e = Math.max(i.precision, t.precision), n = xr(i, t), s = sr(...n).filter((r) => r >= -t.precision && r <= 1 + t.precision);
4891
+ return Ai(s, e).map((r) => t.paramPoint(r)).filter((r) => i.isOnSegment(r));
4892
4892
  }
4893
4893
  function lt(i, { firstPoint: t, lastPoint: e }, n = 1e-9) {
4894
4894
  const s = q(e, t);
4895
- return Math.abs(s[0]) < n ? s[1] > 0 ? t[0] - i[0] : i[0] - t[0] : Math.abs(s[1]) < n ? s[0] > 0 ? i[1] - t[1] : t[1] - i[1] : bt(s, q(i, t)) / Xi(s);
4895
+ return Math.abs(s[0]) < n ? s[1] > 0 ? t[0] - i[0] : i[0] - t[0] : Math.abs(s[1]) < n ? s[0] > 0 ? i[1] - t[1] : t[1] - i[1] : bt(s, q(i, t)) / Wi(s);
4896
4896
  }
4897
- let un = class {
4897
+ let cn = class {
4898
4898
  constructor(t, e, n, s) {
4899
4899
  this.firstPoint = t, this.lastPoint = e, this.negativeThickness = n, this.positiveThickness = s;
4900
4900
  }
@@ -4902,33 +4902,33 @@ let un = class {
4902
4902
  return this.positiveThickness - this.negativeThickness;
4903
4903
  }
4904
4904
  };
4905
- const xr = 3 / 4, vr = 4 / 9;
4906
- function Ar(i) {
4907
- const t = lt(i.firstControlPoint, i), e = lt(i.lastControlPoint, i), n = t * e > 0 ? xr : vr;
4908
- return new un(
4905
+ const vr = 3 / 4, Ar = 4 / 9;
4906
+ function Er(i) {
4907
+ const t = lt(i.firstControlPoint, i), e = lt(i.lastControlPoint, i), n = t * e > 0 ? vr : Ar;
4908
+ return new cn(
4909
4909
  i.firstPoint,
4910
4910
  i.lastPoint,
4911
4911
  n * Math.min(0, t, e),
4912
4912
  n * Math.max(0, t, e)
4913
4913
  );
4914
4914
  }
4915
- function Er(i) {
4915
+ function Sr(i) {
4916
4916
  const t = lt(i.controlPoint, i);
4917
- return new un(
4917
+ return new cn(
4918
4918
  i.firstPoint,
4919
4919
  i.lastPoint,
4920
4920
  Math.min(0, t / 2),
4921
4921
  Math.max(0, t / 2)
4922
4922
  );
4923
4923
  }
4924
- function Sr(i) {
4924
+ function kr(i) {
4925
4925
  if (i instanceof rt)
4926
- return Ar(i);
4927
- if (i instanceof et)
4928
4926
  return Er(i);
4927
+ if (i instanceof et)
4928
+ return Sr(i);
4929
4929
  throw new Error("Not implemented");
4930
4930
  }
4931
- function kr(i) {
4931
+ function Rr(i) {
4932
4932
  const t = i.paramPoint(0.5), e = nt(q(t, i.firstPoint)), n = X(t, e), s = {
4933
4933
  firstPoint: t,
4934
4934
  lastPoint: n
@@ -4939,14 +4939,14 @@ function kr(i) {
4939
4939
  return i instanceof rt ? r.push(
4940
4940
  lt(i.firstControlPoint, s),
4941
4941
  lt(i.lastControlPoint, s)
4942
- ) : i instanceof et && r.push(lt(i.controlPoint, s)), new un(
4942
+ ) : i instanceof et && r.push(lt(i.controlPoint, s)), new cn(
4943
4943
  t,
4944
4944
  n,
4945
4945
  Math.min(...r),
4946
4946
  Math.max(...r)
4947
4947
  );
4948
4948
  }
4949
- function $n(i, t) {
4949
+ function _n(i, t) {
4950
4950
  const e = [];
4951
4951
  for (let n = 1; n < i.length; n++) {
4952
4952
  const s = i[n];
@@ -4975,23 +4975,23 @@ class Ht {
4975
4975
  return this.from === "start" ? this.to === "end" ? t : t.splitAtParameters([this.to])[0] : this.to === "end" ? t.splitAtParameters([this.from])[1] : t.splitAtParameters([this.from, this.to])[1];
4976
4976
  }
4977
4977
  }
4978
- function Rr(i, t) {
4978
+ function Cr(i, t) {
4979
4979
  if (i instanceof rt)
4980
- return new Tr([
4980
+ return new Ir([
4981
4981
  lt(i.firstPoint, t),
4982
4982
  lt(i.firstControlPoint, t),
4983
4983
  lt(i.lastControlPoint, t),
4984
4984
  lt(i.lastPoint, t)
4985
4985
  ]);
4986
4986
  if (i instanceof et)
4987
- return new Cr([
4987
+ return new Tr([
4988
4988
  lt(i.firstPoint, t),
4989
4989
  lt(i.controlPoint, t),
4990
4990
  lt(i.lastPoint, t)
4991
4991
  ]);
4992
4992
  throw new Error("Not implemented");
4993
4993
  }
4994
- class Cr {
4994
+ class Tr {
4995
4995
  constructor(t) {
4996
4996
  ut(this, "topHull", []), ut(this, "bottomHull", []), this.distances = t;
4997
4997
  const [e, n, s] = t, r = [0, e], o = [1 / 2, n], a = [1, s], h = s - e, l = e;
@@ -5004,7 +5004,7 @@ class Cr {
5004
5004
  return this.distances[2];
5005
5005
  }
5006
5006
  }
5007
- class Tr {
5007
+ class Ir {
5008
5008
  constructor(t) {
5009
5009
  ut(this, "topHull", []), ut(this, "bottomHull", []), this.distances = t;
5010
5010
  const [e, n, s, r] = t, o = [0, e], a = [1 / 3, n], h = [2 / 3, s], l = [1, r], c = r - e, u = e, m = n - (c * (1 / 3) + u), w = s - (c * (2 / 3) + u);
@@ -5024,11 +5024,11 @@ class Tr {
5024
5024
  return this.distances[3];
5025
5025
  }
5026
5026
  }
5027
- function In(i, t) {
5028
- const e = Rr(t, i), n = $n(
5027
+ function Fn(i, t) {
5028
+ const e = Cr(t, i), n = _n(
5029
5029
  e.topHull,
5030
5030
  i.negativeThickness
5031
- ), s = $n(
5031
+ ), s = _n(
5032
5032
  e.bottomHull,
5033
5033
  i.positiveThickness
5034
5034
  ), r = e.endDistance >= i.negativeThickness && e.endDistance <= i.positiveThickness;
@@ -5043,11 +5043,11 @@ function In(i, t) {
5043
5043
  const o = n.length ? n : s;
5044
5044
  return o.length === 2 ? new Ht(o[0], o[1]) : r ? new Ht(o[0], "end") : new Ht("start", o[0]);
5045
5045
  }
5046
- function _n(i, t) {
5047
- const e = Sr(i), n = In(e, t);
5046
+ function Ln(i, t) {
5047
+ const e = kr(i), n = Fn(e, t);
5048
5048
  if (!n)
5049
5049
  return null;
5050
- const s = kr(i), r = In(
5050
+ const s = Rr(i), r = Fn(
5051
5051
  s,
5052
5052
  t
5053
5053
  );
@@ -5058,18 +5058,18 @@ function It(i, t, e = 1e-9, { maxIterations: n = 100 } = {}) {
5058
5058
  const s = Math.max(e * e, Number.EPSILON * 10);
5059
5059
  let r = i, o = t, a = be(r), h = be(o);
5060
5060
  for (let l = 0; l < n; l++) {
5061
- const c = a > s ? _n(o, r) : r;
5061
+ const c = a > s ? Ln(o, r) : r;
5062
5062
  if (!c) return [];
5063
- const u = be(c), m = h > s ? _n(c, o) : o;
5063
+ const u = be(c), m = h > s ? Ln(c, o) : o;
5064
5064
  if (!m) return [];
5065
5065
  const w = be(m);
5066
5066
  if (u <= s && w <= s)
5067
5067
  return [
5068
5068
  c.boundingBox.intersection(m.boundingBox).center
5069
5069
  ];
5070
- if (k(c.firstPoint, c.lastPoint) && m.isOnSegment(c.firstPoint))
5070
+ if (R(c.firstPoint, c.lastPoint) && m.isOnSegment(c.firstPoint))
5071
5071
  return [c.firstPoint];
5072
- if (k(m.firstPoint, m.lastPoint) && c.isOnSegment(m.firstPoint))
5072
+ if (R(m.firstPoint, m.lastPoint) && c.isOnSegment(m.firstPoint))
5073
5073
  return [m.firstPoint];
5074
5074
  if (u > 0.8 * a && w > 0.8 * h)
5075
5075
  if (u / a > w / h) {
@@ -5121,11 +5121,11 @@ function $r(i, t) {
5121
5121
  if (e.length === 2)
5122
5122
  return [i.splitAt(e)[1]];
5123
5123
  if (e.length === 3)
5124
- return k(e[0], i.firstPoint) && k(e[1], i.lastPoint) ? [i] : [t];
5124
+ return R(e[0], i.firstPoint) && R(e[1], i.lastPoint) ? [i] : [t];
5125
5125
  if (e.length === 4)
5126
5126
  return [i];
5127
5127
  }
5128
- function Ir(i, t, e = !1) {
5128
+ function _r(i, t, e = !1) {
5129
5129
  const n = Math.max(i.precision, t.precision);
5130
5130
  if (e) {
5131
5131
  const s = $r(i, t);
@@ -5134,7 +5134,7 @@ function Ir(i, t, e = !1) {
5134
5134
  }
5135
5135
  return It(i, t, n);
5136
5136
  }
5137
- function _r(i, t) {
5137
+ function Fr(i, t) {
5138
5138
  const e = [];
5139
5139
  if ([
5140
5140
  [i.firstPoint, t],
@@ -5148,22 +5148,22 @@ function _r(i, t) {
5148
5148
  if (e.length === 2)
5149
5149
  return [i.splitAt(e)[1]];
5150
5150
  if (e.length === 3)
5151
- return k(e[0], i.firstPoint) && k(e[1], i.lastPoint) ? [i] : [t];
5151
+ return R(e[0], i.firstPoint) && R(e[1], i.lastPoint) ? [i] : [t];
5152
5152
  if (e.length === 4)
5153
5153
  return [i];
5154
5154
  }
5155
- function Fr(i, t, e = !1) {
5155
+ function Lr(i, t, e = !1) {
5156
5156
  const n = Math.max(i.precision, t.precision);
5157
5157
  if (e) {
5158
- const s = _r(i, t);
5158
+ const s = Fr(i, t);
5159
5159
  if (s)
5160
5160
  return s;
5161
5161
  }
5162
5162
  return It(i, t, n);
5163
5163
  }
5164
- function Lr(i, t, e) {
5164
+ function Br(i, t, e) {
5165
5165
  if (i instanceof D && t instanceof D) {
5166
- const n = oi(
5166
+ const n = hi(
5167
5167
  i,
5168
5168
  t,
5169
5169
  !1,
@@ -5172,16 +5172,16 @@ function Lr(i, t, e) {
5172
5172
  return n === null ? [] : [n];
5173
5173
  }
5174
5174
  if (i instanceof D && t instanceof z)
5175
- return Re(i, t, e);
5175
+ return Ce(i, t, e);
5176
5176
  if (i instanceof z && t instanceof D)
5177
- return Re(t, i, e);
5177
+ return Ce(t, i, e);
5178
5178
  if (i instanceof z && t instanceof z)
5179
- return yi(i, t, !1, e);
5179
+ return xi(i, t, !1, e);
5180
5180
  throw new Error("Not implemented");
5181
5181
  }
5182
- function ie(i, t, e) {
5182
+ function se(i, t, e) {
5183
5183
  if (i instanceof D && t instanceof D) {
5184
- const n = oi(
5184
+ const n = hi(
5185
5185
  i,
5186
5186
  t,
5187
5187
  !0,
@@ -5192,15 +5192,15 @@ function ie(i, t, e) {
5192
5192
  if (!i.boundingBox.overlaps(t.boundingBox))
5193
5193
  return { intersections: [], overlaps: [], count: 0 };
5194
5194
  if (i instanceof D && t instanceof z) {
5195
- const n = Re(i, t, e);
5195
+ const n = Ce(i, t, e);
5196
5196
  return { intersections: n, overlaps: [], count: n.length };
5197
5197
  }
5198
5198
  if (i instanceof z && t instanceof D) {
5199
- const n = Re(t, i, e);
5199
+ const n = Ce(t, i, e);
5200
5200
  return { intersections: n, overlaps: [], count: n.length };
5201
5201
  }
5202
5202
  if (i instanceof z && t instanceof z) {
5203
- const n = yi(
5203
+ const n = xi(
5204
5204
  i,
5205
5205
  t,
5206
5206
  !0,
@@ -5217,7 +5217,7 @@ function ie(i, t, e) {
5217
5217
  } : { intersections: [], overlaps: [], count: 0 };
5218
5218
  }
5219
5219
  if (i instanceof D && t instanceof at) {
5220
- const n = We(
5220
+ const n = He(
5221
5221
  i,
5222
5222
  t,
5223
5223
  e
@@ -5225,7 +5225,7 @@ function ie(i, t, e) {
5225
5225
  return { intersections: n, overlaps: [], count: n.length };
5226
5226
  }
5227
5227
  if (t instanceof D && i instanceof at) {
5228
- const n = We(
5228
+ const n = He(
5229
5229
  t,
5230
5230
  i,
5231
5231
  e
@@ -5233,15 +5233,15 @@ function ie(i, t, e) {
5233
5233
  return { intersections: n, overlaps: [], count: n.length };
5234
5234
  }
5235
5235
  if (i instanceof z && t instanceof at) {
5236
- const n = kn(i, t);
5236
+ const n = Cn(i, t);
5237
5237
  return { intersections: n, overlaps: [], count: n.length };
5238
5238
  }
5239
5239
  if (t instanceof z && i instanceof at) {
5240
- const n = kn(t, i);
5240
+ const n = Cn(t, i);
5241
5241
  return { intersections: n, overlaps: [], count: n.length };
5242
5242
  }
5243
5243
  if (i instanceof at && t instanceof at) {
5244
- const n = Pr(
5244
+ const n = Mr(
5245
5245
  i,
5246
5246
  t,
5247
5247
  !0
@@ -5257,31 +5257,31 @@ function ie(i, t, e) {
5257
5257
  } : { intersections: [], overlaps: [], count: 0 };
5258
5258
  }
5259
5259
  if (i instanceof D && (t instanceof rt || t instanceof et)) {
5260
- const n = Rn(i, t);
5260
+ const n = Tn(i, t);
5261
5261
  return { intersections: n, overlaps: [], count: n.length };
5262
5262
  }
5263
5263
  if (t instanceof D && (i instanceof rt || i instanceof et)) {
5264
- const n = Rn(t, i);
5264
+ const n = Tn(t, i);
5265
5265
  return { intersections: n, overlaps: [], count: n.length };
5266
5266
  }
5267
5267
  if ((i instanceof z || i instanceof at) && t instanceof et) {
5268
- const n = Tn(i, t);
5268
+ const n = $n(i, t);
5269
5269
  return { intersections: n, overlaps: [], count: n.length };
5270
5270
  }
5271
5271
  if ((t instanceof z || t instanceof at) && i instanceof et) {
5272
- const n = Tn(t, i);
5272
+ const n = $n(t, i);
5273
5273
  return { intersections: n, overlaps: [], count: n.length };
5274
5274
  }
5275
5275
  if ((i instanceof z || i instanceof at) && t instanceof rt) {
5276
- const n = Cn(i, t);
5276
+ const n = In(i, t);
5277
5277
  return { intersections: n, overlaps: [], count: n.length };
5278
5278
  }
5279
5279
  if ((t instanceof z || t instanceof at) && i instanceof rt) {
5280
- const n = Cn(t, i);
5280
+ const n = In(t, i);
5281
5281
  return { intersections: n, overlaps: [], count: n.length };
5282
5282
  }
5283
5283
  if (i instanceof et && t instanceof et) {
5284
- const n = Fr(
5284
+ const n = Lr(
5285
5285
  i,
5286
5286
  t
5287
5287
  );
@@ -5300,7 +5300,7 @@ function ie(i, t, e) {
5300
5300
  return { intersections: n, overlaps: [], count: n.length };
5301
5301
  }
5302
5302
  if (i instanceof rt && t instanceof rt) {
5303
- const n = Ir(
5303
+ const n = _r(
5304
5304
  i,
5305
5305
  t
5306
5306
  );
@@ -5316,20 +5316,20 @@ function ie(i, t, e) {
5316
5316
  }
5317
5317
  throw new Error("Not implemented");
5318
5318
  }
5319
- function vi(i) {
5319
+ function Ei(i) {
5320
5320
  const t = [];
5321
5321
  for (let e = 0; e < i; e++)
5322
5322
  for (let n = 0; n <= e; n++)
5323
5323
  t.push([e, n]);
5324
5324
  return t;
5325
5325
  }
5326
- function* He(i) {
5327
- for (const [t, e] of vi(i.length))
5326
+ function* Qe(i) {
5327
+ for (const [t, e] of Ei(i.length))
5328
5328
  t !== e && (yield [i[t], i[e]]);
5329
5329
  }
5330
- class Ai extends Lt {
5330
+ class Si extends Ft {
5331
5331
  constructor(t, { ignoreChecks: e = !1 } = {}) {
5332
- super(), ut(this, "segments"), ut(this, "_boundingBox", null), e || Ei(t), this.segments = t;
5332
+ super(), ut(this, "segments"), ut(this, "_boundingBox", null), e || ki(t), this.segments = t;
5333
5333
  }
5334
5334
  get repr() {
5335
5335
  return this.segments.map((t) => t.repr).join(`
@@ -5354,12 +5354,12 @@ class Ai extends Lt {
5354
5354
  intersects(t) {
5355
5355
  return this.boundingBox.overlaps(t.boundingBox) ? this.segments.some(
5356
5356
  (e) => t.segments.some(
5357
- (n) => ie(e, n).count > 0
5357
+ (n) => se(e, n).count > 0
5358
5358
  )
5359
5359
  ) : !1;
5360
5360
  }
5361
5361
  overlappingSegments(t) {
5362
- return this.segments.flatMap((e) => t.segments.flatMap((n) => e.boundingBox.overlaps(n.boundingBox) ? ie(e, n).overlaps : []));
5362
+ return this.segments.flatMap((e) => t.segments.flatMap((n) => e.boundingBox.overlaps(n.boundingBox) ? se(e, n).overlaps : []));
5363
5363
  }
5364
5364
  get boundingBox() {
5365
5365
  if (this._boundingBox === null) {
@@ -5374,30 +5374,30 @@ class Ai extends Lt {
5374
5374
  return this.repr;
5375
5375
  }
5376
5376
  }
5377
- function Br(i, t = "Stroke") {
5378
- vi(i.length).forEach(
5377
+ function Vr(i, t = "Stroke") {
5378
+ Ei(i.length).forEach(
5379
5379
  ([e, n]) => {
5380
5380
  if (e === n) return;
5381
- const s = i[e], r = i[n], o = ie(s, r), a = Math.max(s.precision, r.precision);
5381
+ const s = i[e], r = i[n], o = se(s, r), a = Math.max(s.precision, r.precision);
5382
5382
  if (o.count !== 0) {
5383
5383
  if (o.count === 1 && !o.overlaps.length) {
5384
5384
  const h = e - n, l = o.intersections[0];
5385
- if (h === 1 && k(s.firstPoint, l, a) || h === -1 && k(s.lastPoint, l, a) || h === i.length - 1 && k(s.lastPoint, l, a) && k(r.firstPoint, l, a) || -h === i.length - 1 && k(s.firstPoint, l, a) && k(r.lastPoint, l, a))
5385
+ if (h === 1 && R(s.firstPoint, l, a) || h === -1 && R(s.lastPoint, l, a) || h === i.length - 1 && R(s.lastPoint, l, a) && R(r.firstPoint, l, a) || -h === i.length - 1 && R(s.firstPoint, l, a) && R(r.lastPoint, l, a))
5386
5386
  return;
5387
5387
  }
5388
- if (!(o.count === 2 && i.length === 2 && (k(
5388
+ if (!(o.count === 2 && i.length === 2 && (R(
5389
5389
  s.firstPoint,
5390
5390
  o.intersections[0],
5391
5391
  a
5392
- ) && k(
5392
+ ) && R(
5393
5393
  s.lastPoint,
5394
5394
  o.intersections[1],
5395
5395
  a
5396
- ) || k(
5396
+ ) || R(
5397
5397
  s.firstPoint,
5398
5398
  o.intersections[1],
5399
5399
  a
5400
- ) && k(
5400
+ ) && R(
5401
5401
  s.lastPoint,
5402
5402
  o.intersections[0],
5403
5403
  a
@@ -5411,22 +5411,22 @@ function Br(i, t = "Stroke") {
5411
5411
  }
5412
5412
  );
5413
5413
  }
5414
- function Ei(i, t = "Stroke") {
5414
+ function ki(i, t = "Stroke") {
5415
5415
  if (i.length === 0)
5416
5416
  throw new Error(`${t} must have at least one segment`);
5417
5417
  Pt([i.slice(0, -1), i.slice(1)]).forEach(
5418
5418
  ([e, n]) => {
5419
- if (!k(e.lastPoint, n.firstPoint))
5419
+ if (!R(e.lastPoint, n.firstPoint))
5420
5420
  throw new Error(
5421
5421
  `${t} segments must be connected, but ${e.info} and ${n.info} are not`
5422
5422
  );
5423
5423
  }
5424
- ), Br(i, t);
5424
+ ), Vr(i, t);
5425
5425
  }
5426
- function Fn(i, t) {
5427
- return !!(i instanceof D && t instanceof D && sn(i.V, t.V) || i instanceof z && t instanceof z && k(i.center, t.center) && i.radius - t.radius < i.precision);
5426
+ function Bn(i, t) {
5427
+ return !!(i instanceof D && t instanceof D && rn(i.V, t.V) || i instanceof z && t instanceof z && R(i.center, t.center) && i.radius - t.radius < i.precision);
5428
5428
  }
5429
- function Ln(i, t) {
5429
+ function Vn(i, t) {
5430
5430
  if (i instanceof D && t instanceof D)
5431
5431
  return new D(i.firstPoint, t.lastPoint);
5432
5432
  if (i instanceof z && t instanceof z)
@@ -5438,7 +5438,7 @@ function Ln(i, t) {
5438
5438
  );
5439
5439
  throw new Error("Not implemented");
5440
5440
  }
5441
- function Si(i) {
5441
+ function Ri(i) {
5442
5442
  let t = !1;
5443
5443
  const e = [];
5444
5444
  for (const n of i.segments) {
@@ -5447,19 +5447,19 @@ function Si(i) {
5447
5447
  continue;
5448
5448
  }
5449
5449
  const s = e[e.length - 1];
5450
- Fn(s, n) ? (t = !0, e.pop(), e.push(Ln(s, n))) : e.push(n);
5450
+ Bn(s, n) ? (t = !0, e.pop(), e.push(Vn(s, n))) : e.push(n);
5451
5451
  }
5452
- if (k(i.firstPoint, i.lastPoint) && Fn(
5452
+ if (R(i.firstPoint, i.lastPoint) && Bn(
5453
5453
  e[0],
5454
5454
  e[e.length - 1]
5455
5455
  )) {
5456
5456
  t = !0;
5457
5457
  const n = e.pop();
5458
- e[0] = Ln(n, e[0]);
5458
+ e[0] = Vn(n, e[0]);
5459
5459
  }
5460
5460
  return t ? e : null;
5461
5461
  }
5462
- let Rt = class Ut extends Ai {
5462
+ let Rt = class Ut extends Si {
5463
5463
  constructor() {
5464
5464
  super(...arguments), ut(this, "strokeType", "STRAND");
5465
5465
  }
@@ -5474,12 +5474,12 @@ let Rt = class Ut extends Ai {
5474
5474
  );
5475
5475
  }
5476
5476
  extend(t) {
5477
- if (!k(this.lastPoint, t.firstPoint))
5477
+ if (!R(this.lastPoint, t.firstPoint))
5478
5478
  throw console.error(this.repr, t.repr), new Error("Cannot extend strand: connection point is not the same");
5479
5479
  return new Ut([...this.segments, ...t.segments]);
5480
5480
  }
5481
5481
  simplify() {
5482
- const t = Si(this);
5482
+ const t = Ri(this);
5483
5483
  return t ? new Ut(t, { ignoreChecks: !0 }) : this;
5484
5484
  }
5485
5485
  transform(t) {
@@ -5489,8 +5489,8 @@ let Rt = class Ut extends Ai {
5489
5489
  );
5490
5490
  }
5491
5491
  };
5492
- const Vr = (i, t) => {
5493
- const e = Ie(t, {
5492
+ const jr = (i, t) => {
5493
+ const e = _e(t, {
5494
5494
  V: [1, 0],
5495
5495
  firstPoint: i,
5496
5496
  precision: t.precision
@@ -5505,36 +5505,36 @@ const Vr = (i, t) => {
5505
5505
  }
5506
5506
  return 1;
5507
5507
  };
5508
- class cn {
5508
+ let fn = class {
5509
5509
  constructor(t) {
5510
5510
  ut(this, "_count", 0), ut(this, "segment"), this.segment = t;
5511
5511
  }
5512
5512
  update(t, e = !1) {
5513
- !e && !this.segment.isOnSegment(t) || (k(t, this.segment.firstPoint) ? this._count += this.segment.tangentAtFirstPoint[1] > 0 ? 1 : 0 : k(t, this.segment.lastPoint) ? this._count += this.segment.tangentAtLastPoint[1] > 0 ? 0 : 1 : this._count += 1);
5513
+ !e && !this.segment.isOnSegment(t) || (R(t, this.segment.firstPoint) ? this._count += this.segment.tangentAtFirstPoint[1] > 0 ? 1 : 0 : R(t, this.segment.lastPoint) ? this._count += this.segment.tangentAtLastPoint[1] > 0 ? 0 : 1 : this._count += 1);
5514
5514
  }
5515
5515
  get count() {
5516
5516
  return this._count;
5517
5517
  }
5518
- }
5519
- const jr = (i, t) => {
5518
+ };
5519
+ const qr = (i, t) => {
5520
5520
  const e = t.precision, n = Math.abs(i[1] - t.center[1]);
5521
5521
  if (n > t.radius + e) return 0;
5522
- const s = Ft(i, t.center), r = t.radius * t.radius, o = e * e;
5522
+ const s = _t(i, t.center), r = t.radius * t.radius, o = e * e;
5523
5523
  if (Math.abs(s - r) < o && t.isOnSegment(i))
5524
5524
  return 0;
5525
5525
  const a = s - r > o;
5526
5526
  if (a && t.center[0] < i[0]) return 0;
5527
5527
  const h = Math.sqrt(
5528
5528
  t.radius * t.radius - n * n
5529
- ), l = new cn(t);
5529
+ ), l = new fn(t);
5530
5530
  return l.update([t.center[0] + h, i[1]]), a && l.update([t.center[0] - h, i[1]]), l.count;
5531
- }, qr = (i, t) => {
5532
- const e = t.boundingBox.xMax + t.boundingBox.width / 2, n = new D(i, [e, i[1]]), s = new cn(t);
5533
- return We(n, t).forEach((r) => {
5531
+ }, Nr = (i, t) => {
5532
+ const e = t.boundingBox.xMax + t.boundingBox.width / 2, n = new D(i, [e, i[1]]), s = new fn(t);
5533
+ return He(n, t).forEach((r) => {
5534
5534
  s.update(r, !0);
5535
5535
  }), s.count;
5536
- }, Nr = (i, t) => {
5537
- const e = new cn(t);
5536
+ }, Or = (i, t) => {
5537
+ const e = new fn(t);
5538
5538
  return t.paramsAtY(i[1]).map((n) => {
5539
5539
  try {
5540
5540
  return t.paramPoint(n);
@@ -5548,20 +5548,20 @@ const jr = (i, t) => {
5548
5548
  e.update(n, !0);
5549
5549
  }), e.count;
5550
5550
  };
5551
- function Or(i, t) {
5551
+ function zr(i, t) {
5552
5552
  if (t instanceof D)
5553
- return Vr(i, t);
5554
- if (t instanceof z)
5555
5553
  return jr(i, t);
5556
- if (t instanceof at)
5554
+ if (t instanceof z)
5557
5555
  return qr(i, t);
5558
- if (t instanceof rt || t instanceof et)
5556
+ if (t instanceof at)
5559
5557
  return Nr(i, t);
5558
+ if (t instanceof rt || t instanceof et)
5559
+ return Or(i, t);
5560
5560
  throw new Error("Not implemented");
5561
5561
  }
5562
- class dt extends Ai {
5562
+ let Lt = class Jt extends Si {
5563
5563
  constructor(t, { ignoreChecks: e = !1 } = {}) {
5564
- super(t, { ignoreChecks: !0 }), ut(this, "strokeType", "LOOP"), ut(this, "_clockwise", null), e || zr(t);
5564
+ super(t, { ignoreChecks: !0 }), ut(this, "strokeType", "LOOP"), ut(this, "_clockwise", null), e || Dr(t);
5565
5565
  }
5566
5566
  get clockwise() {
5567
5567
  if (this._clockwise === null) {
@@ -5574,44 +5574,44 @@ class dt extends Ai {
5574
5574
  return this._clockwise;
5575
5575
  }
5576
5576
  clone() {
5577
- return new dt(
5577
+ return new Jt(
5578
5578
  this.segments.map((t) => t.clone()),
5579
5579
  { ignoreChecks: !0 }
5580
5580
  );
5581
5581
  }
5582
5582
  reverse() {
5583
5583
  const t = this.segments.map((e) => e.reverse());
5584
- return t.reverse(), new dt(t, { ignoreChecks: !0 });
5584
+ return t.reverse(), new Jt(t, { ignoreChecks: !0 });
5585
5585
  }
5586
5586
  transform(t) {
5587
- return new dt(
5587
+ return new Jt(
5588
5588
  this.segments.map((e) => e.transform(t)),
5589
5589
  { ignoreChecks: !0 }
5590
5590
  );
5591
5591
  }
5592
- contains(t) {
5593
- return this.onStroke(t) || !this.boundingBox.contains(t) ? !1 : this.segments.reduce((e, n) => e + Or(t, n), 0) % 2 === 1;
5592
+ contains(t, { strokeIsInside: e = !1 } = {}) {
5593
+ return this.onStroke(t) ? e : this.boundingBox.contains(t) ? this.segments.reduce((n, s) => n + zr(t, s), 0) % 2 === 1 : !1;
5594
5594
  }
5595
5595
  simplify() {
5596
- const t = Si(this);
5597
- return t ? new dt(t, { ignoreChecks: !0 }) : this;
5596
+ const t = Ri(this);
5597
+ return t ? new Jt(t, { ignoreChecks: !0 }) : this;
5598
5598
  }
5599
- }
5600
- function zr(i) {
5601
- if (Ei(i, "Loop"), !k(i[0].firstPoint, i[i.length - 1].lastPoint))
5599
+ };
5600
+ function Dr(i) {
5601
+ if (ki(i, "Loop"), !R(i[0].firstPoint, i[i.length - 1].lastPoint))
5602
5602
  throw new Error("Loop segment must be closed");
5603
5603
  }
5604
- const Dr = [
5604
+ const Ur = [
5605
5605
  D,
5606
5606
  z,
5607
5607
  at,
5608
5608
  et,
5609
5609
  rt
5610
5610
  ];
5611
- function ki(i) {
5612
- return Dr.some((t) => i instanceof t);
5611
+ function Ci(i) {
5612
+ return Ur.some((t) => i instanceof t);
5613
5613
  }
5614
- function Ri(i) {
5614
+ function Ti(i) {
5615
5615
  if (i instanceof D)
5616
5616
  return {
5617
5617
  type: i.segmentType,
@@ -5654,37 +5654,37 @@ function Ri(i) {
5654
5654
  };
5655
5655
  throw new Error("Unknown segment type");
5656
5656
  }
5657
- function Qe(i) {
5657
+ function Ge(i) {
5658
5658
  return {
5659
5659
  type: "LOOP",
5660
- segments: i.segments.map(Ri)
5660
+ segments: i.segments.map(Ti)
5661
5661
  };
5662
5662
  }
5663
- function Ci(i) {
5663
+ function Ii(i) {
5664
5664
  return {
5665
5665
  type: "FIGURE",
5666
- contour: Qe(i.contour),
5667
- holes: i.holes.map(Qe)
5666
+ contour: Ge(i.contour),
5667
+ holes: i.holes.map(Ge)
5668
5668
  };
5669
5669
  }
5670
- function Ur(i) {
5670
+ function Yr(i) {
5671
5671
  return {
5672
5672
  type: "DIAGRAM",
5673
- figures: i.figures.map(Ci)
5673
+ figures: i.figures.map(Ii)
5674
5674
  };
5675
5675
  }
5676
- function Bn(i) {
5677
- if (i instanceof ae)
5678
- return Ur(i);
5679
- if (i instanceof mt)
5680
- return Ci(i);
5676
+ function jn(i) {
5681
5677
  if (i instanceof dt)
5682
- return Qe(i);
5683
- if (ki(i))
5684
- return Ri(i);
5678
+ return Yr(i);
5679
+ if (i instanceof mt)
5680
+ return Ii(i);
5681
+ if (i instanceof Lt)
5682
+ return Ge(i);
5683
+ if (Ci(i))
5684
+ return Ti(i);
5685
5685
  throw new Error("Unknown shape type");
5686
5686
  }
5687
- class Yr {
5687
+ class Xr {
5688
5688
  constructor() {
5689
5689
  this.ids = [], this.values = [], this.length = 0;
5690
5690
  }
@@ -5730,8 +5730,8 @@ class Yr {
5730
5730
  this.ids.length = this.values.length = this.length;
5731
5731
  }
5732
5732
  }
5733
- const Vn = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], ze = 3;
5734
- let Xr = class Ti {
5733
+ const qn = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], De = 3;
5734
+ class mn {
5735
5735
  /**
5736
5736
  * Recreate a Flatbush index from raw `ArrayBuffer` or `SharedArrayBuffer` data.
5737
5737
  * @param {ArrayBuffer | SharedArrayBuffer} data
@@ -5747,13 +5747,13 @@ let Xr = class Ti {
5747
5747
  if (n !== 251)
5748
5748
  throw new Error("Data does not appear to be in a Flatbush format.");
5749
5749
  const r = s >> 4;
5750
- if (r !== ze)
5751
- throw new Error(`Got v${r} data when expected v${ze}.`);
5752
- const o = Vn[s & 15];
5750
+ if (r !== De)
5751
+ throw new Error(`Got v${r} data when expected v${De}.`);
5752
+ const o = qn[s & 15];
5753
5753
  if (!o)
5754
5754
  throw new Error("Unrecognized array type.");
5755
5755
  const [a] = new Uint16Array(t, e + 2, 1), [h] = new Uint32Array(t, e + 4, 1);
5756
- return new Ti(h, a, o, void 0, t, e);
5756
+ return new mn(h, a, o, void 0, t, e);
5757
5757
  }
5758
5758
  /**
5759
5759
  * Create a Flatbush index that will hold a given number of items.
@@ -5774,10 +5774,10 @@ let Xr = class Ti {
5774
5774
  a = Math.ceil(a / this.nodeSize), h += a, this._levelBounds.push(h * 4);
5775
5775
  while (a !== 1);
5776
5776
  this.ArrayType = n, this.IndexArrayType = h < 16384 ? Uint16Array : Uint32Array;
5777
- const l = Vn.indexOf(this.ArrayType), c = h * 4 * this.ArrayType.BYTES_PER_ELEMENT;
5777
+ const l = qn.indexOf(this.ArrayType), c = h * 4 * this.ArrayType.BYTES_PER_ELEMENT;
5778
5778
  if (l < 0)
5779
5779
  throw new Error(`Unexpected typed array class: ${n}.`);
5780
- r && r.byteLength !== void 0 && !r.buffer ? (this.data = r, this._boxes = new this.ArrayType(this.data, o + 8, h * 4), this._indices = new this.IndexArrayType(this.data, o + 8 + c, h), this._pos = h * 4, this.minX = this._boxes[this._pos - 4], this.minY = this._boxes[this._pos - 3], this.maxX = this._boxes[this._pos - 2], this.maxY = this._boxes[this._pos - 1]) : (this.data = new s(8 + c + h * this.IndexArrayType.BYTES_PER_ELEMENT), this._boxes = new this.ArrayType(this.data, 8, h * 4), this._indices = new this.IndexArrayType(this.data, 8 + c, h), this._pos = 0, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, new Uint8Array(this.data, 0, 2).set([251, (ze << 4) + l]), new Uint16Array(this.data, 2, 1)[0] = e, new Uint32Array(this.data, 4, 1)[0] = t), this._queue = new Yr();
5780
+ r && r.byteLength !== void 0 && !r.buffer ? (this.data = r, this._boxes = new this.ArrayType(this.data, o + 8, h * 4), this._indices = new this.IndexArrayType(this.data, o + 8 + c, h), this._pos = h * 4, this.minX = this._boxes[this._pos - 4], this.minY = this._boxes[this._pos - 3], this.maxX = this._boxes[this._pos - 2], this.maxY = this._boxes[this._pos - 1]) : (this.data = new s(8 + c + h * this.IndexArrayType.BYTES_PER_ELEMENT), this._boxes = new this.ArrayType(this.data, 8, h * 4), this._indices = new this.IndexArrayType(this.data, 8 + c, h), this._pos = 0, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = -1 / 0, this.maxY = -1 / 0, new Uint8Array(this.data, 0, 2).set([251, (De << 4) + l]), new Uint16Array(this.data, 2, 1)[0] = e, new Uint32Array(this.data, 4, 1)[0] = t), this._queue = new Xr();
5781
5781
  }
5782
5782
  /**
5783
5783
  * Add a given rectangle to the index.
@@ -5805,7 +5805,7 @@ let Xr = class Ti {
5805
5805
  const h = t[a++], l = t[a++], c = t[a++], u = t[a++], m = Math.floor(r * ((h + c) / 2 - this.minX) / e), w = Math.floor(r * ((l + u) / 2 - this.minY) / n);
5806
5806
  s[o] = Hr(m, w);
5807
5807
  }
5808
- Ge(s, t, this._indices, 0, this.numItems - 1, this.nodeSize);
5808
+ Je(s, t, this._indices, 0, this.numItems - 1, this.nodeSize);
5809
5809
  for (let o = 0, a = 0; o < this._levelBounds.length - 1; o++) {
5810
5810
  const h = this._levelBounds[o];
5811
5811
  for (; a < h; ) {
@@ -5832,7 +5832,7 @@ let Xr = class Ti {
5832
5832
  let o = this._boxes.length - 4;
5833
5833
  const a = [], h = [];
5834
5834
  for (; o !== void 0; ) {
5835
- const l = Math.min(o + this.nodeSize * 4, qn(o, this._levelBounds));
5835
+ const l = Math.min(o + this.nodeSize * 4, On(o, this._levelBounds));
5836
5836
  for (let c = o; c < l; c += 4) {
5837
5837
  if (n < this._boxes[c] || s < this._boxes[c + 1] || t > this._boxes[c + 2] || e > this._boxes[c + 3]) continue;
5838
5838
  const u = this._indices[c >> 2] | 0;
@@ -5857,9 +5857,9 @@ let Xr = class Ti {
5857
5857
  let o = this._boxes.length - 4;
5858
5858
  const a = this._queue, h = [], l = s * s;
5859
5859
  t: for (; o !== void 0; ) {
5860
- const c = Math.min(o + this.nodeSize * 4, qn(o, this._levelBounds));
5860
+ const c = Math.min(o + this.nodeSize * 4, On(o, this._levelBounds));
5861
5861
  for (let u = o; u < c; u += 4) {
5862
- const m = this._indices[u >> 2] | 0, w = jn(t, this._boxes[u], this._boxes[u + 2]), g = jn(e, this._boxes[u + 1], this._boxes[u + 3]), p = w * w + g * g;
5862
+ const m = this._indices[u >> 2] | 0, w = Nn(t, this._boxes[u], this._boxes[u + 2]), g = Nn(e, this._boxes[u + 1], this._boxes[u + 3]), p = w * w + g * g;
5863
5863
  p > l || (o >= this.numItems * 4 ? a.push(m << 1, p) : (r === void 0 || r(m)) && a.push((m << 1) + 1, p));
5864
5864
  }
5865
5865
  for (; a.length && a.peek() & 1; )
@@ -5868,11 +5868,11 @@ let Xr = class Ti {
5868
5868
  }
5869
5869
  return a.clear(), h;
5870
5870
  }
5871
- };
5872
- function jn(i, t, e) {
5871
+ }
5872
+ function Nn(i, t, e) {
5873
5873
  return i < t ? t - i : i <= e ? 0 : i - e;
5874
5874
  }
5875
- function qn(i, t) {
5875
+ function On(i, t) {
5876
5876
  let e = 0, n = t.length - 1;
5877
5877
  for (; e < n; ) {
5878
5878
  const s = e + n >> 1;
@@ -5880,7 +5880,7 @@ function qn(i, t) {
5880
5880
  }
5881
5881
  return t[e];
5882
5882
  }
5883
- function Ge(i, t, e, n, s, r) {
5883
+ function Je(i, t, e, n, s, r) {
5884
5884
  if (Math.floor(n / r) >= Math.floor(s / r)) return;
5885
5885
  const o = i[n + s >> 1];
5886
5886
  let a = n - 1, h = s + 1;
@@ -5894,7 +5894,7 @@ function Ge(i, t, e, n, s, r) {
5894
5894
  if (a >= h) break;
5895
5895
  Wr(i, t, e, a, h);
5896
5896
  }
5897
- Ge(i, t, e, n, h, r), Ge(i, t, e, h + 1, s, r);
5897
+ Je(i, t, e, n, h, r), Je(i, t, e, h + 1, s, r);
5898
5898
  }
5899
5899
  function Wr(i, t, e, n, s) {
5900
5900
  const r = i[n];
@@ -5913,7 +5913,7 @@ function Hr(i, t) {
5913
5913
  function $i(i, t = 1e-7) {
5914
5914
  if (i.length === 0) return [];
5915
5915
  if (i.length === 1) return [i];
5916
- const e = new Xr(i.length);
5916
+ const e = new mn(i.length);
5917
5917
  i.forEach((r) => {
5918
5918
  const [o, a] = r.firstPoint;
5919
5919
  e.add(o - t, a - t, o + t, a + t);
@@ -5947,7 +5947,7 @@ function $i(i, t = 1e-7) {
5947
5947
  }
5948
5948
  }), n;
5949
5949
  }
5950
- let mt = class Ee extends Lt {
5950
+ let mt = class Se extends Ft {
5951
5951
  constructor(t, e = [], { ignoreChecks: n = !1 } = {}) {
5952
5952
  super(), ut(this, "contour"), ut(this, "holes"), n || Qr(t, e), this.contour = t, this.holes = e;
5953
5953
  }
@@ -5961,19 +5961,19 @@ let mt = class Ee extends Lt {
5961
5961
  return [this.contour, ...this.holes];
5962
5962
  }
5963
5963
  clone() {
5964
- return new Ee(
5964
+ return new Se(
5965
5965
  this.contour.clone(),
5966
5966
  this.holes.map((t) => t.clone())
5967
5967
  );
5968
5968
  }
5969
5969
  transform(t) {
5970
- return new Ee(
5970
+ return new Se(
5971
5971
  this.contour.transform(t),
5972
5972
  this.holes.map((e) => e.transform(t))
5973
5973
  );
5974
5974
  }
5975
- contains(t) {
5976
- return this.contour.contains(t) && !this.holes.some((e) => e.contains(t));
5975
+ contains(t, { strokeIsInside: e = !1 } = {}) {
5976
+ return this.contour.contains(t, { strokeIsInside: e }) && !this.holes.some((n) => n.contains(t, { strokeIsInside: e }));
5977
5977
  }
5978
5978
  intersects(t) {
5979
5979
  return this.allLoops.some(
@@ -5981,24 +5981,45 @@ let mt = class Ee extends Lt {
5981
5981
  );
5982
5982
  }
5983
5983
  overlappingStrands(t) {
5984
- const e = t instanceof Ee ? t.allLoops : [t], n = this.allLoops.flatMap((s) => e.flatMap((r) => s.overlappingSegments(r)));
5984
+ const e = t instanceof Se ? t.allLoops : [t], n = this.allLoops.flatMap((s) => e.flatMap((r) => s.overlappingSegments(r)));
5985
5985
  return $i(n).map((s) => new Rt(s));
5986
5986
  }
5987
5987
  };
5988
5988
  function Qr(i, t = []) {
5989
5989
  if (!i) throw new Error("Figure must have a contour");
5990
- for (const [e, n] of He([i, ...t]))
5990
+ for (const [e, n] of Qe([i, ...t]))
5991
5991
  if (e.intersects(n))
5992
5992
  throw new Error("Loops in a figure must not intersect");
5993
5993
  if (t.some(
5994
5994
  (e) => !i.contains(e.firstPoint) && !i.onStroke(e.firstPoint)
5995
5995
  ))
5996
5996
  throw new Error("Holes must be inside the contour");
5997
- for (const [e, n] of He(t))
5997
+ for (const [e, n] of Qe(t))
5998
5998
  if (e.contains(n.firstPoint))
5999
- throw console.error(Bn(e), Bn(n)), new Error("Holes must not be inside other holes");
6000
- }
6001
- const Gr = (i) => {
5999
+ throw console.error(jn(e), jn(n)), new Error("Holes must not be inside other holes");
6000
+ }
6001
+ const xe = (i, t, e = 1e-7) => Math.abs(i - t) <= e, Gr = (i, t) => {
6002
+ const e = i.boundingBox, n = t.boundingBox;
6003
+ return xe(e.xMin, n.xMin) && xe(e.yMin, n.yMin) && xe(e.xMax, n.xMax) && xe(e.yMax, n.yMax);
6004
+ }, Jr = (i, t) => {
6005
+ if (i.segmentsCount !== t.segmentsCount || !Gr(i, t)) return !1;
6006
+ const e = i.segments, n = t.segments, s = e.length, r = (o, a) => {
6007
+ for (let h = 0; h < s; h += 1) {
6008
+ const l = (o + a * h + s) % s;
6009
+ if (!e[h].isSame(n[l])) return !1;
6010
+ }
6011
+ return !0;
6012
+ };
6013
+ for (let o = 0; o < s; o += 1)
6014
+ if (e[0].isSame(n[o]) && (r(o, 1) || r(o, -1)))
6015
+ return !0;
6016
+ return !1;
6017
+ }, Zr = (i) => {
6018
+ const t = [];
6019
+ return i.forEach((e) => {
6020
+ t.some((n) => Jr(e, n)) || t.push(e);
6021
+ }), t;
6022
+ }, Kr = (i) => {
6002
6023
  const t = i.map((s, r) => i.slice(r + 1).map((o, a) => [a + r + 1, o]).filter(([, o]) => s.boundingBox.overlaps(o.boundingBox)).map(([o]) => o)), e = [], n = Array(t.length);
6003
6024
  return t.forEach((s, r) => {
6004
6025
  let o = n[r];
@@ -6006,54 +6027,55 @@ const Gr = (i) => {
6006
6027
  n[a] = o;
6007
6028
  });
6008
6029
  }), e;
6009
- }, Ii = (i) => i.map((t, e) => {
6030
+ }, _i = (i) => i.map((t, e) => {
6010
6031
  const n = t.segments[0].midPoint, s = i.filter((r, o) => e === o ? !1 : r.contains(n));
6011
6032
  return {
6012
6033
  loop: t,
6013
6034
  isIn: s
6014
6035
  };
6015
- }), Jr = (i, t) => i.flatMap(({ loop: e }) => fn(
6036
+ }), to = (i, t) => i.flatMap(({ loop: e }) => gn(
6016
6037
  t.filter(
6017
6038
  ({ loop: n, isIn: s }) => n === e || s.indexOf(e) !== -1
6018
6039
  )
6019
- )), Zr = (i, t) => {
6020
- const e = t.filter(({ isIn: s }) => s.length <= 1), n = fn(
6021
- Ii(i.map(({ loop: s }) => s))
6040
+ )), eo = (i, t) => {
6041
+ const e = t.filter(({ isIn: s }) => s.length <= 1), n = gn(
6042
+ _i(i.map(({ loop: s }) => s))
6022
6043
  );
6023
6044
  return [e, ...n];
6024
- }, fn = (i) => {
6045
+ }, gn = (i) => {
6025
6046
  if (!i.length) return [];
6026
6047
  const t = i.filter(({ isIn: n }) => !n.length), e = i.filter(({ isIn: n }) => n.length > 1);
6027
- return t.length === 1 && e.length === 0 ? [i] : t.length > 1 ? Jr(t, i) : Zr(e, i);
6048
+ return t.length === 1 && e.length === 0 ? [i] : t.length > 1 ? to(t, i) : eo(e, i);
6028
6049
  };
6029
- function te(i) {
6030
- return Gr(i).map(Ii).flatMap(fn).map((t) => {
6031
- if (t.length === 1) return new mt(t[0].loop);
6032
- t.sort((s, r) => s.isIn.length - r.isIn.length);
6033
- const [e, ...n] = t.map(({ loop: s }) => s);
6034
- return new mt(e, n);
6050
+ function ee(i) {
6051
+ const t = Zr(i);
6052
+ return Kr(t).map(_i).flatMap(gn).map((e) => {
6053
+ if (e.length === 1) return new mt(e[0].loop);
6054
+ e.sort((r, o) => r.isIn.length - o.isIn.length);
6055
+ const [n, ...s] = e.map(({ loop: r }) => r);
6056
+ return new mt(n, s);
6035
6057
  });
6036
6058
  }
6037
- function Kr(i, t) {
6059
+ function no(i, t) {
6038
6060
  const e = [];
6039
6061
  for (const n of i)
6040
6062
  for (const s of t)
6041
6063
  e.push([n, s]);
6042
6064
  return e;
6043
6065
  }
6044
- function* Je(i, t, e) {
6045
- const n = (o) => t.some((a) => k(a, o.lastPoint)), s = (o) => e.some((a) => o.isSame(a));
6046
- let r = [];
6047
- for (const o of i)
6048
- n(o) ? (r.push(o), yield new Rt(r, { ignoreChecks: !0 }), r = []) : s(o) ? (r.length && (yield new Rt(r, { ignoreChecks: !0 }), r = []), yield new Rt([o], { ignoreChecks: !0 })) : r.push(o);
6049
- r.length && (yield new Rt(r, { ignoreChecks: !0 }));
6066
+ function* Ze(i, t, e) {
6067
+ const n = (a) => t.some((h) => R(h, a.lastPoint)), s = (a, h) => a.segmentType !== h.segmentType || !h.isOnSegment(a.firstPoint) || !h.isOnSegment(a.lastPoint) ? !1 : a.segmentType !== "LINE" ? h.isOnSegment(a.midPoint) : !0, r = (a) => e.some((h) => a.isSame(h) || s(a, h));
6068
+ let o = [];
6069
+ for (const a of i)
6070
+ n(a) ? (o.push(a), yield new Rt(o, { ignoreChecks: !0 }), o = []) : r(a) ? (o.length && (yield new Rt(o, { ignoreChecks: !0 }), o = []), yield new Rt([a], { ignoreChecks: !0 })) : o.push(a);
6071
+ o.length && (yield new Rt(o, { ignoreChecks: !0 }));
6050
6072
  }
6051
- const Nn = (i, t) => {
6052
- const e = i.findIndex((s) => k(t, s.firstPoint)), n = i.slice(0, e);
6073
+ const zn = (i, t) => {
6074
+ const e = i.findIndex((s) => R(t, s.firstPoint)), n = i.slice(0, e);
6053
6075
  return i.slice(e).concat(n);
6054
- }, On = (i, t) => {
6076
+ }, Dn = (i, t) => {
6055
6077
  let e = i;
6056
- const n = (o) => k(o.firstPoint, t.firstPoint) && k(o.lastPoint, t.lastPoint);
6078
+ const n = (o) => R(o.firstPoint, t.firstPoint) && R(o.lastPoint, t.lastPoint);
6057
6079
  let s = i.findIndex(n);
6058
6080
  if (s === -1) {
6059
6081
  const o = i.map((a) => a.reverse());
@@ -6067,162 +6089,200 @@ const Nn = (i, t) => {
6067
6089
  const r = e.slice(0, s);
6068
6090
  return e.slice(s).concat(r);
6069
6091
  };
6070
- function to(i, t, e) {
6092
+ function io(i, t, e) {
6071
6093
  return i.filter((n) => {
6072
- const s = t.filter((o) => k(o.firstPoint, n) || k(o.lastPoint, n));
6094
+ const s = t.filter((o) => R(o.firstPoint, n) || R(o.lastPoint, n));
6073
6095
  if (s.length % 2)
6074
6096
  throw new Error("Bug in the intersection algo on non crossing point");
6075
6097
  const r = s.map((o) => e.contains(o.midPoint));
6076
6098
  return !(r.every((o) => o) || !r.some((o) => o));
6077
6099
  });
6078
6100
  }
6079
- function eo(i, t, e) {
6080
- let n = [];
6081
- const s = [], r = new Array(i.segments.length).fill(0).map(() => []), o = new Array(t.segments.length).fill(0).map(() => []);
6082
- if (i.segments.forEach((m, w) => {
6083
- t.segments.forEach((g, p) => {
6084
- const { intersections: M, overlaps: f } = ie(
6085
- m,
6086
- g,
6101
+ function so(i, t, e, n = !1) {
6102
+ let s = [];
6103
+ const r = [], o = new Array(i.segments.length).fill(0).map(() => []), a = new Array(t.segments.length).fill(0).map(() => []);
6104
+ if (i.segments.forEach((w, g) => {
6105
+ t.segments.forEach((p, M) => {
6106
+ const { intersections: f, overlaps: P } = se(
6107
+ w,
6108
+ p,
6087
6109
  e
6088
6110
  );
6089
- n.push(...M), r[w].push(...M), o[p].push(...M), s.push(...f);
6090
- const P = f.flatMap((b) => [
6091
- b.firstPoint,
6092
- b.lastPoint
6111
+ s.push(...f), o[g].push(...f), a[M].push(...f), r.push(...P);
6112
+ const b = P.flatMap((S) => [
6113
+ S.firstPoint,
6114
+ S.lastPoint
6093
6115
  ]);
6094
- n.push(...P), r[w].push(...P), o[p].push(...P);
6116
+ s.push(...b), o[g].push(...b), a[M].push(...b);
6095
6117
  });
6096
- }), n = At(n, e), !n.length || n.length === 1) return null;
6097
- const a = ([m, w]) => w.length ? m.splitAt(w) : [m];
6098
- let h = Pt([i.segments, r]).flatMap(a), l = Pt([t.segments, o]).flatMap(a);
6099
- if (n = to(
6100
- n,
6101
- h,
6118
+ }), s = At(s, e), !s.length || s.length === 1) return null;
6119
+ const h = ([w, g]) => g.length ? w.splitAt(g) : [w];
6120
+ let l = Pt([i.segments, o]).flatMap(h), c = Pt([t.segments, a]).flatMap(h);
6121
+ if (s = io(
6122
+ s,
6123
+ l,
6102
6124
  t
6103
- ), !n.length && !s.length) return null;
6104
- if (s.length) {
6105
- const m = s[0];
6106
- h = On(
6107
- h,
6108
- m
6109
- ), l = On(
6125
+ ), !s.length && !r.length) return null;
6126
+ if (r.length) {
6127
+ const w = r[0];
6128
+ l = Dn(
6110
6129
  l,
6111
- m
6130
+ w
6131
+ ), c = Dn(
6132
+ c,
6133
+ w
6112
6134
  );
6113
6135
  } else {
6114
- const m = n[0];
6115
- h = Nn(h, m), l = Nn(l, m);
6136
+ const w = s[0];
6137
+ l = zn(l, w), c = zn(c, w);
6116
6138
  }
6117
- let c = Array.from(
6118
- Je(
6119
- h,
6120
- n,
6121
- s
6122
- )
6123
- ), u = Array.from(
6124
- Je(
6139
+ let u = Array.from(
6140
+ Ze(
6125
6141
  l,
6126
- n,
6127
- s
6142
+ s,
6143
+ r
6144
+ )
6145
+ ), m = Array.from(
6146
+ Ze(
6147
+ c,
6148
+ s,
6149
+ r
6128
6150
  )
6129
6151
  );
6130
- return (!k(
6131
- u[0].lastPoint,
6132
- c[0].lastPoint
6133
- ) || s.length > 0 && u[0].segmentsCount !== 1) && (u = u.map((m) => m.reverse()).reverse(), k(u[0].lastPoint, c[0].lastPoint) || (c = c.map((m) => m.reverse()).reverse())), Pt([c, u]).map(([m, w]) => m.segmentsCount === 1 && s.some((g) => m.segments[0].isSame(g)) ? [m, "same"] : [m, w]);
6152
+ return (!R(
6153
+ m[0].lastPoint,
6154
+ u[0].lastPoint
6155
+ ) || r.length > 0 && m[0].segmentsCount !== 1) && (m = m.map((w) => w.reverse()).reverse(), R(m[0].lastPoint, u[0].lastPoint) || (u = u.map((w) => w.reverse()).reverse())), Pt([u, m]).map(([w, g]) => {
6156
+ if (n) {
6157
+ if (((p) => p.segments.every(
6158
+ (M) => r.some(
6159
+ (f) => M.isSame(f) || M.segmentType === f.segmentType && f.isOnSegment(M.firstPoint) && f.isOnSegment(M.lastPoint) && (M.segmentType === "LINE" || f.isOnSegment(M.midPoint))
6160
+ )
6161
+ ))(w))
6162
+ return [w, "same"];
6163
+ } else if (w.segmentsCount === 1 && r.some((p) => w.segments[0].isSame(p)))
6164
+ return [w, "same"];
6165
+ return [w, g];
6166
+ });
6134
6167
  }
6135
- function zn(i) {
6168
+ function Un(i) {
6136
6169
  let t = i[0];
6137
6170
  for (const e of i.slice(1))
6138
6171
  t = t.extend(e);
6139
- if (!k(t.firstPoint, t.lastPoint))
6172
+ if (!R(t.firstPoint, t.lastPoint))
6140
6173
  throw console.error(
6141
6174
  it(t.firstPoint),
6142
6175
  it(t.lastPoint)
6143
6176
  ), new Error("Bug in the intersection algo on non closing strand");
6144
- return new dt(t.segments);
6177
+ return new Lt(t.segments);
6145
6178
  }
6146
- function no(i, t) {
6179
+ function ro(i, t) {
6147
6180
  const e = Pt([
6148
6181
  t.slice(0, -1),
6149
6182
  t.slice(1)
6150
- ]).map(([s, r]) => zn(i.slice(s, r)));
6183
+ ]).map(([s, r]) => Un(i.slice(s, r)));
6151
6184
  let n = i.slice(
6152
6185
  t[t.length - 1]
6153
6186
  );
6154
- return t[0] !== 0 && (n = n.concat(i.slice(0, t[0]))), e.push(zn(n)), e;
6187
+ return t[0] !== 0 && (n = n.concat(i.slice(0, t[0]))), e.push(Un(n)), e;
6155
6188
  }
6156
- function io(i) {
6189
+ function oo(i) {
6157
6190
  if (!i.length) return [];
6158
6191
  const t = i.map((s) => s.firstPoint);
6159
6192
  let e = i.map((s) => s.lastPoint);
6160
6193
  e = e.slice(-1).concat(e.slice(0, -1));
6161
6194
  const n = Pt([t, e]).flatMap(
6162
- ([s, r], o) => k(s, r) ? [] : o
6195
+ ([s, r], o) => R(s, r) ? [] : o
6163
6196
  );
6164
6197
  try {
6165
- return no(i, n);
6198
+ return ro(i, n);
6166
6199
  } catch {
6167
- return $i(i.flatMap((s) => s.segments)).filter((s) => s.length > 1).filter((s) => k(s[0].firstPoint, s.at(-1).lastPoint)).map((s) => new dt(s));
6200
+ return $i(i.flatMap((s) => s.segments)).filter((s) => s.length > 1).filter((s) => R(s[0].firstPoint, s.at(-1).lastPoint)).map((s) => new Lt(s));
6168
6201
  }
6169
6202
  }
6170
- const Dn = (i, t) => {
6203
+ const Yn = (i, t) => {
6171
6204
  if (i.length === 0) return [t];
6172
6205
  const e = i.at(-1);
6173
- return k(e.lastPoint, t.firstPoint) ? i.slice(0, -1).concat([e.extend(t)]) : k(e.lastPoint, t.lastPoint) ? i.slice(0, -1).concat([e.extend(t.reverse())]) : i.concat([t]);
6174
- }, so = (i, t) => i.length === 0 ? [t] : k(i[0].firstPoint, t.lastPoint) ? [t.extend(i[0])].concat(i.slice(1)) : [t].concat(i);
6175
- function mn(i, t, {
6206
+ return R(e.lastPoint, t.firstPoint) ? i.slice(0, -1).concat([e.extend(t)]) : R(e.lastPoint, t.lastPoint) ? i.slice(0, -1).concat([e.extend(t.reverse())]) : i.concat([t]);
6207
+ }, ao = (i, t) => i.length === 0 ? [t] : R(i[0].firstPoint, t.lastPoint) ? [t.extend(i[0])].concat(i.slice(1)) : [t].concat(i);
6208
+ function pn(i, t, {
6176
6209
  firstInside: e,
6177
- secondInside: n
6210
+ secondInside: n,
6211
+ firstBoundaryInside: s = !1,
6212
+ secondBoundaryInside: r = !1
6178
6213
  }) {
6179
- const s = eo(i, t);
6180
- if (!s) {
6181
- const h = i.segments[0].midPoint, l = t.contains(h), c = t.segments[0].midPoint, u = i.contains(c);
6214
+ const o = so(
6215
+ i,
6216
+ t,
6217
+ void 0,
6218
+ s || r
6219
+ );
6220
+ if (!o) {
6221
+ const c = i.segments[0].midPoint, u = t.contains(c, {
6222
+ strokeIsInside: r
6223
+ }), m = t.segments[0].midPoint, w = i.contains(m, {
6224
+ strokeIsInside: s
6225
+ });
6182
6226
  return {
6183
6227
  identical: !1,
6184
- firstCurveInSecond: l,
6185
- secondCurveInFirst: u
6228
+ firstCurveInSecond: u,
6229
+ secondCurveInFirst: w
6186
6230
  };
6187
6231
  }
6188
- if (s.every(([, h]) => h === "same"))
6232
+ if (o.every(([, c]) => c === "same"))
6189
6233
  return { identical: !0 };
6190
- let r = null, o = null;
6191
- const a = s.flatMap(([h, l]) => {
6192
- let c = [], u = 0;
6193
- if (l === "same")
6194
- return o === 1 ? (o = 1, h) : o === 2 || o === 0 ? (o = null, []) : o === null ? (r ? r = r.extend(h) : r = h, []) : (console.error("weird situation"), []);
6195
- const m = h.segments[0].midPoint, w = t.contains(m);
6196
- (e === "keep" && w || e === "remove" && !w) && (u += 1, c = Dn(c, h));
6197
- const g = l.segments[0].midPoint, p = i.contains(g);
6198
- if (n === "keep" && p || n === "remove" && !p) {
6199
- const M = l;
6200
- u += 1, u === 2 && c.length ? (c = Dn(c, M), r = null) : c = [M];
6234
+ let a = null, h = null;
6235
+ const l = o.flatMap(([c, u]) => {
6236
+ let m = [], w = 0;
6237
+ if (u === "same")
6238
+ return h === 1 ? (h = 1, c) : h === 2 || h === 0 ? (h = null, []) : h === null ? (a ? a = a.extend(c) : a = c, []) : (console.error("weird situation"), []);
6239
+ const g = c.segments[0].midPoint, p = t.contains(g, {
6240
+ strokeIsInside: r
6241
+ });
6242
+ (e === "keep" && p || e === "remove" && !p) && (w += 1, m = Yn(m, c));
6243
+ const M = u.segments[0].midPoint, f = i.contains(M, {
6244
+ strokeIsInside: s
6245
+ });
6246
+ if (n === "keep" && f || n === "remove" && !f) {
6247
+ const P = u;
6248
+ w += 1, w === 2 && m.length ? (m = Yn(m, P), a = null) : m = [P];
6201
6249
  }
6202
- return o === null && u === 1 && r && (c = so(c, r)), u === 1 && (o = u, r = null), c.length ? c : (r = null, []);
6250
+ return h === null && w === 1 && a && (m = ao(m, a)), w === 1 && (h = w, a = null), m.length ? m : (a = null, []);
6203
6251
  });
6204
- return io(a);
6252
+ return oo(l);
6205
6253
  }
6206
- const ro = (i, t) => {
6207
- const e = mn(i, t, {
6254
+ const ho = (i, t, e) => {
6255
+ const n = pn(i, t, {
6208
6256
  firstInside: "remove",
6209
- secondInside: "remove"
6257
+ secondInside: "remove",
6258
+ ...e
6210
6259
  });
6211
- return Array.isArray(e) ? e : e.identical ? [i] : e.firstCurveInSecond ? [t] : e.secondCurveInFirst ? [i] : [i, t];
6212
- }, Ce = (i, t) => {
6213
- const e = mn(i, t, {
6260
+ return Array.isArray(n) ? n : n.identical ? [i] : n.firstCurveInSecond ? [t] : n.secondCurveInFirst ? [i] : [i, t];
6261
+ }, Te = (i, t, e) => {
6262
+ const n = pn(i, t, {
6214
6263
  firstInside: "remove",
6215
- secondInside: "keep"
6264
+ secondInside: "keep",
6265
+ ...e
6216
6266
  });
6217
- return Array.isArray(e) ? e : e.identical ? [] : e.firstCurveInSecond ? [] : e.secondCurveInFirst ? [i, t] : [i];
6218
- }, gn = (i, t) => {
6219
- const e = mn(i, t, {
6267
+ return Array.isArray(n) ? n : n.identical ? [] : n.firstCurveInSecond ? [] : n.secondCurveInFirst ? [i, t] : [i];
6268
+ }, wn = (i, t, e) => {
6269
+ const n = (e == null ? void 0 : e.firstBoundaryInside) ?? !1, s = (e == null ? void 0 : e.secondBoundaryInside) ?? !1, r = n || s, o = (h, l, c) => h.segments.every(
6270
+ (u) => l.contains(u.midPoint, { strokeIsInside: c })
6271
+ );
6272
+ if (r) {
6273
+ if (o(i, t, s))
6274
+ return [i];
6275
+ if (o(t, i, n))
6276
+ return [t];
6277
+ }
6278
+ const a = pn(i, t, {
6220
6279
  firstInside: "keep",
6221
- secondInside: "keep"
6280
+ secondInside: "keep",
6281
+ ...e
6222
6282
  });
6223
- return Array.isArray(e) ? e : e.identical ? [i] : e.firstCurveInSecond ? [i] : e.secondCurveInFirst ? [t] : [];
6283
+ return Array.isArray(a) ? a : a.identical ? [i] : a.firstCurveInSecond ? [i] : a.secondCurveInFirst ? [t] : [];
6224
6284
  };
6225
- function oo(i) {
6285
+ function lo(i) {
6226
6286
  const t = /* @__PURE__ */ new Map(), e = [];
6227
6287
  return i.forEach((n, s) => {
6228
6288
  let r;
@@ -6234,50 +6294,50 @@ function oo(i) {
6234
6294
  (w) => c.some((g) => w.intersects(g))
6235
6295
  )) return;
6236
6296
  let m;
6237
- h.length > 1 || c.length > 1 ? m = se(h, c) : m = _i(h[0], c[0]), r.fusedWith.add(l), r.current = m, u || t.set(l, r);
6297
+ h.length > 1 || c.length > 1 ? m = re(h, c) : m = Fi(h[0], c[0]), r.fusedWith.add(l), r.current = m, u || t.set(l, r);
6238
6298
  });
6239
6299
  }), e.flatMap(({ current: n }) => n);
6240
6300
  }
6241
- function _i(i, t) {
6242
- const e = ro(i.contour, t.contour), n = t.holes.flatMap((o) => Ce(o, i.contour)), s = i.holes.flatMap((o) => Ce(o, t.contour)), r = Kr(i.holes, t.holes).flatMap(
6243
- ([o, a]) => gn(o, a)
6301
+ function Fi(i, t) {
6302
+ const e = ho(i.contour, t.contour), n = t.holes.flatMap((o) => Te(o, i.contour)), s = i.holes.flatMap((o) => Te(o, t.contour)), r = no(i.holes, t.holes).flatMap(
6303
+ ([o, a]) => wn(o, a)
6244
6304
  );
6245
- return te([
6305
+ return ee([
6246
6306
  ...e,
6247
6307
  ...n,
6248
6308
  ...s,
6249
6309
  ...r
6250
6310
  ]);
6251
6311
  }
6252
- function Te(i, t) {
6312
+ function Ie(i, t) {
6253
6313
  if (i.isFull && t.isFull)
6254
- return te(Ce(i.contour, t.contour));
6314
+ return ee(Te(i.contour, t.contour));
6255
6315
  if (i.isFull) {
6256
- const n = Ce(i.contour, t.contour), s = t.holes.flatMap(
6257
- (r) => gn(r, i.contour)
6316
+ const n = Te(i.contour, t.contour), s = t.holes.flatMap(
6317
+ (r) => wn(r, i.contour, { firstBoundaryInside: !0 })
6258
6318
  );
6259
- return te([...n, ...s]);
6319
+ return ee([...n, ...s]);
6260
6320
  } else if (t.isFull && !i.contour.intersects(t.contour))
6261
6321
  if (i.contour.contains(t.contour.firstPoint)) {
6262
- const n = se(
6322
+ const n = re(
6263
6323
  i.holes.map((s) => new mt(s)),
6264
6324
  [t]
6265
6325
  );
6266
- return te([
6326
+ return ee([
6267
6327
  i.contour,
6268
6328
  ...n.flatMap((s) => s.allLoops)
6269
6329
  ]);
6270
6330
  } else
6271
6331
  return [i];
6272
- let e = Te(new mt(i.contour), t);
6332
+ let e = Ie(new mt(i.contour), t);
6273
6333
  return i.holes.forEach((n) => {
6274
- e = e.flatMap((s) => Te(s, new mt(n)));
6334
+ e = e.flatMap((s) => Ie(s, new mt(n)));
6275
6335
  }), e;
6276
6336
  }
6277
- function ao(i, t) {
6278
- const e = gn(i.contour, t.contour);
6337
+ function uo(i, t) {
6338
+ const e = wn(i.contour, t.contour);
6279
6339
  if (!e.length) return [];
6280
- let n = te(e);
6340
+ let n = ee(e);
6281
6341
  return n = Xt(
6282
6342
  n,
6283
6343
  i.holes.map((s) => new mt(s))
@@ -6286,43 +6346,43 @@ function ao(i, t) {
6286
6346
  t.holes.map((s) => new mt(s))
6287
6347
  );
6288
6348
  }
6289
- function se(i, t) {
6349
+ function re(i, t) {
6290
6350
  if (!i.length) return t;
6291
6351
  if (!t.length) return i;
6292
6352
  if (i.length === 1 && t.length > 1 || t.length === 1 && i.length > 1)
6293
- return oo([...i, ...t]);
6353
+ return lo([...i, ...t]);
6294
6354
  if (i.length > 1 && t.length > 1) {
6295
- let e = se([i[0]], t);
6355
+ let e = re([i[0]], t);
6296
6356
  return i.slice(1).forEach((n) => {
6297
- e = se([n], e);
6357
+ e = re([n], e);
6298
6358
  }), e;
6299
6359
  }
6300
- return i.length === 1 && t.length === 1 ? _i(i[0], t[0]) : [];
6360
+ return i.length === 1 && t.length === 1 ? Fi(i[0], t[0]) : [];
6301
6361
  }
6302
6362
  function Xt(i, t) {
6303
6363
  if (!i.length) return [];
6304
6364
  if (!t.length) return i;
6305
6365
  if (i.length === 1 && t.length === 1)
6306
- return Te(i[0], t[0]);
6366
+ return Ie(i[0], t[0]);
6307
6367
  if (i.length > 1)
6308
6368
  return i.flatMap((n) => Xt([n], t));
6309
- let e = Te(i[0], t[0]);
6369
+ let e = Ie(i[0], t[0]);
6310
6370
  return t.slice(1).forEach((n) => {
6311
6371
  e = Xt(e, [n]);
6312
6372
  }), e;
6313
6373
  }
6314
- function Ze(i, t) {
6315
- return !i.length || !t.length ? [] : i.length === 1 && t.length === 1 ? ao(i[0], t[0]) : i.length > 1 ? i.flatMap((e) => Ze([e], t)) : t.flatMap((e) => Ze(i, [e]));
6374
+ function Ke(i, t) {
6375
+ return !i.length || !t.length ? [] : i.length === 1 && t.length === 1 ? uo(i[0], t[0]) : i.length > 1 ? i.flatMap((e) => Ke([e], t)) : t.flatMap((e) => Ke(i, [e]));
6316
6376
  }
6317
- let ae = class Tt extends Lt {
6377
+ class dt extends Ft {
6318
6378
  constructor(t = [], { ignoreChecks: e = !1 } = {}) {
6319
- super(), ut(this, "figures"), ut(this, "_boundingBox", null), e || ho(t), this.figures = t;
6379
+ super(), ut(this, "figures"), ut(this, "_boundingBox", null), e || co(t), this.figures = t;
6320
6380
  }
6321
6381
  get isEmpty() {
6322
6382
  return this.figures.length === 0;
6323
6383
  }
6324
6384
  get boundingBox() {
6325
- if (this.isEmpty) return new re();
6385
+ if (this.isEmpty) return new oe();
6326
6386
  if (this._boundingBox === null) {
6327
6387
  let t = this.figures[0].boundingBox;
6328
6388
  for (const e of this.figures.slice(1))
@@ -6332,13 +6392,15 @@ let ae = class Tt extends Lt {
6332
6392
  return this._boundingBox;
6333
6393
  }
6334
6394
  clone() {
6335
- return new Tt(this.figures.map((t) => t.clone()));
6395
+ return new dt(this.figures.map((t) => t.clone()));
6336
6396
  }
6337
6397
  transform(t) {
6338
- return new Tt(this.figures.map((e) => e.transform(t)));
6398
+ return new dt(this.figures.map((e) => e.transform(t)));
6339
6399
  }
6340
- contains(t) {
6341
- return this.figures.some((e) => e.contains(t));
6400
+ contains(t, { strokeIsInside: e = !1 } = {}) {
6401
+ return this.figures.some(
6402
+ (n) => n.contains(t, { strokeIsInside: e })
6403
+ );
6342
6404
  }
6343
6405
  intersects(t) {
6344
6406
  return this.figures.some(
@@ -6346,27 +6408,27 @@ let ae = class Tt extends Lt {
6346
6408
  );
6347
6409
  }
6348
6410
  overlappingStrands(t) {
6349
- return this.figures.flatMap((e) => t instanceof Tt ? t.figures.flatMap(
6411
+ return this.figures.flatMap((e) => t instanceof dt ? t.figures.flatMap(
6350
6412
  (n) => e.overlappingStrands(n)
6351
6413
  ) : e.overlappingStrands(t));
6352
6414
  }
6353
6415
  fuse(t) {
6354
- return new Tt(se(this.figures, t.figures));
6416
+ return new dt(re(this.figures, t.figures));
6355
6417
  }
6356
6418
  cut(t) {
6357
- return new Tt(Xt(this.figures, t.figures));
6419
+ return new dt(Xt(this.figures, t.figures));
6358
6420
  }
6359
6421
  intersect(t) {
6360
- return new Tt(Ze(this.figures, t.figures));
6422
+ return new dt(Ke(this.figures, t.figures));
6361
6423
  }
6362
- };
6363
- function ho(i) {
6364
- for (const [t, e] of He(i))
6424
+ }
6425
+ function co(i) {
6426
+ for (const [t, e] of Qe(i))
6365
6427
  if (t.intersects(e))
6366
6428
  throw new Error("Diagram figures must not intersect");
6367
6429
  }
6368
- var lo = Object.defineProperty, uo = (i, t, e) => t in i ? lo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, xe = (i, t, e) => uo(i, typeof t != "symbol" ? t + "" : t, e);
6369
- const Fi = (i, t, e) => {
6430
+ var fo = Object.defineProperty, mo = (i, t, e) => t in i ? fo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, ve = (i, t, e) => mo(i, typeof t != "symbol" ? t + "" : t, e);
6431
+ const Li = (i, t, e) => {
6370
6432
  const n = bt(i.V, t.V), s = i.precision * t.precision;
6371
6433
  if (n * n < s)
6372
6434
  return "parallel";
@@ -6378,23 +6440,23 @@ class $e {
6378
6440
  this.firstPoint = t, this.lastPoint = e;
6379
6441
  }
6380
6442
  }
6381
- function Un(i, t) {
6443
+ function Xn(i, t) {
6382
6444
  if (i instanceof D)
6383
- return co(i, t);
6445
+ return go(i, t);
6384
6446
  if (i instanceof z)
6385
- return fo(i, t);
6447
+ return po(i, t);
6386
6448
  if (i instanceof et || i instanceof rt)
6387
- return mo(i, t);
6449
+ return wo(i, t);
6388
6450
  throw new Error("Not implemented");
6389
6451
  }
6390
- function co(i, t) {
6452
+ function go(i, t) {
6391
6453
  const { firstPoint: e, lastPoint: n } = i, s = i.normalVector;
6392
6454
  return new D(
6393
6455
  X(e, Q(s, t)),
6394
6456
  X(n, Q(s, t))
6395
6457
  );
6396
6458
  }
6397
- function fo(i, t) {
6459
+ function po(i, t) {
6398
6460
  const e = X(
6399
6461
  i.firstPoint,
6400
6462
  Q(nt(i.tangentAtFirstPoint), t)
@@ -6404,8 +6466,8 @@ function fo(i, t) {
6404
6466
  ), s = t * (i.clockwise ? 1 : -1);
6405
6467
  return i.radius + s < i.precision ? new $e(e, n) : new z(e, n, i.center, i.clockwise);
6406
6468
  }
6407
- function De(i, t, e, n, s) {
6408
- const r = Fi(
6469
+ function Ue(i, t, e, n, s) {
6470
+ const r = Li(
6409
6471
  {
6410
6472
  V: e,
6411
6473
  firstPoint: n,
@@ -6423,8 +6485,8 @@ function De(i, t, e, n, s) {
6423
6485
  );
6424
6486
  return r;
6425
6487
  }
6426
- function mo(i, t) {
6427
- const { firstPoint: e, lastPoint: n, normalAtFirstPoint: s, normalAtLastPoint: r } = i, o = Fi(
6488
+ function wo(i, t) {
6489
+ const { firstPoint: e, lastPoint: n, normalAtFirstPoint: s, normalAtLastPoint: r } = i, o = Li(
6428
6490
  { V: s, firstPoint: e, precision: i.precision },
6429
6491
  { V: r, firstPoint: n, precision: i.precision }
6430
6492
  ), a = X(
@@ -6436,13 +6498,13 @@ function mo(i, t) {
6436
6498
  );
6437
6499
  if (o === "parallel")
6438
6500
  throw new Error("Parallel lines not expected in safe bezier offset");
6439
- if (Se(q(o, e), s) * t > 0 && Math.min(
6501
+ if (ke(q(o, e), s) * t > 0 && Math.min(
6440
6502
  J(e, o),
6441
6503
  J(n, o)
6442
6504
  ) < t)
6443
6505
  return new $e(a, h);
6444
6506
  if (i instanceof et) {
6445
- const u = De(
6507
+ const u = Ue(
6446
6508
  o,
6447
6509
  i.controlPoint,
6448
6510
  i.tangentAtFirstPoint,
@@ -6455,13 +6517,13 @@ function mo(i, t) {
6455
6517
  u
6456
6518
  );
6457
6519
  }
6458
- const l = De(
6520
+ const l = Ue(
6459
6521
  o,
6460
6522
  i.firstControlPoint,
6461
6523
  i.tangentAtFirstPoint,
6462
6524
  a,
6463
6525
  i.precision
6464
- ), c = De(
6526
+ ), c = Ue(
6465
6527
  o,
6466
6528
  i.lastControlPoint,
6467
6529
  i.tangentAtLastPoint,
@@ -6475,31 +6537,31 @@ function mo(i, t) {
6475
6537
  c
6476
6538
  );
6477
6539
  }
6478
- function Li(i, t, e) {
6540
+ function Bi(i, t, e) {
6479
6541
  const n = bt(
6480
6542
  i.tangentAtLastPoint,
6481
6543
  t.tangentAtFirstPoint
6482
6544
  );
6483
6545
  if (Math.abs(n) < 1e-10) return null;
6484
- const s = n > 0 ? 1 : -1, r = Math.abs(e) * s, o = Un(i, r), a = Un(t, r);
6546
+ const s = n > 0 ? 1 : -1, r = Math.abs(e) * s, o = Xn(i, r), a = Xn(t, r);
6485
6547
  if (o instanceof $e || a instanceof $e)
6486
6548
  return null;
6487
6549
  let h;
6488
6550
  try {
6489
- h = Lr(o, a, 1e-9).at(-1);
6551
+ h = Br(o, a, 1e-9).at(-1);
6490
6552
  } catch {
6491
6553
  return null;
6492
6554
  }
6493
6555
  if (!h)
6494
6556
  return null;
6495
6557
  const l = h, c = (w, g) => {
6496
- const p = g.tangentAt(l), M = Zt(p), f = X(l, Q(M, r));
6558
+ const p = g.tangentAt(l), M = Kt(p), f = X(l, Q(M, r));
6497
6559
  return w.splitAt(f);
6498
6560
  }, [u] = c(i, o), [, m] = c(t, a);
6499
6561
  return { first: u, second: m, center: l };
6500
6562
  }
6501
- function Yn(i, t, e) {
6502
- const n = Li(i, t, e);
6563
+ function Wn(i, t, e) {
6564
+ const n = Bi(i, t, e);
6503
6565
  if (!n)
6504
6566
  return console.warn(
6505
6567
  "Cannot fillet between segments",
@@ -6509,12 +6571,12 @@ function Yn(i, t, e) {
6509
6571
  const { first: s, second: r } = n;
6510
6572
  return [
6511
6573
  s,
6512
- ai(s.lastPoint, r.firstPoint, s.tangentAtLastPoint),
6574
+ li(s.lastPoint, r.firstPoint, s.tangentAtLastPoint),
6513
6575
  r
6514
6576
  ];
6515
6577
  }
6516
- function Xn(i, t, e) {
6517
- const n = Li(i, t, e);
6578
+ function Hn(i, t, e) {
6579
+ const n = Bi(i, t, e);
6518
6580
  if (!n)
6519
6581
  return console.warn(
6520
6582
  "Cannot chamfer between segments",
@@ -6524,7 +6586,7 @@ function Xn(i, t, e) {
6524
6586
  const { first: s, second: r } = n;
6525
6587
  return [s, new D(s.lastPoint, r.firstPoint), r];
6526
6588
  }
6527
- const go = (i) => {
6589
+ const Po = (i) => {
6528
6590
  let t;
6529
6591
  i ? typeof i == "number" || Array.isArray(i) && i.length === 2 ? t = { endTangent: i } : t = { endTangent: 0, ...i } : t = { endTangent: [1, 0] };
6530
6592
  const {
@@ -6534,16 +6596,16 @@ const go = (i) => {
6534
6596
  startTangent: r
6535
6597
  } = t;
6536
6598
  let o;
6537
- typeof e == "number" ? o = vt(1, e * _t) : o = e;
6599
+ typeof e == "number" ? o = vt(1, e * $t) : o = e;
6538
6600
  let a;
6539
- return typeof r == "number" ? a = vt(1, r * _t) : a = r, { endTangent: o, startFactor: n, endFactor: s, startTangent: a };
6601
+ return typeof r == "number" ? a = vt(1, r * $t) : a = r, { endTangent: o, startFactor: n, endFactor: s, startTangent: a };
6540
6602
  };
6541
- function Wn(i, { ignoreChecks: t = !1 } = {}) {
6542
- return new ae([new mt(new dt([...i], { ignoreChecks: t }))]);
6603
+ function Qn(i, { ignoreChecks: t = !1 } = {}) {
6604
+ return new dt([new mt(new Lt([...i], { ignoreChecks: t }))]);
6543
6605
  }
6544
- let po = class {
6606
+ let Mo = class {
6545
6607
  constructor(t = [0, 0]) {
6546
- xe(this, "pointer"), xe(this, "firstPoint"), xe(this, "pendingSegments"), xe(this, "_nextCorner"), this.pointer = t, this.firstPoint = t, this.pendingSegments = [], this._nextCorner = null;
6608
+ ve(this, "pointer"), ve(this, "firstPoint"), ve(this, "pendingSegments"), ve(this, "_nextCorner"), this.pointer = t, this.firstPoint = t, this.pendingSegments = [], this._nextCorner = null;
6547
6609
  }
6548
6610
  movePointerTo(t) {
6549
6611
  if (this.pendingSegments.length)
@@ -6553,13 +6615,13 @@ let po = class {
6553
6615
  return this.pointer = t, this.firstPoint = t, this;
6554
6616
  }
6555
6617
  saveSegment(t) {
6556
- if (k(t.firstPoint, t.lastPoint))
6618
+ if (R(t.firstPoint, t.lastPoint))
6557
6619
  throw new Error(`Segment has no length, ${t.repr}`);
6558
6620
  if (!this._nextCorner)
6559
6621
  return this.pendingSegments.push(t), this;
6560
6622
  const e = this.pendingSegments.pop();
6561
6623
  if (!e) throw new Error("bug in the custom corner algorithm");
6562
- const n = this._nextCorner.mode === "chamfer" ? Xn : Yn;
6624
+ const n = this._nextCorner.mode === "chamfer" ? Hn : Wn;
6563
6625
  return this.pendingSegments.push(
6564
6626
  ...n(e, t, this._nextCorner.radius)
6565
6627
  ), this._nextCorner = null, this;
@@ -6584,11 +6646,11 @@ let po = class {
6584
6646
  return this.lineTo([t, this.pointer[1]]);
6585
6647
  }
6586
6648
  polarLineTo([t, e]) {
6587
- const n = e * _t, s = vt(t, n);
6649
+ const n = e * $t, s = vt(t, n);
6588
6650
  return this.lineTo(s);
6589
6651
  }
6590
6652
  polarLine(t, e) {
6591
- const n = e * _t, [s, r] = vt(t, n);
6653
+ const n = e * $t, [s, r] = vt(t, n);
6592
6654
  return this.line(s, r);
6593
6655
  }
6594
6656
  tangentLine(t) {
@@ -6599,7 +6661,7 @@ let po = class {
6599
6661
  return this.line(n * t, s * t);
6600
6662
  }
6601
6663
  threePointsArcTo(t, e) {
6602
- return this.saveSegment(Zi(this.pointer, e, t)), this.pointer = t, this;
6664
+ return this.saveSegment(Ki(this.pointer, e, t)), this.pointer = t, this;
6603
6665
  }
6604
6666
  threePointsArc(t, e, n, s) {
6605
6667
  const [r, o] = this.pointer;
@@ -6647,7 +6709,7 @@ let po = class {
6647
6709
  if (!n)
6648
6710
  throw new Error("You need a previous curve to sketch a tangent arc");
6649
6711
  return this.saveSegment(
6650
- ai(
6712
+ li(
6651
6713
  this.pointer,
6652
6714
  t,
6653
6715
  e ?? n.tangentAtLastPoint
@@ -6660,7 +6722,7 @@ let po = class {
6660
6722
  }
6661
6723
  ellipseTo(t, e, n, s, r, o) {
6662
6724
  return this.saveSegment(
6663
- hr(this.pointer, t, e, n, s, r, o)
6725
+ lr(this.pointer, t, e, n, s, r, o)
6664
6726
  ), this.pointer = t, this;
6665
6727
  }
6666
6728
  ellipse(t, e, n, s, r, o, a) {
@@ -6674,12 +6736,12 @@ let po = class {
6674
6736
  );
6675
6737
  }
6676
6738
  halfEllipseTo(t, e) {
6677
- const [n, s] = si(q(t, this.pointer));
6739
+ const [n, s] = oi(q(t, this.pointer));
6678
6740
  return this.ellipseTo(
6679
6741
  t,
6680
6742
  n / 2,
6681
6743
  Math.abs(e),
6682
- s * nn,
6744
+ s * sn,
6683
6745
  !0,
6684
6746
  e > 0
6685
6747
  );
@@ -6699,7 +6761,7 @@ let po = class {
6699
6761
  return this.saveSegment(new et(this.pointer, t, e)), this.pointer = t, this;
6700
6762
  }
6701
6763
  smoothCurveTo(t, e) {
6702
- const { endTangent: n, startTangent: s, startFactor: r, endFactor: o } = go(e), a = this.pendingSegments.length ? this.pendingSegments[this.pendingSegments.length - 1] : null, h = J(this.pointer, t) / 3;
6764
+ const { endTangent: n, startTangent: s, startFactor: r, endFactor: o } = Po(e), a = this.pendingSegments.length ? this.pendingSegments[this.pendingSegments.length - 1] : null, h = J(this.pointer, t) / 3;
6703
6765
  let l;
6704
6766
  s ? l = s : a ? l = a.tangentAtLastPoint : l = [1, 0], l = ot(l);
6705
6767
  const c = [
@@ -6730,16 +6792,16 @@ let po = class {
6730
6792
  const n = this.pendingSegments.pop(), s = this.pendingSegments.shift();
6731
6793
  if (!n || !s)
6732
6794
  throw new Error("Not enough curves to close and fillet");
6733
- const r = e === "chamfer" ? Xn : Yn;
6795
+ const r = e === "chamfer" ? Hn : Wn;
6734
6796
  this.pendingSegments.push(...r(n, s, t));
6735
6797
  }
6736
6798
  close(t = !1) {
6737
6799
  if (!this.pendingSegments.length) throw new Error("No segments to close");
6738
6800
  const e = this.pendingSegments[0], n = this.pendingSegments.at(-1);
6739
- return k(e.firstPoint, n.lastPoint) || this.lineTo(e.firstPoint), this._nextCorner !== null && (this._customCornerLastWithFirst(
6801
+ return R(e.firstPoint, n.lastPoint) || this.lineTo(e.firstPoint), this._nextCorner !== null && (this._customCornerLastWithFirst(
6740
6802
  this._nextCorner.radius,
6741
6803
  this._nextCorner.mode
6742
- ), this._nextCorner = null), Wn(this.pendingSegments, { ignoreChecks: t });
6804
+ ), this._nextCorner = null), Qn(this.pendingSegments, { ignoreChecks: t });
6743
6805
  }
6744
6806
  closeWithMirror(t = !1) {
6745
6807
  if (!this.pendingSegments.length) throw new Error("No segments to close");
@@ -6752,7 +6814,7 @@ let po = class {
6752
6814
  ), o = this.pendingSegments.map(
6753
6815
  (a) => a.transform(r).reverse()
6754
6816
  );
6755
- return o.reverse(), Wn(
6817
+ return o.reverse(), Qn(
6756
6818
  [...this.pendingSegments, ...o],
6757
6819
  { ignoreChecks: t }
6758
6820
  );
@@ -6762,22 +6824,22 @@ let po = class {
6762
6824
  }
6763
6825
  get isClosed() {
6764
6826
  var t;
6765
- return k(this.pointer, (t = this.pendingSegments[0]) == null ? void 0 : t.firstPoint);
6827
+ return R(this.pointer, (t = this.pendingSegments[0]) == null ? void 0 : t.firstPoint);
6766
6828
  }
6767
6829
  };
6768
- function Bi(i = [0, 0]) {
6769
- return new po(i);
6830
+ function Vi(i = [0, 0]) {
6831
+ return new Mo(i);
6770
6832
  }
6771
6833
  function kt([i, t]) {
6772
6834
  return `${i} ${t}`;
6773
6835
  }
6774
- function pn(i) {
6836
+ function dn(i) {
6775
6837
  if (i instanceof D)
6776
6838
  return `L ${kt(i.lastPoint)}`;
6777
6839
  if (i instanceof z)
6778
6840
  return `A ${i.radius} ${i.radius} 0 ${i.angularLength > Math.PI ? "1" : "0"} ${i.clockwise ? "0" : "1"} ${kt(i.lastPoint)}`;
6779
6841
  if (i instanceof at)
6780
- return `A ${i.majorRadius} ${i.minorRadius} ${i.tiltAngle * nn} ${i.deltaAngle > Math.PI ? "1" : "0"} ${i.clockwise ? "0" : "1"} ${kt(i.lastPoint)}`;
6842
+ return `A ${i.majorRadius} ${i.minorRadius} ${i.tiltAngle * sn} ${i.deltaAngle > Math.PI ? "1" : "0"} ${i.clockwise ? "0" : "1"} ${kt(i.lastPoint)}`;
6781
6843
  if (i instanceof et)
6782
6844
  return `Q ${[
6783
6845
  kt(i.controlPoint),
@@ -6791,49 +6853,49 @@ function pn(i) {
6791
6853
  ].join(" ")}`;
6792
6854
  throw new Error("Unknown segment type");
6793
6855
  }
6794
- function Vi(i) {
6795
- const t = `M ${i.firstPoint.join(" ")}`, e = i.segments.map(pn).join(" ");
6856
+ function ji(i) {
6857
+ const t = `M ${i.firstPoint.join(" ")}`, e = i.segments.map(dn).join(" ");
6796
6858
  return `${t} ${e} Z`;
6797
6859
  }
6798
- function ji(i) {
6799
- return `<path d="${i.allLoops.map(Vi).join(" ")}" />`;
6860
+ function qi(i) {
6861
+ return `<path d="${i.allLoops.map(ji).join(" ")}" />`;
6800
6862
  }
6801
- function wo(i) {
6863
+ function yo(i) {
6802
6864
  return `<g>
6803
- ${i.figures.map(ji).join(`
6865
+ ${i.figures.map(qi).join(`
6804
6866
  `)}
6805
6867
  </g>`;
6806
6868
  }
6807
- function Po(i) {
6808
- const t = `M ${i.firstPoint.join(" ")}`, e = i.segments.map(pn).join(" ");
6869
+ function bo(i) {
6870
+ const t = `M ${i.firstPoint.join(" ")}`, e = i.segments.map(dn).join(" ");
6809
6871
  return `${t} ${e}`;
6810
6872
  }
6811
- function Mo(i, t = 1) {
6873
+ function xo(i, t = 1) {
6812
6874
  const e = i.xMin - t, n = i.yMin - t;
6813
6875
  return `${e} ${n} ${i.width + 2 * t} ${i.height + 2 * t}`;
6814
6876
  }
6815
- function Hn(i, t, e = 1, n) {
6816
- const s = Mo(t, e), r = n ? `width="${t.width + 2 * e}${n}" height="${t.height + 2 * e}${n}"` : "";
6877
+ function Gn(i, t, e = 1, n) {
6878
+ const s = xo(t, e), r = n ? `width="${t.width + 2 * e}${n}" height="${t.height + 2 * e}${n}"` : "";
6817
6879
  return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
6818
6880
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="${s}" fill="none" stroke="grey" stroke-width="0.2%" vector-effect="non-scaling-stroke" ${r}>
6819
6881
  ${i}
6820
6882
  </svg>`;
6821
6883
  }
6822
- function Qn(i) {
6884
+ function Jn(i) {
6823
6885
  if (i instanceof mt)
6824
6886
  return [i];
6825
- if (i instanceof dt)
6887
+ if (i instanceof Lt)
6826
6888
  return [new mt(i)];
6827
- if (i instanceof ae)
6889
+ if (i instanceof dt)
6828
6890
  return i.figures;
6829
6891
  throw new Error("Unknown shape");
6830
6892
  }
6831
- function qi(i, t, e = 1e-9) {
6893
+ function Ni(i, t, e = 1e-9) {
6832
6894
  let n = [];
6833
6895
  const s = [], r = new Array(t.segments.length).fill(0).map(() => []);
6834
6896
  t.segments.forEach((a, h) => {
6835
6897
  i.segments.forEach((l) => {
6836
- const { intersections: c, overlaps: u } = ie(
6898
+ const { intersections: c, overlaps: u } = se(
6837
6899
  a,
6838
6900
  l,
6839
6901
  e
@@ -6848,89 +6910,89 @@ function qi(i, t, e = 1e-9) {
6848
6910
  }), n = At(n, e);
6849
6911
  const o = Pt([t.segments, r]).flatMap(([a, h]) => h.length ? a.splitAt(h) : [a]);
6850
6912
  return Array.from(
6851
- Je(
6913
+ Ze(
6852
6914
  o,
6853
6915
  n,
6854
6916
  s
6855
6917
  )
6856
6918
  );
6857
6919
  }
6858
- function Ni(i, t, e = !1) {
6859
- return qi(t, i).filter((n) => {
6920
+ function Oi(i, t, e = !1) {
6921
+ return Ni(t, i).filter((n) => {
6860
6922
  const s = n.segments[0].midPoint;
6861
6923
  return t.onStroke(s) ? !e : !t.contains(s);
6862
6924
  });
6863
6925
  }
6864
- function yo(i, t, e = !1) {
6865
- return qi(t, i).filter((n) => {
6926
+ function vo(i, t, e = !1) {
6927
+ return Ni(t, i).filter((n) => {
6866
6928
  const s = n.segments[0].midPoint;
6867
6929
  return t.onStroke(s) ? !e : t.contains(s);
6868
6930
  });
6869
6931
  }
6870
- function Gn(i, t, e = !1) {
6871
- const n = Ni(
6932
+ function Zn(i, t, e = !1) {
6933
+ const n = Oi(
6872
6934
  i,
6873
6935
  t.contour,
6874
6936
  e
6875
6937
  ), s = t.holes.flatMap(
6876
- (r) => yo(i, r, e)
6938
+ (r) => vo(i, r, e)
6877
6939
  );
6878
6940
  return [...n, ...s];
6879
6941
  }
6880
- function bo(i, t) {
6881
- return new ae(
6882
- Xt(Qn(i), Qn(t))
6942
+ function Ao(i, t) {
6943
+ return new dt(
6944
+ Xt(Jn(i), Jn(t))
6883
6945
  );
6884
6946
  }
6885
- function Ue(i, t, e = !0) {
6886
- if (t instanceof dt)
6887
- return Ni(i, t, e);
6947
+ function Ye(i, t, e = !0) {
6948
+ if (t instanceof Lt)
6949
+ return Oi(i, t, e);
6888
6950
  if (t instanceof mt)
6889
- return Gn(i, t, e);
6951
+ return Zn(i, t, e);
6890
6952
  let n = [new Rt([...i.segments])];
6891
6953
  return t.figures.forEach((s) => {
6892
- n = n.flatMap((r) => Gn(r, s, e));
6954
+ n = n.flatMap((r) => Zn(r, s, e));
6893
6955
  }), n;
6894
6956
  }
6895
- function Jn(i) {
6896
- if (i instanceof ae)
6897
- return wo(i);
6898
- if (i instanceof mt)
6899
- return ji(i);
6957
+ function Kn(i) {
6900
6958
  if (i instanceof dt)
6901
- return `<path d="${Vi(i)}" />`;
6959
+ return yo(i);
6960
+ if (i instanceof mt)
6961
+ return qi(i);
6962
+ if (i instanceof Lt)
6963
+ return `<path d="${ji(i)}" />`;
6902
6964
  if (i instanceof Rt)
6903
- return `<path d="${Po(i)}" />`;
6904
- if (ki(i))
6905
- return `<path d="${`M ${i.firstPoint.join(" ")}`} ${pn(
6965
+ return `<path d="${bo(i)}" />`;
6966
+ if (Ci(i))
6967
+ return `<path d="${`M ${i.firstPoint.join(" ")}`} ${dn(
6906
6968
  i
6907
6969
  )}" />`;
6908
6970
  throw new Error("Unknown shape type");
6909
6971
  }
6910
- const Zn = (i) => "shape" in i ? i.shape : i, Kn = (i, t) => {
6972
+ const ti = (i) => "shape" in i ? i.shape : i, ei = (i, t) => {
6911
6973
  if (!("shape" in i)) return t;
6912
6974
  const { color: e } = i;
6913
6975
  return e ? `<g stroke="${e}">${t}</g>` : t;
6914
- }, ti = (i) => new re(i.xMin, -i.yMax, i.xMax, -i.yMin);
6915
- function xo(i, {
6976
+ }, ni = (i) => new oe(i.xMin, -i.yMax, i.xMax, -i.yMin);
6977
+ function Eo(i, {
6916
6978
  margin: t = 1,
6917
6979
  unit: e = null,
6918
6980
  viewBox: n
6919
6981
  } = {}) {
6920
6982
  if (Array.isArray(i)) {
6921
- const r = i.map((h) => Zn(h).mirror()), o = r.map((h, l) => Kn(i[l], Jn(h))).join(`
6983
+ const r = i.map((h) => ti(h).mirror()), o = r.map((h, l) => ei(i[l], Kn(h))).join(`
6922
6984
  `), a = r.slice(1).reduce((h, l) => h.merge(l.boundingBox), r[0].boundingBox);
6923
- return Hn(o, n ? ti(n) : a, t, e);
6985
+ return Gn(o, n ? ni(n) : a, t, e);
6924
6986
  }
6925
- const s = Zn(i).mirror();
6926
- return Hn(
6927
- Kn(i, Jn(s)),
6928
- n ? ti(n) : s.boundingBox,
6987
+ const s = ti(i).mirror();
6988
+ return Gn(
6989
+ ei(i, Kn(s)),
6990
+ n ? ni(n) : s.boundingBox,
6929
6991
  t,
6930
6992
  e
6931
6993
  );
6932
6994
  }
6933
- class Jt extends Lt {
6995
+ class Zt extends Ft {
6934
6996
  constructor(e, {
6935
6997
  cutLines: n = [],
6936
6998
  foldLines: s = [],
@@ -6948,7 +7010,7 @@ class Jt extends Lt {
6948
7010
  return [...this.foldLinesForwards, ...this.foldLinesBackwards];
6949
7011
  }
6950
7012
  clone() {
6951
- return new Jt(this.body, {
7013
+ return new Zt(this.body, {
6952
7014
  cutLines: [...this.cutLines],
6953
7015
  foldLinesForwards: [...this.foldLinesForwards],
6954
7016
  foldLinesBackwards: [...this.foldLinesBackwards]
@@ -6961,27 +7023,27 @@ class Jt extends Lt {
6961
7023
  n === "forwards" ? this.foldLinesForwards.push(e) : this.foldLinesBackwards.push(e);
6962
7024
  }
6963
7025
  fuseFold(e, n = "backwards") {
6964
- const s = e instanceof Jt ? e.body : e, r = this.body.overlappingStrands(s);
7026
+ const s = e instanceof Zt ? e.body : e, r = this.body.overlappingStrands(s);
6965
7027
  return n === "forwards" ? this.foldLinesForwards.push(...r) : this.foldLinesBackwards.push(...r), this.fuseBody(e), this;
6966
7028
  }
6967
7029
  fuseBody(e) {
6968
7030
  let n;
6969
- return e instanceof Jt ? (n = e.body, this.cutLines.push(...e.cutLines), this.foldLinesForwards.push(...e.foldLinesForwards), this.foldLinesBackwards.push(...e.foldLinesBackwards)) : n = e, this.body = this.body.fuse(n), this;
7031
+ return e instanceof Zt ? (n = e.body, this.cutLines.push(...e.cutLines), this.foldLinesForwards.push(...e.foldLinesForwards), this.foldLinesBackwards.push(...e.foldLinesBackwards)) : n = e, this.body = this.body.fuse(n), this;
6970
7032
  }
6971
7033
  cutShape(e) {
6972
- return this.body = bo(this.body, e), this.cutLines = this.cutLines.flatMap(
6973
- (n) => Ue(n, e, !0)
7034
+ return this.body = Ao(this.body, e), this.cutLines = this.cutLines.flatMap(
7035
+ (n) => Ye(n, e, !0)
6974
7036
  ), this.eraseFolds(e), this;
6975
7037
  }
6976
7038
  eraseFolds(e) {
6977
7039
  this.foldLinesBackwards = this.foldLinesBackwards.flatMap(
6978
- (n) => Ue(n, e, !0)
7040
+ (n) => Ye(n, e, !0)
6979
7041
  ), this.foldLinesForwards = this.foldLinesForwards.flatMap(
6980
- (n) => Ue(n, e, !0)
7042
+ (n) => Ye(n, e, !0)
6981
7043
  );
6982
7044
  }
6983
7045
  transform(e) {
6984
- return new Jt(this.body.transform(e), {
7046
+ return new Zt(this.body.transform(e), {
6985
7047
  cutLines: this.cutLines.map((s) => s.transform(e)),
6986
7048
  foldLinesForwards: this.foldLinesForwards.map(
6987
7049
  (s) => s.transform(e)
@@ -6997,10 +7059,10 @@ class Jt extends Lt {
6997
7059
  (n) => e.push({ shape: n, color: "green" })
6998
7060
  ), this.foldLinesForwards.length && this.foldLinesForwards.map(
6999
7061
  (n) => e.push({ shape: n, color: "blue" })
7000
- ), xo(e, { unit: "mm" });
7062
+ ), Eo(e, { unit: "mm" });
7001
7063
  }
7002
7064
  }
7003
- function wn(i, t, {
7065
+ function Pn(i, t, {
7004
7066
  fillet: e = 1,
7005
7067
  contraction: n = 1,
7006
7068
  contractionMode: s = "rounded",
@@ -7009,23 +7071,23 @@ function wn(i, t, {
7009
7071
  leftContractionMode: a,
7010
7072
  rightContractionMode: h
7011
7073
  } = {}) {
7012
- const l = r ?? n, c = o ?? n, u = Bi([-i / 2, 0]).hLine(i);
7074
+ const l = r ?? n, c = o ?? n, u = Vi([-i / 2, 0]).hLine(i);
7013
7075
  return c ? (h ?? s) === "rounded" ? (u.tangentArc(-c, c, [-1, 0]), u.vLine(t - c)) : u.line(-c, t) : u.vLine(t), u.customCorner(e), u.hLine(-i + l + c), u.customCorner(e), l ? (a ?? s) === "rounded" ? (u.vLine(-t + l), u.tangentArcTo([-i / 2, 0])) : u.lineTo([-i / 2, 0]) : u.vLine(-t), u.close();
7014
7076
  }
7015
- function vo(i, t, e = {}) {
7016
- return wn(i, t, e);
7077
+ function So(i, t, e = {}) {
7078
+ return Pn(i, t, e);
7017
7079
  }
7018
- function Ao(i, t, e = {}) {
7019
- return wn(i, t, e).mirror("x");
7080
+ function ko(i, t, e = {}) {
7081
+ return Pn(i, t, e).mirror("x");
7020
7082
  }
7021
- function Oi(i, t, {
7083
+ function zi(i, t, {
7022
7084
  contractionTop: e,
7023
7085
  contractionBottom: n,
7024
7086
  topContractionMode: s,
7025
7087
  bottomContractionMode: r,
7026
7088
  ...o
7027
7089
  } = {}) {
7028
- return wn(i, t, {
7090
+ return Pn(i, t, {
7029
7091
  contractionLeft: e,
7030
7092
  contractionRight: n,
7031
7093
  leftContractionMode: s,
@@ -7033,16 +7095,16 @@ function Oi(i, t, {
7033
7095
  ...o
7034
7096
  }).rotate(90);
7035
7097
  }
7036
- function Eo(i, t, e = {}) {
7037
- return Oi(i, t, e).mirror("y");
7098
+ function Ro(i, t, e = {}) {
7099
+ return zi(i, t, e).mirror("y");
7038
7100
  }
7039
- const Lo = {
7040
- right: Eo,
7041
- left: Oi,
7042
- top: vo,
7043
- bottom: Ao
7044
- }, ei = (i, t) => Bi([-i / 2, 0]).line(t, -t).hLine(i - 2 * t).line(t, t);
7045
- class Ke extends Lt {
7101
+ const qo = {
7102
+ right: Ro,
7103
+ left: zi,
7104
+ top: So,
7105
+ bottom: ko
7106
+ }, ii = (i, t) => Vi([-i / 2, 0]).line(t, -t).hLine(i - 2 * t).line(t, t);
7107
+ class tn extends Ft {
7046
7108
  constructor(e, n = 0.2) {
7047
7109
  super();
7048
7110
  St(this, "cut");
@@ -7052,14 +7114,14 @@ class Ke extends Lt {
7052
7114
  this.cut = e.cut, this.unfold = e.unfold, this.bump = e.bump;
7053
7115
  return;
7054
7116
  }
7055
- const s = ei(e, n * 2.5);
7056
- this.cut = s.asStrand(), this.unfold = s.close(), this.bump = ei(e - 5 * n, 5 * n).close().mirror("x");
7117
+ const s = ii(e, n * 2.5);
7118
+ this.cut = s.asStrand(), this.unfold = s.close(), this.bump = ii(e - 5 * n, 5 * n).close().mirror("x");
7057
7119
  }
7058
7120
  clone() {
7059
- return new Ke(this);
7121
+ return new tn(this);
7060
7122
  }
7061
7123
  transform(e) {
7062
- return new Ke({
7124
+ return new tn({
7063
7125
  cut: this.cut.transform(e),
7064
7126
  unfold: this.unfold.transform(e),
7065
7127
  bump: this.bump.transform(e)
@@ -7072,12 +7134,12 @@ class Ke extends Lt {
7072
7134
  e.fuseBody(this.bump);
7073
7135
  }
7074
7136
  }
7075
- class Le extends Lt {
7137
+ class Be extends Ft {
7076
7138
  constructor(t) {
7077
7139
  super(), this.points = t, this.points = t;
7078
7140
  }
7079
7141
  transform(t) {
7080
- return new Le(this.points.map(t.transform));
7142
+ return new Be(this.points.map(t.transform));
7081
7143
  }
7082
7144
  distribute(t) {
7083
7145
  return this.points.map((e) => t.translateTo(e));
@@ -7086,7 +7148,7 @@ class Le extends Lt {
7086
7148
  return this.points.map((e) => t.clone().translateTo(e));
7087
7149
  }
7088
7150
  }
7089
- function Bo(i, t, e = 3, n = 0) {
7151
+ function No(i, t, e = 3, n = 0) {
7090
7152
  if (i <= t * 2)
7091
7153
  throw new Error("totalWidth must be greater than twice the objectWidth");
7092
7154
  const s = Math.max(
@@ -7097,25 +7159,25 @@ function Bo(i, t, e = 3, n = 0) {
7097
7159
  a.push(
7098
7160
  n + h * (t + o) - i / 2 + t / 2
7099
7161
  );
7100
- return new Le(a.map((h) => [h, 0]));
7162
+ return new Be(a.map((h) => [h, 0]));
7101
7163
  }
7102
- function Vo(i, t, e = "x") {
7164
+ function Oo(i, t, e = "x") {
7103
7165
  const n = i * (t - 1), s = [];
7104
7166
  for (let r = 0; r < t; r++)
7105
7167
  s.push(r * i - n / 2);
7106
- return new Le(
7168
+ return new Be(
7107
7169
  s.map((r) => e.toLowerCase() === "x" ? [r, 0] : [0, r])
7108
7170
  );
7109
7171
  }
7110
7172
  export {
7111
- Jt as Dieline,
7112
- Ke as FoldLockBump,
7113
- Ao as bottomFlap,
7114
- Lo as drawFlaps,
7115
- Oi as leftFlap,
7116
- Bo as linearDistribution,
7117
- Vo as linearSpread,
7118
- Eo as rightFlap,
7119
- vo as topFlap
7173
+ Zt as Dieline,
7174
+ tn as FoldLockBump,
7175
+ ko as bottomFlap,
7176
+ qo as drawFlaps,
7177
+ zi as leftFlap,
7178
+ No as linearDistribution,
7179
+ Oo as linearSpread,
7180
+ Ro as rightFlap,
7181
+ So as topFlap
7120
7182
  };
7121
7183
  //# sourceMappingURL=dielines.js.map