@kubohiroya/turbowarp-bubble 0.1.1 → 0.3.0

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.
@@ -173,28 +173,28 @@ function b(e) {
173
173
  }
174
174
  //#endregion
175
175
  //#region src/actor-transform.ts
176
- var ee = 12, x = 18, te = Object.freeze({
176
+ var x = 12, S = 18, C = Object.freeze({
177
177
  x: 0,
178
178
  y: 0,
179
179
  scalePercent: 100
180
180
  });
181
- function S(e, t) {
181
+ function w(e, t) {
182
182
  if (typeof e != "number" || !Number.isFinite(e)) throw TypeError(`${t} must be a finite number.`);
183
183
  return e;
184
184
  }
185
- function C(e) {
186
- let t = S(e, "Bubble distance");
185
+ function T(e) {
186
+ let t = w(e, "Bubble distance");
187
187
  if (t < 0) throw TypeError("Bubble distance must be zero or greater.");
188
188
  return t;
189
189
  }
190
- function ne(e) {
191
- let t = S(e, "Bubble tail length");
190
+ function E(e) {
191
+ let t = w(e, "Bubble tail length");
192
192
  if (t <= 0) throw TypeError("Bubble tail length must be greater than zero.");
193
193
  return t;
194
194
  }
195
- function w(e) {
195
+ function D(e) {
196
196
  if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
197
- let t = S(e[0], "Bubble offset x"), n = S(e[1], "Bubble offset y"), r = S(e.length === 3 ? e[2] : 100, "Bubble offset scale");
197
+ let t = w(e[0], "Bubble offset x"), n = w(e[1], "Bubble offset y"), r = w(e.length === 3 ? e[2] : 100, "Bubble offset scale");
198
198
  if (r <= 0) throw TypeError("Bubble offset scale must be greater than zero.");
199
199
  return Object.freeze({
200
200
  x: t,
@@ -202,7 +202,7 @@ function w(e) {
202
202
  scalePercent: r
203
203
  });
204
204
  }
205
- function re(e) {
205
+ function ee(e) {
206
206
  let t = (e.bounds.left + e.bounds.right) / 2, n = (e.bounds.top + e.bounds.bottom) / 2, r = b(e.direction), i = e.distance + e.tailLength, a = r.x < 0 ? t - e.bounds.left + i + e.bubbleWidth / 2 : e.bounds.right - t + i + e.bubbleWidth / 2, o = r.y < 0 ? n - e.bounds.bottom + i + e.bubbleHeight / 2 : e.bounds.top - n + i + e.bubbleHeight / 2, s = Math.min(r.x === 0 ? Infinity : a / Math.abs(r.x), r.y === 0 ? Infinity : o / Math.abs(r.y));
207
207
  return Object.freeze({
208
208
  x: t + r.x * s + e.offset.x,
@@ -211,7 +211,7 @@ function re(e) {
211
211
  }
212
212
  //#endregion
213
213
  //#region node_modules/.pnpm/jsclipper@https+++codeload.github.com+platener+jsclipper+tar.gz+56aed19845113e1939d8971c47233054659436b1/node_modules/jsclipper/jsclipper.js
214
- var ie = /* @__PURE__ */ o(((e, t) => {
214
+ var O = /* @__PURE__ */ o(((e, t) => {
215
215
  (function() {
216
216
  var e = {}, n = !1;
217
217
  t !== void 0 && t.exports ? (t.exports = e, n = !0) : typeof document < "u" ? window.ClipperLib = e : self.ClipperLib = e;
@@ -270,14 +270,14 @@ var ie = /* @__PURE__ */ o(((e, t) => {
270
270
  for (var t = this.t - 1; t >= 0; --t) e[t] = this[t];
271
271
  e.t = this.t, e.s = this.s;
272
272
  }
273
- function ee(e) {
273
+ function x(e) {
274
274
  this.t = 1, this.s = e < 0 ? -1 : 0, e > 0 ? this[0] = e : e < -1 ? this[0] = e + this.DV : this.t = 0;
275
275
  }
276
- function x(e) {
276
+ function S(e) {
277
277
  var t = l();
278
278
  return t.fromInt(e), t;
279
279
  }
280
- function te(e, t) {
280
+ function C(e, t) {
281
281
  var n;
282
282
  if (t == 16) n = 4;
283
283
  else if (t == 8) n = 3;
@@ -300,10 +300,10 @@ var ie = /* @__PURE__ */ o(((e, t) => {
300
300
  }
301
301
  n == 8 && e[0] & 128 && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)), this.clamp(), i && c.ZERO.subTo(this, this);
302
302
  }
303
- function S() {
303
+ function w() {
304
304
  for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e;) --this.t;
305
305
  }
306
- function C(e) {
306
+ function T(e) {
307
307
  if (this.s < 0) return "-" + this.negate().toString(e);
308
308
  var t;
309
309
  if (e == 16) t = 4;
@@ -316,14 +316,14 @@ var ie = /* @__PURE__ */ o(((e, t) => {
316
316
  if (o-- > 0) for (s < this.DB && (r = this[o] >> s) > 0 && (i = !0, a = v(r)); o >= 0;) s < t ? (r = (this[o] & (1 << s) - 1) << t - s, r |= this[--o] >> (s += this.DB - t)) : (r = this[o] >> (s -= t) & n, s <= 0 && (s += this.DB, --o)), r > 0 && (i = !0), i && (a += v(r));
317
317
  return i ? a : "0";
318
318
  }
319
- function ne() {
319
+ function E() {
320
320
  var e = l();
321
321
  return c.ZERO.subTo(this, e), e;
322
322
  }
323
- function w() {
323
+ function D() {
324
324
  return this.s < 0 ? this.negate() : this;
325
325
  }
326
- function re(e) {
326
+ function ee(e) {
327
327
  var t = this.s - e.s;
328
328
  if (t != 0) return t;
329
329
  var n = this.t;
@@ -331,30 +331,30 @@ var ie = /* @__PURE__ */ o(((e, t) => {
331
331
  for (; --n >= 0;) if ((t = this[n] - e[n]) != 0) return t;
332
332
  return 0;
333
333
  }
334
- function ie(e) {
334
+ function O(e) {
335
335
  var t = 1, n;
336
336
  return (n = e >>> 16) != 0 && (e = n, t += 16), (n = e >> 8) != 0 && (e = n, t += 8), (n = e >> 4) != 0 && (e = n, t += 4), (n = e >> 2) != 0 && (e = n, t += 2), (n = e >> 1) != 0 && (e = n, t += 1), t;
337
337
  }
338
- function ae() {
339
- return this.t <= 0 ? 0 : this.DB * (this.t - 1) + ie(this[this.t - 1] ^ this.s & this.DM);
338
+ function te() {
339
+ return this.t <= 0 ? 0 : this.DB * (this.t - 1) + O(this[this.t - 1] ^ this.s & this.DM);
340
340
  }
341
- function oe(e, t) {
341
+ function k(e, t) {
342
342
  var n;
343
343
  for (n = this.t - 1; n >= 0; --n) t[n + e] = this[n];
344
344
  for (n = e - 1; n >= 0; --n) t[n] = 0;
345
345
  t.t = this.t + e, t.s = this.s;
346
346
  }
347
- function T(e, t) {
347
+ function A(e, t) {
348
348
  for (var n = e; n < this.t; ++n) t[n - e] = this[n];
349
349
  t.t = Math.max(this.t - e, 0), t.s = this.s;
350
350
  }
351
- function E(e, t) {
351
+ function j(e, t) {
352
352
  var n = e % this.DB, r = this.DB - n, i = (1 << r) - 1, a = Math.floor(e / this.DB), o = this.s << n & this.DM, s;
353
353
  for (s = this.t - 1; s >= 0; --s) t[s + a + 1] = this[s] >> r | o, o = (this[s] & i) << n;
354
354
  for (s = a - 1; s >= 0; --s) t[s] = 0;
355
355
  t[a] = o, t.t = this.t + a + 1, t.s = this.s, t.clamp();
356
356
  }
357
- function se(e, t) {
357
+ function ne(e, t) {
358
358
  t.s = this.s;
359
359
  var n = Math.floor(e / this.DB);
360
360
  if (n >= this.t) {
@@ -366,7 +366,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
366
366
  for (var o = n + 1; o < this.t; ++o) t[o - n - 1] |= (this[o] & a) << i, t[o - n] = this[o] >> r;
367
367
  r > 0 && (t[this.t - n - 1] |= (this.s & a) << i), t.t = this.t - n, t.clamp();
368
368
  }
369
- function D(e, t) {
369
+ function M(e, t) {
370
370
  for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] - e[n], t[n++] = r & this.DM, r >>= this.DB;
371
371
  if (e.t < this.t) {
372
372
  for (r -= e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
@@ -377,13 +377,13 @@ var ie = /* @__PURE__ */ o(((e, t) => {
377
377
  }
378
378
  t.s = r < 0 ? -1 : 0, r < -1 ? t[n++] = this.DV + r : r > 0 && (t[n++] = r), t.t = n, t.clamp();
379
379
  }
380
- function ce(e, t) {
380
+ function re(e, t) {
381
381
  var n = this.abs(), r = e.abs(), i = n.t;
382
382
  for (t.t = i + r.t; --i >= 0;) t[i] = 0;
383
383
  for (i = 0; i < r.t; ++i) t[i + n.t] = n.am(0, r[i], t, i, 0, n.t);
384
384
  t.s = 0, t.clamp(), this.s != e.s && c.ZERO.subTo(t, t);
385
385
  }
386
- function le(e) {
386
+ function ie(e) {
387
387
  for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) e[n] = 0;
388
388
  for (n = 0; n < t.t - 1; ++n) {
389
389
  var r = t.am(n, t[n], e, 2 * n, 0, 1);
@@ -391,7 +391,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
391
391
  }
392
392
  e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1)), e.s = 0, e.clamp();
393
393
  }
394
- function ue(e, t, n) {
394
+ function ae(e, t, n) {
395
395
  var r = e.abs();
396
396
  if (!(r.t <= 0)) {
397
397
  var i = this.abs();
@@ -400,7 +400,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
400
400
  return;
401
401
  }
402
402
  n ??= l();
403
- var a = l(), o = this.s, s = e.s, u = this.DB - ie(r[r.t - 1]);
403
+ var a = l(), o = this.s, s = e.s, u = this.DB - O(r[r.t - 1]);
404
404
  u > 0 ? (r.lShiftTo(u, a), i.lShiftTo(u, n)) : (r.copyTo(a), i.copyTo(n));
405
405
  var d = a.t, f = a[d - 1];
406
406
  if (f != 0) {
@@ -414,48 +414,48 @@ var ie = /* @__PURE__ */ o(((e, t) => {
414
414
  }
415
415
  }
416
416
  }
417
- function O(e) {
417
+ function N(e) {
418
418
  var t = l();
419
419
  return this.abs().divRemTo(e, null, t), this.s < 0 && t.compareTo(c.ZERO) > 0 && e.subTo(t, t), t;
420
420
  }
421
- function k(e) {
421
+ function P(e) {
422
422
  this.m = e;
423
423
  }
424
- function A(e) {
424
+ function F(e) {
425
425
  return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
426
426
  }
427
- function de(e) {
427
+ function oe(e) {
428
428
  return e;
429
429
  }
430
- function fe(e) {
430
+ function se(e) {
431
431
  e.divRemTo(this.m, null, e);
432
432
  }
433
- function pe(e, t, n) {
433
+ function ce(e, t, n) {
434
434
  e.multiplyTo(t, n), this.reduce(n);
435
435
  }
436
- function me(e, t) {
436
+ function le(e, t) {
437
437
  e.squareTo(t), this.reduce(t);
438
438
  }
439
- k.prototype.convert = A, k.prototype.revert = de, k.prototype.reduce = fe, k.prototype.mulTo = pe, k.prototype.sqrTo = me;
440
- function he() {
439
+ P.prototype.convert = F, P.prototype.revert = oe, P.prototype.reduce = se, P.prototype.mulTo = ce, P.prototype.sqrTo = le;
440
+ function ue() {
441
441
  if (this.t < 1) return 0;
442
442
  var e = this[0];
443
443
  if (!(e & 1)) return 0;
444
444
  var t = e & 3;
445
445
  return t = t * (2 - (e & 15) * t) & 15, t = t * (2 - (e & 255) * t) & 255, t = t * (2 - ((e & 65535) * t & 65535)) & 65535, t = t * (2 - e * t % this.DV) % this.DV, t > 0 ? this.DV - t : -t;
446
446
  }
447
- function j(e) {
447
+ function I(e) {
448
448
  this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
449
449
  }
450
- function ge(e) {
450
+ function de(e) {
451
451
  var t = l();
452
452
  return e.abs().dlShiftTo(this.m.t, t), t.divRemTo(this.m, null, t), e.s < 0 && t.compareTo(c.ZERO) > 0 && this.m.subTo(t, t), t;
453
453
  }
454
- function _e(e) {
454
+ function fe(e) {
455
455
  var t = l();
456
456
  return e.copyTo(t), this.reduce(t), t;
457
457
  }
458
- function ve(e) {
458
+ function pe(e) {
459
459
  for (; e.t <= this.mt2;) e[e.t++] = 0;
460
460
  for (var t = 0; t < this.m.t; ++t) {
461
461
  var n = e[t] & 32767, r = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
@@ -463,19 +463,19 @@ var ie = /* @__PURE__ */ o(((e, t) => {
463
463
  }
464
464
  e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
465
465
  }
466
- function ye(e, t) {
466
+ function me(e, t) {
467
467
  e.squareTo(t), this.reduce(t);
468
468
  }
469
- function be(e, t, n) {
469
+ function he(e, t, n) {
470
470
  e.multiplyTo(t, n), this.reduce(n);
471
471
  }
472
- j.prototype.convert = ge, j.prototype.revert = _e, j.prototype.reduce = ve, j.prototype.mulTo = be, j.prototype.sqrTo = ye;
473
- function xe() {
472
+ I.prototype.convert = de, I.prototype.revert = fe, I.prototype.reduce = pe, I.prototype.mulTo = he, I.prototype.sqrTo = me;
473
+ function ge() {
474
474
  return (this.t > 0 ? this[0] & 1 : this.s) == 0;
475
475
  }
476
- function Se(e, t) {
476
+ function _e(e, t) {
477
477
  if (e > 4294967295 || e < 1) return c.ONE;
478
- var n = l(), r = l(), i = t.convert(this), a = ie(e) - 1;
478
+ var n = l(), r = l(), i = t.convert(this), a = O(e) - 1;
479
479
  for (i.copyTo(n); --a >= 0;) if (t.sqrTo(n, r), (e & 1 << a) > 0) t.mulTo(r, i, n);
480
480
  else {
481
481
  var o = n;
@@ -483,16 +483,16 @@ var ie = /* @__PURE__ */ o(((e, t) => {
483
483
  }
484
484
  return t.revert(n);
485
485
  }
486
- function Ce(e, t) {
487
- var n = e < 256 || t.isEven() ? new k(t) : new j(t);
486
+ function ve(e, t) {
487
+ var n = e < 256 || t.isEven() ? new P(t) : new I(t);
488
488
  return this.exp(e, n);
489
489
  }
490
- c.prototype.copyTo = b, c.prototype.fromInt = ee, c.prototype.fromString = te, c.prototype.clamp = S, c.prototype.dlShiftTo = oe, c.prototype.drShiftTo = T, c.prototype.lShiftTo = E, c.prototype.rShiftTo = se, c.prototype.subTo = D, c.prototype.multiplyTo = ce, c.prototype.squareTo = le, c.prototype.divRemTo = ue, c.prototype.invDigit = he, c.prototype.isEven = xe, c.prototype.exp = Se, c.prototype.toString = C, c.prototype.negate = ne, c.prototype.abs = w, c.prototype.compareTo = re, c.prototype.bitLength = ae, c.prototype.mod = O, c.prototype.modPowInt = Ce, c.ZERO = x(0), c.ONE = x(1);
491
- function we() {
490
+ c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = k, c.prototype.drShiftTo = A, c.prototype.lShiftTo = j, c.prototype.rShiftTo = ne, c.prototype.subTo = M, c.prototype.multiplyTo = re, c.prototype.squareTo = ie, c.prototype.divRemTo = ae, c.prototype.invDigit = ue, c.prototype.isEven = ge, c.prototype.exp = _e, c.prototype.toString = T, c.prototype.negate = E, c.prototype.abs = D, c.prototype.compareTo = ee, c.prototype.bitLength = te, c.prototype.mod = N, c.prototype.modPowInt = ve, c.ZERO = S(0), c.ONE = S(1);
491
+ function ye() {
492
492
  var e = l();
493
493
  return this.copyTo(e), e;
494
494
  }
495
- function Te() {
495
+ function be() {
496
496
  if (this.s < 0) {
497
497
  if (this.t == 1) return this[0] - this.DV;
498
498
  if (this.t == 0) return -1;
@@ -500,25 +500,25 @@ var ie = /* @__PURE__ */ o(((e, t) => {
500
500
  else if (this.t == 0) return 0;
501
501
  return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
502
502
  }
503
- function Ee() {
503
+ function xe() {
504
504
  return this.t == 0 ? this.s : this[0] << 24 >> 24;
505
505
  }
506
- function De() {
506
+ function Se() {
507
507
  return this.t == 0 ? this.s : this[0] << 16 >> 16;
508
508
  }
509
- function Oe(e) {
509
+ function Ce(e) {
510
510
  return Math.floor(Math.LN2 * this.DB / Math.log(e));
511
511
  }
512
- function ke() {
512
+ function we() {
513
513
  return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
514
514
  }
515
- function M(e) {
515
+ function L(e) {
516
516
  if (e ??= 10, this.signum() == 0 || e < 2 || e > 36) return "0";
517
- var t = this.chunkSize(e), n = e ** +t, r = x(n), i = l(), a = l(), o = "";
517
+ var t = this.chunkSize(e), n = e ** +t, r = S(n), i = l(), a = l(), o = "";
518
518
  for (this.divRemTo(r, i, a); i.signum() > 0;) o = (n + a.intValue()).toString(e).substr(1) + o, i.divRemTo(r, i, a);
519
519
  return a.intValue().toString(e) + o;
520
520
  }
521
- function N(e, t) {
521
+ function Te(e, t) {
522
522
  this.fromInt(0), t ??= 10;
523
523
  for (var n = this.chunkSize(t), r = t ** +n, i = !1, a = 0, o = 0, s = 0; s < e.length; ++s) {
524
524
  var l = y(e, s);
@@ -530,32 +530,32 @@ var ie = /* @__PURE__ */ o(((e, t) => {
530
530
  }
531
531
  a > 0 && (this.dMultiply(t ** +a), this.dAddOffset(o, 0)), i && c.ZERO.subTo(this, this);
532
532
  }
533
- function Ae(e, t, n) {
533
+ function Ee(e, t, n) {
534
534
  if (typeof t == "number") {
535
535
  if (e < 2) this.fromInt(1);
536
- else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), Re, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
536
+ else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), Pe, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
537
537
  } else {
538
538
  var r = [], i = e & 7;
539
539
  r.length = (e >> 3) + 1, t.nextBytes(r), i > 0 ? r[0] &= (1 << i) - 1 : r[0] = 0, this.fromString(r, 256);
540
540
  }
541
541
  }
542
- function je() {
542
+ function De() {
543
543
  var e = this.t, t = [];
544
544
  t[0] = this.s;
545
545
  var n = this.DB - e * this.DB % 8, r, i = 0;
546
546
  if (e-- > 0) for (n < this.DB && (r = this[e] >> n) != (this.s & this.DM) >> n && (t[i++] = r | this.s << this.DB - n); e >= 0;) n < 8 ? (r = (this[e] & (1 << n) - 1) << 8 - n, r |= this[--e] >> (n += this.DB - 8)) : (r = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --e)), r & 128 && (r |= -256), i == 0 && (this.s & 128) != (r & 128) && ++i, (i > 0 || r != this.s) && (t[i++] = r);
547
547
  return t;
548
548
  }
549
- function Me(e) {
549
+ function Oe(e) {
550
550
  return this.compareTo(e) == 0;
551
551
  }
552
- function Ne(e) {
552
+ function ke(e) {
553
553
  return this.compareTo(e) < 0 ? this : e;
554
554
  }
555
- function Pe(e) {
555
+ function Ae(e) {
556
556
  return this.compareTo(e) > 0 ? this : e;
557
557
  }
558
- function Fe(e, t, n) {
558
+ function je(e, t, n) {
559
559
  var r, i, a = Math.min(e.t, this.t);
560
560
  for (r = 0; r < a; ++r) n[r] = t(this[r], e[r]);
561
561
  if (e.t < this.t) {
@@ -567,81 +567,81 @@ var ie = /* @__PURE__ */ o(((e, t) => {
567
567
  }
568
568
  n.s = t(this.s, e.s), n.clamp();
569
569
  }
570
- function Ie(e, t) {
570
+ function Me(e, t) {
571
571
  return e & t;
572
572
  }
573
- function Le(e) {
573
+ function Ne(e) {
574
574
  var t = l();
575
- return this.bitwiseTo(e, Ie, t), t;
575
+ return this.bitwiseTo(e, Me, t), t;
576
576
  }
577
- function Re(e, t) {
577
+ function Pe(e, t) {
578
578
  return e | t;
579
579
  }
580
- function ze(e) {
580
+ function Fe(e) {
581
581
  var t = l();
582
- return this.bitwiseTo(e, Re, t), t;
582
+ return this.bitwiseTo(e, Pe, t), t;
583
583
  }
584
- function Be(e, t) {
584
+ function Ie(e, t) {
585
585
  return e ^ t;
586
586
  }
587
- function P(e) {
587
+ function R(e) {
588
588
  var t = l();
589
- return this.bitwiseTo(e, Be, t), t;
589
+ return this.bitwiseTo(e, Ie, t), t;
590
590
  }
591
- function F(e, t) {
591
+ function z(e, t) {
592
592
  return e & ~t;
593
593
  }
594
- function Ve(e) {
594
+ function Le(e) {
595
595
  var t = l();
596
- return this.bitwiseTo(e, F, t), t;
596
+ return this.bitwiseTo(e, z, t), t;
597
597
  }
598
- function He() {
598
+ function Re() {
599
599
  for (var e = l(), t = 0; t < this.t; ++t) e[t] = this.DM & ~this[t];
600
600
  return e.t = this.t, e.s = ~this.s, e;
601
601
  }
602
- function Ue(e) {
602
+ function ze(e) {
603
603
  var t = l();
604
604
  return e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t;
605
605
  }
606
- function We(e) {
606
+ function Be(e) {
607
607
  var t = l();
608
608
  return e < 0 ? this.lShiftTo(-e, t) : this.rShiftTo(e, t), t;
609
609
  }
610
- function Ge(e) {
610
+ function Ve(e) {
611
611
  if (e == 0) return -1;
612
612
  var t = 0;
613
613
  return e & 65535 || (e >>= 16, t += 16), e & 255 || (e >>= 8, t += 8), e & 15 || (e >>= 4, t += 4), e & 3 || (e >>= 2, t += 2), e & 1 || ++t, t;
614
614
  }
615
- function Ke() {
616
- for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Ge(this[e]);
615
+ function He() {
616
+ for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Ve(this[e]);
617
617
  return this.s < 0 ? this.t * this.DB : -1;
618
618
  }
619
- function I(e) {
619
+ function B(e) {
620
620
  for (var t = 0; e != 0;) e &= e - 1, ++t;
621
621
  return t;
622
622
  }
623
- function qe() {
624
- for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += I(this[n] ^ t);
623
+ function Ue() {
624
+ for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += B(this[n] ^ t);
625
625
  return e;
626
626
  }
627
- function Je(e) {
627
+ function We(e) {
628
628
  var t = Math.floor(e / this.DB);
629
629
  return t >= this.t ? this.s != 0 : !!(this[t] & 1 << e % this.DB);
630
630
  }
631
- function Ye(e, t) {
631
+ function Ge(e, t) {
632
632
  var n = c.ONE.shiftLeft(e);
633
633
  return this.bitwiseTo(n, t, n), n;
634
634
  }
635
- function Xe(e) {
636
- return this.changeBit(e, Re);
635
+ function Ke(e) {
636
+ return this.changeBit(e, Pe);
637
637
  }
638
- function L(e) {
639
- return this.changeBit(e, F);
638
+ function V(e) {
639
+ return this.changeBit(e, z);
640
640
  }
641
- function Ze(e) {
642
- return this.changeBit(e, Be);
641
+ function qe(e) {
642
+ return this.changeBit(e, Ie);
643
643
  }
644
- function Qe(e, t) {
644
+ function Je(e, t) {
645
645
  for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] + e[n], t[n++] = r & this.DM, r >>= this.DB;
646
646
  if (e.t < this.t) {
647
647
  for (r += e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
@@ -652,58 +652,58 @@ var ie = /* @__PURE__ */ o(((e, t) => {
652
652
  }
653
653
  t.s = r < 0 ? -1 : 0, r > 0 ? t[n++] = r : r < -1 && (t[n++] = this.DV + r), t.t = n, t.clamp();
654
654
  }
655
- function $e(e) {
655
+ function Ye(e) {
656
656
  var t = l();
657
657
  return this.addTo(e, t), t;
658
658
  }
659
- function et(e) {
659
+ function Xe(e) {
660
660
  var t = l();
661
661
  return this.subTo(e, t), t;
662
662
  }
663
- function tt(e) {
663
+ function Ze(e) {
664
664
  var t = l();
665
665
  return this.multiplyTo(e, t), t;
666
666
  }
667
- function nt() {
667
+ function Qe() {
668
668
  var e = l();
669
669
  return this.squareTo(e), e;
670
670
  }
671
- function rt(e) {
671
+ function $e(e) {
672
672
  var t = l();
673
673
  return this.divRemTo(e, t, null), t;
674
674
  }
675
- function it(e) {
675
+ function et(e) {
676
676
  var t = l();
677
677
  return this.divRemTo(e, null, t), t;
678
678
  }
679
- function at(e) {
679
+ function tt(e) {
680
680
  var t = l(), n = l();
681
681
  return this.divRemTo(e, t, n), [t, n];
682
682
  }
683
- function ot(e) {
683
+ function nt(e) {
684
684
  this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
685
685
  }
686
- function st(e, t) {
686
+ function rt(e, t) {
687
687
  if (e != 0) {
688
688
  for (; this.t <= t;) this[this.t++] = 0;
689
689
  for (this[t] += e; this[t] >= this.DV;) this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t];
690
690
  }
691
691
  }
692
- function R() {}
693
- function ct(e) {
692
+ function it() {}
693
+ function at(e) {
694
694
  return e;
695
695
  }
696
- function lt(e, t, n) {
696
+ function ot(e, t, n) {
697
697
  e.multiplyTo(t, n);
698
698
  }
699
- function ut(e, t) {
699
+ function st(e, t) {
700
700
  e.squareTo(t);
701
701
  }
702
- R.prototype.convert = ct, R.prototype.revert = ct, R.prototype.mulTo = lt, R.prototype.sqrTo = ut;
703
- function dt(e) {
704
- return this.exp(e, new R());
702
+ it.prototype.convert = at, it.prototype.revert = at, it.prototype.mulTo = ot, it.prototype.sqrTo = st;
703
+ function ct(e) {
704
+ return this.exp(e, new it());
705
705
  }
706
- function ft(e, t, n) {
706
+ function lt(e, t, n) {
707
707
  var r = Math.min(this.t + e.t, t);
708
708
  for (n.s = 0, n.t = r; r > 0;) n[--r] = 0;
709
709
  var i;
@@ -711,47 +711,47 @@ var ie = /* @__PURE__ */ o(((e, t) => {
711
711
  for (i = Math.min(e.t, t); r < i; ++r) this.am(0, e[r], n, r, 0, t - r);
712
712
  n.clamp();
713
713
  }
714
- function pt(e, t, n) {
714
+ function ut(e, t, n) {
715
715
  --t;
716
716
  var r = n.t = this.t + e.t - t;
717
717
  for (n.s = 0; --r >= 0;) n[r] = 0;
718
718
  for (r = Math.max(t - this.t, 0); r < e.t; ++r) n[this.t + r - t] = this.am(t - r, e[r], n, 0, 0, this.t + r - t);
719
719
  n.clamp(), n.drShiftTo(1, n);
720
720
  }
721
- function z(e) {
721
+ function dt(e) {
722
722
  this.r2 = l(), this.q3 = l(), c.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
723
723
  }
724
- function mt(e) {
724
+ function ft(e) {
725
725
  if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
726
726
  if (e.compareTo(this.m) < 0) return e;
727
727
  var t = l();
728
728
  return e.copyTo(t), this.reduce(t), t;
729
729
  }
730
- function ht(e) {
730
+ function pt(e) {
731
731
  return e;
732
732
  }
733
- function gt(e) {
733
+ function mt(e) {
734
734
  for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) e.dAddOffset(1, this.m.t + 1);
735
735
  for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) e.subTo(this.m, e);
736
736
  }
737
- function _t(e, t) {
737
+ function ht(e, t) {
738
738
  e.squareTo(t), this.reduce(t);
739
739
  }
740
- function vt(e, t, n) {
740
+ function gt(e, t, n) {
741
741
  e.multiplyTo(t, n), this.reduce(n);
742
742
  }
743
- z.prototype.convert = mt, z.prototype.revert = ht, z.prototype.reduce = gt, z.prototype.mulTo = vt, z.prototype.sqrTo = _t;
744
- function yt(e, t) {
745
- var n = e.bitLength(), r, i = x(1), a;
743
+ dt.prototype.convert = ft, dt.prototype.revert = pt, dt.prototype.reduce = mt, dt.prototype.mulTo = gt, dt.prototype.sqrTo = ht;
744
+ function _t(e, t) {
745
+ var n = e.bitLength(), r, i = S(1), a;
746
746
  if (n <= 0) return i;
747
- r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new k(t) : t.isEven() ? new z(t) : new j(t);
747
+ r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new P(t) : t.isEven() ? new dt(t) : new I(t);
748
748
  var o = [], s = 3, c = r - 1, u = (1 << r) - 1;
749
749
  if (o[1] = a.convert(this), r > 1) {
750
750
  var d = l();
751
751
  for (a.sqrTo(o[1], d); s <= u;) o[s] = l(), a.mulTo(d, o[s - 2], o[s]), s += 2;
752
752
  }
753
753
  var f = e.t - 1, p, m = !0, h = l(), g;
754
- for (n = ie(e[f]) - 1; f >= 0;) {
754
+ for (n = O(e[f]) - 1; f >= 0;) {
755
755
  for (n >= c ? p = e[f] >> n - c & u : (p = (e[f] & (1 << n + 1) - 1) << c - n, f > 0 && (p |= e[f - 1] >> this.DB + n - c)), s = r; !(p & 1);) p >>= 1, --s;
756
756
  if ((n -= s) < 0 && (n += this.DB, --f), m) o[p].copyTo(i), m = !1;
757
757
  else {
@@ -762,7 +762,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
762
762
  }
763
763
  return a.revert(i);
764
764
  }
765
- function bt(e) {
765
+ function vt(e) {
766
766
  var t = this.s < 0 ? this.negate() : this.clone(), n = e.s < 0 ? e.negate() : e.clone();
767
767
  if (t.compareTo(n) < 0) {
768
768
  var r = t;
@@ -773,7 +773,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
773
773
  for (i < a && (a = i), a > 0 && (t.rShiftTo(a, t), n.rShiftTo(a, n)); t.signum() > 0;) (i = t.getLowestSetBit()) > 0 && t.rShiftTo(i, t), (i = n.getLowestSetBit()) > 0 && n.rShiftTo(i, n), t.compareTo(n) >= 0 ? (t.subTo(n, t), t.rShiftTo(1, t)) : (n.subTo(t, n), n.rShiftTo(1, n));
774
774
  return a > 0 && n.lShiftTo(a, n), n;
775
775
  }
776
- function B(e) {
776
+ function yt(e) {
777
777
  if (e <= 0) return 0;
778
778
  var t = this.DV % e, n = this.s < 0 ? e - 1 : 0;
779
779
  if (this.t > 0) {
@@ -782,10 +782,10 @@ var ie = /* @__PURE__ */ o(((e, t) => {
782
782
  }
783
783
  return n;
784
784
  }
785
- function xt(e) {
785
+ function bt(e) {
786
786
  var t = e.isEven();
787
787
  if (this.isEven() && t || e.signum() == 0) return c.ZERO;
788
- for (var n = e.clone(), r = this.clone(), i = x(1), a = x(0), o = x(0), s = x(1); n.signum() != 0;) {
788
+ for (var n = e.clone(), r = this.clone(), i = S(1), a = S(0), o = S(0), s = S(1); n.signum() != 0;) {
789
789
  for (; n.isEven();) n.rShiftTo(1, n), t ? ((!i.isEven() || !a.isEven()) && (i.addTo(this, i), a.subTo(e, a)), i.rShiftTo(1, i)) : a.isEven() || a.subTo(e, a), a.rShiftTo(1, a);
790
790
  for (; r.isEven();) r.rShiftTo(1, r), t ? ((!o.isEven() || !s.isEven()) && (o.addTo(this, o), s.subTo(e, s)), o.rShiftTo(1, o)) : s.isEven() || s.subTo(e, s), s.rShiftTo(1, s);
791
791
  n.compareTo(r) >= 0 ? (n.subTo(r, n), t && i.subTo(o, i), a.subTo(s, a)) : (r.subTo(n, r), t && o.subTo(i, o), s.subTo(a, s));
@@ -796,7 +796,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
796
796
  else return s;
797
797
  return s.signum() < 0 ? s.add(e) : s;
798
798
  }
799
- var V = [
799
+ var H = [
800
800
  2,
801
801
  3,
802
802
  5,
@@ -965,27 +965,27 @@ var ie = /* @__PURE__ */ o(((e, t) => {
965
965
  983,
966
966
  991,
967
967
  997
968
- ], H = (1 << 26) / V[V.length - 1];
969
- function St(e) {
968
+ ], U = (1 << 26) / H[H.length - 1];
969
+ function xt(e) {
970
970
  var t, n = this.abs();
971
- if (n.t == 1 && n[0] <= V[V.length - 1]) {
972
- for (t = 0; t < V.length; ++t) if (n[0] == V[t]) return !0;
971
+ if (n.t == 1 && n[0] <= H[H.length - 1]) {
972
+ for (t = 0; t < H.length; ++t) if (n[0] == H[t]) return !0;
973
973
  return !1;
974
974
  }
975
975
  if (n.isEven()) return !1;
976
- for (t = 1; t < V.length;) {
977
- for (var r = V[t], i = t + 1; i < V.length && r < H;) r *= V[i++];
978
- for (r = n.modInt(r); t < i;) if (r % V[t++] == 0) return !1;
976
+ for (t = 1; t < H.length;) {
977
+ for (var r = H[t], i = t + 1; i < H.length && r < U;) r *= H[i++];
978
+ for (r = n.modInt(r); t < i;) if (r % H[t++] == 0) return !1;
979
979
  }
980
980
  return n.millerRabin(e);
981
981
  }
982
- function Ct(e) {
982
+ function St(e) {
983
983
  var t = this.subtract(c.ONE), n = t.getLowestSetBit();
984
984
  if (n <= 0) return !1;
985
985
  var r = t.shiftRight(n);
986
- e = e + 1 >> 1, e > V.length && (e = V.length);
986
+ e = e + 1 >> 1, e > H.length && (e = H.length);
987
987
  for (var i = l(), a = 0; a < e; ++a) {
988
- i.fromInt(V[Math.floor(Math.random() * V.length)]);
988
+ i.fromInt(H[Math.floor(Math.random() * H.length)]);
989
989
  var o = i.modPow(r, this);
990
990
  if (o.compareTo(c.ONE) != 0 && o.compareTo(t) != 0) {
991
991
  for (var s = 1; s++ < n && o.compareTo(t) != 0;) if (o = o.modPowInt(2, this), o.compareTo(c.ONE) == 0) return !1;
@@ -994,29 +994,29 @@ var ie = /* @__PURE__ */ o(((e, t) => {
994
994
  }
995
995
  return !0;
996
996
  }
997
- c.prototype.chunkSize = Oe, c.prototype.toRadix = M, c.prototype.fromRadix = N, c.prototype.fromNumber = Ae, c.prototype.bitwiseTo = Fe, c.prototype.changeBit = Ye, c.prototype.addTo = Qe, c.prototype.dMultiply = ot, c.prototype.dAddOffset = st, c.prototype.multiplyLowerTo = ft, c.prototype.multiplyUpperTo = pt, c.prototype.modInt = B, c.prototype.millerRabin = Ct, c.prototype.clone = we, c.prototype.intValue = Te, c.prototype.byteValue = Ee, c.prototype.shortValue = De, c.prototype.signum = ke, c.prototype.toByteArray = je, c.prototype.equals = Me, c.prototype.min = Ne, c.prototype.max = Pe, c.prototype.and = Le, c.prototype.or = ze, c.prototype.xor = P, c.prototype.andNot = Ve, c.prototype.not = He, c.prototype.shiftLeft = Ue, c.prototype.shiftRight = We, c.prototype.getLowestSetBit = Ke, c.prototype.bitCount = qe, c.prototype.testBit = Je, c.prototype.setBit = Xe, c.prototype.clearBit = L, c.prototype.flipBit = Ze, c.prototype.add = $e, c.prototype.subtract = et, c.prototype.multiply = tt, c.prototype.divide = rt, c.prototype.remainder = it, c.prototype.divideAndRemainder = at, c.prototype.modPow = yt, c.prototype.modInverse = xt, c.prototype.pow = dt, c.prototype.gcd = bt, c.prototype.isProbablePrime = St, c.prototype.square = nt;
998
- var U = c;
999
- if (U.prototype.IsNegative = function() {
1000
- return this.compareTo(U.ZERO) == -1;
1001
- }, U.op_Equality = function(e, t) {
997
+ c.prototype.chunkSize = Ce, c.prototype.toRadix = L, c.prototype.fromRadix = Te, c.prototype.fromNumber = Ee, c.prototype.bitwiseTo = je, c.prototype.changeBit = Ge, c.prototype.addTo = Je, c.prototype.dMultiply = nt, c.prototype.dAddOffset = rt, c.prototype.multiplyLowerTo = lt, c.prototype.multiplyUpperTo = ut, c.prototype.modInt = yt, c.prototype.millerRabin = St, c.prototype.clone = ye, c.prototype.intValue = be, c.prototype.byteValue = xe, c.prototype.shortValue = Se, c.prototype.signum = we, c.prototype.toByteArray = De, c.prototype.equals = Oe, c.prototype.min = ke, c.prototype.max = Ae, c.prototype.and = Ne, c.prototype.or = Fe, c.prototype.xor = R, c.prototype.andNot = Le, c.prototype.not = Re, c.prototype.shiftLeft = ze, c.prototype.shiftRight = Be, c.prototype.getLowestSetBit = He, c.prototype.bitCount = Ue, c.prototype.testBit = We, c.prototype.setBit = Ke, c.prototype.clearBit = V, c.prototype.flipBit = qe, c.prototype.add = Ye, c.prototype.subtract = Xe, c.prototype.multiply = Ze, c.prototype.divide = $e, c.prototype.remainder = et, c.prototype.divideAndRemainder = tt, c.prototype.modPow = _t, c.prototype.modInverse = bt, c.prototype.pow = ct, c.prototype.gcd = vt, c.prototype.isProbablePrime = xt, c.prototype.square = Qe;
998
+ var W = c;
999
+ if (W.prototype.IsNegative = function() {
1000
+ return this.compareTo(W.ZERO) == -1;
1001
+ }, W.op_Equality = function(e, t) {
1002
1002
  return e.compareTo(t) == 0;
1003
- }, U.op_Inequality = function(e, t) {
1003
+ }, W.op_Inequality = function(e, t) {
1004
1004
  return e.compareTo(t) != 0;
1005
- }, U.op_GreaterThan = function(e, t) {
1005
+ }, W.op_GreaterThan = function(e, t) {
1006
1006
  return e.compareTo(t) > 0;
1007
- }, U.op_LessThan = function(e, t) {
1007
+ }, W.op_LessThan = function(e, t) {
1008
1008
  return e.compareTo(t) < 0;
1009
- }, U.op_Addition = function(e, t) {
1010
- return new U(e).add(new U(t));
1011
- }, U.op_Subtraction = function(e, t) {
1012
- return new U(e).subtract(new U(t));
1013
- }, U.Int128Mul = function(e, t) {
1014
- return new U(e).multiply(new U(t));
1015
- }, U.op_Division = function(e, t) {
1009
+ }, W.op_Addition = function(e, t) {
1010
+ return new W(e).add(new W(t));
1011
+ }, W.op_Subtraction = function(e, t) {
1012
+ return new W(e).subtract(new W(t));
1013
+ }, W.Int128Mul = function(e, t) {
1014
+ return new W(e).multiply(new W(t));
1015
+ }, W.op_Division = function(e, t) {
1016
1016
  return e.divide(t);
1017
- }, U.prototype.ToDouble = function() {
1017
+ }, W.prototype.ToDouble = function() {
1018
1018
  return parseFloat(this.toString());
1019
- }, wt === void 0) var wt = function(e, t) {
1019
+ }, Ct === void 0) var Ct = function(e, t) {
1020
1020
  var n;
1021
1021
  if (Object.getOwnPropertyNames === void 0) {
1022
1022
  for (n in t.prototype) (e.prototype[n] === void 0 || e.prototype[n] == Object.prototype[n]) && (e.prototype[n] = t.prototype[n]);
@@ -1072,7 +1072,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
1072
1072
  return this.m_Childs.length > 0 ? this.m_Childs[0] : null;
1073
1073
  }, e.PolyTree.prototype.Total = function() {
1074
1074
  return this.m_AllPolys.length;
1075
- }, wt(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
1075
+ }, Ct(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
1076
1076
  return Math.abs(e);
1077
1077
  }, e.Math_Max_Int32_Int32 = function(e, t) {
1078
1078
  return Math.max(e, t);
@@ -1185,7 +1185,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
1185
1185
  } while (r != n);
1186
1186
  return !1;
1187
1187
  }, e.ClipperBase.prototype.PointOnLineSegment = function(e, t, n, r) {
1188
- return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && U.op_Equality(U.Int128Mul(e.X - t.X, n.Y - t.Y), U.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
1188
+ return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && W.op_Equality(W.Int128Mul(e.X - t.X, n.Y - t.Y), W.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
1189
1189
  }, e.ClipperBase.prototype.PointOnPolygon = function(e, t, n) {
1190
1190
  for (var r = t;;) {
1191
1191
  if (this.PointOnLineSegment(e, r.Pt, r.Next.Pt, n)) return !0;
@@ -1194,13 +1194,13 @@ var ie = /* @__PURE__ */ o(((e, t) => {
1194
1194
  return !1;
1195
1195
  }, e.ClipperBase.prototype.SlopesEqual = e.ClipperBase.SlopesEqual = function() {
1196
1196
  var t = arguments, n = t.length, r, i, a, o, s, c, l;
1197
- return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? U.op_Equality(U.Int128Mul(r.Delta.Y, i.Delta.X), U.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? U.op_Equality(U.Int128Mul(a.Y - o.Y, o.X - s.X), U.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? U.op_Equality(U.Int128Mul(a.Y - o.Y, s.X - c.X), U.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
1197
+ return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? W.op_Equality(W.Int128Mul(r.Delta.Y, i.Delta.X), W.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? W.op_Equality(W.Int128Mul(a.Y - o.Y, o.X - s.X), W.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? W.op_Equality(W.Int128Mul(a.Y - o.Y, s.X - c.X), W.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
1198
1198
  }, e.ClipperBase.SlopesEqual3 = function(t, n, r) {
1199
- return r ? U.op_Equality(U.Int128Mul(t.Delta.Y, n.Delta.X), U.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
1199
+ return r ? W.op_Equality(W.Int128Mul(t.Delta.Y, n.Delta.X), W.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
1200
1200
  }, e.ClipperBase.SlopesEqual4 = function(t, n, r, i) {
1201
- return i ? U.op_Equality(U.Int128Mul(t.Y - n.Y, n.X - r.X), U.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
1201
+ return i ? W.op_Equality(W.Int128Mul(t.Y - n.Y, n.X - r.X), W.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
1202
1202
  }, e.ClipperBase.SlopesEqual5 = function(t, n, r, i, a) {
1203
- return a ? U.op_Equality(U.Int128Mul(t.Y - n.Y, r.X - i.X), U.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
1203
+ return a ? W.op_Equality(W.Int128Mul(t.Y - n.Y, r.X - i.X), W.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
1204
1204
  }, e.ClipperBase.prototype.Clear = function() {
1205
1205
  this.DisposeLocalMinimaList();
1206
1206
  for (var t = 0, n = this.m_edges.length; t < n; ++t) {
@@ -1878,16 +1878,16 @@ var ie = /* @__PURE__ */ o(((e, t) => {
1878
1878
  }
1879
1879
  this.m_IntersectList.length = 0;
1880
1880
  };
1881
- var Tt = function(e) {
1881
+ var wt = function(e) {
1882
1882
  return e < 0 ? Math.ceil(e - .5) : Math.round(e);
1883
- }, Et = function(e) {
1883
+ }, Tt = function(e) {
1884
1884
  return e < 0 ? Math.ceil(e - .5) : Math.floor(e + .5);
1885
- }, Dt = function(e) {
1885
+ }, Et = function(e) {
1886
1886
  return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
1887
- }, Ot = function(e) {
1887
+ }, Dt = function(e) {
1888
1888
  return e < 0 ? (e -= .5, e < -2147483648 ? Math.ceil(e) : e | 0) : (e += .5, e > 2147483647 ? Math.floor(e) : e | 0);
1889
1889
  };
1890
- a.msie ? e.Clipper.Round = Tt : a.chromium ? e.Clipper.Round = Dt : a.safari ? e.Clipper.Round = Ot : e.Clipper.Round = Et, e.Clipper.TopX = function(t, n) {
1890
+ a.msie ? e.Clipper.Round = wt : a.chromium ? e.Clipper.Round = Et : a.safari ? e.Clipper.Round = Dt : e.Clipper.Round = Tt, e.Clipper.TopX = function(t, n) {
1891
1891
  return n == t.Top.Y ? t.Top.X : t.Bot.X + e.Clipper.Round(t.Dx * (n - t.Bot.Y));
1892
1892
  }, e.Clipper.prototype.IntersectPoint = function(t, n, r) {
1893
1893
  r.X = 0, r.Y = 0;
@@ -2265,7 +2265,7 @@ var ie = /* @__PURE__ */ o(((e, t) => {
2265
2265
  }, e.Clipper.ClosedPathsFromPolyTree = function(t) {
2266
2266
  var n = new e.Paths();
2267
2267
  return e.Clipper.AddPolyNodeToPaths(t, e.Clipper.NodeType.ntClosed, n), n;
2268
- }, wt(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2268
+ }, Ct(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2269
2269
  ntAny: 0,
2270
2270
  ntOpen: 1,
2271
2271
  ntClosed: 2
@@ -2461,13 +2461,13 @@ var ie = /* @__PURE__ */ o(((e, t) => {
2461
2461
  if (typeof n != "number" || n === null) return e.Error("Tolerance is not a number in Lighten()."), e.JS.Clone(t);
2462
2462
  if (t.length === 0 || t.length == 1 && t[0].length === 0 || n < 0) return e.JS.Clone(t);
2463
2463
  t[0] instanceof Array || (t = [t]);
2464
- var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b = t.length, ee = n * n, x = [];
2464
+ var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b = t.length, x = n * n, S = [];
2465
2465
  for (r = 0; r < b; r++) if (a = t[r], c = a.length, c != 0) {
2466
2466
  for (o = 0; o < 1e6; o++) {
2467
2467
  for (s = [], c = a.length, a[c - 1].X != a[0].X || a[c - 1].Y != a[0].Y ? (m = 1, a.push({
2468
2468
  X: a[0].X,
2469
2469
  Y: a[0].Y
2470
- }), c = a.length) : m = 0, p = [], i = 0; i < c - 2; i++) l = a[i], d = a[i + 1], u = a[i + 2], v = l.X, y = l.Y, h = u.X - v, g = u.Y - y, (h !== 0 || g !== 0) && (_ = ((d.X - v) * h + (d.Y - y) * g) / (h * h + g * g), _ > 1 ? (v = u.X, y = u.Y) : _ > 0 && (v += h * _, y += g * _)), h = d.X - v, g = d.Y - y, f = h * h + g * g, f <= ee && (p[i + 1] = 1, i++);
2470
+ }), c = a.length) : m = 0, p = [], i = 0; i < c - 2; i++) l = a[i], d = a[i + 1], u = a[i + 2], v = l.X, y = l.Y, h = u.X - v, g = u.Y - y, (h !== 0 || g !== 0) && (_ = ((d.X - v) * h + (d.Y - y) * g) / (h * h + g * g), _ > 1 ? (v = u.X, y = u.Y) : _ > 0 && (v += h * _, y += g * _)), h = d.X - v, g = d.Y - y, f = h * h + g * g, f <= x && (p[i + 1] = 1, i++);
2471
2471
  for (s.push({
2472
2472
  X: a[0].X,
2473
2473
  Y: a[0].Y
@@ -2481,9 +2481,9 @@ var ie = /* @__PURE__ */ o(((e, t) => {
2481
2481
  }), m && a.pop(), p.length) a = s;
2482
2482
  else break;
2483
2483
  }
2484
- c = s.length, s[c - 1].X == s[0].X && s[c - 1].Y == s[0].Y && s.pop(), s.length > 2 && x.push(s);
2484
+ c = s.length, s[c - 1].X == s[0].X && s[c - 1].Y == s[0].Y && s.pop(), s.length > 2 && S.push(s);
2485
2485
  }
2486
- return !t[0] instanceof Array && (x = x[0]), x === void 0 && (x = [[]]), x;
2486
+ return !t[0] instanceof Array && (S = S[0]), S === void 0 && (S = [[]]), S;
2487
2487
  }, e.JS.PerimeterOfPath = function(e, t, n) {
2488
2488
  if (e === void 0) return 0;
2489
2489
  var r = Math.sqrt, i = 0, a, o, s = 0, c = 0, l = 0, u = 0, d = e.length;
@@ -2528,8 +2528,8 @@ var ie = /* @__PURE__ */ o(((e, t) => {
2528
2528
  return n;
2529
2529
  };
2530
2530
  })();
2531
- })), ae = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2532
- var n = ie(), r = 10 ** 5;
2531
+ })), te = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2532
+ var n = O(), r = 10 ** 5;
2533
2533
  function i(e) {
2534
2534
  return e.map(function(e) {
2535
2535
  return {
@@ -2714,16 +2714,16 @@ var ie = /* @__PURE__ */ o(((e, t) => {
2714
2714
  Polygon: _,
2715
2715
  ClipperLib: n
2716
2716
  };
2717
- })))(), 1), oe = 18, T = Object.freeze({
2717
+ })))(), 1), k = 18, A = Object.freeze({
2718
2718
  x: 0,
2719
2719
  y: 0,
2720
2720
  scalePercent: 100
2721
2721
  });
2722
- function E(e) {
2722
+ function j(e) {
2723
2723
  if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError("Bubble tail length must be greater than zero.");
2724
2724
  return e;
2725
2725
  }
2726
- function se(e) {
2726
+ function ne(e) {
2727
2727
  if (e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
2728
2728
  let [t, n, r = 100] = e;
2729
2729
  if (![
@@ -2737,7 +2737,7 @@ function se(e) {
2737
2737
  scalePercent: r
2738
2738
  });
2739
2739
  }
2740
- var D = Object.freeze([
2740
+ var M = Object.freeze([
2741
2741
  "NORMAL",
2742
2742
  "THINKING",
2743
2743
  "DREAMING",
@@ -2749,21 +2749,21 @@ var D = Object.freeze([
2749
2749
  "NARRATION",
2750
2750
  "NO_BUBBLE"
2751
2751
  ]);
2752
- function ce(e) {
2752
+ function re(e) {
2753
2753
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
2754
2754
  }
2755
- function le(e, t) {
2755
+ function ie(e, t) {
2756
2756
  let n = e ?? t;
2757
2757
  if (!Number.isFinite(n) || n <= 0) throw TypeError("Bubble SVG dimensions must be positive and finite.");
2758
2758
  return n;
2759
2759
  }
2760
- function ue(e) {
2760
+ function ae(e) {
2761
2761
  if (e === null) return null;
2762
2762
  let t = e ?? 180;
2763
2763
  if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
2764
2764
  return (t % 360 + 360) % 360;
2765
2765
  }
2766
- function O(e, t, n = 18) {
2766
+ function N(e, t, n = 18) {
2767
2767
  let r = e - 24, i = t - 24;
2768
2768
  return [
2769
2769
  {
@@ -2794,24 +2794,24 @@ function O(e, t, n = 18) {
2794
2794
  };
2795
2795
  }));
2796
2796
  }
2797
- function k(e, t) {
2797
+ function P(e, t) {
2798
2798
  return e.x * t.y - e.y * t.x;
2799
2799
  }
2800
- function A(e, t) {
2800
+ function F(e, t) {
2801
2801
  return {
2802
2802
  x: e.x - t.x,
2803
2803
  y: e.y - t.y
2804
2804
  };
2805
2805
  }
2806
- function de(e, t) {
2806
+ function oe(e, t) {
2807
2807
  return Math.hypot(e.x - t.x, e.y - t.y);
2808
2808
  }
2809
- function fe(e, t, n, r) {
2809
+ function se(e, t, n, r) {
2810
2810
  let i = t, a = r;
2811
2811
  for (; a > 0;) {
2812
2812
  let t = (i + n + e.length) % e.length, r = e[i], o = e[t];
2813
2813
  if (!r || !o) throw Error("Bubble border path is invalid.");
2814
- let s = de(r, o);
2814
+ let s = oe(r, o);
2815
2815
  if (a <= s) {
2816
2816
  let e = a / s;
2817
2817
  return {
@@ -2825,14 +2825,14 @@ function fe(e, t, n, r) {
2825
2825
  if (!o) throw Error("Bubble border path is empty.");
2826
2826
  return o;
2827
2827
  }
2828
- function pe(e, t, n, r, i) {
2828
+ function ce(e, t, n, r, i) {
2829
2829
  let a;
2830
2830
  for (let r = 0; r < e.length; r += 1) {
2831
2831
  let i = e[r], o = e[(r + 1) % e.length];
2832
2832
  if (!i || !o) continue;
2833
- let s = A(o, i), c = k(n, s);
2833
+ let s = F(o, i), c = P(n, s);
2834
2834
  if (Math.abs(c) < 1e-9) continue;
2835
- let l = A(i, t), u = k(l, s) / c, d = k(l, n) / c;
2835
+ let l = F(i, t), u = P(l, s) / c, d = P(l, n) / c;
2836
2836
  u < 0 || d < -1e-9 || d > 1 + 1e-9 || a && u >= a.rayScale || (a = {
2837
2837
  edgeIndex: r,
2838
2838
  point: {
@@ -2850,61 +2850,61 @@ function pe(e, t, n, r, i) {
2850
2850
  ], s = a.edgeIndex + 1;
2851
2851
  return {
2852
2852
  borderPoint: a.point,
2853
- base: [fe(o, s, -1, 9), fe(o, s, 1, 9)],
2853
+ base: [se(o, s, -1, 9), se(o, s, 1, 9)],
2854
2854
  tip: {
2855
2855
  x: i?.x ?? t.x + n.x * (a.rayScale + r),
2856
2856
  y: i?.y ?? t.y + n.y * (a.rayScale + r)
2857
2857
  }
2858
2858
  };
2859
2859
  }
2860
- function me(e) {
2860
+ function le(e) {
2861
2861
  let t = e * Math.PI / 180;
2862
2862
  return {
2863
2863
  x: Math.sin(t),
2864
2864
  y: -Math.cos(t)
2865
2865
  };
2866
2866
  }
2867
- function he(e, t, n, r) {
2867
+ function ue(e, t, n, r) {
2868
2868
  return {
2869
2869
  x: n.x + (e.x - t.x) * r,
2870
2870
  y: n.y + (e.y - t.y) * r
2871
2871
  };
2872
2872
  }
2873
- function j(e, t, n, r, i, a) {
2873
+ function I(e, t, n, r, i, a) {
2874
2874
  let o = {
2875
2875
  x: t / 2,
2876
2876
  y: n / 2
2877
- }, s = me(r), c = pe(e, o, s, i), l = de(o, c.borderPoint), u = a.scalePercent / 100, d = {
2877
+ }, s = le(r), c = ce(e, o, s, i), l = oe(o, c.borderPoint), u = a.scalePercent / 100, d = {
2878
2878
  x: o.x - s.x * l * (u - 1) + a.x,
2879
2879
  y: o.y - s.y * l * (u - 1) - a.y
2880
2880
  };
2881
2881
  return {
2882
- body: e.map((e) => he(e, o, d, u)),
2882
+ body: e.map((e) => ue(e, o, d, u)),
2883
2883
  bodyCenter: d,
2884
2884
  tip: c.tip
2885
2885
  };
2886
2886
  }
2887
- function ge(e) {
2887
+ function de(e) {
2888
2888
  let t = e[0];
2889
2889
  if (!t) throw Error("Bubble polygon is empty.");
2890
2890
  return `M ${t.x.toFixed(4)} ${t.y.toFixed(4)} ${e.slice(1).map(({ x: e, y: t }) => `L ${e.toFixed(4)} ${t.toFixed(4)}`).join(" ")} Z`;
2891
2891
  }
2892
- function _e(e) {
2892
+ function fe(e) {
2893
2893
  return Math.abs(e.reduce((t, n, r) => {
2894
2894
  let i = e[(r + 1) % e.length];
2895
2895
  return i ? t + n.x * i.y - i.x * n.y : t;
2896
2896
  }, 0) / 2);
2897
2897
  }
2898
- function ve(e, t, n, r = "") {
2899
- return `<path d="${ge(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
2898
+ function pe(e, t, n, r = "") {
2899
+ return `<path d="${de(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
2900
2900
  }
2901
- function ye(e, t, n, r, i, a = "") {
2902
- let o = A(n, t), s = Math.hypot(o.x, o.y);
2901
+ function me(e, t, n, r, i, a = "") {
2902
+ let o = F(n, t), s = Math.hypot(o.x, o.y);
2903
2903
  if (!(s > 0)) throw TypeError("Bubble body center and tail tip must differ.");
2904
- let c = pe(e, t, {
2904
+ let c = ce(e, t, {
2905
2905
  x: o.x / s,
2906
2906
  y: o.y / s
2907
- }, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = ae.default.union([l(e)], [[l([
2907
+ }, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = te.default.union([l(e)], [[l([
2908
2908
  c.base[0],
2909
2909
  c.tip,
2910
2910
  c.base[1]
@@ -2913,11 +2913,11 @@ function ye(e, t, n, r, i, a = "") {
2913
2913
  let d = u.map((e) => e.map(([e, t]) => ({
2914
2914
  x: e,
2915
2915
  y: t
2916
- }))).sort((e, t) => _e(t) - _e(e))[0];
2916
+ }))).sort((e, t) => fe(t) - fe(e))[0];
2917
2917
  if (!d) throw Error("JSClipper returned an empty Bubble outline.");
2918
- return `<path d="${ge(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
2918
+ return `<path d="${de(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
2919
2919
  }
2920
- function be(e, t, n, r) {
2920
+ function he(e, t, n, r) {
2921
2921
  let i = e - 24, a = t - 24, o = e / 2, s = t / 2;
2922
2922
  return `<path d="M 42 ${s}
2923
2923
  C 22 ${s - 20}, 32 42, 60 44
@@ -2930,8 +2930,8 @@ function be(e, t, n, r) {
2930
2930
  C 31 ${a + 2}, 17 ${s + 20}, 42 ${s} Z"
2931
2931
  fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
2932
2932
  }
2933
- function xe(e, t, n, r, i, a) {
2934
- let o = A(n, t), s = Math.hypot(o.x, o.y), c = pe(e, t, {
2933
+ function ge(e, t, n, r, i, a) {
2934
+ let o = F(n, t), s = Math.hypot(o.x, o.y), c = ce(e, t, {
2935
2935
  x: o.x / s,
2936
2936
  y: o.y / s
2937
2937
  }, 0, n), l = {
@@ -2959,7 +2959,7 @@ function xe(e, t, n, r, i, a) {
2959
2959
  radius: 3.5
2960
2960
  }]).map(({ ratio: e, radius: t }) => `<circle cx="${l.x + (c.tip.x - l.x) * e}" cy="${l.y + (c.tip.y - l.y) * e}" r="${t}" fill="${r}" stroke="${i}" stroke-width="2"/>`).join("");
2961
2961
  }
2962
- function Se(e, t) {
2962
+ function _e(e, t) {
2963
2963
  let n = e / 2, r = t / 2;
2964
2964
  return Array.from({ length: 28 }, (i, a) => {
2965
2965
  let o = a * Math.PI * 2 / 28 - Math.PI / 2, s = a % 2 == 0, c = s ? e / 2 - 6 : e / 2 - 22, l = s ? t / 2 - 6 : t / 2 - 22;
@@ -2969,7 +2969,7 @@ function Se(e, t) {
2969
2969
  };
2970
2970
  });
2971
2971
  }
2972
- function Ce(e, t) {
2972
+ function ve(e, t) {
2973
2973
  let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
2974
2974
  let n = t / 20;
2975
2975
  return {
@@ -3002,59 +3002,61 @@ function Ce(e, t) {
3002
3002
  }))
3003
3003
  ];
3004
3004
  }
3005
- function we(e, t, n) {
3006
- return e === "YELLING" ? Se(t, n) : e === "WAVY" ? Ce(t, n) : O(t, n);
3005
+ function ye(e, t, n) {
3006
+ return e === "YELLING" ? _e(t, n) : e === "WAVY" ? ve(t, n) : N(t, n);
3007
3007
  }
3008
- function Te(e) {
3009
- let t = le(e.width, 220), n = le(e.height, 112), r = ue(e.tailDirection);
3008
+ function be(e) {
3009
+ let t = ie(e.width, 220), n = ie(e.height, 112), r = ae(e.tailDirection);
3010
3010
  if (r === null) throw TypeError("Bubble body center offset requires a tail direction.");
3011
- let i = E(e.tailLength ?? oe), a = se(e.offset), o = {
3011
+ let i = j(e.tailLength ?? k), a = ne(e.offset), o = {
3012
3012
  x: t / 2,
3013
3013
  y: n / 2
3014
- }, s = j(we(e.style, t, n), t, n, r, i, a);
3014
+ }, s = I(ye(e.style, t, n), t, n, r, i, a);
3015
3015
  return Object.freeze({
3016
3016
  x: s.bodyCenter.x - o.x,
3017
3017
  y: s.bodyCenter.y - o.y
3018
3018
  });
3019
3019
  }
3020
- function Ee(e, t, n, r, i, a, o, s) {
3021
- let c = O(t, n), l = (e) => r === null ? e : j(e, t, n, r, o, s).body, u = (e, c = "") => {
3022
- if (r === null) return ve(e, i, a, c);
3023
- let l = j(e, t, n, r, o, s);
3024
- return ye(l.body, l.bodyCenter, l.tip, i, a, c);
3020
+ function xe(e, t, n, r, i, a, o, s) {
3021
+ let c = N(t, n), l = (e) => r === null ? e : I(e, t, n, r, o, s).body, u = (e, c = "") => {
3022
+ if (r === null) return pe(e, i, a, c);
3023
+ let l = I(e, t, n, r, o, s);
3024
+ return me(l.body, l.bodyCenter, l.tip, i, a, c);
3025
3025
  };
3026
3026
  switch (e) {
3027
3027
  case "NO_BUBBLE": return "";
3028
3028
  case "THINKING":
3029
3029
  case "DREAMING": {
3030
- if (r === null) return be(t, n, i, a);
3031
- let l = j(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
3030
+ if (r === null) return he(t, n, i, a);
3031
+ let l = I(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
3032
3032
  x: t / 2,
3033
3033
  y: n / 2
3034
3034
  }, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
3035
- return `${xe(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${be(t, n, i, a)}</g>`;
3035
+ return `${ge(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${he(t, n, i, a)}</g>`;
3036
3036
  }
3037
- case "YELLING": return u(Se(t, n));
3038
- case "WAVY": return u(Ce(t, n));
3037
+ case "YELLING": return u(_e(t, n));
3038
+ case "WAVY": return u(ve(t, n));
3039
3039
  case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
3040
3040
  case "ANNOUNCEMENT": return `${u(c)}<rect x="30" y="30" width="${t - 60}" height="${n - 60}" rx="13" fill="none" stroke="${a}" stroke-width="1.5"/>`;
3041
- case "NARRATION": return ve(l(c), i, a);
3041
+ case "NARRATION": return pe(l(c), i, a);
3042
3042
  case "OFF_PANEL": return u(c);
3043
3043
  case "NORMAL": return u(c);
3044
3044
  }
3045
3045
  }
3046
- function De(e) {
3047
- if (!D.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
3046
+ function Se(e) {
3047
+ if (!M.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
3048
3048
  if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
3049
- let t = le(e.width, 220), n = le(e.height, 112), r = le(e.fontSize, 15), i = ue(e.tailDirection), a = E(e.tailLength ?? oe), o = e.offset === void 0 ? T : se(e.offset), s = e.fillColor ?? "#fff4cc", c = e.borderColor ?? "#6f5b45", l = e.textColor ?? "#25283a", u = e.fontFamily ?? "Noto Sans JP, sans-serif", d = r * 1.35, f = n / 2 - (e.lines.length - 1) * d / 2 + r * .35, p = i === null ? 1 : o.scalePercent / 100, m = i === null ? {
3049
+ let t = ie(e.width, 220), n = ie(e.height, 112), r = ie(e.fontSize, 15), i = ae(e.tailDirection), a = j(e.tailLength ?? k), o = e.offset === void 0 ? A : ne(e.offset), s = e.shapeTransition;
3050
+ if (s !== void 0 && (!M.includes(s.from) || !M.includes(s.to) || !Number.isFinite(s.progress) || s.progress < 0 || s.progress > 1)) throw TypeError("Bubble shape transition is invalid.");
3051
+ let c = e.fillColor ?? "#fff4cc", l = e.borderColor ?? "#6f5b45", u = e.textColor ?? "#25283a", d = e.fontFamily ?? "Noto Sans JP, sans-serif", f = r * 1.35, p = n / 2 - (e.lines.length - 1) * f / 2 + r * .35, m = i === null ? 1 : o.scalePercent / 100, h = i === null ? {
3050
3052
  x: t / 2,
3051
3053
  y: n / 2
3052
- } : j(O(t, n), t, n, i, a, o).bodyCenter, h = e.lines.map((e, t) => `<text x="${m.x}" y="${m.y + (f + t * d - n / 2) * p}" text-anchor="middle" fill="${ce(l)}" font-family="${ce(u)}" font-size="${r * p}">${ce(e)}</text>`).join(""), g = ce(e.title ?? `${e.style} bubble`);
3053
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"><title>${g}</title>${Ee(e.style, t, n, i, s, c, a, o)}${h}</svg>`;
3054
+ } : I(N(t, n), t, n, i, a, o).bodyCenter, g = e.lines.map((e, t) => `<text x="${h.x}" y="${h.y + (p + t * f - n / 2) * m}" text-anchor="middle" fill="${re(u)}" font-family="${re(d)}" font-size="${r * m}">${re(e)}</text>`).join(""), _ = s === void 0 ? xe(e.style, t, n, i, c, l, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${xe(s.from, t, n, i, c, l, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${xe(s.to, t, n, i, c, l, a, o)}</g>`, v = re(e.title ?? `${e.style} bubble`), y = s === void 0 ? "" : ` data-bubble-shape-transition-from="${s.from}" data-bubble-shape-transition-to="${s.to}" data-bubble-shape-transition-progress="${s.progress.toFixed(4)}"`;
3055
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"${y}><title>${v}</title>${_}${g}</svg>`;
3054
3056
  }
3055
3057
  //#endregion
3056
3058
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
3057
- var Oe = 2048, ke = 2112, M = Uint8Array, N = Uint16Array, Ae = Int32Array, je = new M([
3059
+ var Ce = 2048, we = 2112, L = Uint8Array, Te = Uint16Array, Ee = Int32Array, De = new L([
3058
3060
  0,
3059
3061
  0,
3060
3062
  0,
@@ -3087,7 +3089,7 @@ var Oe = 2048, ke = 2112, M = Uint8Array, N = Uint16Array, Ae = Int32Array, je =
3087
3089
  0,
3088
3090
  0,
3089
3091
  0
3090
- ]), Me = new M([
3092
+ ]), Oe = new L([
3091
3093
  0,
3092
3094
  0,
3093
3095
  0,
@@ -3120,7 +3122,7 @@ var Oe = 2048, ke = 2112, M = Uint8Array, N = Uint16Array, Ae = Int32Array, je =
3120
3122
  13,
3121
3123
  0,
3122
3124
  0
3123
- ]), Ne = new M([
3125
+ ]), ke = new L([
3124
3126
  16,
3125
3127
  17,
3126
3128
  18,
@@ -3140,51 +3142,51 @@ var Oe = 2048, ke = 2112, M = Uint8Array, N = Uint16Array, Ae = Int32Array, je =
3140
3142
  14,
3141
3143
  1,
3142
3144
  15
3143
- ]), Pe = function(e, t) {
3144
- for (var n = new N(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3145
- for (var i = new Ae(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
3145
+ ]), Ae = function(e, t) {
3146
+ for (var n = new Te(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3147
+ for (var i = new Ee(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
3146
3148
  return {
3147
3149
  b: n,
3148
3150
  r: i
3149
3151
  };
3150
- }, Fe = Pe(je, 2), Ie = Fe.b, Le = Fe.r;
3151
- Ie[28] = 258, Le[258] = 28;
3152
- var Re = Pe(Me, 0), ze = Re.b;
3153
- Re.r;
3154
- for (var Be = new N(32768), P = 0; P < 32768; ++P) {
3155
- var F = (P & 43690) >> 1 | (P & 21845) << 1;
3156
- F = (F & 52428) >> 2 | (F & 13107) << 2, F = (F & 61680) >> 4 | (F & 3855) << 4, Be[P] = ((F & 65280) >> 8 | (F & 255) << 8) >> 1;
3152
+ }, je = Ae(De, 2), Me = je.b, Ne = je.r;
3153
+ Me[28] = 258, Ne[258] = 28;
3154
+ var Pe = Ae(Oe, 0), Fe = Pe.b;
3155
+ Pe.r;
3156
+ for (var Ie = new Te(32768), R = 0; R < 32768; ++R) {
3157
+ var z = (R & 43690) >> 1 | (R & 21845) << 1;
3158
+ z = (z & 52428) >> 2 | (z & 13107) << 2, z = (z & 61680) >> 4 | (z & 3855) << 4, Ie[R] = ((z & 65280) >> 8 | (z & 255) << 8) >> 1;
3157
3159
  }
3158
- for (var Ve = (function(e, t, n) {
3159
- for (var r = e.length, i = 0, a = new N(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3160
- var o = new N(t);
3160
+ for (var Le = (function(e, t, n) {
3161
+ for (var r = e.length, i = 0, a = new Te(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3162
+ var o = new Te(t);
3161
3163
  for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
3162
3164
  var s;
3163
3165
  if (n) {
3164
- s = new N(1 << t);
3166
+ s = new Te(1 << t);
3165
3167
  var c = 15 - t;
3166
- for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[Be[d] >> c] = l;
3167
- } else for (s = new N(r), i = 0; i < r; ++i) e[i] && (s[i] = Be[o[e[i] - 1]++] >> 15 - e[i]);
3168
+ for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[Ie[d] >> c] = l;
3169
+ } else for (s = new Te(r), i = 0; i < r; ++i) e[i] && (s[i] = Ie[o[e[i] - 1]++] >> 15 - e[i]);
3168
3170
  return s;
3169
- }), He = new M(288), P = 0; P < 144; ++P) He[P] = 8;
3170
- for (var P = 144; P < 256; ++P) He[P] = 9;
3171
- for (var P = 256; P < 280; ++P) He[P] = 7;
3172
- for (var P = 280; P < 288; ++P) He[P] = 8;
3173
- for (var Ue = new M(32), P = 0; P < 32; ++P) Ue[P] = 5;
3174
- var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = function(e) {
3171
+ }), Re = new L(288), R = 0; R < 144; ++R) Re[R] = 8;
3172
+ for (var R = 144; R < 256; ++R) Re[R] = 9;
3173
+ for (var R = 256; R < 280; ++R) Re[R] = 7;
3174
+ for (var R = 280; R < 288; ++R) Re[R] = 8;
3175
+ for (var ze = new L(32), R = 0; R < 32; ++R) ze[R] = 5;
3176
+ var Be = /*#__PURE__*/ Le(Re, 9, 1), Ve = /*#__PURE__*/ Le(ze, 5, 1), He = function(e) {
3175
3177
  for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
3176
3178
  return t;
3177
- }, I = function(e, t, n) {
3179
+ }, B = function(e, t, n) {
3178
3180
  var r = t / 8 | 0;
3179
3181
  return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
3180
- }, qe = function(e, t) {
3182
+ }, Ue = function(e, t) {
3181
3183
  var n = t / 8 | 0;
3182
3184
  return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
3183
- }, Je = function(e) {
3185
+ }, We = function(e) {
3184
3186
  return (e + 7) / 8 | 0;
3185
- }, Ye = function(e, t, n) {
3186
- return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new M(e.subarray(t, n));
3187
- }, Xe = [
3187
+ }, Ge = function(e, t, n) {
3188
+ return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new L(e.subarray(t, n));
3189
+ }, Ke = [
3188
3190
  "unexpected EOF",
3189
3191
  "invalid block type",
3190
3192
  "invalid length/literal",
@@ -3199,121 +3201,121 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3199
3201
  "filename too long",
3200
3202
  "stream finishing",
3201
3203
  "invalid zip data"
3202
- ], L = function(e, t, n) {
3203
- var r = Error(t || Xe[e]);
3204
- if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, L), !n) throw r;
3204
+ ], V = function(e, t, n) {
3205
+ var r = Error(t || Ke[e]);
3206
+ if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, V), !n) throw r;
3205
3207
  return r;
3206
- }, Ze = function(e, t, n, r) {
3208
+ }, qe = function(e, t, n, r) {
3207
3209
  var i = e.length, a = r ? r.length : 0;
3208
- if (!i || t.f && !t.l) return n || new M(0);
3210
+ if (!i || t.f && !t.l) return n || new L(0);
3209
3211
  var o = !n, s = o || t.i != 2, c = t.i;
3210
- o && (n = new M(i * 3));
3212
+ o && (n = new L(i * 3));
3211
3213
  var l = function(e) {
3212
3214
  var t = n.length;
3213
3215
  if (e > t) {
3214
- var r = new M(Math.max(t * 2, e));
3216
+ var r = new L(Math.max(t * 2, e));
3215
3217
  r.set(n), n = r;
3216
3218
  }
3217
3219
  }, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
3218
3220
  do {
3219
3221
  if (!p) {
3220
- u = I(e, d, 1);
3221
- var v = I(e, d + 1, 3);
3222
+ u = B(e, d, 1);
3223
+ var v = B(e, d + 1, 3);
3222
3224
  if (d += 3, !v) {
3223
- var y = Je(d) + 4, b = e[y - 4] | e[y - 3] << 8, ee = y + b;
3224
- if (ee > i) {
3225
- c && L(0);
3225
+ var y = We(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
3226
+ if (x > i) {
3227
+ c && V(0);
3226
3228
  break;
3227
3229
  }
3228
- s && l(f + b), n.set(e.subarray(y, ee), f), t.b = f += b, t.p = d = ee * 8, t.f = u;
3230
+ s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
3229
3231
  continue;
3230
3232
  }
3231
- if (v == 1) p = We, m = Ge, h = 9, g = 5;
3233
+ if (v == 1) p = Be, m = Ve, h = 9, g = 5;
3232
3234
  else if (v == 2) {
3233
- var x = I(e, d, 31) + 257, te = I(e, d + 10, 15) + 4, S = x + I(e, d + 5, 31) + 1;
3235
+ var S = B(e, d, 31) + 257, C = B(e, d + 10, 15) + 4, w = S + B(e, d + 5, 31) + 1;
3234
3236
  d += 14;
3235
- for (var C = new M(S), ne = new M(19), w = 0; w < te; ++w) ne[Ne[w]] = I(e, d + w * 3, 7);
3236
- d += te * 3;
3237
- for (var re = Ke(ne), ie = (1 << re) - 1, ae = Ve(ne, re, 1), w = 0; w < S;) {
3238
- var oe = ae[I(e, d, ie)];
3239
- d += oe & 15;
3240
- var y = oe >> 4;
3241
- if (y < 16) C[w++] = y;
3237
+ for (var T = new L(w), E = new L(19), D = 0; D < C; ++D) E[ke[D]] = B(e, d + D * 3, 7);
3238
+ d += C * 3;
3239
+ for (var ee = He(E), O = (1 << ee) - 1, te = Le(E, ee, 1), D = 0; D < w;) {
3240
+ var k = te[B(e, d, O)];
3241
+ d += k & 15;
3242
+ var y = k >> 4;
3243
+ if (y < 16) T[D++] = y;
3242
3244
  else {
3243
- var T = 0, E = 0;
3244
- for (y == 16 ? (E = 3 + I(e, d, 3), d += 2, T = C[w - 1]) : y == 17 ? (E = 3 + I(e, d, 7), d += 3) : y == 18 && (E = 11 + I(e, d, 127), d += 7); E--;) C[w++] = T;
3245
+ var A = 0, j = 0;
3246
+ for (y == 16 ? (j = 3 + B(e, d, 3), d += 2, A = T[D - 1]) : y == 17 ? (j = 3 + B(e, d, 7), d += 3) : y == 18 && (j = 11 + B(e, d, 127), d += 7); j--;) T[D++] = A;
3245
3247
  }
3246
3248
  }
3247
- var se = C.subarray(0, x), D = C.subarray(x);
3248
- h = Ke(se), g = Ke(D), p = Ve(se, h, 1), m = Ve(D, g, 1);
3249
- } else L(1);
3249
+ var ne = T.subarray(0, S), M = T.subarray(S);
3250
+ h = He(ne), g = He(M), p = Le(ne, h, 1), m = Le(M, g, 1);
3251
+ } else V(1);
3250
3252
  if (d > _) {
3251
- c && L(0);
3253
+ c && V(0);
3252
3254
  break;
3253
3255
  }
3254
3256
  }
3255
3257
  s && l(f + 131072);
3256
- for (var ce = (1 << h) - 1, le = (1 << g) - 1, ue = d;; ue = d) {
3257
- var T = p[qe(e, d) & ce], O = T >> 4;
3258
- if (d += T & 15, d > _) {
3259
- c && L(0);
3258
+ for (var re = (1 << h) - 1, ie = (1 << g) - 1, ae = d;; ae = d) {
3259
+ var A = p[Ue(e, d) & re], N = A >> 4;
3260
+ if (d += A & 15, d > _) {
3261
+ c && V(0);
3260
3262
  break;
3261
3263
  }
3262
- if (T || L(2), O < 256) n[f++] = O;
3263
- else if (O == 256) {
3264
- ue = d, p = null;
3264
+ if (A || V(2), N < 256) n[f++] = N;
3265
+ else if (N == 256) {
3266
+ ae = d, p = null;
3265
3267
  break;
3266
3268
  } else {
3267
- var k = O - 254;
3268
- if (O > 264) {
3269
- var w = O - 257, A = je[w];
3270
- k = I(e, d, (1 << A) - 1) + Ie[w], d += A;
3269
+ var P = N - 254;
3270
+ if (N > 264) {
3271
+ var D = N - 257, F = De[D];
3272
+ P = B(e, d, (1 << F) - 1) + Me[D], d += F;
3271
3273
  }
3272
- var de = m[qe(e, d) & le], fe = de >> 4;
3273
- de || L(3), d += de & 15;
3274
- var D = ze[fe];
3275
- if (fe > 3) {
3276
- var A = Me[fe];
3277
- D += qe(e, d) & (1 << A) - 1, d += A;
3274
+ var oe = m[Ue(e, d) & ie], se = oe >> 4;
3275
+ oe || V(3), d += oe & 15;
3276
+ var M = Fe[se];
3277
+ if (se > 3) {
3278
+ var F = Oe[se];
3279
+ M += Ue(e, d) & (1 << F) - 1, d += F;
3278
3280
  }
3279
3281
  if (d > _) {
3280
- c && L(0);
3282
+ c && V(0);
3281
3283
  break;
3282
3284
  }
3283
3285
  s && l(f + 131072);
3284
- var pe = f + k;
3285
- if (f < D) {
3286
- var me = a - D, he = Math.min(D, pe);
3287
- for (me + f < 0 && L(3); f < he; ++f) n[f] = r[me + f];
3286
+ var ce = f + P;
3287
+ if (f < M) {
3288
+ var le = a - M, ue = Math.min(M, ce);
3289
+ for (le + f < 0 && V(3); f < ue; ++f) n[f] = r[le + f];
3288
3290
  }
3289
- for (; f < pe; ++f) n[f] = n[f - D];
3291
+ for (; f < ce; ++f) n[f] = n[f - M];
3290
3292
  }
3291
3293
  }
3292
- t.l = p, t.p = ue, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
3294
+ t.l = p, t.p = ae, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
3293
3295
  } while (!u);
3294
- return f != n.length && o ? Ye(n, 0, f) : n.subarray(0, f);
3295
- }, Qe = /*#__PURE__*/ new M(0), $e = function(e) {
3296
- (e[0] != 31 || e[1] != 139 || e[2] != 8) && L(6, "invalid gzip data");
3296
+ return f != n.length && o ? Ge(n, 0, f) : n.subarray(0, f);
3297
+ }, Je = /*#__PURE__*/ new L(0), Ye = function(e) {
3298
+ (e[0] != 31 || e[1] != 139 || e[2] != 8) && V(6, "invalid gzip data");
3297
3299
  var t = e[3], n = 10;
3298
3300
  t & 4 && (n += (e[10] | e[11] << 8) + 2);
3299
3301
  for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
3300
3302
  return n + (t & 2);
3301
- }, et = function(e) {
3303
+ }, Xe = function(e) {
3302
3304
  var t = e.length;
3303
3305
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
3304
3306
  };
3305
- function tt(e, t) {
3306
- var n = $e(e);
3307
- return n + 8 > e.length && L(6, "invalid gzip data"), Ze(e.subarray(n, -8), { i: 2 }, t && t.out || new M(et(e)), t && t.dictionary);
3307
+ function Ze(e, t) {
3308
+ var n = Ye(e);
3309
+ return n + 8 > e.length && V(6, "invalid gzip data"), qe(e.subarray(n, -8), { i: 2 }, t && t.out || new L(Xe(e)), t && t.dictionary);
3308
3310
  }
3309
- var nt = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3311
+ var Qe = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3310
3312
  try {
3311
- nt.decode(Qe, { stream: !0 });
3313
+ Qe.decode(Je, { stream: !0 });
3312
3314
  } catch {}
3313
3315
  //#endregion
3314
3316
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
3315
- var rt = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3316
- function it(e) {
3317
+ var $e = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3318
+ function et(e) {
3317
3319
  let t = e.length;
3318
3320
  for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
3319
3321
  e[n + 3],
@@ -3322,15 +3324,15 @@ function it(e) {
3322
3324
  e[n]
3323
3325
  ];
3324
3326
  }
3325
- function at(e) {}
3326
- var ot = rt ? it : at, st = new TextDecoder(), R = class e {
3327
+ function tt(e) {}
3328
+ var nt = $e ? et : tt, rt = new TextDecoder(), it = class e {
3327
3329
  constructor(e) {
3328
3330
  if (e instanceof Uint8Array) {
3329
3331
  let t = 0, n = new DataView(e.buffer);
3330
3332
  if (this.highStart = n.getUint32(0, !0), this.errorValue = n.getUint32(4, !0), t = n.getUint32(8, !0), t !== 4294967295) throw Error("Trie created with old version of @cto.af/unicode-trie.");
3331
3333
  if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
3332
3334
  let r = e.subarray(16 + t);
3333
- this.values = r.length ? JSON.parse(st.decode(tt(r))) : [], e = tt(e.subarray(16, 16 + t)), ot(e), this.data = new Int32Array(e.buffer);
3335
+ this.values = r.length ? JSON.parse(rt.decode(Ze(r))) : [], e = Ze(e.subarray(16, 16 + t)), nt(e), this.data = new Int32Array(e.buffer);
3334
3336
  } else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
3335
3337
  }
3336
3338
  static fromBase64(t) {
@@ -3343,10 +3345,10 @@ var ot = rt ? it : at, st = new TextDecoder(), R = class e {
3343
3345
  let n = (this.data[e >> 5] << 2) + (e & 31);
3344
3346
  t = this.data[n];
3345
3347
  } else if (e <= 65535) {
3346
- let n = (this.data[Oe + (e - 55296 >> 5)] << 2) + (e & 31);
3348
+ let n = (this.data[Ce + (e - 55296 >> 5)] << 2) + (e & 31);
3347
3349
  t = this.data[n];
3348
3350
  } else if (e < this.highStart) {
3349
- let n = this.data[ke - 32 + (e >> 11)];
3351
+ let n = this.data[we - 32 + (e >> 11)];
3350
3352
  n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
3351
3353
  } else t = this.data[this.data.length - 4];
3352
3354
  return t;
@@ -3355,26 +3357,26 @@ var ot = rt ? it : at, st = new TextDecoder(), R = class e {
3355
3357
  let t = this.get(e);
3356
3358
  return this.values[t] ?? t;
3357
3359
  }
3358
- }, ct = R.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48FEw3NTwDTp/BxwAZgJLgaXgCvAAnADuA3cDe4Hj0rPLQerwLPgJfAaeBe8Az4EnT/Ram0D\n eoBdwe5gENgX0DsOhHkQGAlGgTHgaHACGA8mgilgGpgBLgJzweVgPlgIbgF3iPOl4BGwAqwG\n a8Er4C2wDnwEumzRanUDPUFv0B8MBgeAL4BDwNfAN8C3wIngO+A0cCZowd/nwrwA/Eic/wzm\n L8EMHM+HuRDcDP4g7t8Hk3hYmI8BCv+TwvwLTOZvglfBawKyQ7wrjv8Ns1OXVqsroPNuwuwJ\n szfoL86JwTgeIp3HYJj0vhE4Hg3GgnHgZMDhnYDjyWCqZP9CHM8Gc8S1y2BeBa4FvweLxPN3\n wVwq7Dwirp0KVuB4NVgLXgSvg/fA+6C1Jf6gO+gF+oI9wQa3YQ4FwwDlwREwR4Mj+L6GY3Dv\n eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9cA64Dt4I7wT3gQfA4eAI8DdaKd7wizLdgvg86dUWa\n g+1BL0D3+sIcAAaLc5X9xfUDYR4EDlUYJR2PAUeCY8FJ4DRwJjgXTAezwBwwD1wDrgO3gjuF\n G/fAfBA8Js5XwnwaPF/htypeFfbfhvm+w7OdtkL6Axe3thP2uSzuhPM+YICA6tZ9YA4FwwGV\n 55F0XTBGOlY5GhwHxoOJYAqYBn4AfiyOLwVXgvnSc9dKxzeC28XxEoNbbdq0iQvXEe24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Th\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), lt = Object.fromEntries(ct.values.map((e, t) => [e, t])), { values: ut } = ct, { AI: dt, AL: ft, CJ: pt, CM: z, NS: mt, SA: ht, SG: gt, SP: _t, XX: vt } = lt;
3359
- function yt(e) {
3360
+ }, at = it.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48FEw3NTwDTp/BxwAZgJLgaXgCvAAnADuA3cDe4Hj0rPLQerwLPgJfAaeBe8Az4EnT/Ram0D\n eoBdwe5gENgX0DsOhHkQGAlGgTHgaHACGA8mgilgGpgBLgJzweVgPlgIbgF3iPOl4BGwAqwG\n a8Er4C2wDnwEumzRanUDPUFv0B8MBgeAL4BDwNfAN8C3wIngO+A0cCZowd/nwrwA/Eic/wzm\n L8EMHM+HuRDcDP4g7t8Hk3hYmI8BCv+TwvwLTOZvglfBawKyQ7wrjv8Ns1OXVqsroPNuwuwJ\n szfoL86JwTgeIp3HYJj0vhE4Hg3GgnHgZMDhnYDjyWCqZP9CHM8Gc8S1y2BeBa4FvweLxPN3\n wVwq7Dwirp0KVuB4NVgLXgSvg/fA+6C1Jf6gO+gF+oI9wQa3YQ4FwwDlwREwR4Mj+L6GY3Dv\n eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9cA64Dt4I7wT3gQfA4eAI8DdaKd7wizLdgvg86dUWa\n g+1BL0D3+sIcAAaLc5X9xfUDYR4EDlUYJR2PAUeCY8FJ4DRwJjgXTAezwBwwD1wDrgO3gjuF\n G/fAfBA8Js5XwnwaPF/htypeFfbfhvm+w7OdtkL6Axe3th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t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), ot = Object.fromEntries(at.values.map((e, t) => [e, t])), { values: st } = at, { AI: ct, AL: lt, CJ: ut, CM: dt, NS: ft, SA: pt, SG: mt, SP: ht, XX: gt } = ot;
3361
+ function _t(e) {
3360
3362
  switch (e) {
3361
3363
  case null: return null;
3362
3364
  case -1: return "sot";
3363
3365
  case -2: return "eot";
3364
- default: return ut[e];
3366
+ default: return st[e];
3365
3367
  }
3366
3368
  }
3367
- function bt(e, t) {
3369
+ function vt(e, t) {
3368
3370
  switch (e) {
3369
- case dt:
3370
- case gt:
3371
- case vt: return ft;
3372
- case ht: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? z : ft;
3373
- case pt: return mt;
3371
+ case ct:
3372
+ case mt:
3373
+ case gt: return lt;
3374
+ case pt: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? dt : lt;
3375
+ case ut: return ft;
3374
3376
  }
3375
3377
  return e;
3376
3378
  }
3377
- var B = class {
3379
+ var yt = class {
3378
3380
  cp = -Infinity;
3379
3381
  cls = -1;
3380
3382
  char = "";
@@ -3384,15 +3386,15 @@ var B = class {
3384
3386
  this.cls = e, this.cp = t, this.char = n, this.len = r;
3385
3387
  }
3386
3388
  [Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
3387
- return `${yt(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
3389
+ return `${_t(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
3388
3390
  }
3389
- }, xt = class {
3391
+ }, bt = class {
3390
3392
  str = "";
3391
3393
  len = 0;
3392
3394
  prevChunk = 0;
3393
- prev = new B(-1, -Infinity, "", 0);
3394
- cur = new B(-1, -Infinity, "", 0);
3395
- next = new B(-1, -Infinity, "", 0);
3395
+ prev = new yt(-1, -Infinity, "", 0);
3396
+ cur = new yt(-1, -Infinity, "", 0);
3397
+ next = new yt(-1, -Infinity, "", 0);
3396
3398
  LB8 = !1;
3397
3399
  spaces = !1;
3398
3400
  RI = 0;
@@ -3405,13 +3407,13 @@ var B = class {
3405
3407
  this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
3406
3408
  }
3407
3409
  pushEnd() {
3408
- this.push(new B(-2, Infinity, "", this.next.len));
3410
+ this.push(new yt(-2, Infinity, "", this.next.len));
3409
3411
  }
3410
3412
  *codePoints(e, t = !0) {
3411
3413
  if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
3412
3414
  else {
3413
- let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = ct.get(t);
3414
- e += n.length, yield new B(bt(r, n), t, n, e);
3415
+ let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = at.get(t);
3416
+ e += n.length, yield new yt(vt(r, n), t, n, e);
3415
3417
  }
3416
3418
  else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
3417
3419
  else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
@@ -3419,11 +3421,11 @@ var B = class {
3419
3421
  let t = e - 1, n = this.str.charCodeAt(t);
3420
3422
  n >= 56320 && n <= 57343 && t--;
3421
3423
  let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
3422
- yield new B(bt(ct.get(r), i), r, i, e), e = t;
3424
+ yield new yt(vt(at.get(r), i), r, i, e), e = t;
3423
3425
  }
3424
3426
  }
3425
3427
  classAfterSpaces(e) {
3426
- for (let { cls: t } of this.codePoints(e)) if (t !== _t) return t;
3428
+ for (let { cls: t } of this.codePoints(e)) if (t !== ht) return t;
3427
3429
  return -2;
3428
3430
  }
3429
3431
  afterNext(e = 1) {
@@ -3437,64 +3439,64 @@ var B = class {
3437
3439
  let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
3438
3440
  return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
3439
3441
  }
3440
- }, V = class {
3442
+ }, H = class {
3441
3443
  string = void 0;
3442
3444
  props = void 0;
3443
3445
  constructor(e, t = !1) {
3444
3446
  this.position = e, this.required = t;
3445
3447
  }
3446
- }, H = R.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
3447
- Object.fromEntries(H.values.map((e, t) => [e, t]));
3448
- var { values: St } = H, { AK: Ct, AL: U, AP: wt, AS: Tt, B2: Et, BA: Dt, BB: Ot, BK: kt, CB: At, CL: jt, CM: Mt, CP: Nt, CR: Pt, EB: Ft, EM: It, EX: Lt, GL: Rt, H2: zt, H3: Bt, HH: Vt, HL: W, HY: Ht, ID: Ut, IN: Wt, IS: G, JL: Gt, JT: Kt, JV: qt, LF: Jt, NU: K, OP: Yt, NL: Xt, NS: Zt, PO: Qt, PR: $t, RI: en, SP: q, SY: tn, QU: J, VF: nn, VI: rn, WJ: an, ZW: on, ZWJ: sn } = lt, cn = /* @__PURE__ */ new Set([
3449
- U,
3448
+ }, U = it.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
3449
+ Object.fromEntries(U.values.map((e, t) => [e, t]));
3450
+ var { values: xt } = U, { AK: St, AL: W, AP: Ct, AS: wt, B2: Tt, BA: Et, BB: Dt, BK: Ot, CB: kt, CL: At, CM: jt, CP: Mt, CR: Nt, EB: Pt, EM: Ft, EX: It, GL: Lt, H2: Rt, H3: zt, HH: Bt, HL: G, HY: Vt, ID: Ht, IN: Ut, IS: Wt, JL: Gt, JT: Kt, JV: qt, LF: Jt, NU: K, OP: Yt, NL: Xt, NS: Zt, PO: Qt, PR: $t, RI: en, SP: q, SY: tn, QU: J, VF: nn, VI: rn, WJ: an, ZW: on, ZWJ: sn } = ot, cn = /* @__PURE__ */ new Set([
3450
3451
  W,
3452
+ G,
3451
3453
  K
3452
3454
  ]), ln = /* @__PURE__ */ new Set([
3453
- kt,
3454
- Pt,
3455
+ Ot,
3456
+ Nt,
3455
3457
  Jt,
3456
3458
  Xt,
3457
3459
  q,
3458
3460
  on
3459
3461
  ]), un = /* @__PURE__ */ new Set([
3460
- Ut,
3461
- Ft,
3462
- It
3462
+ Ht,
3463
+ Pt,
3464
+ Ft
3463
3465
  ]), dn = /* @__PURE__ */ new Set([
3464
3466
  Gt,
3465
3467
  qt,
3466
- zt,
3467
- Bt
3468
+ Rt,
3469
+ zt
3468
3470
  ]), fn = /* @__PURE__ */ new Set([
3469
3471
  Gt,
3470
3472
  qt,
3471
3473
  Kt,
3472
- zt,
3473
- Bt
3474
+ Rt,
3475
+ zt
3474
3476
  ]), pn = /* @__PURE__ */ new Set([qt, Kt]), mn = /* @__PURE__ */ new Set([
3475
3477
  q,
3476
- Rt,
3478
+ Lt,
3477
3479
  an,
3478
- jt,
3480
+ At,
3479
3481
  J,
3480
- Nt,
3481
- Lt,
3482
- G,
3482
+ Mt,
3483
+ It,
3484
+ Wt,
3483
3485
  tn,
3484
- kt,
3485
- Pt,
3486
+ Ot,
3487
+ Nt,
3486
3488
  Jt,
3487
3489
  Xt,
3488
3490
  on
3489
3491
  ]), hn = /* @__PURE__ */ new Set([
3490
3492
  -1,
3491
- kt,
3492
- Pt,
3493
+ Ot,
3494
+ Nt,
3493
3495
  Jt,
3494
3496
  Xt,
3495
3497
  Yt,
3496
3498
  J,
3497
- Rt,
3499
+ Lt,
3498
3500
  q,
3499
3501
  on
3500
3502
  ]), Y = Symbol("PASS"), X = Symbol("NO_BREAK"), gn = Symbol("MAY_BREAK"), _n = Symbol("MUST_BREAK");
@@ -3505,11 +3507,11 @@ function yn(e) {
3505
3507
  return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? _n : Y;
3506
3508
  }
3507
3509
  function bn(e) {
3508
- return e.cur.cls === kt ? _n : Y;
3510
+ return e.cur.cls === Ot ? _n : Y;
3509
3511
  }
3510
3512
  function xn(e) {
3511
3513
  switch (e.cur.cls) {
3512
- case Pt: return e.next.cls === Jt ? X : _n;
3514
+ case Nt: return e.next.cls === Jt ? X : _n;
3513
3515
  case Jt:
3514
3516
  case Xt: return _n;
3515
3517
  }
@@ -3517,8 +3519,8 @@ function xn(e) {
3517
3519
  }
3518
3520
  function Sn(e) {
3519
3521
  switch (e.next.cls) {
3520
- case kt:
3521
- case Pt:
3522
+ case Ot:
3523
+ case Nt:
3522
3524
  case Jt:
3523
3525
  case Xt: return X;
3524
3526
  }
@@ -3533,9 +3535,9 @@ function wn(e) {
3533
3535
  case on:
3534
3536
  case Yt:
3535
3537
  case J:
3536
- case jt:
3537
- case Nt:
3538
- case Et: break;
3538
+ case At:
3539
+ case Mt:
3540
+ case Tt: break;
3539
3541
  default: return X;
3540
3542
  }
3541
3543
  return Y;
@@ -3547,32 +3549,32 @@ function En(e) {
3547
3549
  return e.cur.cls === sn ? X : Y;
3548
3550
  }
3549
3551
  function Dn(e) {
3550
- return !ln.has(e.cur.cls) && (e.next.cls === Mt || e.next.cls === sn) ? (e.next.ignored = !0, X) : Y;
3552
+ return !ln.has(e.cur.cls) && (e.next.cls === jt || e.next.cls === sn) ? (e.next.ignored = !0, X) : Y;
3551
3553
  }
3552
3554
  function On(e) {
3553
- return e.cur.cls === Mt && (e.cur.cls = U), e.next.cls === Mt && (e.next.cls = U), Y;
3555
+ return e.cur.cls === jt && (e.cur.cls = W), e.next.cls === jt && (e.next.cls = W), Y;
3554
3556
  }
3555
3557
  function kn(e) {
3556
3558
  return e.next.cls === an || e.cur.cls === an ? X : Y;
3557
3559
  }
3558
3560
  function An(e) {
3559
- return e.cur.cls === Rt ? X : Y;
3561
+ return e.cur.cls === Lt ? X : Y;
3560
3562
  }
3561
3563
  function jn(e) {
3562
- if (e.next.cls === Rt) switch (e.cur.cls) {
3564
+ if (e.next.cls === Lt) switch (e.cur.cls) {
3563
3565
  case q:
3564
- case Dt:
3565
- case Ht:
3566
- case Vt: return Y;
3566
+ case Et:
3567
+ case Vt:
3568
+ case Bt: return Y;
3567
3569
  default: return X;
3568
3570
  }
3569
3571
  return Y;
3570
3572
  }
3571
3573
  function Mn(e) {
3572
3574
  switch (e.next.cls) {
3573
- case jt:
3574
- case Nt:
3575
- case Lt:
3575
+ case At:
3576
+ case Mt:
3577
+ case It:
3576
3578
  case tn: return X;
3577
3579
  }
3578
3580
  return Y;
@@ -3591,21 +3593,21 @@ function Fn(e) {
3591
3593
  return Y;
3592
3594
  }
3593
3595
  function In(e) {
3594
- return e.cur.cls === q && e.next.cls === G && e.afterNext()?.cls === K ? gn : Y;
3596
+ return e.cur.cls === q && e.next.cls === Wt && e.afterNext()?.cls === K ? gn : Y;
3595
3597
  }
3596
3598
  function Ln(e) {
3597
- return e.next.cls === G ? X : Y;
3599
+ return e.next.cls === Wt ? X : Y;
3598
3600
  }
3599
3601
  function Rn(e) {
3600
- if (e.cur.cls === jt || e.cur.cls === Nt) {
3602
+ if (e.cur.cls === At || e.cur.cls === Mt) {
3601
3603
  if (e.classAfterSpaces(e.cur.len) === Zt) return e.next.cls === q && (e.spaces = !0), X;
3602
3604
  if (e.next.cls === q) return X;
3603
3605
  }
3604
3606
  return Y;
3605
3607
  }
3606
3608
  function zn(e) {
3607
- if (e.cur.cls === Et) {
3608
- if (e.classAfterSpaces(e.cur.len) === Et) return e.next.cls === q && (e.spaces = !0), X;
3609
+ if (e.cur.cls === Tt) {
3610
+ if (e.classAfterSpaces(e.cur.len) === Tt) return e.next.cls === q && (e.spaces = !0), X;
3609
3611
  if (e.next.cls === q) return X;
3610
3612
  }
3611
3613
  return Y;
@@ -3617,56 +3619,56 @@ function Vn(e) {
3617
3619
  return e.next.cls === J && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === J && !/^\p{Pf}$/u.test(e.cur.char) ? X : Y;
3618
3620
  }
3619
3621
  function Hn(e) {
3620
- if (!H.get(e.cur.cp) && e.next.cls === J) return X;
3622
+ if (!U.get(e.cur.cp) && e.next.cls === J) return X;
3621
3623
  if (e.next.cls === J) {
3622
3624
  let t = e.afterNext();
3623
- if (!t || !H.get(t.cp)) return X;
3625
+ if (!t || !U.get(t.cp)) return X;
3624
3626
  }
3625
- return e.cur.cls === J && !H.get(e.next.cp) || (e.prev.cls === -1 || !H.get(e.prev.cp)) && e.cur.cls === J ? X : Y;
3627
+ return e.cur.cls === J && !U.get(e.next.cp) || (e.prev.cls === -1 || !U.get(e.prev.cp)) && e.cur.cls === J ? X : Y;
3626
3628
  }
3627
3629
  function Un(e) {
3628
- return e.cur.cls === At || e.next.cls === At ? gn : Y;
3630
+ return e.cur.cls === kt || e.next.cls === kt ? gn : Y;
3629
3631
  }
3630
3632
  var Wn = /* @__PURE__ */ new Set([
3631
3633
  -1,
3632
- kt,
3633
- Pt,
3634
+ Ot,
3635
+ Nt,
3634
3636
  Jt,
3635
3637
  Xt,
3636
3638
  q,
3637
3639
  on,
3638
- At,
3639
- Rt
3640
+ kt,
3641
+ Lt
3640
3642
  ]);
3641
3643
  function Gn(e) {
3642
- return Wn.has(e.prev.cls) && (e.cur.cls === Ht || e.cur.cls === Vt) && (e.next.cls === U || e.next.cls === W) ? X : Y;
3644
+ return Wn.has(e.prev.cls) && (e.cur.cls === Vt || e.cur.cls === Bt) && (e.next.cls === W || e.next.cls === G) ? X : Y;
3643
3645
  }
3644
3646
  function Kn(e) {
3645
- if (e.cur.cls === Ot) return X;
3647
+ if (e.cur.cls === Dt) return X;
3646
3648
  switch (e.next.cls) {
3647
- case Dt:
3649
+ case Et:
3650
+ case Bt:
3648
3651
  case Vt:
3649
- case Ht:
3650
3652
  case Zt: return X;
3651
3653
  }
3652
3654
  return Y;
3653
3655
  }
3654
3656
  function qn(e) {
3655
- return e.prev.cls === W && (e.cur.cls === Ht || e.cur.cls === Vt) && e.next.cls !== W ? X : Y;
3657
+ return e.prev.cls === G && (e.cur.cls === Vt || e.cur.cls === Bt) && e.next.cls !== G ? X : Y;
3656
3658
  }
3657
3659
  function Jn(e) {
3658
- return e.cur.cls === tn && e.next.cls === W ? X : Y;
3660
+ return e.cur.cls === tn && e.next.cls === G ? X : Y;
3659
3661
  }
3660
3662
  function Yn(e) {
3661
- return e.next.cls === Wt ? X : Y;
3663
+ return e.next.cls === Ut ? X : Y;
3662
3664
  }
3663
3665
  function Xn(e) {
3664
3666
  switch (e.cur.cls) {
3665
- case U:
3666
3667
  case W:
3668
+ case G:
3667
3669
  if (e.next.cls === K) return X;
3668
3670
  break;
3669
- case K: if (e.next.cls === U || e.next.cls === W) return X;
3671
+ case K: if (e.next.cls === W || e.next.cls === G) return X;
3670
3672
  }
3671
3673
  return Y;
3672
3674
  }
@@ -3674,24 +3676,24 @@ function Zn(e) {
3674
3676
  return e.cur.cls === $t && un.has(e.next.cls) || e.next.cls === Qt && un.has(e.cur.cls) ? X : Y;
3675
3677
  }
3676
3678
  function Qn(e) {
3677
- return (e.cur.cls === $t || e.cur.cls === Qt) && (e.next.cls === U || e.next.cls === W) || (e.cur.cls === U || e.cur.cls === W) && (e.next.cls === $t || e.next.cls === Qt) ? X : Y;
3679
+ return (e.cur.cls === $t || e.cur.cls === Qt) && (e.next.cls === W || e.next.cls === G) || (e.cur.cls === W || e.cur.cls === G) && (e.next.cls === $t || e.next.cls === Qt) ? X : Y;
3678
3680
  }
3679
- var $n = /* @__PURE__ */ new Set([Qt, $t]), er = /* @__PURE__ */ new Set([jt, Nt]);
3681
+ var $n = /* @__PURE__ */ new Set([Qt, $t]), er = /* @__PURE__ */ new Set([At, Mt]);
3680
3682
  function tr(e) {
3681
3683
  let t = null;
3682
3684
  if ($n.has(e.next.cls) ? t = er.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === K && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
3683
3685
  case tn:
3684
- case G: continue;
3686
+ case Wt: continue;
3685
3687
  case K: return X;
3686
3688
  default: break SyIsLoop;
3687
3689
  }
3688
3690
  if (e.cur.cls === Qt || e.cur.cls === $t) {
3689
3691
  if (e.next.cls === Yt) {
3690
3692
  let t = e.afterNext();
3691
- if (t && (t.cls === K || t.cls === G && e.afterNext(2)?.cls === K)) return X;
3693
+ if (t && (t.cls === K || t.cls === Wt && e.afterNext(2)?.cls === K)) return X;
3692
3694
  } else if (e.next.cls === K) return X;
3693
3695
  }
3694
- return e.cur.cls === Ht && e.next.cls === K || e.cur.cls === G && e.next.cls === K ? X : Y;
3696
+ return e.cur.cls === Vt && e.next.cls === K || e.cur.cls === Wt && e.next.cls === K ? X : Y;
3695
3697
  }
3696
3698
  function nr(e) {
3697
3699
  switch (e.cur.cls) {
@@ -3699,11 +3701,11 @@ function nr(e) {
3699
3701
  if (dn.has(e.next.cls)) return X;
3700
3702
  break;
3701
3703
  case qt:
3702
- case zt:
3704
+ case Rt:
3703
3705
  if (pn.has(e.next.cls)) return X;
3704
3706
  break;
3705
3707
  case Kt:
3706
- case Bt: if (e.next.cls === Kt) return X;
3708
+ case zt: if (e.next.cls === Kt) return X;
3707
3709
  }
3708
3710
  return Y;
3709
3711
  }
@@ -3712,8 +3714,8 @@ function rr(e) {
3712
3714
  case Gt:
3713
3715
  case qt:
3714
3716
  case Kt:
3717
+ case Rt:
3715
3718
  case zt:
3716
- case Bt:
3717
3719
  if (e.next.cls === Qt) return X;
3718
3720
  break;
3719
3721
  case $t: if (fn.has(e.next.cls)) return X;
@@ -3721,26 +3723,26 @@ function rr(e) {
3721
3723
  return Y;
3722
3724
  }
3723
3725
  function ar(e) {
3724
- return (e.cur.cls === U || e.cur.cls === W) && (e.next.cls === U || e.next.cls === W) ? X : Y;
3726
+ return (e.cur.cls === W || e.cur.cls === G) && (e.next.cls === W || e.next.cls === G) ? X : Y;
3725
3727
  }
3726
3728
  function or(e) {
3727
3729
  let { prev: t, cur: n, next: r } = e;
3728
3730
  function i(e) {
3729
- return e.cls === Ct || e.char === "◌" || e.cls === Tt;
3731
+ return e.cls === St || e.char === "◌" || e.cls === wt;
3730
3732
  }
3731
- return n.cls === wt && i(r) || i(n) && (r.cls === nn || r.cls === rn) || i(t) && n.cls === rn && (r.cls === Ct || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === nn ? X : Y;
3733
+ return n.cls === Ct && i(r) || i(n) && (r.cls === nn || r.cls === rn) || i(t) && n.cls === rn && (r.cls === St || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === nn ? X : Y;
3732
3734
  }
3733
3735
  function sr(e) {
3734
- return e.cur.cls === G && (e.next.cls === U || e.next.cls === W) ? X : Y;
3736
+ return e.cur.cls === Wt && (e.next.cls === W || e.next.cls === G) ? X : Y;
3735
3737
  }
3736
3738
  function cr(e) {
3737
3739
  switch (e.cur.cls) {
3738
- case U:
3739
3740
  case W:
3741
+ case G:
3740
3742
  case K:
3741
- if (e.next.cls === Yt && !H.get(e.next.cp)) return X;
3743
+ if (e.next.cls === Yt && !U.get(e.next.cp)) return X;
3742
3744
  break;
3743
- case Nt: if (!H.get(e.cur.cp) && cn.has(e.next.cls)) return X;
3745
+ case Mt: if (!U.get(e.cur.cp) && cn.has(e.next.cls)) return X;
3744
3746
  }
3745
3747
  return Y;
3746
3748
  }
@@ -3751,7 +3753,7 @@ function lr(e) {
3751
3753
  return Y;
3752
3754
  }
3753
3755
  function ur(e) {
3754
- return e.cur.cls === Ft && e.next.cls === It || e.next.cls === It && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? X : Y;
3756
+ return e.cur.cls === Pt && e.next.cls === Ft || e.next.cls === Ft && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? X : Y;
3755
3757
  }
3756
3758
  function dr() {
3757
3759
  return gn;
@@ -3837,8 +3839,8 @@ var fr = [
3837
3839
  switch (n) {
3838
3840
  case Y: break;
3839
3841
  case X: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
3840
- case gn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new V(e.cur.len);
3841
- case _n: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new V(e.cur.len, !0);
3842
+ case gn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new H(e.cur.len);
3843
+ case _n: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new H(e.cur.len, !0);
3842
3844
  default: throw Error(`Invalid state: "${n}"`);
3843
3845
  }
3844
3846
  }
@@ -3849,7 +3851,7 @@ var fr = [
3849
3851
  t && (this.#e.string && (t.string = e.str.slice(e.prevChunk, e.cur.len)), e.props &&= (t.props = e.props, void 0), yield t, e.prevChunk = e.cur.len);
3850
3852
  }
3851
3853
  *breaks(e) {
3852
- let t = new xt(e);
3854
+ let t = new bt(e);
3853
3855
  for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
3854
3856
  t.pushEnd(), yield* this.#n(t);
3855
3857
  }
@@ -3944,21 +3946,114 @@ function Sr(e) {
3944
3946
  });
3945
3947
  }
3946
3948
  //#endregion
3949
+ //#region src/reveal.ts
3950
+ var Cr = Object.freeze([
3951
+ "CHARACTER",
3952
+ "WORD",
3953
+ "LINE",
3954
+ "BLOCK"
3955
+ ]);
3956
+ function wr(e) {
3957
+ let t = globalThis.Intl?.Segmenter;
3958
+ return typeof t == "function" ? [...new t(void 0, { granularity: "grapheme" }).segment(e)].map(({ segment: e }) => e) : Array.from(e);
3959
+ }
3960
+ function Tr(e) {
3961
+ if (typeof e != "string" || !Cr.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
3962
+ return e;
3963
+ }
3964
+ function Er(e) {
3965
+ if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Bubble reveal must be an object.");
3966
+ let t = e, n = /* @__PURE__ */ new Set([
3967
+ "unit",
3968
+ "delimiters",
3969
+ "showDelimiters",
3970
+ "layout",
3971
+ "intervalSeconds",
3972
+ "sound"
3973
+ ]);
3974
+ if (Object.keys(t).filter((e) => !n.has(e)).length > 0 || t.unit === void 0) throw TypeError("Bubble reveal has unknown or missing properties.");
3975
+ let r = Tr(t.unit), i = t.delimiters ?? " \\t\\r\\n";
3976
+ if (typeof i != "string" || i.length === 0) throw TypeError("Bubble WORD delimiters must be a non-empty string.");
3977
+ let a = t.showDelimiters ?? !1;
3978
+ if (typeof a != "boolean") throw TypeError("Bubble reveal showDelimiters must be boolean.");
3979
+ let o = t.layout ?? "DYNAMIC";
3980
+ if (o !== "DYNAMIC" && o !== "RESERVED") throw TypeError("Bubble reveal layout must be DYNAMIC or RESERVED.");
3981
+ let s = t.intervalSeconds ?? 0;
3982
+ if (typeof s != "number" || !Number.isFinite(s) || s < 0) throw TypeError("Bubble reveal intervalSeconds must be zero or greater.");
3983
+ let c = t.sound;
3984
+ if (c !== void 0 && (typeof c != "string" || c.trim() === "")) throw TypeError("Bubble reveal sound must be a non-empty asset name.");
3985
+ return Object.freeze({
3986
+ unit: r,
3987
+ delimiters: i,
3988
+ showDelimiters: a,
3989
+ layout: o,
3990
+ intervalSeconds: s,
3991
+ ...c === void 0 ? {} : { sound: c.trim() }
3992
+ });
3993
+ }
3994
+ function Dr(e, t, n) {
3995
+ let r = new Set(wr(t)), i = [], a = "";
3996
+ for (let t of wr(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
3997
+ return a.length > 0 && i.push(a), i.filter((e) => e.length > 0);
3998
+ }
3999
+ function Or(e, t) {
4000
+ if (e.length === 0) return Object.freeze([""]);
4001
+ if (t.unit === "CHARACTER") return Object.freeze(wr(e));
4002
+ if (t.unit === "WORD") {
4003
+ let n = Dr(e, t.delimiters, t.showDelimiters);
4004
+ if (t.showDelimiters) return Object.freeze(n);
4005
+ let r = [], i = 0;
4006
+ for (let a of n) {
4007
+ let n = e.indexOf(a, i);
4008
+ if (n < 0) r.push(a);
4009
+ else for (r.push(a), i = n + a.length; i < e.length && t.delimiters.includes(e[i] ?? "");) i += 1;
4010
+ }
4011
+ return Object.freeze(r);
4012
+ }
4013
+ let n = t.unit === "LINE" ? /(?<=\n)/u : /\n{2,}/u, r = e.split(n).filter((e) => e.length > 0);
4014
+ if (t.unit === "BLOCK") {
4015
+ let t = [...e.matchAll(/\n{2,}/gu)].map(([e]) => e), n = r.map((e, n) => n < t.length ? `${e}${t[n] ?? ""}` : e);
4016
+ return Object.freeze(n.length > 0 ? n : [e]);
4017
+ }
4018
+ let i = r;
4019
+ return Object.freeze(i.length > 0 ? i : [e]);
4020
+ }
4021
+ function kr(e, t) {
4022
+ return e.slice(0, Math.max(0, Math.min(t, e.length))).join("");
4023
+ }
4024
+ //#endregion
3947
4025
  //#region src/composition.ts
3948
4026
  var Z = class extends Error {
3949
4027
  code;
3950
4028
  constructor(e, t) {
3951
4029
  super(t), this.name = "BubbleCompositionError", this.code = e;
3952
4030
  }
3953
- }, Cr = /* @__PURE__ */ new Set(["say", "think"]), wr = /* @__PURE__ */ new Set([
4031
+ }, Ar = /* @__PURE__ */ new Set(["say", "think"]), jr = /* @__PURE__ */ new Set([
3954
4032
  "idle",
3955
4033
  "talking",
3956
- "awaiting-advance"
4034
+ "awaiting-continue"
4035
+ ]), Mr = /* @__PURE__ */ new Set([
4036
+ "fadeIn",
4037
+ "fadeOut",
4038
+ "floatIn",
4039
+ "floatOut",
4040
+ "zoomIn",
4041
+ "zoomOut",
4042
+ "riseUp",
4043
+ "sink",
4044
+ "shake",
4045
+ "explode",
4046
+ "animateBubbleShape"
4047
+ ]), Nr = /* @__PURE__ */ new Set([
4048
+ "linear",
4049
+ "easeIn",
4050
+ "easeOut",
4051
+ "easeInOut"
3957
4052
  ]);
3958
4053
  function Q(e) {
3959
4054
  return typeof e == "object" && !!e && !Array.isArray(e);
3960
4055
  }
3961
- function Tr(e, t, n, r) {
4056
+ function Pr(e, t, n, r) {
3962
4057
  let i = /* @__PURE__ */ new Set([...t, ...n]), a = t.filter((t) => !Object.prototype.hasOwnProperty.call(e, t)), o = Object.keys(e).filter((e) => !i.has(e));
3963
4058
  if (a.length > 0 || o.length > 0) throw new Z("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
3964
4059
  }
@@ -3966,9 +4061,9 @@ function $(e, t) {
3966
4061
  if (typeof e != "string" || e.trim().length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
3967
4062
  return e.trim();
3968
4063
  }
3969
- function Er(e, t, n) {
4064
+ function Fr(e, t, n) {
3970
4065
  if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
3971
- if (Tr(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
4066
+ if (Pr(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
3972
4067
  let r = Object.freeze(e.frames.map((e, n) => $(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
3973
4068
  if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
3974
4069
  return Object.freeze({
@@ -3976,111 +4071,222 @@ function Er(e, t, n) {
3976
4071
  frameIntervalSeconds: i
3977
4072
  });
3978
4073
  }
3979
- function Dr(e) {
4074
+ function Ir(e) {
3980
4075
  if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
3981
- Tr(e, ["base"], ["blink", "talk"], "Bubble portrait");
3982
- let t = e.blink === void 0 ? void 0 : Er(e.blink, "Bubble portrait blink", 1), n = e.talk === void 0 ? void 0 : Er(e.talk, "Bubble portrait talk", 1);
4076
+ Pr(e, ["base"], ["blink", "lipSync"], "Bubble portrait");
4077
+ let t = e.blink === void 0 ? void 0 : Fr(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Fr(e.lipSync, "Bubble portrait lip-sync", 1);
3983
4078
  return Object.freeze({
3984
4079
  base: $(e.base, "Bubble portrait base"),
3985
4080
  ...t === void 0 ? {} : { blink: t },
3986
- ...n === void 0 ? {} : { talk: n }
4081
+ ...n === void 0 ? {} : { lipSync: n }
4082
+ });
4083
+ }
4084
+ function Lr(e, t) {
4085
+ if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
4086
+ if (Pr(e, ["name"], [
4087
+ "durationSeconds",
4088
+ "ease",
4089
+ "direction",
4090
+ "count",
4091
+ "relativeScale",
4092
+ "speed",
4093
+ "visualStyle"
4094
+ ], t), !Mr.has(e.name)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
4095
+ let n = (n, r, i = !1) => {
4096
+ let a = e[n];
4097
+ if (a !== void 0) {
4098
+ if (typeof a != "number" || !Number.isFinite(a) || a < r || i && !Number.isInteger(a)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.${n} is invalid.`);
4099
+ return a;
4100
+ }
4101
+ }, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
4102
+ if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Z("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
4103
+ let c = e.ease ?? "easeInOut";
4104
+ if (typeof c != "string" || !Nr.has(c)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
4105
+ let l = e.visualStyle;
4106
+ if (l !== void 0 && (typeof l != "string" || !M.includes(l))) throw new Z("BUBBLE-COMPOSITION-001", `${t}.visualStyle is invalid.`);
4107
+ return Object.freeze({
4108
+ name: e.name,
4109
+ ...r === void 0 ? {} : { durationSeconds: r },
4110
+ ease: c,
4111
+ ...s === void 0 ? {} : { direction: s },
4112
+ ...i === void 0 ? {} : { count: i },
4113
+ ...a === void 0 ? {} : { relativeScale: a },
4114
+ ...o === void 0 ? {} : { speed: o },
4115
+ ...l === void 0 ? {} : { visualStyle: l }
3987
4116
  });
3988
4117
  }
3989
- function Or(e) {
4118
+ function Rr(e) {
4119
+ if (e === void 0) return;
4120
+ if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
4121
+ Pr(e, [], [
4122
+ "voice",
4123
+ "reveal",
4124
+ "finish"
4125
+ ], "Bubble audio");
4126
+ let t = {};
4127
+ for (let n of [
4128
+ "voice",
4129
+ "reveal",
4130
+ "finish"
4131
+ ]) {
4132
+ let r = e[n];
4133
+ r !== void 0 && (t[n] = $(r, `Bubble audio ${n}`));
4134
+ }
4135
+ return Object.freeze(t);
4136
+ }
4137
+ function zr(e) {
3990
4138
  if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
3991
- Tr(e, ["name", "textStyle"], [
4139
+ Pr(e, ["name", "textStyle"], [
3992
4140
  "placement",
4141
+ "maxWidth",
4142
+ "textLocale",
3993
4143
  "distance",
3994
4144
  "tailLength",
3995
4145
  "offset",
3996
4146
  "visualStyle",
3997
4147
  "portrait",
3998
- "advanceIndicator"
4148
+ "continueIndicator",
4149
+ "reveal",
4150
+ "audio",
4151
+ "showAnimation",
4152
+ "hideAnimation"
3999
4153
  ], "Bubble style");
4000
- let t = e.portrait === void 0 ? void 0 : Dr(e.portrait), n = e.advanceIndicator === void 0 ? void 0 : Er(e.advanceIndicator, "Bubble advance indicator", 2), r;
4154
+ let t = e.portrait === void 0 ? void 0 : Ir(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Fr(e.continueIndicator, "Bubble continue indicator", 2), r;
4155
+ if (e.reveal !== void 0) try {
4156
+ r = Er(e.reveal);
4157
+ } catch (e) {
4158
+ throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
4159
+ }
4160
+ let i = Rr(e.audio), a = e.showAnimation === void 0 ? void 0 : Lr(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : Lr(e.hideAnimation, "Bubble hideAnimation"), s;
4001
4161
  try {
4002
- r = y(e.placement ?? "up-right");
4162
+ s = y(e.placement ?? "up-right");
4003
4163
  } catch (e) {
4004
4164
  throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble placement is invalid.");
4005
4165
  }
4006
- let i, a, o;
4166
+ let c, l, u;
4007
4167
  try {
4008
- i = C(e.distance ?? 12), a = ne(e.tailLength ?? 18), o = e.offset === void 0 ? te : w(e.offset);
4168
+ c = T(e.distance ?? 12), l = E(e.tailLength ?? 18), u = e.offset === void 0 ? C : D(e.offset);
4009
4169
  } catch (e) {
4010
4170
  throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble actor-relative transform is invalid.");
4011
4171
  }
4012
- let s = e.visualStyle ?? "NORMAL";
4013
- if (typeof s != "string" || !D.includes(s)) throw new Z("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(s)}`);
4172
+ let d = e.visualStyle ?? "NORMAL";
4173
+ if (typeof d != "string" || !M.includes(d)) throw new Z("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(d)}`);
4174
+ let f;
4175
+ if (e.maxWidth !== void 0) {
4176
+ if (typeof e.maxWidth != "number" || !Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style maxWidth must be a positive finite number.");
4177
+ f = e.maxWidth;
4178
+ }
4179
+ let p = e.textLocale === void 0 ? void 0 : $(e.textLocale, "Bubble style text locale");
4014
4180
  return Object.freeze({
4015
4181
  name: $(e.name, "Bubble style name"),
4016
4182
  textStyle: $(e.textStyle, "Bubble text style name"),
4017
- placement: r,
4018
- distance: i,
4019
- tailLength: a,
4020
- offset: o,
4021
- visualStyle: s,
4183
+ ...f === void 0 ? {} : { maxWidth: f },
4184
+ ...p === void 0 ? {} : { textLocale: p },
4185
+ placement: s,
4186
+ distance: c,
4187
+ tailLength: l,
4188
+ offset: u,
4189
+ visualStyle: d,
4022
4190
  ...t === void 0 ? {} : { portrait: t },
4023
- ...n === void 0 ? {} : { advanceIndicator: n }
4191
+ ...n === void 0 ? {} : { continueIndicator: n },
4192
+ ...r === void 0 ? {} : { reveal: r },
4193
+ ...i === void 0 ? {} : { audio: i },
4194
+ ...a === void 0 ? {} : { showAnimation: a },
4195
+ ...o === void 0 ? {} : { hideAnimation: o }
4024
4196
  });
4025
4197
  }
4026
- function kr(e) {
4027
- if (!Q(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble asset manager must provide applyToTarget, getMimeType, and isRegistered.");
4198
+ function Br(e) {
4199
+ if (e !== void 0) {
4200
+ if (!Q(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
4201
+ return e;
4202
+ }
4203
+ }
4204
+ function Vr(e) {
4205
+ if (e !== void 0) {
4206
+ if (!Q(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
4207
+ if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
4208
+ if (e.getMimeType !== void 0 && typeof e.getMimeType != "function") throw TypeError("Bubble audio capability getMimeType must be a function.");
4209
+ return e;
4210
+ }
4211
+ }
4212
+ function Hr(e) {
4213
+ if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
4028
4214
  return e;
4029
4215
  }
4030
- function Ar(e) {
4216
+ function Ur(e) {
4031
4217
  if (!Q(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble SVG Text composition must provide setText and releaseTarget.");
4032
4218
  return e;
4033
4219
  }
4034
- function jr() {
4220
+ function Wr() {
4035
4221
  return Object.freeze({
4036
4222
  setTimeout: (e, t) => globalThis.setTimeout(e, t),
4037
4223
  clearTimeout: (e) => globalThis.clearTimeout(e)
4038
4224
  });
4039
4225
  }
4040
- function Mr(e) {
4226
+ function Gr(e) {
4041
4227
  if (!Q(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
4042
4228
  return e;
4043
4229
  }
4044
- function Nr(e, t) {
4230
+ function Kr(e, t) {
4045
4231
  if (!Q(e) || typeof e.id != "string" || e.id.length === 0 || typeof e.isStage != "boolean") throw new Z("BUBBLE-COMPOSITION-004", `${t} must provide id and isStage.`);
4046
4232
  return e;
4047
4233
  }
4048
- function Pr(e) {
4234
+ function qr(e) {
4049
4235
  if (!Q(e) || typeof e.drawableID != "number" || !Number.isInteger(e.drawableID) || e.drawableID < 0) throw new Z("BUBBLE-COMPOSITION-004", "Bubble text target must provide a non-negative integer drawableID.");
4050
4236
  return e;
4051
4237
  }
4052
- function Fr(e, t) {
4053
- if (!Q(e) || !Q(e.targets) || typeof e.setLayerVisible != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new Z("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
4238
+ function Jr(e, t) {
4239
+ if (!Q(e) || !Q(e.targets) || typeof e.setLayerVisible != "function" || typeof e.updateStyle != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new Z("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
4054
4240
  let n = e.targets;
4055
- Pr(n.text);
4241
+ qr(n.text);
4056
4242
  let r = /* @__PURE__ */ new Set(), i = (e, t) => {
4057
4243
  let i = n[e];
4058
4244
  if (!t && i === void 0) return;
4059
- let a = Nr(i, `Bubble surface ${e}`);
4245
+ let a = Kr(i, `Bubble surface ${e}`);
4060
4246
  if (r.has(a.id)) throw new Z("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
4061
4247
  r.add(a.id);
4062
4248
  };
4063
- return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitTalk", t.portrait?.talk !== void 0), i("advanceIndicator", t.advanceIndicator !== void 0), e;
4249
+ return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitLipSync", t.portrait?.lipSync !== void 0), i("continueIndicator", t.continueIndicator !== void 0), e;
4064
4250
  }
4065
- function Ir(e, t) {
4251
+ function Yr(e, t) {
4252
+ if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
4066
4253
  if (!e.isRegistered(t)) throw new Z("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
4067
4254
  if (!e.getMimeType(t).startsWith("image/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
4068
4255
  }
4069
- function Lr(e) {
4256
+ function Xr(e, t) {
4257
+ if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
4258
+ if (e.isRegistered?.(t) === !1) throw new Z("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
4259
+ let n = e.getMimeType?.(t);
4260
+ if (n !== void 0 && !n.startsWith("audio/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
4261
+ }
4262
+ function Zr(e) {
4070
4263
  return [...e.portrait === void 0 ? [] : [
4071
4264
  e.portrait.base,
4072
4265
  ...e.portrait.blink?.frames ?? [],
4073
- ...e.portrait.talk?.frames ?? []
4074
- ], ...e.advanceIndicator?.frames ?? []];
4266
+ ...e.portrait.lipSync?.frames ?? []
4267
+ ], ...e.continueIndicator?.frames ?? []];
4075
4268
  }
4076
- function Rr(e, t) {
4269
+ function Qr(e, t, n) {
4270
+ if (t.maxWidth === void 0) return e;
4271
+ if (typeof n.measureText != "function") throw new Z("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
4272
+ return Sr({
4273
+ text: e,
4274
+ maxWidth: t.maxWidth,
4275
+ ...t.textLocale === void 0 ? {} : { locale: t.textLocale },
4276
+ measureText: (e) => n.measureText?.({
4277
+ styleName: t.textStyle,
4278
+ text: e
4279
+ }) ?? 0
4280
+ }).lines.map(({ text: e }) => e).join("\n");
4281
+ }
4282
+ function $r(e, t) {
4077
4283
  if (e.length === 1) throw e[0];
4078
4284
  if (e.length > 1) throw AggregateError(e, t);
4079
4285
  }
4080
- function zr(e) {
4286
+ function ei(e) {
4081
4287
  let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
4082
4288
  let n = e.animation.frames[t];
4083
- n !== void 0 && await e.assetManager.applyToTarget(n, e.target);
4289
+ n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
4084
4290
  }, s = (t, n) => {
4085
4291
  e.onError?.(t, Object.freeze({
4086
4292
  actorKey: e.actorKey,
@@ -4112,206 +4318,375 @@ function zr(e) {
4112
4318
  }
4113
4319
  });
4114
4320
  }
4115
- function Br(e) {
4321
+ function ti(e) {
4116
4322
  if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
4117
- if (Tr(e, [
4323
+ if (Pr(e, [
4118
4324
  "actor",
4119
4325
  "actorKey",
4120
4326
  "kind",
4121
4327
  "text",
4122
4328
  "styleName"
4123
- ], ["animationMode"], "Show bubble input"), !Cr.has(e.kind)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
4329
+ ], ["animationMode", "reveal"], "Show bubble input"), !Ar.has(e.kind)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
4124
4330
  if (typeof e.text != "string") throw new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string.");
4125
4331
  let t = e.animationMode ?? "talking";
4126
- if (!wr.has(t)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
4332
+ if (!jr.has(t)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
4333
+ let n;
4334
+ if (e.reveal !== void 0) try {
4335
+ n = Er(e.reveal);
4336
+ } catch (e) {
4337
+ throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
4338
+ }
4127
4339
  return {
4128
4340
  actor: e.actor,
4129
4341
  actorKey: $(e.actorKey, "Bubble actor key"),
4130
4342
  kind: e.kind,
4131
4343
  text: e.text,
4132
4344
  styleName: $(e.styleName, "Bubble style name"),
4133
- animationMode: t
4345
+ animationMode: t,
4346
+ ...n === void 0 ? {} : { reveal: n }
4134
4347
  };
4135
4348
  }
4136
- function Vr(e) {
4349
+ function ni(e) {
4137
4350
  if (!Q(e)) throw TypeError("Bubble composition options must be an object.");
4138
- let t = kr(e.assetManager), n = Ar(e.svgText);
4351
+ let t = Br(e.imageResolver), n = Vr(e.audio), r = Ur(e.svgText);
4139
4352
  if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
4140
4353
  if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
4141
- let r = Mr(e.scheduler ?? jr()), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = !1, c = () => {
4142
- if (s) throw new Z("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
4143
- }, l = async (e, t) => {
4144
- let n = (o.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
4145
- o.set(e, n);
4354
+ let i = Gr(e.scheduler ?? Wr()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
4355
+ if (c) throw new Z("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
4356
+ }, u = async (e, t) => {
4357
+ let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
4358
+ s.set(e, n);
4146
4359
  try {
4147
4360
  return await n;
4148
4361
  } finally {
4149
- o.get(e) === n && o.delete(e);
4362
+ s.get(e) === n && s.delete(e);
4150
4363
  }
4151
- }, u = async (o) => {
4152
- c();
4153
- let s = i.get(o.styleName);
4154
- if (!s) throw new Z("BUBBLE-COMPOSITION-002", `Bubble style is not defined: ${o.styleName}`);
4155
- for (let e of new Set(Lr(s))) Ir(t, e);
4156
- let l = a.get(o.actorKey);
4157
- l && await l.close();
4158
- let u, d = !1, f = !1, p, m, h;
4159
- try {
4160
- u = Fr(await e.createSurface(Object.freeze({
4161
- actor: o.actor,
4162
- actorKey: o.actorKey,
4163
- kind: o.kind,
4164
- style: s
4165
- })), s), n.setText({
4166
- styleName: s.textStyle,
4167
- target: u.targets.text,
4168
- text: o.text
4169
- }), d = !0;
4170
- let i = [];
4171
- if (s.portrait) {
4172
- i.push(t.applyToTarget(s.portrait.base, u.targets.portraitBase));
4173
- let e = s.portrait.blink?.frames[0];
4174
- e !== void 0 && i.push(t.applyToTarget(e, u.targets.portraitBlink));
4175
- let n = s.portrait.talk?.frames[0];
4176
- n !== void 0 && i.push(t.applyToTarget(n, u.targets.portraitTalk));
4364
+ }, d = async (s) => {
4365
+ l();
4366
+ let c = a.get(s.styleName);
4367
+ if (!c) throw new Z("BUBBLE-COMPOSITION-002", `Bubble style is not defined: ${s.styleName}`);
4368
+ let u = c;
4369
+ s.reveal !== void 0 && (u = Object.freeze({
4370
+ ...c,
4371
+ reveal: s.reveal
4372
+ }));
4373
+ let d = s.text, f = (e) => {
4374
+ let n = new Set(Zr(e)), r = n.size === 0 ? void 0 : Hr(t);
4375
+ for (let e of n) Yr(r, e);
4376
+ return r;
4377
+ }, p = f(u);
4378
+ for (let e of [
4379
+ u.audio?.voice,
4380
+ u.audio?.reveal,
4381
+ u.audio?.finish,
4382
+ u.reveal?.sound
4383
+ ]) e !== void 0 && Xr(n, e);
4384
+ let m = async (e, t = !1) => {
4385
+ e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
4386
+ }, h = async (e, t, n) => {
4387
+ let r = Zr(e).length === 0 ? void 0 : Hr(t), i = [];
4388
+ if (e.portrait) {
4389
+ let t = Hr(r);
4390
+ i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
4391
+ let a = e.portrait.blink?.frames[0];
4392
+ a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
4393
+ let o = e.portrait.lipSync?.frames[0];
4394
+ o !== void 0 && i.push(Promise.resolve(t.applyToTarget(o, n.targets.portraitLipSync)));
4395
+ }
4396
+ let a = e.continueIndicator?.frames[0];
4397
+ if (a !== void 0) {
4398
+ let e = Hr(r);
4399
+ i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
4177
4400
  }
4178
- let c = s.advanceIndicator?.frames[0];
4179
- c !== void 0 && i.push(t.applyToTarget(c, u.targets.advanceIndicator)), await Promise.all(i), p = s.portrait?.blink === void 0 ? void 0 : zr({
4180
- actorKey: o.actorKey,
4401
+ await Promise.all(i);
4402
+ }, g = (t, n, r) => {
4403
+ x = t.portrait?.blink === void 0 ? void 0 : ei({
4404
+ actorKey: s.actorKey,
4181
4405
  layer: "portraitBlink",
4182
- animation: s.portrait.blink,
4183
- target: u.targets.portraitBlink,
4184
- assetManager: t,
4185
- scheduler: r,
4406
+ animation: t.portrait.blink,
4407
+ target: r.targets.portraitBlink,
4408
+ imageResolver: Hr(n),
4409
+ scheduler: i,
4186
4410
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4187
- }), m = s.portrait?.talk === void 0 ? void 0 : zr({
4188
- actorKey: o.actorKey,
4189
- layer: "portraitTalk",
4190
- animation: s.portrait.talk,
4191
- target: u.targets.portraitTalk,
4192
- assetManager: t,
4193
- scheduler: r,
4411
+ }), S = t.portrait?.lipSync === void 0 ? void 0 : ei({
4412
+ actorKey: s.actorKey,
4413
+ layer: "portraitLipSync",
4414
+ animation: t.portrait.lipSync,
4415
+ target: r.targets.portraitLipSync,
4416
+ imageResolver: Hr(n),
4417
+ scheduler: i,
4194
4418
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4195
- }), h = s.advanceIndicator === void 0 ? void 0 : zr({
4196
- actorKey: o.actorKey,
4197
- layer: "advanceIndicator",
4198
- animation: s.advanceIndicator,
4199
- target: u.targets.advanceIndicator,
4200
- assetManager: t,
4201
- scheduler: r,
4419
+ }), C = t.continueIndicator === void 0 ? void 0 : ei({
4420
+ actorKey: s.actorKey,
4421
+ layer: "continueIndicator",
4422
+ animation: t.continueIndicator,
4423
+ target: r.targets.continueIndicator,
4424
+ imageResolver: Hr(n),
4425
+ scheduler: i,
4202
4426
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4203
4427
  });
4204
- let l = "idle", g = !1, _ = Promise.resolve(), v = async (e) => {
4205
- e !== l && (e === "talking" ? (await h?.stop(), await u?.setLayerVisible("advanceIndicator", !1), await u?.setLayerVisible("portraitTalk", m !== void 0), await m?.start({ primed: !0 })) : e === "awaiting-advance" ? (await m?.stop({ reset: !0 }), await u?.setLayerVisible("portraitTalk", !1), await u?.setLayerVisible("advanceIndicator", h !== void 0), await h?.start({ primed: !0 })) : (await Promise.all([m?.stop({ reset: !0 }), h?.stop()]), await Promise.all([u?.setLayerVisible("portraitTalk", !1), u?.setLayerVisible("advanceIndicator", !1)])), l = e);
4428
+ }, _ = o.get(s.actorKey);
4429
+ _ && await _.close();
4430
+ let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? Or(s.text, w) : Object.freeze([s.text]), E = w ? Math.min(1, T.length) : 1, D, ee = 0;
4431
+ try {
4432
+ v = Jr(await e.createSurface(Object.freeze({
4433
+ actor: s.actor,
4434
+ actorKey: s.actorKey,
4435
+ kind: s.kind,
4436
+ style: u
4437
+ })), u);
4438
+ let t = Qr(s.text, u, r);
4439
+ w?.layout === "RESERVED" && (r.setText({
4440
+ styleName: u.textStyle,
4441
+ target: v.targets.text,
4442
+ text: t
4443
+ }), v.captureTextLayout?.()), r.setText({
4444
+ styleName: u.textStyle,
4445
+ target: v.targets.text,
4446
+ text: Qr(w ? kr(T, E) : s.text, u, r)
4447
+ }), y = !0, await h(u, p, v), g(u, p, v);
4448
+ let a = "idle", c = !1, l = Promise.resolve(), _ = async () => {
4449
+ if (!v) return;
4450
+ let e = w ? kr(T, E) : d;
4451
+ r.setText({
4452
+ styleName: u.textStyle,
4453
+ target: v.targets.text,
4454
+ text: Qr(e, u, r)
4455
+ }), await v.show();
4456
+ }, O = () => {
4457
+ ee += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
4458
+ }, te = async () => !w || E >= T.length ? !1 : (E += 1, await _(), await m(w.sound ?? u.audio?.reveal), E >= T.length && O(), !0), k = () => {
4459
+ if (!w || w.intervalSeconds <= 0 || E >= T.length) return;
4460
+ let e = ee;
4461
+ D = i.setTimeout(() => {
4462
+ D = void 0, !(c || e !== ee) && (l = l.then(() => te()).then(() => k()));
4463
+ }, w.intervalSeconds * 1e3);
4464
+ }, A = async (e) => {
4465
+ e !== a && (e === "talking" ? (await C?.stop(), await v?.setLayerVisible("continueIndicator", !1), await v?.setLayerVisible("portraitLipSync", S !== void 0), await S?.start({ primed: !0 })) : e === "awaiting-continue" ? (await S?.stop({ reset: !0 }), await v?.setLayerVisible("portraitLipSync", !1), await v?.setLayerVisible("continueIndicator", C !== void 0), await C?.start({ primed: !0 })) : (await Promise.all([S?.stop({ reset: !0 }), C?.stop()]), await Promise.all([v?.setLayerVisible("portraitLipSync", !1), v?.setLayerVisible("continueIndicator", !1)])), a = e);
4206
4466
  };
4207
4467
  await Promise.all([
4208
- u.setLayerVisible("portraitBase", s.portrait !== void 0),
4209
- u.setLayerVisible("portraitBlink", s.portrait?.blink !== void 0),
4210
- u.setLayerVisible("portraitTalk", !1),
4211
- u.setLayerVisible("advanceIndicator", !1)
4212
- ]), await u.show(), f = !0, await p?.start({ primed: !0 }), await v(o.animationMode);
4213
- let y = Object.freeze({
4214
- actorKey: o.actorKey,
4215
- kind: o.kind,
4468
+ v.setLayerVisible("portraitBase", u.portrait !== void 0),
4469
+ v.setLayerVisible("portraitBlink", u.portrait?.blink !== void 0),
4470
+ v.setLayerVisible("portraitLipSync", !1),
4471
+ v.setLayerVisible("continueIndicator", !1)
4472
+ ]), await v.show(), b = !0, await m(u.audio?.voice), w !== void 0 && await m(w.sound ?? u.audio?.reveal), await x?.start({ primed: !0 }), await A(s.animationMode);
4473
+ let j = Object.freeze({
4474
+ actorKey: s.actorKey,
4475
+ kind: s.kind,
4216
4476
  get animationMode() {
4217
- return l;
4477
+ return a;
4218
4478
  },
4219
4479
  setText(e) {
4220
- return g ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : typeof e == "string" ? (_ = _.then(async () => {
4221
- u && (n.setText({
4222
- styleName: s.textStyle,
4223
- target: u.targets.text,
4224
- text: e
4225
- }), await u.show());
4226
- }), _) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
4480
+ return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : typeof e == "string" ? (l = l.then(async () => {
4481
+ v && (O(), d = e, w ? (T = Or(e, w), E = Math.min(1, T.length), w.layout === "RESERVED" && (r.setText({
4482
+ styleName: u.textStyle,
4483
+ target: v.targets.text,
4484
+ text: Qr(e, u, r)
4485
+ }), v.captureTextLayout?.()), await _(), k()) : await _());
4486
+ }), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
4487
+ },
4488
+ updateStyle(e) {
4489
+ if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4490
+ let t;
4491
+ try {
4492
+ t = zr(e);
4493
+ } catch (e) {
4494
+ return Promise.reject(e);
4495
+ }
4496
+ return l = l.then(async () => {
4497
+ if (!v) return;
4498
+ Jr(v, t);
4499
+ let e = f(t);
4500
+ for (let e of [
4501
+ t.audio?.voice,
4502
+ t.audio?.reveal,
4503
+ t.audio?.finish,
4504
+ t.reveal?.sound
4505
+ ]) e !== void 0 && Xr(n, e);
4506
+ await Promise.all([
4507
+ x?.stop(),
4508
+ S?.stop(),
4509
+ C?.stop()
4510
+ ]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? Or(d, w) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, O(), w?.layout === "RESERVED" && (r.setText({
4511
+ styleName: t.textStyle,
4512
+ target: v.targets.text,
4513
+ text: Qr(d, t, r)
4514
+ }), v.captureTextLayout?.()), r.setText({
4515
+ styleName: t.textStyle,
4516
+ target: v.targets.text,
4517
+ text: Qr(d, t, r)
4518
+ }), g(t, e, v), await Promise.all([
4519
+ v.setLayerVisible("portraitBase", t.portrait !== void 0),
4520
+ v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
4521
+ v.setLayerVisible("portraitLipSync", !1),
4522
+ v.setLayerVisible("continueIndicator", !1)
4523
+ ]);
4524
+ let i = a;
4525
+ a = "idle", await x?.start({ primed: !0 }), await A(i), await _(), k(), await m(u.audio?.voice);
4526
+ }), l;
4227
4527
  },
4228
4528
  setAnimationMode(e) {
4229
- return g ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : wr.has(e) ? (_ = _.then(() => v(e)), _) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
4529
+ return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : jr.has(e) ? (l = l.then(() => A(e)), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
4530
+ },
4531
+ revealNext() {
4532
+ if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4533
+ let e = !1;
4534
+ return l = l.then(async () => {
4535
+ e = await te(), e && k();
4536
+ }), l.then(() => e);
4537
+ },
4538
+ revealAll() {
4539
+ return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : (l = l.then(async () => {
4540
+ if (O(), w) for (; await te(););
4541
+ }), l);
4542
+ },
4543
+ finish(e = {}) {
4544
+ if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4545
+ let t = e.timeoutSeconds ?? 0;
4546
+ return !Number.isFinite(t) || t < 0 ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish timeoutSeconds must be zero or greater.")) : e.condition !== void 0 && typeof e.condition != "function" ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish condition must be a function.")) : (l = l.then(async () => {
4547
+ if (O(), e.unit !== void 0 && (w = Er({
4548
+ ...w ?? {},
4549
+ unit: e.unit
4550
+ }), T = Or(d, w), E = Math.min(1, T.length), w.layout === "RESERVED" && v && (r.setText({
4551
+ styleName: u.textStyle,
4552
+ target: v.targets.text,
4553
+ text: Qr(d, u, r)
4554
+ }), v.captureTextLayout?.())), w) for (; await te(););
4555
+ let n = e.condition;
4556
+ if (n === void 0 && t === 0) {
4557
+ await m(u.audio?.finish);
4558
+ return;
4559
+ }
4560
+ await new Promise((e, r) => {
4561
+ let a = !1, o, s, c = () => {
4562
+ a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), m(u.audio?.finish).then(e, r));
4563
+ };
4564
+ if (t > 0 && (o = i.setTimeout(c, t * 1e3)), !n) return;
4565
+ let l = () => {
4566
+ let e;
4567
+ try {
4568
+ e = n();
4569
+ } catch (e) {
4570
+ a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), r(e));
4571
+ return;
4572
+ }
4573
+ Promise.resolve(e).then((e) => {
4574
+ e ? c() : a || (s = i.setTimeout(l, 16));
4575
+ }, (e) => {
4576
+ a || (a = !0, o !== void 0 && i.clearTimeout(o), s !== void 0 && i.clearTimeout(s), r(e));
4577
+ });
4578
+ };
4579
+ l();
4580
+ });
4581
+ }), l);
4582
+ },
4583
+ animate(e) {
4584
+ if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4585
+ let t;
4586
+ try {
4587
+ t = Lr(e, "Bubble motion");
4588
+ } catch (e) {
4589
+ return Promise.reject(e);
4590
+ }
4591
+ return l = l.then(async () => {
4592
+ if (t.name === "animateBubbleShape" && t.visualStyle) {
4593
+ let e = Object.freeze({
4594
+ ...u,
4595
+ visualStyle: t.visualStyle
4596
+ });
4597
+ await v?.animate?.(t), u = e, await v?.updateStyle(u);
4598
+ return;
4599
+ }
4600
+ await v?.animate?.(t);
4601
+ }), l;
4230
4602
  },
4231
4603
  async close() {
4232
- if (g) return;
4233
- g = !0;
4604
+ if (c) return;
4605
+ c = !0;
4234
4606
  let e = [];
4607
+ O();
4235
4608
  try {
4236
- await _;
4609
+ await l;
4237
4610
  } catch (t) {
4238
4611
  e.push(t);
4239
4612
  }
4240
4613
  for (let t of [
4241
- () => p?.stop(),
4242
- () => m?.stop(),
4243
- () => h?.stop(),
4614
+ () => u.hideAnimation === void 0 ? void 0 : v?.animate?.(u.hideAnimation),
4615
+ () => x?.stop(),
4616
+ () => S?.stop(),
4617
+ () => C?.stop(),
4244
4618
  async () => {
4245
- f && await u?.hide();
4619
+ b && await v?.hide();
4246
4620
  },
4247
4621
  async () => {
4248
- d && u && n.releaseTarget(u.targets.text);
4622
+ y && v && r.releaseTarget(v.targets.text);
4249
4623
  },
4250
- async () => u?.dispose()
4624
+ async () => v?.dispose()
4251
4625
  ]) try {
4252
4626
  await t();
4253
4627
  } catch (t) {
4254
4628
  e.push(t);
4255
4629
  }
4256
- a.get(o.actorKey) === y && a.delete(o.actorKey), Rr(e, `Failed to close bubble: ${o.actorKey}`);
4630
+ o.get(s.actorKey) === j && o.delete(s.actorKey), $r(e, `Failed to close bubble: ${s.actorKey}`);
4257
4631
  }
4258
4632
  });
4259
- return a.set(o.actorKey, y), y;
4633
+ return o.set(s.actorKey, j), k(), u.showAnimation !== void 0 && await j.animate(u.showAnimation), j;
4260
4634
  } catch (e) {
4261
- let t = [], r = await Promise.allSettled([
4262
- p?.stop(),
4263
- m?.stop(),
4264
- h?.stop()
4635
+ o.delete(s.actorKey);
4636
+ let t = [], n = await Promise.allSettled([
4637
+ x?.stop(),
4638
+ S?.stop(),
4639
+ C?.stop()
4265
4640
  ]);
4266
- if (t.push(...r.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), f && u) try {
4267
- await u.hide();
4641
+ if (t.push(...n.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), b && v) try {
4642
+ await v.hide();
4268
4643
  } catch (e) {
4269
4644
  t.push(e);
4270
4645
  }
4271
- if (d && u) try {
4272
- n.releaseTarget(u.targets.text);
4646
+ if (y && v) try {
4647
+ r.releaseTarget(v.targets.text);
4273
4648
  } catch (e) {
4274
4649
  t.push(e);
4275
4650
  }
4276
- if (u) try {
4277
- await u.dispose();
4651
+ if (v) try {
4652
+ await v.dispose();
4278
4653
  } catch (e) {
4279
4654
  t.push(e);
4280
4655
  }
4281
- throw t.length > 0 ? AggregateError([e, ...t], `Failed to show and clean up bubble: ${o.actorKey}`, { cause: e }) : e;
4656
+ throw t.length > 0 ? AggregateError([e, ...t], `Failed to show and clean up bubble: ${s.actorKey}`, { cause: e }) : e;
4282
4657
  }
4283
4658
  };
4284
4659
  return Object.freeze({
4285
4660
  defineStyle(e) {
4286
- c();
4287
- let t = Or(e);
4288
- i.set(t.name, t);
4661
+ l();
4662
+ let t = zr(e);
4663
+ a.set(t.name, t);
4289
4664
  },
4290
4665
  hasActiveBubble(e) {
4291
- return a.has($(e, "Bubble actor key"));
4666
+ return o.has($(e, "Bubble actor key"));
4292
4667
  },
4293
4668
  async show(e) {
4294
- c();
4295
- let t = Br(e);
4296
- return l(t.actorKey, () => u(t));
4669
+ l();
4670
+ let t = ti(e);
4671
+ return u(t.actorKey, () => d(t));
4297
4672
  },
4298
4673
  releaseTarget(e) {
4299
- c();
4674
+ l();
4300
4675
  let t = $(e, "Bubble actor key");
4301
- return l(t, async () => {
4302
- await a.get(t)?.close();
4676
+ return u(t, async () => {
4677
+ await o.get(t)?.close();
4303
4678
  });
4304
4679
  },
4305
4680
  async releaseAll() {
4306
- c(), await Promise.allSettled([...o.values()]), Rr((await Promise.allSettled([...a.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
4681
+ l(), await Promise.allSettled([...s.values()]), $r((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
4307
4682
  },
4308
4683
  async dispose() {
4309
- if (s) return;
4310
- s = !0, await Promise.allSettled([...o.values()]);
4311
- let e = await Promise.allSettled([...a.values()].map((e) => e.close()));
4312
- i.clear(), Rr(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
4684
+ if (c) return;
4685
+ c = !0, await Promise.allSettled([...s.values()]);
4686
+ let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
4687
+ a.clear(), $r(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
4313
4688
  }
4314
4689
  });
4315
4690
  }
4316
4691
  //#endregion
4317
- export { Z as BubbleCompositionError, hr as UnicodeLineBreakProvider, re as actorRelativeBubbleCenter, d as bubbleBackgroundRegions, Te as bubbleBodyCenterOffset, u as bubbleDirectionAliases, l as bubbleDirectionNames, D as bubbleVisualStyles, Vr as createBubbleComposition, ee as defaultBubbleDistance, te as defaultBubbleOffset, f as defaultBubblePlacementInput, x as defaultBubbleTailLength, C as normalizeBubbleDistance, w as normalizeBubbleOffset, y as normalizeBubblePlacement, ne as normalizeBubbleTailLength, De as renderBubbleSvg, Sr as wrapText };
4692
+ export { Z as BubbleCompositionError, hr as UnicodeLineBreakProvider, ee as actorRelativeBubbleCenter, d as bubbleBackgroundRegions, be as bubbleBodyCenterOffset, u as bubbleDirectionAliases, l as bubbleDirectionNames, Cr as bubbleRevealUnits, M as bubbleVisualStyles, ni as createBubbleComposition, x as defaultBubbleDistance, C as defaultBubbleOffset, f as defaultBubblePlacementInput, S as defaultBubbleTailLength, T as normalizeBubbleDistance, D as normalizeBubbleOffset, y as normalizeBubblePlacement, Er as normalizeBubbleReveal, E as normalizeBubbleTailLength, Se as renderBubbleSvg, kr as revealedBubbleText, Or as splitBubbleText, Sr as wrapText };