@kubohiroya/turbowarp-bubble 0.17.0 → 0.17.2

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.
@@ -546,10 +546,10 @@ var O = /* @__PURE__ */ o(((e, t) => {
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 L(e) {
549
+ function ke(e) {
550
550
  return this.compareTo(e) == 0;
551
551
  }
552
- function ke(e) {
552
+ function L(e) {
553
553
  return this.compareTo(e) < 0 ? this : e;
554
554
  }
555
555
  function Ae(e) {
@@ -599,21 +599,21 @@ var O = /* @__PURE__ */ o(((e, t) => {
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 R(e) {
602
+ function Ve(e) {
603
603
  var t = l();
604
604
  return e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t;
605
605
  }
606
- function z(e) {
606
+ function R(e) {
607
607
  var t = l();
608
608
  return e < 0 ? this.lShiftTo(-e, t) : this.rShiftTo(e, t), t;
609
609
  }
610
- function Ve(e) {
610
+ function z(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
615
  function He() {
616
- for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Ve(this[e]);
616
+ for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + z(this[e]);
617
617
  return this.s < 0 ? this.t * this.DB : -1;
618
618
  }
619
619
  function Ue(e) {
@@ -632,10 +632,10 @@ var O = /* @__PURE__ */ o(((e, t) => {
632
632
  var n = c.ONE.shiftLeft(e);
633
633
  return this.bitwiseTo(n, t, n), n;
634
634
  }
635
- function B(e) {
635
+ function qe(e) {
636
636
  return this.changeBit(e, Pe);
637
637
  }
638
- function qe(e) {
638
+ function B(e) {
639
639
  return this.changeBit(e, Re);
640
640
  }
641
641
  function Je(e) {
@@ -656,11 +656,11 @@ var O = /* @__PURE__ */ o(((e, t) => {
656
656
  var t = l();
657
657
  return this.addTo(e, t), t;
658
658
  }
659
- function V(e) {
659
+ function Ze(e) {
660
660
  var t = l();
661
661
  return this.subTo(e, t), t;
662
662
  }
663
- function Ze(e) {
663
+ function V(e) {
664
664
  var t = l();
665
665
  return this.multiplyTo(e, t), t;
666
666
  }
@@ -994,7 +994,7 @@ var O = /* @__PURE__ */ o(((e, t) => {
994
994
  }
995
995
  return !0;
996
996
  }
997
- c.prototype.chunkSize = Ce, c.prototype.toRadix = Te, c.prototype.fromRadix = Ee, c.prototype.fromNumber = De, c.prototype.bitwiseTo = je, c.prototype.changeBit = Ke, c.prototype.addTo = Ye, c.prototype.dMultiply = nt, c.prototype.dAddOffset = rt, c.prototype.multiplyLowerTo = lt, c.prototype.multiplyUpperTo = ut, c.prototype.modInt = yt, c.prototype.millerRabin = Ct, c.prototype.clone = ye, c.prototype.intValue = be, c.prototype.byteValue = xe, c.prototype.shortValue = Se, c.prototype.signum = we, c.prototype.toByteArray = Oe, c.prototype.equals = L, c.prototype.min = ke, c.prototype.max = Ae, c.prototype.and = Ne, c.prototype.or = Fe, c.prototype.xor = Le, c.prototype.andNot = ze, c.prototype.not = Be, c.prototype.shiftLeft = R, c.prototype.shiftRight = z, c.prototype.getLowestSetBit = He, c.prototype.bitCount = We, c.prototype.testBit = Ge, c.prototype.setBit = B, c.prototype.clearBit = qe, c.prototype.flipBit = Je, c.prototype.add = Xe, c.prototype.subtract = V, 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 = St, c.prototype.square = Qe;
997
+ c.prototype.chunkSize = Ce, c.prototype.toRadix = Te, c.prototype.fromRadix = Ee, c.prototype.fromNumber = De, c.prototype.bitwiseTo = je, c.prototype.changeBit = Ke, c.prototype.addTo = Ye, c.prototype.dMultiply = nt, c.prototype.dAddOffset = rt, c.prototype.multiplyLowerTo = lt, c.prototype.multiplyUpperTo = ut, c.prototype.modInt = yt, c.prototype.millerRabin = Ct, c.prototype.clone = ye, c.prototype.intValue = be, c.prototype.byteValue = xe, c.prototype.shortValue = Se, c.prototype.signum = we, c.prototype.toByteArray = Oe, c.prototype.equals = ke, c.prototype.min = L, c.prototype.max = Ae, c.prototype.and = Ne, c.prototype.or = Fe, c.prototype.xor = Le, c.prototype.andNot = ze, c.prototype.not = Be, c.prototype.shiftLeft = Ve, c.prototype.shiftRight = R, c.prototype.getLowestSetBit = He, c.prototype.bitCount = We, c.prototype.testBit = Ge, c.prototype.setBit = qe, c.prototype.clearBit = B, c.prototype.flipBit = Je, c.prototype.add = Xe, c.prototype.subtract = Ze, c.prototype.multiply = V, 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 = St, c.prototype.square = Qe;
998
998
  var U = c;
999
999
  if (U.prototype.IsNegative = function() {
1000
1000
  return this.compareTo(U.ZERO) == -1;
@@ -1016,7 +1016,7 @@ var O = /* @__PURE__ */ o(((e, t) => {
1016
1016
  return e.divide(t);
1017
1017
  }, U.prototype.ToDouble = function() {
1018
1018
  return parseFloat(this.toString());
1019
- }, W === void 0) var W = function(e, t) {
1019
+ }, wt === void 0) var wt = 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 O = /* @__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
- }, W(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
1075
+ }, wt(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);
@@ -1878,16 +1878,16 @@ var O = /* @__PURE__ */ o(((e, t) => {
1878
1878
  }
1879
1879
  this.m_IntersectList.length = 0;
1880
1880
  };
1881
- var wt = function(e) {
1881
+ var W = function(e) {
1882
1882
  return e < 0 ? Math.ceil(e - .5) : Math.round(e);
1883
1883
  }, Tt = function(e) {
1884
1884
  return e < 0 ? Math.ceil(e - .5) : Math.floor(e + .5);
1885
- }, G = function(e) {
1886
- return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
1887
1885
  }, Et = function(e) {
1886
+ return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
1887
+ }, G = 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 = wt : a.chromium ? e.Clipper.Round = G : a.safari ? e.Clipper.Round = Et : e.Clipper.Round = Tt, e.Clipper.TopX = function(t, n) {
1890
+ a.msie ? e.Clipper.Round = W : a.chromium ? e.Clipper.Round = Et : a.safari ? e.Clipper.Round = G : 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 O = /* @__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
- }, W(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2268
+ }, wt(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2269
2269
  ntAny: 0,
2270
2270
  ntOpen: 1,
2271
2271
  ntClosed: 2
@@ -2772,27 +2772,27 @@ function ae(e) {
2772
2772
  if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
2773
2773
  return (t % 360 + 360) % 360;
2774
2774
  }
2775
- function oe(e, t, n = 18) {
2776
- let r = e - 24, i = t - 24;
2775
+ function oe(e, t, n = 18, r = 24) {
2776
+ let i = r, a = r, o = e - r, s = t - r;
2777
2777
  return [
2778
2778
  {
2779
- centerX: r - n,
2780
- centerY: 24 + n,
2779
+ centerX: o - n,
2780
+ centerY: a + n,
2781
2781
  start: -90
2782
2782
  },
2783
2783
  {
2784
- centerX: r - n,
2785
- centerY: i - n,
2784
+ centerX: o - n,
2785
+ centerY: s - n,
2786
2786
  start: 0
2787
2787
  },
2788
2788
  {
2789
- centerX: 24 + n,
2790
- centerY: i - n,
2789
+ centerX: i + n,
2790
+ centerY: s - n,
2791
2791
  start: 90
2792
2792
  },
2793
2793
  {
2794
- centerX: 24 + n,
2795
- centerY: 24 + n,
2794
+ centerX: i + n,
2795
+ centerY: a + n,
2796
2796
  start: 180
2797
2797
  }
2798
2798
  ].flatMap(({ centerX: e, centerY: t, start: r }) => Array.from({ length: 11 }, (i, a) => {
@@ -2926,48 +2926,52 @@ function _e(e, t, n, r, i, a = "") {
2926
2926
  if (!d) throw Error("JSClipper returned an empty Bubble outline.");
2927
2927
  return `<path d="${me(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
2928
2928
  }
2929
- function ve(e) {
2930
- let t = e[0];
2931
- if (!t || e.length < 3) throw TypeError("Smooth Bubble path requires at least three points.");
2932
- let n = (e) => e.toFixed(4), r = e.map((t, r) => {
2933
- let i = e[(r - 1 + e.length) % e.length], a = e[(r + 1) % e.length], o = e[(r + 2) % e.length];
2934
- if (!i || !a || !o) throw Error("Smooth Bubble path is invalid.");
2935
- let s = {
2936
- x: t.x + (a.x - i.x) / 6,
2937
- y: t.y + (a.y - i.y) / 6
2938
- }, c = {
2939
- x: a.x - (o.x - t.x) / 6,
2940
- y: a.y - (o.y - t.y) / 6
2929
+ var ve = Object.freeze([
2930
+ 1,
2931
+ .78,
2932
+ 1.14,
2933
+ .88,
2934
+ 1.06,
2935
+ .8,
2936
+ 1.2,
2937
+ .92
2938
+ ]);
2939
+ function ye(e, t) {
2940
+ let n = e - 48, r = t - 48, i = e / 2, a = t / 2, o = Math.min(40, Math.max(22, 20 + Math.min(n, r) * .12 + Math.max(n, r) * .03)), s = o * .34, c = Math.max(1, n / 2 - s), l = Math.max(1, r / 2 - s), u = (e) => {
2941
+ let t = Math.cos(e), n = Math.sin(e);
2942
+ return {
2943
+ x: i + c * Math.sign(t) * Math.abs(t) ** (2 / 3),
2944
+ y: a + l * Math.sign(n) * Math.abs(n) ** (2 / 3)
2941
2945
  };
2942
- return `C ${n(s.x)} ${n(s.y)} ${n(c.x)} ${n(c.y)} ${n(a.x)} ${n(a.y)}`;
2946
+ }, d = [0], f = u(-Math.PI / 2);
2947
+ for (let e = 1; e <= 720; e += 1) {
2948
+ let t = u(-Math.PI / 2 + e * Math.PI * 2 / 720);
2949
+ d.push((d[e - 1] ?? 0) + Math.hypot(t.x - f.x, t.y - f.y)), f = t;
2950
+ }
2951
+ let p = d[720] ?? 0, m = ve.reduce((e, t) => e + t, 0), h = Math.max(8, Math.round(p / (o * m) * ve.length)), g = Array.from({ length: h }, (e, t) => ve[t % ve.length] ?? 1), _ = g.reduce((e, t) => e + t, 0), v = (e) => {
2952
+ let t = 0, n = 720;
2953
+ for (; n - t > 1;) {
2954
+ let r = t + n >> 1;
2955
+ (d[r] ?? 0) <= e ? t = r : n = r;
2956
+ }
2957
+ let r = d[t] ?? 0, i = d[n] ?? r, a = i > r ? (e - r) / (i - r) : 0;
2958
+ return u(-Math.PI / 2 + (t + a) * Math.PI * 2 / 720);
2959
+ }, y = 0;
2960
+ return g.map((e) => {
2961
+ let t = v(y / _ * p);
2962
+ return y += e, t;
2943
2963
  });
2944
- return `M ${n(t.x)} ${n(t.y)} ${r.join(" ")} Z`;
2945
2964
  }
2946
- function ye(e, t, n, r) {
2947
- let i = e - 24, a = t - 24, o = i - 24, s = a - 24, c = (e, t) => ({
2948
- x: 24 + o * e,
2949
- y: 24 + s * t
2965
+ function be(e, t, n, r) {
2966
+ let i = (e) => e.toFixed(4), a = ye(e, t), o = a[0];
2967
+ if (!o) throw Error("Cloud Bubble path is invalid.");
2968
+ let s = a.map((e, t) => {
2969
+ let n = a[t] ?? o, r = a[(t + 1) % a.length] ?? o, s = Math.hypot(r.x - n.x, r.y - n.y) * .56;
2970
+ return `A ${i(s)} ${i(s)} 0 0 1 ${i(r.x)} ${i(r.y)}`;
2950
2971
  });
2951
- return `<path d="${ve([
2952
- c(0, .5),
2953
- c(.03, .3),
2954
- c(.18, .2),
2955
- c(.28, .04),
2956
- c(.5, .16),
2957
- c(.68, .03),
2958
- c(.84, .18),
2959
- c(.98, .3),
2960
- c(1, .52),
2961
- c(.95, .7),
2962
- c(.82, .82),
2963
- c(.68, .97),
2964
- c(.5, .84),
2965
- c(.32, .97),
2966
- c(.18, .82),
2967
- c(.03, .7)
2968
- ])}" fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
2969
- }
2970
- function be(e, t, n, r, i, a) {
2972
+ return `<path d="M ${i(o.x)} ${i(o.y)} ${s.join(" ")} Z" fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
2973
+ }
2974
+ function xe(e, t, n, r, i, a) {
2971
2975
  let o = ce(n, t), s = Math.hypot(o.x, o.y), c = I(e, t, {
2972
2976
  x: o.x / s,
2973
2977
  y: o.y / s
@@ -2996,7 +3000,7 @@ function be(e, t, n, r, i, a) {
2996
3000
  radius: 3.5
2997
3001
  }]).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("");
2998
3002
  }
2999
- function xe(e, t) {
3003
+ function Se(e, t) {
3000
3004
  let n = e / 2, r = t / 2;
3001
3005
  return Array.from({ length: 28 }, (i, a) => {
3002
3006
  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;
@@ -3006,7 +3010,7 @@ function xe(e, t) {
3006
3010
  };
3007
3011
  });
3008
3012
  }
3009
- function Se(e, t) {
3013
+ function Ce(e, t) {
3010
3014
  let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
3011
3015
  let n = t / 20;
3012
3016
  return {
@@ -3039,22 +3043,22 @@ function Se(e, t) {
3039
3043
  }))
3040
3044
  ];
3041
3045
  }
3042
- function Ce(e, t, n) {
3043
- return e === "YELLING" ? xe(t, n) : e === "WAVY" ? Se(t, n) : oe(t, n);
3046
+ function we(e, t, n) {
3047
+ return e === "YELLING" ? Se(t, n) : e === "WAVY" ? Ce(t, n) : oe(t, n);
3044
3048
  }
3045
- function we(e) {
3049
+ function Te(e) {
3046
3050
  let t = ie(e.style), n = Math.max(F(e.width, 220), t.width), r = Math.max(F(e.height, 112), t.height), i = ae(e.tailDirection);
3047
3051
  if (i === null) throw TypeError("Bubble body center offset requires a tail direction.");
3048
3052
  let a = j(e.tailLength ?? te), o = M(e.offset), s = {
3049
3053
  x: n / 2,
3050
3054
  y: r / 2
3051
- }, c = pe(Ce(e.style, n, r), n, r, i, a, o);
3055
+ }, c = pe(we(e.style, n, r), n, r, i, a, o);
3052
3056
  return Object.freeze({
3053
3057
  x: c.bodyCenter.x - s.x,
3054
3058
  y: c.bodyCenter.y - s.y
3055
3059
  });
3056
3060
  }
3057
- function Te(e, t, n, r, i, a, o, s) {
3061
+ function Ee(e, t, n, r, i, a, o, s) {
3058
3062
  let c = oe(t, n), l = (e) => r === null ? e : pe(e, t, n, r, o, s).body, u = (e, c = "") => {
3059
3063
  if (r === null) return ge(e, i, a, c);
3060
3064
  let l = pe(e, t, n, r, o, s);
@@ -3064,23 +3068,32 @@ function Te(e, t, n, r, i, a, o, s) {
3064
3068
  case "NO_BUBBLE": return "";
3065
3069
  case "THINKING":
3066
3070
  case "DREAMING": {
3067
- if (r === null) return ye(t, n, i, a);
3071
+ if (r === null) return be(t, n, i, a);
3068
3072
  let l = pe(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
3069
3073
  x: t / 2,
3070
3074
  y: n / 2
3071
3075
  }, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
3072
- return `${be(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${ye(t, n, i, a)}</g>`;
3076
+ 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>`;
3073
3077
  }
3074
- case "YELLING": return u(xe(t, n));
3075
- case "WAVY": return u(Se(t, n));
3078
+ case "YELLING": return u(Se(t, n));
3079
+ case "WAVY": return u(Ce(t, n));
3076
3080
  case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
3077
- 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"/>`;
3081
+ case "ANNOUNCEMENT": {
3082
+ let e = oe(t, n, 13, 30), i = r === null ? e : (() => {
3083
+ let { bodyCenter: i } = pe(c, t, n, r, o, s), a = {
3084
+ x: t / 2,
3085
+ y: n / 2
3086
+ }, l = s.scalePercent / 100;
3087
+ return e.map((e) => fe(e, a, i, l));
3088
+ })();
3089
+ return `${u(c)}<path d="${me(i)}" fill="none" stroke="${a}" stroke-width="1.5" stroke-linejoin="round" data-bubble-inner-frame="true"/>`;
3090
+ }
3078
3091
  case "NARRATION": return ge(l(c), i, a);
3079
3092
  case "OFF_PANEL": return u(c);
3080
3093
  case "NORMAL": return u(c);
3081
3094
  }
3082
3095
  }
3083
- function Ee(e) {
3096
+ function De(e) {
3084
3097
  if (!N.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
3085
3098
  if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
3086
3099
  let t = F(e.width, 220), n = F(e.height, 112), r = F(e.fontSize, 15), i = ae(e.tailDirection), a = j(e.tailLength ?? te), o = e.offset === void 0 ? A : M(e.offset), s = e.shapeTransition;
@@ -3088,12 +3101,12 @@ function Ee(e) {
3088
3101
  let c = ie(e.style, ...s === void 0 ? [] : [s.from, s.to]), l = Math.max(t, c.width), u = Math.max(n, c.height), d = e.fillColor ?? "#fff4cc", f = e.borderColor ?? "#6f5b45", p = e.textColor ?? "#25283a", m = e.fontFamily ?? "Noto Sans JP, sans-serif", h = r * 1.35, g = u / 2 - (e.lines.length - 1) * h / 2 + r * .35, _ = i === null ? 1 : o.scalePercent / 100, v = i === null ? {
3089
3102
  x: l / 2,
3090
3103
  y: u / 2
3091
- } : pe(oe(l, u), l, u, i, a, o).bodyCenter, y = e.lines.map((e, t) => `<text x="${v.x}" y="${v.y + (g + t * h - u / 2) * _}" text-anchor="middle" fill="${P(p)}" font-family="${P(m)}" font-size="${r * _}">${P(e)}</text>`).join(""), b = s === void 0 ? Te(e.style, l, u, i, d, f, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${Te(s.from, l, u, i, d, f, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${Te(s.to, l, u, i, d, f, a, o)}</g>`, x = P(e.title ?? `${e.style} bubble`), S = 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)}"`;
3104
+ } : pe(oe(l, u), l, u, i, a, o).bodyCenter, y = e.lines.map((e, t) => `<text x="${v.x}" y="${v.y + (g + t * h - u / 2) * _}" text-anchor="middle" fill="${P(p)}" font-family="${P(m)}" font-size="${r * _}">${P(e)}</text>`).join(""), b = s === void 0 ? Ee(e.style, l, u, i, d, f, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${Ee(s.from, l, u, i, d, f, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${Ee(s.to, l, u, i, d, f, a, o)}</g>`, x = P(e.title ?? `${e.style} bubble`), S = 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)}"`;
3092
3105
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${u}" viewBox="0 0 ${l} ${u}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}" data-bubble-body-width="${l}" data-bubble-body-height="${u}"${S}><title>${x}</title>${b}${y}</svg>`;
3093
3106
  }
3094
3107
  //#endregion
3095
3108
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
3096
- var De = 2048, Oe = 2112, L = Uint8Array, ke = Uint16Array, Ae = Int32Array, je = new L([
3109
+ var Oe = 2048, ke = 2112, L = Uint8Array, Ae = Uint16Array, je = Int32Array, Me = new L([
3097
3110
  0,
3098
3111
  0,
3099
3112
  0,
@@ -3126,7 +3139,7 @@ var De = 2048, Oe = 2112, L = Uint8Array, ke = Uint16Array, Ae = Int32Array, je
3126
3139
  0,
3127
3140
  0,
3128
3141
  0
3129
- ]), Me = new L([
3142
+ ]), Ne = new L([
3130
3143
  0,
3131
3144
  0,
3132
3145
  0,
@@ -3159,7 +3172,7 @@ var De = 2048, Oe = 2112, L = Uint8Array, ke = Uint16Array, Ae = Int32Array, je
3159
3172
  13,
3160
3173
  0,
3161
3174
  0
3162
- ]), Ne = new L([
3175
+ ]), Pe = new L([
3163
3176
  16,
3164
3177
  17,
3165
3178
  18,
@@ -3179,51 +3192,51 @@ var De = 2048, Oe = 2112, L = Uint8Array, ke = Uint16Array, Ae = Int32Array, je
3179
3192
  14,
3180
3193
  1,
3181
3194
  15
3182
- ]), Pe = function(e, t) {
3183
- for (var n = new ke(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3184
- 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;
3195
+ ]), Fe = function(e, t) {
3196
+ for (var n = new Ae(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3197
+ for (var i = new je(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
3185
3198
  return {
3186
3199
  b: n,
3187
3200
  r: i
3188
3201
  };
3189
- }, Fe = Pe(je, 2), Ie = Fe.b, Le = Fe.r;
3190
- Ie[28] = 258, Le[258] = 28;
3191
- var Re = Pe(Me, 0), ze = Re.b;
3192
- Re.r;
3193
- for (var Be = new ke(32768), R = 0; R < 32768; ++R) {
3202
+ }, Ie = Fe(Me, 2), Le = Ie.b, Re = Ie.r;
3203
+ Le[28] = 258, Re[258] = 28;
3204
+ var ze = Fe(Ne, 0), Be = ze.b;
3205
+ ze.r;
3206
+ for (var Ve = new Ae(32768), R = 0; R < 32768; ++R) {
3194
3207
  var z = (R & 43690) >> 1 | (R & 21845) << 1;
3195
- z = (z & 52428) >> 2 | (z & 13107) << 2, z = (z & 61680) >> 4 | (z & 3855) << 4, Be[R] = ((z & 65280) >> 8 | (z & 255) << 8) >> 1;
3208
+ z = (z & 52428) >> 2 | (z & 13107) << 2, z = (z & 61680) >> 4 | (z & 3855) << 4, Ve[R] = ((z & 65280) >> 8 | (z & 255) << 8) >> 1;
3196
3209
  }
3197
- for (var Ve = (function(e, t, n) {
3198
- for (var r = e.length, i = 0, a = new ke(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3199
- var o = new ke(t);
3210
+ for (var He = (function(e, t, n) {
3211
+ for (var r = e.length, i = 0, a = new Ae(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3212
+ var o = new Ae(t);
3200
3213
  for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
3201
3214
  var s;
3202
3215
  if (n) {
3203
- s = new ke(1 << t);
3216
+ s = new Ae(1 << t);
3204
3217
  var c = 15 - t;
3205
- 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;
3206
- } else for (s = new ke(r), i = 0; i < r; ++i) e[i] && (s[i] = Be[o[e[i] - 1]++] >> 15 - e[i]);
3218
+ 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[Ve[d] >> c] = l;
3219
+ } else for (s = new Ae(r), i = 0; i < r; ++i) e[i] && (s[i] = Ve[o[e[i] - 1]++] >> 15 - e[i]);
3207
3220
  return s;
3208
- }), He = new L(288), R = 0; R < 144; ++R) He[R] = 8;
3209
- for (var R = 144; R < 256; ++R) He[R] = 9;
3210
- for (var R = 256; R < 280; ++R) He[R] = 7;
3211
- for (var R = 280; R < 288; ++R) He[R] = 8;
3212
- for (var Ue = new L(32), R = 0; R < 32; ++R) Ue[R] = 5;
3213
- var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = function(e) {
3221
+ }), Ue = new L(288), R = 0; R < 144; ++R) Ue[R] = 8;
3222
+ for (var R = 144; R < 256; ++R) Ue[R] = 9;
3223
+ for (var R = 256; R < 280; ++R) Ue[R] = 7;
3224
+ for (var R = 280; R < 288; ++R) Ue[R] = 8;
3225
+ for (var We = new L(32), R = 0; R < 32; ++R) We[R] = 5;
3226
+ var Ge = /*#__PURE__*/ He(Ue, 9, 1), Ke = /*#__PURE__*/ He(We, 5, 1), qe = function(e) {
3214
3227
  for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
3215
3228
  return t;
3216
3229
  }, B = function(e, t, n) {
3217
3230
  var r = t / 8 | 0;
3218
3231
  return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
3219
- }, qe = function(e, t) {
3232
+ }, Je = function(e, t) {
3220
3233
  var n = t / 8 | 0;
3221
3234
  return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
3222
- }, Je = function(e) {
3235
+ }, Ye = function(e) {
3223
3236
  return (e + 7) / 8 | 0;
3224
- }, Ye = function(e, t, n) {
3237
+ }, Xe = function(e, t, n) {
3225
3238
  return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new L(e.subarray(t, n));
3226
- }, Xe = [
3239
+ }, Ze = [
3227
3240
  "unexpected EOF",
3228
3241
  "invalid block type",
3229
3242
  "invalid length/literal",
@@ -3239,10 +3252,10 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3239
3252
  "stream finishing",
3240
3253
  "invalid zip data"
3241
3254
  ], V = function(e, t, n) {
3242
- var r = Error(t || Xe[e]);
3255
+ var r = Error(t || Ze[e]);
3243
3256
  if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, V), !n) throw r;
3244
3257
  return r;
3245
- }, Ze = function(e, t, n, r) {
3258
+ }, Qe = function(e, t, n, r) {
3246
3259
  var i = e.length, a = r ? r.length : 0;
3247
3260
  if (!i || t.f && !t.l) return n || new L(0);
3248
3261
  var o = !n, s = o || t.i != 2, c = t.i;
@@ -3259,7 +3272,7 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3259
3272
  u = B(e, d, 1);
3260
3273
  var v = B(e, d + 1, 3);
3261
3274
  if (d += 3, !v) {
3262
- var y = Je(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
3275
+ var y = Ye(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
3263
3276
  if (x > i) {
3264
3277
  c && V(0);
3265
3278
  break;
@@ -3267,13 +3280,13 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3267
3280
  s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
3268
3281
  continue;
3269
3282
  }
3270
- if (v == 1) p = We, m = Ge, h = 9, g = 5;
3283
+ if (v == 1) p = Ge, m = Ke, h = 9, g = 5;
3271
3284
  else if (v == 2) {
3272
3285
  var S = B(e, d, 31) + 257, C = B(e, d + 10, 15) + 4, w = S + B(e, d + 5, 31) + 1;
3273
3286
  d += 14;
3274
- for (var T = new L(w), E = new L(19), D = 0; D < C; ++D) E[Ne[D]] = B(e, d + D * 3, 7);
3287
+ for (var T = new L(w), E = new L(19), D = 0; D < C; ++D) E[Pe[D]] = B(e, d + D * 3, 7);
3275
3288
  d += C * 3;
3276
- for (var ee = Ke(E), O = (1 << ee) - 1, k = Ve(E, ee, 1), D = 0; D < w;) {
3289
+ for (var ee = qe(E), O = (1 << ee) - 1, k = He(E, ee, 1), D = 0; D < w;) {
3277
3290
  var te = k[B(e, d, O)];
3278
3291
  d += te & 15;
3279
3292
  var y = te >> 4;
@@ -3284,7 +3297,7 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3284
3297
  }
3285
3298
  }
3286
3299
  var M = T.subarray(0, S), N = T.subarray(S);
3287
- h = Ke(M), g = Ke(N), p = Ve(M, h, 1), m = Ve(N, g, 1);
3300
+ h = qe(M), g = qe(N), p = He(M, h, 1), m = He(N, g, 1);
3288
3301
  } else V(1);
3289
3302
  if (d > _) {
3290
3303
  c && V(0);
@@ -3293,7 +3306,7 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3293
3306
  }
3294
3307
  s && l(f + 131072);
3295
3308
  for (var ne = (1 << h) - 1, re = (1 << g) - 1, ie = d;; ie = d) {
3296
- var A = p[qe(e, d) & ne], P = A >> 4;
3309
+ var A = p[Je(e, d) & ne], P = A >> 4;
3297
3310
  if (d += A & 15, d > _) {
3298
3311
  c && V(0);
3299
3312
  break;
@@ -3305,15 +3318,15 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3305
3318
  } else {
3306
3319
  var F = P - 254;
3307
3320
  if (P > 264) {
3308
- var D = P - 257, ae = je[D];
3309
- F = B(e, d, (1 << ae) - 1) + Ie[D], d += ae;
3321
+ var D = P - 257, ae = Me[D];
3322
+ F = B(e, d, (1 << ae) - 1) + Le[D], d += ae;
3310
3323
  }
3311
- var oe = m[qe(e, d) & re], se = oe >> 4;
3324
+ var oe = m[Je(e, d) & re], se = oe >> 4;
3312
3325
  oe || V(3), d += oe & 15;
3313
- var N = ze[se];
3326
+ var N = Be[se];
3314
3327
  if (se > 3) {
3315
- var ae = Me[se];
3316
- N += qe(e, d) & (1 << ae) - 1, d += ae;
3328
+ var ae = Ne[se];
3329
+ N += Je(e, d) & (1 << ae) - 1, d += ae;
3317
3330
  }
3318
3331
  if (d > _) {
3319
3332
  c && V(0);
@@ -3330,29 +3343,29 @@ var We = /*#__PURE__*/ Ve(He, 9, 1), Ge = /*#__PURE__*/ Ve(Ue, 5, 1), Ke = funct
3330
3343
  }
3331
3344
  t.l = p, t.p = ie, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
3332
3345
  } while (!u);
3333
- return f != n.length && o ? Ye(n, 0, f) : n.subarray(0, f);
3334
- }, Qe = /*#__PURE__*/ new L(0), $e = function(e) {
3346
+ return f != n.length && o ? Xe(n, 0, f) : n.subarray(0, f);
3347
+ }, $e = /*#__PURE__*/ new L(0), et = function(e) {
3335
3348
  (e[0] != 31 || e[1] != 139 || e[2] != 8) && V(6, "invalid gzip data");
3336
3349
  var t = e[3], n = 10;
3337
3350
  t & 4 && (n += (e[10] | e[11] << 8) + 2);
3338
3351
  for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
3339
3352
  return n + (t & 2);
3340
- }, et = function(e) {
3353
+ }, tt = function(e) {
3341
3354
  var t = e.length;
3342
3355
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
3343
3356
  };
3344
- function tt(e, t) {
3345
- var n = $e(e);
3346
- return n + 8 > e.length && V(6, "invalid gzip data"), Ze(e.subarray(n, -8), { i: 2 }, t && t.out || new L(et(e)), t && t.dictionary);
3357
+ function nt(e, t) {
3358
+ var n = et(e);
3359
+ return n + 8 > e.length && V(6, "invalid gzip data"), Qe(e.subarray(n, -8), { i: 2 }, t && t.out || new L(tt(e)), t && t.dictionary);
3347
3360
  }
3348
- var nt = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3361
+ var rt = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3349
3362
  try {
3350
- nt.decode(Qe, { stream: !0 });
3363
+ rt.decode($e, { stream: !0 });
3351
3364
  } catch {}
3352
3365
  //#endregion
3353
3366
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
3354
- var rt = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3355
- function it(e) {
3367
+ var it = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3368
+ function at(e) {
3356
3369
  let t = e.length;
3357
3370
  for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
3358
3371
  e[n + 3],
@@ -3361,15 +3374,15 @@ function it(e) {
3361
3374
  e[n]
3362
3375
  ];
3363
3376
  }
3364
- function at(e) {}
3365
- var ot = rt ? it : at, st = new TextDecoder(), ct = class e {
3377
+ function ot(e) {}
3378
+ var st = it ? at : ot, ct = new TextDecoder(), lt = class e {
3366
3379
  constructor(e) {
3367
3380
  if (e instanceof Uint8Array) {
3368
3381
  let t = 0, n = new DataView(e.buffer);
3369
3382
  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.");
3370
3383
  if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
3371
3384
  let r = e.subarray(16 + t);
3372
- 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);
3385
+ this.values = r.length ? JSON.parse(ct.decode(nt(r))) : [], e = nt(e.subarray(16, 16 + t)), st(e), this.data = new Int32Array(e.buffer);
3373
3386
  } else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
3374
3387
  }
3375
3388
  static fromBase64(t) {
@@ -3382,10 +3395,10 @@ var ot = rt ? it : at, st = new TextDecoder(), ct = class e {
3382
3395
  let n = (this.data[e >> 5] << 2) + (e & 31);
3383
3396
  t = this.data[n];
3384
3397
  } else if (e <= 65535) {
3385
- let n = (this.data[De + (e - 55296 >> 5)] << 2) + (e & 31);
3398
+ let n = (this.data[Oe + (e - 55296 >> 5)] << 2) + (e & 31);
3386
3399
  t = this.data[n];
3387
3400
  } else if (e < this.highStart) {
3388
- let n = this.data[Oe - 32 + (e >> 11)];
3401
+ let n = this.data[ke - 32 + (e >> 11)];
3389
3402
  n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
3390
3403
  } else t = this.data[this.data.length - 4];
3391
3404
  return t;
@@ -3394,26 +3407,26 @@ var ot = rt ? it : at, st = new TextDecoder(), ct = class e {
3394
3407
  let t = this.get(e);
3395
3408
  return this.values[t] ?? t;
3396
3409
  }
3397
- }, lt = ct.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 eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9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Sp2vJve7eN+zP3nYsojYunAhMq1cs2vM1X9J99+Q2g+d+1z\n 5OznpXJD1zcKcc/U33KN39TzgCnr4lz95Fz1cW79kxT6SDF00UruT5ZDZ8Xl9x83MV0I0CwB\n AB+LCAC4xcFoAgMdjksWhCAMBO/CelYzJ4gMCqiI4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), ut = Object.fromEntries(lt.values.map((e, t) => [e, t])), { values: dt } = lt, { AI: ft, AL: pt, CJ: mt, CM: ht, NS: gt, SA: _t, SG: vt, SP: yt, XX: bt } = ut;
3398
- function H(e) {
3410
+ }, ut = lt.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 wVwq7Dwirp0KVu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hH5z/Vrm1YZPsheUtn2pQh+RnfMmCqy3PN7aSeN0oRtrp8m6oONOXflHVfrnj0ccdU1lVS\n yYu7Ssjz96ZwxEgz13rX1c3Y+Sp2vJve7eN+zP3nYsojYunAhMq1cs2vM1X9J99+Q2g+d+1z\n 5OznpXJD1zcKcc/U33KN39TzgCnr4lz95Fz1cW79kxT6SDF00UruT5ZDZ8Xl9x83MV0I0CwB\n AB+LCAC4xcFoAgMdjksWhCAMBO/CelYzJ4gMCqiI4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), dt = Object.fromEntries(ut.values.map((e, t) => [e, t])), { values: ft } = ut, { AI: pt, AL: mt, CJ: ht, CM: gt, NS: _t, SA: vt, SG: yt, SP: bt, XX: H } = dt;
3411
+ function xt(e) {
3399
3412
  switch (e) {
3400
3413
  case null: return null;
3401
3414
  case -1: return "sot";
3402
3415
  case -2: return "eot";
3403
- default: return dt[e];
3416
+ default: return ft[e];
3404
3417
  }
3405
3418
  }
3406
- function xt(e, t) {
3419
+ function St(e, t) {
3407
3420
  switch (e) {
3408
- case ft:
3409
- case vt:
3410
- case bt: return pt;
3411
- case _t: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? ht : pt;
3412
- case mt: return gt;
3421
+ case pt:
3422
+ case yt:
3423
+ case H: return mt;
3424
+ case vt: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? gt : mt;
3425
+ case ht: return _t;
3413
3426
  }
3414
3427
  return e;
3415
3428
  }
3416
- var St = class {
3429
+ var Ct = class {
3417
3430
  cp = -Infinity;
3418
3431
  cls = -1;
3419
3432
  char = "";
@@ -3423,15 +3436,15 @@ var St = class {
3423
3436
  this.cls = e, this.cp = t, this.char = n, this.len = r;
3424
3437
  }
3425
3438
  [Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
3426
- return `${H(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
3439
+ return `${xt(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
3427
3440
  }
3428
- }, Ct = class {
3441
+ }, U = class {
3429
3442
  str = "";
3430
3443
  len = 0;
3431
3444
  prevChunk = 0;
3432
- prev = new St(-1, -Infinity, "", 0);
3433
- cur = new St(-1, -Infinity, "", 0);
3434
- next = new St(-1, -Infinity, "", 0);
3445
+ prev = new Ct(-1, -Infinity, "", 0);
3446
+ cur = new Ct(-1, -Infinity, "", 0);
3447
+ next = new Ct(-1, -Infinity, "", 0);
3435
3448
  LB8 = !1;
3436
3449
  spaces = !1;
3437
3450
  RI = 0;
@@ -3444,13 +3457,13 @@ var St = class {
3444
3457
  this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
3445
3458
  }
3446
3459
  pushEnd() {
3447
- this.push(new St(-2, Infinity, "", this.next.len));
3460
+ this.push(new Ct(-2, Infinity, "", this.next.len));
3448
3461
  }
3449
3462
  *codePoints(e, t = !0) {
3450
3463
  if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
3451
3464
  else {
3452
- let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = lt.get(t);
3453
- e += n.length, yield new St(xt(r, n), t, n, e);
3465
+ let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = ut.get(t);
3466
+ e += n.length, yield new Ct(St(r, n), t, n, e);
3454
3467
  }
3455
3468
  else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
3456
3469
  else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
@@ -3458,11 +3471,11 @@ var St = class {
3458
3471
  let t = e - 1, n = this.str.charCodeAt(t);
3459
3472
  n >= 56320 && n <= 57343 && t--;
3460
3473
  let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
3461
- yield new St(xt(lt.get(r), i), r, i, e), e = t;
3474
+ yield new Ct(St(ut.get(r), i), r, i, e), e = t;
3462
3475
  }
3463
3476
  }
3464
3477
  classAfterSpaces(e) {
3465
- for (let { cls: t } of this.codePoints(e)) if (t !== yt) return t;
3478
+ for (let { cls: t } of this.codePoints(e)) if (t !== bt) return t;
3466
3479
  return -2;
3467
3480
  }
3468
3481
  afterNext(e = 1) {
@@ -3476,186 +3489,186 @@ var St = class {
3476
3489
  let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
3477
3490
  return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
3478
3491
  }
3479
- }, U = class {
3492
+ }, wt = class {
3480
3493
  string = void 0;
3481
3494
  props = void 0;
3482
3495
  constructor(e, t = !1) {
3483
3496
  this.position = e, this.required = t;
3484
3497
  }
3485
- }, W = ct.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH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Z0yNjuz8\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");
3486
3499
  Object.fromEntries(W.values.map((e, t) => [e, t]));
3487
- var { values: wt } = W, { AK: Tt, AL: G, AP: Et, AS: Dt, B2: Ot, BA: kt, BB: At, BK: jt, CB: Mt, CL: Nt, CM: Pt, CP: Ft, CR: It, EB: Lt, EM: Rt, EX: zt, GL: Bt, H2: Vt, H3: Ht, HH: Ut, HL: K, HY: Wt, ID: Gt, IN: Kt, IS: qt, JL: Jt, JT: Yt, JV: Xt, LF: Zt, NU: q, OP: Qt, NL: $t, NS: en, PO: tn, PR: nn, RI: rn, SP: J, SY: an, QU: Y, VF: on, VI: sn, WJ: cn, ZW: ln, ZWJ: un } = ut, dn = /* @__PURE__ */ new Set([
3500
+ var { values: Tt } = W, { AK: Et, AL: G, AP: Dt, AS: Ot, B2: kt, BA: At, BB: jt, BK: Mt, CB: Nt, CL: Pt, CM: Ft, CP: It, CR: Lt, EB: Rt, EM: zt, EX: Bt, GL: Vt, H2: Ht, H3: Ut, HH: Wt, HL: K, HY: Gt, ID: Kt, IN: qt, IS: Jt, JL: Yt, JT: Xt, JV: Zt, LF: Qt, NU: q, OP: $t, NL: en, NS: tn, PO: nn, PR: rn, RI: an, SP: J, SY: on, QU: Y, VF: sn, VI: cn, WJ: ln, ZW: un, ZWJ: dn } = dt, fn = /* @__PURE__ */ new Set([
3488
3501
  G,
3489
3502
  K,
3490
3503
  q
3491
- ]), fn = /* @__PURE__ */ new Set([
3492
- jt,
3493
- It,
3494
- Zt,
3495
- $t,
3496
- J,
3497
- ln
3498
3504
  ]), pn = /* @__PURE__ */ new Set([
3499
- Gt,
3505
+ Mt,
3500
3506
  Lt,
3501
- Rt
3507
+ Qt,
3508
+ en,
3509
+ J,
3510
+ un
3502
3511
  ]), mn = /* @__PURE__ */ new Set([
3503
- Jt,
3504
- Xt,
3505
- Vt,
3506
- Ht
3512
+ Kt,
3513
+ Rt,
3514
+ zt
3507
3515
  ]), hn = /* @__PURE__ */ new Set([
3508
- Jt,
3509
- Xt,
3510
3516
  Yt,
3511
- Vt,
3512
- Ht
3513
- ]), gn = /* @__PURE__ */ new Set([Xt, Yt]), _n = /* @__PURE__ */ new Set([
3517
+ Zt,
3518
+ Ht,
3519
+ Ut
3520
+ ]), gn = /* @__PURE__ */ new Set([
3521
+ Yt,
3522
+ Zt,
3523
+ Xt,
3524
+ Ht,
3525
+ Ut
3526
+ ]), _n = /* @__PURE__ */ new Set([Zt, Xt]), vn = /* @__PURE__ */ new Set([
3514
3527
  J,
3515
- Bt,
3516
- cn,
3517
- Nt,
3528
+ Vt,
3529
+ ln,
3530
+ Pt,
3518
3531
  Y,
3519
- Ft,
3520
- zt,
3521
- qt,
3522
- an,
3523
- jt,
3524
3532
  It,
3525
- Zt,
3526
- $t,
3527
- ln
3528
- ]), vn = /* @__PURE__ */ new Set([
3533
+ Bt,
3534
+ Jt,
3535
+ on,
3536
+ Mt,
3537
+ Lt,
3538
+ Qt,
3539
+ en,
3540
+ un
3541
+ ]), yn = /* @__PURE__ */ new Set([
3529
3542
  -1,
3530
- jt,
3531
- It,
3532
- Zt,
3533
- $t,
3543
+ Mt,
3544
+ Lt,
3534
3545
  Qt,
3546
+ en,
3547
+ $t,
3535
3548
  Y,
3536
- Bt,
3549
+ Vt,
3537
3550
  J,
3538
- ln
3539
- ]), X = Symbol("PASS"), Z = Symbol("NO_BREAK"), yn = Symbol("MAY_BREAK"), bn = Symbol("MUST_BREAK");
3540
- function xn(e) {
3541
- return e.cur.cls === -1 && e.next.cls !== -2 ? Z : X;
3542
- }
3551
+ un
3552
+ ]), X = Symbol("PASS"), Z = Symbol("NO_BREAK"), bn = Symbol("MAY_BREAK"), xn = Symbol("MUST_BREAK");
3543
3553
  function Sn(e) {
3544
- return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? bn : X;
3554
+ return e.cur.cls === -1 && e.next.cls !== -2 ? Z : X;
3545
3555
  }
3546
3556
  function Cn(e) {
3547
- return e.cur.cls === jt ? bn : X;
3557
+ return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? xn : X;
3548
3558
  }
3549
3559
  function wn(e) {
3560
+ return e.cur.cls === Mt ? xn : X;
3561
+ }
3562
+ function Tn(e) {
3550
3563
  switch (e.cur.cls) {
3551
- case It: return e.next.cls === Zt ? Z : bn;
3552
- case Zt:
3553
- case $t: return bn;
3564
+ case Lt: return e.next.cls === Qt ? Z : xn;
3565
+ case Qt:
3566
+ case en: return xn;
3554
3567
  }
3555
3568
  return X;
3556
3569
  }
3557
- function Tn(e) {
3570
+ function En(e) {
3558
3571
  switch (e.next.cls) {
3559
- case jt:
3560
- case It:
3561
- case Zt:
3562
- case $t: return Z;
3572
+ case Mt:
3573
+ case Lt:
3574
+ case Qt:
3575
+ case en: return Z;
3563
3576
  }
3564
3577
  return X;
3565
3578
  }
3566
- function En(e) {
3567
- return e.cur.cls !== rn && (e.RI = 0), e.spaces ? (e.next.cls !== J && (e.spaces = !1), Z) : X;
3568
- }
3569
3579
  function Dn(e) {
3570
- if (e.next.cls === ln) return Z;
3580
+ return e.cur.cls !== an && (e.RI = 0), e.spaces ? (e.next.cls !== J && (e.spaces = !1), Z) : X;
3581
+ }
3582
+ function On(e) {
3583
+ if (e.next.cls === un) return Z;
3571
3584
  if (e.next.cls === J) switch (e.cur.cls) {
3572
- case ln:
3573
- case Qt:
3585
+ case un:
3586
+ case $t:
3574
3587
  case Y:
3575
- case Nt:
3576
- case Ft:
3577
- case Ot: break;
3588
+ case Pt:
3589
+ case It:
3590
+ case kt: break;
3578
3591
  default: return Z;
3579
3592
  }
3580
3593
  return X;
3581
3594
  }
3582
- function On(e) {
3583
- return e.LB8 ? (e.LB8 = !1, yn) : e.cur.cls === ln ? e.next.cls === J ? (e.LB8 = !0, Z) : yn : X;
3584
- }
3585
3595
  function kn(e) {
3586
- return e.cur.cls === un ? Z : X;
3596
+ return e.LB8 ? (e.LB8 = !1, bn) : e.cur.cls === un ? e.next.cls === J ? (e.LB8 = !0, Z) : bn : X;
3587
3597
  }
3588
3598
  function An(e) {
3589
- return !fn.has(e.cur.cls) && (e.next.cls === Pt || e.next.cls === un) ? (e.next.ignored = !0, Z) : X;
3599
+ return e.cur.cls === dn ? Z : X;
3590
3600
  }
3591
3601
  function jn(e) {
3592
- return e.cur.cls === Pt && (e.cur.cls = G), e.next.cls === Pt && (e.next.cls = G), X;
3602
+ return !pn.has(e.cur.cls) && (e.next.cls === Ft || e.next.cls === dn) ? (e.next.ignored = !0, Z) : X;
3593
3603
  }
3594
3604
  function Mn(e) {
3595
- return e.next.cls === cn || e.cur.cls === cn ? Z : X;
3605
+ return e.cur.cls === Ft && (e.cur.cls = G), e.next.cls === Ft && (e.next.cls = G), X;
3596
3606
  }
3597
3607
  function Nn(e) {
3598
- return e.cur.cls === Bt ? Z : X;
3608
+ return e.next.cls === ln || e.cur.cls === ln ? Z : X;
3599
3609
  }
3600
3610
  function Pn(e) {
3601
- if (e.next.cls === Bt) switch (e.cur.cls) {
3611
+ return e.cur.cls === Vt ? Z : X;
3612
+ }
3613
+ function Fn(e) {
3614
+ if (e.next.cls === Vt) switch (e.cur.cls) {
3602
3615
  case J:
3603
- case kt:
3604
- case Wt:
3605
- case Ut: return X;
3616
+ case At:
3617
+ case Gt:
3618
+ case Wt: return X;
3606
3619
  default: return Z;
3607
3620
  }
3608
3621
  return X;
3609
3622
  }
3610
- function Fn(e) {
3623
+ function In(e) {
3611
3624
  switch (e.next.cls) {
3612
- case Nt:
3613
- case Ft:
3614
- case zt:
3615
- case an: return Z;
3625
+ case Pt:
3626
+ case It:
3627
+ case Bt:
3628
+ case on: return Z;
3616
3629
  }
3617
3630
  return X;
3618
3631
  }
3619
- function In(e) {
3620
- return e.cur.cls === Qt ? (e.next.cls === J && (e.spaces = !0), Z) : X;
3621
- }
3622
3632
  function Ln(e) {
3623
- return vn.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === Y ? (e.spaces = !0, Z) : X;
3633
+ return e.cur.cls === $t ? (e.next.cls === J && (e.spaces = !0), Z) : X;
3624
3634
  }
3625
3635
  function Rn(e) {
3636
+ return yn.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === Y ? (e.spaces = !0, Z) : X;
3637
+ }
3638
+ function zn(e) {
3626
3639
  if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls === Y) {
3627
3640
  let t = e.afterNext();
3628
- if (!t || _n.has(t.cls)) return Z;
3641
+ if (!t || vn.has(t.cls)) return Z;
3629
3642
  }
3630
3643
  return X;
3631
3644
  }
3632
- function zn(e) {
3633
- return e.cur.cls === J && e.next.cls === qt && e.afterNext()?.cls === q ? yn : X;
3634
- }
3635
3645
  function Bn(e) {
3636
- return e.next.cls === qt ? Z : X;
3646
+ return e.cur.cls === J && e.next.cls === Jt && e.afterNext()?.cls === q ? bn : X;
3637
3647
  }
3638
3648
  function Vn(e) {
3639
- if (e.cur.cls === Nt || e.cur.cls === Ft) {
3640
- if (e.classAfterSpaces(e.cur.len) === en) return e.next.cls === J && (e.spaces = !0), Z;
3641
- if (e.next.cls === J) return Z;
3642
- }
3643
- return X;
3649
+ return e.next.cls === Jt ? Z : X;
3644
3650
  }
3645
3651
  function Hn(e) {
3646
- if (e.cur.cls === Ot) {
3647
- if (e.classAfterSpaces(e.cur.len) === Ot) return e.next.cls === J && (e.spaces = !0), Z;
3652
+ if (e.cur.cls === Pt || e.cur.cls === It) {
3653
+ if (e.classAfterSpaces(e.cur.len) === tn) return e.next.cls === J && (e.spaces = !0), Z;
3648
3654
  if (e.next.cls === J) return Z;
3649
3655
  }
3650
3656
  return X;
3651
3657
  }
3652
3658
  function Un(e) {
3653
- return e.cur.cls === J ? yn : X;
3659
+ if (e.cur.cls === kt) {
3660
+ if (e.classAfterSpaces(e.cur.len) === kt) return e.next.cls === J && (e.spaces = !0), Z;
3661
+ if (e.next.cls === J) return Z;
3662
+ }
3663
+ return X;
3654
3664
  }
3655
3665
  function Wn(e) {
3656
- return e.next.cls === Y && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === Y && !/^\p{Pf}$/u.test(e.cur.char) ? Z : X;
3666
+ return e.cur.cls === J ? bn : X;
3657
3667
  }
3658
3668
  function Gn(e) {
3669
+ return e.next.cls === Y && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === Y && !/^\p{Pf}$/u.test(e.cur.char) ? Z : X;
3670
+ }
3671
+ function Kn(e) {
3659
3672
  if (!W.get(e.cur.cp) && e.next.cls === Y) return Z;
3660
3673
  if (e.next.cls === Y) {
3661
3674
  let t = e.afterNext();
@@ -3663,43 +3676,43 @@ function Gn(e) {
3663
3676
  }
3664
3677
  return e.cur.cls === Y && !W.get(e.next.cp) || (e.prev.cls === -1 || !W.get(e.prev.cp)) && e.cur.cls === Y ? Z : X;
3665
3678
  }
3666
- function Kn(e) {
3667
- return e.cur.cls === Mt || e.next.cls === Mt ? yn : X;
3679
+ function qn(e) {
3680
+ return e.cur.cls === Nt || e.next.cls === Nt ? bn : X;
3668
3681
  }
3669
- var qn = /* @__PURE__ */ new Set([
3682
+ var Jn = /* @__PURE__ */ new Set([
3670
3683
  -1,
3671
- jt,
3672
- It,
3673
- Zt,
3674
- $t,
3675
- J,
3676
- ln,
3677
3684
  Mt,
3678
- Bt
3685
+ Lt,
3686
+ Qt,
3687
+ en,
3688
+ J,
3689
+ un,
3690
+ Nt,
3691
+ Vt
3679
3692
  ]);
3680
- function Jn(e) {
3681
- return qn.has(e.prev.cls) && (e.cur.cls === Wt || e.cur.cls === Ut) && (e.next.cls === G || e.next.cls === K) ? Z : X;
3682
- }
3683
3693
  function Yn(e) {
3684
- if (e.cur.cls === At) return Z;
3694
+ return Jn.has(e.prev.cls) && (e.cur.cls === Gt || e.cur.cls === Wt) && (e.next.cls === G || e.next.cls === K) ? Z : X;
3695
+ }
3696
+ function Xn(e) {
3697
+ if (e.cur.cls === jt) return Z;
3685
3698
  switch (e.next.cls) {
3686
- case kt:
3687
- case Ut:
3699
+ case At:
3688
3700
  case Wt:
3689
- case en: return Z;
3701
+ case Gt:
3702
+ case tn: return Z;
3690
3703
  }
3691
3704
  return X;
3692
3705
  }
3693
- function Xn(e) {
3694
- return e.prev.cls === K && (e.cur.cls === Wt || e.cur.cls === Ut) && e.next.cls !== K ? Z : X;
3695
- }
3696
3706
  function Zn(e) {
3697
- return e.cur.cls === an && e.next.cls === K ? Z : X;
3707
+ return e.prev.cls === K && (e.cur.cls === Gt || e.cur.cls === Wt) && e.next.cls !== K ? Z : X;
3698
3708
  }
3699
3709
  function Qn(e) {
3700
- return e.next.cls === Kt ? Z : X;
3710
+ return e.cur.cls === on && e.next.cls === K ? Z : X;
3701
3711
  }
3702
3712
  function $n(e) {
3713
+ return e.next.cls === qt ? Z : X;
3714
+ }
3715
+ function er(e) {
3703
3716
  switch (e.cur.cls) {
3704
3717
  case G:
3705
3718
  case K:
@@ -3709,94 +3722,93 @@ function $n(e) {
3709
3722
  }
3710
3723
  return X;
3711
3724
  }
3712
- function er(e) {
3713
- return e.cur.cls === nn && pn.has(e.next.cls) || e.next.cls === tn && pn.has(e.cur.cls) ? Z : X;
3714
- }
3715
3725
  function tr(e) {
3716
- return (e.cur.cls === nn || e.cur.cls === tn) && (e.next.cls === G || e.next.cls === K) || (e.cur.cls === G || e.cur.cls === K) && (e.next.cls === nn || e.next.cls === tn) ? Z : X;
3726
+ return e.cur.cls === rn && mn.has(e.next.cls) || e.next.cls === nn && mn.has(e.cur.cls) ? Z : X;
3717
3727
  }
3718
- var nr = /* @__PURE__ */ new Set([tn, nn]), rr = /* @__PURE__ */ new Set([Nt, Ft]);
3719
- function ar(e) {
3728
+ function nr(e) {
3729
+ return (e.cur.cls === rn || e.cur.cls === nn) && (e.next.cls === G || e.next.cls === K) || (e.cur.cls === G || e.cur.cls === K) && (e.next.cls === rn || e.next.cls === nn) ? Z : X;
3730
+ }
3731
+ var rr = /* @__PURE__ */ new Set([nn, rn]), ar = /* @__PURE__ */ new Set([Pt, It]);
3732
+ function or(e) {
3720
3733
  let t = null;
3721
- if (nr.has(e.next.cls) ? t = rr.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === q && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
3722
- case an:
3723
- case qt: continue;
3734
+ if (rr.has(e.next.cls) ? t = ar.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === q && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
3735
+ case on:
3736
+ case Jt: continue;
3724
3737
  case q: return Z;
3725
3738
  default: break SyIsLoop;
3726
3739
  }
3727
- if (e.cur.cls === tn || e.cur.cls === nn) {
3728
- if (e.next.cls === Qt) {
3740
+ if (e.cur.cls === nn || e.cur.cls === rn) {
3741
+ if (e.next.cls === $t) {
3729
3742
  let t = e.afterNext();
3730
- if (t && (t.cls === q || t.cls === qt && e.afterNext(2)?.cls === q)) return Z;
3743
+ if (t && (t.cls === q || t.cls === Jt && e.afterNext(2)?.cls === q)) return Z;
3731
3744
  } else if (e.next.cls === q) return Z;
3732
3745
  }
3733
- return e.cur.cls === Wt && e.next.cls === q || e.cur.cls === qt && e.next.cls === q ? Z : X;
3746
+ return e.cur.cls === Gt && e.next.cls === q || e.cur.cls === Jt && e.next.cls === q ? Z : X;
3734
3747
  }
3735
- function or(e) {
3748
+ function sr(e) {
3736
3749
  switch (e.cur.cls) {
3737
- case Jt:
3738
- if (mn.has(e.next.cls)) return Z;
3750
+ case Yt:
3751
+ if (hn.has(e.next.cls)) return Z;
3739
3752
  break;
3740
- case Xt:
3741
- case Vt:
3742
- if (gn.has(e.next.cls)) return Z;
3753
+ case Zt:
3754
+ case Ht:
3755
+ if (_n.has(e.next.cls)) return Z;
3743
3756
  break;
3744
- case Yt:
3745
- case Ht: if (e.next.cls === Yt) return Z;
3757
+ case Xt:
3758
+ case Ut: if (e.next.cls === Xt) return Z;
3746
3759
  }
3747
3760
  return X;
3748
3761
  }
3749
- function sr(e) {
3762
+ function cr(e) {
3750
3763
  switch (e.cur.cls) {
3751
- case Jt:
3752
- case Xt:
3753
3764
  case Yt:
3754
- case Vt:
3765
+ case Zt:
3766
+ case Xt:
3755
3767
  case Ht:
3756
- if (e.next.cls === tn) return Z;
3768
+ case Ut:
3769
+ if (e.next.cls === nn) return Z;
3757
3770
  break;
3758
- case nn: if (hn.has(e.next.cls)) return Z;
3771
+ case rn: if (gn.has(e.next.cls)) return Z;
3759
3772
  }
3760
3773
  return X;
3761
3774
  }
3762
- function cr(e) {
3775
+ function lr(e) {
3763
3776
  return (e.cur.cls === G || e.cur.cls === K) && (e.next.cls === G || e.next.cls === K) ? Z : X;
3764
3777
  }
3765
- function lr(e) {
3778
+ function ur(e) {
3766
3779
  let { prev: t, cur: n, next: r } = e;
3767
3780
  function i(e) {
3768
- return e.cls === Tt || e.char === "◌" || e.cls === Dt;
3781
+ return e.cls === Et || e.char === "◌" || e.cls === Ot;
3769
3782
  }
3770
- return n.cls === Et && i(r) || i(n) && (r.cls === on || r.cls === sn) || i(t) && n.cls === sn && (r.cls === Tt || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === on ? Z : X;
3771
- }
3772
- function ur(e) {
3773
- return e.cur.cls === qt && (e.next.cls === G || e.next.cls === K) ? Z : X;
3783
+ return n.cls === Dt && i(r) || i(n) && (r.cls === sn || r.cls === cn) || i(t) && n.cls === cn && (r.cls === Et || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === sn ? Z : X;
3774
3784
  }
3775
3785
  function dr(e) {
3786
+ return e.cur.cls === Jt && (e.next.cls === G || e.next.cls === K) ? Z : X;
3787
+ }
3788
+ function fr(e) {
3776
3789
  switch (e.cur.cls) {
3777
3790
  case G:
3778
3791
  case K:
3779
3792
  case q:
3780
- if (e.next.cls === Qt && !W.get(e.next.cp)) return Z;
3793
+ if (e.next.cls === $t && !W.get(e.next.cp)) return Z;
3781
3794
  break;
3782
- case Ft: if (!W.get(e.cur.cp) && dn.has(e.next.cls)) return Z;
3795
+ case It: if (!W.get(e.cur.cp) && fn.has(e.next.cls)) return Z;
3783
3796
  }
3784
3797
  return X;
3785
3798
  }
3786
- function fr(e) {
3787
- if (e.cur.cls === rn) {
3788
- if (e.next.cls === rn && ++e.RI % 2 != 0) return Z;
3799
+ function pr(e) {
3800
+ if (e.cur.cls === an) {
3801
+ if (e.next.cls === an && ++e.RI % 2 != 0) return Z;
3789
3802
  } else e.RI = 0;
3790
3803
  return X;
3791
3804
  }
3792
- function pr(e) {
3793
- return e.cur.cls === Lt && e.next.cls === Rt || e.next.cls === Rt && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? Z : X;
3805
+ function mr(e) {
3806
+ return e.cur.cls === Rt && e.next.cls === zt || e.next.cls === zt && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? Z : X;
3794
3807
  }
3795
- function mr() {
3796
- return yn;
3808
+ function hr() {
3809
+ return bn;
3797
3810
  }
3798
- var hr = [
3799
- xn,
3811
+ var gr = [
3800
3812
  Sn,
3801
3813
  Cn,
3802
3814
  wn,
@@ -3822,15 +3834,15 @@ var hr = [
3822
3834
  Wn,
3823
3835
  Gn,
3824
3836
  Kn,
3825
- Jn,
3826
- Xn,
3837
+ qn,
3827
3838
  Yn,
3828
3839
  Zn,
3840
+ Xn,
3829
3841
  Qn,
3830
3842
  $n,
3831
3843
  er,
3832
3844
  tr,
3833
- ar,
3845
+ nr,
3834
3846
  or,
3835
3847
  sr,
3836
3848
  cr,
@@ -3839,8 +3851,9 @@ var hr = [
3839
3851
  dr,
3840
3852
  fr,
3841
3853
  pr,
3842
- mr
3843
- ], gr = class {
3854
+ mr,
3855
+ hr
3856
+ ], _r = class {
3844
3857
  #e;
3845
3858
  constructor(e = {}) {
3846
3859
  if (this.#e = {
@@ -3848,7 +3861,7 @@ var hr = [
3848
3861
  example7: !1,
3849
3862
  verbose: !1,
3850
3863
  ...e
3851
- }, this.rules = [...hr], this.#e.example7) throw Error("'example7' flag deprecated");
3864
+ }, this.rules = [...gr], this.#e.example7) throw Error("'example7' flag deprecated");
3852
3865
  this.#e.verbose && this.rules.unshift((e) => (console.log(e.cur.len, e), X));
3853
3866
  }
3854
3867
  removeRule(...e) {
@@ -3876,8 +3889,8 @@ var hr = [
3876
3889
  switch (n) {
3877
3890
  case X: break;
3878
3891
  case Z: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
3879
- case yn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new U(e.cur.len);
3880
- case bn: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new U(e.cur.len, !0);
3892
+ case bn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new wt(e.cur.len);
3893
+ case xn: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new wt(e.cur.len, !0);
3881
3894
  default: throw Error(`Invalid state: "${n}"`);
3882
3895
  }
3883
3896
  }
@@ -3888,44 +3901,44 @@ var hr = [
3888
3901
  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);
3889
3902
  }
3890
3903
  *breaks(e) {
3891
- let t = new Ct(e);
3904
+ let t = new U(e);
3892
3905
  for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
3893
3906
  t.pushEnd(), yield* this.#n(t);
3894
3907
  }
3895
3908
  };
3896
3909
  //#endregion
3897
3910
  //#region src/text-layout.ts
3898
- function _r(e, t) {
3911
+ function vr(e, t) {
3899
3912
  let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = /* @__PURE__ */ new Set([0]);
3900
3913
  for (let t of n.segment(e)) r.add(t.index + t.segment.length);
3901
3914
  return r;
3902
3915
  }
3903
- var vr = class {
3904
- #e = new gr();
3916
+ var yr = class {
3917
+ #e = new _r();
3905
3918
  #t;
3906
3919
  constructor(e = "ja") {
3907
3920
  this.#t = e;
3908
3921
  }
3909
3922
  getBreakOpportunities(e) {
3910
- let t = _r(e, this.#t), n = /* @__PURE__ */ new Map();
3923
+ let t = vr(e, this.#t), n = /* @__PURE__ */ new Map();
3911
3924
  for (let r of this.#e.breaks(e)) t.has(r.position) && n.set(r.position, (n.get(r.position) ?? !1) || r.required);
3912
3925
  return Object.freeze([...n].sort(([e], [t]) => e - t).map(([e, t]) => Object.freeze({
3913
3926
  position: e,
3914
3927
  required: t
3915
3928
  })));
3916
3929
  }
3917
- }, yr = /* @__PURE__ */ new Map(), br = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
3918
- function xr(e) {
3919
- let t = yr.get(e);
3930
+ }, br = /* @__PURE__ */ new Map(), xr = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
3931
+ function Sr(e) {
3932
+ let t = br.get(e);
3920
3933
  if (t) return t;
3921
- let n = new vr(e);
3922
- return yr.set(e, n), n;
3934
+ let n = new yr(e);
3935
+ return br.set(e, n), n;
3923
3936
  }
3924
- function Sr(e, t) {
3937
+ function Cr(e, t) {
3925
3938
  if (!Number.isFinite(e) || e < 0) throw TypeError(`${t} must return a non-negative finite number.`);
3926
3939
  return e;
3927
3940
  }
3928
- function Cr(e, t, n) {
3941
+ function wr(e, t, n) {
3929
3942
  let r = /* @__PURE__ */ new Map();
3930
3943
  for (let i of t.getBreakOpportunities(e)) {
3931
3944
  let { position: t, required: a } = i;
@@ -3936,28 +3949,28 @@ function Cr(e, t, n) {
3936
3949
  required: t
3937
3950
  }));
3938
3951
  }
3939
- function wr(e, t, n, r, i) {
3952
+ function Tr(e, t, n, r, i) {
3940
3953
  if (e.length === 0) return [{
3941
3954
  text: "",
3942
3955
  start: t,
3943
3956
  end: t,
3944
3957
  width: 0
3945
3958
  }];
3946
- let a = _r(e, i), o = [...a].sort((e, t) => e - t), s = Cr(e, r, a), c = [], l = 0;
3959
+ let a = vr(e, i), o = [...a].sort((e, t) => e - t), s = wr(e, r, a), c = [], l = 0;
3947
3960
  for (; l < e.length;) {
3948
3961
  let r = s.find((e) => e.position > l && e.required)?.position ?? e.length, i, a = 0;
3949
3962
  for (let t of s) {
3950
3963
  if (t.position <= l || t.position > r) continue;
3951
- let o = e.slice(l, t.position), s = Sr(n.measureText(o), "measureText");
3964
+ let o = e.slice(l, t.position), s = Cr(n.measureText(o), "measureText");
3952
3965
  s <= n.maxWidth && (i = t.position, a = s);
3953
3966
  }
3954
3967
  if (i === void 0) {
3955
3968
  let t = o.filter((e) => e > l && e <= r);
3956
3969
  for (let r of t) {
3957
- let t = e.slice(l, r), o = Sr(n.measureText(t), "measureText");
3970
+ let t = e.slice(l, r), o = Cr(n.measureText(t), "measureText");
3958
3971
  o <= n.maxWidth && (i = r, a = o);
3959
3972
  }
3960
- i === void 0 && (i = t[0] ?? r, a = Sr(n.measureText(e.slice(l, i)), "measureText"));
3973
+ i === void 0 && (i = t[0] ?? r, a = Cr(n.measureText(e.slice(l, i)), "measureText"));
3961
3974
  }
3962
3975
  c.push({
3963
3976
  text: e.slice(l, i),
@@ -3968,38 +3981,38 @@ function wr(e, t, n, r, i) {
3968
3981
  }
3969
3982
  return c;
3970
3983
  }
3971
- function Tr(e) {
3984
+ function Er(e) {
3972
3985
  if (typeof e.text != "string") throw TypeError("text must be a string.");
3973
3986
  if (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw TypeError("maxWidth must be a positive finite number.");
3974
3987
  if (typeof e.measureText != "function") throw TypeError("measureText must be a function.");
3975
- let t = e.locale ?? "ja", n = e.lineBreakProvider ?? xr(t), r = [], i = 0;
3976
- for (let a of e.text.matchAll(br)) {
3988
+ let t = e.locale ?? "ja", n = e.lineBreakProvider ?? Sr(t), r = [], i = 0;
3989
+ for (let a of e.text.matchAll(xr)) {
3977
3990
  let o = a.index;
3978
- r.push(...wr(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
3991
+ r.push(...Tr(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
3979
3992
  }
3980
- return r.push(...wr(e.text.slice(i), i, e, n, t)), Object.freeze({
3993
+ return r.push(...Tr(e.text.slice(i), i, e, n, t)), Object.freeze({
3981
3994
  lines: Object.freeze(r.map((e) => Object.freeze(e))),
3982
3995
  maxLineWidth: Math.max(0, ...r.map((e) => e.width))
3983
3996
  });
3984
3997
  }
3985
3998
  //#endregion
3986
3999
  //#region src/content-run.ts
3987
- function Er(e) {
4000
+ function Dr(e) {
3988
4001
  return typeof e == "object" && !!e && !Array.isArray(e);
3989
4002
  }
3990
- function Dr(e, t) {
4003
+ function Or(e, t) {
3991
4004
  let n = /* @__PURE__ */ new Set(["type", ...t]), r = Object.keys(e).filter((e) => !n.has(e));
3992
4005
  if (r.length > 0) throw TypeError(`Bubble content run has unknown properties: ${r.join(", ")}.`);
3993
4006
  for (let n of t) if (typeof e[n] != "string") throw TypeError(`Bubble content run ${n} must be a string.`);
3994
4007
  }
3995
- function Or(e) {
3996
- if (!Er(e)) throw TypeError("Bubble content run must be an object.");
3997
- if (e.type === "text") return Dr(e, ["text"]), Object.freeze({
4008
+ function kr(e) {
4009
+ if (!Dr(e)) throw TypeError("Bubble content run must be an object.");
4010
+ if (e.type === "text") return Or(e, ["text"]), Object.freeze({
3998
4011
  text: e.text,
3999
4012
  type: "text"
4000
4013
  });
4001
4014
  if (e.type === "ruby") {
4002
- Dr(e, ["base", "reading"]);
4015
+ Or(e, ["base", "reading"]);
4003
4016
  let t = e.base, n = e.reading;
4004
4017
  if (t.length === 0) throw TypeError("Bubble ruby run base must not be empty.");
4005
4018
  if (n.length === 0) throw TypeError("Bubble ruby run reading must not be empty.");
@@ -4011,28 +4024,28 @@ function Or(e) {
4011
4024
  }
4012
4025
  throw TypeError("Bubble content run type must be text or ruby.");
4013
4026
  }
4014
- function kr(e) {
4027
+ function Ar(e) {
4015
4028
  if (typeof e == "string") return Object.freeze([Object.freeze({
4016
4029
  text: e,
4017
4030
  type: "text"
4018
4031
  })]);
4019
4032
  if (!Array.isArray(e)) throw TypeError("Bubble text must be a string or content run array.");
4020
- let t = e.map((e) => Or(e)).filter((e) => e.type !== "text" || e.text.length > 0);
4033
+ let t = e.map((e) => kr(e)).filter((e) => e.type !== "text" || e.text.length > 0);
4021
4034
  return t.length === 0 ? Object.freeze([Object.freeze({
4022
4035
  text: "",
4023
4036
  type: "text"
4024
4037
  })]) : Object.freeze(t);
4025
4038
  }
4026
- function Ar(e) {
4039
+ function jr(e) {
4027
4040
  return e.every((e) => e.type === "text");
4028
4041
  }
4029
- function jr(e) {
4042
+ function Mr(e) {
4030
4043
  return e.map((e) => e.type === "ruby" ? e.base : e.text).join("");
4031
4044
  }
4032
- function Mr(e) {
4045
+ function Nr(e) {
4033
4046
  return e.map((e) => e.type === "ruby" ? e.reading : "").join("");
4034
4047
  }
4035
- function Nr(e) {
4048
+ function Pr(e) {
4036
4049
  let t = [];
4037
4050
  for (let n of e) {
4038
4051
  let e = t[t.length - 1];
@@ -4049,21 +4062,21 @@ function Nr(e) {
4049
4062
  }
4050
4063
  //#endregion
4051
4064
  //#region src/reveal.ts
4052
- var Pr = Object.freeze([
4065
+ var Fr = Object.freeze([
4053
4066
  "CHARACTER",
4054
4067
  "WORD",
4055
4068
  "LINE",
4056
4069
  "BLOCK"
4057
4070
  ]);
4058
- function Fr(e) {
4071
+ function Ir(e) {
4059
4072
  let t = globalThis.Intl?.Segmenter;
4060
4073
  return typeof t == "function" ? [...new t(void 0, { granularity: "grapheme" }).segment(e)].map(({ segment: e }) => e) : Array.from(e);
4061
4074
  }
4062
- function Ir(e) {
4063
- if (typeof e != "string" || !Pr.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
4075
+ function Lr(e) {
4076
+ if (typeof e != "string" || !Fr.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
4064
4077
  return e;
4065
4078
  }
4066
- function Lr(e) {
4079
+ function Rr(e) {
4067
4080
  if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Bubble reveal must be an object.");
4068
4081
  let t = e, n = /* @__PURE__ */ new Set([
4069
4082
  "unit",
@@ -4074,7 +4087,7 @@ function Lr(e) {
4074
4087
  "sound"
4075
4088
  ]);
4076
4089
  if (Object.keys(t).filter((e) => !n.has(e)).length > 0 || t.unit === void 0) throw TypeError("Bubble reveal has unknown or missing properties.");
4077
- let r = Ir(t.unit), i = t.delimiters ?? " \r\n";
4090
+ let r = Lr(t.unit), i = t.delimiters ?? " \r\n";
4078
4091
  if (typeof i != "string" || i.length === 0) throw TypeError("Bubble WORD delimiters must be a non-empty string.");
4079
4092
  let a = t.showDelimiters ?? !1;
4080
4093
  if (typeof a != "boolean") throw TypeError("Bubble reveal showDelimiters must be boolean.");
@@ -4093,16 +4106,16 @@ function Lr(e) {
4093
4106
  ...c === void 0 ? {} : { sound: c }
4094
4107
  });
4095
4108
  }
4096
- function Rr(e, t, n) {
4109
+ function zr(e, t, n) {
4097
4110
  let r = new Set(Array.from(t)), i = [], a = "";
4098
- for (let t of Fr(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
4111
+ for (let t of Ir(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
4099
4112
  return a.length > 0 && i.push(a), i.filter((e) => e.length > 0);
4100
4113
  }
4101
- function zr(e, t) {
4114
+ function Br(e, t) {
4102
4115
  if (e.length === 0) return Object.freeze([""]);
4103
- if (t.unit === "CHARACTER") return Object.freeze(Fr(e));
4116
+ if (t.unit === "CHARACTER") return Object.freeze(Ir(e));
4104
4117
  if (t.unit === "WORD") {
4105
- let n = Rr(e, t.delimiters, t.showDelimiters);
4118
+ let n = zr(e, t.delimiters, t.showDelimiters);
4106
4119
  if (t.showDelimiters) return Object.freeze(n);
4107
4120
  let r = [], i = 0;
4108
4121
  for (let a of n) {
@@ -4120,21 +4133,21 @@ function zr(e, t) {
4120
4133
  let i = r;
4121
4134
  return Object.freeze(i.length > 0 ? i : [e]);
4122
4135
  }
4123
- function Br(e, t) {
4136
+ function Vr(e, t) {
4124
4137
  return e.slice(0, Math.max(0, Math.min(t, e.length))).join("");
4125
4138
  }
4126
- function Vr(e) {
4127
- return Object.freeze(Nr(Object.freeze([...e])));
4128
- }
4129
4139
  function Hr(e) {
4140
+ return Object.freeze(Pr(Object.freeze([...e])));
4141
+ }
4142
+ function Ur(e) {
4130
4143
  return Object.freeze({
4131
4144
  text: e,
4132
4145
  type: "text"
4133
4146
  });
4134
4147
  }
4135
- function Ur(e, t) {
4148
+ function Wr(e, t) {
4136
4149
  let n = [], r = [], i = () => {
4137
- r.length !== 0 && (n.push(Vr(r)), r = []);
4150
+ r.length !== 0 && (n.push(Hr(r)), r = []);
4138
4151
  };
4139
4152
  for (let n of e) {
4140
4153
  if (n.type === "ruby") {
@@ -4142,53 +4155,53 @@ function Ur(e, t) {
4142
4155
  continue;
4143
4156
  }
4144
4157
  if (t === "LINE") {
4145
- for (let e of n.text.split(/(?<=\n)/u)) e.length !== 0 && (r.push(Hr(e)), e.endsWith("\n") && i());
4158
+ for (let e of n.text.split(/(?<=\n)/u)) e.length !== 0 && (r.push(Ur(e)), e.endsWith("\n") && i());
4146
4159
  continue;
4147
4160
  }
4148
4161
  let e = n.text.split(/(\n{2,})/u);
4149
- for (let [t, n] of e.entries()) n.length !== 0 && (r.push(Hr(n)), t % 2 == 1 && i());
4162
+ for (let [t, n] of e.entries()) n.length !== 0 && (r.push(Ur(n)), t % 2 == 1 && i());
4150
4163
  }
4151
- return i(), Object.freeze(n.length > 0 ? n : [Vr(e)]);
4164
+ return i(), Object.freeze(n.length > 0 ? n : [Hr(e)]);
4152
4165
  }
4153
- function Wr(e, t) {
4154
- if (Ar(e)) return Object.freeze(zr(jr(e), t).map((e) => Object.freeze([Hr(e)])));
4155
- if (t.unit === "LINE" || t.unit === "BLOCK") return Ur(e, t.unit);
4166
+ function Gr(e, t) {
4167
+ if (jr(e)) return Object.freeze(Br(Mr(e), t).map((e) => Object.freeze([Ur(e)])));
4168
+ if (t.unit === "LINE" || t.unit === "BLOCK") return Wr(e, t.unit);
4156
4169
  let n = [];
4157
4170
  for (let r of e) {
4158
4171
  if (r.type === "ruby") {
4159
4172
  n.push(Object.freeze([r]));
4160
4173
  continue;
4161
4174
  }
4162
- let e = t.unit === "CHARACTER" ? Fr(r.text) : Rr(r.text, t.delimiters, t.showDelimiters);
4163
- for (let t of e) n.push(Object.freeze([Hr(t)]));
4175
+ let e = t.unit === "CHARACTER" ? Ir(r.text) : zr(r.text, t.delimiters, t.showDelimiters);
4176
+ for (let t of e) n.push(Object.freeze([Ur(t)]));
4164
4177
  }
4165
- return Object.freeze(n.length > 0 ? n : [Object.freeze([Hr("")])]);
4178
+ return Object.freeze(n.length > 0 ? n : [Object.freeze([Ur("")])]);
4166
4179
  }
4167
- function Gr(e, t) {
4180
+ function Kr(e, t) {
4168
4181
  let n = e.slice(0, Math.max(0, Math.min(t, e.length)));
4169
- return Nr(Object.freeze(n.flat()));
4182
+ return Pr(Object.freeze(n.flat()));
4170
4183
  }
4171
4184
  //#endregion
4172
4185
  //#region src/portrait-layout.ts
4173
- var Kr = Object.freeze([
4186
+ var qr = Object.freeze([
4174
4187
  "left",
4175
4188
  "right",
4176
4189
  "top-left",
4177
4190
  "top-right",
4178
4191
  "bottom-left",
4179
4192
  "bottom-right"
4180
- ]), qr = "left", Jr = Object.freeze({
4193
+ ]), Jr = "left", Yr = Object.freeze({
4181
4194
  x: 0,
4182
4195
  y: 0,
4183
4196
  zoomPercent: 100
4184
- }), Yr = 0;
4185
- function Xr(e) {
4197
+ }), Xr = 0;
4198
+ function Zr(e) {
4186
4199
  if (typeof e != "string") throw TypeError("Bubble portrait placement must be a string.");
4187
4200
  let t = e.trim().toLowerCase().replaceAll("_", "-");
4188
- if (!Kr.includes(t)) throw TypeError(`Unsupported Bubble portrait placement: ${e}`);
4201
+ if (!qr.includes(t)) throw TypeError(`Unsupported Bubble portrait placement: ${e}`);
4189
4202
  return t;
4190
4203
  }
4191
- function Zr(e) {
4204
+ function Qr(e) {
4192
4205
  if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble portrait offset must be [x, y] or [x, y, zoom].");
4193
4206
  let [t, n, r = 100] = e;
4194
4207
  if (![
@@ -4202,13 +4215,13 @@ function Zr(e) {
4202
4215
  zoomPercent: r
4203
4216
  });
4204
4217
  }
4205
- function Qr(e) {
4218
+ function $r(e) {
4206
4219
  if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw TypeError("Bubble portrait corner radius must be zero or greater.");
4207
4220
  return e;
4208
4221
  }
4209
4222
  //#endregion
4210
4223
  //#region src/scratch-default.ts
4211
- var $r = 330, ei = 170, ti = 50, ni = 4, ri = 10, ii = 16, ai = 12, oi = 14, si = 16, ci = Object.freeze([
4224
+ var ei = 330, ti = 170, ni = 50, ri = 4, ii = 10, ai = 16, oi = 12, si = 14, ci = 16, li = Object.freeze([
4212
4225
  "placement",
4213
4226
  "maxWidth",
4214
4227
  "textLocale",
@@ -4223,20 +4236,20 @@ var $r = 330, ei = 170, ti = 50, ni = 4, ri = 10, ii = 16, ai = 12, oi = 14, si
4223
4236
  "showAnimation",
4224
4237
  "hideAnimation"
4225
4238
  ]);
4226
- function li(e) {
4227
- return typeof e == "object" && !!e && !Array.isArray(e);
4228
- }
4229
4239
  function ui(e) {
4230
- return !li(e) || typeof e.textStyle != "string" || e.textStyle.trim() !== "default" ? "custom" : ci.every((t) => e[t] === void 0) ? "scratch-default" : "custom";
4240
+ return typeof e == "object" && !!e && !Array.isArray(e);
4231
4241
  }
4232
4242
  function di(e) {
4233
- return ui(e) === "scratch-default";
4243
+ return !ui(e) || typeof e.textStyle != "string" || e.textStyle.trim() !== "default" ? "custom" : li.every((t) => e[t] === void 0) ? "scratch-default" : "custom";
4234
4244
  }
4235
4245
  function fi(e) {
4246
+ return di(e) === "scratch-default";
4247
+ }
4248
+ function pi(e) {
4236
4249
  let t = e;
4237
4250
  return typeof e == "number" && Math.abs(e) >= .01 && e % 1 != 0 && (t = e.toFixed(2)), String(t).slice(0, 330);
4238
4251
  }
4239
- function pi(e) {
4252
+ function mi(e) {
4240
4253
  let t = 0;
4241
4254
  for (let n of e) if (!/\p{Mark}/u.test(n)) {
4242
4255
  if (/\s/u.test(n)) {
@@ -4247,8 +4260,8 @@ function pi(e) {
4247
4260
  }
4248
4261
  return t * 14;
4249
4262
  }
4250
- function mi(e, t = pi) {
4251
- let n = Tr({
4263
+ function hi(e, t = mi) {
4264
+ let n = Er({
4252
4265
  text: e.slice(0, 330),
4253
4266
  maxWidth: 170,
4254
4267
  measureText: (e) => {
@@ -4256,9 +4269,9 @@ function mi(e, t = pi) {
4256
4269
  try {
4257
4270
  n = t(e);
4258
4271
  } catch {
4259
- return pi(e);
4272
+ return mi(e);
4260
4273
  }
4261
- return Number.isFinite(n) && n >= 0 ? n : pi(e);
4274
+ return Number.isFinite(n) && n >= 0 ? n : mi(e);
4262
4275
  }
4263
4276
  }), r = Object.freeze(n.lines.map((e) => Object.freeze({
4264
4277
  text: e.text,
@@ -4270,7 +4283,7 @@ function mi(e, t = pi) {
4270
4283
  text: r.map((e) => e.text).join("\n")
4271
4284
  });
4272
4285
  }
4273
- function hi(e) {
4286
+ function gi(e) {
4274
4287
  let t = Math.max(1, e.lines.length), n = Math.max(e.maxLineWidth, 50) + 20, r = 16 * t + 20;
4275
4288
  return Object.freeze({
4276
4289
  bodyHeight: r + 4,
@@ -4281,7 +4294,7 @@ function hi(e) {
4281
4294
  width: n + 4
4282
4295
  });
4283
4296
  }
4284
- function gi(e) {
4297
+ function _i(e) {
4285
4298
  let t = -e.stageWidth / 2, n = e.stageWidth / 2, r = e.stageHeight / 2, i = e.pointsLeft;
4286
4299
  !i && e.width + e.bounds.right > n && e.bounds.left - e.width > t ? i = !0 : i && e.bounds.left - e.width < t && e.width + e.bounds.right < n && (i = !1);
4287
4300
  let a = i ? Math.min(n - e.width, Math.max(t, e.bounds.left - e.width)) : Math.max(t, Math.min(n - e.width, e.bounds.right)), o = Math.min(r, e.bounds.bottom + e.height);
@@ -4293,10 +4306,10 @@ function gi(e) {
4293
4306
  top: o
4294
4307
  });
4295
4308
  }
4296
- function _i(e) {
4309
+ function vi(e) {
4297
4310
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
4298
4311
  }
4299
- function vi(e) {
4312
+ function yi(e) {
4300
4313
  let { paddedHeight: t, paddedWidth: n } = e, r = Math.min(16, n / 2, t / 2);
4301
4314
  return [
4302
4315
  `M ${r} ${t}`,
@@ -4309,16 +4322,16 @@ function vi(e) {
4309
4322
  `Q ${n} ${t} ${n - r} ${t}`
4310
4323
  ].join(" ");
4311
4324
  }
4312
- function yi(e) {
4313
- let { paddedHeight: t, paddedWidth: n } = e;
4314
- return `<path d="${`${vi(e)} C ${n - 16} ${t + 4} ${n - 12} ${t + 8} ${n - 12} ${t + 10} Q ${n - 12} ${t + 12} ${n - 14} ${t + 12} C ${n - 17} ${t + 12} ${n - 27} ${t + 8} ${n - 32} ${t} Z`}" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" stroke-linejoin="round" paint-order="stroke fill"/>`;
4315
- }
4316
4325
  function bi(e) {
4317
4326
  let { paddedHeight: t, paddedWidth: n } = e;
4318
- return `<path d="${`${vi(e)} L ${n - 28} ${t} A 4 4 0 0 1 ${n - 36} ${t} Z`}" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" stroke-linejoin="round" paint-order="stroke fill"/><circle cx="${n - 25.25}" cy="${t + 7.25}" r="2.25" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" paint-order="stroke fill"/><circle cx="${n - 17.5}" cy="${t + 9.5}" r="1.5" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" paint-order="stroke fill"/>`;
4327
+ return `<path d="${`${yi(e)} C ${n - 16} ${t + 4} ${n - 12} ${t + 8} ${n - 12} ${t + 10} Q ${n - 12} ${t + 12} ${n - 14} ${t + 12} C ${n - 17} ${t + 12} ${n - 27} ${t + 8} ${n - 32} ${t} Z`}" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" stroke-linejoin="round" paint-order="stroke fill"/>`;
4319
4328
  }
4320
4329
  function xi(e) {
4321
- let t = hi(e.layout), n = e.kind === "say" ? yi(t) : bi(t), r = e.pointsLeft ? "translate(2 2)" : `translate(${t.width} 0) scale(-1 1) translate(2 2)`, i = e.layout.lines.map((e, t) => `<text x="12" y="${24.6 + 16 * t}" fill="#575E75" font-family="Helvetica, sans-serif" font-size="14" xml:space="preserve">${_i(e.text)}</text>`).join(""), a = _i(e.title ?? `${e.kind} bubble`);
4330
+ let { paddedHeight: t, paddedWidth: n } = e;
4331
+ return `<path d="${`${yi(e)} L ${n - 28} ${t} A 4 4 0 0 1 ${n - 36} ${t} Z`}" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" stroke-linejoin="round" paint-order="stroke fill"/><circle cx="${n - 25.25}" cy="${t + 7.25}" r="2.25" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" paint-order="stroke fill"/><circle cx="${n - 17.5}" cy="${t + 9.5}" r="1.5" fill="white" stroke="rgba(0, 0, 0, 0.15)" stroke-width="4" paint-order="stroke fill"/>`;
4332
+ }
4333
+ function Si(e) {
4334
+ let t = gi(e.layout), n = e.kind === "say" ? bi(t) : xi(t), r = e.pointsLeft ? "translate(2 2)" : `translate(${t.width} 0) scale(-1 1) translate(2 2)`, i = e.layout.lines.map((e, t) => `<text x="12" y="${24.6 + 16 * t}" fill="#575E75" font-family="Helvetica, sans-serif" font-size="14" xml:space="preserve">${vi(e.text)}</text>`).join(""), a = vi(e.title ?? `${e.kind} bubble`);
4322
4335
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" viewBox="0 0 ${t.width} ${t.height}" role="img" data-bubble-profile="scratch-default" data-bubble-kind="${e.kind}"><title>${a}</title><g transform="${r}">${n}</g>${i}</svg>`;
4323
4336
  }
4324
4337
  //#endregion
@@ -4328,11 +4341,11 @@ var Q = class extends Error {
4328
4341
  constructor(e, t) {
4329
4342
  super(t), this.name = "BubbleCompositionError", this.code = e;
4330
4343
  }
4331
- }, Si = /* @__PURE__ */ new Set(["say", "think"]), Ci = /* @__PURE__ */ new Set([
4344
+ }, Ci = /* @__PURE__ */ new Set(["say", "think"]), wi = /* @__PURE__ */ new Set([
4332
4345
  "idle",
4333
4346
  "talking",
4334
4347
  "awaiting-continue"
4335
- ]), wi = /* @__PURE__ */ new Set([
4348
+ ]), Ti = /* @__PURE__ */ new Set([
4336
4349
  "fadeIn",
4337
4350
  "fadeOut",
4338
4351
  "floatIn",
@@ -4344,7 +4357,7 @@ var Q = class extends Error {
4344
4357
  "shake",
4345
4358
  "explode",
4346
4359
  "animateBubbleShape"
4347
- ]), Ti = /* @__PURE__ */ new Set([
4360
+ ]), Ei = /* @__PURE__ */ new Set([
4348
4361
  "linear",
4349
4362
  "easeIn",
4350
4363
  "easeOut",
@@ -4353,45 +4366,45 @@ var Q = class extends Error {
4353
4366
  function $(e) {
4354
4367
  return typeof e == "object" && !!e && !Array.isArray(e);
4355
4368
  }
4356
- function Ei(e, t, n, r) {
4369
+ function Di(e, t, n, r) {
4357
4370
  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));
4358
4371
  if (a.length > 0 || o.length > 0) throw new Q("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
4359
4372
  }
4360
- function Di(e, t) {
4373
+ function Oi(e, t) {
4361
4374
  if (typeof e != "string" || e.trim().length === 0) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
4362
4375
  return e.trim();
4363
4376
  }
4364
- function Oi(e, t) {
4377
+ function ki(e, t) {
4365
4378
  if (typeof e != "string" || e.length === 0) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
4366
4379
  return e;
4367
4380
  }
4368
- function ki(e, t, n) {
4381
+ function Ai(e, t, n) {
4369
4382
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
4370
- if (Ei(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Q("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
4371
- let r = Object.freeze(e.frames.map((e, n) => Oi(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
4383
+ if (Di(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Q("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
4384
+ let r = Object.freeze(e.frames.map((e, n) => ki(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
4372
4385
  if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Q("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
4373
4386
  return Object.freeze({
4374
4387
  frames: r,
4375
4388
  frameIntervalSeconds: i
4376
4389
  });
4377
4390
  }
4378
- function Ai(e) {
4391
+ function ji(e) {
4379
4392
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
4380
- Ei(e, ["base"], [
4393
+ Di(e, ["base"], [
4381
4394
  "blink",
4382
4395
  "lipSync",
4383
4396
  "placement",
4384
4397
  "offset",
4385
4398
  "cornerRadius"
4386
4399
  ], "Bubble portrait");
4387
- let t = e.blink === void 0 ? void 0 : ki(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : ki(e.lipSync, "Bubble portrait lip-sync", 1), r, i, a;
4400
+ let t = e.blink === void 0 ? void 0 : Ai(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Ai(e.lipSync, "Bubble portrait lip-sync", 1), r, i, a;
4388
4401
  try {
4389
- r = Xr(e.placement ?? "left"), i = e.offset === void 0 ? Jr : Zr(e.offset), a = Qr(e.cornerRadius ?? 0);
4402
+ r = Zr(e.placement ?? "left"), i = e.offset === void 0 ? Yr : Qr(e.offset), a = $r(e.cornerRadius ?? 0);
4390
4403
  } catch (e) {
4391
4404
  throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble portrait layout is invalid.");
4392
4405
  }
4393
4406
  return Object.freeze({
4394
- base: Oi(e.base, "Bubble portrait base"),
4407
+ base: ki(e.base, "Bubble portrait base"),
4395
4408
  ...t === void 0 ? {} : { blink: t },
4396
4409
  ...n === void 0 ? {} : { lipSync: n },
4397
4410
  placement: r,
@@ -4399,9 +4412,9 @@ function Ai(e) {
4399
4412
  cornerRadius: a
4400
4413
  });
4401
4414
  }
4402
- function ji(e, t) {
4415
+ function Mi(e, t) {
4403
4416
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
4404
- if (Ei(e, ["name"], [
4417
+ if (Di(e, ["name"], [
4405
4418
  "durationSeconds",
4406
4419
  "ease",
4407
4420
  "direction",
@@ -4409,7 +4422,7 @@ function ji(e, t) {
4409
4422
  "relativeScale",
4410
4423
  "speed",
4411
4424
  "visualStyle"
4412
- ], t), !wi.has(e.name)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
4425
+ ], t), !Ti.has(e.name)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
4413
4426
  let n = (n, r, i = !1) => {
4414
4427
  let a = e[n];
4415
4428
  if (a !== void 0) {
@@ -4419,7 +4432,7 @@ function ji(e, t) {
4419
4432
  }, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
4420
4433
  if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Q("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
4421
4434
  let c = e.ease ?? "easeInOut";
4422
- if (typeof c != "string" || !Ti.has(c)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
4435
+ if (typeof c != "string" || !Ei.has(c)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
4423
4436
  let l = e.visualStyle;
4424
4437
  if (l !== void 0 && (typeof l != "string" || !N.includes(l))) throw new Q("BUBBLE-COMPOSITION-001", `${t}.visualStyle is invalid.`);
4425
4438
  return Object.freeze({
@@ -4433,10 +4446,10 @@ function ji(e, t) {
4433
4446
  ...l === void 0 ? {} : { visualStyle: l }
4434
4447
  });
4435
4448
  }
4436
- function Mi(e) {
4449
+ function Ni(e) {
4437
4450
  if (e === void 0) return;
4438
4451
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
4439
- Ei(e, [], [
4452
+ Di(e, [], [
4440
4453
  "voice",
4441
4454
  "reveal",
4442
4455
  "finish"
@@ -4448,13 +4461,13 @@ function Mi(e) {
4448
4461
  "finish"
4449
4462
  ]) {
4450
4463
  let r = e[n];
4451
- r !== void 0 && (t[n] = Oi(r, `Bubble audio ${n}`));
4464
+ r !== void 0 && (t[n] = ki(r, `Bubble audio ${n}`));
4452
4465
  }
4453
4466
  return Object.freeze(t);
4454
4467
  }
4455
- function Ni(e) {
4468
+ function Pi(e) {
4456
4469
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
4457
- Ei(e, ["name", "textStyle"], [
4470
+ Di(e, ["name", "textStyle"], [
4458
4471
  "placement",
4459
4472
  "maxWidth",
4460
4473
  "textLocale",
@@ -4469,13 +4482,13 @@ function Ni(e) {
4469
4482
  "showAnimation",
4470
4483
  "hideAnimation"
4471
4484
  ], "Bubble style");
4472
- let t = e.portrait === void 0 ? void 0 : Ai(e.portrait), n = e.continueIndicator === void 0 ? void 0 : ki(e.continueIndicator, "Bubble continue indicator", 2), r;
4485
+ let t = e.portrait === void 0 ? void 0 : ji(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Ai(e.continueIndicator, "Bubble continue indicator", 2), r;
4473
4486
  if (e.reveal !== void 0) try {
4474
- r = Lr(e.reveal);
4487
+ r = Rr(e.reveal);
4475
4488
  } catch (e) {
4476
4489
  throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
4477
4490
  }
4478
- let i = Mi(e.audio), a = e.showAnimation === void 0 ? void 0 : ji(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : ji(e.hideAnimation, "Bubble hideAnimation"), s;
4491
+ let i = Ni(e.audio), a = e.showAnimation === void 0 ? void 0 : Mi(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : Mi(e.hideAnimation, "Bubble hideAnimation"), s;
4479
4492
  try {
4480
4493
  s = y(e.placement ?? "up-right");
4481
4494
  } catch (e) {
@@ -4494,10 +4507,10 @@ function Ni(e) {
4494
4507
  if (typeof e.maxWidth != "number" || !Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw new Q("BUBBLE-COMPOSITION-001", "Bubble style maxWidth must be a positive finite number.");
4495
4508
  f = e.maxWidth;
4496
4509
  }
4497
- let p = e.textLocale === void 0 ? void 0 : Di(e.textLocale, "Bubble style text locale"), m = ui(e);
4510
+ let p = e.textLocale === void 0 ? void 0 : Oi(e.textLocale, "Bubble style text locale"), m = di(e);
4498
4511
  return Object.freeze({
4499
- name: Di(e.name, "Bubble style name"),
4500
- textStyle: Di(e.textStyle, "Bubble text style name"),
4512
+ name: Oi(e.name, "Bubble style name"),
4513
+ textStyle: Oi(e.textStyle, "Bubble text style name"),
4501
4514
  layoutProfile: m,
4502
4515
  ...f === void 0 ? {} : { maxWidth: f },
4503
4516
  ...p === void 0 ? {} : { textLocale: p },
@@ -4514,13 +4527,13 @@ function Ni(e) {
4514
4527
  ...o === void 0 ? {} : { hideAnimation: o }
4515
4528
  });
4516
4529
  }
4517
- function Pi(e) {
4530
+ function Fi(e) {
4518
4531
  if (e !== void 0) {
4519
4532
  if (!$(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
4520
4533
  return e;
4521
4534
  }
4522
4535
  }
4523
- function Fi(e) {
4536
+ function Ii(e) {
4524
4537
  if (e !== void 0) {
4525
4538
  if (!$(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
4526
4539
  if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
@@ -4528,83 +4541,83 @@ function Fi(e) {
4528
4541
  return e;
4529
4542
  }
4530
4543
  }
4531
- function Ii(e) {
4544
+ function Li(e) {
4532
4545
  if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
4533
4546
  return e;
4534
4547
  }
4535
- function Li(e) {
4548
+ function Ri(e) {
4536
4549
  if (!$(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble text capability must provide setText and releaseTarget.");
4537
4550
  return e;
4538
4551
  }
4539
- function Ri() {
4552
+ function zi() {
4540
4553
  return Object.freeze({
4541
4554
  setTimeout: (e, t) => globalThis.setTimeout(e, t),
4542
4555
  clearTimeout: (e) => globalThis.clearTimeout(e)
4543
4556
  });
4544
4557
  }
4545
- function zi(e) {
4558
+ function Bi(e) {
4546
4559
  if (!$(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
4547
4560
  return e;
4548
4561
  }
4549
- function Bi(e, t) {
4562
+ function Vi(e, t) {
4550
4563
  if (!$(e) || typeof e.id != "string" || e.id.length === 0 || typeof e.isStage != "boolean") throw new Q("BUBBLE-COMPOSITION-004", `${t} must provide id and isStage.`);
4551
4564
  return e;
4552
4565
  }
4553
- function Vi(e) {
4566
+ function Hi(e) {
4554
4567
  if (typeof e != "object" || !e) throw new Q("BUBBLE-COMPOSITION-004", "Bubble text target must be a non-null object.");
4555
4568
  return e;
4556
4569
  }
4557
- function Hi(e, t) {
4570
+ function Ui(e, t) {
4558
4571
  if (!$(e) || !$(e.targets) || typeof e.setLayerVisible != "function" || typeof e.updateStyle != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new Q("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
4559
4572
  let n = e.targets;
4560
- Vi(n.text);
4573
+ Hi(n.text);
4561
4574
  let r = /* @__PURE__ */ new Set(), i = (e, t) => {
4562
4575
  let i = n[e];
4563
4576
  if (!t && i === void 0) return;
4564
- let a = Bi(i, `Bubble surface ${e}`);
4577
+ let a = Vi(i, `Bubble surface ${e}`);
4565
4578
  if (r.has(a.id)) throw new Q("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
4566
4579
  r.add(a.id);
4567
4580
  };
4568
4581
  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;
4569
4582
  }
4570
- function Ui(e, t) {
4583
+ function Wi(e, t) {
4571
4584
  if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
4572
4585
  if (!e.isRegistered(t)) throw new Q("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
4573
4586
  if (!e.getMimeType(t).startsWith("image/")) throw new Q("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
4574
4587
  }
4575
- function Wi(e, t) {
4588
+ function Gi(e, t) {
4576
4589
  if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
4577
4590
  if (e.isRegistered?.(t) === !1) throw new Q("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
4578
4591
  let n = e.getMimeType?.(t);
4579
4592
  if (n !== void 0 && !n.startsWith("audio/")) throw new Q("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
4580
4593
  }
4581
- function Gi(e) {
4594
+ function Ki(e) {
4582
4595
  return [...e.portrait === void 0 ? [] : [
4583
4596
  e.portrait.base,
4584
4597
  ...e.portrait.blink?.frames ?? [],
4585
4598
  ...e.portrait.lipSync?.frames ?? []
4586
4599
  ], ...e.continueIndicator?.frames ?? []];
4587
4600
  }
4588
- function Ki(e) {
4601
+ function qi(e) {
4589
4602
  let t = e.setRichText;
4590
4603
  if (typeof t != "function") throw new Q("BUBBLE-COMPOSITION-007", "Bubble ruby content requires the text capability setRichText method.");
4591
4604
  return t;
4592
4605
  }
4593
- function qi(e, t, n, r) {
4594
- return !Ar(e) && typeof r.splitRichText == "function" ? r.splitRichText({
4606
+ function Ji(e, t, n, r) {
4607
+ return !jr(e) && typeof r.splitRichText == "function" ? r.splitRichText({
4595
4608
  reveal: t,
4596
4609
  runs: e,
4597
4610
  styleName: n
4598
- }) : Wr(e, t);
4611
+ }) : Gr(e, t);
4599
4612
  }
4600
- function Ji(e, t, n) {
4601
- if (t.layoutProfile === "scratch-default") return mi(e, (e) => typeof n.measureText == "function" ? n.measureText({
4613
+ function Yi(e, t, n) {
4614
+ if (t.layoutProfile === "scratch-default") return hi(e, (e) => typeof n.measureText == "function" ? n.measureText({
4602
4615
  styleName: t.textStyle,
4603
4616
  text: e
4604
4617
  }) : NaN).text;
4605
4618
  if (t.maxWidth === void 0) return e;
4606
4619
  if (typeof n.measureText != "function") throw new Q("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
4607
- return Tr({
4620
+ return Er({
4608
4621
  text: e,
4609
4622
  maxWidth: t.maxWidth,
4610
4623
  ...t.textLocale === void 0 ? {} : { locale: t.textLocale },
@@ -4614,11 +4627,11 @@ function Ji(e, t, n) {
4614
4627
  }) ?? 0
4615
4628
  }).lines.map(({ text: e }) => e).join("\n");
4616
4629
  }
4617
- function Yi(e, t) {
4630
+ function Xi(e, t) {
4618
4631
  if (e.length === 1) throw e[0];
4619
4632
  if (e.length > 1) throw AggregateError(e, t);
4620
4633
  }
4621
- function Xi(e) {
4634
+ function Zi(e) {
4622
4635
  let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
4623
4636
  let n = e.animation.frames[t];
4624
4637
  n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
@@ -4653,45 +4666,45 @@ function Xi(e) {
4653
4666
  }
4654
4667
  });
4655
4668
  }
4656
- function Zi(e) {
4669
+ function Qi(e) {
4657
4670
  if (!$(e)) throw new Q("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
4658
- if (Ei(e, [
4671
+ if (Di(e, [
4659
4672
  "actor",
4660
4673
  "actorKey",
4661
4674
  "kind",
4662
4675
  "text",
4663
4676
  "styleName"
4664
- ], ["animationMode", "reveal"], "Show bubble input"), !Si.has(e.kind)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
4677
+ ], ["animationMode", "reveal"], "Show bubble input"), !Ci.has(e.kind)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
4665
4678
  let t;
4666
4679
  try {
4667
- t = kr(e.text);
4680
+ t = Ar(e.text);
4668
4681
  } catch (e) {
4669
4682
  throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble text is invalid.");
4670
4683
  }
4671
4684
  let n = e.animationMode ?? "talking";
4672
- if (!Ci.has(n)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
4685
+ if (!wi.has(n)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
4673
4686
  let r;
4674
4687
  if (e.reveal !== void 0) try {
4675
- r = Lr(e.reveal);
4688
+ r = Rr(e.reveal);
4676
4689
  } catch (e) {
4677
4690
  throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
4678
4691
  }
4679
4692
  return {
4680
4693
  actor: e.actor,
4681
- actorKey: Di(e.actorKey, "Bubble actor key"),
4694
+ actorKey: Oi(e.actorKey, "Bubble actor key"),
4682
4695
  kind: e.kind,
4683
4696
  content: t,
4684
- styleName: Di(e.styleName, "Bubble style name"),
4697
+ styleName: Oi(e.styleName, "Bubble style name"),
4685
4698
  animationMode: n,
4686
4699
  ...r === void 0 ? {} : { reveal: r }
4687
4700
  };
4688
4701
  }
4689
- function Qi(e) {
4702
+ function $i(e) {
4690
4703
  if (!$(e)) throw TypeError("Bubble composition options must be an object.");
4691
- let t = Pi(e.imageResolver), n = Fi(e.audio), r = Li(e.textCapability);
4704
+ let t = Fi(e.imageResolver), n = Ii(e.audio), r = Ri(e.textCapability);
4692
4705
  if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
4693
4706
  if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
4694
- let i = zi(e.scheduler ?? Ri()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
4707
+ let i = Bi(e.scheduler ?? zi()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
4695
4708
  if (c) throw new Q("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
4696
4709
  }, u = async (e, t) => {
4697
4710
  let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
@@ -4712,8 +4725,8 @@ function Qi(e) {
4712
4725
  reveal: s.reveal
4713
4726
  }));
4714
4727
  let d = s.content, f = (e) => {
4715
- let n = new Set(Gi(e)), r = n.size === 0 ? void 0 : Ii(t);
4716
- for (let e of n) Ui(r, e);
4728
+ let n = new Set(Ki(e)), r = n.size === 0 ? void 0 : Li(t);
4729
+ for (let e of n) Wi(r, e);
4717
4730
  return r;
4718
4731
  }, p = f(u);
4719
4732
  for (let e of [
@@ -4721,13 +4734,13 @@ function Qi(e) {
4721
4734
  u.audio?.reveal,
4722
4735
  u.audio?.finish,
4723
4736
  u.reveal?.sound
4724
- ]) e !== void 0 && Wi(n, e);
4737
+ ]) e !== void 0 && Gi(n, e);
4725
4738
  let m = async (e, t = !1) => {
4726
4739
  e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
4727
4740
  }, h = async (e, t, n) => {
4728
- let r = Gi(e).length === 0 ? void 0 : Ii(t), i = [];
4741
+ let r = Ki(e).length === 0 ? void 0 : Li(t), i = [];
4729
4742
  if (e.portrait) {
4730
- let t = Ii(r);
4743
+ let t = Li(r);
4731
4744
  i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
4732
4745
  let a = e.portrait.blink?.frames[0];
4733
4746
  a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
@@ -4736,63 +4749,63 @@ function Qi(e) {
4736
4749
  }
4737
4750
  let a = e.continueIndicator?.frames[0];
4738
4751
  if (a !== void 0) {
4739
- let e = Ii(r);
4752
+ let e = Li(r);
4740
4753
  i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
4741
4754
  }
4742
4755
  await Promise.all(i);
4743
4756
  }, g = (t, n, r) => {
4744
- x = t.portrait?.blink === void 0 ? void 0 : Xi({
4757
+ x = t.portrait?.blink === void 0 ? void 0 : Zi({
4745
4758
  actorKey: s.actorKey,
4746
4759
  layer: "portraitBlink",
4747
4760
  animation: t.portrait.blink,
4748
4761
  target: r.targets.portraitBlink,
4749
- imageResolver: Ii(n),
4762
+ imageResolver: Li(n),
4750
4763
  scheduler: i,
4751
4764
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4752
- }), S = t.portrait?.lipSync === void 0 ? void 0 : Xi({
4765
+ }), S = t.portrait?.lipSync === void 0 ? void 0 : Zi({
4753
4766
  actorKey: s.actorKey,
4754
4767
  layer: "portraitLipSync",
4755
4768
  animation: t.portrait.lipSync,
4756
4769
  target: r.targets.portraitLipSync,
4757
- imageResolver: Ii(n),
4770
+ imageResolver: Li(n),
4758
4771
  scheduler: i,
4759
4772
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4760
- }), C = t.continueIndicator === void 0 ? void 0 : Xi({
4773
+ }), C = t.continueIndicator === void 0 ? void 0 : Zi({
4761
4774
  actorKey: s.actorKey,
4762
4775
  layer: "continueIndicator",
4763
4776
  animation: t.continueIndicator,
4764
4777
  target: r.targets.continueIndicator,
4765
- imageResolver: Ii(n),
4778
+ imageResolver: Li(n),
4766
4779
  scheduler: i,
4767
4780
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
4768
4781
  });
4769
4782
  }, _ = o.get(s.actorKey);
4770
4783
  _ && await _.close();
4771
- let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? qi(s.content, w, u.textStyle, r) : Object.freeze([s.content]), E = w ? Math.min(1, T.length) : 1, D, ee = 0;
4784
+ let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? Ji(s.content, w, u.textStyle, r) : Object.freeze([s.content]), E = w ? Math.min(1, T.length) : 1, D, ee = 0;
4772
4785
  try {
4773
- v = Hi(await e.createSurface(Object.freeze({
4786
+ v = Ui(await e.createSurface(Object.freeze({
4774
4787
  actor: s.actor,
4775
4788
  actorKey: s.actorKey,
4776
4789
  kind: s.kind,
4777
4790
  style: u
4778
4791
  })), u);
4779
4792
  let t = (e, t, n) => {
4780
- Ki(r)({
4793
+ qi(r)({
4781
4794
  runs: e,
4782
4795
  styleName: t.textStyle,
4783
4796
  target: n,
4784
4797
  ...t.maxWidth === void 0 ? {} : { maxWidth: t.maxWidth }
4785
4798
  }), y = !0;
4786
- }, a = () => !Ar(d), c = async (e, n = u) => {
4799
+ }, a = () => !jr(d), c = async (e, n = u) => {
4787
4800
  if (a()) {
4788
4801
  if (!v) return;
4789
4802
  if (n.layoutProfile === "scratch-default" && v.renderScratchText) throw new Q("BUBBLE-COMPOSITION-007", "Bubble ruby content requires a rich text capability; the scratch-default surface renders plain text only.");
4790
4803
  t(e, n, v.targets.text);
4791
4804
  return;
4792
4805
  }
4793
- let i = jr(e);
4806
+ let i = Mr(e);
4794
4807
  if (n.layoutProfile === "scratch-default" && v?.renderScratchText) {
4795
- let e = mi(i, (e) => typeof r.measureText == "function" ? r.measureText({
4808
+ let e = hi(i, (e) => typeof r.measureText == "function" ? r.measureText({
4796
4809
  styleName: n.textStyle,
4797
4810
  text: e
4798
4811
  }) : NaN);
@@ -4802,19 +4815,19 @@ function Qi(e) {
4802
4815
  v && (r.setText({
4803
4816
  styleName: n.textStyle,
4804
4817
  target: v.targets.text,
4805
- text: Ji(i, n, r)
4818
+ text: Yi(i, n, r)
4806
4819
  }), y = !0);
4807
4820
  }, l = (e, n = u) => {
4808
4821
  v && (a() ? t(e, n, v.targets.text) : (r.setText({
4809
4822
  styleName: n.textStyle,
4810
4823
  target: v.targets.text,
4811
- text: Ji(jr(e), n, r)
4824
+ text: Yi(Mr(e), n, r)
4812
4825
  }), y = !0), v.captureTextLayout?.());
4813
4826
  };
4814
- w?.layout === "RESERVED" && l(s.content), await c(w ? Gr(T, E) : s.content), await h(u, p, v), g(u, p, v);
4827
+ w?.layout === "RESERVED" && l(s.content), await c(w ? Kr(T, E) : s.content), await h(u, p, v), g(u, p, v);
4815
4828
  let _ = "idle", O = !1, k = Promise.resolve(), te = async () => {
4816
4829
  if (!v) return;
4817
- let e = w ? Gr(T, E) : d;
4830
+ let e = w ? Kr(T, E) : d;
4818
4831
  await c(e), await v.show();
4819
4832
  }, A = () => {
4820
4833
  ee += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
@@ -4843,37 +4856,37 @@ function Qi(e) {
4843
4856
  if (O) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4844
4857
  let t;
4845
4858
  try {
4846
- t = kr(e);
4859
+ t = Ar(e);
4847
4860
  } catch (e) {
4848
4861
  return Promise.reject(new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble text is invalid."));
4849
4862
  }
4850
4863
  return k = k.then(async () => {
4851
- v && (A(), d = t, w ? (T = qi(t, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && l(t), await te(), M()) : await te());
4864
+ v && (A(), d = t, w ? (T = Ji(t, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && l(t), await te(), M()) : await te());
4852
4865
  }), k;
4853
4866
  },
4854
4867
  updateStyle(e) {
4855
4868
  if (O) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4856
4869
  let t;
4857
4870
  try {
4858
- t = Ni(e);
4871
+ t = Pi(e);
4859
4872
  } catch (e) {
4860
4873
  return Promise.reject(e);
4861
4874
  }
4862
4875
  return k = k.then(async () => {
4863
4876
  if (!v) return;
4864
- Hi(v, t);
4877
+ Ui(v, t);
4865
4878
  let e = f(t);
4866
4879
  for (let e of [
4867
4880
  t.audio?.voice,
4868
4881
  t.audio?.reveal,
4869
4882
  t.audio?.finish,
4870
4883
  t.reveal?.sound
4871
- ]) e !== void 0 && Wi(n, e);
4884
+ ]) e !== void 0 && Gi(n, e);
4872
4885
  await Promise.all([
4873
4886
  x?.stop(),
4874
4887
  S?.stop(),
4875
4888
  C?.stop()
4876
- ]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? qi(d, w, t.textStyle, r) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, A(), w?.layout === "RESERVED" && l(d, t), await c(d, t), g(t, e, v), await Promise.all([
4889
+ ]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? Ji(d, w, t.textStyle, r) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, A(), w?.layout === "RESERVED" && l(d, t), await c(d, t), g(t, e, v), await Promise.all([
4877
4890
  v.setLayerVisible("portraitBase", t.portrait !== void 0),
4878
4891
  v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
4879
4892
  v.setLayerVisible("portraitLipSync", !1),
@@ -4884,7 +4897,7 @@ function Qi(e) {
4884
4897
  }), k;
4885
4898
  },
4886
4899
  setAnimationMode(e) {
4887
- return O ? Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : Ci.has(e) ? (k = k.then(() => N(e)), k) : Promise.reject(new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
4900
+ return O ? Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : wi.has(e) ? (k = k.then(() => N(e)), k) : Promise.reject(new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
4888
4901
  },
4889
4902
  revealNext() {
4890
4903
  if (O) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
@@ -4902,10 +4915,10 @@ function Qi(e) {
4902
4915
  if (O) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4903
4916
  let t = e.timeoutSeconds ?? 0;
4904
4917
  return !Number.isFinite(t) || t < 0 ? Promise.reject(new Q("BUBBLE-COMPOSITION-001", "Bubble finish timeoutSeconds must be zero or greater.")) : e.condition !== void 0 && typeof e.condition != "function" ? Promise.reject(new Q("BUBBLE-COMPOSITION-001", "Bubble finish condition must be a function.")) : (k = k.then(async () => {
4905
- if (A(), e.unit !== void 0 && (w = Lr({
4918
+ if (A(), e.unit !== void 0 && (w = Rr({
4906
4919
  ...w ?? {},
4907
4920
  unit: e.unit
4908
- }), T = qi(d, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && v && l(d)), w) for (; await j(););
4921
+ }), T = Ji(d, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && v && l(d)), w) for (; await j(););
4909
4922
  let n = e.condition;
4910
4923
  if (n === void 0 && t === 0) {
4911
4924
  await m(u.audio?.finish);
@@ -4938,7 +4951,7 @@ function Qi(e) {
4938
4951
  if (O) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
4939
4952
  let t;
4940
4953
  try {
4941
- t = ji(e, "Bubble motion");
4954
+ t = Mi(e, "Bubble motion");
4942
4955
  } catch (e) {
4943
4956
  return Promise.reject(e);
4944
4957
  }
@@ -4984,7 +4997,7 @@ function Qi(e) {
4984
4997
  } catch (t) {
4985
4998
  e.push(t);
4986
4999
  }
4987
- o.get(s.actorKey) === ne && o.delete(s.actorKey), Yi(e, `Failed to close bubble: ${s.actorKey}`);
5000
+ o.get(s.actorKey) === ne && o.delete(s.actorKey), Xi(e, `Failed to close bubble: ${s.actorKey}`);
4988
5001
  }
4989
5002
  });
4990
5003
  return o.set(s.actorKey, ne), M(), u.showAnimation !== void 0 && await ne.animate(u.showAnimation), ne;
@@ -5016,34 +5029,34 @@ function Qi(e) {
5016
5029
  return Object.freeze({
5017
5030
  defineStyle(e) {
5018
5031
  l();
5019
- let t = Ni(e);
5032
+ let t = Pi(e);
5020
5033
  a.set(t.name, t);
5021
5034
  },
5022
5035
  hasActiveBubble(e) {
5023
- return o.has(Di(e, "Bubble actor key"));
5036
+ return o.has(Oi(e, "Bubble actor key"));
5024
5037
  },
5025
5038
  async show(e) {
5026
5039
  l();
5027
- let t = Zi(e);
5040
+ let t = Qi(e);
5028
5041
  return u(t.actorKey, () => d(t));
5029
5042
  },
5030
5043
  releaseTarget(e) {
5031
5044
  l();
5032
- let t = Di(e, "Bubble actor key");
5045
+ let t = Oi(e, "Bubble actor key");
5033
5046
  return u(t, async () => {
5034
5047
  await o.get(t)?.close();
5035
5048
  });
5036
5049
  },
5037
5050
  async releaseAll() {
5038
- l(), await Promise.allSettled([...s.values()]), Yi((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
5051
+ l(), await Promise.allSettled([...s.values()]), Xi((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
5039
5052
  },
5040
5053
  async dispose() {
5041
5054
  if (c) return;
5042
5055
  c = !0, await Promise.allSettled([...s.values()]);
5043
5056
  let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
5044
- a.clear(), Yi(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
5057
+ a.clear(), Xi(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
5045
5058
  }
5046
5059
  });
5047
5060
  }
5048
5061
  //#endregion
5049
- export { Q as BubbleCompositionError, vr as UnicodeLineBreakProvider, ee as actorRelativeBubbleCenter, d as bubbleBackgroundRegions, we as bubbleBodyCenterOffset, jr as bubbleContentPlainText, Mr as bubbleContentReadingText, u as bubbleDirectionAliases, l as bubbleDirectionNames, ui as bubbleLayoutProfileForStyleInput, Kr as bubblePortraitPlacements, Pr as bubbleRevealUnits, N as bubbleVisualStyles, Qi as createBubbleComposition, x as defaultBubbleDistance, C as defaultBubbleOffset, f as defaultBubblePlacementInput, Yr as defaultBubblePortraitCornerRadius, Jr as defaultBubblePortraitOffset, qr as defaultBubblePortraitPlacement, S as defaultBubbleTailLength, fi as formatScratchBubbleArgument, Ar as isPlainBubbleContent, di as isScratchDefaultBubbleStyleInput, mi as layoutScratchBubbleText, Nr as mergeBubbleContent, kr as normalizeBubbleContent, T as normalizeBubbleDistance, D as normalizeBubbleOffset, y as normalizeBubblePlacement, Qr as normalizeBubblePortraitCornerRadius, Zr as normalizeBubblePortraitOffset, Xr as normalizeBubblePortraitPlacement, Lr as normalizeBubbleReveal, E as normalizeBubbleTailLength, gi as positionScratchBubble, Ee as renderBubbleSvg, xi as renderScratchBubbleSvg, Gr as revealedBubbleContent, Br as revealedBubbleText, ii as scratchBubbleCornerRadius, oi as scratchBubbleFontSize, si as scratchBubbleLineHeight, ei as scratchBubbleMaximumLineWidth, hi as scratchBubbleMetrics, ti as scratchBubbleMinimumTextWidth, ri as scratchBubblePadding, ni as scratchBubbleStrokeWidth, ai as scratchBubbleTailHeight, $r as scratchBubbleTextLimit, Wr as splitBubbleContent, zr as splitBubbleText, Tr as wrapText };
5062
+ export { Q as BubbleCompositionError, yr as UnicodeLineBreakProvider, ee as actorRelativeBubbleCenter, d as bubbleBackgroundRegions, Te as bubbleBodyCenterOffset, Mr as bubbleContentPlainText, Nr as bubbleContentReadingText, u as bubbleDirectionAliases, l as bubbleDirectionNames, di as bubbleLayoutProfileForStyleInput, qr as bubblePortraitPlacements, Fr as bubbleRevealUnits, N as bubbleVisualStyles, $i as createBubbleComposition, x as defaultBubbleDistance, C as defaultBubbleOffset, f as defaultBubblePlacementInput, Xr as defaultBubblePortraitCornerRadius, Yr as defaultBubblePortraitOffset, Jr as defaultBubblePortraitPlacement, S as defaultBubbleTailLength, pi as formatScratchBubbleArgument, jr as isPlainBubbleContent, fi as isScratchDefaultBubbleStyleInput, hi as layoutScratchBubbleText, Pr as mergeBubbleContent, Ar as normalizeBubbleContent, T as normalizeBubbleDistance, D as normalizeBubbleOffset, y as normalizeBubblePlacement, $r as normalizeBubblePortraitCornerRadius, Qr as normalizeBubblePortraitOffset, Zr as normalizeBubblePortraitPlacement, Rr as normalizeBubbleReveal, E as normalizeBubbleTailLength, _i as positionScratchBubble, De as renderBubbleSvg, Si as renderScratchBubbleSvg, Kr as revealedBubbleContent, Vr as revealedBubbleText, ai as scratchBubbleCornerRadius, si as scratchBubbleFontSize, ci as scratchBubbleLineHeight, ti as scratchBubbleMaximumLineWidth, gi as scratchBubbleMetrics, ni as scratchBubbleMinimumTextWidth, ii as scratchBubblePadding, ri as scratchBubbleStrokeWidth, oi as scratchBubbleTailHeight, ei as scratchBubbleTextLimit, Gr as splitBubbleContent, Br as splitBubbleText, Er as wrapText };