@kubohiroya/turbowarp-bubble 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +17 -17
- package/README.md +17 -17
- package/dist/composition.js +525 -521
- package/dist/turbowarp-adapter.js +1035 -961
- package/dist/turbowarp-bubble.js +189 -58
- package/dist/types/bubble-svg.d.ts +15 -0
- package/docs/assets/bubble-style-gallery.svg +2 -2
- package/docs/assets/width-linebreak-guide.svg +6 -6
- package/docs/block-manual.ja.md +10 -10
- package/docs/block-manual.md +10 -10
- package/docs/index.html +11 -11
- package/docs/ja/index.html +11 -11
- package/package.json +10 -10
|
@@ -266,15 +266,15 @@ var C = 480, w = 360, T = 100, E = 50, D = 1, O = 128, k = {
|
|
|
266
266
|
rubyGap: D
|
|
267
267
|
});
|
|
268
268
|
function M(e, t, n) {
|
|
269
|
-
let r =
|
|
269
|
+
let r = R(t, n), i = e.split("\n").map((e) => ({
|
|
270
270
|
text: e,
|
|
271
|
-
width:
|
|
271
|
+
width: ee(e, r.fontSize)
|
|
272
272
|
})), a = Math.max(1, ...i.map((e) => e.width)), o = Math.max(1, Math.ceil(a + r.padding * 2)), s = Math.max(1, Math.ceil(r.lineHeight * i.length + r.padding * 2)), c = t.alignment === "center" ? o / 2 : t.alignment === "right" ? o - r.padding : r.padding, l = Object.freeze(i.map((e, t) => Object.freeze({
|
|
273
273
|
baseline: r.padding + r.fontSize + r.lineHeight * t,
|
|
274
274
|
text: e.text,
|
|
275
275
|
width: e.width,
|
|
276
276
|
x: c
|
|
277
|
-
}))), u =
|
|
277
|
+
}))), u = z(t, r);
|
|
278
278
|
return Object.freeze({
|
|
279
279
|
height: s,
|
|
280
280
|
lines: l,
|
|
@@ -284,8 +284,8 @@ function M(e, t, n) {
|
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
function N(e, t, n, r) {
|
|
287
|
-
let i =
|
|
288
|
-
...
|
|
287
|
+
let i = R(t, n), a = i.fontSize * (t.rubyFontPercent / T), o = t.rubyGap * i.fontScale, s = Object.freeze({
|
|
288
|
+
...z(t, i),
|
|
289
289
|
rubyFontPercent: t.rubyFontPercent,
|
|
290
290
|
rubyFontSize: a,
|
|
291
291
|
rubyGap: o
|
|
@@ -300,7 +300,7 @@ function N(e, t, n, r) {
|
|
|
300
300
|
type: "ruby"
|
|
301
301
|
});
|
|
302
302
|
u.push(e);
|
|
303
|
-
let r =
|
|
303
|
+
let r = ee(n.base, i.fontSize), o = ee(n.reading, a);
|
|
304
304
|
d.push({
|
|
305
305
|
base: n.base,
|
|
306
306
|
baseWidth: r,
|
|
@@ -312,7 +312,7 @@ function N(e, t, n, r) {
|
|
|
312
312
|
});
|
|
313
313
|
continue;
|
|
314
314
|
}
|
|
315
|
-
for (let e of
|
|
315
|
+
for (let e of B(n.text)) {
|
|
316
316
|
if (e.segment === "\n") {
|
|
317
317
|
d.push("break");
|
|
318
318
|
continue;
|
|
@@ -328,7 +328,7 @@ function N(e, t, n, r) {
|
|
|
328
328
|
reveal: n,
|
|
329
329
|
text: e.segment,
|
|
330
330
|
type: "text",
|
|
331
|
-
width:
|
|
331
|
+
width: ee(e.segment, i.fontSize)
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -419,14 +419,14 @@ function I(e, t) {
|
|
|
419
419
|
let n = e.trim();
|
|
420
420
|
return n === "" ? t : n.toLowerCase() === "transparent" || /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/iu.test(n) || globalThis.CSS?.supports?.("color", n) ? n : t;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function L(e) {
|
|
423
423
|
let t = e.trim(), n = [...t].some((e) => {
|
|
424
424
|
let t = e.codePointAt(0) ?? 0;
|
|
425
425
|
return t <= 31 || t === 127 || ",;{}".includes(e);
|
|
426
426
|
});
|
|
427
427
|
return t === "" || t.length > O || n ? A.font : t;
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function R(e, t) {
|
|
430
430
|
let n = Math.min(t[0] / C, t[1] / w), r = n * (e.fontPercent / T);
|
|
431
431
|
return {
|
|
432
432
|
cornerRadius: k.cornerRadius * n,
|
|
@@ -436,7 +436,7 @@ function L(e, t) {
|
|
|
436
436
|
padding: k.padding * n
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function z(e, t) {
|
|
440
440
|
return Object.freeze({
|
|
441
441
|
alignment: e.alignment,
|
|
442
442
|
backgroundColor: e.backgroundColor,
|
|
@@ -449,9 +449,9 @@ function R(e, t) {
|
|
|
449
449
|
textColor: e.textColor
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function B(e) {
|
|
453
453
|
let t = [], n = "", r = 0, i = !1, a = 0;
|
|
454
|
-
for (let o of e) !(n !== "" && (i || o === "" ||
|
|
454
|
+
for (let o of e) !(n !== "" && (i || o === "" || V(o))) && n !== "" && (t.push({
|
|
455
455
|
end: a,
|
|
456
456
|
segment: n,
|
|
457
457
|
start: r
|
|
@@ -462,12 +462,12 @@ function z(e) {
|
|
|
462
462
|
start: r
|
|
463
463
|
}), t;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function V(e) {
|
|
466
466
|
if (/\p{Mark}/u.test(e)) return !0;
|
|
467
467
|
let t = e.codePointAt(0) ?? 0;
|
|
468
468
|
return t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999 || t >= 127995 && t <= 127999;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function ee(e, t) {
|
|
471
471
|
let n = 0;
|
|
472
472
|
for (let t of e) {
|
|
473
473
|
if (/\p{Mark}/u.test(t)) continue;
|
|
@@ -494,7 +494,7 @@ function H(e) {
|
|
|
494
494
|
function U(e) {
|
|
495
495
|
return String(Math.round(e * 1e3) / 1e3);
|
|
496
496
|
}
|
|
497
|
-
var te = l.blocks, ne = l.menus, re = "https://kubohiroya.github.io/turbowarp-svg-text/", ie = "default", ae = 100,
|
|
497
|
+
var te = l.blocks, ne = l.menus, re = "https://kubohiroya.github.io/turbowarp-svg-text/", ie = "default", ae = 100, W = 50, oe = 1, se = 1, ce = 1e3, le = 10, ue = 100, de = 0, fe = 100, pe = d.blockIconURI, me = class {
|
|
498
498
|
constructor(e = Scratch.vm?.runtime, t = {}) {
|
|
499
499
|
if (this.styles = /* @__PURE__ */ new Map([[ie, j]]), this.textActors = /* @__PURE__ */ new Map(), !e) throw Error("SVG Text requires the TurboWarp VM.");
|
|
500
500
|
this.runtime = e, this.castToString = t.castToString ?? Scratch.Cast.toString, (t.listenForRuntimeEvents ?? !0) && this.runtime.on("STAGE_SIZE_CHANGED", () => {
|
|
@@ -574,14 +574,14 @@ var te = l.blocks, ne = l.menus, re = "https://kubohiroya.github.io/turbowarp-sv
|
|
|
574
574
|
return Number.isFinite(t) ? Math.min(ce, Math.max(se, t)) : ae;
|
|
575
575
|
}
|
|
576
576
|
normalizeRubyFontPercent(e) {
|
|
577
|
-
if (typeof e == "string" && e.trim() === "") return
|
|
577
|
+
if (typeof e == "string" && e.trim() === "") return W;
|
|
578
578
|
let t = Number(e);
|
|
579
|
-
return Number.isFinite(t) ? Math.min(ue, Math.max(le, t)) :
|
|
579
|
+
return Number.isFinite(t) ? Math.min(ue, Math.max(le, t)) : W;
|
|
580
580
|
}
|
|
581
581
|
normalizeRubyGap(e) {
|
|
582
|
-
if (typeof e == "string" && e.trim() === "") return
|
|
582
|
+
if (typeof e == "string" && e.trim() === "") return oe;
|
|
583
583
|
let t = Number(e);
|
|
584
|
-
return Number.isFinite(t) ? Math.min(fe, Math.max(de, t)) :
|
|
584
|
+
return Number.isFinite(t) ? Math.min(fe, Math.max(de, t)) : oe;
|
|
585
585
|
}
|
|
586
586
|
normalizeMessage(e) {
|
|
587
587
|
return this.castToString(e).replace(/\\r\\n|\\n|\\r/gu, "\n");
|
|
@@ -594,7 +594,7 @@ var te = l.blocks, ne = l.menus, re = "https://kubohiroya.github.io/turbowarp-sv
|
|
|
594
594
|
return I(this.castToString(e), t);
|
|
595
595
|
}
|
|
596
596
|
normalizeFont(e) {
|
|
597
|
-
return
|
|
597
|
+
return L(this.castToString(e));
|
|
598
598
|
}
|
|
599
599
|
getNativeSize() {
|
|
600
600
|
let e = this.runtime.renderer?.getNativeSize?.();
|
|
@@ -698,7 +698,7 @@ function Ae(e) {
|
|
|
698
698
|
return Object.freeze({
|
|
699
699
|
alignment: e.alignment ?? A.alignment,
|
|
700
700
|
backgroundColor: I(e.backgroundColor ?? "", A.backgroundColor),
|
|
701
|
-
font:
|
|
701
|
+
font: L(e.font ?? ""),
|
|
702
702
|
fontPercent: e.fontPercent ?? A.fontPercent,
|
|
703
703
|
rubyFontPercent: e.rubyFontPercent ?? j.rubyFontPercent,
|
|
704
704
|
rubyGap: e.rubyGap ?? j.rubyGap,
|
|
@@ -1260,7 +1260,7 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1260
1260
|
for (i = 0; i < r.t; ++i) t[i + n.t] = n.am(0, r[i], t, i, 0, n.t);
|
|
1261
1261
|
t.s = 0, t.clamp(), this.s != e.s && c.ZERO.subTo(t, t);
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function L(e) {
|
|
1264
1264
|
for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) e[n] = 0;
|
|
1265
1265
|
for (n = 0; n < t.t - 1; ++n) {
|
|
1266
1266
|
var r = t.am(n, t[n], e, 2 * n, 0, 1);
|
|
@@ -1268,7 +1268,7 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1)), e.s = 0, e.clamp();
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1271
|
+
function R(e, t, n) {
|
|
1272
1272
|
var r = e.abs();
|
|
1273
1273
|
if (!(r.t <= 0)) {
|
|
1274
1274
|
var i = this.abs();
|
|
@@ -1291,17 +1291,17 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function z(e) {
|
|
1295
1295
|
var t = l();
|
|
1296
1296
|
return this.abs().divRemTo(e, null, t), this.s < 0 && t.compareTo(c.ZERO) > 0 && e.subTo(t, t), t;
|
|
1297
1297
|
}
|
|
1298
|
-
function
|
|
1298
|
+
function B(e) {
|
|
1299
1299
|
this.m = e;
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function V(e) {
|
|
1302
1302
|
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1304
|
+
function ee(e) {
|
|
1305
1305
|
return e;
|
|
1306
1306
|
}
|
|
1307
1307
|
function H(e) {
|
|
@@ -1313,7 +1313,7 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1313
1313
|
function te(e, t) {
|
|
1314
1314
|
e.squareTo(t), this.reduce(t);
|
|
1315
1315
|
}
|
|
1316
|
-
|
|
1316
|
+
B.prototype.convert = V, B.prototype.revert = ee, B.prototype.reduce = H, B.prototype.mulTo = U, B.prototype.sqrTo = te;
|
|
1317
1317
|
function ne() {
|
|
1318
1318
|
if (this.t < 1) return 0;
|
|
1319
1319
|
var e = this[0];
|
|
@@ -1332,7 +1332,7 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1332
1332
|
var t = l();
|
|
1333
1333
|
return e.copyTo(t), this.reduce(t), t;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function W(e) {
|
|
1336
1336
|
for (; e.t <= this.mt2;) e[e.t++] = 0;
|
|
1337
1337
|
for (var t = 0; t < this.m.t; ++t) {
|
|
1338
1338
|
var n = e[t] & 32767, r = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
|
|
@@ -1340,13 +1340,13 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function oe(e, t) {
|
|
1344
1344
|
e.squareTo(t), this.reduce(t);
|
|
1345
1345
|
}
|
|
1346
1346
|
function se(e, t, n) {
|
|
1347
1347
|
e.multiplyTo(t, n), this.reduce(n);
|
|
1348
1348
|
}
|
|
1349
|
-
re.prototype.convert = ie, re.prototype.revert = ae, re.prototype.reduce =
|
|
1349
|
+
re.prototype.convert = ie, re.prototype.revert = ae, re.prototype.reduce = W, re.prototype.mulTo = se, re.prototype.sqrTo = oe;
|
|
1350
1350
|
function ce() {
|
|
1351
1351
|
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
1352
1352
|
}
|
|
@@ -1361,10 +1361,10 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1361
1361
|
return t.revert(n);
|
|
1362
1362
|
}
|
|
1363
1363
|
function ue(e, t) {
|
|
1364
|
-
var n = e < 256 || t.isEven() ? new
|
|
1364
|
+
var n = e < 256 || t.isEven() ? new B(t) : new re(t);
|
|
1365
1365
|
return this.exp(e, n);
|
|
1366
1366
|
}
|
|
1367
|
-
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = j, c.prototype.drShiftTo = M, c.prototype.lShiftTo = N, c.prototype.rShiftTo = P, c.prototype.subTo = F, c.prototype.multiplyTo = I, c.prototype.squareTo =
|
|
1367
|
+
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = j, c.prototype.drShiftTo = M, c.prototype.lShiftTo = N, c.prototype.rShiftTo = P, c.prototype.subTo = F, c.prototype.multiplyTo = I, c.prototype.squareTo = L, c.prototype.divRemTo = R, c.prototype.invDigit = ne, c.prototype.isEven = ce, c.prototype.exp = le, c.prototype.toString = T, c.prototype.negate = E, c.prototype.abs = D, c.prototype.compareTo = O, c.prototype.bitLength = A, c.prototype.mod = z, c.prototype.modPowInt = ue, c.ZERO = S(0), c.ONE = S(1);
|
|
1368
1368
|
function de() {
|
|
1369
1369
|
var e = l();
|
|
1370
1370
|
return this.copyTo(e), e;
|
|
@@ -1621,7 +1621,7 @@ var it = /* @__PURE__ */ o(((e, t) => {
|
|
|
1621
1621
|
function pt(e, t) {
|
|
1622
1622
|
var n = e.bitLength(), r, i = S(1), a;
|
|
1623
1623
|
if (n <= 0) return i;
|
|
1624
|
-
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new
|
|
1624
|
+
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new B(t) : t.isEven() ? new st(t) : new re(t);
|
|
1625
1625
|
var o = [], s = 3, c = r - 1, u = (1 << r) - 1;
|
|
1626
1626
|
if (o[1] = a.convert(this), r > 1) {
|
|
1627
1627
|
var d = l();
|
|
@@ -3635,41 +3635,103 @@ var ut = Object.freeze([
|
|
|
3635
3635
|
function pt(...e) {
|
|
3636
3636
|
return e.some((e) => e === "THINKING" || e === "DREAMING") ? dt : ft;
|
|
3637
3637
|
}
|
|
3638
|
-
|
|
3638
|
+
var mt = 2, ht = 400, gt = /* @__PURE__ */ new Map(), K = 128;
|
|
3639
|
+
function _t(e, t, n) {
|
|
3640
|
+
switch (e) {
|
|
3641
|
+
case "NO_BUBBLE": return;
|
|
3642
|
+
case "THINKING":
|
|
3643
|
+
case "DREAMING": return Lt(t, n);
|
|
3644
|
+
case "YELLING": return Bt(t, n);
|
|
3645
|
+
case "WAVY": return Vt(t, n);
|
|
3646
|
+
case "ANNOUNCEMENT": return Ct(t, n, 13, 30);
|
|
3647
|
+
case "NORMAL":
|
|
3648
|
+
case "OFF_PANEL":
|
|
3649
|
+
case "WHISPERING":
|
|
3650
|
+
case "NARRATION": return Ct(t, n);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
function vt(e, t) {
|
|
3654
|
+
let n = !1;
|
|
3655
|
+
for (let r = 0, i = t.length - 1; r < t.length; i = r, r += 1) {
|
|
3656
|
+
let a = t[r], o = t[i];
|
|
3657
|
+
!a || !o || a.y > e.y != o.y > e.y && e.x < (o.x - a.x) * (e.y - a.y) / (o.y - a.y) + a.x && (n = !n);
|
|
3658
|
+
}
|
|
3659
|
+
return n;
|
|
3660
|
+
}
|
|
3661
|
+
function yt(e, t, n, r, i) {
|
|
3662
|
+
let a = r / 2 + 6, o = i / 2 + 6, s = t / 2 - a, c = t / 2 + a, l = n / 2 - o, u = n / 2 + o, d = (t, n) => +!vt({
|
|
3663
|
+
x: t,
|
|
3664
|
+
y: n
|
|
3665
|
+
}, e), f = 0, p = Math.max(1, Math.ceil((c - s) / 4)), m = Math.max(1, Math.ceil((u - l) / 4));
|
|
3666
|
+
for (let e = 0; e <= p; e += 1) {
|
|
3667
|
+
let t = s + (c - s) * e / p;
|
|
3668
|
+
f += d(t, l) + d(t, u);
|
|
3669
|
+
}
|
|
3670
|
+
for (let e = 1; e < m; e += 1) {
|
|
3671
|
+
let t = l + (u - l) * e / m;
|
|
3672
|
+
f += d(s, t) + d(c, t);
|
|
3673
|
+
}
|
|
3674
|
+
for (let t of e) t.x > s && t.x < c && t.y > l && t.y < u && (f += 1);
|
|
3675
|
+
return f;
|
|
3676
|
+
}
|
|
3677
|
+
function q(e) {
|
|
3678
|
+
let t = Math.max(0, e.contentWidth), n = Math.max(0, e.contentHeight);
|
|
3679
|
+
if (!Number.isFinite(t) || !Number.isFinite(n)) throw TypeError("Bubble content size must be finite.");
|
|
3680
|
+
let r = [...new Set(e.styles)], i = `${r.join(",")}:${t}:${n}`, a = gt.get(i);
|
|
3681
|
+
if (a) return a;
|
|
3682
|
+
let o = (e, i) => r.reduce((r, a) => {
|
|
3683
|
+
let o = _t(a, e, i);
|
|
3684
|
+
return o ? r + yt(o, e, i, t, n) : r;
|
|
3685
|
+
}, 0), s = pt(...r), c = Math.max(t + 48, s.width), l = Math.max(n + 48, s.height);
|
|
3686
|
+
for (let e = 0; e < ht && o(c, l) > 0; e += 1) {
|
|
3687
|
+
let e = o(c + mt, l), t = o(c, l + mt);
|
|
3688
|
+
e <= t && (c += mt), t <= e && (l += mt);
|
|
3689
|
+
}
|
|
3690
|
+
let u = Object.freeze({
|
|
3691
|
+
height: l,
|
|
3692
|
+
width: c
|
|
3693
|
+
});
|
|
3694
|
+
if (gt.size >= K) {
|
|
3695
|
+
let e = gt.keys().next().value;
|
|
3696
|
+
e !== void 0 && gt.delete(e);
|
|
3697
|
+
}
|
|
3698
|
+
return gt.set(i, u), u;
|
|
3699
|
+
}
|
|
3700
|
+
function bt(e) {
|
|
3639
3701
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
3640
3702
|
}
|
|
3641
|
-
function
|
|
3703
|
+
function xt(e, t) {
|
|
3642
3704
|
let n = e ?? t;
|
|
3643
3705
|
if (!Number.isFinite(n) || n <= 0) throw TypeError("Bubble SVG dimensions must be positive and finite.");
|
|
3644
3706
|
return n;
|
|
3645
3707
|
}
|
|
3646
|
-
function
|
|
3708
|
+
function St(e) {
|
|
3647
3709
|
if (e === null) return null;
|
|
3648
3710
|
let t = e ?? 180;
|
|
3649
3711
|
if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
|
|
3650
3712
|
return (t % 360 + 360) % 360;
|
|
3651
3713
|
}
|
|
3652
|
-
function
|
|
3653
|
-
let r = e -
|
|
3714
|
+
function Ct(e, t, n = 18, r = 24) {
|
|
3715
|
+
let i = r, a = r, o = e - r, s = t - r;
|
|
3654
3716
|
return [
|
|
3655
3717
|
{
|
|
3656
|
-
centerX:
|
|
3657
|
-
centerY:
|
|
3718
|
+
centerX: o - n,
|
|
3719
|
+
centerY: a + n,
|
|
3658
3720
|
start: -90
|
|
3659
3721
|
},
|
|
3660
3722
|
{
|
|
3661
|
-
centerX:
|
|
3662
|
-
centerY:
|
|
3723
|
+
centerX: o - n,
|
|
3724
|
+
centerY: s - n,
|
|
3663
3725
|
start: 0
|
|
3664
3726
|
},
|
|
3665
3727
|
{
|
|
3666
|
-
centerX:
|
|
3667
|
-
centerY:
|
|
3728
|
+
centerX: i + n,
|
|
3729
|
+
centerY: s - n,
|
|
3668
3730
|
start: 90
|
|
3669
3731
|
},
|
|
3670
3732
|
{
|
|
3671
|
-
centerX:
|
|
3672
|
-
centerY:
|
|
3733
|
+
centerX: i + n,
|
|
3734
|
+
centerY: a + n,
|
|
3673
3735
|
start: 180
|
|
3674
3736
|
}
|
|
3675
3737
|
].flatMap(({ centerX: e, centerY: t, start: r }) => Array.from({ length: 11 }, (i, a) => {
|
|
@@ -3680,24 +3742,24 @@ function K(e, t, n = 18) {
|
|
|
3680
3742
|
};
|
|
3681
3743
|
}));
|
|
3682
3744
|
}
|
|
3683
|
-
function
|
|
3745
|
+
function wt(e, t) {
|
|
3684
3746
|
return e.x * t.y - e.y * t.x;
|
|
3685
3747
|
}
|
|
3686
|
-
function
|
|
3748
|
+
function Tt(e, t) {
|
|
3687
3749
|
return {
|
|
3688
3750
|
x: e.x - t.x,
|
|
3689
3751
|
y: e.y - t.y
|
|
3690
3752
|
};
|
|
3691
3753
|
}
|
|
3692
|
-
function
|
|
3754
|
+
function Et(e, t) {
|
|
3693
3755
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
3694
3756
|
}
|
|
3695
|
-
function
|
|
3757
|
+
function Dt(e, t, n, r) {
|
|
3696
3758
|
let i = t, a = r;
|
|
3697
3759
|
for (; a > 0;) {
|
|
3698
3760
|
let t = (i + n + e.length) % e.length, r = e[i], o = e[t];
|
|
3699
3761
|
if (!r || !o) throw Error("Bubble border path is invalid.");
|
|
3700
|
-
let s =
|
|
3762
|
+
let s = Et(r, o);
|
|
3701
3763
|
if (a <= s) {
|
|
3702
3764
|
let e = a / s;
|
|
3703
3765
|
return {
|
|
@@ -3711,14 +3773,14 @@ function q(e, t, n, r) {
|
|
|
3711
3773
|
if (!o) throw Error("Bubble border path is empty.");
|
|
3712
3774
|
return o;
|
|
3713
3775
|
}
|
|
3714
|
-
function
|
|
3776
|
+
function Ot(e, t, n, r, i) {
|
|
3715
3777
|
let a;
|
|
3716
3778
|
for (let r = 0; r < e.length; r += 1) {
|
|
3717
3779
|
let i = e[r], o = e[(r + 1) % e.length];
|
|
3718
3780
|
if (!i || !o) continue;
|
|
3719
|
-
let s =
|
|
3781
|
+
let s = Tt(o, i), c = wt(n, s);
|
|
3720
3782
|
if (Math.abs(c) < 1e-9) continue;
|
|
3721
|
-
let l =
|
|
3783
|
+
let l = Tt(i, t), u = wt(l, s) / c, d = wt(l, n) / c;
|
|
3722
3784
|
u < 0 || d < -1e-9 || d > 1 + 1e-9 || a && u >= a.rayScale || (a = {
|
|
3723
3785
|
edgeIndex: r,
|
|
3724
3786
|
point: {
|
|
@@ -3736,58 +3798,58 @@ function bt(e, t, n, r, i) {
|
|
|
3736
3798
|
], s = a.edgeIndex + 1;
|
|
3737
3799
|
return {
|
|
3738
3800
|
borderPoint: a.point,
|
|
3739
|
-
base: [
|
|
3801
|
+
base: [Dt(o, s, -1, 9), Dt(o, s, 1, 9)],
|
|
3740
3802
|
tip: {
|
|
3741
3803
|
x: i?.x ?? t.x + n.x * (a.rayScale + r),
|
|
3742
3804
|
y: i?.y ?? t.y + n.y * (a.rayScale + r)
|
|
3743
3805
|
}
|
|
3744
3806
|
};
|
|
3745
3807
|
}
|
|
3746
|
-
function
|
|
3808
|
+
function kt(e) {
|
|
3747
3809
|
let t = e * Math.PI / 180;
|
|
3748
3810
|
return {
|
|
3749
3811
|
x: Math.sin(t),
|
|
3750
3812
|
y: -Math.cos(t)
|
|
3751
3813
|
};
|
|
3752
3814
|
}
|
|
3753
|
-
function
|
|
3815
|
+
function At(e, t, n, r) {
|
|
3754
3816
|
return {
|
|
3755
3817
|
x: n.x + (e.x - t.x) * r,
|
|
3756
3818
|
y: n.y + (e.y - t.y) * r
|
|
3757
3819
|
};
|
|
3758
3820
|
}
|
|
3759
|
-
function
|
|
3821
|
+
function jt(e, t, n, r, i, a) {
|
|
3760
3822
|
let o = {
|
|
3761
3823
|
x: t / 2,
|
|
3762
3824
|
y: n / 2
|
|
3763
|
-
}, s =
|
|
3825
|
+
}, s = kt(r), c = Ot(e, o, s, i), l = Et(o, c.borderPoint), u = a.scalePercent / 100, d = {
|
|
3764
3826
|
x: o.x - s.x * l * (u - 1) + a.x,
|
|
3765
3827
|
y: o.y - s.y * l * (u - 1) - a.y
|
|
3766
3828
|
};
|
|
3767
3829
|
return {
|
|
3768
|
-
body: e.map((e) =>
|
|
3830
|
+
body: e.map((e) => At(e, o, d, u)),
|
|
3769
3831
|
bodyCenter: d,
|
|
3770
3832
|
tip: c.tip
|
|
3771
3833
|
};
|
|
3772
3834
|
}
|
|
3773
|
-
function
|
|
3835
|
+
function Mt(e) {
|
|
3774
3836
|
let t = e[0];
|
|
3775
3837
|
if (!t) throw Error("Bubble polygon is empty.");
|
|
3776
3838
|
return `M ${t.x.toFixed(4)} ${t.y.toFixed(4)} ${e.slice(1).map(({ x: e, y: t }) => `L ${e.toFixed(4)} ${t.toFixed(4)}`).join(" ")} Z`;
|
|
3777
3839
|
}
|
|
3778
|
-
function
|
|
3840
|
+
function Nt(e) {
|
|
3779
3841
|
return Math.abs(e.reduce((t, n, r) => {
|
|
3780
3842
|
let i = e[(r + 1) % e.length];
|
|
3781
3843
|
return i ? t + n.x * i.y - i.x * n.y : t;
|
|
3782
3844
|
}, 0) / 2);
|
|
3783
3845
|
}
|
|
3784
|
-
function
|
|
3785
|
-
return `<path d="${
|
|
3846
|
+
function Pt(e, t, n, r = "") {
|
|
3847
|
+
return `<path d="${Mt(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
|
|
3786
3848
|
}
|
|
3787
|
-
function
|
|
3788
|
-
let o =
|
|
3849
|
+
function Ft(e, t, n, r, i, a = "") {
|
|
3850
|
+
let o = Tt(n, t), s = Math.hypot(o.x, o.y);
|
|
3789
3851
|
if (!(s > 0)) throw TypeError("Bubble body center and tail tip must differ.");
|
|
3790
|
-
let c =
|
|
3852
|
+
let c = Ot(e, t, {
|
|
3791
3853
|
x: o.x / s,
|
|
3792
3854
|
y: o.y / s
|
|
3793
3855
|
}, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = at.default.union([l(e)], [[l([
|
|
@@ -3799,53 +3861,57 @@ function Dt(e, t, n, r, i, a = "") {
|
|
|
3799
3861
|
let d = u.map((e) => e.map(([e, t]) => ({
|
|
3800
3862
|
x: e,
|
|
3801
3863
|
y: t
|
|
3802
|
-
}))).sort((e, t) =>
|
|
3864
|
+
}))).sort((e, t) => Nt(t) - Nt(e))[0];
|
|
3803
3865
|
if (!d) throw Error("JSClipper returned an empty Bubble outline.");
|
|
3804
|
-
return `<path d="${
|
|
3866
|
+
return `<path d="${Mt(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
|
|
3805
3867
|
}
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3868
|
+
var It = Object.freeze([
|
|
3869
|
+
1,
|
|
3870
|
+
.78,
|
|
3871
|
+
1.14,
|
|
3872
|
+
.88,
|
|
3873
|
+
1.06,
|
|
3874
|
+
.8,
|
|
3875
|
+
1.2,
|
|
3876
|
+
.92
|
|
3877
|
+
]);
|
|
3878
|
+
function Lt(e, t) {
|
|
3879
|
+
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) => {
|
|
3880
|
+
let t = Math.cos(e), n = Math.sin(e);
|
|
3881
|
+
return {
|
|
3882
|
+
x: i + c * Math.sign(t) * Math.abs(t) ** (2 / 3),
|
|
3883
|
+
y: a + l * Math.sign(n) * Math.abs(n) ** (2 / 3)
|
|
3818
3884
|
};
|
|
3819
|
-
|
|
3885
|
+
}, d = [0], f = u(-Math.PI / 2);
|
|
3886
|
+
for (let e = 1; e <= 720; e += 1) {
|
|
3887
|
+
let t = u(-Math.PI / 2 + e * Math.PI * 2 / 720);
|
|
3888
|
+
d.push((d[e - 1] ?? 0) + Math.hypot(t.x - f.x, t.y - f.y)), f = t;
|
|
3889
|
+
}
|
|
3890
|
+
let p = d[720] ?? 0, m = It.reduce((e, t) => e + t, 0), h = Math.max(8, Math.round(p / (o * m) * It.length)), g = Array.from({ length: h }, (e, t) => It[t % It.length] ?? 1), _ = g.reduce((e, t) => e + t, 0), v = (e) => {
|
|
3891
|
+
let t = 0, n = 720;
|
|
3892
|
+
for (; n - t > 1;) {
|
|
3893
|
+
let r = t + n >> 1;
|
|
3894
|
+
(d[r] ?? 0) <= e ? t = r : n = r;
|
|
3895
|
+
}
|
|
3896
|
+
let r = d[t] ?? 0, i = d[n] ?? r, a = i > r ? (e - r) / (i - r) : 0;
|
|
3897
|
+
return u(-Math.PI / 2 + (t + a) * Math.PI * 2 / 720);
|
|
3898
|
+
}, y = 0;
|
|
3899
|
+
return g.map((e) => {
|
|
3900
|
+
let t = v(y / _ * p);
|
|
3901
|
+
return y += e, t;
|
|
3820
3902
|
});
|
|
3821
|
-
return `M ${n(t.x)} ${n(t.y)} ${r.join(" ")} Z`;
|
|
3822
3903
|
}
|
|
3823
|
-
function
|
|
3824
|
-
let i = e
|
|
3825
|
-
|
|
3826
|
-
|
|
3904
|
+
function Rt(e, t, n, r) {
|
|
3905
|
+
let i = (e) => e.toFixed(4), a = Lt(e, t), o = a[0];
|
|
3906
|
+
if (!o) throw Error("Cloud Bubble path is invalid.");
|
|
3907
|
+
let s = a.map((e, t) => {
|
|
3908
|
+
let n = a[t] ?? o, r = a[(t + 1) % a.length] ?? o, s = Math.hypot(r.x - n.x, r.y - n.y) * .56;
|
|
3909
|
+
return `A ${i(s)} ${i(s)} 0 0 1 ${i(r.x)} ${i(r.y)}`;
|
|
3827
3910
|
});
|
|
3828
|
-
return `<path d="${
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
c(.28, .04),
|
|
3833
|
-
c(.5, .16),
|
|
3834
|
-
c(.68, .03),
|
|
3835
|
-
c(.84, .18),
|
|
3836
|
-
c(.98, .3),
|
|
3837
|
-
c(1, .52),
|
|
3838
|
-
c(.95, .7),
|
|
3839
|
-
c(.82, .82),
|
|
3840
|
-
c(.68, .97),
|
|
3841
|
-
c(.5, .84),
|
|
3842
|
-
c(.32, .97),
|
|
3843
|
-
c(.18, .82),
|
|
3844
|
-
c(.03, .7)
|
|
3845
|
-
])}" fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
3846
|
-
}
|
|
3847
|
-
function At(e, t, n, r, i, a) {
|
|
3848
|
-
let o = vt(n, t), s = Math.hypot(o.x, o.y), c = bt(e, t, {
|
|
3911
|
+
return `<path d="M ${i(o.x)} ${i(o.y)} ${s.join(" ")} Z" fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
3912
|
+
}
|
|
3913
|
+
function zt(e, t, n, r, i, a) {
|
|
3914
|
+
let o = Tt(n, t), s = Math.hypot(o.x, o.y), c = Ot(e, t, {
|
|
3849
3915
|
x: o.x / s,
|
|
3850
3916
|
y: o.y / s
|
|
3851
3917
|
}, 0, n), l = {
|
|
@@ -3873,7 +3939,7 @@ function At(e, t, n, r, i, a) {
|
|
|
3873
3939
|
radius: 3.5
|
|
3874
3940
|
}]).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("");
|
|
3875
3941
|
}
|
|
3876
|
-
function
|
|
3942
|
+
function Bt(e, t) {
|
|
3877
3943
|
let n = e / 2, r = t / 2;
|
|
3878
3944
|
return Array.from({ length: 28 }, (i, a) => {
|
|
3879
3945
|
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;
|
|
@@ -3883,7 +3949,7 @@ function jt(e, t) {
|
|
|
3883
3949
|
};
|
|
3884
3950
|
});
|
|
3885
3951
|
}
|
|
3886
|
-
function
|
|
3952
|
+
function Vt(e, t) {
|
|
3887
3953
|
let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
|
|
3888
3954
|
let n = t / 20;
|
|
3889
3955
|
return {
|
|
@@ -3916,61 +3982,61 @@ function Mt(e, t) {
|
|
|
3916
3982
|
}))
|
|
3917
3983
|
];
|
|
3918
3984
|
}
|
|
3919
|
-
function
|
|
3920
|
-
return e === "YELLING" ?
|
|
3985
|
+
function Ht(e, t, n) {
|
|
3986
|
+
return e === "YELLING" ? Bt(t, n) : e === "WAVY" ? Vt(t, n) : Ct(t, n);
|
|
3921
3987
|
}
|
|
3922
|
-
function
|
|
3923
|
-
let t = pt(e.style), n = Math.max(
|
|
3988
|
+
function Ut(e) {
|
|
3989
|
+
let t = pt(e.style), n = Math.max(xt(e.width, 220), t.width), r = Math.max(xt(e.height, 112), t.height), i = St(e.tailDirection);
|
|
3924
3990
|
if (i === null) throw TypeError("Bubble body center offset requires a tail direction.");
|
|
3925
3991
|
let a = ct(e.tailLength ?? ot), o = lt(e.offset), s = {
|
|
3926
3992
|
x: n / 2,
|
|
3927
3993
|
y: r / 2
|
|
3928
|
-
}, c =
|
|
3994
|
+
}, c = jt(Ht(e.style, n, r), n, r, i, a, o);
|
|
3929
3995
|
return Object.freeze({
|
|
3930
3996
|
x: c.bodyCenter.x - s.x,
|
|
3931
3997
|
y: c.bodyCenter.y - s.y
|
|
3932
3998
|
});
|
|
3933
3999
|
}
|
|
3934
|
-
function
|
|
3935
|
-
let c =
|
|
3936
|
-
if (r === null) return
|
|
3937
|
-
let l =
|
|
3938
|
-
return
|
|
4000
|
+
function Wt(e, t, n, r, i, a, o, s) {
|
|
4001
|
+
let c = Ct(t, n), l = (e) => r === null ? e : jt(e, t, n, r, o, s).body, u = (e, c = "") => {
|
|
4002
|
+
if (r === null) return Pt(e, i, a, c);
|
|
4003
|
+
let l = jt(e, t, n, r, o, s);
|
|
4004
|
+
return Ft(l.body, l.bodyCenter, l.tip, i, a, c);
|
|
3939
4005
|
};
|
|
3940
4006
|
switch (e) {
|
|
3941
4007
|
case "NO_BUBBLE": return "";
|
|
3942
4008
|
case "THINKING":
|
|
3943
4009
|
case "DREAMING": {
|
|
3944
|
-
if (r === null) return
|
|
3945
|
-
let l =
|
|
4010
|
+
if (r === null) return Rt(t, n, i, a);
|
|
4011
|
+
let l = jt(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
|
|
3946
4012
|
x: t / 2,
|
|
3947
4013
|
y: n / 2
|
|
3948
4014
|
}, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
|
|
3949
|
-
return `${
|
|
4015
|
+
return `${zt(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${Rt(t, n, i, a)}</g>`;
|
|
3950
4016
|
}
|
|
3951
|
-
case "YELLING": return u(
|
|
3952
|
-
case "WAVY": return u(
|
|
4017
|
+
case "YELLING": return u(Bt(t, n));
|
|
4018
|
+
case "WAVY": return u(Vt(t, n));
|
|
3953
4019
|
case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
|
|
3954
4020
|
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"/>`;
|
|
3955
|
-
case "NARRATION": return
|
|
4021
|
+
case "NARRATION": return Pt(l(c), i, a);
|
|
3956
4022
|
case "OFF_PANEL": return u(c);
|
|
3957
4023
|
case "NORMAL": return u(c);
|
|
3958
4024
|
}
|
|
3959
4025
|
}
|
|
3960
|
-
function
|
|
4026
|
+
function Gt(e) {
|
|
3961
4027
|
if (!ut.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
|
|
3962
4028
|
if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
|
|
3963
|
-
let t =
|
|
4029
|
+
let t = xt(e.width, 220), n = xt(e.height, 112), r = xt(e.fontSize, 15), i = St(e.tailDirection), a = ct(e.tailLength ?? ot), o = e.offset === void 0 ? st : lt(e.offset), s = e.shapeTransition;
|
|
3964
4030
|
if (s !== void 0 && (!ut.includes(s.from) || !ut.includes(s.to) || !Number.isFinite(s.progress) || s.progress < 0 || s.progress > 1)) throw TypeError("Bubble shape transition is invalid.");
|
|
3965
4031
|
let c = pt(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 ? {
|
|
3966
4032
|
x: l / 2,
|
|
3967
4033
|
y: u / 2
|
|
3968
|
-
} : Ct(
|
|
4034
|
+
} : jt(Ct(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="${bt(p)}" font-family="${bt(m)}" font-size="${r * _}">${bt(e)}</text>`).join(""), b = s === void 0 ? Wt(e.style, l, u, i, d, f, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${Wt(s.from, l, u, i, d, f, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${Wt(s.to, l, u, i, d, f, a, o)}</g>`, x = bt(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)}"`;
|
|
3969
4035
|
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>`;
|
|
3970
4036
|
}
|
|
3971
4037
|
//#endregion
|
|
3972
4038
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
|
|
3973
|
-
var
|
|
4039
|
+
var Kt = 2048, qt = 2112, Jt = Uint8Array, Yt = Uint16Array, Xt = Int32Array, Zt = new Jt([
|
|
3974
4040
|
0,
|
|
3975
4041
|
0,
|
|
3976
4042
|
0,
|
|
@@ -4003,7 +4069,7 @@ var Lt = 2048, Rt = 2112, zt = Uint8Array, Bt = Uint16Array, Vt = Int32Array, Ht
|
|
|
4003
4069
|
0,
|
|
4004
4070
|
0,
|
|
4005
4071
|
0
|
|
4006
|
-
]),
|
|
4072
|
+
]), Qt = new Jt([
|
|
4007
4073
|
0,
|
|
4008
4074
|
0,
|
|
4009
4075
|
0,
|
|
@@ -4036,7 +4102,7 @@ var Lt = 2048, Rt = 2112, zt = Uint8Array, Bt = Uint16Array, Vt = Int32Array, Ht
|
|
|
4036
4102
|
13,
|
|
4037
4103
|
0,
|
|
4038
4104
|
0
|
|
4039
|
-
]),
|
|
4105
|
+
]), $t = new Jt([
|
|
4040
4106
|
16,
|
|
4041
4107
|
17,
|
|
4042
4108
|
18,
|
|
@@ -4056,51 +4122,51 @@ var Lt = 2048, Rt = 2112, zt = Uint8Array, Bt = Uint16Array, Vt = Int32Array, Ht
|
|
|
4056
4122
|
14,
|
|
4057
4123
|
1,
|
|
4058
4124
|
15
|
|
4059
|
-
]),
|
|
4060
|
-
for (var n = new
|
|
4061
|
-
for (var i = new
|
|
4125
|
+
]), en = function(e, t) {
|
|
4126
|
+
for (var n = new Yt(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
|
|
4127
|
+
for (var i = new Xt(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
|
|
4062
4128
|
return {
|
|
4063
4129
|
b: n,
|
|
4064
4130
|
r: i
|
|
4065
4131
|
};
|
|
4066
|
-
},
|
|
4067
|
-
|
|
4068
|
-
var
|
|
4069
|
-
|
|
4070
|
-
for (var
|
|
4071
|
-
var
|
|
4072
|
-
|
|
4073
|
-
}
|
|
4074
|
-
for (var
|
|
4075
|
-
for (var r = e.length, i = 0, a = new
|
|
4076
|
-
var o = new
|
|
4132
|
+
}, tn = en(Zt, 2), nn = tn.b, rn = tn.r;
|
|
4133
|
+
nn[28] = 258, rn[258] = 28;
|
|
4134
|
+
var an = en(Qt, 0), on = an.b;
|
|
4135
|
+
an.r;
|
|
4136
|
+
for (var sn = new Yt(32768), J = 0; J < 32768; ++J) {
|
|
4137
|
+
var cn = (J & 43690) >> 1 | (J & 21845) << 1;
|
|
4138
|
+
cn = (cn & 52428) >> 2 | (cn & 13107) << 2, cn = (cn & 61680) >> 4 | (cn & 3855) << 4, sn[J] = ((cn & 65280) >> 8 | (cn & 255) << 8) >> 1;
|
|
4139
|
+
}
|
|
4140
|
+
for (var ln = (function(e, t, n) {
|
|
4141
|
+
for (var r = e.length, i = 0, a = new Yt(t); i < r; ++i) e[i] && ++a[e[i] - 1];
|
|
4142
|
+
var o = new Yt(t);
|
|
4077
4143
|
for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
|
|
4078
4144
|
var s;
|
|
4079
4145
|
if (n) {
|
|
4080
|
-
s = new
|
|
4146
|
+
s = new Yt(1 << t);
|
|
4081
4147
|
var c = 15 - t;
|
|
4082
|
-
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[
|
|
4083
|
-
} else for (s = new
|
|
4148
|
+
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[sn[d] >> c] = l;
|
|
4149
|
+
} else for (s = new Yt(r), i = 0; i < r; ++i) e[i] && (s[i] = sn[o[e[i] - 1]++] >> 15 - e[i]);
|
|
4084
4150
|
return s;
|
|
4085
|
-
}),
|
|
4086
|
-
for (var J = 144; J < 256; ++J)
|
|
4087
|
-
for (var J = 256; J < 280; ++J)
|
|
4088
|
-
for (var J = 280; J < 288; ++J)
|
|
4089
|
-
for (var
|
|
4090
|
-
var
|
|
4151
|
+
}), un = new Jt(288), J = 0; J < 144; ++J) un[J] = 8;
|
|
4152
|
+
for (var J = 144; J < 256; ++J) un[J] = 9;
|
|
4153
|
+
for (var J = 256; J < 280; ++J) un[J] = 7;
|
|
4154
|
+
for (var J = 280; J < 288; ++J) un[J] = 8;
|
|
4155
|
+
for (var dn = new Jt(32), J = 0; J < 32; ++J) dn[J] = 5;
|
|
4156
|
+
var fn = /*#__PURE__*/ ln(un, 9, 1), pn = /*#__PURE__*/ ln(dn, 5, 1), mn = function(e) {
|
|
4091
4157
|
for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
|
|
4092
4158
|
return t;
|
|
4093
|
-
},
|
|
4159
|
+
}, hn = function(e, t, n) {
|
|
4094
4160
|
var r = t / 8 | 0;
|
|
4095
4161
|
return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
|
|
4096
|
-
},
|
|
4162
|
+
}, gn = function(e, t) {
|
|
4097
4163
|
var n = t / 8 | 0;
|
|
4098
4164
|
return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
|
|
4099
|
-
},
|
|
4165
|
+
}, _n = function(e) {
|
|
4100
4166
|
return (e + 7) / 8 | 0;
|
|
4101
|
-
},
|
|
4102
|
-
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new
|
|
4103
|
-
},
|
|
4167
|
+
}, vn = function(e, t, n) {
|
|
4168
|
+
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new Jt(e.subarray(t, n));
|
|
4169
|
+
}, yn = [
|
|
4104
4170
|
"unexpected EOF",
|
|
4105
4171
|
"invalid block type",
|
|
4106
4172
|
"invalid length/literal",
|
|
@@ -4115,121 +4181,121 @@ var nn = /*#__PURE__*/ $t(en, 9, 1), rn = /*#__PURE__*/ $t(tn, 5, 1), an = funct
|
|
|
4115
4181
|
"filename too long",
|
|
4116
4182
|
"stream finishing",
|
|
4117
4183
|
"invalid zip data"
|
|
4118
|
-
],
|
|
4119
|
-
var r = Error(t ||
|
|
4120
|
-
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r,
|
|
4184
|
+
], bn = function(e, t, n) {
|
|
4185
|
+
var r = Error(t || yn[e]);
|
|
4186
|
+
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, bn), !n) throw r;
|
|
4121
4187
|
return r;
|
|
4122
|
-
},
|
|
4188
|
+
}, xn = function(e, t, n, r) {
|
|
4123
4189
|
var i = e.length, a = r ? r.length : 0;
|
|
4124
|
-
if (!i || t.f && !t.l) return n || new
|
|
4190
|
+
if (!i || t.f && !t.l) return n || new Jt(0);
|
|
4125
4191
|
var o = !n, s = o || t.i != 2, c = t.i;
|
|
4126
|
-
o && (n = new
|
|
4192
|
+
o && (n = new Jt(i * 3));
|
|
4127
4193
|
var l = function(e) {
|
|
4128
4194
|
var t = n.length;
|
|
4129
4195
|
if (e > t) {
|
|
4130
|
-
var r = new
|
|
4196
|
+
var r = new Jt(Math.max(t * 2, e));
|
|
4131
4197
|
r.set(n), n = r;
|
|
4132
4198
|
}
|
|
4133
4199
|
}, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
|
|
4134
4200
|
do {
|
|
4135
4201
|
if (!p) {
|
|
4136
|
-
u =
|
|
4137
|
-
var v =
|
|
4202
|
+
u = hn(e, d, 1);
|
|
4203
|
+
var v = hn(e, d + 1, 3);
|
|
4138
4204
|
if (d += 3, !v) {
|
|
4139
|
-
var y =
|
|
4205
|
+
var y = _n(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
|
|
4140
4206
|
if (x > i) {
|
|
4141
|
-
c &&
|
|
4207
|
+
c && bn(0);
|
|
4142
4208
|
break;
|
|
4143
4209
|
}
|
|
4144
4210
|
s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
|
|
4145
4211
|
continue;
|
|
4146
4212
|
}
|
|
4147
|
-
if (v == 1) p =
|
|
4213
|
+
if (v == 1) p = fn, m = pn, h = 9, g = 5;
|
|
4148
4214
|
else if (v == 2) {
|
|
4149
|
-
var S =
|
|
4215
|
+
var S = hn(e, d, 31) + 257, C = hn(e, d + 10, 15) + 4, w = S + hn(e, d + 5, 31) + 1;
|
|
4150
4216
|
d += 14;
|
|
4151
|
-
for (var T = new
|
|
4217
|
+
for (var T = new Jt(w), E = new Jt(19), D = 0; D < C; ++D) E[$t[D]] = hn(e, d + D * 3, 7);
|
|
4152
4218
|
d += C * 3;
|
|
4153
|
-
for (var O =
|
|
4154
|
-
var j = A[
|
|
4219
|
+
for (var O = mn(E), k = (1 << O) - 1, A = ln(E, O, 1), D = 0; D < w;) {
|
|
4220
|
+
var j = A[hn(e, d, k)];
|
|
4155
4221
|
d += j & 15;
|
|
4156
4222
|
var y = j >> 4;
|
|
4157
4223
|
if (y < 16) T[D++] = y;
|
|
4158
4224
|
else {
|
|
4159
4225
|
var M = 0, N = 0;
|
|
4160
|
-
for (y == 16 ? (N = 3 +
|
|
4226
|
+
for (y == 16 ? (N = 3 + hn(e, d, 3), d += 2, M = T[D - 1]) : y == 17 ? (N = 3 + hn(e, d, 7), d += 3) : y == 18 && (N = 11 + hn(e, d, 127), d += 7); N--;) T[D++] = M;
|
|
4161
4227
|
}
|
|
4162
4228
|
}
|
|
4163
4229
|
var P = T.subarray(0, S), F = T.subarray(S);
|
|
4164
|
-
h =
|
|
4165
|
-
} else
|
|
4230
|
+
h = mn(P), g = mn(F), p = ln(P, h, 1), m = ln(F, g, 1);
|
|
4231
|
+
} else bn(1);
|
|
4166
4232
|
if (d > _) {
|
|
4167
|
-
c &&
|
|
4233
|
+
c && bn(0);
|
|
4168
4234
|
break;
|
|
4169
4235
|
}
|
|
4170
4236
|
}
|
|
4171
4237
|
s && l(f + 131072);
|
|
4172
|
-
for (var I = (1 << h) - 1,
|
|
4173
|
-
var M = p[
|
|
4238
|
+
for (var I = (1 << h) - 1, L = (1 << g) - 1, R = d;; R = d) {
|
|
4239
|
+
var M = p[gn(e, d) & I], z = M >> 4;
|
|
4174
4240
|
if (d += M & 15, d > _) {
|
|
4175
|
-
c &&
|
|
4241
|
+
c && bn(0);
|
|
4176
4242
|
break;
|
|
4177
4243
|
}
|
|
4178
|
-
if (M ||
|
|
4179
|
-
else if (
|
|
4180
|
-
|
|
4244
|
+
if (M || bn(2), z < 256) n[f++] = z;
|
|
4245
|
+
else if (z == 256) {
|
|
4246
|
+
R = d, p = null;
|
|
4181
4247
|
break;
|
|
4182
4248
|
} else {
|
|
4183
|
-
var
|
|
4184
|
-
if (
|
|
4185
|
-
var D =
|
|
4186
|
-
|
|
4249
|
+
var B = z - 254;
|
|
4250
|
+
if (z > 264) {
|
|
4251
|
+
var D = z - 257, V = Zt[D];
|
|
4252
|
+
B = hn(e, d, (1 << V) - 1) + nn[D], d += V;
|
|
4187
4253
|
}
|
|
4188
|
-
var
|
|
4189
|
-
|
|
4190
|
-
var F =
|
|
4254
|
+
var ee = m[gn(e, d) & L], H = ee >> 4;
|
|
4255
|
+
ee || bn(3), d += ee & 15;
|
|
4256
|
+
var F = on[H];
|
|
4191
4257
|
if (H > 3) {
|
|
4192
|
-
var
|
|
4193
|
-
F +=
|
|
4258
|
+
var V = Qt[H];
|
|
4259
|
+
F += gn(e, d) & (1 << V) - 1, d += V;
|
|
4194
4260
|
}
|
|
4195
4261
|
if (d > _) {
|
|
4196
|
-
c &&
|
|
4262
|
+
c && bn(0);
|
|
4197
4263
|
break;
|
|
4198
4264
|
}
|
|
4199
4265
|
s && l(f + 131072);
|
|
4200
|
-
var U = f +
|
|
4266
|
+
var U = f + B;
|
|
4201
4267
|
if (f < F) {
|
|
4202
4268
|
var te = a - F, ne = Math.min(F, U);
|
|
4203
|
-
for (te + f < 0 &&
|
|
4269
|
+
for (te + f < 0 && bn(3); f < ne; ++f) n[f] = r[te + f];
|
|
4204
4270
|
}
|
|
4205
4271
|
for (; f < U; ++f) n[f] = n[f - F];
|
|
4206
4272
|
}
|
|
4207
4273
|
}
|
|
4208
|
-
t.l = p, t.p =
|
|
4274
|
+
t.l = p, t.p = R, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
|
|
4209
4275
|
} while (!u);
|
|
4210
|
-
return f != n.length && o ?
|
|
4211
|
-
},
|
|
4212
|
-
(e[0] != 31 || e[1] != 139 || e[2] != 8) &&
|
|
4276
|
+
return f != n.length && o ? vn(n, 0, f) : n.subarray(0, f);
|
|
4277
|
+
}, Sn = /*#__PURE__*/ new Jt(0), Cn = function(e) {
|
|
4278
|
+
(e[0] != 31 || e[1] != 139 || e[2] != 8) && bn(6, "invalid gzip data");
|
|
4213
4279
|
var t = e[3], n = 10;
|
|
4214
4280
|
t & 4 && (n += (e[10] | e[11] << 8) + 2);
|
|
4215
4281
|
for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
|
|
4216
4282
|
return n + (t & 2);
|
|
4217
|
-
},
|
|
4283
|
+
}, wn = function(e) {
|
|
4218
4284
|
var t = e.length;
|
|
4219
4285
|
return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
|
|
4220
4286
|
};
|
|
4221
|
-
function
|
|
4222
|
-
var n =
|
|
4223
|
-
return n + 8 > e.length &&
|
|
4287
|
+
function Tn(e, t) {
|
|
4288
|
+
var n = Cn(e);
|
|
4289
|
+
return n + 8 > e.length && bn(6, "invalid gzip data"), xn(e.subarray(n, -8), { i: 2 }, t && t.out || new Jt(wn(e)), t && t.dictionary);
|
|
4224
4290
|
}
|
|
4225
|
-
var
|
|
4291
|
+
var En = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
|
|
4226
4292
|
try {
|
|
4227
|
-
|
|
4293
|
+
En.decode(Sn, { stream: !0 });
|
|
4228
4294
|
} catch {}
|
|
4229
4295
|
//#endregion
|
|
4230
4296
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
|
|
4231
|
-
var
|
|
4232
|
-
function
|
|
4297
|
+
var Dn = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
|
|
4298
|
+
function On(e) {
|
|
4233
4299
|
let t = e.length;
|
|
4234
4300
|
for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
|
|
4235
4301
|
e[n + 3],
|
|
@@ -4238,15 +4304,15 @@ function yn(e) {
|
|
|
4238
4304
|
e[n]
|
|
4239
4305
|
];
|
|
4240
4306
|
}
|
|
4241
|
-
function
|
|
4242
|
-
var
|
|
4307
|
+
function kn(e) {}
|
|
4308
|
+
var An = Dn ? On : kn, jn = new TextDecoder(), Mn = class e {
|
|
4243
4309
|
constructor(e) {
|
|
4244
4310
|
if (e instanceof Uint8Array) {
|
|
4245
4311
|
let t = 0, n = new DataView(e.buffer);
|
|
4246
4312
|
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.");
|
|
4247
4313
|
if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
|
|
4248
4314
|
let r = e.subarray(16 + t);
|
|
4249
|
-
this.values = r.length ? JSON.parse(
|
|
4315
|
+
this.values = r.length ? JSON.parse(jn.decode(Tn(r))) : [], e = Tn(e.subarray(16, 16 + t)), An(e), this.data = new Int32Array(e.buffer);
|
|
4250
4316
|
} else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
|
|
4251
4317
|
}
|
|
4252
4318
|
static fromBase64(t) {
|
|
@@ -4259,10 +4325,10 @@ var xn = vn ? yn : bn, Sn = new TextDecoder(), Cn = class e {
|
|
|
4259
4325
|
let n = (this.data[e >> 5] << 2) + (e & 31);
|
|
4260
4326
|
t = this.data[n];
|
|
4261
4327
|
} else if (e <= 65535) {
|
|
4262
|
-
let n = (this.data[
|
|
4328
|
+
let n = (this.data[Kt + (e - 55296 >> 5)] << 2) + (e & 31);
|
|
4263
4329
|
t = this.data[n];
|
|
4264
4330
|
} else if (e < this.highStart) {
|
|
4265
|
-
let n = this.data[
|
|
4331
|
+
let n = this.data[qt - 32 + (e >> 11)];
|
|
4266
4332
|
n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
|
|
4267
4333
|
} else t = this.data[this.data.length - 4];
|
|
4268
4334
|
return t;
|
|
@@ -4271,26 +4337,26 @@ var xn = vn ? yn : bn, Sn = new TextDecoder(), Cn = class e {
|
|
|
4271
4337
|
let t = this.get(e);
|
|
4272
4338
|
return this.values[t] ?? t;
|
|
4273
4339
|
}
|
|
4274
|
-
},
|
|
4275
|
-
function
|
|
4340
|
+
}, Nn = Mn.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48FEw3NTwDTp/BxwAZgJLgaXgCvAAnADuA3cDe4Hj0rPLQerwLPgJfAaeBe8Az4EnT/Ram0D\n eoBdwe5gENgX0DsOhHkQGAlGgTHgaHACGA8mgilgGpgBLgJzweVgPlgIbgF3iPOl4BGwAqwG\n a8Er4C2wDnwEumzRanUDPUFv0B8MBgeAL4BDwNfAN8C3wIngO+A0cCZowd/nwrwA/Eic/wzm\n L8EMHM+HuRDcDP4g7t8Hk3hYmI8BCv+TwvwLTOZvglfBawKyQ7wrjv8Ns1OXVqsroPNuwuwJ\n szfoL86JwTgeIp3HYJj0vhE4Hg3GgnHgZMDhnYDjyWCqZP9CHM8Gc8S1y2BeBa4FvweLxPN3\n wVwq7Dwirp0KVuB4NVgLXgSvg/fA+6C1Jf6gO+gF+oI9wQa3YQ4FwwDlwREwR4Mj+L6GY3Dv\n eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9cA64Dt4I7wT3gQfA4eAI8DdaKd7wizLdgvg86dUWa\n g+1BL0D3+sIcAAaLc5X9xfUDYR4EDlUYJR2PAUeCY8FJ4DRwJjgXTAezwBwwD1wDrgO3gjuF\n G/fAfBA8Js5XwnwaPF/htypeFfbfhvm+w7OdtkL6Axe3thP2uSzuhPM+YICA6tZ9YA4FwwGV\n 55F0XTBGOlY5GhwHxoOJYAqYBn4AfiyOLwVXgvnSc9dKxzeC28XxEoNbbdq0iQvXEe24aNOm\n TZs2bdq0aePC0ob55yFhPg5IHlI3Rl4Je8+I/vALMN+T7v3DMN5+B/c+BJ23hhwQ0LUeMM+G\n OQrshuM9AMkJ94b5WfBF8GVwKPg6+CYgOc7xME8BLFsiJuH8LPA9MFO8/yJhMnNxfjm4AlwJ\n rgK/AleD+e177Xvte+177XvR7/0O3ARuBSQzLcmd8ENJSoe/TZsmE9qfvR9l7FHwhNL3c+Ep\n zbPP4trz4FXwT/AB2Gyb/7WzJc67g16gLxgIBgOasxkCcxgoXf/c2+1jDu7ean0fLDbwDvjc\n 9pi7Aj8H8r1V4vxlmLvtgLlCMBesBNvs+PG9g2GeBxaB5aB7j1brOczh9UN8nAiuBs8BGg8c\n BqgP/xOqI2n+VvAQzile53T6L6NwLts5G+eLwSpxfT3M4dtiTg0sAevB8O1wDuT35GZJA9yX\n 461NmzZtNiXWow6cTrpKaCNGU3uhtPNjcW0cOEFq28fjeAI4HUwWz8iQbIvsrYM5VTw3HSbp\n Fs2EebG4dpnGPYL0hM4n3SfcXyDsLhTmzTBvA3eI86VKn6MK0lshfao/kt9x/pjk7ydFW7lG\n vIt0rl4W99+EuQ58BEh3jP3bBW1oVxHObjjeCfQB7B7bG8DXYJ5OelYwvwS+Ath9fuY0KT4O\n E88dKcxjYJIs8NswT5WeVSG/k/0zYOcccL54nuLvh+QHmD8V5jJA8fILnP8Lz10N87eAdMRu\n grlY9Bfo/AGYfwYrxPl9eOdqHK8l/+D47zDfFv76AOZmyFeTcLwVzB1AL9AXDAT7gSFgGBgB\n yH87ks4ZjseK86+CcdQ+a8JI90/GvQniPtufjPOp4vkLYc4Gc8Hl4NfgesP7Fin3OE3uwvVl\n 4BGwQrKzGsd/BS+C18Hb4APhdif0J7sC1unbHsf83C7SMd3vh/O9yC4YCoaBQ8Aoyd4YHB8J\n jgUngVMBlQ8qG2dI9nScg/sXgJngYsnupTi+EvxG+DMnXI7UuCZuNPjn9pqwboxQOeXwc50Q\n gyUinh8wxPfDFfeW4/qqAvmmaVDb6PvsGiX+XvLM2/1Qb76xEZeLGOlEdTC1i+tEnNMx1Z8f\n ivPOGJtvDXYEJNfw9eeueL4uHLvDziBA/Rb5+gG4Rvq0n5feQTKJXHp8rlBfaiT8R7KcKnnV\n 4Yb42BQ4wjL9joG9E8Apjul9uBL3TS+/kxC+74LzGpAvTHl7BvznUyYuwnM05iGoLM/F+Tzl\n XdyHqStbZM4S5/PxjoXgJvEuWqvAdkmuKIeL6hV5TET9e6r/qsJPazHIvBfveQgsF248BXMF\n 1YcOcXGERXv4AslIPeNXhuL3TVFnroO5HmwB2WtT8j21Mdsa/NMT93qDDevFkJ79Fbsb1s7g\n 2hDLMFE/cZh434iAeKD3jDY8T/fHGu5TuMfVuH+y8KeOCeJZPp+cIU1JD4fcmiq5NVvIIaqe\n oXJyIezPBpeAK8AC8Xxvi/5YXd1+A951C6C1R4uFeTdMurdMmC78Cc+sBM+ANdLzNF/xBlgH\n PpKud8G8xXagB9gZ9AF0fQ+Yg8QxcQCOh4rz4TBHimM5TQ/HNT5egHDQfdZFOkrcI/nEcTge\n Dyh+JsKcIt41TZgzYM5S3j9H8gsxD+dXSe4x10rXrleeyc2iwu6XhsJ/F8WBqMeJ/ysfBpaJ\n PNKReXzzThvYDKd1YFn0hscg/tsALZ21ec4GsTS0hWLZou4kDX9oaELHdI1EeiT24ntUtVGX\n g0yq7igpbCD7BL2HIXfl89RQWCgMHJ7ckPuUlpj63XBO8Y9pyE2aTf2nK5NQC4hWvuvoKfIl\n lXkqGwzlz50EfMx1BOVhztP8HNvdWXlWhp6Xz8ndlOWN/V6K0u43Dc4fch7gc9s4U/OU/Azn\n vZLkKrdNheqTKnzeVxff/FOvc19D/dW9SzZjkuKdMfPmxlrn5Ix3mzzWBKhs9NL4l9rxqj5J\n 06HwcD6W8zQf01iDzLrfLhmpc1vNVza/qvGXnP7UZ2PUcZlLnHOcksk0KZ+nyGe2412KW13c\n p65rOQ3qwmCyo8afzi7bsY2PmPV4yfYqZl7qKO1F6nhyreNs6rvY+S9XnOjaai7TssxAHqfn\n 8GuV/9XrVfZi5PVcZaXK367u636hfuP8bCtL8u3np+6vURhK9BObUPZjxm+scZ0810DkrFfV\n 8uY6zgotWy5ygSq35DJYlyZqedWVX5s2UTeeqQqT6pZr+vJ4QRc/fF1uj6rCZYprU1hypG/d\n sRznpnS1Sd+6dKzLa3X5wzZ9dfWEa5/Mtfzq0qRE+vqWX10eqErfkL6tOubxLb8s1zG54RLO\n nPWzb/3pkl9z1J8ufcQqP9fl9ao6w9Re6cKsS7u6a3Xto2s81NWvpjxqW/5s5IEpxpncTtr2\n 4XPWpbHGWa79Idv0NMWZKR5i1aemn+38oxwum2dKpm+M9jJm+pr6RrHSV9eH9dXnyN0XijEO\n i5GedX16VzluqvZXHr9UpY1P/9a1zSs176m2kbb+NY13qvKLjYwqtP1V/eLT//5kQ1B/1G8I\n eZ/LfA3LgUzxw8dVcZYiLuvcjB33IX7wybe6NKM+gox8jfRq+JjSi87l+ViGrut0buvaqdhy\n QPKj3MawSbqApBfLZoi81kcuXqV3XXc9VHbeBH0L+nF5N7W/Nm2NnBer+rasD9bEute1flTD\n lst9Ux1vK8PWjZFD+x27Fma3wvQujG/fMFQ/0iX/hD7f9PClnr9OHX8+Mh65PTS1Iyn9UULX\n M/b8vq9uKf9ID7KkjkvOtOe+om/8cxvu6meXubpY+jcuc0Wx3TeNBVOH33e+LKQ+rZM55pQd\n cNz3kc4578rygFhy7Fj1H4872f88FpD1hNV1Iy76tbnr35Dyn1v3yCT3KhEnJdpnG1mui46u\n ryzBNNaiH5eH0HFfbPlWqvouVX0ZKjdW65S68XQqfWC1nJSUO8eoj0OfjxGGUjI1V/erZGIh\n P507n8qIa7z1tXinLK/sZwnb/7TS7+drNtj43+Y9sttN00121aMOnR+wTb/UuIZ/d4FrfydV\n PSOXCRmf+jfl/E9KuUMpuVPMfnKMdQIucze69X6m8YPvngAl9yOwqWNt5Wsu+hSp9xRoytr0\n UN3tunhPHQ91brDsoqqOZSivyed7iDzXX8p/JJ8le2QSA4C8lwntkcP7bvGxfC7bJfaUIDd5\n j7CqsiCv/dYh+4HcIbkTYdpLgOWwbNdk31R/k/tqnKpy2oGB43o1H9js0cPhk/ebUfegsZVT\n h8pW5D2aVNQ9nFzQPStf4+MQN4jYfZ4Q+TDndzUNTfqAVfs7uazFtc03KfaP0u3LZYvP877u\n ++6zpf5SuOfiJ9+w6PylXtPdZ1Pdx80UZ1VxoYahLl/Y7tflUxbqwhyr7OjioCpuTOexymmM\n 99vGWe5960LdoT5PrDlkNn39yrIdFzdTxKkqa0o9n5NyfjbFL6T9i03O9jTEjVT9CZt61qWe\n DAmTbX1rkw4ubWysflyu/Uh19Utdv8QUb/wevs/vlN3YK0J95hvGWP26FP0CXV0ix6XOfmi8\n lNw7tlSc284PqXnZlKf5umpfVx7Ue3K5q4onnT9079H5h8ubyX5VGZHfIVOiPynLz2RkPSTV\n /2p/0NZM2Ufw7dPm3tveJp46kn5prDC7miXDUCoOc7QdKeU9KeZZbNZTsw6ZKjPna6G6jLZ6\n v6Y9S0rqHMbaN8j3flUbVIdpnonTleaP+JsiapunntfVOer7WUdXNw+jCyvNYxE6P9Ix+7Mu\n TCa3uM3mb9JUmfLe1q59N19yulXnD5dfU/yRyn/8vR2Cr9H8JB/btsm29undfCw/56tbVmVX\n d53nXtV0+Iw4rjNTk8udOvdtwl13j1B1YuT5b04HMpsW/7HCr8t/dF0Of846J3W9HPtdNnUf\n x7UvpdsiV1mJjawiFLWODEm73G1mLF1J2/GB7X7UtvqhJeeTfPc4T7mPtLpuWqWJ66malIZV\n Oq6uerCp9Oh1dlzCzrpIudKf92/hsZbP+hIbHa0Q/fQYe/v4lmd5T5s6veq6vYViyzJT69KV\n 2t/FlN451zKFrm3i9U0264J0fQOX9U5Vfe6S+xPRL8VaHJe8rK69qpNJqe92jX81XX3X2fr8\n XPaHsq1PdPWWa12Sag1GaXmwT98pZ/2vy8+h7e8gsHdGcrvn+ou5l5j6K7GfmPobXJiY4xLb\n d9C3GKnM2H7Xkd7j+z1I03X5ftWxjd9KwDLy0mNPV/fUtSCh4wyeF5DXS8nzWnSd9Jqrfrye\n UWfa3NP1O131E9TnTDItvs/rn9Qwm9y3lS/yuiSdDK2J32LmH61l4/l7DpMcFl0cy/HpKvNU\n 5Z6yuzmgsPj4PZX78jydfMzx1BFk7Gr61smlU9yXf7w+UL7Pa5Fc9pe3lTntI+YJYvTvQ9Y9\n x9gbNOU66lxyYJPsuqPtBRpjvW7uX6n9Y3LpfMUe8+fYy6sJ+99x2QyVR1TJrEvlz9Lxmzq8\n Kct+jO8mpnIrV35pYv3rso+6j2w1RzkxpWeOslpV38Xey7lJ7XVVnDdFVyDn2o2m7A1s871r\n U3+hbp661LfjbL6l6vL9O5v5uiqdcd/9mG3sVrlrktHl3m+5Ln46Qply/f51rDq2afV3U92P\n 9Z2CVPu71+kExf4uhm265Mpfcrjl9S+p/WGjb9FEeYmrHlhsXTLb772b2v3U8bKvoAk6VaQ3\n ZdqvWf2FytNd9g1W/c57VNf9+JuMuXT+ZJ1tnZ6T7U+un1PXpSm/BxKiZ+b6nUC5P+bybdoU\n 3wWR9zP1WcOrrtc06dG7rA9gf6lzCCVlQKl1cKvW16r7MjdxPqHue3m55l5M6yRy1q8p6i+d\n GzbfR5Dtqeeu1D2rulVlp+67ulXfzlDPqS/AP52us+kb5aoetdp226wrqOtHuvxc9InlsMrX\n 5HCkgvtULt80VtPB5tvHlLbU51R1leQ+nW0ftknjClM7Ktf7Pt9n161FKfULHbeU/P5brO/5\n 8PeveZ2l+s31OpmmizxP5z/VrssvNP7Vb9XbUGr+LWSdWKr4c/lemct7U/1KfJcs5nfiXNcz\n Va3lCf2OXi75c+gaSd/4SyH/pmds+8G2fWCbvmwMeZapf6v2g9hU16vF7l/65K8cc6uh7bIs\n W8jdLyyxp4BPPOru6+Qx8rd8beIyhew8xjoMtU8l90dcyldseUOJPpPLevpc7ZnvL8f4oaRO\n ad34WVeefPYVSdG+27T7vPdESj0VV5leyvXoufQvffKZTpZmGy+27UNKfYCc5dWmj2fbp44Z\n P6G/WN9X1cl8beoieS7ad7+PGP14nz1ATO1q3Xx2jHnpWO1xR1uPovumYQndrFD9uyrdvpD4\n b9L8Yaz9wxl5bbVu/XlT9j2X/Rr6Hl7brYPd0V1jM5bOk+84oUn7xpeeH7IhVJ7j25+IrU9s\n ig+XOi7lGMtGj9pGB903/kuMQVPuORpjv7+c35AvvYYkNO1CviFvU4/HkF+qe2ZTG+VTn1bt\n fV7y5/PtqNR76oeuy4zlH3n/9ND3qPuxu7xb3cuj7heahiXq4ljrC1R5vm5M39HGFz7yzRLr\n k1PoMMfcPzeGvDPWPssxw6Rzo8QcXmp3XGSSHX2/Et08k67f5dtmuupKN2FvMpOsKObeDnVx\n k3ofp1h6VrFIVVdV7T2fYm9013l7k/5rbNlKaBuXso7LLV+K1d67uuWiJ19ShhcjvUP97FsO\n Q+V7pdfDpy5rtv2qEPkU7XFY0v3Q+Oc8FpqHdHV9Xf415XFbPTPfPk7qNWsufow9vkqlz6v+\n eA4udH9l3XxtiA5ZyN5XpvxSNzdetRdQlWnKjzbP695Xt9+WTz/bJk5y6tDVlYHUe0Crv9Bv\n vMf+bnzq79DHenfs/ZD3y4TO7b0S7vPM8Z5yL2mTG1XXKcyMLh5093OzvwbVfzr/1hHDby7u\n ufhH5z/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"), Pn = Object.fromEntries(Nn.values.map((e, t) => [e, t])), { values: Fn } = Nn, { AI: In, AL: Ln, CJ: Rn, CM: zn, NS: Bn, SA: Vn, SG: Hn, SP: Un, XX: Wn } = Pn;
|
|
4341
|
+
function Gn(e) {
|
|
4276
4342
|
switch (e) {
|
|
4277
4343
|
case null: return null;
|
|
4278
4344
|
case -1: return "sot";
|
|
4279
4345
|
case -2: return "eot";
|
|
4280
|
-
default: return
|
|
4346
|
+
default: return Fn[e];
|
|
4281
4347
|
}
|
|
4282
4348
|
}
|
|
4283
|
-
function
|
|
4349
|
+
function Kn(e, t) {
|
|
4284
4350
|
switch (e) {
|
|
4285
|
-
case
|
|
4286
|
-
case
|
|
4287
|
-
case
|
|
4288
|
-
case
|
|
4289
|
-
case
|
|
4351
|
+
case In:
|
|
4352
|
+
case Hn:
|
|
4353
|
+
case Wn: return Ln;
|
|
4354
|
+
case Vn: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? zn : Ln;
|
|
4355
|
+
case Rn: return Bn;
|
|
4290
4356
|
}
|
|
4291
4357
|
return e;
|
|
4292
4358
|
}
|
|
4293
|
-
var
|
|
4359
|
+
var qn = class {
|
|
4294
4360
|
cp = -Infinity;
|
|
4295
4361
|
cls = -1;
|
|
4296
4362
|
char = "";
|
|
@@ -4300,15 +4366,15 @@ var Rn = class {
|
|
|
4300
4366
|
this.cls = e, this.cp = t, this.char = n, this.len = r;
|
|
4301
4367
|
}
|
|
4302
4368
|
[Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
|
|
4303
|
-
return `${
|
|
4369
|
+
return `${Gn(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
|
|
4304
4370
|
}
|
|
4305
|
-
},
|
|
4371
|
+
}, Jn = class {
|
|
4306
4372
|
str = "";
|
|
4307
4373
|
len = 0;
|
|
4308
4374
|
prevChunk = 0;
|
|
4309
|
-
prev = new
|
|
4310
|
-
cur = new
|
|
4311
|
-
next = new
|
|
4375
|
+
prev = new qn(-1, -Infinity, "", 0);
|
|
4376
|
+
cur = new qn(-1, -Infinity, "", 0);
|
|
4377
|
+
next = new qn(-1, -Infinity, "", 0);
|
|
4312
4378
|
LB8 = !1;
|
|
4313
4379
|
spaces = !1;
|
|
4314
4380
|
RI = 0;
|
|
@@ -4321,13 +4387,13 @@ var Rn = class {
|
|
|
4321
4387
|
this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
|
|
4322
4388
|
}
|
|
4323
4389
|
pushEnd() {
|
|
4324
|
-
this.push(new
|
|
4390
|
+
this.push(new qn(-2, Infinity, "", this.next.len));
|
|
4325
4391
|
}
|
|
4326
4392
|
*codePoints(e, t = !0) {
|
|
4327
4393
|
if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
|
|
4328
4394
|
else {
|
|
4329
|
-
let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r =
|
|
4330
|
-
e += n.length, yield new
|
|
4395
|
+
let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = Nn.get(t);
|
|
4396
|
+
e += n.length, yield new qn(Kn(r, n), t, n, e);
|
|
4331
4397
|
}
|
|
4332
4398
|
else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
|
|
4333
4399
|
else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
|
|
@@ -4335,11 +4401,11 @@ var Rn = class {
|
|
|
4335
4401
|
let t = e - 1, n = this.str.charCodeAt(t);
|
|
4336
4402
|
n >= 56320 && n <= 57343 && t--;
|
|
4337
4403
|
let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
|
|
4338
|
-
yield new
|
|
4404
|
+
yield new qn(Kn(Nn.get(r), i), r, i, e), e = t;
|
|
4339
4405
|
}
|
|
4340
4406
|
}
|
|
4341
4407
|
classAfterSpaces(e) {
|
|
4342
|
-
for (let { cls: t } of this.codePoints(e)) if (t !==
|
|
4408
|
+
for (let { cls: t } of this.codePoints(e)) if (t !== Un) return t;
|
|
4343
4409
|
return -2;
|
|
4344
4410
|
}
|
|
4345
4411
|
afterNext(e = 1) {
|
|
@@ -4353,335 +4419,326 @@ var Rn = class {
|
|
|
4353
4419
|
let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
|
|
4354
4420
|
return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
|
|
4355
4421
|
}
|
|
4356
|
-
},
|
|
4422
|
+
}, Yn = class {
|
|
4357
4423
|
string = void 0;
|
|
4358
4424
|
props = void 0;
|
|
4359
4425
|
constructor(e, t = !1) {
|
|
4360
4426
|
this.position = e, this.required = t;
|
|
4361
4427
|
}
|
|
4362
|
-
},
|
|
4363
|
-
Object.fromEntries(
|
|
4364
|
-
var { values:
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
]),
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4428
|
+
}, Xn = Mn.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
|
|
4429
|
+
Object.fromEntries(Xn.values.map((e, t) => [e, t]));
|
|
4430
|
+
var { values: Zn } = Xn, { AK: Qn, AL: $n, AP: er, AS: tr, B2: nr, BA: rr, BB: ar, BK: or, CB: sr, CL: cr, CM: lr, CP: ur, CR: dr, EB: fr, EM: pr, EX: mr, GL: hr, H2: gr, H3: _r, HH: vr, HL: yr, HY: br, ID: xr, IN: Sr, IS: Cr, JL: wr, JT: Tr, JV: Er, LF: Dr, NU: Or, OP: kr, NL: Ar, NS: jr, PO: Mr, PR: Nr, RI: Pr, SP: Y, SY: Fr, QU: Ir, VF: Lr, VI: Rr, WJ: zr, ZW: Br, ZWJ: Vr } = Pn, Hr = /* @__PURE__ */ new Set([
|
|
4431
|
+
$n,
|
|
4432
|
+
yr,
|
|
4433
|
+
Or
|
|
4434
|
+
]), Ur = /* @__PURE__ */ new Set([
|
|
4435
|
+
or,
|
|
4436
|
+
dr,
|
|
4437
|
+
Dr,
|
|
4438
|
+
Ar,
|
|
4373
4439
|
Y,
|
|
4374
|
-
|
|
4375
|
-
]),
|
|
4440
|
+
Br
|
|
4441
|
+
]), Wr = /* @__PURE__ */ new Set([
|
|
4442
|
+
xr,
|
|
4376
4443
|
fr,
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
_r,
|
|
4382
|
-
sr,
|
|
4383
|
-
cr
|
|
4384
|
-
]), Lr = /* @__PURE__ */ new Set([
|
|
4385
|
-
hr,
|
|
4386
|
-
_r,
|
|
4444
|
+
pr
|
|
4445
|
+
]), Gr = /* @__PURE__ */ new Set([
|
|
4446
|
+
wr,
|
|
4447
|
+
Er,
|
|
4387
4448
|
gr,
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4449
|
+
_r
|
|
4450
|
+
]), Kr = /* @__PURE__ */ new Set([
|
|
4451
|
+
wr,
|
|
4452
|
+
Er,
|
|
4453
|
+
Tr,
|
|
4454
|
+
gr,
|
|
4455
|
+
_r
|
|
4456
|
+
]), qr = /* @__PURE__ */ new Set([Er, Tr]), Jr = /* @__PURE__ */ new Set([
|
|
4391
4457
|
Y,
|
|
4458
|
+
hr,
|
|
4459
|
+
zr,
|
|
4460
|
+
cr,
|
|
4461
|
+
Ir,
|
|
4462
|
+
ur,
|
|
4463
|
+
mr,
|
|
4464
|
+
Cr,
|
|
4465
|
+
Fr,
|
|
4392
4466
|
or,
|
|
4393
|
-
|
|
4394
|
-
Qn,
|
|
4467
|
+
dr,
|
|
4395
4468
|
Dr,
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
Er,
|
|
4400
|
-
Xn,
|
|
4401
|
-
tr,
|
|
4402
|
-
vr,
|
|
4403
|
-
xr,
|
|
4404
|
-
jr
|
|
4405
|
-
]), Br = /* @__PURE__ */ new Set([
|
|
4469
|
+
Ar,
|
|
4470
|
+
Br
|
|
4471
|
+
]), Yr = /* @__PURE__ */ new Set([
|
|
4406
4472
|
-1,
|
|
4407
|
-
Xn,
|
|
4408
|
-
tr,
|
|
4409
|
-
vr,
|
|
4410
|
-
xr,
|
|
4411
|
-
br,
|
|
4412
|
-
Dr,
|
|
4413
4473
|
or,
|
|
4474
|
+
dr,
|
|
4475
|
+
Dr,
|
|
4476
|
+
Ar,
|
|
4477
|
+
kr,
|
|
4478
|
+
Ir,
|
|
4479
|
+
hr,
|
|
4414
4480
|
Y,
|
|
4415
|
-
|
|
4416
|
-
]), X = Symbol("PASS"), Z = Symbol("NO_BREAK"),
|
|
4417
|
-
function
|
|
4481
|
+
Br
|
|
4482
|
+
]), X = Symbol("PASS"), Z = Symbol("NO_BREAK"), Xr = Symbol("MAY_BREAK"), Zr = Symbol("MUST_BREAK");
|
|
4483
|
+
function Qr(e) {
|
|
4418
4484
|
return e.cur.cls === -1 && e.next.cls !== -2 ? Z : X;
|
|
4419
4485
|
}
|
|
4420
|
-
function
|
|
4421
|
-
return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ?
|
|
4486
|
+
function $r(e) {
|
|
4487
|
+
return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? Zr : X;
|
|
4422
4488
|
}
|
|
4423
|
-
function
|
|
4424
|
-
return e.cur.cls ===
|
|
4489
|
+
function ei(e) {
|
|
4490
|
+
return e.cur.cls === or ? Zr : X;
|
|
4425
4491
|
}
|
|
4426
|
-
function
|
|
4492
|
+
function ti(e) {
|
|
4427
4493
|
switch (e.cur.cls) {
|
|
4428
|
-
case
|
|
4429
|
-
case
|
|
4430
|
-
case
|
|
4494
|
+
case dr: return e.next.cls === Dr ? Z : Zr;
|
|
4495
|
+
case Dr:
|
|
4496
|
+
case Ar: return Zr;
|
|
4431
4497
|
}
|
|
4432
4498
|
return X;
|
|
4433
4499
|
}
|
|
4434
|
-
function
|
|
4500
|
+
function ni(e) {
|
|
4435
4501
|
switch (e.next.cls) {
|
|
4436
|
-
case
|
|
4437
|
-
case
|
|
4438
|
-
case
|
|
4439
|
-
case
|
|
4502
|
+
case or:
|
|
4503
|
+
case dr:
|
|
4504
|
+
case Dr:
|
|
4505
|
+
case Ar: return Z;
|
|
4440
4506
|
}
|
|
4441
4507
|
return X;
|
|
4442
4508
|
}
|
|
4443
|
-
function
|
|
4444
|
-
return e.cur.cls !==
|
|
4509
|
+
function ri(e) {
|
|
4510
|
+
return e.cur.cls !== Pr && (e.RI = 0), e.spaces ? (e.next.cls !== Y && (e.spaces = !1), Z) : X;
|
|
4445
4511
|
}
|
|
4446
|
-
function
|
|
4447
|
-
if (e.next.cls ===
|
|
4512
|
+
function ii(e) {
|
|
4513
|
+
if (e.next.cls === Br) return Z;
|
|
4448
4514
|
if (e.next.cls === Y) switch (e.cur.cls) {
|
|
4449
|
-
case
|
|
4450
|
-
case
|
|
4451
|
-
case
|
|
4452
|
-
case
|
|
4453
|
-
case
|
|
4454
|
-
case
|
|
4515
|
+
case Br:
|
|
4516
|
+
case kr:
|
|
4517
|
+
case Ir:
|
|
4518
|
+
case cr:
|
|
4519
|
+
case ur:
|
|
4520
|
+
case nr: break;
|
|
4455
4521
|
default: return Z;
|
|
4456
4522
|
}
|
|
4457
4523
|
return X;
|
|
4458
4524
|
}
|
|
4459
|
-
function
|
|
4460
|
-
return e.LB8 ? (e.LB8 = !1,
|
|
4525
|
+
function ai(e) {
|
|
4526
|
+
return e.LB8 ? (e.LB8 = !1, Xr) : e.cur.cls === Br ? e.next.cls === Y ? (e.LB8 = !0, Z) : Xr : X;
|
|
4461
4527
|
}
|
|
4462
|
-
function
|
|
4463
|
-
return e.cur.cls ===
|
|
4528
|
+
function oi(e) {
|
|
4529
|
+
return e.cur.cls === Vr ? Z : X;
|
|
4464
4530
|
}
|
|
4465
|
-
function
|
|
4466
|
-
return !
|
|
4531
|
+
function si(e) {
|
|
4532
|
+
return !Ur.has(e.cur.cls) && (e.next.cls === lr || e.next.cls === Vr) ? (e.next.ignored = !0, Z) : X;
|
|
4467
4533
|
}
|
|
4468
|
-
function
|
|
4469
|
-
return e.cur.cls ===
|
|
4534
|
+
function ci(e) {
|
|
4535
|
+
return e.cur.cls === lr && (e.cur.cls = $n), e.next.cls === lr && (e.next.cls = $n), X;
|
|
4470
4536
|
}
|
|
4471
|
-
function
|
|
4472
|
-
return e.next.cls ===
|
|
4537
|
+
function li(e) {
|
|
4538
|
+
return e.next.cls === zr || e.cur.cls === zr ? Z : X;
|
|
4473
4539
|
}
|
|
4474
|
-
function
|
|
4475
|
-
return e.cur.cls ===
|
|
4540
|
+
function ui(e) {
|
|
4541
|
+
return e.cur.cls === hr ? Z : X;
|
|
4476
4542
|
}
|
|
4477
|
-
function
|
|
4478
|
-
if (e.next.cls ===
|
|
4543
|
+
function di(e) {
|
|
4544
|
+
if (e.next.cls === hr) switch (e.cur.cls) {
|
|
4479
4545
|
case Y:
|
|
4480
|
-
case
|
|
4481
|
-
case
|
|
4482
|
-
case
|
|
4546
|
+
case rr:
|
|
4547
|
+
case br:
|
|
4548
|
+
case vr: return X;
|
|
4483
4549
|
default: return Z;
|
|
4484
4550
|
}
|
|
4485
4551
|
return X;
|
|
4486
4552
|
}
|
|
4487
|
-
function
|
|
4553
|
+
function fi(e) {
|
|
4488
4554
|
switch (e.next.cls) {
|
|
4489
|
-
case
|
|
4490
|
-
case
|
|
4491
|
-
case
|
|
4492
|
-
case
|
|
4555
|
+
case cr:
|
|
4556
|
+
case ur:
|
|
4557
|
+
case mr:
|
|
4558
|
+
case Fr: return Z;
|
|
4493
4559
|
}
|
|
4494
4560
|
return X;
|
|
4495
4561
|
}
|
|
4496
|
-
function
|
|
4497
|
-
return e.cur.cls ===
|
|
4562
|
+
function pi(e) {
|
|
4563
|
+
return e.cur.cls === kr ? (e.next.cls === Y && (e.spaces = !0), Z) : X;
|
|
4498
4564
|
}
|
|
4499
|
-
function
|
|
4500
|
-
return
|
|
4565
|
+
function mi(e) {
|
|
4566
|
+
return Yr.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === Ir ? (e.spaces = !0, Z) : X;
|
|
4501
4567
|
}
|
|
4502
|
-
function
|
|
4503
|
-
if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls ===
|
|
4568
|
+
function hi(e) {
|
|
4569
|
+
if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls === Ir) {
|
|
4504
4570
|
let t = e.afterNext();
|
|
4505
|
-
if (!t ||
|
|
4571
|
+
if (!t || Jr.has(t.cls)) return Z;
|
|
4506
4572
|
}
|
|
4507
4573
|
return X;
|
|
4508
4574
|
}
|
|
4509
|
-
function
|
|
4510
|
-
return e.cur.cls === Y && e.next.cls ===
|
|
4575
|
+
function gi(e) {
|
|
4576
|
+
return e.cur.cls === Y && e.next.cls === Cr && e.afterNext()?.cls === Or ? Xr : X;
|
|
4511
4577
|
}
|
|
4512
|
-
function
|
|
4513
|
-
return e.next.cls ===
|
|
4578
|
+
function _i(e) {
|
|
4579
|
+
return e.next.cls === Cr ? Z : X;
|
|
4514
4580
|
}
|
|
4515
|
-
function
|
|
4516
|
-
if (e.cur.cls ===
|
|
4517
|
-
if (e.classAfterSpaces(e.cur.len) ===
|
|
4581
|
+
function vi(e) {
|
|
4582
|
+
if (e.cur.cls === cr || e.cur.cls === ur) {
|
|
4583
|
+
if (e.classAfterSpaces(e.cur.len) === jr) return e.next.cls === Y && (e.spaces = !0), Z;
|
|
4518
4584
|
if (e.next.cls === Y) return Z;
|
|
4519
4585
|
}
|
|
4520
4586
|
return X;
|
|
4521
4587
|
}
|
|
4522
|
-
function
|
|
4523
|
-
if (e.cur.cls ===
|
|
4524
|
-
if (e.classAfterSpaces(e.cur.len) ===
|
|
4588
|
+
function yi(e) {
|
|
4589
|
+
if (e.cur.cls === nr) {
|
|
4590
|
+
if (e.classAfterSpaces(e.cur.len) === nr) return e.next.cls === Y && (e.spaces = !0), Z;
|
|
4525
4591
|
if (e.next.cls === Y) return Z;
|
|
4526
4592
|
}
|
|
4527
4593
|
return X;
|
|
4528
4594
|
}
|
|
4529
|
-
function
|
|
4530
|
-
return e.cur.cls === Y ?
|
|
4595
|
+
function bi(e) {
|
|
4596
|
+
return e.cur.cls === Y ? Xr : X;
|
|
4531
4597
|
}
|
|
4532
|
-
function
|
|
4533
|
-
return e.next.cls ===
|
|
4598
|
+
function xi(e) {
|
|
4599
|
+
return e.next.cls === Ir && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === Ir && !/^\p{Pf}$/u.test(e.cur.char) ? Z : X;
|
|
4534
4600
|
}
|
|
4535
|
-
function
|
|
4536
|
-
if (!
|
|
4537
|
-
if (e.next.cls ===
|
|
4601
|
+
function Si(e) {
|
|
4602
|
+
if (!Xn.get(e.cur.cp) && e.next.cls === Ir) return Z;
|
|
4603
|
+
if (e.next.cls === Ir) {
|
|
4538
4604
|
let t = e.afterNext();
|
|
4539
|
-
if (!t || !
|
|
4605
|
+
if (!t || !Xn.get(t.cp)) return Z;
|
|
4540
4606
|
}
|
|
4541
|
-
return e.cur.cls ===
|
|
4607
|
+
return e.cur.cls === Ir && !Xn.get(e.next.cp) || (e.prev.cls === -1 || !Xn.get(e.prev.cp)) && e.cur.cls === Ir ? Z : X;
|
|
4542
4608
|
}
|
|
4543
|
-
function
|
|
4544
|
-
return e.cur.cls ===
|
|
4609
|
+
function Ci(e) {
|
|
4610
|
+
return e.cur.cls === sr || e.next.cls === sr ? Xr : X;
|
|
4545
4611
|
}
|
|
4546
|
-
var
|
|
4612
|
+
var wi = /* @__PURE__ */ new Set([
|
|
4547
4613
|
-1,
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4614
|
+
or,
|
|
4615
|
+
dr,
|
|
4616
|
+
Dr,
|
|
4617
|
+
Ar,
|
|
4552
4618
|
Y,
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4619
|
+
Br,
|
|
4620
|
+
sr,
|
|
4621
|
+
hr
|
|
4556
4622
|
]);
|
|
4557
|
-
function
|
|
4558
|
-
return
|
|
4623
|
+
function Ti(e) {
|
|
4624
|
+
return wi.has(e.prev.cls) && (e.cur.cls === br || e.cur.cls === vr) && (e.next.cls === $n || e.next.cls === yr) ? Z : X;
|
|
4559
4625
|
}
|
|
4560
|
-
function
|
|
4561
|
-
if (e.cur.cls ===
|
|
4626
|
+
function Ei(e) {
|
|
4627
|
+
if (e.cur.cls === ar) return Z;
|
|
4562
4628
|
switch (e.next.cls) {
|
|
4563
|
-
case
|
|
4564
|
-
case
|
|
4565
|
-
case
|
|
4566
|
-
case
|
|
4629
|
+
case rr:
|
|
4630
|
+
case vr:
|
|
4631
|
+
case br:
|
|
4632
|
+
case jr: return Z;
|
|
4567
4633
|
}
|
|
4568
4634
|
return X;
|
|
4569
4635
|
}
|
|
4570
|
-
function
|
|
4571
|
-
return e.prev.cls ===
|
|
4636
|
+
function Di(e) {
|
|
4637
|
+
return e.prev.cls === yr && (e.cur.cls === br || e.cur.cls === vr) && e.next.cls !== yr ? Z : X;
|
|
4572
4638
|
}
|
|
4573
|
-
function
|
|
4574
|
-
return e.cur.cls ===
|
|
4639
|
+
function Oi(e) {
|
|
4640
|
+
return e.cur.cls === Fr && e.next.cls === yr ? Z : X;
|
|
4575
4641
|
}
|
|
4576
|
-
function
|
|
4577
|
-
return e.next.cls ===
|
|
4642
|
+
function ki(e) {
|
|
4643
|
+
return e.next.cls === Sr ? Z : X;
|
|
4578
4644
|
}
|
|
4579
|
-
function
|
|
4645
|
+
function Ai(e) {
|
|
4580
4646
|
switch (e.cur.cls) {
|
|
4581
|
-
case
|
|
4582
|
-
case
|
|
4583
|
-
if (e.next.cls ===
|
|
4647
|
+
case $n:
|
|
4648
|
+
case yr:
|
|
4649
|
+
if (e.next.cls === Or) return Z;
|
|
4584
4650
|
break;
|
|
4585
|
-
case
|
|
4651
|
+
case Or: if (e.next.cls === $n || e.next.cls === yr) return Z;
|
|
4586
4652
|
}
|
|
4587
4653
|
return X;
|
|
4588
4654
|
}
|
|
4589
|
-
function
|
|
4590
|
-
return e.cur.cls ===
|
|
4655
|
+
function ji(e) {
|
|
4656
|
+
return e.cur.cls === Nr && Wr.has(e.next.cls) || e.next.cls === Mr && Wr.has(e.cur.cls) ? Z : X;
|
|
4591
4657
|
}
|
|
4592
|
-
function
|
|
4593
|
-
return (e.cur.cls ===
|
|
4658
|
+
function Mi(e) {
|
|
4659
|
+
return (e.cur.cls === Nr || e.cur.cls === Mr) && (e.next.cls === $n || e.next.cls === yr) || (e.cur.cls === $n || e.cur.cls === yr) && (e.next.cls === Nr || e.next.cls === Mr) ? Z : X;
|
|
4594
4660
|
}
|
|
4595
|
-
var
|
|
4596
|
-
function
|
|
4661
|
+
var Ni = /* @__PURE__ */ new Set([Mr, Nr]), Pi = /* @__PURE__ */ new Set([cr, ur]);
|
|
4662
|
+
function Fi(e) {
|
|
4597
4663
|
let t = null;
|
|
4598
|
-
if (
|
|
4599
|
-
case
|
|
4600
|
-
case
|
|
4601
|
-
case
|
|
4664
|
+
if (Ni.has(e.next.cls) ? t = Pi.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === Or && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
|
|
4665
|
+
case Fr:
|
|
4666
|
+
case Cr: continue;
|
|
4667
|
+
case Or: return Z;
|
|
4602
4668
|
default: break SyIsLoop;
|
|
4603
4669
|
}
|
|
4604
|
-
if (e.cur.cls ===
|
|
4605
|
-
if (e.next.cls ===
|
|
4670
|
+
if (e.cur.cls === Mr || e.cur.cls === Nr) {
|
|
4671
|
+
if (e.next.cls === kr) {
|
|
4606
4672
|
let t = e.afterNext();
|
|
4607
|
-
if (t && (t.cls ===
|
|
4608
|
-
} else if (e.next.cls ===
|
|
4673
|
+
if (t && (t.cls === Or || t.cls === Cr && e.afterNext(2)?.cls === Or)) return Z;
|
|
4674
|
+
} else if (e.next.cls === Or) return Z;
|
|
4609
4675
|
}
|
|
4610
|
-
return e.cur.cls ===
|
|
4676
|
+
return e.cur.cls === br && e.next.cls === Or || e.cur.cls === Cr && e.next.cls === Or ? Z : X;
|
|
4611
4677
|
}
|
|
4612
|
-
function
|
|
4678
|
+
function Ii(e) {
|
|
4613
4679
|
switch (e.cur.cls) {
|
|
4614
|
-
case
|
|
4615
|
-
if (
|
|
4616
|
-
break;
|
|
4617
|
-
case _r:
|
|
4618
|
-
case sr:
|
|
4619
|
-
if (Rr.has(e.next.cls)) return Z;
|
|
4680
|
+
case wr:
|
|
4681
|
+
if (Gr.has(e.next.cls)) return Z;
|
|
4620
4682
|
break;
|
|
4683
|
+
case Er:
|
|
4621
4684
|
case gr:
|
|
4622
|
-
|
|
4685
|
+
if (qr.has(e.next.cls)) return Z;
|
|
4686
|
+
break;
|
|
4687
|
+
case Tr:
|
|
4688
|
+
case _r: if (e.next.cls === Tr) return Z;
|
|
4623
4689
|
}
|
|
4624
4690
|
return X;
|
|
4625
4691
|
}
|
|
4626
|
-
function
|
|
4692
|
+
function Li(e) {
|
|
4627
4693
|
switch (e.cur.cls) {
|
|
4628
|
-
case
|
|
4629
|
-
case
|
|
4694
|
+
case wr:
|
|
4695
|
+
case Er:
|
|
4696
|
+
case Tr:
|
|
4630
4697
|
case gr:
|
|
4631
|
-
case
|
|
4632
|
-
|
|
4633
|
-
if (e.next.cls === Cr) return Z;
|
|
4698
|
+
case _r:
|
|
4699
|
+
if (e.next.cls === Mr) return Z;
|
|
4634
4700
|
break;
|
|
4635
|
-
case
|
|
4701
|
+
case Nr: if (Kr.has(e.next.cls)) return Z;
|
|
4636
4702
|
}
|
|
4637
4703
|
return X;
|
|
4638
4704
|
}
|
|
4639
|
-
function
|
|
4640
|
-
return (e.cur.cls ===
|
|
4705
|
+
function Ri(e) {
|
|
4706
|
+
return (e.cur.cls === $n || e.cur.cls === yr) && (e.next.cls === $n || e.next.cls === yr) ? Z : X;
|
|
4641
4707
|
}
|
|
4642
|
-
function
|
|
4708
|
+
function zi(e) {
|
|
4643
4709
|
let { prev: t, cur: n, next: r } = e;
|
|
4644
4710
|
function i(e) {
|
|
4645
|
-
return e.cls ===
|
|
4711
|
+
return e.cls === Qn || e.char === "◌" || e.cls === tr;
|
|
4646
4712
|
}
|
|
4647
|
-
return n.cls ===
|
|
4713
|
+
return n.cls === er && i(r) || i(n) && (r.cls === Lr || r.cls === Rr) || i(t) && n.cls === Rr && (r.cls === Qn || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === Lr ? Z : X;
|
|
4648
4714
|
}
|
|
4649
|
-
function
|
|
4650
|
-
return e.cur.cls ===
|
|
4715
|
+
function Bi(e) {
|
|
4716
|
+
return e.cur.cls === Cr && (e.next.cls === $n || e.next.cls === yr) ? Z : X;
|
|
4651
4717
|
}
|
|
4652
|
-
function
|
|
4718
|
+
function Vi(e) {
|
|
4653
4719
|
switch (e.cur.cls) {
|
|
4654
|
-
case
|
|
4655
|
-
case ur:
|
|
4720
|
+
case $n:
|
|
4656
4721
|
case yr:
|
|
4657
|
-
|
|
4722
|
+
case Or:
|
|
4723
|
+
if (e.next.cls === kr && !Xn.get(e.next.cp)) return Z;
|
|
4658
4724
|
break;
|
|
4659
|
-
case
|
|
4725
|
+
case ur: if (!Xn.get(e.cur.cp) && Hr.has(e.next.cls)) return Z;
|
|
4660
4726
|
}
|
|
4661
4727
|
return X;
|
|
4662
4728
|
}
|
|
4663
|
-
function
|
|
4664
|
-
if (e.cur.cls ===
|
|
4665
|
-
if (e.next.cls ===
|
|
4729
|
+
function Hi(e) {
|
|
4730
|
+
if (e.cur.cls === Pr) {
|
|
4731
|
+
if (e.next.cls === Pr && ++e.RI % 2 != 0) return Z;
|
|
4666
4732
|
} else e.RI = 0;
|
|
4667
4733
|
return X;
|
|
4668
4734
|
}
|
|
4669
|
-
function
|
|
4670
|
-
return e.cur.cls ===
|
|
4671
|
-
}
|
|
4672
|
-
function
|
|
4673
|
-
return
|
|
4674
|
-
}
|
|
4675
|
-
var
|
|
4676
|
-
Ur,
|
|
4677
|
-
Wr,
|
|
4678
|
-
Gr,
|
|
4679
|
-
Kr,
|
|
4680
|
-
qr,
|
|
4681
|
-
Jr,
|
|
4682
|
-
Yr,
|
|
4683
|
-
Xr,
|
|
4684
|
-
Zr,
|
|
4735
|
+
function Ui(e) {
|
|
4736
|
+
return e.cur.cls === fr && e.next.cls === pr || e.next.cls === pr && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? Z : X;
|
|
4737
|
+
}
|
|
4738
|
+
function Wi() {
|
|
4739
|
+
return Xr;
|
|
4740
|
+
}
|
|
4741
|
+
var Gi = [
|
|
4685
4742
|
Qr,
|
|
4686
4743
|
$r,
|
|
4687
4744
|
ei,
|
|
@@ -4699,25 +4756,34 @@ var Ii = [
|
|
|
4699
4756
|
fi,
|
|
4700
4757
|
pi,
|
|
4701
4758
|
mi,
|
|
4759
|
+
hi,
|
|
4702
4760
|
gi,
|
|
4703
|
-
vi,
|
|
4704
4761
|
_i,
|
|
4762
|
+
vi,
|
|
4705
4763
|
yi,
|
|
4706
4764
|
bi,
|
|
4707
4765
|
xi,
|
|
4708
4766
|
Si,
|
|
4709
4767
|
Ci,
|
|
4710
|
-
|
|
4768
|
+
Ti,
|
|
4711
4769
|
Di,
|
|
4770
|
+
Ei,
|
|
4712
4771
|
Oi,
|
|
4713
4772
|
ki,
|
|
4714
4773
|
Ai,
|
|
4715
4774
|
ji,
|
|
4716
4775
|
Mi,
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4776
|
+
Fi,
|
|
4777
|
+
Ii,
|
|
4778
|
+
Li,
|
|
4779
|
+
Ri,
|
|
4780
|
+
zi,
|
|
4781
|
+
Bi,
|
|
4782
|
+
Vi,
|
|
4783
|
+
Hi,
|
|
4784
|
+
Ui,
|
|
4785
|
+
Wi
|
|
4786
|
+
], Ki = class {
|
|
4721
4787
|
#e;
|
|
4722
4788
|
constructor(e = {}) {
|
|
4723
4789
|
if (this.#e = {
|
|
@@ -4725,7 +4791,7 @@ var Ii = [
|
|
|
4725
4791
|
example7: !1,
|
|
4726
4792
|
verbose: !1,
|
|
4727
4793
|
...e
|
|
4728
|
-
}, this.rules = [...
|
|
4794
|
+
}, this.rules = [...Gi], this.#e.example7) throw Error("'example7' flag deprecated");
|
|
4729
4795
|
this.#e.verbose && this.rules.unshift((e) => (console.log(e.cur.len, e), X));
|
|
4730
4796
|
}
|
|
4731
4797
|
removeRule(...e) {
|
|
@@ -4753,8 +4819,8 @@ var Ii = [
|
|
|
4753
4819
|
switch (n) {
|
|
4754
4820
|
case X: break;
|
|
4755
4821
|
case Z: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
|
|
4756
|
-
case
|
|
4757
|
-
case
|
|
4822
|
+
case Xr: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new Yn(e.cur.len);
|
|
4823
|
+
case Zr: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new Yn(e.cur.len, !0);
|
|
4758
4824
|
default: throw Error(`Invalid state: "${n}"`);
|
|
4759
4825
|
}
|
|
4760
4826
|
}
|
|
@@ -4765,44 +4831,44 @@ var Ii = [
|
|
|
4765
4831
|
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);
|
|
4766
4832
|
}
|
|
4767
4833
|
*breaks(e) {
|
|
4768
|
-
let t = new
|
|
4834
|
+
let t = new Jn(e);
|
|
4769
4835
|
for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
|
|
4770
4836
|
t.pushEnd(), yield* this.#n(t);
|
|
4771
4837
|
}
|
|
4772
4838
|
};
|
|
4773
4839
|
//#endregion
|
|
4774
4840
|
//#region src/text-layout.ts
|
|
4775
|
-
function
|
|
4841
|
+
function qi(e, t) {
|
|
4776
4842
|
let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = /* @__PURE__ */ new Set([0]);
|
|
4777
4843
|
for (let t of n.segment(e)) r.add(t.index + t.segment.length);
|
|
4778
4844
|
return r;
|
|
4779
4845
|
}
|
|
4780
|
-
var
|
|
4781
|
-
#e = new
|
|
4846
|
+
var Ji = class {
|
|
4847
|
+
#e = new Ki();
|
|
4782
4848
|
#t;
|
|
4783
4849
|
constructor(e = "ja") {
|
|
4784
4850
|
this.#t = e;
|
|
4785
4851
|
}
|
|
4786
4852
|
getBreakOpportunities(e) {
|
|
4787
|
-
let t =
|
|
4853
|
+
let t = qi(e, this.#t), n = /* @__PURE__ */ new Map();
|
|
4788
4854
|
for (let r of this.#e.breaks(e)) t.has(r.position) && n.set(r.position, (n.get(r.position) ?? !1) || r.required);
|
|
4789
4855
|
return Object.freeze([...n].sort(([e], [t]) => e - t).map(([e, t]) => Object.freeze({
|
|
4790
4856
|
position: e,
|
|
4791
4857
|
required: t
|
|
4792
4858
|
})));
|
|
4793
4859
|
}
|
|
4794
|
-
},
|
|
4795
|
-
function
|
|
4796
|
-
let t =
|
|
4860
|
+
}, Yi = /* @__PURE__ */ new Map(), Xi = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
|
|
4861
|
+
function Zi(e) {
|
|
4862
|
+
let t = Yi.get(e);
|
|
4797
4863
|
if (t) return t;
|
|
4798
|
-
let n = new
|
|
4799
|
-
return
|
|
4864
|
+
let n = new Ji(e);
|
|
4865
|
+
return Yi.set(e, n), n;
|
|
4800
4866
|
}
|
|
4801
|
-
function
|
|
4867
|
+
function Qi(e, t) {
|
|
4802
4868
|
if (!Number.isFinite(e) || e < 0) throw TypeError(`${t} must return a non-negative finite number.`);
|
|
4803
4869
|
return e;
|
|
4804
4870
|
}
|
|
4805
|
-
function
|
|
4871
|
+
function $i(e, t, n) {
|
|
4806
4872
|
let r = /* @__PURE__ */ new Map();
|
|
4807
4873
|
for (let i of t.getBreakOpportunities(e)) {
|
|
4808
4874
|
let { position: t, required: a } = i;
|
|
@@ -4813,28 +4879,28 @@ function Wi(e, t, n) {
|
|
|
4813
4879
|
required: t
|
|
4814
4880
|
}));
|
|
4815
4881
|
}
|
|
4816
|
-
function
|
|
4882
|
+
function ea(e, t, n, r, i) {
|
|
4817
4883
|
if (e.length === 0) return [{
|
|
4818
4884
|
text: "",
|
|
4819
4885
|
start: t,
|
|
4820
4886
|
end: t,
|
|
4821
4887
|
width: 0
|
|
4822
4888
|
}];
|
|
4823
|
-
let a =
|
|
4889
|
+
let a = qi(e, i), o = [...a].sort((e, t) => e - t), s = $i(e, r, a), c = [], l = 0;
|
|
4824
4890
|
for (; l < e.length;) {
|
|
4825
4891
|
let r = s.find((e) => e.position > l && e.required)?.position ?? e.length, i, a = 0;
|
|
4826
4892
|
for (let t of s) {
|
|
4827
4893
|
if (t.position <= l || t.position > r) continue;
|
|
4828
|
-
let o = e.slice(l, t.position), s =
|
|
4894
|
+
let o = e.slice(l, t.position), s = Qi(n.measureText(o), "measureText");
|
|
4829
4895
|
s <= n.maxWidth && (i = t.position, a = s);
|
|
4830
4896
|
}
|
|
4831
4897
|
if (i === void 0) {
|
|
4832
4898
|
let t = o.filter((e) => e > l && e <= r);
|
|
4833
4899
|
for (let r of t) {
|
|
4834
|
-
let t = e.slice(l, r), o =
|
|
4900
|
+
let t = e.slice(l, r), o = Qi(n.measureText(t), "measureText");
|
|
4835
4901
|
o <= n.maxWidth && (i = r, a = o);
|
|
4836
4902
|
}
|
|
4837
|
-
i === void 0 && (i = t[0] ?? r, a =
|
|
4903
|
+
i === void 0 && (i = t[0] ?? r, a = Qi(n.measureText(e.slice(l, i)), "measureText"));
|
|
4838
4904
|
}
|
|
4839
4905
|
c.push({
|
|
4840
4906
|
text: e.slice(l, i),
|
|
@@ -4845,38 +4911,38 @@ function Gi(e, t, n, r, i) {
|
|
|
4845
4911
|
}
|
|
4846
4912
|
return c;
|
|
4847
4913
|
}
|
|
4848
|
-
function
|
|
4914
|
+
function ta(e) {
|
|
4849
4915
|
if (typeof e.text != "string") throw TypeError("text must be a string.");
|
|
4850
4916
|
if (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw TypeError("maxWidth must be a positive finite number.");
|
|
4851
4917
|
if (typeof e.measureText != "function") throw TypeError("measureText must be a function.");
|
|
4852
|
-
let t = e.locale ?? "ja", n = e.lineBreakProvider ??
|
|
4853
|
-
for (let a of e.text.matchAll(
|
|
4918
|
+
let t = e.locale ?? "ja", n = e.lineBreakProvider ?? Zi(t), r = [], i = 0;
|
|
4919
|
+
for (let a of e.text.matchAll(Xi)) {
|
|
4854
4920
|
let o = a.index;
|
|
4855
|
-
r.push(...
|
|
4921
|
+
r.push(...ea(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
|
|
4856
4922
|
}
|
|
4857
|
-
return r.push(...
|
|
4923
|
+
return r.push(...ea(e.text.slice(i), i, e, n, t)), Object.freeze({
|
|
4858
4924
|
lines: Object.freeze(r.map((e) => Object.freeze(e))),
|
|
4859
4925
|
maxLineWidth: Math.max(0, ...r.map((e) => e.width))
|
|
4860
4926
|
});
|
|
4861
4927
|
}
|
|
4862
4928
|
//#endregion
|
|
4863
4929
|
//#region src/content-run.ts
|
|
4864
|
-
function
|
|
4930
|
+
function na(e) {
|
|
4865
4931
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4866
4932
|
}
|
|
4867
|
-
function
|
|
4933
|
+
function ra(e, t) {
|
|
4868
4934
|
let n = /* @__PURE__ */ new Set(["type", ...t]), r = Object.keys(e).filter((e) => !n.has(e));
|
|
4869
4935
|
if (r.length > 0) throw TypeError(`Bubble content run has unknown properties: ${r.join(", ")}.`);
|
|
4870
4936
|
for (let n of t) if (typeof e[n] != "string") throw TypeError(`Bubble content run ${n} must be a string.`);
|
|
4871
4937
|
}
|
|
4872
|
-
function
|
|
4873
|
-
if (!
|
|
4874
|
-
if (e.type === "text") return
|
|
4938
|
+
function ia(e) {
|
|
4939
|
+
if (!na(e)) throw TypeError("Bubble content run must be an object.");
|
|
4940
|
+
if (e.type === "text") return ra(e, ["text"]), Object.freeze({
|
|
4875
4941
|
text: e.text,
|
|
4876
4942
|
type: "text"
|
|
4877
4943
|
});
|
|
4878
4944
|
if (e.type === "ruby") {
|
|
4879
|
-
|
|
4945
|
+
ra(e, ["base", "reading"]);
|
|
4880
4946
|
let t = e.base, n = e.reading;
|
|
4881
4947
|
if (t.length === 0) throw TypeError("Bubble ruby run base must not be empty.");
|
|
4882
4948
|
if (n.length === 0) throw TypeError("Bubble ruby run reading must not be empty.");
|
|
@@ -4888,25 +4954,25 @@ function Yi(e) {
|
|
|
4888
4954
|
}
|
|
4889
4955
|
throw TypeError("Bubble content run type must be text or ruby.");
|
|
4890
4956
|
}
|
|
4891
|
-
function
|
|
4957
|
+
function aa(e) {
|
|
4892
4958
|
if (typeof e == "string") return Object.freeze([Object.freeze({
|
|
4893
4959
|
text: e,
|
|
4894
4960
|
type: "text"
|
|
4895
4961
|
})]);
|
|
4896
4962
|
if (!Array.isArray(e)) throw TypeError("Bubble text must be a string or content run array.");
|
|
4897
|
-
let t = e.map((e) =>
|
|
4963
|
+
let t = e.map((e) => ia(e)).filter((e) => e.type !== "text" || e.text.length > 0);
|
|
4898
4964
|
return t.length === 0 ? Object.freeze([Object.freeze({
|
|
4899
4965
|
text: "",
|
|
4900
4966
|
type: "text"
|
|
4901
4967
|
})]) : Object.freeze(t);
|
|
4902
4968
|
}
|
|
4903
|
-
function
|
|
4969
|
+
function oa(e) {
|
|
4904
4970
|
return e.every((e) => e.type === "text");
|
|
4905
4971
|
}
|
|
4906
|
-
function
|
|
4972
|
+
function sa(e) {
|
|
4907
4973
|
return e.map((e) => e.type === "ruby" ? e.base : e.text).join("");
|
|
4908
4974
|
}
|
|
4909
|
-
function
|
|
4975
|
+
function ca(e) {
|
|
4910
4976
|
let t = [];
|
|
4911
4977
|
for (let n of e) {
|
|
4912
4978
|
let e = t[t.length - 1];
|
|
@@ -4923,21 +4989,21 @@ function $i(e) {
|
|
|
4923
4989
|
}
|
|
4924
4990
|
//#endregion
|
|
4925
4991
|
//#region src/reveal.ts
|
|
4926
|
-
var
|
|
4992
|
+
var la = Object.freeze([
|
|
4927
4993
|
"CHARACTER",
|
|
4928
4994
|
"WORD",
|
|
4929
4995
|
"LINE",
|
|
4930
4996
|
"BLOCK"
|
|
4931
4997
|
]);
|
|
4932
|
-
function
|
|
4998
|
+
function ua(e) {
|
|
4933
4999
|
let t = globalThis.Intl?.Segmenter;
|
|
4934
5000
|
return typeof t == "function" ? [...new t(void 0, { granularity: "grapheme" }).segment(e)].map(({ segment: e }) => e) : Array.from(e);
|
|
4935
5001
|
}
|
|
4936
|
-
function
|
|
4937
|
-
if (typeof e != "string" || !
|
|
5002
|
+
function da(e) {
|
|
5003
|
+
if (typeof e != "string" || !la.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
|
|
4938
5004
|
return e;
|
|
4939
5005
|
}
|
|
4940
|
-
function
|
|
5006
|
+
function fa(e) {
|
|
4941
5007
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Bubble reveal must be an object.");
|
|
4942
5008
|
let t = e, n = /* @__PURE__ */ new Set([
|
|
4943
5009
|
"unit",
|
|
@@ -4948,7 +5014,7 @@ function ra(e) {
|
|
|
4948
5014
|
"sound"
|
|
4949
5015
|
]);
|
|
4950
5016
|
if (Object.keys(t).filter((e) => !n.has(e)).length > 0 || t.unit === void 0) throw TypeError("Bubble reveal has unknown or missing properties.");
|
|
4951
|
-
let r =
|
|
5017
|
+
let r = da(t.unit), i = t.delimiters ?? " \r\n";
|
|
4952
5018
|
if (typeof i != "string" || i.length === 0) throw TypeError("Bubble WORD delimiters must be a non-empty string.");
|
|
4953
5019
|
let a = t.showDelimiters ?? !1;
|
|
4954
5020
|
if (typeof a != "boolean") throw TypeError("Bubble reveal showDelimiters must be boolean.");
|
|
@@ -4967,16 +5033,16 @@ function ra(e) {
|
|
|
4967
5033
|
...c === void 0 ? {} : { sound: c }
|
|
4968
5034
|
});
|
|
4969
5035
|
}
|
|
4970
|
-
function
|
|
5036
|
+
function pa(e, t, n) {
|
|
4971
5037
|
let r = new Set(Array.from(t)), i = [], a = "";
|
|
4972
|
-
for (let t of
|
|
5038
|
+
for (let t of ua(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
|
|
4973
5039
|
return a.length > 0 && i.push(a), i.filter((e) => e.length > 0);
|
|
4974
5040
|
}
|
|
4975
|
-
function
|
|
5041
|
+
function ma(e, t) {
|
|
4976
5042
|
if (e.length === 0) return Object.freeze([""]);
|
|
4977
|
-
if (t.unit === "CHARACTER") return Object.freeze(
|
|
5043
|
+
if (t.unit === "CHARACTER") return Object.freeze(ua(e));
|
|
4978
5044
|
if (t.unit === "WORD") {
|
|
4979
|
-
let n =
|
|
5045
|
+
let n = pa(e, t.delimiters, t.showDelimiters);
|
|
4980
5046
|
if (t.showDelimiters) return Object.freeze(n);
|
|
4981
5047
|
let r = [], i = 0;
|
|
4982
5048
|
for (let a of n) {
|
|
@@ -4994,18 +5060,18 @@ function aa(e, t) {
|
|
|
4994
5060
|
let i = r;
|
|
4995
5061
|
return Object.freeze(i.length > 0 ? i : [e]);
|
|
4996
5062
|
}
|
|
4997
|
-
function
|
|
4998
|
-
return Object.freeze(
|
|
5063
|
+
function ha(e) {
|
|
5064
|
+
return Object.freeze(ca(Object.freeze([...e])));
|
|
4999
5065
|
}
|
|
5000
|
-
function
|
|
5066
|
+
function ga(e) {
|
|
5001
5067
|
return Object.freeze({
|
|
5002
5068
|
text: e,
|
|
5003
5069
|
type: "text"
|
|
5004
5070
|
});
|
|
5005
5071
|
}
|
|
5006
|
-
function
|
|
5072
|
+
function _a(e, t) {
|
|
5007
5073
|
let n = [], r = [], i = () => {
|
|
5008
|
-
r.length !== 0 && (n.push(
|
|
5074
|
+
r.length !== 0 && (n.push(ha(r)), r = []);
|
|
5009
5075
|
};
|
|
5010
5076
|
for (let n of e) {
|
|
5011
5077
|
if (n.type === "ruby") {
|
|
@@ -5013,53 +5079,53 @@ function ca(e, t) {
|
|
|
5013
5079
|
continue;
|
|
5014
5080
|
}
|
|
5015
5081
|
if (t === "LINE") {
|
|
5016
|
-
for (let e of n.text.split(/(?<=\n)/u)) e.length !== 0 && (r.push(
|
|
5082
|
+
for (let e of n.text.split(/(?<=\n)/u)) e.length !== 0 && (r.push(ga(e)), e.endsWith("\n") && i());
|
|
5017
5083
|
continue;
|
|
5018
5084
|
}
|
|
5019
5085
|
let e = n.text.split(/(\n{2,})/u);
|
|
5020
|
-
for (let [t, n] of e.entries()) n.length !== 0 && (r.push(
|
|
5086
|
+
for (let [t, n] of e.entries()) n.length !== 0 && (r.push(ga(n)), t % 2 == 1 && i());
|
|
5021
5087
|
}
|
|
5022
|
-
return i(), Object.freeze(n.length > 0 ? n : [
|
|
5088
|
+
return i(), Object.freeze(n.length > 0 ? n : [ha(e)]);
|
|
5023
5089
|
}
|
|
5024
|
-
function
|
|
5025
|
-
if (
|
|
5026
|
-
if (t.unit === "LINE" || t.unit === "BLOCK") return
|
|
5090
|
+
function va(e, t) {
|
|
5091
|
+
if (oa(e)) return Object.freeze(ma(sa(e), t).map((e) => Object.freeze([ga(e)])));
|
|
5092
|
+
if (t.unit === "LINE" || t.unit === "BLOCK") return _a(e, t.unit);
|
|
5027
5093
|
let n = [];
|
|
5028
5094
|
for (let r of e) {
|
|
5029
5095
|
if (r.type === "ruby") {
|
|
5030
5096
|
n.push(Object.freeze([r]));
|
|
5031
5097
|
continue;
|
|
5032
5098
|
}
|
|
5033
|
-
let e = t.unit === "CHARACTER" ?
|
|
5034
|
-
for (let t of e) n.push(Object.freeze([
|
|
5099
|
+
let e = t.unit === "CHARACTER" ? ua(r.text) : pa(r.text, t.delimiters, t.showDelimiters);
|
|
5100
|
+
for (let t of e) n.push(Object.freeze([ga(t)]));
|
|
5035
5101
|
}
|
|
5036
|
-
return Object.freeze(n.length > 0 ? n : [Object.freeze([
|
|
5102
|
+
return Object.freeze(n.length > 0 ? n : [Object.freeze([ga("")])]);
|
|
5037
5103
|
}
|
|
5038
|
-
function
|
|
5104
|
+
function ya(e, t) {
|
|
5039
5105
|
let n = e.slice(0, Math.max(0, Math.min(t, e.length)));
|
|
5040
|
-
return
|
|
5106
|
+
return ca(Object.freeze(n.flat()));
|
|
5041
5107
|
}
|
|
5042
5108
|
//#endregion
|
|
5043
5109
|
//#region src/portrait-layout.ts
|
|
5044
|
-
var
|
|
5110
|
+
var ba = Object.freeze([
|
|
5045
5111
|
"left",
|
|
5046
5112
|
"right",
|
|
5047
5113
|
"top-left",
|
|
5048
5114
|
"top-right",
|
|
5049
5115
|
"bottom-left",
|
|
5050
5116
|
"bottom-right"
|
|
5051
|
-
]),
|
|
5117
|
+
]), xa = Object.freeze({
|
|
5052
5118
|
x: 0,
|
|
5053
5119
|
y: 0,
|
|
5054
5120
|
zoomPercent: 100
|
|
5055
5121
|
});
|
|
5056
|
-
function
|
|
5122
|
+
function Sa(e) {
|
|
5057
5123
|
if (typeof e != "string") throw TypeError("Bubble portrait placement must be a string.");
|
|
5058
5124
|
let t = e.trim().toLowerCase().replaceAll("_", "-");
|
|
5059
|
-
if (!
|
|
5125
|
+
if (!ba.includes(t)) throw TypeError(`Unsupported Bubble portrait placement: ${e}`);
|
|
5060
5126
|
return t;
|
|
5061
5127
|
}
|
|
5062
|
-
function
|
|
5128
|
+
function Ca(e) {
|
|
5063
5129
|
if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble portrait offset must be [x, y] or [x, y, zoom].");
|
|
5064
5130
|
let [t, n, r = 100] = e;
|
|
5065
5131
|
if (![
|
|
@@ -5073,11 +5139,11 @@ function ma(e) {
|
|
|
5073
5139
|
zoomPercent: r
|
|
5074
5140
|
});
|
|
5075
5141
|
}
|
|
5076
|
-
function
|
|
5142
|
+
function wa(e) {
|
|
5077
5143
|
if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw TypeError("Bubble portrait corner radius must be zero or greater.");
|
|
5078
5144
|
return e;
|
|
5079
5145
|
}
|
|
5080
|
-
var
|
|
5146
|
+
var Ta = Object.freeze([
|
|
5081
5147
|
"placement",
|
|
5082
5148
|
"maxWidth",
|
|
5083
5149
|
"textLocale",
|
|
@@ -5092,13 +5158,13 @@ var ga = Object.freeze([
|
|
|
5092
5158
|
"showAnimation",
|
|
5093
5159
|
"hideAnimation"
|
|
5094
5160
|
]);
|
|
5095
|
-
function
|
|
5161
|
+
function Ea(e) {
|
|
5096
5162
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
5097
5163
|
}
|
|
5098
|
-
function
|
|
5099
|
-
return !
|
|
5164
|
+
function Da(e) {
|
|
5165
|
+
return !Ea(e) || typeof e.textStyle != "string" || e.textStyle.trim() !== "default" ? "custom" : Ta.every((t) => e[t] === void 0) ? "scratch-default" : "custom";
|
|
5100
5166
|
}
|
|
5101
|
-
function
|
|
5167
|
+
function Oa(e) {
|
|
5102
5168
|
let t = 0;
|
|
5103
5169
|
for (let n of e) if (!/\p{Mark}/u.test(n)) {
|
|
5104
5170
|
if (/\s/u.test(n)) {
|
|
@@ -5109,8 +5175,8 @@ function ya(e) {
|
|
|
5109
5175
|
}
|
|
5110
5176
|
return t * 14;
|
|
5111
5177
|
}
|
|
5112
|
-
function
|
|
5113
|
-
let n =
|
|
5178
|
+
function ka(e, t = Oa) {
|
|
5179
|
+
let n = ta({
|
|
5114
5180
|
text: e.slice(0, 330),
|
|
5115
5181
|
maxWidth: 170,
|
|
5116
5182
|
measureText: (e) => {
|
|
@@ -5118,9 +5184,9 @@ function ba(e, t = ya) {
|
|
|
5118
5184
|
try {
|
|
5119
5185
|
n = t(e);
|
|
5120
5186
|
} catch {
|
|
5121
|
-
return
|
|
5187
|
+
return Oa(e);
|
|
5122
5188
|
}
|
|
5123
|
-
return Number.isFinite(n) && n >= 0 ? n :
|
|
5189
|
+
return Number.isFinite(n) && n >= 0 ? n : Oa(e);
|
|
5124
5190
|
}
|
|
5125
5191
|
}), r = Object.freeze(n.lines.map((e) => Object.freeze({
|
|
5126
5192
|
text: e.text,
|
|
@@ -5132,7 +5198,7 @@ function ba(e, t = ya) {
|
|
|
5132
5198
|
text: r.map((e) => e.text).join("\n")
|
|
5133
5199
|
});
|
|
5134
5200
|
}
|
|
5135
|
-
function
|
|
5201
|
+
function Aa(e) {
|
|
5136
5202
|
let t = Math.max(1, e.lines.length), n = Math.max(e.maxLineWidth, 50) + 20, r = 16 * t + 20;
|
|
5137
5203
|
return Object.freeze({
|
|
5138
5204
|
bodyHeight: r + 4,
|
|
@@ -5143,7 +5209,7 @@ function xa(e) {
|
|
|
5143
5209
|
width: n + 4
|
|
5144
5210
|
});
|
|
5145
5211
|
}
|
|
5146
|
-
function
|
|
5212
|
+
function ja(e) {
|
|
5147
5213
|
let t = -e.stageWidth / 2, n = e.stageWidth / 2, r = e.stageHeight / 2, i = e.pointsLeft;
|
|
5148
5214
|
!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);
|
|
5149
5215
|
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);
|
|
@@ -5155,10 +5221,10 @@ function Sa(e) {
|
|
|
5155
5221
|
top: o
|
|
5156
5222
|
});
|
|
5157
5223
|
}
|
|
5158
|
-
function
|
|
5224
|
+
function Ma(e) {
|
|
5159
5225
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
5160
5226
|
}
|
|
5161
|
-
function
|
|
5227
|
+
function Na(e) {
|
|
5162
5228
|
let { paddedHeight: t, paddedWidth: n } = e, r = Math.min(16, n / 2, t / 2);
|
|
5163
5229
|
return [
|
|
5164
5230
|
`M ${r} ${t}`,
|
|
@@ -5171,16 +5237,16 @@ function wa(e) {
|
|
|
5171
5237
|
`Q ${n} ${t} ${n - r} ${t}`
|
|
5172
5238
|
].join(" ");
|
|
5173
5239
|
}
|
|
5174
|
-
function
|
|
5240
|
+
function Pa(e) {
|
|
5175
5241
|
let { paddedHeight: t, paddedWidth: n } = e;
|
|
5176
|
-
return `<path d="${`${
|
|
5242
|
+
return `<path d="${`${Na(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"/>`;
|
|
5177
5243
|
}
|
|
5178
|
-
function
|
|
5244
|
+
function Fa(e) {
|
|
5179
5245
|
let { paddedHeight: t, paddedWidth: n } = e;
|
|
5180
|
-
return `<path d="${`${
|
|
5246
|
+
return `<path d="${`${Na(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"/>`;
|
|
5181
5247
|
}
|
|
5182
|
-
function
|
|
5183
|
-
let t =
|
|
5248
|
+
function Ia(e) {
|
|
5249
|
+
let t = Aa(e.layout), n = e.kind === "say" ? Pa(t) : Fa(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">${Ma(e.text)}</text>`).join(""), a = Ma(e.title ?? `${e.kind} bubble`);
|
|
5184
5250
|
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>`;
|
|
5185
5251
|
}
|
|
5186
5252
|
//#endregion
|
|
@@ -5190,11 +5256,11 @@ var Q = class extends Error {
|
|
|
5190
5256
|
constructor(e, t) {
|
|
5191
5257
|
super(t), this.name = "BubbleCompositionError", this.code = e;
|
|
5192
5258
|
}
|
|
5193
|
-
},
|
|
5259
|
+
}, La = /* @__PURE__ */ new Set(["say", "think"]), Ra = /* @__PURE__ */ new Set([
|
|
5194
5260
|
"idle",
|
|
5195
5261
|
"talking",
|
|
5196
5262
|
"awaiting-continue"
|
|
5197
|
-
]),
|
|
5263
|
+
]), za = /* @__PURE__ */ new Set([
|
|
5198
5264
|
"fadeIn",
|
|
5199
5265
|
"fadeOut",
|
|
5200
5266
|
"floatIn",
|
|
@@ -5206,54 +5272,54 @@ var Q = class extends Error {
|
|
|
5206
5272
|
"shake",
|
|
5207
5273
|
"explode",
|
|
5208
5274
|
"animateBubbleShape"
|
|
5209
|
-
]),
|
|
5275
|
+
]), Ba = /* @__PURE__ */ new Set([
|
|
5210
5276
|
"linear",
|
|
5211
5277
|
"easeIn",
|
|
5212
5278
|
"easeOut",
|
|
5213
5279
|
"easeInOut"
|
|
5214
5280
|
]);
|
|
5215
|
-
function
|
|
5281
|
+
function Va(e) {
|
|
5216
5282
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
5217
5283
|
}
|
|
5218
|
-
function
|
|
5284
|
+
function Ha(e, t, n, r) {
|
|
5219
5285
|
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));
|
|
5220
5286
|
if (a.length > 0 || o.length > 0) throw new Q("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
|
|
5221
5287
|
}
|
|
5222
|
-
function
|
|
5288
|
+
function Ua(e, t) {
|
|
5223
5289
|
if (typeof e != "string" || e.trim().length === 0) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
5224
5290
|
return e.trim();
|
|
5225
5291
|
}
|
|
5226
|
-
function
|
|
5292
|
+
function Wa(e, t) {
|
|
5227
5293
|
if (typeof e != "string" || e.length === 0) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
5228
5294
|
return e;
|
|
5229
5295
|
}
|
|
5230
|
-
function
|
|
5231
|
-
if (!
|
|
5232
|
-
if (
|
|
5233
|
-
let r = Object.freeze(e.frames.map((e, n) =>
|
|
5296
|
+
function Ga(e, t, n) {
|
|
5297
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
5298
|
+
if (Ha(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"}.`);
|
|
5299
|
+
let r = Object.freeze(e.frames.map((e, n) => Wa(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
|
|
5234
5300
|
if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Q("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
|
|
5235
5301
|
return Object.freeze({
|
|
5236
5302
|
frames: r,
|
|
5237
5303
|
frameIntervalSeconds: i
|
|
5238
5304
|
});
|
|
5239
5305
|
}
|
|
5240
|
-
function
|
|
5241
|
-
if (!
|
|
5242
|
-
|
|
5306
|
+
function Ka(e) {
|
|
5307
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
|
|
5308
|
+
Ha(e, ["base"], [
|
|
5243
5309
|
"blink",
|
|
5244
5310
|
"lipSync",
|
|
5245
5311
|
"placement",
|
|
5246
5312
|
"offset",
|
|
5247
5313
|
"cornerRadius"
|
|
5248
5314
|
], "Bubble portrait");
|
|
5249
|
-
let t = e.blink === void 0 ? void 0 :
|
|
5315
|
+
let t = e.blink === void 0 ? void 0 : Ga(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Ga(e.lipSync, "Bubble portrait lip-sync", 1), r, i, a;
|
|
5250
5316
|
try {
|
|
5251
|
-
r =
|
|
5317
|
+
r = Sa(e.placement ?? "left"), i = e.offset === void 0 ? xa : Ca(e.offset), a = wa(e.cornerRadius ?? 0);
|
|
5252
5318
|
} catch (e) {
|
|
5253
5319
|
throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble portrait layout is invalid.");
|
|
5254
5320
|
}
|
|
5255
5321
|
return Object.freeze({
|
|
5256
|
-
base:
|
|
5322
|
+
base: Wa(e.base, "Bubble portrait base"),
|
|
5257
5323
|
...t === void 0 ? {} : { blink: t },
|
|
5258
5324
|
...n === void 0 ? {} : { lipSync: n },
|
|
5259
5325
|
placement: r,
|
|
@@ -5261,9 +5327,9 @@ function La(e) {
|
|
|
5261
5327
|
cornerRadius: a
|
|
5262
5328
|
});
|
|
5263
5329
|
}
|
|
5264
|
-
function
|
|
5265
|
-
if (!
|
|
5266
|
-
if (
|
|
5330
|
+
function qa(e, t) {
|
|
5331
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
5332
|
+
if (Ha(e, ["name"], [
|
|
5267
5333
|
"durationSeconds",
|
|
5268
5334
|
"ease",
|
|
5269
5335
|
"direction",
|
|
@@ -5271,7 +5337,7 @@ function Ra(e, t) {
|
|
|
5271
5337
|
"relativeScale",
|
|
5272
5338
|
"speed",
|
|
5273
5339
|
"visualStyle"
|
|
5274
|
-
], t), !
|
|
5340
|
+
], t), !za.has(e.name)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
|
|
5275
5341
|
let n = (n, r, i = !1) => {
|
|
5276
5342
|
let a = e[n];
|
|
5277
5343
|
if (a !== void 0) {
|
|
@@ -5281,7 +5347,7 @@ function Ra(e, t) {
|
|
|
5281
5347
|
}, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
|
|
5282
5348
|
if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Q("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
|
|
5283
5349
|
let c = e.ease ?? "easeInOut";
|
|
5284
|
-
if (typeof c != "string" || !
|
|
5350
|
+
if (typeof c != "string" || !Ba.has(c)) throw new Q("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
|
|
5285
5351
|
let l = e.visualStyle;
|
|
5286
5352
|
if (l !== void 0 && (typeof l != "string" || !ut.includes(l))) throw new Q("BUBBLE-COMPOSITION-001", `${t}.visualStyle is invalid.`);
|
|
5287
5353
|
return Object.freeze({
|
|
@@ -5295,10 +5361,10 @@ function Ra(e, t) {
|
|
|
5295
5361
|
...l === void 0 ? {} : { visualStyle: l }
|
|
5296
5362
|
});
|
|
5297
5363
|
}
|
|
5298
|
-
function
|
|
5364
|
+
function Ja(e) {
|
|
5299
5365
|
if (e === void 0) return;
|
|
5300
|
-
if (!
|
|
5301
|
-
|
|
5366
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
|
|
5367
|
+
Ha(e, [], [
|
|
5302
5368
|
"voice",
|
|
5303
5369
|
"reveal",
|
|
5304
5370
|
"finish"
|
|
@@ -5310,13 +5376,13 @@ function za(e) {
|
|
|
5310
5376
|
"finish"
|
|
5311
5377
|
]) {
|
|
5312
5378
|
let r = e[n];
|
|
5313
|
-
r !== void 0 && (t[n] =
|
|
5379
|
+
r !== void 0 && (t[n] = Wa(r, `Bubble audio ${n}`));
|
|
5314
5380
|
}
|
|
5315
5381
|
return Object.freeze(t);
|
|
5316
5382
|
}
|
|
5317
|
-
function
|
|
5318
|
-
if (!
|
|
5319
|
-
|
|
5383
|
+
function Ya(e) {
|
|
5384
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
|
|
5385
|
+
Ha(e, ["name", "textStyle"], [
|
|
5320
5386
|
"placement",
|
|
5321
5387
|
"maxWidth",
|
|
5322
5388
|
"textLocale",
|
|
@@ -5331,13 +5397,13 @@ function Ba(e) {
|
|
|
5331
5397
|
"showAnimation",
|
|
5332
5398
|
"hideAnimation"
|
|
5333
5399
|
], "Bubble style");
|
|
5334
|
-
let t = e.portrait === void 0 ? void 0 :
|
|
5400
|
+
let t = e.portrait === void 0 ? void 0 : Ka(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Ga(e.continueIndicator, "Bubble continue indicator", 2), r;
|
|
5335
5401
|
if (e.reveal !== void 0) try {
|
|
5336
|
-
r =
|
|
5402
|
+
r = fa(e.reveal);
|
|
5337
5403
|
} catch (e) {
|
|
5338
5404
|
throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
5339
5405
|
}
|
|
5340
|
-
let i =
|
|
5406
|
+
let i = Ja(e.audio), a = e.showAnimation === void 0 ? void 0 : qa(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : qa(e.hideAnimation, "Bubble hideAnimation"), s;
|
|
5341
5407
|
try {
|
|
5342
5408
|
s = Xe(e.placement ?? "up-right");
|
|
5343
5409
|
} catch (e) {
|
|
@@ -5356,10 +5422,10 @@ function Ba(e) {
|
|
|
5356
5422
|
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.");
|
|
5357
5423
|
f = e.maxWidth;
|
|
5358
5424
|
}
|
|
5359
|
-
let p = e.textLocale === void 0 ? void 0 :
|
|
5425
|
+
let p = e.textLocale === void 0 ? void 0 : Ua(e.textLocale, "Bubble style text locale"), m = Da(e);
|
|
5360
5426
|
return Object.freeze({
|
|
5361
|
-
name:
|
|
5362
|
-
textStyle:
|
|
5427
|
+
name: Ua(e.name, "Bubble style name"),
|
|
5428
|
+
textStyle: Ua(e.textStyle, "Bubble text style name"),
|
|
5363
5429
|
layoutProfile: m,
|
|
5364
5430
|
...f === void 0 ? {} : { maxWidth: f },
|
|
5365
5431
|
...p === void 0 ? {} : { textLocale: p },
|
|
@@ -5376,97 +5442,97 @@ function Ba(e) {
|
|
|
5376
5442
|
...o === void 0 ? {} : { hideAnimation: o }
|
|
5377
5443
|
});
|
|
5378
5444
|
}
|
|
5379
|
-
function
|
|
5445
|
+
function Xa(e) {
|
|
5380
5446
|
if (e !== void 0) {
|
|
5381
|
-
if (!
|
|
5447
|
+
if (!Va(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
|
|
5382
5448
|
return e;
|
|
5383
5449
|
}
|
|
5384
5450
|
}
|
|
5385
|
-
function
|
|
5451
|
+
function Za(e) {
|
|
5386
5452
|
if (e !== void 0) {
|
|
5387
|
-
if (!
|
|
5453
|
+
if (!Va(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
|
|
5388
5454
|
if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
|
|
5389
5455
|
if (e.getMimeType !== void 0 && typeof e.getMimeType != "function") throw TypeError("Bubble audio capability getMimeType must be a function.");
|
|
5390
5456
|
return e;
|
|
5391
5457
|
}
|
|
5392
5458
|
}
|
|
5393
|
-
function
|
|
5459
|
+
function Qa(e) {
|
|
5394
5460
|
if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
|
|
5395
5461
|
return e;
|
|
5396
5462
|
}
|
|
5397
|
-
function
|
|
5398
|
-
if (!
|
|
5463
|
+
function $a(e) {
|
|
5464
|
+
if (!Va(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble text capability must provide setText and releaseTarget.");
|
|
5399
5465
|
return e;
|
|
5400
5466
|
}
|
|
5401
|
-
function
|
|
5467
|
+
function eo() {
|
|
5402
5468
|
return Object.freeze({
|
|
5403
5469
|
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
5404
5470
|
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
5405
5471
|
});
|
|
5406
5472
|
}
|
|
5407
|
-
function
|
|
5408
|
-
if (!
|
|
5473
|
+
function to(e) {
|
|
5474
|
+
if (!Va(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
|
|
5409
5475
|
return e;
|
|
5410
5476
|
}
|
|
5411
|
-
function
|
|
5412
|
-
if (!
|
|
5477
|
+
function no(e, t) {
|
|
5478
|
+
if (!Va(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.`);
|
|
5413
5479
|
return e;
|
|
5414
5480
|
}
|
|
5415
|
-
function
|
|
5481
|
+
function ro(e) {
|
|
5416
5482
|
if (typeof e != "object" || !e) throw new Q("BUBBLE-COMPOSITION-004", "Bubble text target must be a non-null object.");
|
|
5417
5483
|
return e;
|
|
5418
5484
|
}
|
|
5419
|
-
function
|
|
5420
|
-
if (!
|
|
5485
|
+
function io(e, t) {
|
|
5486
|
+
if (!Va(e) || !Va(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.");
|
|
5421
5487
|
let n = e.targets;
|
|
5422
|
-
|
|
5488
|
+
ro(n.text);
|
|
5423
5489
|
let r = /* @__PURE__ */ new Set(), i = (e, t) => {
|
|
5424
5490
|
let i = n[e];
|
|
5425
5491
|
if (!t && i === void 0) return;
|
|
5426
|
-
let a =
|
|
5492
|
+
let a = no(i, `Bubble surface ${e}`);
|
|
5427
5493
|
if (r.has(a.id)) throw new Q("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
|
|
5428
5494
|
r.add(a.id);
|
|
5429
5495
|
};
|
|
5430
5496
|
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;
|
|
5431
5497
|
}
|
|
5432
|
-
function
|
|
5498
|
+
function ao(e, t) {
|
|
5433
5499
|
if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
|
|
5434
5500
|
if (!e.isRegistered(t)) throw new Q("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
|
|
5435
5501
|
if (!e.getMimeType(t).startsWith("image/")) throw new Q("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
|
|
5436
5502
|
}
|
|
5437
|
-
function
|
|
5503
|
+
function oo(e, t) {
|
|
5438
5504
|
if (e === void 0) throw new Q("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
|
|
5439
5505
|
if (e.isRegistered?.(t) === !1) throw new Q("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
|
|
5440
5506
|
let n = e.getMimeType?.(t);
|
|
5441
5507
|
if (n !== void 0 && !n.startsWith("audio/")) throw new Q("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
|
|
5442
5508
|
}
|
|
5443
|
-
function
|
|
5509
|
+
function so(e) {
|
|
5444
5510
|
return [...e.portrait === void 0 ? [] : [
|
|
5445
5511
|
e.portrait.base,
|
|
5446
5512
|
...e.portrait.blink?.frames ?? [],
|
|
5447
5513
|
...e.portrait.lipSync?.frames ?? []
|
|
5448
5514
|
], ...e.continueIndicator?.frames ?? []];
|
|
5449
5515
|
}
|
|
5450
|
-
function
|
|
5516
|
+
function co(e) {
|
|
5451
5517
|
let t = e.setRichText;
|
|
5452
5518
|
if (typeof t != "function") throw new Q("BUBBLE-COMPOSITION-007", "Bubble ruby content requires the text capability setRichText method.");
|
|
5453
5519
|
return t;
|
|
5454
5520
|
}
|
|
5455
|
-
function
|
|
5456
|
-
return !
|
|
5521
|
+
function lo(e, t, n, r) {
|
|
5522
|
+
return !oa(e) && typeof r.splitRichText == "function" ? r.splitRichText({
|
|
5457
5523
|
reveal: t,
|
|
5458
5524
|
runs: e,
|
|
5459
5525
|
styleName: n
|
|
5460
|
-
}) :
|
|
5526
|
+
}) : va(e, t);
|
|
5461
5527
|
}
|
|
5462
|
-
function
|
|
5463
|
-
if (t.layoutProfile === "scratch-default") return
|
|
5528
|
+
function uo(e, t, n) {
|
|
5529
|
+
if (t.layoutProfile === "scratch-default") return ka(e, (e) => typeof n.measureText == "function" ? n.measureText({
|
|
5464
5530
|
styleName: t.textStyle,
|
|
5465
5531
|
text: e
|
|
5466
5532
|
}) : NaN).text;
|
|
5467
5533
|
if (t.maxWidth === void 0) return e;
|
|
5468
5534
|
if (typeof n.measureText != "function") throw new Q("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
|
|
5469
|
-
return
|
|
5535
|
+
return ta({
|
|
5470
5536
|
text: e,
|
|
5471
5537
|
maxWidth: t.maxWidth,
|
|
5472
5538
|
...t.textLocale === void 0 ? {} : { locale: t.textLocale },
|
|
@@ -5476,11 +5542,11 @@ function to(e, t, n) {
|
|
|
5476
5542
|
}) ?? 0
|
|
5477
5543
|
}).lines.map(({ text: e }) => e).join("\n");
|
|
5478
5544
|
}
|
|
5479
|
-
function
|
|
5545
|
+
function fo(e, t) {
|
|
5480
5546
|
if (e.length === 1) throw e[0];
|
|
5481
5547
|
if (e.length > 1) throw AggregateError(e, t);
|
|
5482
5548
|
}
|
|
5483
|
-
function
|
|
5549
|
+
function po(e) {
|
|
5484
5550
|
let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
|
|
5485
5551
|
let n = e.animation.frames[t];
|
|
5486
5552
|
n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
|
|
@@ -5515,45 +5581,45 @@ function ro(e) {
|
|
|
5515
5581
|
}
|
|
5516
5582
|
});
|
|
5517
5583
|
}
|
|
5518
|
-
function
|
|
5519
|
-
if (!
|
|
5520
|
-
if (
|
|
5584
|
+
function mo(e) {
|
|
5585
|
+
if (!Va(e)) throw new Q("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
|
|
5586
|
+
if (Ha(e, [
|
|
5521
5587
|
"actor",
|
|
5522
5588
|
"actorKey",
|
|
5523
5589
|
"kind",
|
|
5524
5590
|
"text",
|
|
5525
5591
|
"styleName"
|
|
5526
|
-
], ["animationMode", "reveal"], "Show bubble input"), !
|
|
5592
|
+
], ["animationMode", "reveal"], "Show bubble input"), !La.has(e.kind)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
|
|
5527
5593
|
let t;
|
|
5528
5594
|
try {
|
|
5529
|
-
t =
|
|
5595
|
+
t = aa(e.text);
|
|
5530
5596
|
} catch (e) {
|
|
5531
5597
|
throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble text is invalid.");
|
|
5532
5598
|
}
|
|
5533
5599
|
let n = e.animationMode ?? "talking";
|
|
5534
|
-
if (!
|
|
5600
|
+
if (!Ra.has(n)) throw new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
|
|
5535
5601
|
let r;
|
|
5536
5602
|
if (e.reveal !== void 0) try {
|
|
5537
|
-
r =
|
|
5603
|
+
r = fa(e.reveal);
|
|
5538
5604
|
} catch (e) {
|
|
5539
5605
|
throw new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
5540
5606
|
}
|
|
5541
5607
|
return {
|
|
5542
5608
|
actor: e.actor,
|
|
5543
|
-
actorKey:
|
|
5609
|
+
actorKey: Ua(e.actorKey, "Bubble actor key"),
|
|
5544
5610
|
kind: e.kind,
|
|
5545
5611
|
content: t,
|
|
5546
|
-
styleName:
|
|
5612
|
+
styleName: Ua(e.styleName, "Bubble style name"),
|
|
5547
5613
|
animationMode: n,
|
|
5548
5614
|
...r === void 0 ? {} : { reveal: r }
|
|
5549
5615
|
};
|
|
5550
5616
|
}
|
|
5551
|
-
function
|
|
5552
|
-
if (!
|
|
5553
|
-
let t =
|
|
5617
|
+
function ho(e) {
|
|
5618
|
+
if (!Va(e)) throw TypeError("Bubble composition options must be an object.");
|
|
5619
|
+
let t = Xa(e.imageResolver), n = Za(e.audio), r = $a(e.textCapability);
|
|
5554
5620
|
if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
|
|
5555
5621
|
if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
|
|
5556
|
-
let i =
|
|
5622
|
+
let i = to(e.scheduler ?? eo()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
|
|
5557
5623
|
if (c) throw new Q("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
|
|
5558
5624
|
}, u = async (e, t) => {
|
|
5559
5625
|
let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
|
|
@@ -5574,8 +5640,8 @@ function ao(e) {
|
|
|
5574
5640
|
reveal: s.reveal
|
|
5575
5641
|
}));
|
|
5576
5642
|
let d = s.content, f = (e) => {
|
|
5577
|
-
let n = new Set(
|
|
5578
|
-
for (let e of n)
|
|
5643
|
+
let n = new Set(so(e)), r = n.size === 0 ? void 0 : Qa(t);
|
|
5644
|
+
for (let e of n) ao(r, e);
|
|
5579
5645
|
return r;
|
|
5580
5646
|
}, p = f(u);
|
|
5581
5647
|
for (let e of [
|
|
@@ -5583,13 +5649,13 @@ function ao(e) {
|
|
|
5583
5649
|
u.audio?.reveal,
|
|
5584
5650
|
u.audio?.finish,
|
|
5585
5651
|
u.reveal?.sound
|
|
5586
|
-
]) e !== void 0 &&
|
|
5652
|
+
]) e !== void 0 && oo(n, e);
|
|
5587
5653
|
let m = async (e, t = !1) => {
|
|
5588
5654
|
e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
|
|
5589
5655
|
}, h = async (e, t, n) => {
|
|
5590
|
-
let r =
|
|
5656
|
+
let r = so(e).length === 0 ? void 0 : Qa(t), i = [];
|
|
5591
5657
|
if (e.portrait) {
|
|
5592
|
-
let t =
|
|
5658
|
+
let t = Qa(r);
|
|
5593
5659
|
i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
|
|
5594
5660
|
let a = e.portrait.blink?.frames[0];
|
|
5595
5661
|
a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
|
|
@@ -5598,63 +5664,63 @@ function ao(e) {
|
|
|
5598
5664
|
}
|
|
5599
5665
|
let a = e.continueIndicator?.frames[0];
|
|
5600
5666
|
if (a !== void 0) {
|
|
5601
|
-
let e =
|
|
5667
|
+
let e = Qa(r);
|
|
5602
5668
|
i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
|
|
5603
5669
|
}
|
|
5604
5670
|
await Promise.all(i);
|
|
5605
5671
|
}, g = (t, n, r) => {
|
|
5606
|
-
x = t.portrait?.blink === void 0 ? void 0 :
|
|
5672
|
+
x = t.portrait?.blink === void 0 ? void 0 : po({
|
|
5607
5673
|
actorKey: s.actorKey,
|
|
5608
5674
|
layer: "portraitBlink",
|
|
5609
5675
|
animation: t.portrait.blink,
|
|
5610
5676
|
target: r.targets.portraitBlink,
|
|
5611
|
-
imageResolver:
|
|
5677
|
+
imageResolver: Qa(n),
|
|
5612
5678
|
scheduler: i,
|
|
5613
5679
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
5614
|
-
}), S = t.portrait?.lipSync === void 0 ? void 0 :
|
|
5680
|
+
}), S = t.portrait?.lipSync === void 0 ? void 0 : po({
|
|
5615
5681
|
actorKey: s.actorKey,
|
|
5616
5682
|
layer: "portraitLipSync",
|
|
5617
5683
|
animation: t.portrait.lipSync,
|
|
5618
5684
|
target: r.targets.portraitLipSync,
|
|
5619
|
-
imageResolver:
|
|
5685
|
+
imageResolver: Qa(n),
|
|
5620
5686
|
scheduler: i,
|
|
5621
5687
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
5622
|
-
}), C = t.continueIndicator === void 0 ? void 0 :
|
|
5688
|
+
}), C = t.continueIndicator === void 0 ? void 0 : po({
|
|
5623
5689
|
actorKey: s.actorKey,
|
|
5624
5690
|
layer: "continueIndicator",
|
|
5625
5691
|
animation: t.continueIndicator,
|
|
5626
5692
|
target: r.targets.continueIndicator,
|
|
5627
|
-
imageResolver:
|
|
5693
|
+
imageResolver: Qa(n),
|
|
5628
5694
|
scheduler: i,
|
|
5629
5695
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
5630
5696
|
});
|
|
5631
5697
|
}, _ = o.get(s.actorKey);
|
|
5632
5698
|
_ && await _.close();
|
|
5633
|
-
let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ?
|
|
5699
|
+
let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? lo(s.content, w, u.textStyle, r) : Object.freeze([s.content]), E = w ? Math.min(1, T.length) : 1, D, O = 0;
|
|
5634
5700
|
try {
|
|
5635
|
-
v =
|
|
5701
|
+
v = io(await e.createSurface(Object.freeze({
|
|
5636
5702
|
actor: s.actor,
|
|
5637
5703
|
actorKey: s.actorKey,
|
|
5638
5704
|
kind: s.kind,
|
|
5639
5705
|
style: u
|
|
5640
5706
|
})), u);
|
|
5641
5707
|
let t = (e, t, n) => {
|
|
5642
|
-
|
|
5708
|
+
co(r)({
|
|
5643
5709
|
runs: e,
|
|
5644
5710
|
styleName: t.textStyle,
|
|
5645
5711
|
target: n,
|
|
5646
5712
|
...t.maxWidth === void 0 ? {} : { maxWidth: t.maxWidth }
|
|
5647
5713
|
}), y = !0;
|
|
5648
|
-
}, a = () => !
|
|
5714
|
+
}, a = () => !oa(d), c = async (e, n = u) => {
|
|
5649
5715
|
if (a()) {
|
|
5650
5716
|
if (!v) return;
|
|
5651
5717
|
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.");
|
|
5652
5718
|
t(e, n, v.targets.text);
|
|
5653
5719
|
return;
|
|
5654
5720
|
}
|
|
5655
|
-
let i =
|
|
5721
|
+
let i = sa(e);
|
|
5656
5722
|
if (n.layoutProfile === "scratch-default" && v?.renderScratchText) {
|
|
5657
|
-
let e =
|
|
5723
|
+
let e = ka(i, (e) => typeof r.measureText == "function" ? r.measureText({
|
|
5658
5724
|
styleName: n.textStyle,
|
|
5659
5725
|
text: e
|
|
5660
5726
|
}) : NaN);
|
|
@@ -5664,19 +5730,19 @@ function ao(e) {
|
|
|
5664
5730
|
v && (r.setText({
|
|
5665
5731
|
styleName: n.textStyle,
|
|
5666
5732
|
target: v.targets.text,
|
|
5667
|
-
text:
|
|
5733
|
+
text: uo(i, n, r)
|
|
5668
5734
|
}), y = !0);
|
|
5669
5735
|
}, l = (e, n = u) => {
|
|
5670
5736
|
v && (a() ? t(e, n, v.targets.text) : (r.setText({
|
|
5671
5737
|
styleName: n.textStyle,
|
|
5672
5738
|
target: v.targets.text,
|
|
5673
|
-
text:
|
|
5739
|
+
text: uo(sa(e), n, r)
|
|
5674
5740
|
}), y = !0), v.captureTextLayout?.());
|
|
5675
5741
|
};
|
|
5676
|
-
w?.layout === "RESERVED" && l(s.content), await c(w ?
|
|
5742
|
+
w?.layout === "RESERVED" && l(s.content), await c(w ? ya(T, E) : s.content), await h(u, p, v), g(u, p, v);
|
|
5677
5743
|
let _ = "idle", k = !1, A = Promise.resolve(), j = async () => {
|
|
5678
5744
|
if (!v) return;
|
|
5679
|
-
let e = w ?
|
|
5745
|
+
let e = w ? ya(T, E) : d;
|
|
5680
5746
|
await c(e), await v.show();
|
|
5681
5747
|
}, M = () => {
|
|
5682
5748
|
O += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
|
|
@@ -5705,37 +5771,37 @@ function ao(e) {
|
|
|
5705
5771
|
if (k) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
5706
5772
|
let t;
|
|
5707
5773
|
try {
|
|
5708
|
-
t =
|
|
5774
|
+
t = aa(e);
|
|
5709
5775
|
} catch (e) {
|
|
5710
5776
|
return Promise.reject(new Q("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble text is invalid."));
|
|
5711
5777
|
}
|
|
5712
5778
|
return A = A.then(async () => {
|
|
5713
|
-
v && (M(), d = t, w ? (T =
|
|
5779
|
+
v && (M(), d = t, w ? (T = lo(t, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && l(t), await j(), P()) : await j());
|
|
5714
5780
|
}), A;
|
|
5715
5781
|
},
|
|
5716
5782
|
updateStyle(e) {
|
|
5717
5783
|
if (k) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
5718
5784
|
let t;
|
|
5719
5785
|
try {
|
|
5720
|
-
t =
|
|
5786
|
+
t = Ya(e);
|
|
5721
5787
|
} catch (e) {
|
|
5722
5788
|
return Promise.reject(e);
|
|
5723
5789
|
}
|
|
5724
5790
|
return A = A.then(async () => {
|
|
5725
5791
|
if (!v) return;
|
|
5726
|
-
|
|
5792
|
+
io(v, t);
|
|
5727
5793
|
let e = f(t);
|
|
5728
5794
|
for (let e of [
|
|
5729
5795
|
t.audio?.voice,
|
|
5730
5796
|
t.audio?.reveal,
|
|
5731
5797
|
t.audio?.finish,
|
|
5732
5798
|
t.reveal?.sound
|
|
5733
|
-
]) e !== void 0 &&
|
|
5799
|
+
]) e !== void 0 && oo(n, e);
|
|
5734
5800
|
await Promise.all([
|
|
5735
5801
|
x?.stop(),
|
|
5736
5802
|
S?.stop(),
|
|
5737
5803
|
C?.stop()
|
|
5738
|
-
]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ?
|
|
5804
|
+
]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? lo(d, w, t.textStyle, r) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, M(), w?.layout === "RESERVED" && l(d, t), await c(d, t), g(t, e, v), await Promise.all([
|
|
5739
5805
|
v.setLayerVisible("portraitBase", t.portrait !== void 0),
|
|
5740
5806
|
v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
|
|
5741
5807
|
v.setLayerVisible("portraitLipSync", !1),
|
|
@@ -5746,7 +5812,7 @@ function ao(e) {
|
|
|
5746
5812
|
}), A;
|
|
5747
5813
|
},
|
|
5748
5814
|
setAnimationMode(e) {
|
|
5749
|
-
return k ? Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) :
|
|
5815
|
+
return k ? Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : Ra.has(e) ? (A = A.then(() => F(e)), A) : Promise.reject(new Q("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
|
|
5750
5816
|
},
|
|
5751
5817
|
revealNext() {
|
|
5752
5818
|
if (k) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
@@ -5764,10 +5830,10 @@ function ao(e) {
|
|
|
5764
5830
|
if (k) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
5765
5831
|
let t = e.timeoutSeconds ?? 0;
|
|
5766
5832
|
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.")) : (A = A.then(async () => {
|
|
5767
|
-
if (M(), e.unit !== void 0 && (w =
|
|
5833
|
+
if (M(), e.unit !== void 0 && (w = fa({
|
|
5768
5834
|
...w ?? {},
|
|
5769
5835
|
unit: e.unit
|
|
5770
|
-
}), T =
|
|
5836
|
+
}), T = lo(d, w, u.textStyle, r), E = Math.min(1, T.length), w.layout === "RESERVED" && v && l(d)), w) for (; await N(););
|
|
5771
5837
|
let n = e.condition;
|
|
5772
5838
|
if (n === void 0 && t === 0) {
|
|
5773
5839
|
await m(u.audio?.finish);
|
|
@@ -5800,7 +5866,7 @@ function ao(e) {
|
|
|
5800
5866
|
if (k) return Promise.reject(new Q("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
5801
5867
|
let t;
|
|
5802
5868
|
try {
|
|
5803
|
-
t =
|
|
5869
|
+
t = qa(e, "Bubble motion");
|
|
5804
5870
|
} catch (e) {
|
|
5805
5871
|
return Promise.reject(e);
|
|
5806
5872
|
}
|
|
@@ -5846,7 +5912,7 @@ function ao(e) {
|
|
|
5846
5912
|
} catch (t) {
|
|
5847
5913
|
e.push(t);
|
|
5848
5914
|
}
|
|
5849
|
-
o.get(s.actorKey) === I && o.delete(s.actorKey),
|
|
5915
|
+
o.get(s.actorKey) === I && o.delete(s.actorKey), fo(e, `Failed to close bubble: ${s.actorKey}`);
|
|
5850
5916
|
}
|
|
5851
5917
|
});
|
|
5852
5918
|
return o.set(s.actorKey, I), P(), u.showAnimation !== void 0 && await I.animate(u.showAnimation), I;
|
|
@@ -5878,85 +5944,85 @@ function ao(e) {
|
|
|
5878
5944
|
return Object.freeze({
|
|
5879
5945
|
defineStyle(e) {
|
|
5880
5946
|
l();
|
|
5881
|
-
let t =
|
|
5947
|
+
let t = Ya(e);
|
|
5882
5948
|
a.set(t.name, t);
|
|
5883
5949
|
},
|
|
5884
5950
|
hasActiveBubble(e) {
|
|
5885
|
-
return o.has(
|
|
5951
|
+
return o.has(Ua(e, "Bubble actor key"));
|
|
5886
5952
|
},
|
|
5887
5953
|
async show(e) {
|
|
5888
5954
|
l();
|
|
5889
|
-
let t =
|
|
5955
|
+
let t = mo(e);
|
|
5890
5956
|
return u(t.actorKey, () => d(t));
|
|
5891
5957
|
},
|
|
5892
5958
|
releaseTarget(e) {
|
|
5893
5959
|
l();
|
|
5894
|
-
let t =
|
|
5960
|
+
let t = Ua(e, "Bubble actor key");
|
|
5895
5961
|
return u(t, async () => {
|
|
5896
5962
|
await o.get(t)?.close();
|
|
5897
5963
|
});
|
|
5898
5964
|
},
|
|
5899
5965
|
async releaseAll() {
|
|
5900
|
-
l(), await Promise.allSettled([...s.values()]),
|
|
5966
|
+
l(), await Promise.allSettled([...s.values()]), fo((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
|
|
5901
5967
|
},
|
|
5902
5968
|
async dispose() {
|
|
5903
5969
|
if (c) return;
|
|
5904
5970
|
c = !0, await Promise.allSettled([...s.values()]);
|
|
5905
5971
|
let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
|
|
5906
|
-
a.clear(),
|
|
5972
|
+
a.clear(), fo(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
|
|
5907
5973
|
}
|
|
5908
5974
|
});
|
|
5909
5975
|
}
|
|
5910
5976
|
//#endregion
|
|
5911
5977
|
//#region src/turbowarp-svg-text-adapter.ts
|
|
5912
|
-
function
|
|
5978
|
+
function go(e) {
|
|
5913
5979
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
5914
5980
|
}
|
|
5915
|
-
function
|
|
5916
|
-
if (!
|
|
5981
|
+
function _o(e) {
|
|
5982
|
+
if (!go(e) || typeof e.setText != "function" || typeof e.releaseTextActor != "function") throw TypeError("TurboWarp-SVG-Text adapter requires setText and releaseTextActor.");
|
|
5917
5983
|
return e;
|
|
5918
5984
|
}
|
|
5919
|
-
function
|
|
5920
|
-
if (!
|
|
5985
|
+
function vo(e) {
|
|
5986
|
+
if (!go(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("SVG Text composition adapter requires setText and releaseTarget.");
|
|
5921
5987
|
return e;
|
|
5922
5988
|
}
|
|
5923
|
-
function
|
|
5924
|
-
if (!
|
|
5989
|
+
function yo(e) {
|
|
5990
|
+
if (!go(e) || typeof e.layoutText != "function") throw TypeError("SVG Text overlay adapter requires the layoutText composition API.");
|
|
5925
5991
|
return e;
|
|
5926
5992
|
}
|
|
5927
|
-
function
|
|
5993
|
+
function bo(e, t) {
|
|
5928
5994
|
let n = Number(e);
|
|
5929
5995
|
if (!Number.isFinite(n)) throw TypeError(`${t} must be a finite number.`);
|
|
5930
5996
|
return n;
|
|
5931
5997
|
}
|
|
5932
|
-
function
|
|
5933
|
-
if (!
|
|
5998
|
+
function xo(e) {
|
|
5999
|
+
if (!go(e) || !go(e.style) || !Array.isArray(e.lines)) throw TypeError("SVG Text layout result is invalid.");
|
|
5934
6000
|
let t = e.style, n = t.alignment;
|
|
5935
6001
|
if (n !== "left" && n !== "center" && n !== "right") throw TypeError("SVG Text layout alignment is invalid.");
|
|
5936
|
-
let r =
|
|
5937
|
-
if (!
|
|
6002
|
+
let r = bo(e.width, "SVG Text layout width"), i = bo(e.height, "SVG Text layout height"), a = Object.freeze(e.lines.map((e) => {
|
|
6003
|
+
if (!go(e) || typeof e.text != "string") throw TypeError("SVG Text layout line is invalid.");
|
|
5938
6004
|
return Object.freeze({
|
|
5939
|
-
baseline:
|
|
6005
|
+
baseline: bo(e.baseline, "SVG Text line baseline") - i / 2,
|
|
5940
6006
|
text: e.text,
|
|
5941
|
-
x:
|
|
6007
|
+
x: bo(e.x, "SVG Text line x") - r / 2
|
|
5942
6008
|
});
|
|
5943
6009
|
}));
|
|
5944
6010
|
return Object.freeze({
|
|
5945
6011
|
alignment: n,
|
|
5946
6012
|
backgroundColor: String(t.backgroundColor),
|
|
5947
|
-
backgroundCornerRadius:
|
|
6013
|
+
backgroundCornerRadius: bo(t.cornerRadius, "SVG Text corner radius"),
|
|
5948
6014
|
fill: String(t.textColor),
|
|
5949
6015
|
fontFamily: String(t.font),
|
|
5950
|
-
fontSize:
|
|
6016
|
+
fontSize: bo(t.fontSize, "SVG Text font size"),
|
|
5951
6017
|
height: i,
|
|
5952
|
-
lineHeight:
|
|
6018
|
+
lineHeight: bo(t.lineHeight, "SVG Text line height"),
|
|
5953
6019
|
lines: a,
|
|
5954
6020
|
preserveWhitespace: e.preserveWhitespace !== !1,
|
|
5955
6021
|
width: r
|
|
5956
6022
|
});
|
|
5957
6023
|
}
|
|
5958
|
-
function
|
|
5959
|
-
let t =
|
|
6024
|
+
function So(e) {
|
|
6025
|
+
let t = _o(e);
|
|
5960
6026
|
return Object.freeze({
|
|
5961
6027
|
setText({ styleName: e, target: n, text: r }) {
|
|
5962
6028
|
t.setText({
|
|
@@ -5973,8 +6039,8 @@ function po(e) {
|
|
|
5973
6039
|
}
|
|
5974
6040
|
});
|
|
5975
6041
|
}
|
|
5976
|
-
function
|
|
5977
|
-
let t =
|
|
6042
|
+
function Co(e) {
|
|
6043
|
+
let t = vo(e), n = {
|
|
5978
6044
|
setText({ styleName: e, target: n, text: r }) {
|
|
5979
6045
|
t.setText({
|
|
5980
6046
|
styleName: e,
|
|
@@ -6002,11 +6068,11 @@ function mo(e) {
|
|
|
6002
6068
|
...e === void 0 ? {} : { maxWidth: e }
|
|
6003
6069
|
}) ?? 0), Object.freeze(n);
|
|
6004
6070
|
}
|
|
6005
|
-
function
|
|
6006
|
-
let t =
|
|
6071
|
+
function wo(e) {
|
|
6072
|
+
let t = yo(e);
|
|
6007
6073
|
return Object.freeze({
|
|
6008
6074
|
layoutText({ nativeSize: e, styleName: n, text: r }) {
|
|
6009
|
-
return
|
|
6075
|
+
return xo(t.layoutText({
|
|
6010
6076
|
nativeSize: [e.width, e.height],
|
|
6011
6077
|
styleName: n,
|
|
6012
6078
|
text: r
|
|
@@ -6018,17 +6084,17 @@ function ho(e) {
|
|
|
6018
6084
|
styleName: n,
|
|
6019
6085
|
text: r
|
|
6020
6086
|
});
|
|
6021
|
-
return Math.max(1, ...i.lines.map((e) =>
|
|
6087
|
+
return Math.max(1, ...i.lines.map((e) => bo(e.width, "SVG Text line width")));
|
|
6022
6088
|
}
|
|
6023
6089
|
});
|
|
6024
6090
|
}
|
|
6025
|
-
function
|
|
6026
|
-
if (!
|
|
6027
|
-
return
|
|
6091
|
+
function To(e) {
|
|
6092
|
+
if (!go(e) || typeof e.getLayoutCapability != "function") throw TypeError("TurboWarp-SVG-Text overlay adapter requires SVG Text 0.8.1 getLayoutCapability().");
|
|
6093
|
+
return wo(e.getLayoutCapability());
|
|
6028
6094
|
}
|
|
6029
6095
|
//#endregion
|
|
6030
6096
|
//#region src/asset-manager-image-adapter.ts
|
|
6031
|
-
var
|
|
6097
|
+
var Eo = /* @__PURE__ */ new Set([
|
|
6032
6098
|
"image/avif",
|
|
6033
6099
|
"image/gif",
|
|
6034
6100
|
"image/jpeg",
|
|
@@ -6036,37 +6102,37 @@ var _o = /* @__PURE__ */ new Set([
|
|
|
6036
6102
|
"image/svg+xml",
|
|
6037
6103
|
"image/webp"
|
|
6038
6104
|
]);
|
|
6039
|
-
function
|
|
6105
|
+
function Do(e) {
|
|
6040
6106
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
6041
6107
|
}
|
|
6042
|
-
function
|
|
6108
|
+
function Oo(e) {
|
|
6043
6109
|
let t = e.split(";", 1)[0]?.trim().toLowerCase() ?? "";
|
|
6044
6110
|
return t === "image/jpg" || t === "image/pjpeg" ? "image/jpeg" : t === "image/x-png" ? "image/png" : t;
|
|
6045
6111
|
}
|
|
6046
|
-
function
|
|
6047
|
-
return
|
|
6112
|
+
function ko(e) {
|
|
6113
|
+
return Eo.has(Oo(e));
|
|
6048
6114
|
}
|
|
6049
|
-
function
|
|
6050
|
-
if (!
|
|
6115
|
+
function Ao(e) {
|
|
6116
|
+
if (!Do(e) || typeof e.url != "string" || !e.url.startsWith("blob:") || typeof e.mimeType != "string" || !ko(e.mimeType) || typeof e.width != "number" || !Number.isFinite(e.width) || e.width <= 0 || typeof e.height != "number" || !Number.isFinite(e.height) || e.height <= 0 || typeof e.release != "function") throw TypeError("Asset Manager DOM image resources must provide a supported MIME type, positive intrinsic dimensions, a blob URL, and release().");
|
|
6051
6117
|
return e;
|
|
6052
6118
|
}
|
|
6053
|
-
function
|
|
6054
|
-
if (!
|
|
6119
|
+
function jo(e) {
|
|
6120
|
+
if (!Do(e) || typeof e.isRegistered != "function" || typeof e.getMimeType != "function" || typeof e.resolveDOMImageResource != "function") throw TypeError("Asset Manager DOM image capability is invalid.");
|
|
6055
6121
|
let t = e;
|
|
6056
6122
|
return Object.freeze({
|
|
6057
6123
|
isRegistered(e) {
|
|
6058
|
-
return t.isRegistered(e) &&
|
|
6124
|
+
return t.isRegistered(e) && ko(t.getMimeType(e));
|
|
6059
6125
|
},
|
|
6060
6126
|
getMimeType(e) {
|
|
6061
|
-
return
|
|
6127
|
+
return Oo(t.getMimeType(e));
|
|
6062
6128
|
},
|
|
6063
6129
|
async resolveImage(e) {
|
|
6064
|
-
let n =
|
|
6065
|
-
if (!t.isRegistered(e) || !
|
|
6130
|
+
let n = Oo(t.getMimeType(e));
|
|
6131
|
+
if (!t.isRegistered(e) || !ko(n)) throw TypeError("Asset Manager image is not registered with a Bubble-compatible MIME type.");
|
|
6066
6132
|
let r = await t.resolveDOMImageResource(e);
|
|
6067
6133
|
try {
|
|
6068
|
-
|
|
6069
|
-
let e =
|
|
6134
|
+
Ao(r);
|
|
6135
|
+
let e = Oo(r.mimeType);
|
|
6070
6136
|
if (e !== n) throw TypeError("Asset Manager DOM image resource MIME type changed during resolution.");
|
|
6071
6137
|
return Object.freeze({
|
|
6072
6138
|
height: r.height,
|
|
@@ -6084,11 +6150,11 @@ function So(e) {
|
|
|
6084
6150
|
}
|
|
6085
6151
|
//#endregion
|
|
6086
6152
|
//#region src/surface-motion.ts
|
|
6087
|
-
function
|
|
6153
|
+
function Mo(e) {
|
|
6088
6154
|
return Math.max(0, Math.min(1, e));
|
|
6089
6155
|
}
|
|
6090
|
-
function
|
|
6091
|
-
let n =
|
|
6156
|
+
function No(e, t) {
|
|
6157
|
+
let n = Mo(e);
|
|
6092
6158
|
switch (t) {
|
|
6093
6159
|
case "linear": return n;
|
|
6094
6160
|
case "easeIn": return n * n;
|
|
@@ -6097,14 +6163,14 @@ function wo(e, t) {
|
|
|
6097
6163
|
default: return n;
|
|
6098
6164
|
}
|
|
6099
6165
|
}
|
|
6100
|
-
function
|
|
6166
|
+
function Po(e, t, n) {
|
|
6101
6167
|
let r = Math.max(0, t * 1e3);
|
|
6102
6168
|
return r === 0 ? (n(1), Promise.resolve()) : new Promise((t, i) => {
|
|
6103
6169
|
let a = 0, o, s = () => {
|
|
6104
6170
|
let c = Math.min(16, r - a);
|
|
6105
6171
|
a += c;
|
|
6106
6172
|
try {
|
|
6107
|
-
n(
|
|
6173
|
+
n(Mo(a / r));
|
|
6108
6174
|
} catch (t) {
|
|
6109
6175
|
o !== void 0 && e.clearTimeout(o), i(t);
|
|
6110
6176
|
return;
|
|
@@ -6120,33 +6186,33 @@ function To(e, t, n) {
|
|
|
6120
6186
|
}
|
|
6121
6187
|
//#endregion
|
|
6122
6188
|
//#region src/svg-overlay-surface.ts
|
|
6123
|
-
var
|
|
6124
|
-
function
|
|
6189
|
+
var Fo = "http://www.w3.org/2000/svg", Io = "http://www.w3.org/XML/1998/namespace", Lo = 96, Ro = 18, zo = 8, Bo = 16, Vo = Symbol("BubbleSvgOverlayTextTarget"), Ho = Symbol("BubbleSvgOverlayImageTarget"), Uo = 0, Wo = Object.freeze(["scratch-render", "svg-overlay"]), Go = "svg-overlay", Ko = "error";
|
|
6190
|
+
function qo(e) {
|
|
6125
6191
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
6126
6192
|
}
|
|
6127
|
-
function
|
|
6193
|
+
function Jo(e) {
|
|
6128
6194
|
let t = e.getNativeSize(), n = Array.isArray(t) ? Number(t[0]) : NaN, r = Array.isArray(t) ? Number(t[1]) : NaN;
|
|
6129
6195
|
return Object.freeze({
|
|
6130
6196
|
width: n > 0 ? n : 480,
|
|
6131
6197
|
height: r > 0 ? r : 360
|
|
6132
6198
|
});
|
|
6133
6199
|
}
|
|
6134
|
-
function
|
|
6200
|
+
function Yo(e, t) {
|
|
6135
6201
|
let n = Number(e);
|
|
6136
6202
|
if (!Number.isFinite(n) || n <= 0) throw TypeError(`${t} must be a positive finite number.`);
|
|
6137
6203
|
return n;
|
|
6138
6204
|
}
|
|
6139
|
-
function
|
|
6205
|
+
function Xo(e, t) {
|
|
6140
6206
|
if (typeof e != "string" || e.length === 0 || e.length > 128) throw TypeError(`${t} must be a non-empty color string.`);
|
|
6141
6207
|
if (/url\s*\(|[<>;]/iu.test(e)) throw TypeError(`${t} contains a disallowed SVG value.`);
|
|
6142
6208
|
return e;
|
|
6143
6209
|
}
|
|
6144
|
-
function
|
|
6210
|
+
function Zo(e) {
|
|
6145
6211
|
if (typeof e != "string" || e.length === 0 || e.length > 256 || /url\s*\(|[<>{};]/iu.test(e)) throw TypeError("SVG overlay fontFamily is invalid.");
|
|
6146
6212
|
return e;
|
|
6147
6213
|
}
|
|
6148
|
-
function
|
|
6149
|
-
if (!
|
|
6214
|
+
function Qo(e) {
|
|
6215
|
+
if (!qo(e) || !Array.isArray(e.lines)) throw TypeError("SVG overlay text layout is invalid.");
|
|
6150
6216
|
let t = e.alignment;
|
|
6151
6217
|
if (t !== "left" && t !== "center" && t !== "right") throw TypeError("SVG overlay text alignment is invalid.");
|
|
6152
6218
|
let n = e.fontStyle;
|
|
@@ -6155,7 +6221,7 @@ function Uo(e) {
|
|
|
6155
6221
|
if (r !== void 0 && r !== "normal" && r !== "bold" && (!Number.isFinite(r) || Number(r) < 1 || Number(r) > 1e3)) throw TypeError("SVG overlay fontWeight is invalid.");
|
|
6156
6222
|
let i = Object.freeze(e.lines.map((e) => {
|
|
6157
6223
|
if (typeof e == "string") return e;
|
|
6158
|
-
if (!
|
|
6224
|
+
if (!qo(e) || typeof e.text != "string") throw TypeError("SVG overlay text lines must be strings or positioned line records.");
|
|
6159
6225
|
let t = e.x !== void 0;
|
|
6160
6226
|
if (t !== (e.baseline !== void 0)) throw TypeError("SVG overlay positioned text lines require both x and baseline.");
|
|
6161
6227
|
if (t && (!Number.isFinite(e.x) || !Number.isFinite(e.baseline))) throw TypeError("SVG overlay text line coordinates must be finite numbers.");
|
|
@@ -6166,19 +6232,19 @@ function Uo(e) {
|
|
|
6166
6232
|
baseline: Number(e.baseline)
|
|
6167
6233
|
} : {}
|
|
6168
6234
|
});
|
|
6169
|
-
})), a = e.backgroundColor === void 0 ? void 0 :
|
|
6235
|
+
})), a = e.backgroundColor === void 0 ? void 0 : Xo(e.backgroundColor, "SVG overlay backgroundColor"), o = e.backgroundCornerRadius === void 0 ? void 0 : Number(e.backgroundCornerRadius);
|
|
6170
6236
|
if (o !== void 0 && (!Number.isFinite(o) || o < 0)) throw TypeError("SVG overlay backgroundCornerRadius must be a non-negative finite number.");
|
|
6171
6237
|
let s = e.preserveWhitespace;
|
|
6172
6238
|
if (s !== void 0 && typeof s != "boolean") throw TypeError("SVG overlay preserveWhitespace must be a boolean.");
|
|
6173
6239
|
return Object.freeze({
|
|
6174
6240
|
alignment: t,
|
|
6175
|
-
fill:
|
|
6176
|
-
fontFamily:
|
|
6177
|
-
fontSize:
|
|
6178
|
-
height:
|
|
6179
|
-
lineHeight:
|
|
6241
|
+
fill: Xo(e.fill, "SVG overlay text fill"),
|
|
6242
|
+
fontFamily: Zo(e.fontFamily),
|
|
6243
|
+
fontSize: Yo(e.fontSize, "SVG overlay fontSize"),
|
|
6244
|
+
height: Yo(e.height, "SVG overlay text height"),
|
|
6245
|
+
lineHeight: Yo(e.lineHeight, "SVG overlay lineHeight"),
|
|
6180
6246
|
lines: i,
|
|
6181
|
-
width:
|
|
6247
|
+
width: Yo(e.width, "SVG overlay text width"),
|
|
6182
6248
|
...a === void 0 ? {} : { backgroundColor: a },
|
|
6183
6249
|
...o === void 0 ? {} : { backgroundCornerRadius: o },
|
|
6184
6250
|
...n === void 0 ? {} : { fontStyle: n },
|
|
@@ -6186,21 +6252,21 @@ function Uo(e) {
|
|
|
6186
6252
|
...s === void 0 ? {} : { preserveWhitespace: s }
|
|
6187
6253
|
});
|
|
6188
6254
|
}
|
|
6189
|
-
function
|
|
6255
|
+
function $o(e, t) {
|
|
6190
6256
|
let n = {
|
|
6191
6257
|
width: 180,
|
|
6192
6258
|
height: 48
|
|
6193
6259
|
}, r, i, a, o = (r) => {
|
|
6194
|
-
let i =
|
|
6260
|
+
let i = Qo(r), a = [];
|
|
6195
6261
|
if (i.backgroundColor !== void 0 && i.backgroundColor !== "transparent") {
|
|
6196
|
-
let t = e.createElementNS(
|
|
6262
|
+
let t = e.createElementNS(Fo, "rect");
|
|
6197
6263
|
t.setAttribute("x", String(-i.width / 2)), t.setAttribute("y", String(-i.height / 2)), t.setAttribute("width", String(i.width)), t.setAttribute("height", String(i.height)), t.setAttribute("fill", i.backgroundColor), i.backgroundCornerRadius !== void 0 && t.setAttribute("rx", String(i.backgroundCornerRadius)), a.push(t);
|
|
6198
6264
|
}
|
|
6199
|
-
let o = e.createElementNS(
|
|
6200
|
-
o.setAttribute("text-anchor", s), o.setAttribute("fill", i.fill), o.setAttribute("font-family", i.fontFamily), o.setAttribute("font-size", String(i.fontSize)), i.preserveWhitespace !== !1 && o.setAttributeNS(
|
|
6265
|
+
let o = e.createElementNS(Fo, "text"), s = i.alignment === "left" ? "start" : i.alignment === "right" ? "end" : "middle", c = i.alignment === "left" ? -i.width / 2 : i.alignment === "right" ? i.width / 2 : 0;
|
|
6266
|
+
o.setAttribute("text-anchor", s), o.setAttribute("fill", i.fill), o.setAttribute("font-family", i.fontFamily), o.setAttribute("font-size", String(i.fontSize)), i.preserveWhitespace !== !1 && o.setAttributeNS(Io, "xml:space", "preserve"), i.fontStyle !== void 0 && o.setAttribute("font-style", i.fontStyle), i.fontWeight !== void 0 && o.setAttribute("font-weight", String(i.fontWeight));
|
|
6201
6267
|
let l = -Math.max(i.fontSize, (i.lines.length - 1) * i.lineHeight + i.fontSize) / 2 + i.fontSize;
|
|
6202
6268
|
i.lines.forEach((t, n) => {
|
|
6203
|
-
let r = e.createElementNS(
|
|
6269
|
+
let r = e.createElementNS(Fo, "tspan"), a = typeof t == "string" ? void 0 : t;
|
|
6204
6270
|
r.setAttribute("x", String(a?.x ?? c)), r.setAttribute("y", String(a?.baseline ?? l + n * i.lineHeight)), r.textContent = typeof t == "string" ? t : t.text, o.appendChild(r);
|
|
6205
6271
|
}), a.push(o), t.replaceChildren(...a), n = {
|
|
6206
6272
|
width: i.width,
|
|
@@ -6208,7 +6274,7 @@ function Wo(e, t) {
|
|
|
6208
6274
|
};
|
|
6209
6275
|
};
|
|
6210
6276
|
return Object.freeze({
|
|
6211
|
-
[
|
|
6277
|
+
[Vo]: !0,
|
|
6212
6278
|
group: t,
|
|
6213
6279
|
captureLayout() {
|
|
6214
6280
|
i = r, a = { ...n };
|
|
@@ -6230,7 +6296,7 @@ function Wo(e, t) {
|
|
|
6230
6296
|
},
|
|
6231
6297
|
refresh() {
|
|
6232
6298
|
if (i !== void 0) {
|
|
6233
|
-
let e =
|
|
6299
|
+
let e = Qo(i());
|
|
6234
6300
|
a = {
|
|
6235
6301
|
width: e.width,
|
|
6236
6302
|
height: e.height
|
|
@@ -6243,29 +6309,29 @@ function Wo(e, t) {
|
|
|
6243
6309
|
}
|
|
6244
6310
|
});
|
|
6245
6311
|
}
|
|
6246
|
-
function
|
|
6312
|
+
function es(e) {
|
|
6247
6313
|
let t = e;
|
|
6248
|
-
if (t?.[
|
|
6314
|
+
if (t?.[Vo] !== !0) throw TypeError("SVG overlay text target is invalid.");
|
|
6249
6315
|
return t;
|
|
6250
6316
|
}
|
|
6251
|
-
function
|
|
6252
|
-
if (!
|
|
6317
|
+
function ts(e, t) {
|
|
6318
|
+
if (!qo(e) || typeof e.layoutText != "function") throw TypeError("SVG overlay backend requires a text layout capability.");
|
|
6253
6319
|
let n = e;
|
|
6254
6320
|
return Object.freeze({
|
|
6255
6321
|
setText({ styleName: e, target: r, text: i }) {
|
|
6256
|
-
let a =
|
|
6257
|
-
nativeSize:
|
|
6322
|
+
let a = es(r), o = () => n.layoutText({
|
|
6323
|
+
nativeSize: Jo(t),
|
|
6258
6324
|
styleName: e,
|
|
6259
6325
|
text: i
|
|
6260
6326
|
});
|
|
6261
6327
|
a.render(o(), o);
|
|
6262
6328
|
},
|
|
6263
6329
|
releaseTarget(e) {
|
|
6264
|
-
|
|
6330
|
+
es(e).clear();
|
|
6265
6331
|
},
|
|
6266
6332
|
measureText({ styleName: e, text: r }) {
|
|
6267
|
-
let i =
|
|
6268
|
-
return
|
|
6333
|
+
let i = Jo(t);
|
|
6334
|
+
return Yo(n.measureText?.({
|
|
6269
6335
|
nativeSize: i,
|
|
6270
6336
|
styleName: e,
|
|
6271
6337
|
text: r
|
|
@@ -6277,7 +6343,7 @@ function Ko(e, t) {
|
|
|
6277
6343
|
}
|
|
6278
6344
|
});
|
|
6279
6345
|
}
|
|
6280
|
-
function
|
|
6346
|
+
function ns(e) {
|
|
6281
6347
|
return !(/* @__PURE__ */ new Set([
|
|
6282
6348
|
"image/avif",
|
|
6283
6349
|
"image/gif",
|
|
@@ -6287,11 +6353,11 @@ function qo(e) {
|
|
|
6287
6353
|
"image/webp"
|
|
6288
6354
|
])).has(e.mimeType.toLowerCase()) || e.mimeType.toLowerCase() === "image/svg+xml" && e.svgSecurity !== "sanitized" ? !1 : e.src.startsWith("blob:") ? typeof e.release == "function" : /^data:image\/(?:avif|gif|jpeg|png|webp);base64,/iu.test(e.src);
|
|
6289
6355
|
}
|
|
6290
|
-
async function
|
|
6356
|
+
async function rs(e) {
|
|
6291
6357
|
await e?.release?.();
|
|
6292
6358
|
}
|
|
6293
|
-
function
|
|
6294
|
-
let r = e.createElementNS(
|
|
6359
|
+
function is(e, t, n) {
|
|
6360
|
+
let r = e.createElementNS(Fo, "image");
|
|
6295
6361
|
r.setAttribute("preserveAspectRatio", "xMidYMid meet"), n.appendChild(r);
|
|
6296
6362
|
let i, a = {
|
|
6297
6363
|
width: 1,
|
|
@@ -6302,22 +6368,22 @@ function Yo(e, t, n) {
|
|
|
6302
6368
|
return s(), Object.freeze({
|
|
6303
6369
|
id: t,
|
|
6304
6370
|
isStage: !1,
|
|
6305
|
-
[
|
|
6371
|
+
[Ho]: !0,
|
|
6306
6372
|
group: n,
|
|
6307
6373
|
async applyResource(e) {
|
|
6308
6374
|
let t = o + 1;
|
|
6309
6375
|
o = t;
|
|
6310
6376
|
try {
|
|
6311
|
-
if (
|
|
6377
|
+
if (Yo(e.width, "SVG overlay image width"), Yo(e.height, "SVG overlay image height"), typeof e.mimeType != "string" || !e.mimeType.startsWith("image/") || typeof e.src != "string" || !ns(e)) throw TypeError("SVG overlay image resources must use a supported MIME type, a releasable blob URL or approved raster data URL, and sanitized SVG metadata when applicable.");
|
|
6312
6378
|
} catch (t) {
|
|
6313
|
-
throw await
|
|
6379
|
+
throw await rs(e), t;
|
|
6314
6380
|
}
|
|
6315
6381
|
if (t !== o) {
|
|
6316
|
-
await
|
|
6382
|
+
await rs(e);
|
|
6317
6383
|
return;
|
|
6318
6384
|
}
|
|
6319
6385
|
let n = i;
|
|
6320
|
-
i = e, r.setAttribute("href", e.src), await
|
|
6386
|
+
i = e, r.setAttribute("href", e.src), await rs(n);
|
|
6321
6387
|
},
|
|
6322
6388
|
getSize() {
|
|
6323
6389
|
return i ? {
|
|
@@ -6331,7 +6397,7 @@ function Yo(e, t, n) {
|
|
|
6331
6397
|
async release() {
|
|
6332
6398
|
o += 1;
|
|
6333
6399
|
let e = i;
|
|
6334
|
-
i = void 0, r.removeAttribute("href"), await
|
|
6400
|
+
i = void 0, r.removeAttribute("href"), await rs(e);
|
|
6335
6401
|
},
|
|
6336
6402
|
setDisplaySize(e) {
|
|
6337
6403
|
a = e, s();
|
|
@@ -6341,13 +6407,13 @@ function Yo(e, t, n) {
|
|
|
6341
6407
|
}
|
|
6342
6408
|
});
|
|
6343
6409
|
}
|
|
6344
|
-
function
|
|
6410
|
+
function as(e) {
|
|
6345
6411
|
let t = e;
|
|
6346
|
-
if (t?.[
|
|
6412
|
+
if (t?.[Ho] !== !0) throw TypeError("SVG overlay image target is invalid.");
|
|
6347
6413
|
return t;
|
|
6348
6414
|
}
|
|
6349
|
-
function
|
|
6350
|
-
if (!
|
|
6415
|
+
function os(e) {
|
|
6416
|
+
if (!qo(e) || typeof e.isRegistered != "function" || typeof e.getMimeType != "function" || typeof e.resolveImage != "function") throw TypeError("SVG overlay image capability is invalid.");
|
|
6351
6417
|
let t = e;
|
|
6352
6418
|
return Object.freeze({
|
|
6353
6419
|
isRegistered(e) {
|
|
@@ -6357,15 +6423,15 @@ function Zo(e) {
|
|
|
6357
6423
|
return t.getMimeType(e);
|
|
6358
6424
|
},
|
|
6359
6425
|
async applyToTarget(e, n) {
|
|
6360
|
-
await
|
|
6426
|
+
await as(n).applyResource(await t.resolveImage(e));
|
|
6361
6427
|
}
|
|
6362
6428
|
});
|
|
6363
6429
|
}
|
|
6364
|
-
function
|
|
6365
|
-
let n = t.createElementNS(
|
|
6366
|
-
n.setAttribute("xmlns",
|
|
6430
|
+
function ss(e, t) {
|
|
6431
|
+
let n = t.createElementNS(Fo, "svg");
|
|
6432
|
+
n.setAttribute("xmlns", Fo), n.setAttribute("aria-hidden", "true"), n.setAttribute("focusable", "false"), n.setAttribute("data-bubble-render-backend", "svg-overlay"), n.style.display = "block", n.style.overflow = "hidden", n.style.pointerEvents = "none";
|
|
6367
6433
|
let r = /* @__PURE__ */ new Set(), i = !1, a = () => {
|
|
6368
|
-
let t =
|
|
6434
|
+
let t = Jo(e);
|
|
6369
6435
|
return n.setAttribute("width", String(t.width)), n.setAttribute("height", String(t.height)), n.setAttribute("viewBox", `0 0 ${t.width} ${t.height}`), t;
|
|
6370
6436
|
};
|
|
6371
6437
|
return Object.freeze({
|
|
@@ -6387,7 +6453,7 @@ function Qo(e, t) {
|
|
|
6387
6453
|
updateNativeSize: a
|
|
6388
6454
|
});
|
|
6389
6455
|
}
|
|
6390
|
-
function
|
|
6456
|
+
function cs(e) {
|
|
6391
6457
|
try {
|
|
6392
6458
|
let t = e.getBoundsForBubble?.();
|
|
6393
6459
|
if (t && [
|
|
@@ -6405,21 +6471,21 @@ function $o(e) {
|
|
|
6405
6471
|
top: n
|
|
6406
6472
|
};
|
|
6407
6473
|
}
|
|
6408
|
-
function
|
|
6474
|
+
function ls(e, t, n) {
|
|
6409
6475
|
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
6410
6476
|
}
|
|
6411
|
-
function
|
|
6477
|
+
function us(e) {
|
|
6412
6478
|
let t = Ze(e);
|
|
6413
6479
|
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
6414
6480
|
}
|
|
6415
|
-
var
|
|
6481
|
+
var ds = /* @__PURE__ */ new Set([
|
|
6416
6482
|
"circle",
|
|
6417
6483
|
"g",
|
|
6418
6484
|
"path",
|
|
6419
6485
|
"rect",
|
|
6420
6486
|
"text",
|
|
6421
6487
|
"title"
|
|
6422
|
-
]),
|
|
6488
|
+
]), fs = /* @__PURE__ */ new Set([
|
|
6423
6489
|
"cx",
|
|
6424
6490
|
"cy",
|
|
6425
6491
|
"d",
|
|
@@ -6444,46 +6510,46 @@ var ns = /* @__PURE__ */ new Set([
|
|
|
6444
6510
|
"x",
|
|
6445
6511
|
"y"
|
|
6446
6512
|
]);
|
|
6447
|
-
function
|
|
6513
|
+
function ps(e, t) {
|
|
6448
6514
|
let n = e.localName;
|
|
6449
|
-
if (!
|
|
6450
|
-
let r = t.createElementNS(
|
|
6515
|
+
if (!ds.has(n)) throw TypeError(`Bubble body SVG element is not allowed: ${n}`);
|
|
6516
|
+
let r = t.createElementNS(Fo, n);
|
|
6451
6517
|
for (let t of e.getAttributeNames()) {
|
|
6452
|
-
if (!
|
|
6518
|
+
if (!fs.has(t)) throw TypeError(`Bubble body SVG attribute is not allowed: ${t}`);
|
|
6453
6519
|
let n = e.getAttribute(t) ?? "";
|
|
6454
6520
|
if (/javascript:|url\s*\(/iu.test(n)) throw TypeError("Bubble body SVG contains an unsafe attribute value.");
|
|
6455
6521
|
r.setAttribute(t, n);
|
|
6456
6522
|
}
|
|
6457
6523
|
(n === "title" || n === "text") && (r.textContent = e.textContent ?? "");
|
|
6458
|
-
for (let n of Array.from(e.children)) r.appendChild(
|
|
6524
|
+
for (let n of Array.from(e.children)) r.appendChild(ps(n, t));
|
|
6459
6525
|
return r;
|
|
6460
6526
|
}
|
|
6461
|
-
function
|
|
6527
|
+
function ms(e, t, n) {
|
|
6462
6528
|
let r = n.defaultView?.DOMParser;
|
|
6463
6529
|
if (!r) throw TypeError("SVG overlay backend requires DOMParser.");
|
|
6464
6530
|
let i = new r().parseFromString(t, "image/svg+xml");
|
|
6465
6531
|
if (i.querySelector("parsererror")) throw TypeError("Canonical Bubble body SVG could not be parsed.");
|
|
6466
|
-
let a = Array.from(i.documentElement.children).map((e) =>
|
|
6532
|
+
let a = Array.from(i.documentElement.children).map((e) => ps(e, n));
|
|
6467
6533
|
e.replaceChildren(...a);
|
|
6468
6534
|
}
|
|
6469
|
-
function
|
|
6535
|
+
function hs(e, t, n = 1) {
|
|
6470
6536
|
let r = e.getSize(), i = Math.min(t / r.width, t / r.height), a = {
|
|
6471
6537
|
width: r.width * i * n,
|
|
6472
6538
|
height: r.height * i * n
|
|
6473
6539
|
};
|
|
6474
6540
|
return e.setDisplaySize(a), a;
|
|
6475
6541
|
}
|
|
6476
|
-
function
|
|
6477
|
-
let { document: o, renderer: s } = e, c =
|
|
6478
|
-
|
|
6479
|
-
let l = o.createElementNS(
|
|
6542
|
+
function gs(e, t, n, r, i, a) {
|
|
6543
|
+
let { document: o, renderer: s } = e, c = Uo;
|
|
6544
|
+
Uo += 1;
|
|
6545
|
+
let l = o.createElementNS(Fo, "g");
|
|
6480
6546
|
l.setAttribute("data-bubble-surface", `${n}:${c}`);
|
|
6481
|
-
let u = o.createElementNS(
|
|
6547
|
+
let u = o.createElementNS(Fo, "g");
|
|
6482
6548
|
u.setAttribute("data-bubble-layer", "body"), l.appendChild(u);
|
|
6483
6549
|
let d = (e) => {
|
|
6484
|
-
let t = o.createElementNS(
|
|
6550
|
+
let t = o.createElementNS(Fo, "g");
|
|
6485
6551
|
return t.setAttribute("data-bubble-layer", e), t.setAttribute("visibility", "hidden"), l.appendChild(t), t;
|
|
6486
|
-
}, f =
|
|
6552
|
+
}, f = is(o, `bubble:${n}:${c}:portrait-base`, d("portrait-base")), p = is(o, `bubble:${n}:${c}:portrait-blink`, d("portrait-blink")), m = is(o, `bubble:${n}:${c}:portrait-lip-sync`, d("portrait-lip-sync")), h = d("text"), g = $o(o, h), _ = is(o, `bubble:${n}:${c}:continue-indicator`, d("continue-indicator")), v = Object.freeze({
|
|
6487
6553
|
text: g,
|
|
6488
6554
|
portraitBase: f,
|
|
6489
6555
|
portraitBlink: p,
|
|
@@ -6494,22 +6560,22 @@ function ss(e, t, n, r, i, a) {
|
|
|
6494
6560
|
["portraitBlink", p],
|
|
6495
6561
|
["portraitLipSync", m],
|
|
6496
6562
|
["continueIndicator", _]
|
|
6497
|
-
]), b = /* @__PURE__ */ new Map(), x = `bubble-portrait-clip-${c}`, S = o.createElementNS(
|
|
6563
|
+
]), b = /* @__PURE__ */ new Map(), x = `bubble-portrait-clip-${c}`, S = o.createElementNS(Fo, "defs"), C = o.createElementNS(Fo, "clipPath"), w = o.createElementNS(Fo, "rect");
|
|
6498
6564
|
C.setAttribute("id", x), C.appendChild(w), S.appendChild(C), l.insertBefore(S, u);
|
|
6499
6565
|
let T = i, E = !1, D = !1, O = "", k = [0, 0], A = 1, j = 1, M = [0, 0], N, P, F = !1, I = (t = e.updateNativeSize()) => {
|
|
6500
6566
|
let n = t.width / 2 + M[0], r = t.height / 2 - M[1], i = n + k[0], a = r - k[1];
|
|
6501
6567
|
l.setAttribute("transform", `translate(${i} ${a}) scale(${A}) translate(${-n} ${-r})`), l.setAttribute("opacity", String(j));
|
|
6502
|
-
},
|
|
6568
|
+
}, L = (e) => e === "continueIndicator" ? T.continueIndicator !== void 0 : e === "portraitBase" ? T.portrait !== void 0 : e === "portraitBlink" ? T.portrait?.blink !== void 0 : T.portrait?.lipSync !== void 0, R = (e) => {
|
|
6503
6569
|
let n = T.placement.basis === "background" || t.visible !== !1, r = D && n && j > 0, i = T.layoutProfile === "scratch-default" && P !== void 0;
|
|
6504
6570
|
l.setAttribute("visibility", r ? "visible" : "hidden"), u.setAttribute("visibility", r && (i || T.visualStyle !== "NO_BUBBLE") ? "visible" : "hidden"), h.setAttribute("visibility", r && !i ? "visible" : "hidden");
|
|
6505
|
-
for (let [e, t] of y) t.setVisible(r &&
|
|
6571
|
+
for (let [e, t] of y) t.setVisible(r && L(e) && (b.get(e) ?? !1));
|
|
6506
6572
|
I(e);
|
|
6507
|
-
},
|
|
6573
|
+
}, z = () => {
|
|
6508
6574
|
if (E) return;
|
|
6509
6575
|
let n = e.updateNativeSize();
|
|
6510
6576
|
if (T.layoutProfile === "scratch-default" && P !== void 0) {
|
|
6511
|
-
let e =
|
|
6512
|
-
bounds:
|
|
6577
|
+
let e = Aa(P), i = ja({
|
|
6578
|
+
bounds: cs(t),
|
|
6513
6579
|
height: e.height,
|
|
6514
6580
|
pointsLeft: F,
|
|
6515
6581
|
stageHeight: n.height,
|
|
@@ -6522,30 +6588,34 @@ function ss(e, t, n, r, i, a) {
|
|
|
6522
6588
|
layout: P,
|
|
6523
6589
|
pointsLeft: F
|
|
6524
6590
|
});
|
|
6525
|
-
a !== O && (
|
|
6591
|
+
a !== O && (ms(u, Ia({
|
|
6526
6592
|
kind: r,
|
|
6527
6593
|
layout: P,
|
|
6528
6594
|
pointsLeft: F,
|
|
6529
6595
|
title: `${T.name} ${r} Bubble`
|
|
6530
|
-
}), o), O = a), u.setAttribute("data-bubble-style", "SCRATCH_DEFAULT"), u.setAttribute("data-bubble-profile", "scratch-default"), u.setAttribute("data-bubble-kind", r), u.setAttribute("data-bubble-body-width", String(e.width)), u.setAttribute("data-bubble-body-height", String(e.height)), u.setAttribute("transform", `translate(${n.width / 2 + i.left} ${n.height / 2 - i.top})`),
|
|
6596
|
+
}), o), O = a), u.setAttribute("data-bubble-style", "SCRATCH_DEFAULT"), u.setAttribute("data-bubble-profile", "scratch-default"), u.setAttribute("data-bubble-kind", r), u.setAttribute("data-bubble-body-width", String(e.width)), u.setAttribute("data-bubble-body-height", String(e.height)), u.setAttribute("transform", `translate(${n.width / 2 + i.left} ${n.height / 2 - i.top})`), R(n);
|
|
6531
6597
|
return;
|
|
6532
6598
|
}
|
|
6533
6599
|
u.removeAttribute("data-bubble-profile"), u.removeAttribute("data-bubble-kind");
|
|
6534
6600
|
let i = T.placement.basis === "actor" ? T.offset.scalePercent / 100 : 1, a = g.getCapturedSize() ?? g.getSize(), s = {
|
|
6535
6601
|
width: a.width * i,
|
|
6536
6602
|
height: a.height * i
|
|
6537
|
-
}, c = (T.portrait?.offset.zoomPercent ?? 100) / 100, l = T.portrait !== void 0, d = l ?
|
|
6603
|
+
}, c = (T.portrait?.offset.zoomPercent ?? 100) / 100, l = T.portrait !== void 0, d = l ? hs(f, Lo * c, i) : {
|
|
6538
6604
|
width: 0,
|
|
6539
6605
|
height: 0
|
|
6540
6606
|
};
|
|
6541
|
-
for (let e of [p, m]) l &&
|
|
6542
|
-
let v =
|
|
6543
|
-
|
|
6607
|
+
for (let e of [p, m]) l && hs(e, Lo * c, i);
|
|
6608
|
+
let v = hs(_, Ro, i), y = d.width + (l ? zo * i : 0) + s.width, b = Math.max(d.height, s.height), { width: S, height: C } = q({
|
|
6609
|
+
contentWidth: y / i,
|
|
6610
|
+
contentHeight: b / i,
|
|
6611
|
+
styles: [T.visualStyle, ...N === void 0 ? [] : [N.from, N.to]]
|
|
6612
|
+
}), D = Math.max(y, (S - 48) * i), k = Math.max(b, (C - 48) * i), A = -n.width / 2, j = n.width / 2, I = n.height / 2, L = -n.height / 2, z, B;
|
|
6613
|
+
if (T.placement.basis === "background") z = 0, B = T.placement.region === "HEADER_LIKE" ? I - Bo - k / 2 : T.placement.region === "FOOTER_LIKE" ? L + Bo + k / 2 : 0;
|
|
6544
6614
|
else {
|
|
6545
6615
|
let e = rt({
|
|
6546
|
-
bounds:
|
|
6547
|
-
bubbleWidth:
|
|
6548
|
-
bubbleHeight:
|
|
6616
|
+
bounds: cs(t),
|
|
6617
|
+
bubbleWidth: D,
|
|
6618
|
+
bubbleHeight: k,
|
|
6549
6619
|
direction: T.placement.direction,
|
|
6550
6620
|
distance: T.distance,
|
|
6551
6621
|
tailLength: T.tailLength,
|
|
@@ -6553,8 +6623,8 @@ function ss(e, t, n, r, i, a) {
|
|
|
6553
6623
|
});
|
|
6554
6624
|
z = e.x, B = e.y;
|
|
6555
6625
|
}
|
|
6556
|
-
z =
|
|
6557
|
-
let V = T.placement.basis === "actor" ?
|
|
6626
|
+
z = ls(z, A + D / 2, j - D / 2), B = ls(B, L + k / 2, I - k / 2), M = [z, B];
|
|
6627
|
+
let V = T.placement.basis === "actor" ? us(T.placement.direction) : null, ee = T.placement.basis === "actor" ? [
|
|
6558
6628
|
T.offset.x,
|
|
6559
6629
|
T.offset.y,
|
|
6560
6630
|
T.offset.scalePercent
|
|
@@ -6562,66 +6632,66 @@ function ss(e, t, n, r, i, a) {
|
|
|
6562
6632
|
0,
|
|
6563
6633
|
0,
|
|
6564
6634
|
100
|
|
6565
|
-
],
|
|
6635
|
+
], H = V === null ? {
|
|
6566
6636
|
x: 0,
|
|
6567
6637
|
y: 0
|
|
6568
|
-
} :
|
|
6638
|
+
} : Ut({
|
|
6569
6639
|
style: T.visualStyle,
|
|
6570
|
-
width:
|
|
6571
|
-
height:
|
|
6640
|
+
width: S,
|
|
6641
|
+
height: C,
|
|
6572
6642
|
tailDirection: V,
|
|
6573
6643
|
tailLength: T.tailLength,
|
|
6574
|
-
offset:
|
|
6575
|
-
}),
|
|
6576
|
-
baseBubbleHeight:
|
|
6577
|
-
baseBubbleWidth:
|
|
6578
|
-
bodyOffset:
|
|
6644
|
+
offset: ee
|
|
6645
|
+
}), U = JSON.stringify({
|
|
6646
|
+
baseBubbleHeight: C,
|
|
6647
|
+
baseBubbleWidth: S,
|
|
6648
|
+
bodyOffset: ee,
|
|
6579
6649
|
shapeTransition: N,
|
|
6580
6650
|
tailDirection: V,
|
|
6581
6651
|
tailLength: T.tailLength,
|
|
6582
6652
|
visualStyle: T.visualStyle
|
|
6583
6653
|
});
|
|
6584
|
-
|
|
6654
|
+
U !== O && (ms(u, Gt({
|
|
6585
6655
|
style: T.visualStyle,
|
|
6586
6656
|
lines: [],
|
|
6587
|
-
width:
|
|
6588
|
-
height:
|
|
6657
|
+
width: S,
|
|
6658
|
+
height: C,
|
|
6589
6659
|
tailDirection: V,
|
|
6590
6660
|
tailLength: T.tailLength,
|
|
6591
|
-
offset:
|
|
6661
|
+
offset: ee,
|
|
6592
6662
|
title: `${T.name} Bubble body`,
|
|
6593
6663
|
...N === void 0 ? {} : { shapeTransition: N }
|
|
6594
|
-
}), o), O =
|
|
6595
|
-
let
|
|
6596
|
-
u.setAttribute("transform", `translate(${n.width / 2 +
|
|
6597
|
-
let
|
|
6598
|
-
|
|
6599
|
-
let
|
|
6664
|
+
}), o), O = U), u.setAttribute("data-bubble-style", T.visualStyle), u.setAttribute("data-bubble-body-width", String(S)), u.setAttribute("data-bubble-body-height", String(C)), N === void 0 ? (u.removeAttribute("data-bubble-shape-transition-from"), u.removeAttribute("data-bubble-shape-transition-to"), u.removeAttribute("data-bubble-shape-transition-progress")) : (u.setAttribute("data-bubble-shape-transition-from", N.from), u.setAttribute("data-bubble-shape-transition-to", N.to), u.setAttribute("data-bubble-shape-transition-progress", String(N.progress)));
|
|
6665
|
+
let te = z - H.x, ne = B + H.y;
|
|
6666
|
+
u.setAttribute("transform", `translate(${n.width / 2 + te - S / 2} ${n.height / 2 - ne - C / 2})`);
|
|
6667
|
+
let re = z - y / 2, ie = T.portrait?.placement ?? "left", ae = ie.endsWith("right"), W = (T.portrait?.offset.x ?? 0) * i, oe = (T.portrait?.offset.y ?? 0) * i, se = (ae ? re + s.width + zo * i : re) + d.width / 2 + W, ce = B;
|
|
6668
|
+
ie.startsWith("top-") ? ce = B + b / 2 - d.height / 2 : ie.startsWith("bottom-") && (ce = B - b / 2 + d.height / 2), ce += oe;
|
|
6669
|
+
let le = (ae || !l ? re : re + d.width + zo * i) + s.width / 2, ue = (e, t) => `translate(${n.width / 2 + e} ${n.height / 2 - t})`;
|
|
6600
6670
|
for (let e of [
|
|
6601
6671
|
f,
|
|
6602
6672
|
p,
|
|
6603
6673
|
m
|
|
6604
|
-
]) e.group.setAttribute("transform",
|
|
6605
|
-
h.setAttribute("transform", `${
|
|
6606
|
-
let
|
|
6607
|
-
_.group.setAttribute("transform", de
|
|
6608
|
-
let
|
|
6609
|
-
w.setAttribute("x", String(-d.width / 2)), w.setAttribute("y", String(-d.height / 2)), w.setAttribute("width", String(d.width)), w.setAttribute("height", String(d.height)), w.setAttribute("rx", String(
|
|
6674
|
+
]) e.group.setAttribute("transform", ue(se, ce));
|
|
6675
|
+
h.setAttribute("transform", `${ue(le, B)} scale(${i})`);
|
|
6676
|
+
let de = le + s.width / 2 - v.width / 2 - zo * i, fe = B - s.height / 2 + v.height / 2 + zo * i;
|
|
6677
|
+
_.group.setAttribute("transform", ue(de, fe));
|
|
6678
|
+
let pe = Math.min(T.portrait?.cornerRadius ?? 0, d.width / 2, d.height / 2);
|
|
6679
|
+
w.setAttribute("x", String(-d.width / 2)), w.setAttribute("y", String(-d.height / 2)), w.setAttribute("width", String(d.width)), w.setAttribute("height", String(d.height)), w.setAttribute("rx", String(pe));
|
|
6610
6680
|
for (let e of [
|
|
6611
6681
|
f,
|
|
6612
6682
|
p,
|
|
6613
6683
|
m
|
|
6614
|
-
])
|
|
6615
|
-
|
|
6616
|
-
},
|
|
6617
|
-
|
|
6618
|
-
},
|
|
6619
|
-
g.refresh(),
|
|
6684
|
+
]) pe > 0 ? e.group.setAttribute("clip-path", `url(#${x})`) : e.group.removeAttribute("clip-path");
|
|
6685
|
+
R(n);
|
|
6686
|
+
}, B = t.onTargetVisualChange, V = (e) => {
|
|
6687
|
+
B?.(e), z();
|
|
6688
|
+
}, ee = () => {
|
|
6689
|
+
g.refresh(), z();
|
|
6620
6690
|
};
|
|
6621
|
-
return e.acquire(l), T.placement.basis === "actor" && (t.onTargetVisualChange =
|
|
6691
|
+
return e.acquire(l), T.placement.basis === "actor" && (t.onTargetVisualChange = V), s.on?.("NativeSizeChanged", ee), Object.freeze({
|
|
6622
6692
|
targets: v,
|
|
6623
6693
|
setLayerVisible(e, t) {
|
|
6624
|
-
E || (b.set(e, t),
|
|
6694
|
+
E || (b.set(e, t), R());
|
|
6625
6695
|
},
|
|
6626
6696
|
async updateStyle(e) {
|
|
6627
6697
|
if (E) return;
|
|
@@ -6634,53 +6704,53 @@ function ss(e, t, n, r, i, a) {
|
|
|
6634
6704
|
let r = T.placement.basis === "actor";
|
|
6635
6705
|
T = e, k = [0, 0], A = 1, j = 1, N = void 0, O = "", e.reveal?.layout !== "RESERVED" && g.clearCapturedLayout();
|
|
6636
6706
|
let i = T.placement.basis === "actor";
|
|
6637
|
-
r && !i ? t.onTargetVisualChange ===
|
|
6707
|
+
r && !i ? t.onTargetVisualChange === V && (t.onTargetVisualChange = B ?? null) : !r && i && (t.onTargetVisualChange = V), z();
|
|
6638
6708
|
},
|
|
6639
6709
|
captureTextLayout() {
|
|
6640
|
-
E || (g.captureLayout(),
|
|
6710
|
+
E || (g.captureLayout(), z());
|
|
6641
6711
|
},
|
|
6642
6712
|
clearTextLayout() {
|
|
6643
|
-
g.clearCapturedLayout(),
|
|
6713
|
+
g.clearCapturedLayout(), z();
|
|
6644
6714
|
},
|
|
6645
6715
|
renderScratchText(e) {
|
|
6646
|
-
E || (P = e, O = "",
|
|
6716
|
+
E || (P = e, O = "", z());
|
|
6647
6717
|
},
|
|
6648
6718
|
async animate(e) {
|
|
6649
6719
|
if (E) return;
|
|
6650
6720
|
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
6651
|
-
E ||
|
|
6652
|
-
}, r = (t) =>
|
|
6721
|
+
E || R();
|
|
6722
|
+
}, r = (t) => No(t, e.ease ?? "easeInOut");
|
|
6653
6723
|
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
6654
6724
|
D = !0;
|
|
6655
6725
|
let i = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
6656
|
-
k = i, A = o, j = e.name === "fadeIn" ? 0 : 1, n(), await
|
|
6726
|
+
k = i, A = o, j = e.name === "fadeIn" ? 0 : 1, n(), await Po(a, t, (t) => {
|
|
6657
6727
|
let a = r(t);
|
|
6658
6728
|
k = [i[0] * (1 - a), i[1] * (1 - a)], A = o + (1 - o) * a, j = e.name === "fadeIn" ? a : 1, n();
|
|
6659
|
-
}), k = [0, 0], A = 1, j = 1,
|
|
6729
|
+
}), k = [0, 0], A = 1, j = 1, z();
|
|
6660
6730
|
return;
|
|
6661
6731
|
}
|
|
6662
6732
|
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
6663
6733
|
let i = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
6664
|
-
await
|
|
6734
|
+
await Po(a, t, (t) => {
|
|
6665
6735
|
let a = r(t);
|
|
6666
6736
|
k = [i[0] * a, i[1] * a], A = 1 + (o - 1) * a, j = e.name === "fadeOut" ? 1 - a : 1, n();
|
|
6667
|
-
}), D = !1,
|
|
6737
|
+
}), D = !1, R(), k = [0, 0], A = 1, j = 1;
|
|
6668
6738
|
return;
|
|
6669
6739
|
}
|
|
6670
6740
|
if (e.name === "shake") {
|
|
6671
6741
|
let i = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : i * .08, s = Ze(typeof e.direction == "number" ? e.direction : e.direction ?? "right");
|
|
6672
|
-
await
|
|
6742
|
+
await Po(a, o, (e) => {
|
|
6673
6743
|
let t = Math.sin(r(e) * i * Math.PI * 2) * 5;
|
|
6674
6744
|
k = [s.x * t, s.y * t], n();
|
|
6675
|
-
}), k = [0, 0],
|
|
6745
|
+
}), k = [0, 0], z();
|
|
6676
6746
|
return;
|
|
6677
6747
|
}
|
|
6678
6748
|
if (e.name === "explode") {
|
|
6679
6749
|
let i = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : i * .12, s = e.relativeScale ?? 1.15;
|
|
6680
|
-
await
|
|
6750
|
+
await Po(a, o, (e) => {
|
|
6681
6751
|
let t = Math.abs(Math.sin(r(e) * i * Math.PI));
|
|
6682
6752
|
A = 1 + (s - 1) * t, n();
|
|
6683
|
-
}), A = 1,
|
|
6753
|
+
}), A = 1, z();
|
|
6684
6754
|
return;
|
|
6685
6755
|
}
|
|
6686
6756
|
if (e.name === "animateBubbleShape") {
|
|
@@ -6689,21 +6759,21 @@ function ss(e, t, n, r, i, a) {
|
|
|
6689
6759
|
from: r,
|
|
6690
6760
|
to: n,
|
|
6691
6761
|
progress: 0
|
|
6692
|
-
},
|
|
6693
|
-
let o = t === 0 ? 1 :
|
|
6762
|
+
}, z(), await Po(a, t, (a) => {
|
|
6763
|
+
let o = t === 0 ? 1 : Mo(a * Math.max(i, 1));
|
|
6694
6764
|
N = {
|
|
6695
6765
|
from: r,
|
|
6696
6766
|
to: n,
|
|
6697
|
-
progress:
|
|
6698
|
-
}, O = "",
|
|
6699
|
-
}), N = void 0, O = "",
|
|
6767
|
+
progress: No(o, e.ease ?? "easeInOut")
|
|
6768
|
+
}, O = "", z();
|
|
6769
|
+
}), N = void 0, O = "", z();
|
|
6700
6770
|
}
|
|
6701
6771
|
},
|
|
6702
6772
|
show() {
|
|
6703
|
-
E || (D = !0,
|
|
6773
|
+
E || (D = !0, z());
|
|
6704
6774
|
},
|
|
6705
6775
|
hide() {
|
|
6706
|
-
E || (D = !1,
|
|
6776
|
+
E || (D = !1, R());
|
|
6707
6777
|
},
|
|
6708
6778
|
async dispose() {
|
|
6709
6779
|
if (E) return;
|
|
@@ -6716,8 +6786,8 @@ function ss(e, t, n, r, i, a) {
|
|
|
6716
6786
|
}
|
|
6717
6787
|
};
|
|
6718
6788
|
r(() => {
|
|
6719
|
-
t.onTargetVisualChange ===
|
|
6720
|
-
}), r(() => s.off?.("NativeSizeChanged",
|
|
6789
|
+
t.onTargetVisualChange === V && (t.onTargetVisualChange = B ?? null);
|
|
6790
|
+
}), r(() => s.off?.("NativeSizeChanged", ee)), r(() => e.release(l)), r(() => g.clear());
|
|
6721
6791
|
let i = await Promise.allSettled([...y.values()].map((e) => e.release()));
|
|
6722
6792
|
if (n.push(...i.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), n.length === 1) throw n[0];
|
|
6723
6793
|
if (n.length > 1) throw AggregateError(n, "Failed to dispose SVG overlay Bubble surface.");
|
|
@@ -6726,17 +6796,17 @@ function ss(e, t, n, r, i, a) {
|
|
|
6726
6796
|
}
|
|
6727
6797
|
//#endregion
|
|
6728
6798
|
//#region src/turbowarp-adapter.ts
|
|
6729
|
-
var
|
|
6799
|
+
var _s = "sprite", vs = 96, ys = 18, bs = 8, xs = 16, Ss = 0, $ = class extends Error {
|
|
6730
6800
|
code;
|
|
6731
6801
|
constructor(e, t) {
|
|
6732
6802
|
super(t), this.name = "BubbleRuntimeAdapterError", this.code = e;
|
|
6733
6803
|
}
|
|
6734
6804
|
};
|
|
6735
|
-
function
|
|
6805
|
+
function Cs(e) {
|
|
6736
6806
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
6737
6807
|
}
|
|
6738
|
-
function
|
|
6739
|
-
if (!
|
|
6808
|
+
function ws(e) {
|
|
6809
|
+
if (!Cs(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
|
|
6740
6810
|
let t = [
|
|
6741
6811
|
"createSVGSkin",
|
|
6742
6812
|
"createDrawable",
|
|
@@ -6752,41 +6822,41 @@ function hs(e) {
|
|
|
6752
6822
|
if (t.some((t) => typeof e[t] != "function")) throw new $("BUBBLE-RUNTIME-001", `Bubble renderer must provide ${t.join(", ")}.`);
|
|
6753
6823
|
return e;
|
|
6754
6824
|
}
|
|
6755
|
-
function
|
|
6825
|
+
function Ts(e) {
|
|
6756
6826
|
let t = e ?? "svg-overlay";
|
|
6757
6827
|
if (t !== "scratch-render" && t !== "svg-overlay") throw new $("BUBBLE-RUNTIME-004", "Bubble bubbleRenderBackend must be scratch-render or svg-overlay.");
|
|
6758
6828
|
return t;
|
|
6759
6829
|
}
|
|
6760
|
-
function
|
|
6830
|
+
function Es(e) {
|
|
6761
6831
|
let t = e ?? "error";
|
|
6762
6832
|
if (t !== "error" && t !== "fallback") throw new $("BUBBLE-RUNTIME-004", "Bubble svgOverlayUnsupportedBehavior must be error or fallback.");
|
|
6763
6833
|
return t;
|
|
6764
6834
|
}
|
|
6765
|
-
function
|
|
6835
|
+
function Ds(e) {
|
|
6766
6836
|
let t = e ?? (globalThis.document === void 0 ? void 0 : globalThis.document);
|
|
6767
6837
|
if (t !== void 0) {
|
|
6768
|
-
if (!
|
|
6838
|
+
if (!Cs(t) || typeof t.createElementNS != "function") throw new $("BUBBLE-RUNTIME-004", "Bubble SVG overlay document must provide createElementNS().");
|
|
6769
6839
|
return t;
|
|
6770
6840
|
}
|
|
6771
6841
|
}
|
|
6772
|
-
function
|
|
6842
|
+
function Os(e, t, n) {
|
|
6773
6843
|
if (typeof e.addOverlay != "function" || typeof e.removeOverlay != "function") return "the renderer does not provide addOverlay() and removeOverlay()";
|
|
6774
6844
|
if (t === void 0) return "the host does not provide a DOM document";
|
|
6775
6845
|
if (typeof t.defaultView?.DOMParser != "function") return "the host document does not provide DOMParser";
|
|
6776
|
-
if (!
|
|
6846
|
+
if (!Cs(n) || typeof n.layoutText != "function") return "a host-neutral svgOverlayTextCapability is not available";
|
|
6777
6847
|
}
|
|
6778
|
-
function
|
|
6848
|
+
function ks() {
|
|
6779
6849
|
let e = Be(), t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
6780
6850
|
e.defineStyle({
|
|
6781
6851
|
name: n,
|
|
6782
6852
|
backgroundColor: "transparent"
|
|
6783
6853
|
}), t.add(n);
|
|
6784
6854
|
};
|
|
6785
|
-
return n("default"),
|
|
6855
|
+
return n("default"), wo(Object.freeze({ layoutText(r) {
|
|
6786
6856
|
return t.has(r.styleName) || n(r.styleName), e.layoutText(r);
|
|
6787
6857
|
} }));
|
|
6788
6858
|
}
|
|
6789
|
-
function
|
|
6859
|
+
function As(e) {
|
|
6790
6860
|
let t = Ve({ runtime: e }), n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
6791
6861
|
t.defineStyle({
|
|
6792
6862
|
name: e,
|
|
@@ -6795,7 +6865,7 @@ function xs(e) {
|
|
|
6795
6865
|
}, i = (e) => {
|
|
6796
6866
|
n.has(e) || r(e);
|
|
6797
6867
|
};
|
|
6798
|
-
return r("default"),
|
|
6868
|
+
return r("default"), Co(Object.freeze({
|
|
6799
6869
|
setText(e) {
|
|
6800
6870
|
i(e.styleName), t.setText(e);
|
|
6801
6871
|
},
|
|
@@ -6807,17 +6877,17 @@ function xs(e) {
|
|
|
6807
6877
|
}
|
|
6808
6878
|
}));
|
|
6809
6879
|
}
|
|
6810
|
-
function
|
|
6811
|
-
if (!
|
|
6880
|
+
function js(e) {
|
|
6881
|
+
if (!Cs(e) || typeof e.isLoaded != "function" || typeof e.getAssetMimeType != "function" || typeof e.resolveSkin != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble image assets require an imageResolver capability. Load @kubohiroya/turbowarp-asset-cache or provide options.imageResolver before using image features.");
|
|
6812
6882
|
return e;
|
|
6813
6883
|
}
|
|
6814
|
-
function
|
|
6815
|
-
if (!
|
|
6884
|
+
function Ms(e) {
|
|
6885
|
+
if (!Cs(e) || typeof e.getDOMImageCapability != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble SVG overlay image assets require @kubohiroya/turbowarp-asset-cache 0.1.0 or a host-provided options.svgOverlayImageCapability.");
|
|
6816
6886
|
let t = e.getDOMImageCapability();
|
|
6817
|
-
if (!
|
|
6887
|
+
if (!Cs(t) || typeof t.isRegistered != "function" || typeof t.getMimeType != "function" || typeof t.resolveDOMImageResource != "function") throw new $("BUBBLE-RUNTIME-002", "Asset Manager did not provide a valid DOM image capability.");
|
|
6818
6888
|
return t;
|
|
6819
6889
|
}
|
|
6820
|
-
function
|
|
6890
|
+
function Ns(e) {
|
|
6821
6891
|
try {
|
|
6822
6892
|
let t = e.getBoundsForBubble?.();
|
|
6823
6893
|
if (t && [
|
|
@@ -6835,7 +6905,7 @@ function ws(e) {
|
|
|
6835
6905
|
top: n
|
|
6836
6906
|
};
|
|
6837
6907
|
}
|
|
6838
|
-
function
|
|
6908
|
+
function Ps(e, t, n) {
|
|
6839
6909
|
let r = e.getCurrentSkinSize(t.drawableID);
|
|
6840
6910
|
if (!Array.isArray(r) || r.length < 2) return n;
|
|
6841
6911
|
let i = Number(r[0]), a = Number(r[1]);
|
|
@@ -6844,8 +6914,8 @@ function Ts(e, t, n) {
|
|
|
6844
6914
|
height: a
|
|
6845
6915
|
};
|
|
6846
6916
|
}
|
|
6847
|
-
function
|
|
6848
|
-
let i =
|
|
6917
|
+
function Fs(e, t, n, r = 1) {
|
|
6918
|
+
let i = Ps(e, t, {
|
|
6849
6919
|
width: n,
|
|
6850
6920
|
height: n
|
|
6851
6921
|
}), a = Math.min(n / i.width, n / i.height) * r;
|
|
@@ -6855,35 +6925,35 @@ function Es(e, t, n, r = 1) {
|
|
|
6855
6925
|
scalePercent: a * 100
|
|
6856
6926
|
};
|
|
6857
6927
|
}
|
|
6858
|
-
function
|
|
6928
|
+
function Is(e, t, n) {
|
|
6859
6929
|
let r = Math.min(n, e / 2, t / 2), i = e - r, a = t - r;
|
|
6860
6930
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">
|
|
6861
6931
|
<path d="M0 0H${e}V${t}H0Z M${r} 0H${i}A${r} ${r} 0 0 1 ${e} ${r}V${a}A${r} ${r} 0 0 1 ${i} ${t}H${r}A${r} ${r} 0 0 1 0 ${a}V${r}A${r} ${r} 0 0 1 ${r} 0Z" fill="#fff4cc" fill-rule="evenodd" data-bubble-portrait-corner-radius="${r}"/>
|
|
6862
6932
|
</svg>`;
|
|
6863
6933
|
}
|
|
6864
|
-
function
|
|
6934
|
+
function Ls(e, t, n) {
|
|
6865
6935
|
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
6866
6936
|
}
|
|
6867
|
-
function
|
|
6937
|
+
function Rs(e, t, n, r, i) {
|
|
6868
6938
|
let a = t + r * 2, o = n + i * 2;
|
|
6869
6939
|
return e.replace(/<svg\b[^>]*>/u, (e) => e.replace(/\bwidth="[^"]*"/u, `width="${a}"`).replace(/\bheight="[^"]*"/u, `height="${o}"`).replace(/\bviewBox="[^"]*"/u, `viewBox="${-r} ${-i} ${a} ${o}"`));
|
|
6870
6940
|
}
|
|
6871
|
-
function
|
|
6941
|
+
function zs(e) {
|
|
6872
6942
|
let t = Ze(e);
|
|
6873
6943
|
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
6874
6944
|
}
|
|
6875
|
-
function
|
|
6876
|
-
let o = e.renderer, s =
|
|
6877
|
-
|
|
6945
|
+
function Bs(e, t, n, r, i, a) {
|
|
6946
|
+
let o = e.renderer, s = Ss;
|
|
6947
|
+
Ss += 1;
|
|
6878
6948
|
let c = [], l, u, d = (e) => {
|
|
6879
|
-
let t = o.createDrawable(
|
|
6949
|
+
let t = o.createDrawable(_s);
|
|
6880
6950
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", `TurboWarp did not create the Bubble ${e} drawable.`);
|
|
6881
6951
|
let r = Object.freeze({
|
|
6882
6952
|
id: `bubble:${n}:${s}:${e}`,
|
|
6883
6953
|
isStage: !1,
|
|
6884
6954
|
drawableID: t
|
|
6885
6955
|
});
|
|
6886
|
-
return c.push(r), o.updateDrawableVisible(t, !1), o.setDrawableOrder?.(t, Infinity,
|
|
6956
|
+
return c.push(r), o.updateDrawableVisible(t, !1), o.setDrawableOrder?.(t, Infinity, _s), r;
|
|
6887
6957
|
};
|
|
6888
6958
|
try {
|
|
6889
6959
|
let n = d("body"), s = i.portrait ? d("portrait-base") : void 0, f = i.portrait?.blink ? d("portrait-blink") : void 0, p = i.portrait?.lipSync ? d("portrait-lip-sync") : void 0, m = i.portrait ? d("portrait-corner-mask") : void 0, h = d("text"), g = i.continueIndicator ? d("continue-indicator") : void 0, _ = Object.freeze({
|
|
@@ -6909,8 +6979,8 @@ function js(e, t, n, r, i, a) {
|
|
|
6909
6979
|
}, I = () => {
|
|
6910
6980
|
if (x) return;
|
|
6911
6981
|
if (w.layoutProfile === "scratch-default" && M !== void 0) {
|
|
6912
|
-
let e = o.getNativeSize(), i = Array.isArray(e) && Number(e[0]) > 0 ? Number(e[0]) : 480, a = Array.isArray(e) && Number(e[1]) > 0 ? Number(e[1]) : 360, s =
|
|
6913
|
-
bounds:
|
|
6982
|
+
let e = o.getNativeSize(), i = Array.isArray(e) && Number(e[0]) > 0 ? Number(e[0]) : 480, a = Array.isArray(e) && Number(e[1]) > 0 ? Number(e[1]) : 360, s = Aa(M), c = ja({
|
|
6983
|
+
bounds: Ns(t),
|
|
6914
6984
|
height: s.height,
|
|
6915
6985
|
pointsLeft: N,
|
|
6916
6986
|
stageHeight: a,
|
|
@@ -6924,7 +6994,7 @@ function js(e, t, n, r, i, a) {
|
|
|
6924
6994
|
pointsLeft: N
|
|
6925
6995
|
});
|
|
6926
6996
|
if (u !== S) {
|
|
6927
|
-
let e = o.createSVGSkin(
|
|
6997
|
+
let e = o.createSVGSkin(Ia({
|
|
6928
6998
|
kind: r,
|
|
6929
6999
|
layout: M,
|
|
6930
7000
|
pointsLeft: N,
|
|
@@ -6942,7 +7012,7 @@ function js(e, t, n, r, i, a) {
|
|
|
6942
7012
|
o.updateDrawableScale(n.drawableID, [100, 100]), o.updateDrawablePosition(n.drawableID, [c.centerX, c.centerY]), E.set(n.drawableID, [c.centerX, c.centerY]), D.set(n.drawableID, [100, 100]), F();
|
|
6943
7013
|
return;
|
|
6944
7014
|
}
|
|
6945
|
-
let e = w.placement.basis === "actor" ? w.offset.scalePercent / 100 : 1, i = T ??
|
|
7015
|
+
let e = w.placement.basis === "actor" ? w.offset.scalePercent / 100 : 1, i = T ?? Ps(o, h, {
|
|
6946
7016
|
width: 180,
|
|
6947
7017
|
height: 48
|
|
6948
7018
|
});
|
|
@@ -6950,36 +7020,40 @@ function js(e, t, n, r, i, a) {
|
|
|
6950
7020
|
let a = {
|
|
6951
7021
|
width: i.width * e,
|
|
6952
7022
|
height: i.height * e
|
|
6953
|
-
}, c =
|
|
7023
|
+
}, c = vs * ((w.portrait?.offset.zoomPercent ?? 100) / 100), d = s !== void 0 && w.portrait !== void 0, _ = d ? Fs(o, s, c, e) : {
|
|
6954
7024
|
width: 0,
|
|
6955
7025
|
height: 0,
|
|
6956
7026
|
scalePercent: 0
|
|
6957
7027
|
}, v = /* @__PURE__ */ new Map();
|
|
6958
7028
|
d && v.set(s.drawableID, _.scalePercent);
|
|
6959
7029
|
for (let t of [f, p]) if (t && d) {
|
|
6960
|
-
let n =
|
|
7030
|
+
let n = Fs(o, t, c, e);
|
|
6961
7031
|
v.set(t.drawableID, n.scalePercent);
|
|
6962
7032
|
}
|
|
6963
|
-
let y = g ?
|
|
7033
|
+
let y = g ? Fs(o, g, ys, e) : {
|
|
6964
7034
|
width: 0,
|
|
6965
7035
|
height: 0,
|
|
6966
7036
|
scalePercent: 0
|
|
6967
|
-
}, b = _.width + (d ?
|
|
6968
|
-
|
|
7037
|
+
}, b = _.width + (d ? bs * e : 0) + a.width, O = Math.max(_.height, a.height), { width: k, height: A } = q({
|
|
7038
|
+
contentWidth: b / e,
|
|
7039
|
+
contentHeight: O / e,
|
|
7040
|
+
styles: [w.visualStyle, ...j === void 0 ? [] : [j.from, j.to]]
|
|
7041
|
+
}), I = Math.max(b, (k - 48) * e), L = Math.max(O, (A - 48) * e), R = o.getNativeSize(), z = Array.isArray(R) && Number(R[0]) > 0 ? Number(R[0]) : 480, B = Array.isArray(R) && Number(R[1]) > 0 ? Number(R[1]) : 360, V = -z / 2, ee = z / 2, H = B / 2, U = -B / 2, te = V + I / 2, ne = ee - I / 2, re = U + L / 2, ie = H - L / 2, ae, W;
|
|
7042
|
+
if (w.placement.basis === "background") ae = 0, W = w.placement.region === "HEADER_LIKE" ? H - xs - L / 2 : w.placement.region === "FOOTER_LIKE" ? U + xs + L / 2 : 0;
|
|
6969
7043
|
else {
|
|
6970
7044
|
let e = rt({
|
|
6971
|
-
bounds:
|
|
6972
|
-
bubbleWidth:
|
|
7045
|
+
bounds: Ns(t),
|
|
7046
|
+
bubbleWidth: I,
|
|
6973
7047
|
bubbleHeight: L,
|
|
6974
7048
|
direction: w.placement.direction,
|
|
6975
7049
|
distance: w.distance,
|
|
6976
7050
|
tailLength: w.tailLength,
|
|
6977
7051
|
offset: w.offset
|
|
6978
7052
|
});
|
|
6979
|
-
|
|
7053
|
+
ae = e.x, W = e.y;
|
|
6980
7054
|
}
|
|
6981
|
-
|
|
6982
|
-
let
|
|
7055
|
+
ae = Ls(ae, te, ne), W = Ls(W, re, ie);
|
|
7056
|
+
let oe = w.placement.basis === "actor" ? zs(w.placement.direction) : null, se = w.placement.basis === "actor" ? [
|
|
6983
7057
|
w.offset.x,
|
|
6984
7058
|
w.offset.y,
|
|
6985
7059
|
w.offset.scalePercent
|
|
@@ -6987,39 +7061,39 @@ function js(e, t, n, r, i, a) {
|
|
|
6987
7061
|
0,
|
|
6988
7062
|
0,
|
|
6989
7063
|
100
|
|
6990
|
-
],
|
|
7064
|
+
], ce = oe === null ? {
|
|
6991
7065
|
x: 0,
|
|
6992
7066
|
y: 0
|
|
6993
|
-
} :
|
|
7067
|
+
} : Ut({
|
|
6994
7068
|
style: w.visualStyle,
|
|
6995
|
-
width:
|
|
6996
|
-
height:
|
|
6997
|
-
tailDirection:
|
|
7069
|
+
width: k,
|
|
7070
|
+
height: A,
|
|
7071
|
+
tailDirection: oe,
|
|
6998
7072
|
tailLength: w.tailLength,
|
|
6999
|
-
offset:
|
|
7000
|
-
}),
|
|
7001
|
-
baseBubbleHeight:
|
|
7002
|
-
baseBubbleWidth:
|
|
7003
|
-
bodyOffset:
|
|
7004
|
-
tailDirection:
|
|
7073
|
+
offset: se
|
|
7074
|
+
}), le = Math.abs(se[0]) + k * Math.abs(e - 1) + Math.max(0, w.tailLength - 18) + 8, ue = Math.abs(se[1]) + A * Math.abs(e - 1) + Math.max(0, w.tailLength - 18) + 8, de = JSON.stringify({
|
|
7075
|
+
baseBubbleHeight: A,
|
|
7076
|
+
baseBubbleWidth: k,
|
|
7077
|
+
bodyOffset: se,
|
|
7078
|
+
tailDirection: oe,
|
|
7005
7079
|
tailLength: w.tailLength,
|
|
7006
|
-
viewportExtraX:
|
|
7007
|
-
viewportExtraY:
|
|
7080
|
+
viewportExtraX: le,
|
|
7081
|
+
viewportExtraY: ue,
|
|
7008
7082
|
visualStyle: w.visualStyle,
|
|
7009
7083
|
shapeTransition: j
|
|
7010
7084
|
});
|
|
7011
|
-
if (
|
|
7012
|
-
let e =
|
|
7085
|
+
if (de !== S) {
|
|
7086
|
+
let e = Rs(Gt({
|
|
7013
7087
|
style: w.visualStyle,
|
|
7014
7088
|
lines: [],
|
|
7015
|
-
width:
|
|
7016
|
-
height:
|
|
7017
|
-
tailDirection:
|
|
7089
|
+
width: k,
|
|
7090
|
+
height: A,
|
|
7091
|
+
tailDirection: oe,
|
|
7018
7092
|
tailLength: w.tailLength,
|
|
7019
|
-
offset:
|
|
7093
|
+
offset: se,
|
|
7020
7094
|
title: `${w.name} Bubble body`,
|
|
7021
7095
|
...j === void 0 ? {} : { shapeTransition: j }
|
|
7022
|
-
}), A,
|
|
7096
|
+
}), k, A, le, ue), t = o.createSVGSkin(e);
|
|
7023
7097
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble body SVG skin.");
|
|
7024
7098
|
try {
|
|
7025
7099
|
o.updateDrawableSkinId(n.drawableID, t);
|
|
@@ -7027,17 +7101,17 @@ function js(e, t, n, r, i, a) {
|
|
|
7027
7101
|
throw o.destroySkin(t), e;
|
|
7028
7102
|
}
|
|
7029
7103
|
let r = l;
|
|
7030
|
-
l = t, S =
|
|
7104
|
+
l = t, S = de, r !== void 0 && o.destroySkin(r);
|
|
7031
7105
|
}
|
|
7032
|
-
o.updateDrawableScale(n.drawableID, [100, 100]), o.updateDrawablePosition(n.drawableID, [
|
|
7033
|
-
let
|
|
7034
|
-
|
|
7035
|
-
let
|
|
7106
|
+
o.updateDrawableScale(n.drawableID, [100, 100]), o.updateDrawablePosition(n.drawableID, [ae - ce.x, W + ce.y]);
|
|
7107
|
+
let fe = ae - b / 2, pe = w.portrait?.placement ?? "left", me = pe.endsWith("right"), he = (w.portrait?.offset.x ?? 0) * e, ge = (w.portrait?.offset.y ?? 0) * e, _e = (me ? fe + a.width + bs * e : fe) + _.width / 2 + he, ve = W;
|
|
7108
|
+
pe.startsWith("top-") ? ve = W + O / 2 - _.height / 2 : pe.startsWith("bottom-") && (ve = W - O / 2 + _.height / 2), ve += ge;
|
|
7109
|
+
let ye = (me || !d ? fe : fe + _.width + bs * e) + a.width / 2;
|
|
7036
7110
|
for (let e of [
|
|
7037
7111
|
s,
|
|
7038
7112
|
f,
|
|
7039
7113
|
p
|
|
7040
|
-
]) e && o.updateDrawablePosition(e.drawableID, [
|
|
7114
|
+
]) e && o.updateDrawablePosition(e.drawableID, [_e, ve]);
|
|
7041
7115
|
if (m) {
|
|
7042
7116
|
let t = _.width / e, n = _.height / e, r = Math.min(w.portrait?.cornerRadius ?? 0, t / 2, n / 2), i = r > 0 ? JSON.stringify({
|
|
7043
7117
|
maskHeight: n,
|
|
@@ -7047,7 +7121,7 @@ function js(e, t, n, r, i, a) {
|
|
|
7047
7121
|
if (i !== C) {
|
|
7048
7122
|
let e = u;
|
|
7049
7123
|
if (u = void 0, C = i, r > 0) {
|
|
7050
|
-
let e = o.createSVGSkin(
|
|
7124
|
+
let e = o.createSVGSkin(Is(t, n, r));
|
|
7051
7125
|
if (!Number.isInteger(e) || e < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble portrait corner mask SVG skin.");
|
|
7052
7126
|
try {
|
|
7053
7127
|
o.updateDrawableSkinId(m.drawableID, e), u = e;
|
|
@@ -7057,13 +7131,13 @@ function js(e, t, n, r, i, a) {
|
|
|
7057
7131
|
}
|
|
7058
7132
|
e !== void 0 && o.destroySkin(e);
|
|
7059
7133
|
}
|
|
7060
|
-
o.updateDrawablePosition(m.drawableID, [
|
|
7134
|
+
o.updateDrawablePosition(m.drawableID, [_e, ve]);
|
|
7061
7135
|
}
|
|
7062
|
-
o.updateDrawablePosition(h.drawableID, [
|
|
7063
|
-
let
|
|
7136
|
+
o.updateDrawablePosition(h.drawableID, [ye, W]), g && o.updateDrawablePosition(g.drawableID, [ye + a.width / 2 - y.width / 2 - bs * e, W - a.height / 2 + y.height / 2 + bs * e]);
|
|
7137
|
+
let be = (e, t) => {
|
|
7064
7138
|
e && E.set(e.drawableID, t);
|
|
7065
7139
|
};
|
|
7066
|
-
|
|
7140
|
+
be(n, [ae - ce.x, W + ce.y]), be(h, [ye, W]), be(s, [_e, ve]), be(f, [_e, ve]), be(p, [_e, ve]), be(m, [_e, ve]), D.set(n.drawableID, [100, 100]), D.set(h.drawableID, [e * 100, e * 100]);
|
|
7067
7141
|
for (let e of [
|
|
7068
7142
|
s,
|
|
7069
7143
|
f,
|
|
@@ -7073,11 +7147,11 @@ function js(e, t, n, r, i, a) {
|
|
|
7073
7147
|
let t = v.get(e.drawableID) ?? 0;
|
|
7074
7148
|
D.set(e.drawableID, [t, t]);
|
|
7075
7149
|
}
|
|
7076
|
-
m && D.set(m.drawableID, [e * 100, e * 100]), g && D.set(g.drawableID, [y.scalePercent, y.scalePercent]), g &&
|
|
7077
|
-
},
|
|
7078
|
-
|
|
7079
|
-
},
|
|
7080
|
-
return w.placement.basis === "actor" && (t.onTargetVisualChange =
|
|
7150
|
+
m && D.set(m.drawableID, [e * 100, e * 100]), g && D.set(g.drawableID, [y.scalePercent, y.scalePercent]), g && be(g, [ye + a.width / 2 - y.width / 2 - bs * e, W - a.height / 2 + y.height / 2 + bs * e]), P(), F();
|
|
7151
|
+
}, L = t.onTargetVisualChange, R = (e) => {
|
|
7152
|
+
L?.(e), I();
|
|
7153
|
+
}, z = () => I();
|
|
7154
|
+
return w.placement.basis === "actor" && (t.onTargetVisualChange = R), o.on?.("NativeSizeChanged", z), Object.freeze({
|
|
7081
7155
|
targets: _,
|
|
7082
7156
|
setLayerVisible(e, t) {
|
|
7083
7157
|
x || (y.set(e, t), F());
|
|
@@ -7087,10 +7161,10 @@ function js(e, t, n, r, i, a) {
|
|
|
7087
7161
|
let n = w.placement.basis === "actor";
|
|
7088
7162
|
w = e, O = [0, 0], k = 1, A = 1, j = void 0, e.reveal?.layout !== "RESERVED" && (T = void 0);
|
|
7089
7163
|
let r = w.placement.basis === "actor";
|
|
7090
|
-
n && !r ? t.onTargetVisualChange ===
|
|
7164
|
+
n && !r ? t.onTargetVisualChange === R && (t.onTargetVisualChange = L ?? null) : !n && r && (t.onTargetVisualChange = R), I();
|
|
7091
7165
|
},
|
|
7092
7166
|
captureTextLayout() {
|
|
7093
|
-
x || (T =
|
|
7167
|
+
x || (T = Ps(o, h, {
|
|
7094
7168
|
width: 180,
|
|
7095
7169
|
height: 48
|
|
7096
7170
|
}), I());
|
|
@@ -7105,11 +7179,11 @@ function js(e, t, n, r, i, a) {
|
|
|
7105
7179
|
if (x) return;
|
|
7106
7180
|
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
7107
7181
|
x || (P(), F());
|
|
7108
|
-
}, r = (t) =>
|
|
7182
|
+
}, r = (t) => No(t, e.ease ?? "easeInOut");
|
|
7109
7183
|
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
7110
7184
|
b = !0;
|
|
7111
7185
|
let i = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
7112
|
-
O = i, k = o, A = e.name === "fadeIn" ? 0 : 1, n(), await
|
|
7186
|
+
O = i, k = o, A = e.name === "fadeIn" ? 0 : 1, n(), await Po(a, t, (t) => {
|
|
7113
7187
|
let a = r(t);
|
|
7114
7188
|
O = [i[0] * (1 - a), i[1] * (1 - a)], k = o + (1 - o) * a, A = e.name === "fadeIn" ? a : 1, n();
|
|
7115
7189
|
}), O = [0, 0], k = 1, A = 1, I();
|
|
@@ -7117,7 +7191,7 @@ function js(e, t, n, r, i, a) {
|
|
|
7117
7191
|
}
|
|
7118
7192
|
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
7119
7193
|
let i = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
7120
|
-
O = [0, 0], k = 1, A = 1, n(), await
|
|
7194
|
+
O = [0, 0], k = 1, A = 1, n(), await Po(a, t, (t) => {
|
|
7121
7195
|
let a = r(t);
|
|
7122
7196
|
O = [i[0] * a, i[1] * a], k = 1 + (o - 1) * a, A = e.name === "fadeOut" ? 1 - a : 1, n();
|
|
7123
7197
|
}), O = i, k = o, A = e.name === "fadeOut" ? 0 : 1, n(), b = !1, F(), O = [0, 0], k = 1, A = 1;
|
|
@@ -7125,7 +7199,7 @@ function js(e, t, n, r, i, a) {
|
|
|
7125
7199
|
}
|
|
7126
7200
|
if (e.name === "shake") {
|
|
7127
7201
|
let i = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : i * .08, s = Ze(typeof e.direction == "number" ? e.direction : e.direction ?? "right") ?? Ze("right");
|
|
7128
|
-
O = [0, 0], await
|
|
7202
|
+
O = [0, 0], await Po(a, o, (e) => {
|
|
7129
7203
|
let t = r(e) * i * Math.PI * 2, a = Math.sin(t) * 5;
|
|
7130
7204
|
O = [s.x * a, s.y * a], n();
|
|
7131
7205
|
}), O = [0, 0], I();
|
|
@@ -7133,7 +7207,7 @@ function js(e, t, n, r, i, a) {
|
|
|
7133
7207
|
}
|
|
7134
7208
|
if (e.name === "explode") {
|
|
7135
7209
|
let i = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : i * .12, s = e.relativeScale ?? 1.15;
|
|
7136
|
-
await
|
|
7210
|
+
await Po(a, o, (e) => {
|
|
7137
7211
|
let t = r(e), a = Math.abs(Math.sin(t * i * Math.PI));
|
|
7138
7212
|
k = 1 + (s - 1) * a, n();
|
|
7139
7213
|
}), k = 1, I();
|
|
@@ -7145,12 +7219,12 @@ function js(e, t, n, r, i, a) {
|
|
|
7145
7219
|
from: r,
|
|
7146
7220
|
to: n,
|
|
7147
7221
|
progress: 0
|
|
7148
|
-
}, I(), await
|
|
7149
|
-
let o = t === 0 ? 1 :
|
|
7222
|
+
}, I(), await Po(a, t, (a) => {
|
|
7223
|
+
let o = t === 0 ? 1 : Mo(a * Math.max(i, 1) / 1);
|
|
7150
7224
|
j = {
|
|
7151
7225
|
from: r,
|
|
7152
7226
|
to: n,
|
|
7153
|
-
progress:
|
|
7227
|
+
progress: No(o, e.ease ?? "easeInOut")
|
|
7154
7228
|
}, I();
|
|
7155
7229
|
}), j = void 0, I();
|
|
7156
7230
|
return;
|
|
@@ -7164,49 +7238,49 @@ function js(e, t, n, r, i, a) {
|
|
|
7164
7238
|
},
|
|
7165
7239
|
dispose() {
|
|
7166
7240
|
if (!x) {
|
|
7167
|
-
x = !0, o.off?.("NativeSizeChanged",
|
|
7168
|
-
for (let e of [...c].reverse()) o.destroyDrawable(e.drawableID,
|
|
7241
|
+
x = !0, o.off?.("NativeSizeChanged", z), w.placement.basis === "actor" && t.onTargetVisualChange === R && (t.onTargetVisualChange = L ?? null);
|
|
7242
|
+
for (let e of [...c].reverse()) o.destroyDrawable(e.drawableID, _s);
|
|
7169
7243
|
l !== void 0 && (o.destroySkin(l), l = void 0), u !== void 0 && (o.destroySkin(u), u = void 0), e.requestRedraw?.();
|
|
7170
7244
|
}
|
|
7171
7245
|
}
|
|
7172
7246
|
});
|
|
7173
7247
|
} catch (e) {
|
|
7174
|
-
for (let e of [...c].reverse()) o.destroyDrawable(e.drawableID,
|
|
7248
|
+
for (let e of [...c].reverse()) o.destroyDrawable(e.drawableID, _s);
|
|
7175
7249
|
throw l !== void 0 && o.destroySkin(l), u !== void 0 && o.destroySkin(u), e;
|
|
7176
7250
|
}
|
|
7177
7251
|
}
|
|
7178
|
-
function
|
|
7179
|
-
if (!
|
|
7180
|
-
let n = e, r =
|
|
7252
|
+
function Vs(e, t = {}) {
|
|
7253
|
+
if (!Cs(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp runtime.");
|
|
7254
|
+
let n = e, r = ws(n.renderer), i = Ts(t.bubbleRenderBackend), a, o;
|
|
7181
7255
|
if (i === "svg-overlay") {
|
|
7182
7256
|
if (t.svgOverlayTextCapability !== void 0) a = t.svgOverlayTextCapability;
|
|
7183
|
-
else if (n.ext_kubohiroyasvgtext === void 0) a =
|
|
7257
|
+
else if (n.ext_kubohiroyasvgtext === void 0) a = ks();
|
|
7184
7258
|
else try {
|
|
7185
|
-
a =
|
|
7259
|
+
a = To(n.ext_kubohiroyasvgtext);
|
|
7186
7260
|
} catch (e) {
|
|
7187
7261
|
o = e instanceof Error ? e.message : String(e);
|
|
7188
7262
|
}
|
|
7189
7263
|
}
|
|
7190
|
-
let s =
|
|
7264
|
+
let s = Es(t.svgOverlayUnsupportedBehavior), c = i === "svg-overlay" ? Ds(t.document) : void 0, l = i === "svg-overlay" ? o ?? Os(r, c, a) : void 0;
|
|
7191
7265
|
if (i === "svg-overlay" && l !== void 0 && s === "error") throw new $("BUBBLE-RUNTIME-004", `Bubble SVG overlay backend is unavailable because ${l}. Use scratch-render or install the required public upstream capability.`);
|
|
7192
7266
|
let u = i === "svg-overlay" && l === void 0 ? "svg-overlay" : "scratch-render", d = t.scheduler ?? {
|
|
7193
7267
|
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
7194
7268
|
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
7195
|
-
}, f = () => n.ext_kubohiroyaassetcache ?? n.ext_kubohiroyaassetmanager, p = () =>
|
|
7269
|
+
}, f = () => n.ext_kubohiroyaassetcache ?? n.ext_kubohiroyaassetmanager, p = () => js(f()), m, h = () => (m ??= Ms(f()), m), g;
|
|
7196
7270
|
if (u === "svg-overlay") try {
|
|
7197
|
-
g =
|
|
7271
|
+
g = ts(a, r);
|
|
7198
7272
|
} catch (e) {
|
|
7199
7273
|
throw new $("BUBBLE-RUNTIME-004", `Bubble SVG overlay text capability is invalid: ${e instanceof Error ? e.message : String(e)}`);
|
|
7200
7274
|
}
|
|
7201
7275
|
else if (t.textCapability !== void 0) g = t.textCapability;
|
|
7202
7276
|
else try {
|
|
7203
|
-
g = n.ext_kubohiroyasvgtext === void 0 ?
|
|
7277
|
+
g = n.ext_kubohiroyasvgtext === void 0 ? As(n) : So(n.ext_kubohiroyasvgtext);
|
|
7204
7278
|
} catch (e) {
|
|
7205
7279
|
throw new $("BUBBLE-RUNTIME-003", `Bubble could not initialize the scratch-render text provider: ${e instanceof Error ? e.message : String(e)}`);
|
|
7206
7280
|
}
|
|
7207
7281
|
let _;
|
|
7208
7282
|
if (u === "svg-overlay") try {
|
|
7209
|
-
_ =
|
|
7283
|
+
_ = os(t.svgOverlayImageCapability ?? jo(Object.freeze({
|
|
7210
7284
|
isRegistered(e) {
|
|
7211
7285
|
return h().isRegistered(e);
|
|
7212
7286
|
},
|
|
@@ -7231,7 +7305,7 @@ function Ms(e, t = {}) {
|
|
|
7231
7305
|
let i = t.drawableID;
|
|
7232
7306
|
if (!Number.isInteger(i) || i < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
|
|
7233
7307
|
let a = await p().resolveSkin(e);
|
|
7234
|
-
if (!
|
|
7308
|
+
if (!Cs(a) || !Number.isInteger(a.skinId) || a.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
|
|
7235
7309
|
r.updateDrawableSkinId(i, a.skinId), n.requestRedraw?.();
|
|
7236
7310
|
}
|
|
7237
7311
|
};
|
|
@@ -7247,18 +7321,18 @@ function Ms(e, t = {}) {
|
|
|
7247
7321
|
if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp-Asset-Manager does not provide audio playback.");
|
|
7248
7322
|
await r.call(n, { NAME: e });
|
|
7249
7323
|
}
|
|
7250
|
-
}, y = u === "svg-overlay" ?
|
|
7251
|
-
return
|
|
7324
|
+
}, y = u === "svg-overlay" ? ss(r, c) : void 0;
|
|
7325
|
+
return ho({
|
|
7252
7326
|
..._ === void 0 ? {} : { imageResolver: _ },
|
|
7253
7327
|
audio: v,
|
|
7254
7328
|
textCapability: g,
|
|
7255
7329
|
createSurface({ actor: e, actorKey: t, kind: r, style: i }) {
|
|
7256
|
-
if (!
|
|
7257
|
-
return u === "svg-overlay" ?
|
|
7330
|
+
if (!Cs(e) || typeof e.id != "string") throw new $("BUBBLE-RUNTIME-001", "Bubble actor target is invalid.");
|
|
7331
|
+
return u === "svg-overlay" ? gs(y, e, t, r, i, d) : Bs(n, e, t, r, i, d);
|
|
7258
7332
|
},
|
|
7259
7333
|
...t.scheduler === void 0 ? {} : { scheduler: t.scheduler },
|
|
7260
7334
|
...t.onAnimationError === void 0 ? {} : { onAnimationError: t.onAnimationError }
|
|
7261
7335
|
});
|
|
7262
7336
|
}
|
|
7263
7337
|
//#endregion
|
|
7264
|
-
export { $ as BubbleRuntimeAdapterError,
|
|
7338
|
+
export { $ as BubbleRuntimeAdapterError, Wo as bubbleRenderBackends, jo as createAssetManagerSvgOverlayImageCapability, os as createSvgOverlayImageAdapter, gs as createSvgOverlaySurface, ss as createSvgOverlaySurfaceManager, ts as createSvgOverlayTextAdapter, Co as createSvgTextCompositionCapability, wo as createSvgTextOverlayTextCapability, Vs as createTurboWarpBubbleComposition, So as createTurboWarpSvgTextCapability, To as createTurboWarpSvgTextOverlayTextCapability, Ko as defaultBubbleOverlayUnsupportedBehavior, Go as defaultBubbleRenderBackend };
|