@famibee/skynovel 1.64.22 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +3 -3
  2. package/dist/Button.js +131 -163
  3. package/dist/Button.js.map +1 -1
  4. package/dist/CallStack.js +19 -22
  5. package/dist/CallStack.js.map +1 -1
  6. package/dist/CmnInterface.js +91 -0
  7. package/dist/CmnInterface.js.map +1 -0
  8. package/dist/CmnLib.js +94 -0
  9. package/dist/CmnLib.js.map +1 -0
  10. package/dist/Config.js +26 -0
  11. package/dist/Config.js.map +1 -0
  12. package/dist/ConfigBase.js +152 -0
  13. package/dist/ConfigBase.js.map +1 -0
  14. package/dist/DebugMng.js +89 -102
  15. package/dist/DebugMng.js.map +1 -1
  16. package/dist/EventListenerCtn.js +21 -0
  17. package/dist/EventListenerCtn.js.map +1 -0
  18. package/dist/EventMng.js +1435 -1577
  19. package/dist/EventMng.js.map +1 -1
  20. package/dist/Grammar.js +194 -0
  21. package/dist/Grammar.js.map +1 -0
  22. package/dist/GrpLayer.js +163 -195
  23. package/dist/GrpLayer.js.map +1 -1
  24. package/dist/Layer.js +260 -0
  25. package/dist/Layer.js.map +1 -0
  26. package/dist/LayerMng.js +810 -992
  27. package/dist/LayerMng.js.map +1 -1
  28. package/dist/Main.js +144 -393
  29. package/dist/Main.js.map +1 -1
  30. package/dist/PropParser.js +936 -834
  31. package/dist/PropParser.js.map +1 -1
  32. package/dist/Reading.js +918 -786
  33. package/dist/Reading.js.map +1 -1
  34. package/dist/RubySpliter.js +59 -89
  35. package/dist/RubySpliter.js.map +1 -1
  36. package/dist/ScriptIterator.js +805 -1035
  37. package/dist/ScriptIterator.js.map +1 -1
  38. package/dist/SndBuf.js +1097 -1326
  39. package/dist/SndBuf.js.map +1 -1
  40. package/dist/SoundMng.js +124 -135
  41. package/dist/SoundMng.js.map +1 -1
  42. package/dist/SpritesMng.js +220 -232
  43. package/dist/SpritesMng.js.map +1 -1
  44. package/dist/SysBase.js +1729 -0
  45. package/dist/SysBase.js.map +1 -0
  46. package/dist/TxtLayer.js +1212 -1398
  47. package/dist/TxtLayer.js.map +1 -1
  48. package/dist/Variable.js +398 -466
  49. package/dist/Variable.js.map +1 -1
  50. package/dist/chunk.js +18 -0
  51. package/dist/gamepad.js +723 -511
  52. package/dist/gamepad.js.map +1 -1
  53. package/dist/pixi.js +13422 -0
  54. package/dist/pixi.js.map +1 -0
  55. package/dist/platform.js +424 -369
  56. package/dist/platform.js.map +1 -1
  57. package/dist/sn/AnalyzeTagArg.d.ts +1 -1
  58. package/dist/sn/AnalyzeTagArg.d.ts.map +1 -1
  59. package/dist/sn/CmnInterface.d.ts +3 -1
  60. package/dist/sn/CmnInterface.d.ts.map +1 -1
  61. package/dist/sn/CmnLib.d.ts.map +1 -1
  62. package/dist/sn/CmnTween.d.ts +7 -7
  63. package/dist/sn/CmnTween.d.ts.map +1 -1
  64. package/dist/sn/EventMng.d.ts.map +1 -1
  65. package/dist/sn/FocusMng.d.ts.map +1 -1
  66. package/dist/sn/Grammar.d.ts +1 -1
  67. package/dist/sn/Grammar.d.ts.map +1 -1
  68. package/dist/sn/Log.d.ts.map +1 -1
  69. package/dist/sn/Main.d.ts.map +1 -1
  70. package/dist/sn/Pages.d.ts.map +1 -1
  71. package/dist/sn/PropParser.d.ts +2 -2
  72. package/dist/sn/PropParser.d.ts.map +1 -1
  73. package/dist/sn/Reading.d.ts +7 -0
  74. package/dist/sn/Reading.d.ts.map +1 -1
  75. package/dist/sn/RubySpliter.d.ts.map +1 -1
  76. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  77. package/dist/sn/SndBuf.d.ts +27 -16
  78. package/dist/sn/SndBuf.d.ts.map +1 -1
  79. package/dist/sn/SoundMng.d.ts +4 -1
  80. package/dist/sn/SoundMng.d.ts.map +1 -1
  81. package/dist/sn/SysBase.d.ts.map +1 -1
  82. package/dist/sn/TxtStage.d.ts +4 -1
  83. package/dist/sn/TxtStage.d.ts.map +1 -1
  84. package/dist/test/ValTest.d.ts +1 -1
  85. package/dist/test/ValTest.d.ts.map +1 -1
  86. package/dist/web.js +653 -8
  87. package/dist/web.js.map +1 -1
  88. package/dist_app/Button.js +131 -163
  89. package/dist_app/Button.js.map +1 -1
  90. package/dist_app/CallStack.js +19 -22
  91. package/dist_app/CallStack.js.map +1 -1
  92. package/dist_app/CmnInterface.js +91 -0
  93. package/dist_app/CmnInterface.js.map +1 -0
  94. package/dist_app/CmnLib.js +94 -0
  95. package/dist_app/CmnLib.js.map +1 -0
  96. package/dist_app/Config.js +26 -0
  97. package/dist_app/Config.js.map +1 -0
  98. package/dist_app/ConfigBase.js +152 -0
  99. package/dist_app/ConfigBase.js.map +1 -0
  100. package/dist_app/DebugMng.js +92 -0
  101. package/dist_app/DebugMng.js.map +1 -0
  102. package/dist_app/EventListenerCtn.js +21 -0
  103. package/dist_app/EventListenerCtn.js.map +1 -0
  104. package/dist_app/EventMng.js +1435 -1577
  105. package/dist_app/EventMng.js.map +1 -1
  106. package/dist_app/Grammar.js +194 -0
  107. package/dist_app/Grammar.js.map +1 -0
  108. package/dist_app/GrpLayer.js +163 -195
  109. package/dist_app/GrpLayer.js.map +1 -1
  110. package/dist_app/Layer.js +260 -0
  111. package/dist_app/Layer.js.map +1 -0
  112. package/dist_app/LayerMng.js +810 -992
  113. package/dist_app/LayerMng.js.map +1 -1
  114. package/dist_app/Main.js +144 -392
  115. package/dist_app/Main.js.map +1 -1
  116. package/dist_app/PropParser.js +936 -834
  117. package/dist_app/PropParser.js.map +1 -1
  118. package/dist_app/Reading.js +918 -786
  119. package/dist_app/Reading.js.map +1 -1
  120. package/dist_app/RubySpliter.js +59 -89
  121. package/dist_app/RubySpliter.js.map +1 -1
  122. package/dist_app/ScriptIterator.js +805 -1034
  123. package/dist_app/ScriptIterator.js.map +1 -1
  124. package/dist_app/SndBuf.js +1097 -1326
  125. package/dist_app/SndBuf.js.map +1 -1
  126. package/dist_app/SoundMng.js +124 -135
  127. package/dist_app/SoundMng.js.map +1 -1
  128. package/dist_app/SpritesMng.js +220 -231
  129. package/dist_app/SpritesMng.js.map +1 -1
  130. package/dist_app/SysBase.js +1729 -0
  131. package/dist_app/SysBase.js.map +1 -0
  132. package/dist_app/TxtLayer.js +1212 -1397
  133. package/dist_app/TxtLayer.js.map +1 -1
  134. package/dist_app/Variable.js +398 -466
  135. package/dist_app/Variable.js.map +1 -1
  136. package/dist_app/app.js +211 -8
  137. package/dist_app/app.js.map +1 -1
  138. package/dist_app/appMain.js +20 -21
  139. package/dist_app/appMain.js.map +1 -1
  140. package/dist_app/chunk.js +18 -0
  141. package/dist_app/gamepad.js +723 -511
  142. package/dist_app/gamepad.js.map +1 -1
  143. package/dist_app/pixi.js +11181 -0
  144. package/dist_app/pixi.js.map +1 -0
  145. package/dist_app/platform.js +424 -369
  146. package/dist_app/platform.js.map +1 -1
  147. package/dist_app/preload.js +2 -2
  148. package/dist_app/preload.js.map +1 -1
  149. package/dist_app/sn/AnalyzeTagArg.d.ts +1 -1
  150. package/dist_app/sn/AnalyzeTagArg.d.ts.map +1 -1
  151. package/dist_app/sn/CmnInterface.d.ts +3 -1
  152. package/dist_app/sn/CmnInterface.d.ts.map +1 -1
  153. package/dist_app/sn/CmnLib.d.ts.map +1 -1
  154. package/dist_app/sn/CmnTween.d.ts +7 -7
  155. package/dist_app/sn/CmnTween.d.ts.map +1 -1
  156. package/dist_app/sn/EventMng.d.ts.map +1 -1
  157. package/dist_app/sn/FocusMng.d.ts.map +1 -1
  158. package/dist_app/sn/Grammar.d.ts +1 -1
  159. package/dist_app/sn/Grammar.d.ts.map +1 -1
  160. package/dist_app/sn/Log.d.ts.map +1 -1
  161. package/dist_app/sn/Main.d.ts.map +1 -1
  162. package/dist_app/sn/Pages.d.ts.map +1 -1
  163. package/dist_app/sn/PropParser.d.ts +2 -2
  164. package/dist_app/sn/PropParser.d.ts.map +1 -1
  165. package/dist_app/sn/Reading.d.ts +7 -0
  166. package/dist_app/sn/Reading.d.ts.map +1 -1
  167. package/dist_app/sn/RubySpliter.d.ts.map +1 -1
  168. package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
  169. package/dist_app/sn/SndBuf.d.ts +27 -16
  170. package/dist_app/sn/SndBuf.d.ts.map +1 -1
  171. package/dist_app/sn/SoundMng.d.ts +4 -1
  172. package/dist_app/sn/SoundMng.d.ts.map +1 -1
  173. package/dist_app/sn/SysBase.d.ts.map +1 -1
  174. package/dist_app/sn/TxtStage.d.ts +4 -1
  175. package/dist_app/sn/TxtStage.d.ts.map +1 -1
  176. package/dist_app/test/ValTest.d.ts +1 -1
  177. package/dist_app/test/ValTest.d.ts.map +1 -1
  178. package/package.json +24 -14
  179. package/dist/CmnTween.js +0 -193
  180. package/dist/CmnTween.js.map +0 -1
  181. package/dist/web2.js +0 -21644
  182. package/dist/web2.js.map +0 -1
  183. package/dist_app/CmnTween.js +0 -193
  184. package/dist_app/CmnTween.js.map +0 -1
  185. package/dist_app/app2.js +0 -18547
  186. package/dist_app/app2.js.map +0 -1
package/dist/TxtLayer.js CHANGED
@@ -1,1417 +1,1231 @@
1
- import { e as F, l as S, y as rt, q as P, a as j, R as A, G as B, x as G, M as X, z as tt, N as ot, w as V, S as et, u as M, r as ct } from "./web2.js";
2
- import { C as dt } from "./CmnTween.js";
3
- import { S as I } from "./SpritesMng.js";
4
- import { D as K } from "./DebugMng.js";
5
- import { a as W, T as pt } from "./Reading.js";
6
- import { R as st } from "./RubySpliter.js";
7
- import { Button as ft } from "./Button.js";
8
- const H = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", q = "[({〈「『【〔“〝", U = "─‥…", Y = H, it = new RegExp(`[${H}]`), ut = new RegExp(`[${q}]`), gt = new RegExp(`[${U}]`), _t = it;
9
- class yt {
10
- #c = H;
11
- #n = q;
12
- #r = U;
13
- #a = Y;
14
- get 行頭禁則() {
15
- return this.#c;
16
- }
17
- get 行末禁則() {
18
- return this.#n;
19
- }
20
- get 分割禁止() {
21
- return this.#r;
22
- }
23
- get ぶら下げ() {
24
- return this.#a;
25
- }
26
- #e = it;
27
- #h = ut;
28
- #p = gt;
29
- #k = _t;
30
- break_fixed = !1;
31
- break_fixed_left = 0;
32
- break_fixed_top = 0;
33
- bura = !1;
34
- lay(t) {
35
- t.kinsoku_sol && (this.#c = t.kinsoku_sol, this.#e = new RegExp(`[${this.#c}]`)), t.kinsoku_eol && (this.#n = t.kinsoku_eol, this.#l(), this.#h = new RegExp(`[${this.#n}]`)), t.kinsoku_dns && (this.#r = t.kinsoku_dns, this.#g(), this.#p = new RegExp(`[${this.#r}]`)), t.kinsoku_bura && (this.#a = t.kinsoku_bura, this.#l(), this.#g(), this.#k = new RegExp(`[${this.#a}]`)), "bura" in t && (this.bura = F(t, "bura", !1)), this.break_fixed = F(t, "break_fixed", this.break_fixed), this.break_fixed_left = S(t, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = S(t, "break_fixed_top", this.break_fixed_top);
36
- }
37
- // 禁則の競合(ぶら下げ 行末禁則 の両方に含まれる文字があってはならない)
38
- #l() {
39
- const t = this.#n.length, e = this.#a.length;
40
- if (t < e)
41
- for (let s = 0; s < t; ++s) {
42
- const i = this.#n[s];
43
- if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 行末禁則 の両方に含まれます`;
44
- }
45
- else
46
- for (let s = 0; s < e; ++s) {
47
- const i = this.#a[s];
48
- if (this.#n.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 行末禁則 の両方に含まれます`;
49
- }
50
- }
51
- // 禁則の競合(ぶら下げ 分割禁止 の両方に含まれる文字があってはならない)
52
- #g() {
53
- const t = this.#r.length, e = this.#a.length;
54
- if (t < e)
55
- for (let s = 0; s < t; ++s) {
56
- const i = this.#r[s];
57
- if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 分割禁止 の両方に含まれます`;
58
- }
59
- else
60
- for (let s = 0; s < e; ++s) {
61
- const i = this.#a[s];
62
- if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ 分割禁止 の両方に含まれます`;
63
- }
64
- }
65
- reNew(t) {
66
- t.#t(this.#c, this.#n, this.#r, this.#a), t.break_fixed = this.break_fixed, t.break_fixed_left = this.break_fixed_left, t.break_fixed_top = this.break_fixed_top, t.bura = this.bura;
67
- }
68
- #t(t, e, s, i) {
69
- this.#c !== t && (this.#c = t, this.#e = new RegExp(`[${t}]`)), this.#n !== e && (this.#n = e, this.#h = new RegExp(`[${e}]`)), this.#r !== s && (this.#r = s, this.#p = new RegExp(`[${s}]`)), this.#a !== i && (this.#a = i, this.#k = new RegExp(`[${i}]`));
70
- }
71
- record() {
72
- const t = {
73
- break_fixed: this.break_fixed,
74
- break_fixed_left: this.break_fixed_left,
75
- break_fixed_top: this.break_fixed_top,
76
- bura: this.bura
77
- };
78
- return this.#c === H && (t.行頭禁則 = this.#c), this.#n === q && (t.行末禁則 = this.#n), this.#r === U && (t.分割禁止 = this.#r), this.#a === Y && (t.ぶら下げ = this.#a), t;
79
- }
80
- playback(t) {
81
- t && (this.#t(
82
- t.行頭禁則 ?? H,
83
- t.行末禁則 ?? q,
84
- t.分割禁止 ?? U,
85
- t.ぶら下げ ?? Y
86
- ), this.break_fixed = t.break_fixed, this.break_fixed_left = t.break_fixed_left, this.break_fixed_top = t.break_fixed_top, this.bura = t.bura);
87
- }
88
- hyph(t, e, s, i, a) {
89
- let n, l = 0, h = 2, r = (b) => (r = () => !1, i === b ? (i > 0 && (t.innerHTML = a.replaceAll('class="sn_ch"', 'class="sn_ch sn_ch_in_default"')), !0) : b < 2);
90
- do {
91
- if (n = this.#_(t, e), l = n.length, r(l)) break;
92
- let b = -1 / 0;
93
- for (; h < l; ++h) {
94
- const { elm: y, rect: w, ch: C } = n[h];
95
- if (y.tagName === "RT") continue;
96
- const x = s ? w.y : w.x;
97
- if (b <= x || y.previousElementSibling?.tagName === "SPAN" && y.previousElementSibling?.innerHTML.includes("<br>") || y.parentElement?.previousElementSibling?.tagName === "SPAN" && y.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
98
- b = x, this.break_fixed || (this.break_fixed_left = w.x, this.break_fixed_top = w.y);
99
- continue;
100
- }
101
- const N = this.#u(n, h), { elm: g, rect: $, ch: o } = n[N];
102
- if (!this.break_fixed) {
103
- this.break_fixed_left = $.x, this.break_fixed_top = $.y;
104
- const p = globalThis.getComputedStyle(g), E = parseFloat(p.fontSize);
105
- s ? this.break_fixed_top += E : this.break_fixed_left += E;
106
- }
107
- b = -1 / 0;
108
- const d = h, { cont: u, ins: m } = this.bura ? this.hyph_alg_bura(n, N, o, h) : this.hyph_alg(n, N, o, h, C);
109
- if (h = m, u) continue;
110
- const v = n[h].elm, _ = v.parentElement, f = document.createElement("br");
111
- if (_.classList.contains("sn_tx")) _.insertBefore(f, v);
112
- else {
113
- const p = _.parentElement;
114
- p.classList.contains("sn_ch") ? p.parentElement.insertBefore(f, p) : p.insertBefore(f, _);
115
- }
116
- h += 2, h < d && (h = d), l = -1;
117
- break;
118
- }
119
- } while (l < 0);
120
- return [n, l];
121
- }
122
- // 一つ前の要素を探す(ルビ対応)
123
- #u(t, e) {
124
- const s = e - 1, { elm: i } = t[s];
125
- return i.tagName !== "RT" ? s - (i.style.textCombineUpright === "all" ? Array.from(i.textContent).length - 1 : 0) : s - Array.from(i.textContent).length;
126
- }
127
- #_(t, e) {
128
- const s = [];
129
- if (t.nodeType !== t.TEXT_NODE) return Array.from(t.childNodes).map((l) => this.#_(l, e)).flat();
130
- const i = t.ownerDocument.createRange();
131
- i.selectNodeContents(t);
132
- let a = 0;
133
- const n = i.endOffset;
134
- for (; a < n; ) {
135
- i.setStart(t, a), i.setEnd(t, ++a);
136
- const l = i.toString();
137
- s.push({
138
- ch: l,
139
- rect: e(i, l),
140
- elm: i.startContainer.parentElement
141
- });
142
- }
143
- return i.detach(), s;
144
- }
145
- /**
146
- * 抽象化した禁則処理アルゴリズム
147
- * @method hyph_alg
148
- * @param {IChRect[]} a - 文章の抽象化配列
149
- * @param {number} p_i - 処理要素の一つ前の添字
150
- * @param {string} p_ch - 処理要素の一つ前の文字
151
- * @param {number} i - 処理要素の添字
152
- * @param {string} ch - 処理要素の文字
153
- * @return {Object} result 戻り値
154
- * @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
155
- * @return {number} result.ins - 手前に改行を挿入すべき要素の添字
156
- */
157
- hyph_alg(t, e, s, i, a) {
158
- let n = i;
159
- if (!this.#h.test(s)) {
160
- if (this.#e.test(a))
161
- for (; (n = this.#u(t, n)) >= 0 && this.#e.test(t[n].ch); )
162
- ;
163
- else if (!(s === a && this.#p.test(s))) return { cont: !0, ins: n + 1 };
164
- }
165
- for (n = e; (n = this.#u(t, n)) >= 0 && this.#h.test(t[n].ch); )
166
- ;
167
- return { cont: !1, ins: n + 1 };
168
- }
169
- /**
170
- * 抽象化した禁則処理アルゴリズム
171
- * @method hyph_alg
172
- * @param {IChRect[]} a - 文章の抽象化配列
173
- * @param {number} p_i - 処理要素の一つ前の添字
174
- * @param {string} p_ch - 処理要素の一つ前の文字
175
- * @param {number} i - 処理要素の添字
176
- * @return {Object} result 戻り値
177
- * @return {boolean} result.cont - true: 呼び元で改行挿入せず continue
178
- * @return {number} result.ins - 手前に改行を挿入すべき要素の添字
179
- */
180
- hyph_alg_bura(t, e, s, i) {
181
- const a = this.#u(t, e), { ch: n } = t[a];
182
- if (this.#k.test(n) || this.#e.test(n)) {
183
- let h = e;
184
- (this.#k.test(s) || this.#e.test(s)) && ++h;
185
- const r = this.#u(t, h), { ch: b } = t[r], { ch: y } = t[h];
186
- if (b === y && this.#p.test(y)) return { cont: !1, ins: r };
187
- if (!this.#h.test(b)) return { cont: !1, ins: h };
188
- h = r;
189
- do
190
- if (!this.#h.test(t[h].ch)) break;
191
- while ((h = this.#u(t, h)) >= 0);
192
- return { cont: !1, ins: h + 1 };
193
- }
194
- const l = this.#u(t, a);
195
- if (i >= 3) {
196
- const { ch: h } = t[l];
197
- if (this.#p.test(n) && h === n)
198
- return { cont: !1, ins: l };
199
- if (this.#h.test(h)) {
200
- let r = l;
201
- for (; (r = this.#u(t, r)) >= 0 && this.#h.test(t[r].ch); )
202
- ;
203
- return { cont: !1, ins: r + 1 };
204
- }
205
- }
206
- return { cont: !1, ins: a };
207
- }
208
- }
209
- function mt(Q, t, e, s, i, a = !0) {
210
- const n = {
211
- escape: (o) => o.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
212
- mimeType: (o) => {
213
- const d = y(o).toLowerCase();
214
- return l()[d] || "";
215
- },
216
- dataAsUrl: N,
217
- isDataUrl: w,
218
- resolveUrl: C,
219
- getAndEncode: x,
220
- asArray: (o) => {
221
- const d = [], u = o.length;
222
- for (let m = 0; m < u; ++m) d.push(o[m]);
223
- return d;
224
- }
225
- };
226
- function l() {
227
- const o = "application/font-woff", d = "image/jpeg";
228
- return {
229
- woff: o,
230
- woff2: o,
231
- ttf: "application/font-truetype",
232
- eot: "application/vnd.ms-fontobject",
233
- png: "image/png",
234
- jpg: d,
235
- jpeg: d,
236
- gif: "image/gif",
237
- tiff: "image/tiff",
238
- svg: "image/svg+xml"
239
- };
240
- }
241
- const h = g(), r = $();
242
- function b(o) {
243
- return r.resolveAll().then((d) => {
244
- const u = document.createElement("style");
245
- return o.appendChild(u), u.appendChild(document.createTextNode(d)), o;
246
- });
247
- }
248
- function y(o) {
249
- return /\.([^./]*?)$/g.exec(o)?.[1] ?? "";
250
- }
251
- function w(o) {
252
- return o.search(/^(data:)/) !== -1;
253
- }
254
- function C(o, d) {
255
- const u = document.implementation.createHTMLDocument(), m = u.createElement("base");
256
- u.head.appendChild(m);
257
- const v = u.createElement("a");
258
- return u.body.appendChild(v), m.href = d, v.href = o, v.href;
259
- }
260
- function x(o) {
261
- return new Promise(function(u) {
262
- const m = new XMLHttpRequest();
263
- m.onreadystatechange = v, m.ontimeout = _, m.responseType = "blob", m.timeout = 3e4, m.open("GET", o, !0), m.send();
264
- function v() {
265
- if (m.readyState !== 4) return;
266
- if (m.status !== 200) {
267
- f("cannot fetch resource: " + o + ", status: " + m.status);
268
- return;
269
- }
270
- const p = new FileReader();
271
- p.onloadend = function() {
272
- const E = p.result.toString().split(/,/)[1];
273
- u(E);
274
- }, p.readAsDataURL(m.response);
275
- }
276
- function _() {
277
- f("timeout of 30000ms occured while fetching resource: " + o);
278
- }
279
- function f(p) {
280
- console.error(p), u("");
281
- }
282
- });
283
- }
284
- function N(o, d) {
285
- return "data:" + d + ";base64," + o;
286
- }
287
- function g() {
288
- const o = /url\(['"]?([^'"]+?)['"]?\)/g;
289
- return {
290
- inlineAll: v,
291
- shouldProcess: d
292
- };
293
- function d(_) {
294
- return _.search(o) !== -1;
295
- }
296
- function u(_) {
297
- const f = [];
298
- let p;
299
- for (; p = o.exec(_); )
300
- f.push(p[1]);
301
- return f.filter(function(E) {
302
- return !n.isDataUrl(E);
303
- });
304
- }
305
- function m(_, f, p, E) {
306
- return Promise.resolve(f).then((R) => p ? n.resolveUrl(R, p) : R).then(E || n.getAndEncode).then((R) => n.dataAsUrl(R, n.mimeType(f))).then((R) => _.replace(T(f), "$1" + R + "$3"));
307
- function T(R) {
308
- return new RegExp(`(url\\(['"]?)(` + n.escape(R) + `)(['"]?\\))`, "g");
309
- }
310
- }
311
- function v(_, f, p) {
312
- if (E()) return Promise.resolve(_);
313
- return Promise.resolve(_).then(u).then((T) => {
314
- let R = Promise.resolve(_);
315
- for (const J of T) R = R.then((O) => m(O, J, f, p));
316
- return R;
317
- });
318
- function E() {
319
- return !d(_);
320
- }
321
- }
322
- }
323
- function $() {
324
- return {
325
- resolveAll: o,
326
- impl: { readAll: d }
327
- };
328
- function o() {
329
- return d().then((u) => Promise.allSettled(
330
- u.map((m) => m.resolve())
331
- )).then((u) => u.join(`
332
- `));
333
- }
334
- function d() {
335
- return Promise.resolve(n.asArray(document.styleSheets)).then(m).then(u).then((_) => _.map(v));
336
- function u(_) {
337
- return _.filter((f) => f.type === CSSRule.FONT_FACE_RULE).filter((f) => h.shouldProcess(f.style.getPropertyValue("src")));
338
- }
339
- function m(_) {
340
- const f = [];
341
- for (const p of _)
342
- try {
343
- if (p.href) continue;
344
- n.asArray(p.cssRules || []).forEach(f.push.bind(f));
345
- } catch (E) {
346
- console.error("Error while reading CSS rules from " + p.href, String(E));
347
- }
348
- return f;
349
- }
350
- function v(_) {
351
- return {
352
- resolve: function() {
353
- const p = (_.parentStyleSheet || {}).href;
354
- return h.inlineAll(_.cssText, p);
355
- },
356
- src() {
357
- return _.style.getPropertyValue("src");
358
- }
359
- };
360
- }
361
- }
362
- }
363
- Promise.resolve(t).then((o) => {
364
- const d = o.cloneNode(!0);
365
- return d.style.padding = "0px", d.style.paddingRight = s + "px", d.style.paddingTop = i + "px", d.style.left = "0px", d.style.top = "0px", d.style.width = e.$width - e.pad_left - e.pad_right + "px", d.style.height = e.$height - e.pad_top - e.pad_bottom + "px", t.hidden = a, d;
366
- }).then(b).then((o) => {
367
- o.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
368
- const d = new Image();
369
- return d.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(e.$width)}px" height="${String(e.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(o).replaceAll("#", "%23").replaceAll(`
370
- `, "%0A")}</foreignObject></svg>`, new Promise((u) => {
371
- d.onload = () => u(d);
372
- });
373
- }).then((o) => new Promise((d) => setTimeout(() => d(o), 100))).then((o) => {
374
- const d = document.createElement("canvas");
375
- d.width = e.$width, d.height = e.$height, d.getContext("2d").drawImage(o, 0, 0), Q(rt.from(d));
376
- }).catch((o) => K.myTrace(`goTxt() = ${String(o)}`));
377
- }
378
- class c extends P {
379
- constructor(t, e, s) {
380
- super(), this.ctn = t, this.canFocus = e, this.sys = s, this.#e.classList.add("sn_tx"), this.#e.style.position = "absolute", c.#n.view.parentElement.appendChild(this.#e), this.addChild(this.#h), this.addChild(this.#p), this.#p.name = "grpDbgMasume";
381
- const i = j.debugLog ? ({ ch: a, rect: { x: n, y: l, width: h, height: r } }) => console.log(`🍌 masume ch:${a} x:${String(n)} y:${String(l)} w:${String(h)} h:${String(r)}`) : () => {
382
- };
383
- this.#g = c.#c.oCfg.debug.masume ? (a) => {
384
- i(a);
385
- const { x: n, y: l, width: h, height: r } = a.rect;
386
- this.#p.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(n, l, h, r).endFill();
387
- } : () => {
388
- }, this.noticeCompTxt = s.isApp && c.#c.oCfg.debug.dumpHtm ? () => {
389
- W.notifyEndProc(A);
390
- const a = this.#e.innerHTML;
391
- if (a === "") return;
392
- const { fn: n, ln: l } = c.#a.nowScrFnLn(), h = `dumpHtm ${t.name.slice(0, -7).replaceAll(":", "=")}(fn=${n} line=${String(l)})`;
393
- s.outputFile(
394
- s.path_downloads + h + ".htm",
395
- `<!doctype html><html><head><meta charset=utf-8><title>${h}</title>
396
- <h1>${h}</h1>${a.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{&quot;ch_in_style&quot;:&quot;default&quot;, &quot;ch_out_style&quot;:&quot;default&quot;}"/g, "").replaceAll(' style=""', "").replaceAll(/(<\/?ruby>)/g, `
397
- $1
398
- `).replaceAll(/<(br|\/span)>/g, `<$1>
399
- `)}`
400
- );
401
- } : () => W.notifyEndProc(A);
402
- }
403
- static #c;
404
- static #n;
405
- static init(t, e) {
406
- c.#c = t, c.#n = e;
407
- }
408
- static #r;
409
- static #a;
410
- static setEvtMng(t, e) {
411
- c.#r = t, c.#a = e;
412
- }
413
- static destroy() {
414
- c.#$ = /* @__PURE__ */ Object.create(null), c.#E = /* @__PURE__ */ Object.create(null), c.delBreak();
415
- }
416
- #e = document.createElement("span");
417
- // サンプリング元
418
- #h = new P();
419
- // サンプリング先
420
- #p = new B();
421
- static #k = {
422
- "background-color": 0,
423
- "border-bottom-width": 0,
424
- "border-left-width": 0,
425
- "border-right-width": 0,
426
- "border-top-width": 0,
427
- "margin-bottom": 0,
428
- "margin-left": 0,
429
- "margin-right": 0,
430
- "margin-top": 0
431
- };
432
- #l = new yt();
433
- noticeCompTxt = () => {
434
- };
435
- #g;
436
- // readonly #idc :TxtLayDesignCast;
437
- // readonly #idcCh = new TxtLayPadDesignCast(this);
438
- #t = {
439
- fontsize: 24,
440
- $width: 0,
441
- // レイヤサイズであり、背景色(画像)サイズ
442
- $height: 0,
443
- pad_left: 0,
444
- // paddingLeft(レイヤサイズの内側のスペーサー)
445
- pad_right: 0,
446
- // paddingRight
447
- pad_top: 0,
448
- // paddingTop
449
- pad_bottom: 0
450
- // paddingBottom
451
- };
452
- lay(t) {
453
- const e = this.#e.style;
454
- if ("style" in t)
455
- if (t.style) {
456
- const s = document.createElement("span");
457
- s.style.cssText = t.style;
458
- const i = s.style.length;
459
- for (let a = 0; a < i; ++a) {
460
- const n = s.style[a];
461
- if (n in c.#k) {
462
- K.myTrace(`${String(n)}は指定できません`, "W");
463
- continue;
464
- }
465
- e[n] = s.style[n];
466
- }
467
- !s.style.opacity && "alpha" in t && (e.opacity = String(this.ctn.alpha));
468
- } else this.#e.style.cssText = "";
469
- else "alpha" in t && (e.opacity = String(this.ctn.alpha));
470
- if ("width" in t && (e.width = String(t.width ?? "0") + "px"), "height" in t && (e.height = String(t.height ?? "0") + "px"), "pl" in t && (e.paddingLeft = String(t.pl ?? "0") + "px"), "pr" in t && (e.paddingRight = String(t.pr ?? "0") + "px"), "pt" in t && (e.paddingTop = String(t.pt ?? "0") + "px"), "pb" in t && (e.paddingBottom = String(t.pb ?? "0") + "px"), this.#l.lay(t), this.#_(), this.#o = this.ctn.position.x, e.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), e.display = this.ctn.visible ? "inline" : "none", ":redraw" in t && this.#y > 0) {
471
- const s = [
472
- this.#e.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"),
473
- `<span class='sn_ch' data-add='{"ch_in_style":"default"}'>&emsp;</span>`
474
- ];
475
- this.#z(), this.goTxt(s, !0);
476
- }
477
- }
478
- // oxlint-disable-next-line no-unused-private-class-members
479
- #u = 0;
480
- // 「g」などで下が欠ける問題対策
481
- #_() {
482
- const t = this.#e.style, e = parseFloat(t.fontSize || "0");
483
- this.#t.fontsize = e, this.#t.pad_left = parseFloat(t.paddingLeft || "0"), this.#t.pad_right = parseFloat(t.paddingRight || "0"), this.#t.pad_top = parseFloat(t.paddingTop || "0"), this.#t.pad_bottom = parseFloat(t.paddingBottom || "0"), this.#t.$width = parseFloat(t.width || "0"), this.#t.$height = parseFloat(t.height || "0"), this.position.set(this.#t.pad_left, this.#t.pad_top), this.#f = t.writingMode === "vertical-rl", this.#i = 0, this.#b = 0;
484
- const s = t.lineHeight ?? "0";
485
- this.#u = this.#f ? 0 : (s.endsWith("px") ? parseFloat(s) : e * parseFloat(s) - e) / 2;
486
- }
487
- cvsResize() {
488
- const t = this.#e.style, e = this.sys.cvsScale;
489
- t.left = `${String(this.sys.ofsLeft4elm + this.#o * e)}px`, t.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * e)}px`, t.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * e)}, ${String(this.ctn.scale.y * e)})`;
490
- }
491
- #o = 0;
492
- #f = !1;
493
- get tategaki() {
494
- return this.#f;
495
- }
496
- #i = 0;
497
- #b = 0;
498
- get infTL() {
499
- return this.#t;
500
- }
501
- get getWidth() {
502
- return this.#t.$width;
503
- }
504
- get getHeight() {
505
- return this.#t.$height;
506
- }
507
- setMySize(t, e) {
508
- this.#t.$width = t, this.#t.$height = e, this.#e.style.width = String(this.#t.$width) + "px", this.#e.style.height = String(this.#t.$height) + "px";
509
- }
510
- #s = [];
511
- // FIFO実行バッファ
512
- goTxt(t, e) {
513
- const s = () => this.#m(t, e);
514
- this.#s.push(s) === 1 && s();
515
- }
516
- #v = [];
517
- #y = 0;
518
- static #q = "<span class='sn_ch sn_ch_last'>&emsp;</span>";
519
- #m(t, e) {
520
- c.#O.visible = !1;
521
- let s = this.#v.length, i = "";
522
- if (s === 0) {
523
- if (c.#c.oCfg.debug.masume && (j.debugLog && console.log(`🍌 masume ${this.name} v:${String(this.visible)} l:${String(this.x)} t:${String(this.y)} a:${String(this.alpha)} pl:${String(this.#t.pad_left)} pr:${String(this.#t.pad_right)} pt:${String(this.#t.pad_top)} pb:${String(this.#t.pad_bottom)} w:${String(this.#t.$width)} h:${String(this.#t.$height)}`), this.#p.clear().beginFill(3407616, 0.2).lineStyle(1, 3407616, 1).drawRect(-this.#t.pad_left, -this.#t.pad_top, this.#t.$width, this.#t.$height).endFill().beginFill(13311, 0.2).lineStyle(2, 13311, 1).drawRect(
524
- 0,
525
- 0,
526
- this.#t.$width - this.#t.pad_left - this.#t.pad_right,
527
- this.#t.$height - this.#t.pad_top - this.#t.pad_bottom
528
- ).endFill()), this.#e.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + c.#q, !this.#l.break_fixed) {
529
- const g = globalThis.getComputedStyle(this.#e), $ = parseFloat(g.fontSize);
530
- this.#f ? (this.#l.break_fixed_left = (this.#t.$width - this.#t.pad_left - this.#t.pad_right - $ * 1.5) * this.sys.cvsScale, this.#l.break_fixed_top = 0) : (this.#l.break_fixed_left = 0, this.#l.break_fixed_top = $ / 2 * this.sys.cvsScale);
531
- }
532
- } else
533
- i = this.#e.innerHTML, --s, this.#e.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#e.querySelectorAll(":scope > br").forEach((g) => g.remove()), this.#e.insertAdjacentHTML(
534
- "beforeend",
535
- t.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + c.#q
536
- // 末尾改行削除挙動対策
537
- );
538
- this.#e.querySelectorAll(".sn_ch:has(> ruby)").forEach((g) => {
539
- g.style.background = "";
540
- }), this.#y = t.length;
541
- const a = this.sys.cvsScale, n = this.#e.getBoundingClientRect(), l = n.left + this.#t.pad_left, h = n.top + this.#t.pad_top;
542
- let r;
543
- if (a === 1) r = (g, $) => {
544
- const o = g.getBoundingClientRect();
545
- return new X(
546
- o.left - l,
547
- o.top - h,
548
- o.width,
549
- o.height + ("gjqy".includes($) ? this.#u : 0)
550
- );
551
- };
552
- else {
553
- const g = this.sys.ofsPadLeft_Dom2PIXI + n.left * (1 - a), $ = this.sys.ofsPadTop_Dom2PIXI + n.top * (1 - a);
554
- r = (o, d) => {
555
- const u = o.getBoundingClientRect();
556
- return new X(
557
- (u.left - g) / a - l,
558
- (u.top - $) / a - h,
559
- u.width / a,
560
- (u.height + ("gjqy".includes(d) ? this.#u : 0)) / a
561
- );
562
- };
563
- }
564
- const [b, y] = this.#l.hyph(this.#e, r, this.#f, s, i);
565
- this.#v = b;
566
- const w = dt.ease(this.#C);
567
- for (let g = s; g < y; ++g) {
568
- const $ = this.#v[g], { elm: { dataset: o, parentElement: d }, rect: u } = $, m = JSON.parse(o.arg ?? '{"delay": 0}'), v = JSON.parse(o.add ?? "{}"), _ = c.#$[v.ch_in_style];
569
- if (this.#g($), o.cmd === "grp") {
570
- const f = new P();
571
- this.#h.addChild(f), new I(m.pic, f, (p) => {
572
- this.#B(f, m, v, u, w, _ ?? {}), f.parent || f.removeChild(p);
573
- });
574
- }
575
- if (o.lnk) {
576
- const f = d.closest("[data-arg]"), p = JSON.parse(f.dataset.arg ?? "{}");
577
- p.key = `lnk=[${String(g)}] ` + this.name;
578
- const E = new G();
579
- this.#B(E, p, v, u, w, _ ?? {});
580
- const T = p.style ?? "", R = T + (p.style_hover ?? ""), J = T + (p.style_clicked ?? ""), O = p.r_style ?? "", nt = O + (p.r_style_hover ?? ""), at = O + (p.r_style_clicked ?? ""), Z = Array.from(f.getElementsByTagName("rt"));
581
- for (const z of Z) z.dataset.st_r_bk = z.style.cssText;
582
- const ht = f.style.cssText, D = (z, lt) => {
583
- f.style.cssText = ht + z;
584
- for (const L of Z) L.style.cssText = L.dataset.st_r_bk + lt;
585
- };
586
- F(p, "enabled", !0) ? c.#r.button(
587
- p,
588
- E,
589
- () => D(T, O),
590
- () => this.canFocus() ? (D(R, nt), !0) : !1,
591
- () => D(J, at)
592
- ) : D(
593
- T + (p.style_disable ?? "color: gray;"),
594
- O + (p.r_style_disable ?? "color: gray;")
595
- ), this.#h.addChild(E);
596
- }
597
- }
598
- const C = Array.from(this.#e.getElementsByClassName("sn_ch_yet"));
599
- this.#S = () => {
600
- this.#S = () => !1;
601
- for (const $ of C) $.className = "sn_ch";
602
- c.#O.position.set(
603
- this.#l.break_fixed_left,
604
- this.#l.break_fixed_top
605
- ), c.#O.visible = !0, this.noticeCompTxt();
606
- const g = this.#s.shift();
607
- return this.#s.length > 0 && g(), !0;
608
- };
609
- for (const g of C) g.className = g.className.replace("sn_ch_yet sn", "go");
610
- s > 0 && ++s;
611
- let x;
612
- for (let g = y - 2; g >= 0; --g) {
613
- const { elm: $ } = this.#v[g];
614
- if ($.tagName === "SPAN") {
615
- x = $.parentElement?.tagName === "RUBY" ? $.parentElement.parentElement ?? $ : $;
616
- break;
617
- }
618
- }
619
- if (!x || e || s === y) {
620
- this.#S();
621
- return;
622
- }
623
- const N = () => {
624
- x.removeEventListener("animationend", N), this.#S();
625
- };
626
- x.addEventListener("animationend", N, { once: !0, signal: this.#N.signal });
627
- }
628
- #S = () => !1;
629
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
630
- #B(t, e, s, i, a, n) {
631
- t.alpha = 0, e.x && (i.x = e.x.startsWith("=") ? i.x + parseInt(e.x.slice(1)) : parseInt(e.x)), e.y && (i.y = e.y.startsWith("=") ? i.y + parseInt(e.y.slice(1)) : parseInt(e.y)), e.width && (i.width = parseInt(e.width)), e.height && (i.height = parseInt(e.height)), e.wait && (n.wait = e.wait), t.width = i.width, t.height = i.height, n.x ? t.position.set(
632
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
633
- n.x.startsWith("=") ? i.x + t.width * n.nx : n.nx,
634
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
635
- n.y.startsWith("=") ? i.y + t.height * n.ny : n.ny
636
- ) : t.position.set(i.x, i.y);
637
- const l = {
638
- sp: t,
639
- tw: new pt(t).to({ alpha: 1, x: i.x, y: i.y, width: i.width, height: i.height, angle: 0 }, n.wait ?? 0).easing(a).delay((s.wait ?? 0) + (e.delay ?? 0)).onComplete(() => {
640
- l.tw = void 0;
641
- }).start()
642
- };
643
- this.#P.push(l);
644
- }
645
- #P = [];
646
- skipChIn() {
647
- let t = this.#S();
648
- for (const e of this.#P)
649
- e.tw && (e.tw.stop().end(), t = !0);
650
- return this.#P = [], t;
651
- }
652
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
653
- static #$ = /* @__PURE__ */ Object.create(null);
654
- static #W = /[{\s.,*{]/;
655
- // https://regex101.com/r/APC91I/1
656
- static initChStyle() {
657
- c.#$ = /* @__PURE__ */ Object.create(null), c.#E = /* @__PURE__ */ Object.create(null);
658
- }
659
- static getChInStyle(t) {
660
- return c.#$[t];
661
- }
662
- static ch_in_style(t) {
663
- const { name: e } = t;
664
- if (!e) throw "nameは必須です";
665
- if (c.#W.test(e)) throw `name【${e}】に使えない文字が含まれます`;
666
- if (e in c.#$) throw `name【${e}】はすでにあります`;
667
- const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
668
- return c.#$[e] = {
669
- wait: S(t, "wait", 500),
670
- // アニメ・FI時間
671
- alpha: S(t, "alpha", 0),
672
- x: s,
673
- // 初期x値
674
- y: i,
675
- // [tsy]と同様に絶対・相対指定可能
676
- // {x:500} X位置を500に
677
- // {x:'=500'} 現在のX位置に+500加算した位置
678
- // {x:'=-500'} 現在のX位置に-500加算した位置
679
- // {x:'250,500'} +250から+500までの間でランダムな値をX位置に
680
- // {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
681
- nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
682
- ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
683
- scale_x: S(t, "scale_x", 1),
684
- scale_y: S(t, "scale_y", 1),
685
- rotate: S(t, "rotate", 0),
686
- join: F(t, "join", !0),
687
- // 文字を順番に出すか(true)同時か(false)
688
- ease: t.ease ?? "ease-out"
689
- };
690
- }
691
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
692
- static #E = /* @__PURE__ */ Object.create(null);
693
- static getChOutStyle(t) {
694
- return c.#E[t];
695
- }
696
- static ch_out_style(t) {
697
- const { name: e } = t;
698
- if (!e) throw "nameは必須です";
699
- if (c.#W.test(e)) throw `name【${e}】に使えない文字が含まれます`;
700
- if (e in c.#E) throw `name【${e}】はすでにあります`;
701
- const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
702
- return c.#E[e] = {
703
- wait: S(t, "wait", 500),
704
- // アニメ・FI時間
705
- alpha: S(t, "alpha", 0),
706
- x: s,
707
- // 初期x値
708
- y: i,
709
- // [tsy]と同様に絶対・相対指定可能
710
- // {x:500} X位置を500に
711
- // {x:'=500'} 現在のX位置に+500加算した位置
712
- // {x:'=-500'} 現在のX位置に-500加算した位置
713
- // {x:'250,500'} +250から+500までの間でランダムな値をX位置に
714
- // {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
715
- nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
716
- ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
717
- scale_x: S(t, "scale_x", 1),
718
- scale_y: S(t, "scale_y", 1),
719
- rotate: S(t, "rotate", 0),
720
- join: F(t, "join", !1),
721
- // 文字を順番に出すか(true)同時か(false)
722
- ease: t.ease ?? "ease-out"
723
- };
724
- }
725
- static #O = new P();
726
- static #H = new I();
727
- dispBreak(t) {
728
- c.delBreak();
729
- const e = c.#O;
730
- e.visible = !1, this.addChild(e), c.#H.destroy(), c.#H = new I(t.pic, e, (s) => {
731
- e.parent ? (s.x = S(t, "x", 0), s.y = S(t, "y", 0), s.width = S(t, "width", this.#t.fontsize), s.height = S(t, "height", this.#t.fontsize)) : e.removeChild(s);
732
- });
733
- }
734
- static delBreak() {
735
- const t = c.#O;
736
- t.parent?.removeChild(t), c.#H.destroy();
737
- }
738
- #C = "Quadratic.Out";
739
- #R = "Quadratic.Out";
740
- #N = new AbortController();
741
- #z() {
742
- this.#p.clear(), this.#v = [], this.#y = 0, this.#s = [], this.#N.abort(), this.#N = new AbortController(), this.skipChIn();
743
- const t = document.createElement("span");
744
- t.style.cssText = this.#e.style.cssText, t.classList.value = this.#e.classList.value;
745
- const e = this.#e, s = Array.from(e.getElementsByClassName("sn_ch"));
746
- e.parentElement.insertBefore(t, e);
747
- let i = 0;
748
- s.forEach((n) => {
749
- const l = JSON.parse(
750
- n.dataset.add ?? // 通常文字
751
- n.children[0]?.getAttribute("data-add") ?? // ルビ
752
- n.children[0]?.children[0]?.getAttribute("data-add") ?? "{}"
753
- // 縦中横
754
- );
755
- if (!l.ch_out_style) return;
756
- const h = c.#E[l.ch_out_style];
757
- if (h) {
758
- if (h.wait === 0) {
759
- n.style.display = "none";
760
- return;
761
- }
762
- i += h.wait, h.join || (n.style.animationDelay = "0ms"), n.classList.add(`go_ch_out_${String(l.ch_out_style)}`);
763
- }
764
- });
765
- const a = () => {
766
- e.parentElement.removeChild(e);
767
- for (const n of this.#h.removeChildren())
768
- n instanceof P && c.#r.unButton(n), n.destroy();
769
- };
770
- if (i === 0)
771
- this.#e.textContent = "", this.#e = document.createElement("span"), a();
772
- else {
773
- const n = e.lastElementChild;
774
- if (n) {
775
- const l = () => {
776
- n.removeEventListener("animationend", l), a();
777
- };
778
- n.addEventListener("animationend", l, { once: !0, signal: this.#N.signal });
779
- } else a();
780
- }
781
- this.#e = t;
782
- }
783
- reNew() {
784
- this.#z();
785
- const t = new c(this.ctn, this.canFocus, this.sys);
786
- return t.#t = this.#t, t.#e.style.cssText = this.#e.style.cssText, t.#o = this.#o, t.name = this.name, t.#_(), t.#F = this.#F, t.#C = this.#C, t.#R = this.#R, this.#l.reNew(t.#l), this.destroy(), t;
787
- }
788
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
789
- #F = void 0;
790
- // 文字にかけるフィルター
791
- record() {
792
- return {
793
- infTL: this.#t,
794
- cssText: this.#e.style.cssText,
795
- left: this.#o,
796
- // idc_hArg : this.#idc.gethArg(),
797
- ch_filter: this.#F,
798
- fi_easing: this.#C,
799
- fo_easing: this.#R,
800
- hyph: this.#l.record()
801
- };
802
- }
803
- playback(t) {
804
- this.#t = t.infTL, this.position.set(this.#t.pad_left, this.#t.pad_top), this.#e.style.cssText = t.cssText, this.#o = t.left, this.#_(), this.#F = t.ch_filter, this.#C = t.fi_easing, this.#R = t.fo_easing, this.#l.playback(t.hyph);
805
- }
806
- get cssText() {
807
- return this.#e.style.cssText;
808
- }
809
- set cssText(t) {
810
- this.#e.style.cssText = t;
811
- }
812
- #d = void 0;
813
- snapshot(t, e) {
814
- mt((s) => {
815
- this.#d = G.from(s), this.#f && (this.#d.x += j.stageW - (this.#o + this.#t.$width)), this.#d.y -= this.#b, this.#d.texture.frame = new X(
816
- 0,
817
- 0,
818
- Math.min(this.#d.width, this.#t.$width - this.#o),
819
- Math.min(this.#d.height, this.#t.$height)
820
- ), this.#h.addChild(this.#d), t.render(this.#d, { clear: !1 }), e();
821
- }, this.#e, this.#t, this.#i, this.#b, !1);
822
- }
823
- snapshot_end() {
824
- this.#d && (this.#h.removeChild(this.#d), this.#d = void 0);
825
- }
826
- makeDesignCast(t) {
827
- }
828
- showDesignCast() {
829
- }
830
- // showDesignCast() {this.#idc.visible = true; this.#idcCh.visible = true}
831
- dump() {
832
- const t = [], e = this.#e.style, s = e.length;
833
- for (let i = 0; i < s; ++i) {
834
- const a = e[i];
835
- t.push(`"${String(a)}":"${e[a].replaceAll(/(["\\])/g, "\\$1")}"`);
836
- }
837
- return `"txt":"${this.#e.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${t.join(",")}}`;
838
- }
839
- destroy() {
840
- c.delBreak(), this.#e.parentElement.removeChild(this.#e), this.#e = document.createElement("span"), this.removeChild(this.#h), this.removeChild(this.#p), this.#p.clear(), this.#g = () => {
841
- }, this.#s = [], this.#v = [], this.#y = 0, this.#P = [], this.#N.abort(), this.#F = void 0, super.destroy();
842
- }
1
+ import { a as RPN_COMP_CHIN, c as argChk_Color, f as initStyle, g as uint, l as argChk_Num, o as addStyle, s as argChk_Boolean, t as CmnLib } from "./CmnLib.js";
2
+ import { f as Texture, h as Rectangle, m as Container, o as Sprite, s as Graphics } from "./pixi.js";
3
+ import "./EventListenerCtn.js";
4
+ import { n as SEARCH_PATH_ARG_EXT } from "./ConfigBase.js";
5
+ import { t as Layer } from "./Layer.js";
6
+ import { t as DebugMng } from "./DebugMng.js";
7
+ import { a as Group, o as Tween, r as CmnTween, t as Reading } from "./Reading.js";
8
+ import { t as SpritesMng } from "./SpritesMng.js";
9
+ import { Button } from "./Button.js";
10
+ import { t as RubySpliter } from "./RubySpliter.js";
11
+ var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", def行末禁則 = "[({〈「『【〔“〝", def分割禁止 = "─‥…", defぶら下げ = def行頭禁則, defReg行頭禁則 = /* @__PURE__ */ RegExp(`[${def行頭禁則}]`), defReg行末禁則 = /* @__PURE__ */ RegExp(`[${def行末禁則}]`), defReg分割禁止 = /* @__PURE__ */ RegExp(`[${def分割禁止}]`), defRegぶら下げ = defReg行頭禁則, Hyphenation = class {
12
+ #e = def行頭禁則;
13
+ #t = def行末禁則;
14
+ #n = def分割禁止;
15
+ #r = defぶら下げ;
16
+ get 行頭禁則() {
17
+ return this.#e;
18
+ }
19
+ get 行末禁則() {
20
+ return this.#t;
21
+ }
22
+ get 分割禁止() {
23
+ return this.#n;
24
+ }
25
+ get ぶら下げ() {
26
+ return this.#r;
27
+ }
28
+ #i = defReg行頭禁則;
29
+ #a = defReg行末禁則;
30
+ #o = defReg分割禁止;
31
+ #s = defRegぶら下げ;
32
+ break_fixed = !1;
33
+ break_fixed_left = 0;
34
+ break_fixed_top = 0;
35
+ bura = !1;
36
+ lay(e) {
37
+ e.kinsoku_sol && (this.#e = e.kinsoku_sol, this.#i = /* @__PURE__ */ RegExp(`[${this.#e}]`)), e.kinsoku_eol && (this.#t = e.kinsoku_eol, this.#c(), this.#a = /* @__PURE__ */ RegExp(`[${this.#t}]`)), e.kinsoku_dns && (this.#n = e.kinsoku_dns, this.#l(), this.#o = /* @__PURE__ */ RegExp(`[${this.#n}]`)), e.kinsoku_bura && (this.#r = e.kinsoku_bura, this.#c(), this.#l(), this.#s = /* @__PURE__ */ RegExp(`[${this.#r}]`)), "bura" in e && (this.bura = argChk_Boolean(e, "bura", !1)), this.break_fixed = argChk_Boolean(e, "break_fixed", this.break_fixed), this.break_fixed_left = argChk_Num(e, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = argChk_Num(e, "break_fixed_top", this.break_fixed_top);
38
+ }
39
+ #c() {
40
+ let e = this.#t.length, p = this.#r.length;
41
+ if (e < p) for (let p = 0; p < e; ++p) {
42
+ let e = this.#t[p];
43
+ if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 行末禁則 の両方に含まれます`;
44
+ }
45
+ else for (let e = 0; e < p; ++e) {
46
+ let p = this.#r[e];
47
+ if (this.#t.includes(p)) throw `禁則の競合があります。文字 ${String(p)} がぶら下げ と 行末禁則 の両方に含まれます`;
48
+ }
49
+ }
50
+ #l() {
51
+ let e = this.#n.length, p = this.#r.length;
52
+ if (e < p) for (let p = 0; p < e; ++p) {
53
+ let e = this.#n[p];
54
+ if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 分割禁止 の両方に含まれます`;
55
+ }
56
+ else for (let e = 0; e < p; ++e) {
57
+ let p = this.#r[e];
58
+ if (this.#n.includes(p)) throw `禁則の競合があります。文字 ${String(p)} がぶら下げ と 分割禁止 の両方に含まれます`;
59
+ }
60
+ }
61
+ reNew(e) {
62
+ e.#u(this.#e, this.#t, this.#n, this.#r), e.break_fixed = this.break_fixed, e.break_fixed_left = this.break_fixed_left, e.break_fixed_top = this.break_fixed_top, e.bura = this.bura;
63
+ }
64
+ #u(e, p, m, h) {
65
+ this.#e !== e && (this.#e = e, this.#i = /* @__PURE__ */ RegExp(`[${e}]`)), this.#t !== p && (this.#t = p, this.#a = /* @__PURE__ */ RegExp(`[${p}]`)), this.#n !== m && (this.#n = m, this.#o = /* @__PURE__ */ RegExp(`[${m}]`)), this.#r !== h && (this.#r = h, this.#s = /* @__PURE__ */ RegExp(`[${h}]`));
66
+ }
67
+ record() {
68
+ let e = {
69
+ break_fixed: this.break_fixed,
70
+ break_fixed_left: this.break_fixed_left,
71
+ break_fixed_top: this.break_fixed_top,
72
+ bura: this.bura
73
+ };
74
+ return this.#e === def行頭禁則 && (e.行頭禁則 = this.#e), this.#t === def行末禁則 && (e.行末禁則 = this.#t), this.#n === def分割禁止 && (e.分割禁止 = this.#n), this.#r === defぶら下げ && (e.ぶら下げ = this.#r), e;
75
+ }
76
+ playback(e) {
77
+ e && (this.#u(e.行頭禁則 ?? def行頭禁則, e.行末禁則 ?? def行末禁則, e.分割禁止 ?? def分割禁止, e.ぶら下げ ?? defぶら下げ), this.break_fixed = e.break_fixed, this.break_fixed_left = e.break_fixed_left, this.break_fixed_top = e.break_fixed_top, this.bura = e.bura);
78
+ }
79
+ hyph(e, p, m, h, g) {
80
+ let _, v = 0, y = 2, b = (p) => (b = () => !1, h === p ? (h > 0 && (e.innerHTML = g.replaceAll("class=\"sn_ch\"", "class=\"sn_ch sn_ch_in_default\"")), !0) : p < 2);
81
+ do {
82
+ if (_ = this.#f(e, p), v = _.length, b(v)) break;
83
+ let h = -Infinity;
84
+ for (; y < v; ++y) {
85
+ let { elm: e, rect: p, ch: g } = _[y];
86
+ if (e.tagName === "RT") continue;
87
+ let b = m ? p.y : p.x;
88
+ if (h <= b || e.previousElementSibling?.tagName === "SPAN" && e.previousElementSibling?.innerHTML.includes("<br>") || e.parentElement?.previousElementSibling?.tagName === "SPAN" && e.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
89
+ h = b, this.break_fixed || (this.break_fixed_left = p.x, this.break_fixed_top = p.y);
90
+ continue;
91
+ }
92
+ let x = this.#d(_, y), { elm: S, rect: C, ch: w } = _[x];
93
+ if (!this.break_fixed) {
94
+ this.break_fixed_left = C.x, this.break_fixed_top = C.y;
95
+ let e = globalThis.getComputedStyle(S), p = parseFloat(e.fontSize);
96
+ m ? this.break_fixed_top += p : this.break_fixed_left += p;
97
+ }
98
+ h = -Infinity;
99
+ let T = y, { cont: E, ins: D } = this.bura ? this.hyph_alg_bura(_, x, w, y) : this.hyph_alg(_, x, w, y, g);
100
+ if (y = D, E) continue;
101
+ let O = _[y].elm, k = O.parentElement, A = document.createElement("br");
102
+ if (k.classList.contains("sn_tx")) k.insertBefore(A, O);
103
+ else {
104
+ let e = k.parentElement;
105
+ e.classList.contains("sn_ch") ? e.parentElement.insertBefore(A, e) : e.insertBefore(A, k);
106
+ }
107
+ y += 2, y < T && (y = T), v = -1;
108
+ break;
109
+ }
110
+ } while (v < 0);
111
+ return [_, v];
112
+ }
113
+ #d(e, p) {
114
+ let m = p - 1, { elm: h } = e[m];
115
+ return h.tagName === "RT" ? m - Array.from(h.textContent).length : m - (h.style.textCombineUpright === "all" ? Array.from(h.textContent).length - 1 : 0);
116
+ }
117
+ #f(e, p) {
118
+ let m = [];
119
+ if (e.nodeType !== e.TEXT_NODE) return Array.from(e.childNodes).map((e) => this.#f(e, p)).flat();
120
+ let h = e.ownerDocument.createRange();
121
+ h.selectNodeContents(e);
122
+ let g = 0, _ = h.endOffset;
123
+ for (; g < _;) {
124
+ h.setStart(e, g), h.setEnd(e, ++g);
125
+ let _ = h.toString();
126
+ m.push({
127
+ ch: _,
128
+ rect: p(h, _),
129
+ elm: h.startContainer.parentElement
130
+ });
131
+ }
132
+ return h.detach(), m;
133
+ }
134
+ hyph_alg(e, p, m, h, g) {
135
+ let _ = h;
136
+ if (!this.#a.test(m)) {
137
+ if (this.#i.test(g)) for (; (_ = this.#d(e, _)) >= 0 && this.#i.test(e[_].ch););
138
+ else if (!(m === g && this.#o.test(m))) return {
139
+ cont: !0,
140
+ ins: _ + 1
141
+ };
142
+ }
143
+ for (_ = p; (_ = this.#d(e, _)) >= 0 && this.#a.test(e[_].ch););
144
+ return {
145
+ cont: !1,
146
+ ins: _ + 1
147
+ };
148
+ }
149
+ hyph_alg_bura(e, p, m, h) {
150
+ let g = this.#d(e, p), { ch: _ } = e[g];
151
+ if (this.#s.test(_) || this.#i.test(_)) {
152
+ let h = p;
153
+ (this.#s.test(m) || this.#i.test(m)) && ++h;
154
+ let g = this.#d(e, h), { ch: _ } = e[g], { ch: v } = e[h];
155
+ if (_ === v && this.#o.test(v)) return {
156
+ cont: !1,
157
+ ins: g
158
+ };
159
+ if (!this.#a.test(_)) return {
160
+ cont: !1,
161
+ ins: h
162
+ };
163
+ h = g;
164
+ do
165
+ if (!this.#a.test(e[h].ch)) break;
166
+ while ((h = this.#d(e, h)) >= 0);
167
+ return {
168
+ cont: !1,
169
+ ins: h + 1
170
+ };
171
+ }
172
+ let v = this.#d(e, g);
173
+ if (h >= 3) {
174
+ let { ch: p } = e[v];
175
+ if (this.#o.test(_) && p === _) return {
176
+ cont: !1,
177
+ ins: v
178
+ };
179
+ if (this.#a.test(p)) {
180
+ let p = v;
181
+ for (; (p = this.#d(e, p)) >= 0 && this.#a.test(e[p].ch););
182
+ return {
183
+ cont: !1,
184
+ ins: p + 1
185
+ };
186
+ }
187
+ }
188
+ return {
189
+ cont: !1,
190
+ ins: g
191
+ };
192
+ }
193
+ };
194
+ function htm2tx(e, p, m, h, g, _ = !0) {
195
+ let v = {
196
+ escape: (e) => e.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
197
+ mimeType: (e) => {
198
+ let p = w(e).toLowerCase();
199
+ return y()[p] || "";
200
+ },
201
+ dataAsUrl: k,
202
+ isDataUrl: T,
203
+ resolveUrl: E,
204
+ getAndEncode: O,
205
+ asArray: (e) => {
206
+ let p = [], m = e.length;
207
+ for (let h = 0; h < m; ++h) p.push(e[h]);
208
+ return p;
209
+ }
210
+ };
211
+ function y() {
212
+ let e = "application/font-woff", p = "image/jpeg";
213
+ return {
214
+ woff: e,
215
+ woff2: e,
216
+ ttf: "application/font-truetype",
217
+ eot: "application/vnd.ms-fontobject",
218
+ png: "image/png",
219
+ jpg: p,
220
+ jpeg: p,
221
+ gif: "image/gif",
222
+ tiff: "image/tiff",
223
+ svg: "image/svg+xml"
224
+ };
225
+ }
226
+ let x = A(), S = j();
227
+ function C(e) {
228
+ return S.resolveAll().then((p) => {
229
+ let m = document.createElement("style");
230
+ return e.appendChild(m), m.appendChild(document.createTextNode(p)), e;
231
+ });
232
+ }
233
+ function w(e) {
234
+ return /\.([^./]*?)$/g.exec(e)?.[1] ?? "";
235
+ }
236
+ function T(e) {
237
+ return e.search(/^(data:)/) !== -1;
238
+ }
239
+ function E(e, p) {
240
+ let m = document.implementation.createHTMLDocument(), h = m.createElement("base");
241
+ m.head.appendChild(h);
242
+ let g = m.createElement("a");
243
+ return m.body.appendChild(g), h.href = p, g.href = e, g.href;
244
+ }
245
+ function O(e) {
246
+ let p = 3e4;
247
+ return new Promise(function(m) {
248
+ let h = new XMLHttpRequest();
249
+ h.onreadystatechange = g, h.ontimeout = _, h.responseType = "blob", h.timeout = p, h.open("GET", e, !0), h.send();
250
+ function g() {
251
+ if (h.readyState !== 4) return;
252
+ if (h.status !== 200) {
253
+ v("cannot fetch resource: " + e + ", status: " + h.status);
254
+ return;
255
+ }
256
+ let p = new FileReader();
257
+ p.onloadend = function() {
258
+ let e = p.result.toString().split(/,/)[1];
259
+ m(e);
260
+ }, p.readAsDataURL(h.response);
261
+ }
262
+ function _() {
263
+ v("timeout of " + p + "ms occured while fetching resource: " + e);
264
+ }
265
+ function v(e) {
266
+ console.error(e), m("");
267
+ }
268
+ });
269
+ }
270
+ function k(e, p) {
271
+ return "data:" + p + ";base64," + e;
272
+ }
273
+ function A() {
274
+ let e = /url\(['"]?([^'"]+?)['"]?\)/g;
275
+ return {
276
+ inlineAll: g,
277
+ shouldProcess: p
278
+ };
279
+ function p(p) {
280
+ return p.search(e) !== -1;
281
+ }
282
+ function m(p) {
283
+ let m = [], h;
284
+ for (; h = e.exec(p);) m.push(h[1]);
285
+ return m.filter(function(e) {
286
+ return !v.isDataUrl(e);
287
+ });
288
+ }
289
+ function h(e, p, m, h) {
290
+ return Promise.resolve(p).then((e) => m ? v.resolveUrl(e, m) : e).then(h || v.getAndEncode).then((e) => v.dataAsUrl(e, v.mimeType(p))).then((m) => e.replace(g(p), "$1" + m + "$3"));
291
+ function g(e) {
292
+ return RegExp("(url\\(['\"]?)(" + v.escape(e) + ")(['\"]?\\))", "g");
293
+ }
294
+ }
295
+ function g(e, g, _) {
296
+ if (v()) return Promise.resolve(e);
297
+ return Promise.resolve(e).then(m).then((p) => {
298
+ let m = Promise.resolve(e);
299
+ for (let e of p) m = m.then((p) => h(p, e, g, _));
300
+ return m;
301
+ });
302
+ function v() {
303
+ return !p(e);
304
+ }
305
+ }
306
+ }
307
+ function j() {
308
+ return {
309
+ resolveAll: e,
310
+ impl: { readAll: p }
311
+ };
312
+ function e() {
313
+ return p().then((e) => Promise.allSettled(e.map((e) => e.resolve()))).then((e) => e.join("\n"));
314
+ }
315
+ function p() {
316
+ return Promise.resolve(v.asArray(document.styleSheets)).then(p).then(e).then((e) => e.map(m));
317
+ function e(e) {
318
+ return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => x.shouldProcess(e.style.getPropertyValue("src")));
319
+ }
320
+ function p(e) {
321
+ let p = [];
322
+ for (let m of e) try {
323
+ if (m.href) continue;
324
+ v.asArray(m.cssRules || []).forEach(p.push.bind(p));
325
+ } catch (e) {
326
+ console.error("Error while reading CSS rules from " + m.href, String(e));
327
+ }
328
+ return p;
329
+ }
330
+ function m(e) {
331
+ return {
332
+ resolve: function() {
333
+ let p = (e.parentStyleSheet || {}).href;
334
+ return x.inlineAll(e.cssText, p);
335
+ },
336
+ src() {
337
+ return e.style.getPropertyValue("src");
338
+ }
339
+ };
340
+ }
341
+ }
342
+ }
343
+ Promise.resolve(p).then((e) => {
344
+ let v = e.cloneNode(!0);
345
+ return v.style.padding = "0px", v.style.paddingRight = h + "px", v.style.paddingTop = g + "px", v.style.left = "0px", v.style.top = "0px", v.style.width = m.$width - m.pad_left - m.pad_right + "px", v.style.height = m.$height - m.pad_top - m.pad_bottom + "px", p.hidden = _, v;
346
+ }).then(C).then((e) => {
347
+ e.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
348
+ let p = new Image();
349
+ return p.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(m.$width)}px" height="${String(m.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(e).replaceAll("#", "%23").replaceAll("\n", "%0A")}</foreignObject></svg>`, new Promise((e) => {
350
+ p.onload = () => e(p);
351
+ });
352
+ }).then((e) => new Promise((p) => setTimeout(() => p(e), 100))).then((p) => {
353
+ let h = document.createElement("canvas");
354
+ h.width = m.$width, h.height = m.$height, h.getContext("2d").drawImage(p, 0, 0), e(Texture.from(h));
355
+ }).catch((e) => DebugMng.myTrace(`goTxt() = ${String(e)}`));
843
356
  }
844
- class k extends tt {
845
- static #c;
846
- static #n;
847
- static #r;
848
- static #a;
849
- static init(t, e, s, i, a, n) {
850
- this.#c = t, c.init(t, n), this.#n = s, this.#a = i, this.#r = a, s.setDoRecProc((l) => this.chgDoRec(l)), e.autowc = (l) => this.#u(l), e.autowc({ enabled: !1, text: "", time: 0 }), e.ch_in_style = (l) => this.#e(l), e.ch_out_style = (l) => this.#h(l), c.initChStyle(), ot(), V(
851
- t.matchPath(".+", et.FONT).flatMap((l) => Object.values(l).map((h) => `
357
+ var TxtStage = class p extends Container {
358
+ static #e;
359
+ static #t;
360
+ static init(e, m) {
361
+ p.#e = e, p.#t = m, CmnTween.addGrp(p.grp);
362
+ }
363
+ static grp = new Group();
364
+ static #n;
365
+ static #r;
366
+ static setEvtMng(e, m) {
367
+ p.#n = e, p.#r = m;
368
+ }
369
+ static destroy() {
370
+ p.grp.removeAll(), p.#T = Object.create(null), p.#D = Object.create(null), p.delBreak();
371
+ }
372
+ #i = document.createElement("span");
373
+ #a = new Container();
374
+ #o = new Graphics();
375
+ static #s = {
376
+ "background-color": 0,
377
+ "border-bottom-width": 0,
378
+ "border-left-width": 0,
379
+ "border-right-width": 0,
380
+ "border-top-width": 0,
381
+ "margin-bottom": 0,
382
+ "margin-left": 0,
383
+ "margin-right": 0,
384
+ "margin-top": 0
385
+ };
386
+ #c = new Hyphenation();
387
+ noticeCompTxt = () => {};
388
+ #l;
389
+ constructor(m, h, g) {
390
+ super(), this.ctn = m, this.canFocus = h, this.sys = g, this.#i.classList.add("sn_tx"), this.#i.style.position = "absolute", p.#t.view.parentElement.appendChild(this.#i), this.addChild(this.#a), this.addChild(this.#o), this.#o.name = "grpDbgMasume";
391
+ let _ = CmnLib.debugLog ? ({ ch: e, rect: { x: p, y: m, width: h, height: g } }) => console.log(`🍌 masume ch:${e} x:${String(p)} y:${String(m)} w:${String(h)} h:${String(g)}`) : () => {};
392
+ this.#l = p.#e.oCfg.debug.masume ? (e) => {
393
+ _(e);
394
+ let { x: p, y: m, width: h, height: g } = e.rect;
395
+ this.#o.beginFill(6737151, .5).lineStyle(2, 16724736, 1).drawRect(p, m, h, g).endFill();
396
+ } : () => {}, this.noticeCompTxt = g.isApp && p.#e.oCfg.debug.dumpHtm ? () => {
397
+ Reading.notifyEndProc(RPN_COMP_CHIN);
398
+ let h = this.#i.innerHTML;
399
+ if (h === "") return;
400
+ let { fn: _, ln: v } = p.#r.nowScrFnLn(), y = `dumpHtm ${m.name.slice(0, -7).replaceAll(":", "=")}(fn=${_} line=${String(v)})`;
401
+ g.outputFile(g.path_downloads + y + ".htm", `<!doctype html><html><head><meta charset=utf-8><title>${y}</title>
402
+ <h1>${y}</h1>${h.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{&quot;ch_in_style&quot;:&quot;default&quot;, &quot;ch_out_style&quot;:&quot;default&quot;}"/g, "").replaceAll(" style=\"\"", "").replaceAll(/(<\/?ruby>)/g, "\n$1\n").replaceAll(/<(br|\/span)>/g, "<$1>\n")}`);
403
+ } : () => Reading.notifyEndProc(RPN_COMP_CHIN);
404
+ }
405
+ #u = {
406
+ fontsize: 24,
407
+ $width: 0,
408
+ $height: 0,
409
+ pad_left: 0,
410
+ pad_right: 0,
411
+ pad_top: 0,
412
+ pad_bottom: 0
413
+ };
414
+ lay(e) {
415
+ let m = this.#i.style;
416
+ if ("style" in e) if (e.style) {
417
+ let h = document.createElement("span");
418
+ h.style.cssText = e.style;
419
+ let g = h.style.length;
420
+ for (let e = 0; e < g; ++e) {
421
+ let g = h.style[e];
422
+ if (g in p.#s) {
423
+ DebugMng.myTrace(`${String(g)}は指定できません`, "W");
424
+ continue;
425
+ }
426
+ m[g] = h.style[g];
427
+ }
428
+ !h.style.opacity && "alpha" in e && (m.opacity = String(this.ctn.alpha));
429
+ } else this.#i.style.cssText = "";
430
+ else "alpha" in e && (m.opacity = String(this.ctn.alpha));
431
+ if ("width" in e && (m.width = String(e.width ?? "0") + "px"), "height" in e && (m.height = String(e.height ?? "0") + "px"), "pl" in e && (m.paddingLeft = String(e.pl ?? "0") + "px"), "pr" in e && (m.paddingRight = String(e.pr ?? "0") + "px"), "pt" in e && (m.paddingTop = String(e.pt ?? "0") + "px"), "pb" in e && (m.paddingBottom = String(e.pb ?? "0") + "px"), this.#c.lay(e), this.#f(), this.#p = this.ctn.position.x, m.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), m.display = this.ctn.visible ? "inline" : "none", ":redraw" in e && this.#y > 0) {
432
+ let e = [this.#i.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"), "<span class='sn_ch' data-add='{\"ch_in_style\":\"default\"}'>&emsp;</span>"];
433
+ this.#N(), this.goTxt(e, !0);
434
+ }
435
+ }
436
+ #d = 0;
437
+ #f() {
438
+ let e = this.#i.style, p = parseFloat(e.fontSize || "0");
439
+ this.#u.fontsize = p, this.#u.pad_left = parseFloat(e.paddingLeft || "0"), this.#u.pad_right = parseFloat(e.paddingRight || "0"), this.#u.pad_top = parseFloat(e.paddingTop || "0"), this.#u.pad_bottom = parseFloat(e.paddingBottom || "0"), this.#u.$width = parseFloat(e.width || "0"), this.#u.$height = parseFloat(e.height || "0"), this.position.set(this.#u.pad_left, this.#u.pad_top), this.#m = e.writingMode === "vertical-rl", this.#h = 0, this.#g = 0;
440
+ let m = e.lineHeight ?? "0";
441
+ this.#d = this.#m ? 0 : (m.endsWith("px") ? parseFloat(m) : p * parseFloat(m) - p) / 2;
442
+ }
443
+ cvsResize() {
444
+ let e = this.#i.style, p = this.sys.cvsScale;
445
+ e.left = `${String(this.sys.ofsLeft4elm + this.#p * p)}px`, e.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * p)}px`, e.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * p)}, ${String(this.ctn.scale.y * p)})`;
446
+ }
447
+ #p = 0;
448
+ #m = !1;
449
+ get tategaki() {
450
+ return this.#m;
451
+ }
452
+ #h = 0;
453
+ #g = 0;
454
+ get infTL() {
455
+ return this.#u;
456
+ }
457
+ get getWidth() {
458
+ return this.#u.$width;
459
+ }
460
+ get getHeight() {
461
+ return this.#u.$height;
462
+ }
463
+ setMySize(e, p) {
464
+ this.#u.$width = e, this.#u.$height = p, this.#i.style.width = String(this.#u.$width) + "px", this.#i.style.height = String(this.#u.$height) + "px";
465
+ }
466
+ #_ = [];
467
+ goTxt(e, p) {
468
+ let m = () => this.#x(e, p);
469
+ this.#_.push(m) === 1 && m();
470
+ }
471
+ #v = [];
472
+ #y = 0;
473
+ static #b = "<span class='sn_ch sn_ch_last'>&emsp;</span>";
474
+ #x(e, m) {
475
+ p.#O.visible = !1;
476
+ let h = this.#v.length, g = "";
477
+ if (h === 0) {
478
+ if (p.#e.oCfg.debug.masume && (CmnLib.debugLog && console.log(`🍌 masume ${this.name} v:${String(this.visible)} l:${String(this.x)} t:${String(this.y)} a:${String(this.alpha)} pl:${String(this.#u.pad_left)} pr:${String(this.#u.pad_right)} pt:${String(this.#u.pad_top)} pb:${String(this.#u.pad_bottom)} w:${String(this.#u.$width)} h:${String(this.#u.$height)}`), this.#o.clear().beginFill(3407616, .2).lineStyle(1, 3407616, 1).drawRect(-this.#u.pad_left, -this.#u.pad_top, this.#u.$width, this.#u.$height).endFill().beginFill(13311, .2).lineStyle(2, 13311, 1).drawRect(0, 0, this.#u.$width - this.#u.pad_left - this.#u.pad_right, this.#u.$height - this.#u.pad_top - this.#u.pad_bottom).endFill()), this.#i.innerHTML = [...e].join("").replaceAll(/[\n\t]/g, "") + p.#b, !this.#c.break_fixed) {
479
+ let e = globalThis.getComputedStyle(this.#i), p = parseFloat(e.fontSize);
480
+ this.#m ? (this.#c.break_fixed_left = (this.#u.$width - this.#u.pad_left - this.#u.pad_right - p * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = p / 2 * this.sys.cvsScale);
481
+ }
482
+ } else g = this.#i.innerHTML, --h, this.#i.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#i.querySelectorAll(":scope > br").forEach((e) => e.remove()), this.#i.insertAdjacentHTML("beforeend", e.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + p.#b);
483
+ this.#i.querySelectorAll(".sn_ch:has(> ruby)").forEach((e) => {
484
+ e.style.background = "";
485
+ }), this.#y = e.length;
486
+ let _ = this.sys.cvsScale, b = this.#i.getBoundingClientRect(), w = b.left + this.#u.pad_left, T = b.top + this.#u.pad_top, E;
487
+ if (_ === 1) E = (e, p) => {
488
+ let m = e.getBoundingClientRect();
489
+ return new Rectangle(m.left - w, m.top - T, m.width, m.height + ("gjqy".includes(p) ? this.#d : 0));
490
+ };
491
+ else {
492
+ let e = this.sys.ofsPadLeft_Dom2PIXI + b.left * (1 - _), p = this.sys.ofsPadTop_Dom2PIXI + b.top * (1 - _);
493
+ E = (m, h) => {
494
+ let g = m.getBoundingClientRect();
495
+ return new Rectangle((g.left - e) / _ - w, (g.top - p) / _ - T, g.width / _, (g.height + ("gjqy".includes(h) ? this.#d : 0)) / _);
496
+ };
497
+ }
498
+ let [D, O] = this.#c.hyph(this.#i, E, this.#m, h, g);
499
+ this.#v = D;
500
+ let k = CmnTween.ease(this.#A);
501
+ for (let e = h; e < O; ++e) {
502
+ let m = this.#v[e], { elm: { dataset: h, parentElement: g }, rect: _ } = m, y = JSON.parse(h.arg ?? "{\"delay\": 0}"), b = JSON.parse(h.add ?? "{}"), x = p.#T[b.ch_in_style];
503
+ if (this.#l(m), h.cmd === "grp") {
504
+ let e = new Container();
505
+ this.#a.addChild(e), new SpritesMng(y.pic, e, (p) => {
506
+ this.#C(e, y, b, _, k, x ?? {}), e.parent || e.removeChild(p);
507
+ });
508
+ }
509
+ if (h.lnk) {
510
+ let m = g.closest("[data-arg]"), h = JSON.parse(m.dataset.arg ?? "{}");
511
+ h.key = `lnk=[${String(e)}] ` + this.name;
512
+ let y = new Sprite();
513
+ this.#C(y, h, b, _, k, x ?? {});
514
+ let S = h.style ?? "", w = S + (h.style_hover ?? ""), T = S + (h.style_clicked ?? ""), E = h.r_style ?? "", D = E + (h.r_style_hover ?? ""), O = E + (h.r_style_clicked ?? ""), A = Array.from(m.getElementsByTagName("rt"));
515
+ for (let e of A) e.dataset.st_r_bk = e.style.cssText;
516
+ let j = m.style.cssText, M = (e, p) => {
517
+ m.style.cssText = j + e;
518
+ for (let e of A) e.style.cssText = e.dataset.st_r_bk + p;
519
+ };
520
+ argChk_Boolean(h, "enabled", !0) ? p.#n.button(h, y, () => M(S, E), () => this.canFocus() ? (M(w, D), !0) : !1, () => M(T, O)) : M(S + (h.style_disable ?? "color: gray;"), E + (h.r_style_disable ?? "color: gray;")), this.#a.addChild(y);
521
+ }
522
+ }
523
+ let j = Array.from(this.#i.getElementsByClassName("sn_ch_yet"));
524
+ this.#S = () => {
525
+ this.#S = () => !1;
526
+ for (let e of j) e.className = "sn_ch";
527
+ p.#O.position.set(this.#c.break_fixed_left, this.#c.break_fixed_top), p.#O.visible = !0, this.noticeCompTxt();
528
+ let e = this.#_.shift();
529
+ return this.#_.length > 0 && e(), !0;
530
+ };
531
+ for (let e of j) e.className = e.className.replace("sn_ch_yet sn", "go");
532
+ h > 0 && ++h;
533
+ let N;
534
+ for (let e = O - 2; e >= 0; --e) {
535
+ let { elm: p } = this.#v[e];
536
+ if (p.tagName === "SPAN") {
537
+ N = p.parentElement?.tagName === "RUBY" ? p.parentElement.parentElement ?? p : p;
538
+ break;
539
+ }
540
+ }
541
+ if (!N || m || h === O) {
542
+ this.#S();
543
+ return;
544
+ }
545
+ let P = () => {
546
+ N.removeEventListener("animationend", P), this.#S();
547
+ };
548
+ N.addEventListener("animationend", P, {
549
+ once: !0,
550
+ signal: this.#M.signal
551
+ });
552
+ }
553
+ #S = () => !1;
554
+ #C(e, m, h, g, _, v) {
555
+ e.alpha = 0, m.x && (g.x = m.x.startsWith("=") ? g.x + parseInt(m.x.slice(1)) : parseInt(m.x)), m.y && (g.y = m.y.startsWith("=") ? g.y + parseInt(m.y.slice(1)) : parseInt(m.y)), m.width && (g.width = parseInt(m.width)), m.height && (g.height = parseInt(m.height)), m.wait && (v.wait = m.wait), e.width = g.width, e.height = g.height, v.x ? e.position.set(v.x.startsWith("=") ? g.x + e.width * v.nx : v.nx, v.y.startsWith("=") ? g.y + e.height * v.ny : v.ny) : e.position.set(g.x, g.y);
556
+ let y = new Tween(e).to({
557
+ alpha: 1,
558
+ x: g.x,
559
+ y: g.y,
560
+ width: g.width,
561
+ height: g.height,
562
+ angle: 0
563
+ }, v.wait ?? 0).easing(_).delay((h.wait ?? 0) + (m.delay ?? 0)).onComplete(() => {
564
+ b.tw = void 0;
565
+ }).start();
566
+ p.grp.add(y);
567
+ let b = {
568
+ sp: e,
569
+ tw: y
570
+ };
571
+ this.#w.push(b);
572
+ }
573
+ #w = [];
574
+ skipChIn() {
575
+ let e = this.#S();
576
+ for (let p of this.#w) p.tw && (p.tw.stop().end(), e = !0);
577
+ return this.#w = [], e;
578
+ }
579
+ static #T = Object.create(null);
580
+ static #E = /[{\s.,*{]/;
581
+ static initChStyle() {
582
+ p.#T = Object.create(null), p.#D = Object.create(null);
583
+ }
584
+ static getChInStyle(e) {
585
+ return p.#T[e];
586
+ }
587
+ static ch_in_style(e) {
588
+ let { name: m } = e;
589
+ if (!m) throw "nameは必須です";
590
+ if (p.#E.test(m)) throw `name【${m}】に使えない文字が含まれます`;
591
+ if (m in p.#T) throw `name【${m}】はすでにあります`;
592
+ let h = String(e.x ?? "=0"), _ = String(e.y ?? "=0");
593
+ return p.#T[m] = {
594
+ wait: argChk_Num(e, "wait", 500),
595
+ alpha: argChk_Num(e, "alpha", 0),
596
+ x: h,
597
+ y: _,
598
+ nx: parseFloat(h.at(0) === "=" ? h.slice(1) : h),
599
+ ny: parseFloat(_.at(0) === "=" ? _.slice(1) : _),
600
+ scale_x: argChk_Num(e, "scale_x", 1),
601
+ scale_y: argChk_Num(e, "scale_y", 1),
602
+ rotate: argChk_Num(e, "rotate", 0),
603
+ join: argChk_Boolean(e, "join", !0),
604
+ ease: e.ease ?? "ease-out"
605
+ };
606
+ }
607
+ static #D = Object.create(null);
608
+ static getChOutStyle(e) {
609
+ return p.#D[e];
610
+ }
611
+ static ch_out_style(e) {
612
+ let { name: m } = e;
613
+ if (!m) throw "nameは必須です";
614
+ if (p.#E.test(m)) throw `name【${m}】に使えない文字が含まれます`;
615
+ if (m in p.#D) throw `name【${m}】はすでにあります`;
616
+ let h = String(e.x ?? "=0"), _ = String(e.y ?? "=0");
617
+ return p.#D[m] = {
618
+ wait: argChk_Num(e, "wait", 500),
619
+ alpha: argChk_Num(e, "alpha", 0),
620
+ x: h,
621
+ y: _,
622
+ nx: parseFloat(h.at(0) === "=" ? h.slice(1) : h),
623
+ ny: parseFloat(_.at(0) === "=" ? _.slice(1) : _),
624
+ scale_x: argChk_Num(e, "scale_x", 1),
625
+ scale_y: argChk_Num(e, "scale_y", 1),
626
+ rotate: argChk_Num(e, "rotate", 0),
627
+ join: argChk_Boolean(e, "join", !1),
628
+ ease: e.ease ?? "ease-out"
629
+ };
630
+ }
631
+ static #O = new Container();
632
+ static #k = new SpritesMng();
633
+ dispBreak(e) {
634
+ p.delBreak();
635
+ let m = p.#O;
636
+ m.visible = !1, this.addChild(m), p.#k.destroy(), p.#k = new SpritesMng(e.pic, m, (p) => {
637
+ m.parent ? (p.x = argChk_Num(e, "x", 0), p.y = argChk_Num(e, "y", 0), p.width = argChk_Num(e, "width", this.#u.fontsize), p.height = argChk_Num(e, "height", this.#u.fontsize)) : m.removeChild(p);
638
+ });
639
+ }
640
+ static delBreak() {
641
+ let e = p.#O;
642
+ e.parent?.removeChild(e), p.#k.destroy();
643
+ }
644
+ #A = "Quadratic.Out";
645
+ #j = "Quadratic.Out";
646
+ #M = new AbortController();
647
+ #N() {
648
+ this.#o.clear(), this.#v = [], this.#y = 0, this.#_ = [], this.#M.abort(), this.#M = new AbortController(), this.skipChIn();
649
+ let e = document.createElement("span");
650
+ e.style.cssText = this.#i.style.cssText, e.classList.value = this.#i.classList.value;
651
+ let m = this.#i, h = Array.from(m.getElementsByClassName("sn_ch"));
652
+ m.parentElement.insertBefore(e, m);
653
+ let g = 0;
654
+ h.forEach((e) => {
655
+ let m = JSON.parse(e.dataset.add ?? e.children[0]?.getAttribute("data-add") ?? e.children[0]?.children[0]?.getAttribute("data-add") ?? "{}");
656
+ if (!m.ch_out_style) return;
657
+ let h = p.#D[m.ch_out_style];
658
+ if (h) {
659
+ if (h.wait === 0) {
660
+ e.style.display = "none";
661
+ return;
662
+ }
663
+ g += h.wait, h.join || (e.style.animationDelay = "0ms"), e.classList.add(`go_ch_out_${String(m.ch_out_style)}`);
664
+ }
665
+ });
666
+ let _ = () => {
667
+ m.parentElement.removeChild(m);
668
+ for (let e of this.#a.removeChildren()) e instanceof Container && p.#n.unButton(e), e.destroy();
669
+ };
670
+ if (g === 0) this.#i.textContent = "", this.#i = document.createElement("span"), _();
671
+ else {
672
+ let e = m.lastElementChild;
673
+ if (e) {
674
+ let p = () => {
675
+ e.removeEventListener("animationend", p), _();
676
+ };
677
+ e.addEventListener("animationend", p, {
678
+ once: !0,
679
+ signal: this.#M.signal
680
+ });
681
+ } else _();
682
+ }
683
+ this.#i = e;
684
+ }
685
+ reNew() {
686
+ this.#N();
687
+ let e = new p(this.ctn, this.canFocus, this.sys);
688
+ return e.#u = this.#u, e.#i.style.cssText = this.#i.style.cssText, e.#p = this.#p, e.name = this.name, e.#f(), e.#P = this.#P, e.#A = this.#A, e.#j = this.#j, this.#c.reNew(e.#c), this.destroy(), e;
689
+ }
690
+ #P = void 0;
691
+ record() {
692
+ return {
693
+ infTL: this.#u,
694
+ cssText: this.#i.style.cssText,
695
+ left: this.#p,
696
+ ch_filter: this.#P,
697
+ fi_easing: this.#A,
698
+ fo_easing: this.#j,
699
+ hyph: this.#c.record()
700
+ };
701
+ }
702
+ playback(e) {
703
+ this.#u = e.infTL, this.position.set(this.#u.pad_left, this.#u.pad_top), this.#i.style.cssText = e.cssText, this.#p = e.left, this.#f(), this.#P = e.ch_filter, this.#A = e.fi_easing, this.#j = e.fo_easing, this.#c.playback(e.hyph);
704
+ }
705
+ get cssText() {
706
+ return this.#i.style.cssText;
707
+ }
708
+ set cssText(e) {
709
+ this.#i.style.cssText = e;
710
+ }
711
+ #F = void 0;
712
+ snapshot(e, p) {
713
+ htm2tx((m) => {
714
+ this.#F = Sprite.from(m), this.#m && (this.#F.x += CmnLib.stageW - (this.#p + this.#u.$width)), this.#F.y -= this.#g, this.#F.texture.frame = new Rectangle(0, 0, Math.min(this.#F.width, this.#u.$width - this.#p), Math.min(this.#F.height, this.#u.$height)), this.#a.addChild(this.#F), e.render(this.#F, { clear: !1 }), p();
715
+ }, this.#i, this.#u, this.#h, this.#g, !1);
716
+ }
717
+ snapshot_end() {
718
+ this.#F &&= (this.#a.removeChild(this.#F), void 0);
719
+ }
720
+ makeDesignCast(e) {}
721
+ showDesignCast() {}
722
+ dump() {
723
+ let e = [], p = this.#i.style, m = p.length;
724
+ for (let h = 0; h < m; ++h) {
725
+ let m = p[h];
726
+ e.push(`"${String(m)}":"${p[m].replaceAll(/(["\\])/g, "\\$1")}"`);
727
+ }
728
+ return `"txt":"${this.#i.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${e.join(",")}}`;
729
+ }
730
+ destroy() {
731
+ p.delBreak(), this.#i.parentElement.removeChild(this.#i), this.#i = document.createElement("span"), this.removeChild(this.#a), this.removeChild(this.#o), this.#o.clear(), this.#l = () => {}, this.#_ = [], this.#v = [], this.#y = 0, this.#w = [], this.#M.abort(), this.#P = void 0, super.destroy();
732
+ }
733
+ }, TxtLayer = class e extends Layer {
734
+ static #e;
735
+ static #t;
736
+ static #n;
737
+ static #r;
738
+ static init(e, p, h, g, v, y) {
739
+ this.#e = e, TxtStage.init(e, y), this.#t = h, this.#r = g, this.#n = v, h.setDoRecProc((e) => this.chgDoRec(e)), p.autowc = (e) => this.#d(e), p.autowc({
740
+ enabled: !1,
741
+ text: "",
742
+ time: 0
743
+ }), p.ch_in_style = (e) => this.#i(e), p.ch_out_style = (e) => this.#a(e), TxtStage.initChStyle(), initStyle(), addStyle(e.matchPath(".+", SEARCH_PATH_ARG_EXT.FONT).flatMap((e) => Object.values(e).map((e) => `
852
744
  @font-face {
853
- font-family: '${String(h)}';
854
- src: url('${this.#c.searchPath(String(h), et.FONT)}');
855
- }
856
- `)).join("") + `
857
- .sn_tx {
858
- pointer-events: none;
859
- user-select: none;
860
- -webkit-touch-callout: none;
861
- box-sizing: border-box;
745
+ font-family: '${String(e)}';
746
+ src: url('${this.#e.searchPath(String(e), SEARCH_PATH_ARG_EXT.FONT)}');
862
747
  }
863
- .sn_ch {
864
- position: relative;
865
- display: inline-block;
866
- }
867
- `
868
- // 「sn_ch」と「sn_ch_in_〜」の中身が重複しているが、これは必須
869
- ), this.#e({
870
- name: "default",
871
- wait: 500,
872
- alpha: 0,
873
- x: "=0.3",
874
- y: "=0",
875
- scale_x: 1,
876
- scale_y: 1,
877
- rotate: 0,
878
- join: !0,
879
- ease: "ease-out"
880
- }), this.#h({
881
- name: "default",
882
- wait: 0,
883
- alpha: 0,
884
- x: "=0",
885
- y: "=0",
886
- scale_x: 1,
887
- scale_y: 1,
888
- rotate: 0,
889
- join: !1,
890
- ease: "ease-out"
891
- });
892
- }
893
- // 文字出現演出
894
- static #e(t) {
895
- const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: y } = c.ch_in_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, C = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
896
- return V(`
897
- .sn_ch_in_${x} {
748
+ `)).join("") + "\n.sn_tx {\n pointer-events: none;\n user-select: none;\n -webkit-touch-callout: none;\n box-sizing: border-box;\n}\n.sn_ch {\n position: relative;\n display: inline-block;\n}\n"), this.#i({
749
+ name: "default",
750
+ wait: 500,
751
+ alpha: 0,
752
+ x: "=0.3",
753
+ y: "=0",
754
+ scale_x: 1,
755
+ scale_y: 1,
756
+ rotate: 0,
757
+ join: !0,
758
+ ease: "ease-out"
759
+ }), this.#a({
760
+ name: "default",
761
+ wait: 0,
762
+ alpha: 0,
763
+ x: "=0",
764
+ y: "=0",
765
+ scale_x: 1,
766
+ scale_y: 1,
767
+ rotate: 0,
768
+ join: !1,
769
+ ease: "ease-out"
770
+ });
771
+ }
772
+ static #i(e) {
773
+ let { x: p, y: m, nx: h, ny: g, alpha: v, wait: y, ease: b, rotate: x, scale_x: S, scale_y: C } = TxtStage.ch_in_style(e), w = p.startsWith("=") ? `${String(h * 100)}%` : `${String(h)}px`, T = m.startsWith("=") ? `${String(g * 100)}%` : `${String(g)}px`, { name: E = "" } = e;
774
+ return addStyle(`
775
+ .sn_ch_in_${E} {
898
776
  position: relative;
899
777
  display: inline-block;
900
778
  }
901
- .go_ch_in_${x} {
902
- opacity: ${String(n)};
779
+ .go_ch_in_${E} {
780
+ opacity: ${String(v)};
903
781
  position: relative;
904
782
  display: inline-block;
905
- animation: sn_ch_in_${x} ${String(l)}ms ${h} 0s both;
783
+ animation: sn_ch_in_${E} ${String(y)}ms ${b} 0s both;
906
784
  }
907
- @keyframes sn_ch_in_${x} {
908
- from {transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(y)}) translate(${w}, ${C})}
785
+ @keyframes sn_ch_in_${E} {
786
+ from {transform: rotate(${String(x)}deg) scale(${String(S)}, ${String(C)}) translate(${w}, ${T})}
909
787
  to {opacity: 1; transform: none;}
910
788
  }
911
789
  `), !1;
912
- }
913
- // 文字消去演出
914
- static #h(t) {
915
- const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: y } = c.ch_out_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, C = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
916
- return V(`
917
- .go_ch_out_${x} {
790
+ }
791
+ static #a(e) {
792
+ let { x: p, y: m, nx: h, ny: g, alpha: v, wait: y, ease: b, rotate: x, scale_x: S, scale_y: C } = TxtStage.ch_out_style(e), w = p.startsWith("=") ? `${String(h * 100)}%` : `${String(h)}px`, T = m.startsWith("=") ? `${String(g * 100)}%` : `${String(g)}px`, { name: E = "" } = e;
793
+ return addStyle(`
794
+ .go_ch_out_${E} {
918
795
  position: relative;
919
796
  display: inline-block;
920
- animation: go_ch_out_${x} ${String(l)}ms ${h} 0s both;
797
+ animation: go_ch_out_${E} ${String(y)}ms ${b} 0s both;
921
798
  }
922
- @keyframes go_ch_out_${x} {
799
+ @keyframes go_ch_out_${E} {
923
800
  to {
924
- opacity: ${String(n)};
925
- transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(y)}) translate(${w}, ${C});
801
+ opacity: ${String(v)};
802
+ transform: rotate(${String(x)}deg) scale(${String(S)}, ${String(C)}) translate(${w}, ${T});
926
803
  }
927
804
  `), !1;
928
- }
929
- static #p = 10;
930
- static set msecChWait(t) {
931
- k.#p = t;
932
- }
933
- static get msecChWait() {
934
- return k.#p;
935
- }
936
- static #k;
937
- static #l;
938
- static setEvtMng(t, e, s) {
939
- this.#k = t, this.#l = e, c.setEvtMng(t, s);
940
- }
941
- // 文字ごとのウェイト
942
- static #g = !1;
943
- static #t = {};
944
- static #u(t) {
945
- this.#g = F(t, "enabled", this.#g), this.#n.setVal_Nochk("save", "const.sn.autowc.enabled", this.#g);
946
- const { text: e } = t;
947
- if ("text" in t != "time" in t) throw "[autowc] textとtimeは同時指定必須です";
948
- if (this.#n.setVal_Nochk("save", "const.sn.autowc.text", e), !e)
949
- return this.#n.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
950
- const s = e.length;
951
- if (this.#g && s === 0) throw '[autowc] enabled === false かつ text === "" は許されません';
952
- const i = String(t.time).split(",");
953
- if (i.length !== s) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
954
- this.#t = {};
955
- for (let a = 0; a < s; ++a) this.#t[e[a]] = M(i[a]);
956
- return this.#n.setVal_Nochk("save", "const.sn.autowc.time", t.time), !1;
957
- }
958
- // バック
959
- #_ = 0;
960
- #o = 0;
961
- #f = !1;
962
- #i = void 0;
963
- #b = "";
964
- // 背景画像無し(=単色塗り)
965
- // 文字表示
966
- #s = new c(this.ctn, () => this.canFocus(), k.#l);
967
- #v = new st();
968
- #y = document.createElement("span");
969
- // cssチェック・保存用
970
- static #q = {
971
- "text-align": 0,
972
- "text-align-last": 0,
973
- height: 0,
974
- width: 0,
975
- "padding-left": 0,
976
- "padding-right": 0,
977
- "padding-top": 0,
978
- "padding-bottom": 0
979
- };
980
- #m = new P();
981
- constructor() {
982
- super(), this.ctn.addChild(this.#s), this.#v.init(this.#Y), this.ctn.addChild(this.#m), this.#m.name = "cntBtn", this.lay({ style: `width: ${String(j.stageW)}px; height: ${String(j.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: ${String(16)}px;`, in_style: "default", out_style: "default", back_clear: "true" });
983
- }
984
- destroy() {
985
- this.#i && (this.ctn.removeChild(this.#i).destroy(), this.#i = void 0), k.#a.pagebreak(), this.#s.destroy();
986
- }
987
- static destroy() {
988
- this.#g = !1, this.#t = {}, this.#F = (t) => t;
989
- }
990
- set name(t) {
991
- this.name_ = t, this.#s.name = t;
992
- }
993
- get name() {
994
- return this.name_;
995
- }
996
- // getは継承しないらしい
997
- cvsResize() {
998
- this.#s.cvsResize();
999
- }
1000
- cvsResizeChildren() {
1001
- for (const t of this.#m.children) t.cvsResize();
1002
- }
1003
- procSetX(t) {
1004
- this.#s.lay({ x: t });
1005
- }
1006
- procSetY(t) {
1007
- this.#s.lay({ y: t });
1008
- }
1009
- lay(t) {
1010
- if (super.lay(t), tt.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), st.setting(t), this.#H(t), this.#s.lay(t), "r_align" in t && (this.#x = t.r_align ?? ""), this.#d = j.isSafari ? this.#s.tategaki ? (i, a) => `text-align: start; height: ${String(a)}em; padding-top: ${i}; padding-bottom: ${i};` : (i, a) => `text-align: start; width: ${String(a)}em; padding-left: ${i}; padding-right: ${i};` : this.#s.tategaki ? (i) => `text-align: justify; text-align-last: justify; padding-top: ${i}; padding-bottom: ${i};` : (i) => `text-align: justify; text-align-last: justify; padding-left: ${i}; padding-right: ${i};`, j.isFirefox && (this.#U = this.#Z), "r_style" in t)
1011
- if (t.r_style) {
1012
- const i = document.createElement("span");
1013
- i.style.cssText = t.r_style;
1014
- const a = i.style.length, n = this.#y.style;
1015
- for (let l = 0; l < a; ++l) {
1016
- const h = i.style[l];
1017
- if (h in k.#q) {
1018
- K.myTrace(`${String(h)}は指定できません`, "W");
1019
- continue;
1020
- }
1021
- const r = i.style[h];
1022
- r && (n[h] = r);
1023
- }
1024
- } else this.#y.style.cssText = "";
1025
- if ("alpha" in t) for (const i of this.#m.children) i.alpha = this.ctn.alpha;
1026
- this.#S(t), this.#$(t);
1027
- const e = W.procID + `TxtLayer lay name:${this.name_}`, s = this.#O(t, (i) => {
1028
- i && W.endProc(e);
1029
- });
1030
- return s && W.beginProc(e), s;
1031
- }
1032
- #S(t) {
1033
- const { in_style: e } = t;
1034
- if (!e) return;
1035
- const s = c.getChInStyle(e);
1036
- if (!s) throw `存在しないin_style【${e}】です`;
1037
- this.#B = e, this.#P = s.join;
1038
- }
1039
- #B = "";
1040
- #P = !0;
1041
- get width() {
1042
- return this.#s.getWidth;
1043
- }
1044
- get height() {
1045
- return this.#s.getHeight;
1046
- }
1047
- #$(t) {
1048
- const { out_style: e } = t;
1049
- if (!e) return;
1050
- if (!c.getChOutStyle(e)) throw `存在しないout_style【${e}】です`;
1051
- this.#W = e;
1052
- }
1053
- #W = "";
1054
- #E = new I();
1055
- #O(t, e) {
1056
- if ("back_clear" in t)
1057
- return F(t, "back_clear", !1) && (this.#_ = 0, this.#o = 0, this.#f = !1, this.#b = ""), e(!1), !1;
1058
- this.#o = S(t, "b_alpha", this.#o), this.#f = F(t, "b_alpha_isfixed", this.#f);
1059
- const s = (this.#f ? 1 : Number(k.#n.getVal("sys:TextLayer.Back.Alpha"))) * this.#o;
1060
- if (t.b_pic) {
1061
- if (this.#b !== t.b_pic)
1062
- return this.#b = t.b_pic, this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#E = new I(this.#b, this.ctn, (i) => {
1063
- this.#i = i, i.name = "back(pic)", i.visible = s > 0, i.alpha = s, this.#s.setMySize(i.width, i.height), this.ctn.setChildIndex(i, 0), e(!0);
1064
- }), this.#E.ret;
1065
- } else "b_color" in t && (this.#_ = ct(t, "b_color", 0), this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#b = "", this.ctn.addChildAt(
1066
- (this.#i = new B()).beginFill(this.#_, s).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
1067
- 0
1068
- ), this.#i.name = "back(color)");
1069
- return this.#i && (this.#i.visible = s > 0, this.#i.alpha = s), e(!1), !1;
1070
- }
1071
- chgBackAlpha(t) {
1072
- const e = this.#f ? this.#o : t * this.#o;
1073
- this.#i instanceof B && (this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.ctn.addChildAt(
1074
- (this.#i = new B()).beginFill(this.#_, e).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
1075
- 0
1076
- ), this.#i.name = "back(color)"), this.#i && (this.#i.visible = e > 0, this.#i.alpha = e);
1077
- }
1078
- #H(t) {
1079
- "noffs" in t && (this.#N = t.noffs ?? "", this.#z = new RegExp(`[ ${this.#N}]`)), "ffs" in t && (this.#C ??= "", this.#R = this.#C === "" ? () => "" : (e) => this.#z.test(e) ? "" : ` font-feature-settings: ${this.#C};`);
1080
- }
1081
- #C = "";
1082
- #R = (t) => "";
1083
- #N = "";
1084
- // eslint-disable-next-line no-irregular-whitespace
1085
- #z = /[ ]/;
1086
- // Safariが全体に「font-feature-settings」した後、特定文字の「font-feature-settings: initial;」を受け付けてくれないのでわざわざ一つずつ指定
1087
- static chgDoRec(t) {
1088
- this.#F = t ? (e) => e : (e) => `<span class='offrec'>${e}</span>`;
1089
- }
1090
- static #F = (t) => t;
1091
- isCur = !1;
1092
- #d = () => "";
1093
- #U = (t, e, s, i = "") => {
1094
- if (!s) return ` style='${i}'`;
1095
- const a = t.length * 2;
1096
- if (a - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
1097
- let n = "";
1098
- switch (s) {
1099
- case "justify":
1100
- n = this.#d("0", a);
1101
- break;
1102
- case "121":
1103
- n = this.#d(`calc(${String((a - e.length) / (e.length * 2))}em)`, a);
1104
- break;
1105
- case "even":
1106
- n = this.#d(`calc(${String((a - e.length) / (e.length + 1))}em)`, a);
1107
- break;
1108
- case "1ruby":
1109
- n = this.#d("1em", a);
1110
- break;
1111
- default:
1112
- n = `text-align: ${s};`;
1113
- }
1114
- return ` style='${n} ${i}'`;
1115
- };
1116
- #x = "";
1117
- #Z(t, e, s, i = "") {
1118
- if (!s) return ` style='${i}'`;
1119
- const a = t.length * 2;
1120
- if (a - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
1121
- let n = "";
1122
- switch (s) {
1123
- case "left":
1124
- n = "ruby-align: start;";
1125
- break;
1126
- case "center":
1127
- n = "ruby-align: center;";
1128
- break;
1129
- case "right":
1130
- n = "ruby-align: start;";
1131
- break;
1132
- case "justify":
1133
- n = "ruby-align: space-between;";
1134
- break;
1135
- case "121":
1136
- n = "ruby-align: space-around;";
1137
- break;
1138
- case "even":
1139
- {
1140
- const l = ` ${String((a - e.length) / (e.length + 1))}em;`;
1141
- n = "ruby-align: space-between; " + (this.#s.tategaki ? `padding-top:${l} padding-bottom:${l}` : `padding-left:${l} padding-right:${l}`);
1142
- }
1143
- break;
1144
- case "1ruby":
1145
- n = "ruby-align: space-between; " + (this.#s.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
1146
- break;
1147
- default:
1148
- n = `text-align: ${s};`;
1149
- }
1150
- return ` style='${n} ${i}'`;
1151
- }
1152
- tagCh(t) {
1153
- this.#v.putTxt(t);
1154
- }
1155
- #w = !1;
1156
- get needGoTxt() {
1157
- return this.#w;
1158
- }
1159
- #Y = (t, e) => {
1160
- let s = e;
1161
- k.#c.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${s}\` name:\`${this.name_}\``);
1162
- const i = s.split("");
1163
- let a = "";
1164
- const [n, ...l] = i, h = l.join("");
1165
- switch (i.length) {
1166
- case 1:
1167
- if (this.#w = !0, t === `
1168
- `) {
1169
- this.#M ? (this.#M = !1, a = "<ruby>&emsp;<rt>&emsp;</rt></ruby><br/>") : a = "<br/>";
1170
- break;
1171
- }
1172
- this.#M && (this.#M = !1, s === "" && (s = "&emsp;")), a = this.#X(t, s, this.#x);
1173
- break;
1174
- default:
1175
- switch (n) {
1176
- // ルビ揃え指定と同時シリーズ
1177
- case "start":
1178
- // 初期値
1179
- case "left":
1180
- //(肩付き)先頭親文字から、ルビ間は密着
1181
- case "center":
1182
- //(中付き)センター合わせ、〃
1183
- case "right":
1184
- //(右/下揃え)末尾親文字から、〃
1185
- case "justify":
1186
- //(両端揃え)先頭から末尾親文字間に、ルビ間は均等にあける
1187
- case "121":
1188
- //(1-2-1(JIS))ルビの前後を比率1、ルビ間を比率2であける
1189
- case "even":
1190
- //(均等アキ)ルビの前後、ルビ間も均等にあける
1191
- case "1ruby":
1192
- this.#M = !1, this.#w = !0, a = this.#X(t, h, n);
1193
- break;
1194
- case "gotxt":
1195
- this.#V(), this.#w ? (this.isCur && k.#a.recText(
1196
- this.#T.join("").replace(/^<ruby>&emsp;<rt>&emsp;<\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")
1197
- ), this.#s.goTxt(this.#T, this.#I === 0), this.#w = !1, this.#I = 0) : this.isCur && this.#s.noticeCompTxt();
1198
- return;
1199
- // breakではない
1200
- case "add":
1201
- {
1202
- const r = JSON.parse(h), { style: b = "", wait: y = null } = r, { cl: w, sty: C } = this.#D(!0, y ? M(y) : null);
1203
- this.#T.push(`<span${w} style='${C} display: inline; ${b}'>`), delete r.style, this.#K(r);
1204
- }
1205
- return;
1206
- // breakではない
1207
- case "add_close":
1208
- this.#T.push("</span>"), this.#V();
1209
- return;
1210
- // breakではない
1211
- case "grp":
1212
- this.#w = !0;
1213
- {
1214
- const r = JSON.parse(h);
1215
- if (r.id ??= String(this.#T.length), r.id === "break") {
1216
- this.#s.dispBreak(r);
1217
- return;
1218
- }
1219
- this.#M = !1, r.delay = this.#I, r.r ??= "", r.style ??= "", r.r_style ??= "";
1220
- const { r: b, wait: y = null, r_style: w } = r, { cl: C, sty: x, lnk: N } = this.#D(!0, y ? M(y) : null);
1221
- a = `<span${C} style='${x} ${r.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(r)}'${N} style='${x} display: inline;'>&emsp;</span><rt${N}${this.#U(
1222
- " ",
1223
- b,
1224
- this.#x,
1225
- this.#y.style.cssText + (this.#j.at(-1)?.o.r_style ?? "") + w
1226
- )}>${r.r}</rt></ruby></span>`;
1227
- }
1228
- break;
1229
- case "tcy":
1230
- this.#M = !1, this.#w = !0;
1231
- {
1232
- const { t: r = "", r: b = "", wait: y = null, style: w = "", r_style: C = "" } = JSON.parse(h);
1233
- k.#n.doRecLog() && (this.#G += t + (s ? `《${s}》` : ""), this.#J += r);
1234
- const x = j.isSafari ? b.replaceAll(/[A-Za-z0-9]/g, (o) => String.fromCharCode(o.charCodeAt(0) + 65248)) : b, { cl: N, sty: g, lnk: $ } = this.#D(!0, y ? M(y) : null);
1235
- a = `<span${N} style='${g}${this.#R(r)} ${w}'><ruby><span${$} style='${g} display: inline; text-combine-upright: all;'>${r}</span><rt${$}${this.#U(
1236
- r,
1237
- x,
1238
- this.#x,
1239
- this.#y.style.cssText + (this.#j.at(-1)?.o.r_style ?? "") + C
1240
- )}>${x}</rt></ruby></span>`;
1241
- }
1242
- break;
1243
- case "del":
1244
- c.delBreak();
1245
- return;
1246
- // breakではない
1247
- case "span":
1248
- this.#w = !0, this.#Q(JSON.parse(h));
1249
- return;
1250
- // breakではない
1251
- case "link":
1252
- this.#w = !0;
1253
- {
1254
- const r = JSON.parse(h);
1255
- r[":link"] = " data-lnk='@'";
1256
- const { cl: b, sty: y, curpos: w } = this.#D(!1, r.wait ? M(r.wait) : null);
1257
- this.#T.push(`<span${b} style='${y} display: inline; ${r.style ?? ""}' ${w} data-arg='${h}'>`), delete r.style, this.#Q(r);
1258
- }
1259
- return;
1260
- // breakではない
1261
- case "endlink":
1262
- this.#w = !0, this.#T.push("</span>"), this.#V();
1263
- return;
1264
- // breakではない
1265
- default:
1266
- this.#w = !0, a = this.#X(t, s, this.#x);
1267
- }
1268
- break;
1269
- }
1270
- this.#T.push(k.#F(a));
1271
- };
1272
- #X(t, e, s) {
1273
- const i = t === " " ? "&nbsp;" : t === " " ? "&emsp;" : t;
1274
- k.#n.doRecLog() && (this.#G += i + (e ? `《${e}》` : ""), t !== " " && (this.#J += t));
1275
- const { cl: a, sty: n, lnk: l } = this.#D(!0, null, t);
1276
- return e ? `<span${a} style='${n} ${this.#R(t)}'><ruby>${// 文字個別に出現させるため以下にも ${cl} が必要
1277
- Array.from(t).map((h, r) => `<span${a}${l} style='${r > 0 ? this.#D(!0, null, t).sty : n} display: inline;'>${h === " " ? "&nbsp;" : h === " " ? "&emsp;" : h}</span>`).join("")}<rt${l}${this.#U(
1278
- t,
1279
- e,
1280
- s,
1281
- this.#y.style.cssText + (this.#j.at(-1)?.o.r_style ?? "")
1282
- )}>${e}</rt></ruby></span>` : `<span${a} style='${n} ${this.#R(t)}'${l}>${i}</span>`;
1283
- }
1284
- #D(t, e, s = `
1285
- `) {
1286
- const i = this.#P ? e ?? this.#j.at(0)?.o.wait ?? (k.#g ? k.#t[s.at(0) ?? ""] ?? 0 : k.msecChWait) : 0;
1287
- k.#k.isSkipping ? this.#I = 0 : t && this.#P && (this.#I += M(i));
1288
- const a = `data-add='{"ch_in_style":"${this.#B}", "ch_out_style":"${this.#W}"}'`;
1289
- return {
1290
- cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#B}'`,
1291
- // TxtStage.goTxt()はこれ単位で文字出現させる
1292
- sty: `animation-delay: ${String(this.#I)}ms;${this.#j.at(-1)?.o.style ?? ""}`,
1293
- // TxtStage.goTxt()はこれ単位で文字出現させる
1294
- lnk: (this.#j.at(0)?.o[":link"] ?? "") + " " + a,
1295
- curpos: a
1296
- };
1297
- }
1298
- #I = 0;
1299
- #M = !0;
1300
- #T = [];
1301
- #j = [];
1302
- #K(t) {
1303
- this.#j.push({
1304
- o: t,
1305
- r_align: this.#x,
1306
- ch_in_style: this.#B,
1307
- ch_out_style: this.#W
1308
- }), t.r_align && (this.#x = t.r_align), this.#S(t), this.#$(t);
1309
- }
1310
- #V() {
1311
- const t = this.#j.pop();
1312
- t && (this.#x = t.r_align, this.#S({ in_style: t.ch_in_style }), this.#$({ out_style: t.ch_out_style }));
1313
- }
1314
- #Q(t) {
1315
- const e = this.#j.at(-1);
1316
- if (!e) {
1317
- this.#K(t);
1318
- return;
1319
- }
1320
- e.o = { ...e.o, ...t }, !t.style && !t.r_style && (e.o.style = "", e.o.r_style = ""), t.r_align && (this.#x = t.r_align), this.#S(t), this.#$(t);
1321
- }
1322
- click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#s.skipChIn();
1323
- clearText() {
1324
- this.ctn.removeChild(this.#s), this.ctn.addChild(this.#s = this.#s.reNew()), this.#I = 0, this.#M = !0, this.#T = [], this.#G = "", this.#J = "", k.#a.pagebreak();
1325
- }
1326
- #G = "";
1327
- #J = "";
1328
- get pageText() {
1329
- return this.#G.replace("《&emsp;》", "");
1330
- }
1331
- get pagePlainText() {
1332
- return this.#J;
1333
- }
1334
- get enabled() {
1335
- return this.ctn.interactiveChildren;
1336
- }
1337
- set enabled(t) {
1338
- this.ctn.interactiveChildren = t;
1339
- }
1340
- addButton = (t) => new Promise((e) => {
1341
- t.key = `btn=[${String(this.#m.children.length)}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), F(t, "hint_tate", this.#s.tategaki);
1342
- const s = new ft(t, k.#k, () => e(), () => this.canFocus());
1343
- s.name = JSON.stringify(t).replaceAll('"', "'"), this.#m.addChild(s);
1344
- });
1345
- canFocus() {
1346
- return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && k.#r(this);
1347
- }
1348
- clearLay(t) {
1349
- super.clearLay(t), this.clearText();
1350
- for (const e of this.#m.removeChildren()) e.destroy();
1351
- }
1352
- record = () => ({
1353
- ...super.record(),
1354
- enabled: this.enabled,
1355
- r_cssText: this.#y.style.cssText,
1356
- r_align: this.#x,
1357
- // バック
1358
- b_do: this.#i === void 0 ? void 0 : this.#i instanceof G ? "Sprite" : "Graphics",
1359
- b_pic: this.#b,
1360
- b_color: this.#_,
1361
- b_alpha: this.#o,
1362
- b_alpha_isfixed: this.#f,
1363
- ffs: this.#C,
1364
- txs: this.#s.record(),
1365
- strNoFFS: this.#N,
1366
- btns: this.#m.children.map((t) => t.name)
1367
- });
1368
- playback(t, e) {
1369
- super.playback(t, e), this.enabled = t.enabled, this.#y.style.cssText = t.r_cssText, this.#x = t.r_align, this.cvsResize(), this.#H(t), this.#s.playback(t.txs), this.#o = t.b_alpha, this.#f = t.b_alpha_isfixed, e.push(
1370
- new Promise((s) => {
1371
- const i = t.b_do ? t.b_do === "Sprite" ? { b_pic: t.b_pic } : { b_color: t.b_color } : { b_pic: "" };
1372
- i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#O(i, (a) => {
1373
- a && s();
1374
- }) || s();
1375
- }),
1376
- ...t.btns.map((s) => this.addButton(JSON.parse(s.replaceAll("'", '"')))).flat()
1377
- );
1378
- }
1379
- get cssText() {
1380
- return this.#s.cssText;
1381
- }
1382
- set cssText(t) {
1383
- this.#s.cssText = t;
1384
- }
1385
- snapshot(t, e) {
1386
- t.render(this.ctn, { clear: !1 }), this.#s.snapshot(t, e);
1387
- }
1388
- snapshot_end() {
1389
- this.#s.snapshot_end();
1390
- }
1391
- makeDesignCast(t) {
1392
- this.ctn.visible && this.#s.makeDesignCast(t);
1393
- }
1394
- makeDesignCastChildren(t) {
1395
- if (this.ctn.visible)
1396
- for (const e of this.#m.children) e.makeDesignCast(t);
1397
- }
1398
- showDesignCast() {
1399
- this.#s.showDesignCast();
1400
- }
1401
- showDesignCastChildren() {
1402
- for (const t of this.#m.children) t.showDesignCast();
1403
- }
1404
- dump() {
1405
- return this.#Y("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#s.dump()}, "b_pic":"${this.#b}", "b_color":"${String(this.#_)}", "b_alpha":${String(this.#o)}, "b_alpha_isfixed":"${String(this.#f)}", "width":${String(this.#s.getWidth)}, "height":${String(this.#s.getHeight)}, "pixi_obj":[${this.ctn.children.map((t) => `{"class":"${t instanceof G ? "Sprite" : t instanceof B ? "Graphics" : t instanceof P ? "Container" : "?"}", "name":"${t.name}", "alpha":${String(t.alpha)}, "x":${String(t.x)}, "y":${String(t.y)}, "visible":"${String(t.visible)}"}`).join(",")}], "button":[${this.#m.children.map((t) => t.children[0]?.name ?? "{}").join(",")}]`;
1406
- }
1407
- }
1408
- const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1409
- __proto__: null,
1410
- TxtLayer: k
1411
- }, Symbol.toStringTag, { value: "Module" }));
1412
- export {
1413
- k as T,
1414
- c as a,
1415
- Et as b
805
+ }
806
+ static #o = 10;
807
+ static set msecChWait(p) {
808
+ e.#o = p;
809
+ }
810
+ static get msecChWait() {
811
+ return e.#o;
812
+ }
813
+ static #s;
814
+ static #c;
815
+ static setEvtMng(e, p, m) {
816
+ this.#s = e, this.#c = p, TxtStage.setEvtMng(e, m);
817
+ }
818
+ static #l = !1;
819
+ static #u = {};
820
+ static #d(e) {
821
+ this.#l = argChk_Boolean(e, "enabled", this.#l), this.#t.setVal_Nochk("save", "const.sn.autowc.enabled", this.#l);
822
+ let { text: p } = e;
823
+ if ("text" in e != "time" in e) throw "[autowc] textとtimeは同時指定必須です";
824
+ if (this.#t.setVal_Nochk("save", "const.sn.autowc.text", p), !p) return this.#t.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
825
+ let m = p.length;
826
+ if (this.#l && m === 0) throw "[autowc] enabled === false かつ text === \"\" は許されません";
827
+ let g = String(e.time).split(",");
828
+ if (g.length !== m) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
829
+ this.#u = {};
830
+ for (let e = 0; e < m; ++e) this.#u[p[e]] = uint(g[e]);
831
+ return this.#t.setVal_Nochk("save", "const.sn.autowc.time", e.time), !1;
832
+ }
833
+ #f = 0;
834
+ #p = 0;
835
+ #m = !1;
836
+ #h = void 0;
837
+ #g = "";
838
+ #_ = new TxtStage(this.ctn, () => this.canFocus(), e.#c);
839
+ #v = new RubySpliter();
840
+ #y = document.createElement("span");
841
+ static #b = {
842
+ "text-align": 0,
843
+ "text-align-last": 0,
844
+ height: 0,
845
+ width: 0,
846
+ "padding-left": 0,
847
+ "padding-right": 0,
848
+ "padding-top": 0,
849
+ "padding-bottom": 0
850
+ };
851
+ #x = new Container();
852
+ constructor() {
853
+ super(), this.ctn.addChild(this.#_), this.#v.init(this.#B), this.ctn.addChild(this.#x), this.#x.name = "cntBtn", this.lay({
854
+ style: `width: ${String(CmnLib.stageW)}px; height: ${String(CmnLib.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`,
855
+ in_style: "default",
856
+ out_style: "default",
857
+ back_clear: "true"
858
+ });
859
+ }
860
+ destroy() {
861
+ this.#h &&= (this.ctn.removeChild(this.#h).destroy(), void 0), e.#r.pagebreak(), this.#_.destroy();
862
+ }
863
+ static destroy() {
864
+ this.#l = !1, this.#u = {}, this.#P = (e) => e;
865
+ }
866
+ set name(e) {
867
+ this.name_ = e, this.#_.name = e;
868
+ }
869
+ get name() {
870
+ return this.name_;
871
+ }
872
+ cvsResize() {
873
+ this.#_.cvsResize();
874
+ }
875
+ cvsResizeChildren() {
876
+ for (let e of this.#x.children) e.cvsResize();
877
+ }
878
+ procSetX(e) {
879
+ this.#_.lay({ x: e });
880
+ }
881
+ procSetY(e) {
882
+ this.#_.lay({ y: e });
883
+ }
884
+ lay(p) {
885
+ if (super.lay(p), Layer.setXY(this.ctn, p, this.ctn), p[":id_tag"] = this.name_.slice(0, -7), RubySpliter.setting(p), this.#k(p), this.#_.lay(p), "r_align" in p && (this.#L = p.r_align ?? ""), this.#F = CmnLib.isSafari ? this.#_.tategaki ? (e, p) => `text-align: start; height: ${String(p)}em; padding-top: ${e}; padding-bottom: ${e};` : (e, p) => `text-align: start; width: ${String(p)}em; padding-left: ${e}; padding-right: ${e};` : this.#_.tategaki ? (e) => `text-align: justify; text-align-last: justify; padding-top: ${e}; padding-bottom: ${e};` : (e) => `text-align: justify; text-align-last: justify; padding-left: ${e}; padding-right: ${e};`, CmnLib.isFirefox && (this.#I = this.#R), "r_style" in p) if (p.r_style) {
886
+ let m = document.createElement("span");
887
+ m.style.cssText = p.r_style;
888
+ let h = m.style.length, g = this.#y.style;
889
+ for (let p = 0; p < h; ++p) {
890
+ let h = m.style[p];
891
+ if (h in e.#b) {
892
+ DebugMng.myTrace(`${String(h)}は指定できません`, "W");
893
+ continue;
894
+ }
895
+ let _ = m.style[h];
896
+ _ && (g[h] = _);
897
+ }
898
+ } else this.#y.style.cssText = "";
899
+ if ("alpha" in p) for (let e of this.#x.children) e.alpha = this.ctn.alpha;
900
+ this.#S(p), this.#T(p);
901
+ let m = Reading.procID + `TxtLayer lay name:${this.name_}`, h = this.#O(p, (e) => {
902
+ e && Reading.endProc(m);
903
+ });
904
+ return h && Reading.beginProc(m), h;
905
+ }
906
+ #S(e) {
907
+ let { in_style: p } = e;
908
+ if (!p) return;
909
+ let m = TxtStage.getChInStyle(p);
910
+ if (!m) throw `存在しないin_style【${p}】です`;
911
+ this.#C = p, this.#w = m.join;
912
+ }
913
+ #C = "";
914
+ #w = !0;
915
+ get width() {
916
+ return this.#_.getWidth;
917
+ }
918
+ get height() {
919
+ return this.#_.getHeight;
920
+ }
921
+ #T(e) {
922
+ let { out_style: p } = e;
923
+ if (p) {
924
+ if (!TxtStage.getChOutStyle(p)) throw `存在しないout_style【${p}】です`;
925
+ this.#E = p;
926
+ }
927
+ }
928
+ #E = "";
929
+ #D = new SpritesMng();
930
+ #O(m, h) {
931
+ if ("back_clear" in m) return argChk_Boolean(m, "back_clear", !1) && (this.#f = 0, this.#p = 0, this.#m = !1, this.#g = ""), h(!1), !1;
932
+ this.#p = argChk_Num(m, "b_alpha", this.#p), this.#m = argChk_Boolean(m, "b_alpha_isfixed", this.#m);
933
+ let _ = (this.#m ? 1 : Number(e.#t.getVal("sys:TextLayer.Back.Alpha"))) * this.#p;
934
+ if (m.b_pic) {
935
+ if (this.#g !== m.b_pic) return this.#g = m.b_pic, this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#D = new SpritesMng(this.#g, this.ctn, (e) => {
936
+ this.#h = e, e.name = "back(pic)", e.visible = _ > 0, e.alpha = _, this.#_.setMySize(e.width, e.height), this.ctn.setChildIndex(e, 0), h(!0);
937
+ }), this.#D.ret;
938
+ } else "b_color" in m && (this.#f = argChk_Color(m, "b_color", 0), this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#g = "", this.ctn.addChildAt((this.#h = new Graphics()).beginFill(this.#f, _).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)");
939
+ return this.#h && (this.#h.visible = _ > 0, this.#h.alpha = _), h(!1), !1;
940
+ }
941
+ chgBackAlpha(e) {
942
+ let p = this.#m ? this.#p : e * this.#p;
943
+ this.#h instanceof Graphics && (this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.ctn.addChildAt((this.#h = new Graphics()).beginFill(this.#f, p).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)"), this.#h && (this.#h.visible = p > 0, this.#h.alpha = p);
944
+ }
945
+ #k(e) {
946
+ "noffs" in e && (this.#M = e.noffs ?? "", this.#N = /* @__PURE__ */ RegExp(`[ ${this.#M}]`)), "ffs" in e && (this.#A ??= "", this.#j = this.#A === "" ? () => "" : (e) => this.#N.test(e) ? "" : ` font-feature-settings: ${this.#A};`);
947
+ }
948
+ #A = "";
949
+ #j = (e) => "";
950
+ #M = "";
951
+ #N = /[ ]/;
952
+ static chgDoRec(e) {
953
+ this.#P = e ? (e) => e : (e) => `<span class='offrec'>${e}</span>`;
954
+ }
955
+ static #P = (e) => e;
956
+ isCur = !1;
957
+ #F = () => "";
958
+ #I = (e, p, m, h = "") => {
959
+ if (!m) return ` style='${h}'`;
960
+ let g = e.length * 2;
961
+ if (g - p.length < 0) return ` style='text-align: ${m}; ${h}'`;
962
+ let _ = "";
963
+ switch (m) {
964
+ case "justify":
965
+ _ = this.#F("0", g);
966
+ break;
967
+ case "121":
968
+ _ = this.#F(`calc(${String((g - p.length) / (p.length * 2))}em)`, g);
969
+ break;
970
+ case "even":
971
+ _ = this.#F(`calc(${String((g - p.length) / (p.length + 1))}em)`, g);
972
+ break;
973
+ case "1ruby":
974
+ _ = this.#F("1em", g);
975
+ break;
976
+ default: _ = `text-align: ${m};`;
977
+ }
978
+ return ` style='${_} ${h}'`;
979
+ };
980
+ #L = "";
981
+ #R(e, p, m, h = "") {
982
+ if (!m) return ` style='${h}'`;
983
+ let g = e.length * 2;
984
+ if (g - p.length < 0) return ` style='text-align: ${m}; ${h}'`;
985
+ let _ = "";
986
+ switch (m) {
987
+ case "left":
988
+ _ = "ruby-align: start;";
989
+ break;
990
+ case "center":
991
+ _ = "ruby-align: center;";
992
+ break;
993
+ case "right":
994
+ _ = "ruby-align: start;";
995
+ break;
996
+ case "justify":
997
+ _ = "ruby-align: space-between;";
998
+ break;
999
+ case "121":
1000
+ _ = "ruby-align: space-around;";
1001
+ break;
1002
+ case "even":
1003
+ {
1004
+ let e = ` ${String((g - p.length) / (p.length + 1))}em;`;
1005
+ _ = "ruby-align: space-between; " + (this.#_.tategaki ? `padding-top:${e} padding-bottom:${e}` : `padding-left:${e} padding-right:${e}`);
1006
+ }
1007
+ break;
1008
+ case "1ruby":
1009
+ _ = "ruby-align: space-between; " + (this.#_.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
1010
+ break;
1011
+ default: _ = `text-align: ${m};`;
1012
+ }
1013
+ return ` style='${_} ${h}'`;
1014
+ }
1015
+ tagCh(e) {
1016
+ this.#v.putTxt(e);
1017
+ }
1018
+ #z = !1;
1019
+ get needGoTxt() {
1020
+ return this.#z;
1021
+ }
1022
+ #B = (p, m) => {
1023
+ let g = m;
1024
+ e.#e.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${p}\`(${p.charCodeAt(0).toString(16)}) ruby:\`${g}\` name:\`${this.name_}\``);
1025
+ let _ = g.split("|"), v = "", [b, ...x] = _, S = x.join("|");
1026
+ switch (_.length) {
1027
+ case 1:
1028
+ if (this.#z = !0, p === "\n") {
1029
+ this.#W ? (this.#W = !1, v = "<ruby>&emsp;<rt>&emsp;</rt></ruby><br/>") : v = "<br/>";
1030
+ break;
1031
+ }
1032
+ this.#W && (this.#W = !1, g === "" && (g = "&emsp;")), v = this.#V(p, g, this.#L);
1033
+ break;
1034
+ default:
1035
+ switch (b) {
1036
+ case "start":
1037
+ case "left":
1038
+ case "center":
1039
+ case "right":
1040
+ case "justify":
1041
+ case "121":
1042
+ case "even":
1043
+ case "1ruby":
1044
+ this.#W = !1, this.#z = !0, v = this.#V(p, S, b);
1045
+ break;
1046
+ case "gotxt":
1047
+ this.#J(), this.#z ? (this.isCur && e.#r.recText(this.#G.join("").replace(/^<ruby>&emsp;<rt>&emsp;<\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")), this.#_.goTxt(this.#G, this.#U === 0), this.#z = !1, this.#U = 0) : this.isCur && this.#_.noticeCompTxt();
1048
+ return;
1049
+ case "add":
1050
+ {
1051
+ let e = JSON.parse(S), { style: p = "", wait: m = null } = e, { cl: g, sty: _ } = this.#H(!0, m ? uint(m) : null);
1052
+ this.#G.push(`<span${g} style='${_} display: inline; ${p}'>`), delete e.style, this.#q(e);
1053
+ }
1054
+ return;
1055
+ case "add_close":
1056
+ this.#G.push("</span>"), this.#J();
1057
+ return;
1058
+ case "grp":
1059
+ this.#z = !0;
1060
+ {
1061
+ let e = JSON.parse(S);
1062
+ if (e.id ??= String(this.#G.length), e.id === "break") {
1063
+ this.#_.dispBreak(e);
1064
+ return;
1065
+ }
1066
+ this.#W = !1, e.delay = this.#U, e.r ??= "", e.style ??= "", e.r_style ??= "";
1067
+ let { r: p, wait: m = null, r_style: g } = e, { cl: _, sty: y, lnk: b } = this.#H(!0, m ? uint(m) : null);
1068
+ v = `<span${_} style='${y} ${e.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(e)}'${b} style='${y} display: inline;'>&emsp;</span><rt${b}${this.#I(" ", p, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + g)}>${e.r}</rt></ruby></span>`;
1069
+ }
1070
+ break;
1071
+ case "tcy":
1072
+ this.#W = !1, this.#z = !0;
1073
+ {
1074
+ let { t: m = "", r: _ = "", wait: b = null, style: x = "", r_style: C = "" } = JSON.parse(S);
1075
+ e.#t.doRecLog() && (this.#X += p + (g ? `《${g}》` : ""), this.#Z += m);
1076
+ let w = CmnLib.isSafari ? _.replaceAll(/[A-Za-z0-9]/g, (e) => String.fromCharCode(e.charCodeAt(0) + 65248)) : _, { cl: T, sty: E, lnk: D } = this.#H(!0, b ? uint(b) : null);
1077
+ v = `<span${T} style='${E}${this.#j(m)} ${x}'><ruby><span${D} style='${E} display: inline; text-combine-upright: all;'>${m}</span><rt${D}${this.#I(m, w, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + C)}>${w}</rt></ruby></span>`;
1078
+ }
1079
+ break;
1080
+ case "del":
1081
+ TxtStage.delBreak();
1082
+ return;
1083
+ case "span":
1084
+ this.#z = !0, this.#Y(JSON.parse(S));
1085
+ return;
1086
+ case "link":
1087
+ this.#z = !0;
1088
+ {
1089
+ let e = JSON.parse(S);
1090
+ e[":link"] = " data-lnk='@'";
1091
+ let { cl: p, sty: m, curpos: g } = this.#H(!1, e.wait ? uint(e.wait) : null);
1092
+ this.#G.push(`<span${p} style='${m} display: inline; ${e.style ?? ""}' ${g} data-arg='${S}'>`), delete e.style, this.#Y(e);
1093
+ }
1094
+ return;
1095
+ case "endlink":
1096
+ this.#z = !0, this.#G.push("</span>"), this.#J();
1097
+ return;
1098
+ default: this.#z = !0, v = this.#V(p, g, this.#L);
1099
+ }
1100
+ break;
1101
+ }
1102
+ this.#G.push(e.#P(v));
1103
+ };
1104
+ #V(p, m, h) {
1105
+ let g = p === " " ? "&nbsp;" : p === " " ? "&emsp;" : p;
1106
+ e.#t.doRecLog() && (this.#X += g + (m ? `《${m}》` : ""), p !== " " && (this.#Z += p));
1107
+ let { cl: _, sty: v, lnk: y } = this.#H(!0, null, p);
1108
+ return m ? `<span${_} style='${v} ${this.#j(p)}'><ruby>${Array.from(p).map((e, m) => `<span${_}${y} style='${m > 0 ? this.#H(!0, null, p).sty : v} display: inline;'>${e === " " ? "&nbsp;" : e === " " ? "&emsp;" : e}</span>`).join("")}<rt${y}${this.#I(p, m, h, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? ""))}>${m}</rt></ruby></span>` : `<span${_} style='${v} ${this.#j(p)}'${y}>${g}</span>`;
1109
+ }
1110
+ #H(p, m, g = "\n") {
1111
+ let _ = this.#w ? m ?? this.#K.at(0)?.o.wait ?? (e.#l ? e.#u[g.at(0) ?? ""] ?? 0 : e.msecChWait) : 0;
1112
+ e.#s.isSkipping ? this.#U = 0 : p && this.#w && (this.#U += uint(_));
1113
+ let v = `data-add='{"ch_in_style":"${this.#C}", "ch_out_style":"${this.#E}"}'`;
1114
+ return {
1115
+ cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#C}'`,
1116
+ sty: `animation-delay: ${String(this.#U)}ms;${this.#K.at(-1)?.o.style ?? ""}`,
1117
+ lnk: (this.#K.at(0)?.o[":link"] ?? "") + " " + v,
1118
+ curpos: v
1119
+ };
1120
+ }
1121
+ #U = 0;
1122
+ #W = !0;
1123
+ #G = [];
1124
+ #K = [];
1125
+ #q(e) {
1126
+ this.#K.push({
1127
+ o: e,
1128
+ r_align: this.#L,
1129
+ ch_in_style: this.#C,
1130
+ ch_out_style: this.#E
1131
+ }), e.r_align && (this.#L = e.r_align), this.#S(e), this.#T(e);
1132
+ }
1133
+ #J() {
1134
+ let e = this.#K.pop();
1135
+ e && (this.#L = e.r_align, this.#S({ in_style: e.ch_in_style }), this.#T({ out_style: e.ch_out_style }));
1136
+ }
1137
+ #Y(e) {
1138
+ let p = this.#K.at(-1);
1139
+ if (!p) {
1140
+ this.#q(e);
1141
+ return;
1142
+ }
1143
+ p.o = {
1144
+ ...p.o,
1145
+ ...e
1146
+ }, !e.style && !e.r_style && (p.o.style = "", p.o.r_style = ""), e.r_align && (this.#L = e.r_align), this.#S(e), this.#T(e);
1147
+ }
1148
+ click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#_.skipChIn();
1149
+ clearText() {
1150
+ this.ctn.removeChild(this.#_), this.ctn.addChild(this.#_ = this.#_.reNew()), this.#U = 0, this.#W = !0, this.#G = [], this.#X = "", this.#Z = "", e.#r.pagebreak();
1151
+ }
1152
+ #X = "";
1153
+ #Z = "";
1154
+ get pageText() {
1155
+ return this.#X.replace("《&emsp;》", "");
1156
+ }
1157
+ get pagePlainText() {
1158
+ return this.#Z;
1159
+ }
1160
+ get enabled() {
1161
+ return this.ctn.interactiveChildren;
1162
+ }
1163
+ set enabled(e) {
1164
+ this.ctn.interactiveChildren = e;
1165
+ }
1166
+ addButton = (p) => new Promise((m) => {
1167
+ p.key = `btn=[${String(this.#x.children.length)}] ` + this.name_, p[":id_tag"] = p.key.slice(0, -7), argChk_Boolean(p, "hint_tate", this.#_.tategaki);
1168
+ let h = new Button(p, e.#s, () => m(), () => this.canFocus());
1169
+ h.name = JSON.stringify(p).replaceAll("\"", "'"), this.#x.addChild(h);
1170
+ });
1171
+ canFocus() {
1172
+ return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && e.#n(this);
1173
+ }
1174
+ clearLay(e) {
1175
+ super.clearLay(e), this.clearText();
1176
+ for (let e of this.#x.removeChildren()) e.destroy();
1177
+ }
1178
+ record = () => ({
1179
+ ...super.record(),
1180
+ enabled: this.enabled,
1181
+ r_cssText: this.#y.style.cssText,
1182
+ r_align: this.#L,
1183
+ b_do: this.#h === void 0 ? void 0 : this.#h instanceof Sprite ? "Sprite" : "Graphics",
1184
+ b_pic: this.#g,
1185
+ b_color: this.#f,
1186
+ b_alpha: this.#p,
1187
+ b_alpha_isfixed: this.#m,
1188
+ ffs: this.#A,
1189
+ txs: this.#_.record(),
1190
+ strNoFFS: this.#M,
1191
+ btns: this.#x.children.map((e) => e.name)
1192
+ });
1193
+ playback(e, p) {
1194
+ super.playback(e, p), this.enabled = e.enabled, this.#y.style.cssText = e.r_cssText, this.#L = e.r_align, this.cvsResize(), this.#k(e), this.#_.playback(e.txs), this.#p = e.b_alpha, this.#m = e.b_alpha_isfixed, p.push(new Promise((p) => {
1195
+ let m = e.b_do ? e.b_do === "Sprite" ? { b_pic: e.b_pic } : { b_color: e.b_color } : { b_pic: "" };
1196
+ m.b_alpha = e.b_alpha, m.b_alpha_isfixed = e.b_alpha_isfixed, this.#O(m, (e) => {
1197
+ e && p();
1198
+ }) || p();
1199
+ }), ...e.btns.map((e) => this.addButton(JSON.parse(e.replaceAll("'", "\"")))).flat());
1200
+ }
1201
+ get cssText() {
1202
+ return this.#_.cssText;
1203
+ }
1204
+ set cssText(e) {
1205
+ this.#_.cssText = e;
1206
+ }
1207
+ snapshot(e, p) {
1208
+ e.render(this.ctn, { clear: !1 }), this.#_.snapshot(e, p);
1209
+ }
1210
+ snapshot_end() {
1211
+ this.#_.snapshot_end();
1212
+ }
1213
+ makeDesignCast(e) {
1214
+ this.ctn.visible && this.#_.makeDesignCast(e);
1215
+ }
1216
+ makeDesignCastChildren(e) {
1217
+ if (this.ctn.visible) for (let p of this.#x.children) p.makeDesignCast(e);
1218
+ }
1219
+ showDesignCast() {
1220
+ this.#_.showDesignCast();
1221
+ }
1222
+ showDesignCastChildren() {
1223
+ for (let e of this.#x.children) e.showDesignCast();
1224
+ }
1225
+ dump() {
1226
+ return this.#B("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#_.dump()}, "b_pic":"${this.#g}", "b_color":"${String(this.#f)}", "b_alpha":${String(this.#p)}, "b_alpha_isfixed":"${String(this.#m)}", "width":${String(this.#_.getWidth)}, "height":${String(this.#_.getHeight)}, "pixi_obj":[${this.ctn.children.map((e) => `{"class":"${e instanceof Sprite ? "Sprite" : e instanceof Graphics ? "Graphics" : e instanceof Container ? "Container" : "?"}", "name":"${e.name}", "alpha":${String(e.alpha)}, "x":${String(e.x)}, "y":${String(e.y)}, "visible":"${String(e.visible)}"}`).join(",")}], "button":[${this.#x.children.map((e) => e.children[0]?.name ?? "{}").join(",")}]`;
1227
+ }
1416
1228
  };
1417
- //# sourceMappingURL=TxtLayer.js.map
1229
+ export { TxtLayer, TxtStage as t };
1230
+
1231
+ //# sourceMappingURL=TxtLayer.js.map