@famibee/skynovel 2.0.1 → 2.0.3

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 (123) hide show
  1. package/dist/Button.js +36 -34
  2. package/dist/Button.js.map +1 -1
  3. package/dist/CallStack.js +11 -6
  4. package/dist/CallStack.js.map +1 -1
  5. package/dist/CmnInterface.js +13 -11
  6. package/dist/CmnInterface.js.map +1 -1
  7. package/dist/CmnLib.js +58 -56
  8. package/dist/CmnLib.js.map +1 -1
  9. package/dist/Config.js +9 -7
  10. package/dist/Config.js.map +1 -1
  11. package/dist/ConfigBase.js +52 -49
  12. package/dist/ConfigBase.js.map +1 -1
  13. package/dist/DebugMng.js +9 -6
  14. package/dist/DebugMng.js.map +1 -1
  15. package/dist/EventListenerCtn.js +6 -4
  16. package/dist/EventListenerCtn.js.map +1 -1
  17. package/dist/EventMng.js +522 -417
  18. package/dist/EventMng.js.map +1 -1
  19. package/dist/Grammar.js +22 -20
  20. package/dist/Grammar.js.map +1 -1
  21. package/dist/GrpLayer.js +58 -57
  22. package/dist/GrpLayer.js.map +1 -1
  23. package/dist/Layer.js +66 -64
  24. package/dist/Layer.js.map +1 -1
  25. package/dist/LayerMng.js +461 -441
  26. package/dist/LayerMng.js.map +1 -1
  27. package/dist/Main.js +69 -67
  28. package/dist/Main.js.map +1 -1
  29. package/dist/PropParser.js +23 -19
  30. package/dist/PropParser.js.map +1 -1
  31. package/dist/Reading.js +422 -418
  32. package/dist/Reading.js.map +1 -1
  33. package/dist/RubySpliter.js +6 -4
  34. package/dist/RubySpliter.js.map +1 -1
  35. package/dist/ScriptIterator.js +374 -370
  36. package/dist/ScriptIterator.js.map +1 -1
  37. package/dist/SndBuf.js +643 -622
  38. package/dist/SndBuf.js.map +1 -1
  39. package/dist/SoundMng.js +59 -60
  40. package/dist/SoundMng.js.map +1 -1
  41. package/dist/SpritesMng.js +135 -129
  42. package/dist/SpritesMng.js.map +1 -1
  43. package/dist/SysBase.js +985 -950
  44. package/dist/SysBase.js.map +1 -1
  45. package/dist/TxtLayer.js +558 -551
  46. package/dist/TxtLayer.js.map +1 -1
  47. package/dist/Variable.js +47 -45
  48. package/dist/Variable.js.map +1 -1
  49. package/dist/chunk.js +11 -9
  50. package/dist/gamepad.js +396 -660
  51. package/dist/gamepad.js.map +1 -1
  52. package/dist/pixi.js +2631 -2593
  53. package/dist/pixi.js.map +1 -1
  54. package/dist/platform.js +6 -4
  55. package/dist/platform.js.map +1 -1
  56. package/dist/rolldown-runtime.js +20 -0
  57. package/dist/sn/RubySpliter.d.ts.map +1 -1
  58. package/dist/web.js +418 -418
  59. package/dist/web.js.map +1 -1
  60. package/dist_app/Button.js +36 -34
  61. package/dist_app/Button.js.map +1 -1
  62. package/dist_app/CallStack.js +11 -6
  63. package/dist_app/CallStack.js.map +1 -1
  64. package/dist_app/CmnInterface.js +13 -11
  65. package/dist_app/CmnInterface.js.map +1 -1
  66. package/dist_app/CmnLib.js +58 -56
  67. package/dist_app/CmnLib.js.map +1 -1
  68. package/dist_app/Config.js +9 -7
  69. package/dist_app/Config.js.map +1 -1
  70. package/dist_app/ConfigBase.js +52 -49
  71. package/dist_app/ConfigBase.js.map +1 -1
  72. package/dist_app/DebugMng.js +9 -6
  73. package/dist_app/DebugMng.js.map +1 -1
  74. package/dist_app/EventListenerCtn.js +6 -4
  75. package/dist_app/EventListenerCtn.js.map +1 -1
  76. package/dist_app/EventMng.js +522 -417
  77. package/dist_app/EventMng.js.map +1 -1
  78. package/dist_app/Grammar.js +22 -20
  79. package/dist_app/Grammar.js.map +1 -1
  80. package/dist_app/GrpLayer.js +58 -57
  81. package/dist_app/GrpLayer.js.map +1 -1
  82. package/dist_app/Layer.js +66 -64
  83. package/dist_app/Layer.js.map +1 -1
  84. package/dist_app/LayerMng.js +461 -441
  85. package/dist_app/LayerMng.js.map +1 -1
  86. package/dist_app/Main.js +69 -67
  87. package/dist_app/Main.js.map +1 -1
  88. package/dist_app/PropParser.js +23 -19
  89. package/dist_app/PropParser.js.map +1 -1
  90. package/dist_app/Reading.js +422 -418
  91. package/dist_app/Reading.js.map +1 -1
  92. package/dist_app/RubySpliter.js +6 -4
  93. package/dist_app/RubySpliter.js.map +1 -1
  94. package/dist_app/ScriptIterator.js +374 -370
  95. package/dist_app/ScriptIterator.js.map +1 -1
  96. package/dist_app/SndBuf.js +643 -622
  97. package/dist_app/SndBuf.js.map +1 -1
  98. package/dist_app/SoundMng.js +59 -60
  99. package/dist_app/SoundMng.js.map +1 -1
  100. package/dist_app/SpritesMng.js +135 -129
  101. package/dist_app/SpritesMng.js.map +1 -1
  102. package/dist_app/SysBase.js +985 -950
  103. package/dist_app/SysBase.js.map +1 -1
  104. package/dist_app/TxtLayer.js +558 -551
  105. package/dist_app/TxtLayer.js.map +1 -1
  106. package/dist_app/Variable.js +47 -45
  107. package/dist_app/Variable.js.map +1 -1
  108. package/dist_app/app.js +62 -63
  109. package/dist_app/app.js.map +1 -1
  110. package/dist_app/appMain.js +11 -11
  111. package/dist_app/appMain.js.map +1 -1
  112. package/dist_app/chunk.js +11 -9
  113. package/dist_app/gamepad.js +396 -660
  114. package/dist_app/gamepad.js.map +1 -1
  115. package/dist_app/pixi.js +2028 -1990
  116. package/dist_app/pixi.js.map +1 -1
  117. package/dist_app/platform.js +6 -4
  118. package/dist_app/platform.js.map +1 -1
  119. package/dist_app/preload.js +1 -1
  120. package/dist_app/preload.js.map +1 -1
  121. package/dist_app/rolldown-runtime.js +20 -0
  122. package/dist_app/sn/RubySpliter.d.ts.map +1 -1
  123. package/package.json +20 -21
@@ -1,41 +1,46 @@
1
- import { c as argChk_Color, g as uint, h as parseColor, l as argChk_Num, o as addStyle, s as argChk_Boolean, t as CmnLib, u as getDateStr } from "./CmnLib.js";
2
- import { c as Loader, d as RenderTexture, f as Texture, l as LoaderResource, m as Container, o as Sprite, p as autoDetectRenderer, s as Graphics, u as Filter } from "./pixi.js";
3
- import { t as EventListenerCtn } from "./EventListenerCtn.js";
4
- import { n as SEARCH_PATH_ARG_EXT } from "./ConfigBase.js";
5
- import "./DebugMng.js";
6
- import { t as Layer } from "./Layer.js";
7
- import { i as TW_NM_TRANS, 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
- import { TxtLayer, t as TxtStage } from "./TxtLayer.js";
12
- import { GrpLayer, t as DesignCast } from "./GrpLayer.js";
13
- import { n as PROTOCOL_DL, r as PROTOCOL_USERDATA } from "./Config.js";
14
- var Pages = class e {
1
+ import { c as e, g as t, h as n, l as r, o as i, s as a, t as o, u as s } from "./CmnLib.js";
2
+ import { c, d as l, f as u, l as d, m as f, o as p, p as m, s as h, u as g } from "./pixi.js";
3
+ import { t as _ } from "./EventListenerCtn.js";
4
+ import { n as v } from "./ConfigBase.js";
5
+ import { t as y } from "./Layer.js";
6
+ import { i as b, r as x, t as S } from "./Reading.js";
7
+ import { t as C } from "./SpritesMng.js";
8
+ import { Button as w } from "./Button.js";
9
+ import { t as T } from "./RubySpliter.js";
10
+ import { TxtLayer as E, t as D } from "./TxtLayer.js";
11
+ import { GrpLayer as O, t as k } from "./GrpLayer.js";
12
+ import { n as A } from "./Config.js";
13
+ //#region src/sn/Pages.ts
14
+ var j = class e {
15
+ cls;
16
+ hArg;
17
+ sys;
18
+ val;
19
+ ret;
15
20
  #e;
16
- constructor(e, m, h, g, _, y, b, x) {
17
- this.cls = m, this.hArg = _, this.sys = y, this.val = b, this.ret = x;
18
- let S = y.hFactoryCls[m];
19
- if (!S) throw `属性 class【${m}】が不正です`;
20
- let C = S(), w = S();
21
- C.layname = w.layname = e;
22
- let T = _[":id_tag"] = `layer:${e} cls:${m} page:`;
23
- C.ctn.name = C.name = T + "A", w.ctn.name = w.name = T + "B", h.addChild(C.ctn), g.addChild(w.ctn), argChk_Boolean(_, "visible", !0), argChk_Boolean(_, "visible", !0), x.isWait = C.lay(_) || w.lay(_), this.#e = {
24
- fore: C,
25
- back: w
26
- }, g.visible = !1;
27
- let E = `const.sn.lay.${e}`;
28
- b.setVal_Nochk("tmp", E, !0), b.defTmp(E + ".fore.alpha", () => this.#e.fore.alpha), b.defTmp(E + ".back.alpha", () => this.#e.back.alpha), b.defTmp(E + ".fore.height", () => this.#e.fore.height), b.defTmp(E + ".back.height", () => this.#e.back.height), b.defTmp(E + ".fore.visible", () => this.#e.fore.ctn.visible), b.defTmp(E + ".back.visible", () => this.#e.back.ctn.visible), b.defTmp(E + ".fore.width", () => this.#e.fore.width), b.defTmp(E + ".back.width", () => this.#e.back.width), b.defTmp(E + ".fore.x", () => this.#e.fore.x), b.defTmp(E + ".back.x", () => this.#e.back.x), b.defTmp(E + ".fore.y", () => this.#e.fore.y), b.defTmp(E + ".back.y", () => this.#e.back.y);
21
+ constructor(e, t, n, r, i, o, s, c) {
22
+ this.cls = t, this.hArg = i, this.sys = o, this.val = s, this.ret = c;
23
+ let l = o.hFactoryCls[t];
24
+ if (!l) throw `属性 class【${t}】が不正です`;
25
+ let u = l(), d = l();
26
+ u.layname = d.layname = e;
27
+ let f = i[":id_tag"] = `layer:${e} cls:${t} page:`;
28
+ u.ctn.name = u.name = f + "A", d.ctn.name = d.name = f + "B", n.addChild(u.ctn), r.addChild(d.ctn), a(i, "visible", !0), a(i, "visible", !0), c.isWait = u.lay(i) || d.lay(i), this.#e = {
29
+ fore: u,
30
+ back: d
31
+ }, r.visible = !1;
32
+ let p = `const.sn.lay.${e}`;
33
+ s.setVal_Nochk("tmp", p, !0), s.defTmp(p + ".fore.alpha", () => this.#e.fore.alpha), s.defTmp(p + ".back.alpha", () => this.#e.back.alpha), s.defTmp(p + ".fore.height", () => this.#e.fore.height), s.defTmp(p + ".back.height", () => this.#e.back.height), s.defTmp(p + ".fore.visible", () => this.#e.fore.ctn.visible), s.defTmp(p + ".back.visible", () => this.#e.back.ctn.visible), s.defTmp(p + ".fore.width", () => this.#e.fore.width), s.defTmp(p + ".back.width", () => this.#e.back.width), s.defTmp(p + ".fore.x", () => this.#e.fore.x), s.defTmp(p + ".back.x", () => this.#e.back.x), s.defTmp(p + ".fore.y", () => this.#e.fore.y), s.defTmp(p + ".back.y", () => this.#e.back.y);
29
34
  }
30
35
  destroy() {
31
36
  this.#e.fore.destroy(), this.#e.back.destroy();
32
37
  }
33
38
  lay = (e) => this.getPage(e).lay(e);
34
- getPage = (m) => e.argChk_page(m, "fore") === "back" ? this.#e.back : this.#e.fore;
35
- static argChk_page(e, m) {
36
- let h = e.page ?? m;
37
- if (h === "fore" || h === "back") return e.page = h, h;
38
- throw Error("属性 page【" + h + "】が不正です");
39
+ getPage = (t) => e.argChk_page(t, "fore") === "back" ? this.#e.back : this.#e.fore;
40
+ static argChk_page(e, t) {
41
+ let n = e.page ?? t;
42
+ if (n === "fore" || n === "back") return e.page = n, n;
43
+ throw Error("属性 page【" + n + "】が不正です");
39
44
  }
40
45
  get fore() {
41
46
  return this.#e.fore;
@@ -46,15 +51,17 @@ var Pages = class e {
46
51
  transPage(e) {
47
52
  [this.#e.back, this.#e.fore] = [this.#e.fore, this.#e.back], this.#e.back.copy(this.#e.fore, e);
48
53
  }
49
- }, FrameMng = class e {
54
+ }, M = class e {
55
+ appPixi;
56
+ val;
50
57
  static #e;
51
58
  static #t;
52
59
  static #n;
53
- static init(m, h, g) {
54
- e.#e = m, e.#t = h, e.#n = g;
60
+ static init(t, n, r) {
61
+ e.#e = t, e.#t = n, e.#n = r;
55
62
  }
56
- constructor(e, m, h) {
57
- this.appPixi = m, this.val = h, e.add_frame = (e) => this.#o(e), e.let_frame = (e) => this.#f(e), e.set_frame = (e) => this.#p(e), e.frame = (e) => this.#h(e), e.tsy_frame = (e) => this.#g(e);
63
+ constructor(e, t, n) {
64
+ this.appPixi = t, this.val = n, e.add_frame = (e) => this.#o(e), e.let_frame = (e) => this.#f(e), e.set_frame = (e) => this.#p(e), e.frame = (e) => this.#h(e), e.tsy_frame = (e) => this.#g(e);
58
65
  }
59
66
  #r;
60
67
  setEvtMng(e) {
@@ -66,43 +73,43 @@ var Pages = class e {
66
73
  this.#i = Object.create(null);
67
74
  }
68
75
  hideAllFrame() {
69
- for (let [e, { style: m }] of Object.entries(this.#i)) this.#a[e] = m.display !== "none", m.display = "none";
76
+ for (let [e, { style: t }] of Object.entries(this.#i)) this.#a[e] = t.display !== "none", t.display = "none";
70
77
  }
71
78
  #a = Object.create(null);
72
79
  restoreAllFrame() {
73
- for (let [e, m] of Object.entries(this.#a)) {
74
- let h = this.#i[e];
75
- h && (h.style.display = m ? "inline" : "none");
80
+ for (let [e, t] of Object.entries(this.#a)) {
81
+ let n = this.#i[e];
82
+ n && (n.style.display = t ? "inline" : "none");
76
83
  }
77
84
  this.#a = Object.create(null);
78
85
  }
79
- #o(m) {
80
- let { id: h, src: g, alpha: _ = 1, scale_x: y = 1, scale_y: b = 1, rotate: S = 0 } = m;
81
- if (!h) throw "idは必須です";
82
- if (!g) throw "srcは必須です";
83
- let C = "const.sn.frm." + h;
84
- if (this.val.getVal(`tmp:${C}`)) throw `frame【${h}】はすでにあります`;
85
- let T = argChk_Boolean(m, "visible", !0), E = m.b_color ? ` background-color: ${m.b_color};` : "", D = this.#c(m);
86
- e.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${h}" style="opacity: ${String(_)}; ${E} position: absolute; left:${String(e.#t.ofsLeft4elm + D.x * e.#t.cvsScale)}px; top: ${String(e.#t.ofsTop4elm + D.y * e.#t.cvsScale)}px; z-index: 1; border: 0px; overflow: hidden; display: ${T ? "inline" : "none"}; transform: scale(${String(y)}, ${String(b)}) rotate(${String(S)}deg);" width="${String(D.width * e.#t.cvsScale)}" height="${String(D.height * e.#t.cvsScale)}"></iframe>`);
87
- let O = Reading.procID + `add_frame id:${h}`;
88
- Reading.beginProc(O);
89
- let k = e.#e.searchPath(g, SEARCH_PATH_ARG_EXT.HTML), A = new Loader().add({
90
- name: g,
91
- url: k,
92
- xhrType: LoaderResource.XHR_RESPONSE_TYPE.TEXT
86
+ #o(t) {
87
+ let { id: n, src: r, alpha: i = 1, scale_x: o = 1, scale_y: s = 1, rotate: l = 0 } = t;
88
+ if (!n) throw "idは必須です";
89
+ if (!r) throw "srcは必須です";
90
+ let u = "const.sn.frm." + n;
91
+ if (this.val.getVal(`tmp:${u}`)) throw `frame【${n}】はすでにあります`;
92
+ let f = a(t, "visible", !0), p = t.b_color ? ` background-color: ${t.b_color};` : "", m = this.#c(t);
93
+ e.#n.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${n}" style="opacity: ${String(i)}; ${p} position: absolute; left:${String(e.#t.ofsLeft4elm + m.x * e.#t.cvsScale)}px; top: ${String(e.#t.ofsTop4elm + m.y * e.#t.cvsScale)}px; z-index: 1; border: 0px; overflow: hidden; display: ${f ? "inline" : "none"}; transform: scale(${String(o)}, ${String(s)}) rotate(${String(l)}deg);" width="${String(m.width * e.#t.cvsScale)}" height="${String(m.height * e.#t.cvsScale)}"></iframe>`);
94
+ let h = S.procID + `add_frame id:${n}`;
95
+ S.beginProc(h);
96
+ let g = e.#e.searchPath(r, v.HTML), _ = new c().add({
97
+ name: r,
98
+ url: g,
99
+ xhrType: d.XHR_RESPONSE_TYPE.TEXT
93
100
  });
94
- return e.#t.arg.crypto && A.use((m, h) => void e.#t.dec(m.extension, m.data).then((e) => {
95
- m.data = e, h();
96
- }).catch((g) => {
97
- e.#n.errScript(`[add_frame]Html ロード失敗です src:${m.name} ${String(g)}`, !1), h();
98
- })), A.load((m, v) => {
99
- let x = document.getElementById(h);
100
- this.#i[h] = x, this.#s[h] = !1;
101
- let w = k.lastIndexOf("/") + 1, E = k.slice(0, w), A = E.slice(0, w);
102
- x.srcdoc = String(v[g]?.data).replace("sn_repRes();", "").replaceAll(/\s(?:src|href)=(["'])(\S+?)\1/g, (e, m, h) => h.startsWith("../") ? A + e.slice(3) : e.replace("./", "").replace(m, m + E)), x.srcdoc.includes("true/*WEBP*/;") && (x.srcdoc = x.srcdoc.replaceAll(/data-src="(.+?\.)(?:jpe?g|png)/g, (e, m) => `data-src="${m}webp`)), x.onload = () => {
103
- Reading.endProc(O), this.val.setVal_Nochk("tmp", C, !0), this.val.setVal_Nochk("tmp", C + ".alpha", _), this.val.setVal_Nochk("tmp", C + ".x", D.x), this.val.setVal_Nochk("tmp", C + ".y", D.y), this.val.setVal_Nochk("tmp", C + ".scale_x", y), this.val.setVal_Nochk("tmp", C + ".scale_y", b), this.val.setVal_Nochk("tmp", C + ".rotate", S), this.val.setVal_Nochk("tmp", C + ".width", D.width), this.val.setVal_Nochk("tmp", C + ".height", D.height), this.val.setVal_Nochk("tmp", C + ".visible", T);
104
- let m = x.contentWindow;
105
- this.#r.resvFlameEvent(m.document.body), m.sn_repRes?.((m) => e.#l(m.dataset.src ?? "", m));
101
+ return e.#t.arg.crypto && _.use((t, n) => void e.#t.dec(t.extension, t.data).then((e) => {
102
+ t.data = e, n();
103
+ }).catch((r) => {
104
+ e.#n.errScript(`[add_frame]Html ロード失敗です src:${t.name} ${String(r)}`, !1), n();
105
+ })), _.load((t, a) => {
106
+ let c = document.getElementById(n);
107
+ this.#i[n] = c, this.#s[n] = !1;
108
+ let d = g.lastIndexOf("/") + 1, p = g.slice(0, d), _ = p.slice(0, d);
109
+ c.srcdoc = String(a[r]?.data).replace("sn_repRes();", "").replaceAll(/\s(?:src|href)=(["'])(\S+?)\1/g, (e, t, n) => n.startsWith("../") ? _ + e.slice(3) : e.replace("./", "").replace(t, t + p)), c.srcdoc.includes("true/*WEBP*/;") && (c.srcdoc = c.srcdoc.replaceAll(/data-src="(.+?\.)(?:jpe?g|png)/g, (e, t) => `data-src="${t}webp`)), c.onload = () => {
110
+ S.endProc(h), this.val.setVal_Nochk("tmp", u, !0), this.val.setVal_Nochk("tmp", u + ".alpha", i), this.val.setVal_Nochk("tmp", u + ".x", m.x), this.val.setVal_Nochk("tmp", u + ".y", m.y), this.val.setVal_Nochk("tmp", u + ".scale_x", o), this.val.setVal_Nochk("tmp", u + ".scale_y", s), this.val.setVal_Nochk("tmp", u + ".rotate", l), this.val.setVal_Nochk("tmp", u + ".width", m.width), this.val.setVal_Nochk("tmp", u + ".height", m.height), this.val.setVal_Nochk("tmp", u + ".visible", f);
111
+ let t = c.contentWindow;
112
+ this.#r.resvFlameEvent(t.document.body), t.sn_repRes?.((t) => e.#l(t.dataset.src ?? "", t));
106
113
  };
107
114
  }), !0;
108
115
  }
@@ -111,40 +118,40 @@ var Pages = class e {
111
118
  return this.#s[e];
112
119
  }
113
120
  #c(e) {
114
- let m = { ...e };
115
- return new DOMRect(argChk_Num(m, "x", 0), argChk_Num(m, "y", 0), argChk_Num(m, "width", CmnLib.stageW), argChk_Num(m, "height", CmnLib.stageH));
121
+ let t = { ...e };
122
+ return new DOMRect(r(t, "x", 0), r(t, "y", 0), r(t, "width", o.stageW), r(t, "height", o.stageH));
116
123
  }
117
- static #l(m, h, g) {
118
- let _ = this.#d[m];
119
- if (_) {
120
- h.src = _, g && (h.onload = () => g(h));
124
+ static #l(t, n, r) {
125
+ let i = this.#d[t];
126
+ if (i) {
127
+ n.src = i, r && (n.onload = () => r(n));
121
128
  return;
122
129
  }
123
- let v = this.#u[m];
124
- if (v) {
125
- v.push(h);
130
+ let a = this.#u[t];
131
+ if (a) {
132
+ a.push(n);
126
133
  return;
127
134
  }
128
- this.#u[m] = [h];
129
- let [y = "", b = ""] = m.split("?"), S = e.#e.searchPath(y, SEARCH_PATH_ARG_EXT.SP_GSM), C = new Loader().add({
130
- name: m,
131
- url: S,
132
- xhrType: LoaderResource.XHR_RESPONSE_TYPE.BUFFER
135
+ this.#u[t] = [n];
136
+ let [o = "", s = ""] = t.split("?"), l = e.#e.searchPath(o, v.SP_GSM), u = new c().add({
137
+ name: t,
138
+ url: l,
139
+ xhrType: d.XHR_RESPONSE_TYPE.BUFFER
133
140
  });
134
- e.#t.use4ViteElectron(m, S, C, e.#n) || e.#t.arg.crypto && S.endsWith(".bin") && C.use((m, h) => {
135
- if (m.extension !== "bin") {
136
- h();
141
+ e.#t.use4ViteElectron(t, l, u, e.#n) || e.#t.arg.crypto && l.endsWith(".bin") && u.use((t, n) => {
142
+ if (t.extension !== "bin") {
143
+ n();
137
144
  return;
138
145
  }
139
- e.#t.decAB(m.data).then((e) => {
140
- m.data = e, e instanceof HTMLImageElement && (m.type = LoaderResource.TYPE.IMAGE), h();
141
- }).catch((g) => {
142
- e.#n.errScript(`FrameMng loadPic ロード失敗です fn:${m.name} ${String(g)}`, !1), h();
146
+ e.#t.decAB(t.data).then((e) => {
147
+ t.data = e, e instanceof HTMLImageElement && (t.type = d.TYPE.IMAGE), n();
148
+ }).catch((r) => {
149
+ e.#n.errScript(`FrameMng loadPic ロード失敗です fn:${t.name} ${String(r)}`, !1), n();
143
150
  });
144
- }), C.load((e, m) => {
145
- for (let [e, { data: { src: h } }] of Object.entries(m)) {
146
- let m = this.#d[e] = h + (h.startsWith("blob:") || h.startsWith("data:") ? "" : b ? "?" + b : ""), _ = this.#u[e];
147
- if (_) for (let e of _) e.src = m, g && (e.onload = () => g(e));
151
+ }), u.load((e, t) => {
152
+ for (let [e, { data: { src: n } }] of Object.entries(t)) {
153
+ let t = this.#d[e] = n + (n.startsWith("blob:") || n.startsWith("data:") ? "" : s ? "?" + s : ""), i = this.#u[e];
154
+ if (i) for (let e of i) e.src = t, r && (e.onload = () => r(e));
148
155
  delete this.#u[e];
149
156
  }
150
157
  });
@@ -152,100 +159,103 @@ var Pages = class e {
152
159
  static #u = {};
153
160
  static #d = {};
154
161
  cvsResize() {
155
- for (let [m, h] of Object.entries(this.#i)) {
156
- let g = "const.sn.frm." + m, _ = Number(this.val.getVal(g + ".x")), v = Number(this.val.getVal(g + ".y")), y = Number(this.val.getVal(g + ".width")), b = Number(this.val.getVal(g + ".height"));
157
- h.style.left = `${String(e.#t.ofsLeft4elm + _ * e.#t.cvsScale)}px`, h.style.top = `${String(e.#t.ofsTop4elm + v * e.#t.cvsScale)}px`, h.width = String(y * e.#t.cvsScale), h.height = String(b * e.#t.cvsScale);
162
+ for (let [t, n] of Object.entries(this.#i)) {
163
+ let r = "const.sn.frm." + t, i = Number(this.val.getVal(r + ".x")), a = Number(this.val.getVal(r + ".y")), o = Number(this.val.getVal(r + ".width")), s = Number(this.val.getVal(r + ".height"));
164
+ n.style.left = `${String(e.#t.ofsLeft4elm + i * e.#t.cvsScale)}px`, n.style.top = `${String(e.#t.ofsTop4elm + a * e.#t.cvsScale)}px`, n.width = String(o * e.#t.cvsScale), n.height = String(s * e.#t.cvsScale);
158
165
  }
159
166
  }
160
167
  #f(e) {
161
- let { id: m, var_name: h } = e;
162
- if (!m) throw "idは必須です";
163
- let g = document.getElementById(m);
164
- if (!g) throw `id【${m}】はフレームではありません`;
165
- let _ = "const.sn.frm." + m;
166
- if (!this.val.getVal(`tmp:${_}`)) throw `frame【${m}】が読み込まれていません`;
167
- if (!h) throw "var_nameは必須です";
168
- let y = g.contentWindow;
169
- if (!Object.hasOwn(y, h)) throw `frame【${m}】に変数/関数【${h}】がありません。変数は var付きにして下さい`;
170
- let b = y[h];
171
- return this.val.setVal_Nochk("tmp", _ + "." + h, argChk_Boolean(e, "function", !1) ? b() : b), !1;
168
+ let { id: t, var_name: n } = e;
169
+ if (!t) throw "idは必須です";
170
+ let r = document.getElementById(t);
171
+ if (!r) throw `id【${t}】はフレームではありません`;
172
+ let i = "const.sn.frm." + t;
173
+ if (!this.val.getVal(`tmp:${i}`)) throw `frame【${t}】が読み込まれていません`;
174
+ if (!n) throw "var_nameは必須です";
175
+ let o = r.contentWindow;
176
+ if (!Object.hasOwn(o, n)) throw `frame【${t}】に変数/関数【${n}】がありません。変数は var付きにして下さい`;
177
+ let s = o[n];
178
+ return this.val.setVal_Nochk("tmp", i + "." + n, a(e, "function", !1) ? s() : s), !1;
172
179
  }
173
180
  #p(e) {
174
- let { id: m, var_name: h, text: g } = e;
175
- if (!m) throw "idは必須です";
176
- let _ = document.getElementById(m);
177
- if (!_) throw `id【${m}】はフレームではありません`;
178
- let v = "const.sn.frm." + m;
179
- if (!this.val.getVal(`tmp:${v}`)) throw `frame【${m}】が読み込まれていません`;
180
- if (!h) throw "var_nameは必須です";
181
- if (!g) throw "textは必須です";
182
- this.val.setVal_Nochk("tmp", v + "." + h, g);
183
- let y = _.contentWindow;
184
- return y[h] = g, !1;
181
+ let { id: t, var_name: n, text: r } = e;
182
+ if (!t) throw "idは必須です";
183
+ let i = document.getElementById(t);
184
+ if (!i) throw `id【${t}】はフレームではありません`;
185
+ let a = "const.sn.frm." + t;
186
+ if (!this.val.getVal(`tmp:${a}`)) throw `frame【${t}】が読み込まれていません`;
187
+ if (!n) throw "var_nameは必須です";
188
+ if (!r) throw "textは必須です";
189
+ this.val.setVal_Nochk("tmp", a + "." + n, r);
190
+ let o = i.contentWindow;
191
+ return o[n] = r, !1;
185
192
  }
186
193
  #m = 1;
187
- #h(m) {
188
- let { id: h } = m;
189
- if (!h) throw "idは必須です";
190
- let _ = document.getElementById(h);
191
- if (!_) throw `id【${h}】はフレームではありません`;
192
- let y = "const.sn.frm." + h;
193
- if (!this.val.getVal("tmp:" + y)) throw `frame【${h}】が読み込まれていません`;
194
- let b = _.style;
195
- if (argChk_Boolean(m, "float", !1) ? b.zIndex = String(++this.#m) : "index" in m ? b.zIndex = String(argChk_Num(m, "index", 0)) : m.dive && (b.zIndex = String(-++this.#m)), "alpha" in m) {
196
- let e = b.opacity = String(m.alpha);
197
- this.val.setVal_Nochk("tmp", y + ".alpha", e);
194
+ #h(t) {
195
+ let { id: n } = t;
196
+ if (!n) throw "idは必須です";
197
+ let i = document.getElementById(n);
198
+ if (!i) throw `id【${n}】はフレームではありません`;
199
+ let o = "const.sn.frm." + n;
200
+ if (!this.val.getVal("tmp:" + o)) throw `frame【${n}】が読み込まれていません`;
201
+ let s = i.style;
202
+ if (a(t, "float", !1) ? s.zIndex = String(++this.#m) : "index" in t ? s.zIndex = String(r(t, "index", 0)) : t.dive && (s.zIndex = String(-++this.#m)), "alpha" in t) {
203
+ let e = s.opacity = String(t.alpha);
204
+ this.val.setVal_Nochk("tmp", o + ".alpha", e);
198
205
  }
199
- let x = this.#c(m);
200
- if (("x" in m || "y" in m) && (b.left = `${String(e.#t.ofsLeft4elm + x.x * e.#t.cvsScale)}px`, b.top = `${String(e.#t.ofsTop4elm + x.y * e.#t.cvsScale)}px`, this.val.setVal_Nochk("tmp", y + ".x", x.x), this.val.setVal_Nochk("tmp", y + ".y", x.y)), "scale_x" in m || "scale_y" in m || "rotate" in m) {
201
- let e = argChk_Num(m, "scale_x", 1), h = argChk_Num(m, "scale_y", 1), _ = argChk_Num(m, "rotate", 0);
202
- b.transform = `scale(${String(e)}, ${String(h)}) rotate(${String(_)}deg)`, this.val.setVal_Nochk("tmp", y + ".scale_x", e), this.val.setVal_Nochk("tmp", y + ".scale_y", h), this.val.setVal_Nochk("tmp", y + ".rotate", _);
206
+ let c = this.#c(t);
207
+ if (("x" in t || "y" in t) && (s.left = `${String(e.#t.ofsLeft4elm + c.x * e.#t.cvsScale)}px`, s.top = `${String(e.#t.ofsTop4elm + c.y * e.#t.cvsScale)}px`, this.val.setVal_Nochk("tmp", o + ".x", c.x), this.val.setVal_Nochk("tmp", o + ".y", c.y)), "scale_x" in t || "scale_y" in t || "rotate" in t) {
208
+ let e = r(t, "scale_x", 1), n = r(t, "scale_y", 1), i = r(t, "rotate", 0);
209
+ s.transform = `scale(${String(e)}, ${String(n)}) rotate(${String(i)}deg)`, this.val.setVal_Nochk("tmp", o + ".scale_x", e), this.val.setVal_Nochk("tmp", o + ".scale_y", n), this.val.setVal_Nochk("tmp", o + ".rotate", i);
203
210
  }
204
- if ("width" in m && (_.width = String(x.width * e.#t.cvsScale), this.val.setVal_Nochk("tmp", y + ".width", x.width)), "height" in m && (_.height = String(x.height * e.#t.cvsScale), this.val.setVal_Nochk("tmp", y + ".height", x.height)), "visible" in m) {
205
- let e = argChk_Boolean(m, "visible", !0);
206
- b.display = e ? "inline" : "none", this.val.setVal_Nochk("tmp", y + ".visible", e);
211
+ if ("width" in t && (i.width = String(c.width * e.#t.cvsScale), this.val.setVal_Nochk("tmp", o + ".width", c.width)), "height" in t && (i.height = String(c.height * e.#t.cvsScale), this.val.setVal_Nochk("tmp", o + ".height", c.height)), "visible" in t) {
212
+ let e = a(t, "visible", !0);
213
+ s.display = e ? "inline" : "none", this.val.setVal_Nochk("tmp", o + ".visible", e);
207
214
  }
208
- if ("b_color" in m && (b.backgroundColor = m.b_color), "disabled" in m) {
209
- let e = this.#s[h] = argChk_Boolean(m, "disabled", !0), g = _.contentDocument.body;
210
- for (let m of [...Array.from(g.getElementsByTagName("input")), ...Array.from(g.getElementsByTagName("select"))]) m.disabled = e;
215
+ if ("b_color" in t && (s.backgroundColor = t.b_color), "disabled" in t) {
216
+ let e = this.#s[n] = a(t, "disabled", !0), r = i.contentDocument.body;
217
+ for (let t of [...Array.from(r.getElementsByTagName("input")), ...Array.from(r.getElementsByTagName("select"))]) t.disabled = e;
211
218
  }
212
219
  return !1;
213
220
  }
214
- #g(m) {
215
- let { id: h, alpha: _, x: v, y, scale_x: b, scale_y: x, rotate: S, width: C, height: w } = m;
216
- if (!h) throw "idは必須です";
217
- let T = document.getElementById(h);
218
- if (!T) throw `id【${h}】はフレームではありません`;
219
- let E = "const.sn.frm." + h;
220
- if (!this.val.getVal(`tmp:${E}`, 0)) throw `frame【${h}】が読み込まれていません`;
221
- let D = {};
222
- _ && (D.a = Number(T.style.opacity)), (v || y || b || x || S) && (D.x = Number(this.val.getVal(`tmp:${E}.x`)), D.y = Number(this.val.getVal(`tmp:${E}.y`)), D.sx = Number(this.val.getVal(`tmp:${E}.scale_x`)), D.sy = Number(this.val.getVal(`tmp:${E}.scale_y`)), D.r = Number(this.val.getVal(`tmp:${E}.rotate`))), C && (D.w = Number(this.val.getVal(`tmp:${E}.width`))), w && (D.h = Number(this.val.getVal(`tmp:${E}.height`)));
223
- let O = CmnTween.cnvTweenArg(m, D), k = {}, A = (e) => {};
224
- _ && (k.a = argChk_Num(O, "alpha", 0), A = (e) => {
225
- T.style.opacity = String(e.a), this.val.setVal_Nochk("tmp", "alpha", e.a);
221
+ #g(t) {
222
+ let { id: n, alpha: i, x: a, y: o, scale_x: s, scale_y: c, rotate: l, width: u, height: d } = t;
223
+ if (!n) throw "idは必須です";
224
+ let f = document.getElementById(n);
225
+ if (!f) throw `id【${n}】はフレームではありません`;
226
+ let p = "const.sn.frm." + n;
227
+ if (!this.val.getVal(`tmp:${p}`, 0)) throw `frame【${n}】が読み込まれていません`;
228
+ let m = {};
229
+ i && (m.a = Number(f.style.opacity)), (a || o || s || c || l) && (m.x = Number(this.val.getVal(`tmp:${p}.x`)), m.y = Number(this.val.getVal(`tmp:${p}.y`)), m.sx = Number(this.val.getVal(`tmp:${p}.scale_x`)), m.sy = Number(this.val.getVal(`tmp:${p}.scale_y`)), m.r = Number(this.val.getVal(`tmp:${p}.rotate`))), u && (m.w = Number(this.val.getVal(`tmp:${p}.width`))), d && (m.h = Number(this.val.getVal(`tmp:${p}.height`)));
230
+ let h = x.cnvTweenArg(t, m), g = {}, _ = (e) => {};
231
+ i && (g.a = r(h, "alpha", 0), _ = (e) => {
232
+ f.style.opacity = String(e.a), this.val.setVal_Nochk("tmp", "alpha", e.a);
226
233
  });
227
- let j = (e) => {}, M = this.#c(O);
228
- (v || y || b || x || S) && (k.x = M.x, k.y = M.y, k.sx = argChk_Num(O, "scale_x", 1), k.sy = argChk_Num(O, "scale_y", 1), k.r = argChk_Num(O, "rotate", 0), j = (m) => {
229
- T.style.left = `${String(e.#t.ofsLeft4elm + m.x * e.#t.cvsScale)} px`, T.style.top = `${String(e.#t.ofsTop4elm + m.y * e.#t.cvsScale)} px`, T.style.transform = `scale(${String(m.sx)}, ${String(m.sy)}) rotate(${String(m.r)}deg)`, this.val.setVal_Nochk("tmp", E + ".x", m.x), this.val.setVal_Nochk("tmp", E + ".y", m.y), this.val.setVal_Nochk("tmp", E + ".scale_x", m.sx), this.val.setVal_Nochk("tmp", E + ".scale_y", m.sy), this.val.setVal_Nochk("tmp", E + ".rotate", m.r);
234
+ let v = (e) => {}, y = this.#c(h);
235
+ (a || o || s || c || l) && (g.x = y.x, g.y = y.y, g.sx = r(h, "scale_x", 1), g.sy = r(h, "scale_y", 1), g.r = r(h, "rotate", 0), v = (t) => {
236
+ f.style.left = `${String(e.#t.ofsLeft4elm + t.x * e.#t.cvsScale)} px`, f.style.top = `${String(e.#t.ofsTop4elm + t.y * e.#t.cvsScale)} px`, f.style.transform = `scale(${String(t.sx)}, ${String(t.sy)}) rotate(${String(t.r)}deg)`, this.val.setVal_Nochk("tmp", p + ".x", t.x), this.val.setVal_Nochk("tmp", p + ".y", t.y), this.val.setVal_Nochk("tmp", p + ".scale_x", t.sx), this.val.setVal_Nochk("tmp", p + ".scale_y", t.sy), this.val.setVal_Nochk("tmp", p + ".rotate", t.r);
230
237
  });
231
- let N = (e) => {};
232
- C && (k.w = M.width, N = (m) => {
233
- T.width = `${String(m.w * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", E + ".width", m.w);
238
+ let b = (e) => {};
239
+ u && (g.w = y.width, b = (t) => {
240
+ f.width = `${String(t.w * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", p + ".width", t.w);
234
241
  });
235
- let P = (e) => {};
236
- return w && (k.h = M.height, P = (m) => {
237
- T.height = `${String(m.h * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", E + ".height", m.h);
238
- }), this.appPixi.stage.interactive = !1, CmnTween.tween(`frm\n${h}`, m, D, CmnTween.cnvTweenArg(m, D), (e) => {
239
- A(e), j(e), N(e), P(e);
242
+ let S = (e) => {};
243
+ return d && (g.h = y.height, S = (t) => {
244
+ f.height = `${String(t.h * e.#t.cvsScale)} px`, this.val.setVal_Nochk("tmp", p + ".height", t.h);
245
+ }), this.appPixi.stage.interactive = !1, x.tween(`frm\n${n}`, t, m, x.cnvTweenArg(t, m), (e) => {
246
+ _(e), v(e), b(e), S(e);
240
247
  }, () => {
241
248
  this.appPixi.stage.interactive = !0;
242
249
  }, () => {}), !1;
243
250
  }
244
- }, Log = class {
251
+ }, N = class {
252
+ oCfg;
253
+ hTag;
254
+ val;
245
255
  #e = { text: "" };
246
256
  #t = [];
247
- constructor(e, m, h) {
248
- this.oCfg = e, this.hTag = m, this.val = h, m.rec_ch = (e) => this.#n(e), m.rec_r = (e) => this.#r(e), m.reset_rec = (e) => this.#i(e), h.defTmp("const.sn.log.json", () => {
257
+ constructor(e, t, n) {
258
+ this.oCfg = e, this.hTag = t, this.val = n, t.rec_ch = (e) => this.#n(e), t.rec_r = (e) => this.#r(e), t.reset_rec = (e) => this.#i(e), n.defTmp("const.sn.log.json", () => {
249
259
  this.#e.text = this.#e.text.replaceAll("</span><span class='sn_ch'>", "");
250
260
  let e = [...this.#t, this.#e];
251
261
  return JSON.stringify(e);
@@ -276,94 +286,103 @@ var Pages = class e {
276
286
  this.#t = JSON.parse(String(this.val.getVal("save:const.sn.sLog"))), this.#e = { text: "" };
277
287
  }
278
288
  };
279
- function cnvSArg(e) {
289
+ //#endregion
290
+ //#region src/sn/LayerMng.ts
291
+ function P(e) {
280
292
  return encodeURIComponent(JSON.stringify(e));
281
293
  }
282
- var LayerMng = class x {
294
+ var F = class c {
295
+ cfg;
296
+ hTag;
297
+ appPixi;
298
+ val;
299
+ main;
300
+ scrItr;
301
+ sys;
283
302
  #e;
284
- #t = new Container();
285
- #n = new Container();
303
+ #t = new f();
304
+ #n = new f();
286
305
  #r;
287
306
  #i;
288
307
  #a;
289
- #o = new EventListenerCtn();
290
- constructor(e, m, g, _, v, b, x, S, C) {
291
- this.cfg = e, this.hTag = m, this.appPixi = g, this.val = _, this.main = v, this.scrItr = b, this.sys = x;
292
- let w = () => {
293
- if (x.cvsResize(), this.cvsResizeDesign(), this.#l) for (let e of this.#S) this.#x[e].fore.cvsResizeChildren();
308
+ #o = new _();
309
+ constructor(e, t, r, i, a, s, c, l, u) {
310
+ this.cfg = e, this.hTag = t, this.appPixi = r, this.val = i, this.main = a, this.scrItr = s, this.sys = c;
311
+ let d = () => {
312
+ if (c.cvsResize(), this.cvsResizeDesign(), this.#l) for (let e of this.#S) this.#x[e].fore.cvsResizeChildren();
294
313
  else for (let e of this.#S) this.#x[e].fore.cvsResize();
295
314
  this.#r.cvsResize(), this.#f.cvsResize();
296
315
  };
297
- if (CmnLib.isMobile) this.#o.add(globalThis, "orientationchange", w, { passive: !0 });
316
+ if (o.isMobile) this.#o.add(globalThis, "orientationchange", d, { passive: !0 });
298
317
  else {
299
318
  let e;
300
319
  this.#o.add(globalThis, "resize", () => {
301
320
  e ||= setTimeout(() => {
302
- e = void 0, w();
321
+ e = void 0, d();
303
322
  }, 1e3 / 60 * 10);
304
323
  }, { passive: !0 });
305
324
  }
306
- x.cvsResize(), this.#a = new Log(this.cfg.oCfg, m, _), TxtLayer.init(e, m, _, this.#a, (e) => this.#x[e.layname].fore === e, g), GrpLayer.init(v, e, g, x, S, _), FrameMng.init(e, x, v), this.#r = new FrameMng(m, g, _), m.loadplugin = (e) => this.#y(e), m.snapshot = (e) => this.#h(e), this.#g = this.sys.isApp ? (e, m, h, g, _) => this.#_(e, m, h, g, _) : (e, m, h, g, _) => this.#v(e, m, h, g, _), m.add_lay = (e) => this.#b(e), m.clear_lay = (e) => this.#D(e), m.finish_trans = () => !1, m.lay = (e) => this.#T(e), m.trans = (e) => this.#N(e), m.wt = (e) => CmnTween.wt(e), m.quake = (e) => this.#L(e), m.stop_quake = m.finish_trans, m.wq = m.wt, m.pause_tsy = (e) => CmnTween.pause_tsy(e), m.resume_tsy = (e) => CmnTween.resume_tsy(e), m.stop_tsy = (e) => CmnTween.stop_tsy(e), m.tsy = (e) => this.#R(e), m.wait_tsy = (e) => CmnTween.wait_tsy(e), m.add_filter = (e) => this.#z(e), m.clear_filter = (e) => this.#V(e), m.enable_filter = (e) => this.#H(e), m.ch = (e) => this.#W(e), m.clear_text = (e) => this.#Q(e), m.current = (e) => this.#q(e), m.endlink = (e) => this.#$(e), m.er = (e) => this.#ee(e), m.graph = (e) => this.#te(e), m.link = (e) => this.#ne(e), m.r = (e) => this.#re(e), m.ruby2 = (e) => this.#ie(e), m.span = (e) => this.#ae(e), m.tcy = (e) => this.#oe(e), m.add_face = (e) => SpritesMng.add_face(e), m.wv = (e) => SpritesMng.wv(e), m.dump_lay = (e) => this.#se(e), m.enable_event = (e) => this.#ce(e), m.button = (e) => this.#le(e), e.existsBreakline && (this.breakLine = (e) => {
307
- delete e.visible, e.id = "break", e.pic = "breakline", this.#m("grp|" + cnvSArg(e));
325
+ c.cvsResize(), this.#a = new N(this.cfg.oCfg, t, i), E.init(e, t, i, this.#a, (e) => this.#x[e.layname].fore === e, r), O.init(a, e, r, c, l, i), M.init(e, c, a), this.#r = new M(t, r, i), t.loadplugin = (e) => this.#y(e), t.snapshot = (e) => this.#h(e), this.#g = this.sys.isApp ? (e, t, n, r, i) => this.#_(e, t, n, r, i) : (e, t, n, r, i) => this.#v(e, t, n, r, i), t.add_lay = (e) => this.#b(e), t.clear_lay = (e) => this.#D(e), t.finish_trans = () => !1, t.lay = (e) => this.#T(e), t.trans = (e) => this.#N(e), t.wt = (e) => x.wt(e), t.quake = (e) => this.#L(e), t.stop_quake = t.finish_trans, t.wq = t.wt, t.pause_tsy = (e) => x.pause_tsy(e), t.resume_tsy = (e) => x.resume_tsy(e), t.stop_tsy = (e) => x.stop_tsy(e), t.tsy = (e) => this.#R(e), t.wait_tsy = (e) => x.wait_tsy(e), t.add_filter = (e) => this.#z(e), t.clear_filter = (e) => this.#V(e), t.enable_filter = (e) => this.#H(e), t.ch = (e) => this.#W(e), t.clear_text = (e) => this.#Q(e), t.current = (e) => this.#q(e), t.endlink = (e) => this.#$(e), t.er = (e) => this.#ee(e), t.graph = (e) => this.#te(e), t.link = (e) => this.#ne(e), t.r = (e) => this.#re(e), t.ruby2 = (e) => this.#ie(e), t.span = (e) => this.#ae(e), t.tcy = (e) => this.#oe(e), t.add_face = (e) => C.add_face(e), t.wv = (e) => C.wv(e), t.dump_lay = (e) => this.#se(e), t.enable_event = (e) => this.#ce(e), t.button = (e) => this.#le(e), e.existsBreakline && (this.breakLine = (e) => {
326
+ delete e.visible, e.id = "break", e.pic = "breakline", this.#m("grp|" + P(e));
308
327
  }), e.existsBreakpage && (this.breakPage = (e) => {
309
- delete e.visible, e.id = "break", e.pic = "breakpage", this.#m("grp|" + cnvSArg(e));
310
- }), this.#i = parseColor(String(e.oCfg.init.bg_color));
311
- let T = new Graphics();
312
- T.beginFill(this.#i).lineStyle(0, this.#i).drawRect(0, 0, CmnLib.stageW, CmnLib.stageH).endFill(), this.#t.addChild(T.clone()), this.#n.addChild(T), this.#n.visible = !1, this.#t.name = "page:A", this.#n.name = "page:B", this.#e = g.stage, this.#e.addChild(this.#n), this.#e.addChild(this.#t), this.#e.addChild(this.#A), this.#e.addChild(this.#M), this.#e.name = "stage";
313
- let E = (e, m) => {
314
- this.#p(Number(m));
328
+ delete e.visible, e.id = "break", e.pic = "breakpage", this.#m("grp|" + P(e));
329
+ }), this.#i = n(String(e.oCfg.init.bg_color));
330
+ let f = new h();
331
+ f.beginFill(this.#i).lineStyle(0, this.#i).drawRect(0, 0, o.stageW, o.stageH).endFill(), this.#t.addChild(f.clone()), this.#n.addChild(f), this.#n.visible = !1, this.#t.name = "page:A", this.#n.name = "page:B", this.#e = r.stage, this.#e.addChild(this.#n), this.#e.addChild(this.#t), this.#e.addChild(this.#A), this.#e.addChild(this.#M), this.#e.name = "stage";
332
+ let p = (e, t) => {
333
+ this.#p(Number(t));
315
334
  };
316
- E("", _.getVal("sys:TextLayer.Back.Alpha", 1)), _.defValTrg("sys:TextLayer.Back.Alpha", E);
317
- let D = (e, m) => {
318
- Button.fontFamily = m;
335
+ p("", i.getVal("sys:TextLayer.Back.Alpha", 1)), i.defValTrg("sys:TextLayer.Back.Alpha", p);
336
+ let m = (e, t) => {
337
+ w.fontFamily = t;
319
338
  };
320
- D("", _.getVal("tmp:sn.button.fontFamily", Button.fontFamily)), _.defValTrg("tmp:sn.button.fontFamily", D), _.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), _.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), CmnLib.isDbg && (DesignCast.init(g, x, b, C, e, this.#x), this.cvsResizeDesign = () => DesignCast.cvsResizeDesign(), x.addHook((e, m) => {
321
- this.#s[e]?.(e, m) && delete this.#s[e];
339
+ m("", i.getVal("tmp:sn.button.fontFamily", w.fontFamily)), i.defValTrg("tmp:sn.button.fontFamily", m), i.defTmp("const.sn.last_page_text", () => this.currentTxtlayFore?.pageText ?? ""), i.defTmp("const.sn.last_page_plain_text", () => this.currentTxtlayFore?.pagePlainText ?? ""), o.isDbg && (k.init(r, c, s, u, e, this.#x), this.cvsResizeDesign = () => k.cvsResizeDesign(), c.addHook((e, t) => {
340
+ this.#s[e]?.(e, t) && delete this.#s[e];
322
341
  }));
323
342
  }
324
343
  cvsResizeDesign() {}
325
344
  #s = {
326
- attach: (e) => (DesignCast.leaveMode(), !1),
327
- continue: (e) => (DesignCast.leaveMode(), !1),
328
- disconnect: (e) => (DesignCast.leaveMode(), !1),
345
+ attach: (e) => (k.leaveMode(), !1),
346
+ continue: (e) => (k.leaveMode(), !1),
347
+ disconnect: (e) => (k.leaveMode(), !1),
329
348
  _enterDesign: (e) => {
330
- DesignCast.enterMode();
349
+ k.enterMode();
331
350
  for (let e of this.#S) {
332
- let m = this.#x[e].fore;
333
- m.makeDesignCastChildren((e) => e.make()), m.makeDesignCast((e) => e.make());
351
+ let t = this.#x[e].fore;
352
+ t.makeDesignCastChildren((e) => e.make()), t.makeDesignCast((e) => e.make());
334
353
  }
335
354
  return this.#u(this.#C), !1;
336
355
  },
337
- _replaceToken: (e, m) => (DesignCast.replaceToken(m), !1),
338
- _selectNode: (e, m) => (this.#u(m.node), !1)
356
+ _replaceToken: (e, t) => (k.replaceToken(t), !1),
357
+ _selectNode: (e, t) => (this.#u(t.node), !1)
339
358
  };
340
359
  #c = "";
341
360
  #l = "";
342
361
  #u(e) {
343
362
  [this.#c = "", this.#l = ""] = e.split("/");
344
- let m = this.#x[this.#c];
345
- m && (DesignCast.allHide(), this.#l ? m.fore.showDesignCastChildren() : m.fore.showDesignCast());
363
+ let t = this.#x[this.#c];
364
+ t && (k.allHide(), this.#l ? t.fore.showDesignCastChildren() : t.fore.showDesignCast());
346
365
  }
347
366
  getFrmDisabled = (e) => this.#r.getFrmDisabled(e);
348
367
  #d = void 0;
349
- cover(e, m = 0) {
350
- this.#d &&= (this.#e.removeChild(this.#d), this.#d.destroy(), void 0), e && this.#e.addChild((this.#d = new Graphics()).beginFill(m).lineStyle(0, m).drawRect(0, 0, CmnLib.stageW, CmnLib.stageH).endFill());
368
+ cover(e, t = 0) {
369
+ this.#d &&= (this.#e.removeChild(this.#d), this.#d.destroy(), void 0), e && this.#e.addChild((this.#d = new h()).beginFill(t).lineStyle(0, t).drawRect(0, 0, o.stageW, o.stageH).endFill());
351
370
  }
352
371
  #f;
353
372
  setEvtMng(e) {
354
- this.#f = e, this.#r.setEvtMng(e), SpritesMng.setEvtMng(e), CmnTween.init(e);
373
+ this.#f = e, this.#r.setEvtMng(e), C.setEvtMng(e), x.init(e);
355
374
  }
356
375
  destroy() {
357
376
  for (let e of Object.values(this.#x)) e.destroy();
358
- this.#o.clear(), GrpLayer.destroy(), RubySpliter.destroy(), TxtStage.destroy(), TxtLayer.destroy(), this.#r.destroy(), CmnTween.destroy(), TxtLayer.msecChWait = 10;
377
+ this.#o.clear(), O.destroy(), T.destroy(), D.destroy(), E.destroy(), this.#r.destroy(), x.destroy(), E.msecChWait = 10;
359
378
  }
360
379
  #p(e) {
361
- for (let m of this.#S) {
362
- let { fore: h, back: g } = this.#x[m];
363
- h instanceof TxtLayer && (h.chgBackAlpha(e), g.chgBackAlpha(e));
380
+ for (let t of this.#S) {
381
+ let { fore: n, back: r } = this.#x[t];
382
+ n instanceof E && (n.chgBackAlpha(e), r.chgBackAlpha(e));
364
383
  }
365
384
  }
366
- #m = (e, m = this.currentTxtlayForeNeedErr, h = !0) => m.tagCh("|&emsp;《" + e + "》");
385
+ #m = (e, t = this.currentTxtlayForeNeedErr, n = !0) => t.tagCh("|&emsp;《" + e + "》");
367
386
  goTxt = () => {};
368
387
  get needGoTxt() {
369
388
  return this.currentTxtlayFore?.needGoTxt ?? !1;
@@ -374,326 +393,326 @@ var LayerMng = class x {
374
393
  this.currentTxtlayFore && (this.clearBreak = () => this.#m("del|break"), this.clearBreak());
375
394
  }
376
395
  clickTxtLay() {
377
- return this.currentTxtlayFore ? this.#S.map((e) => this.#x[e].fore).some((e) => e instanceof TxtLayer && e.click()) : !1;
396
+ return this.currentTxtlayFore ? this.#S.map((e) => this.#x[e].fore).some((e) => e instanceof E && e.click()) : !1;
378
397
  }
379
398
  #h(e) {
380
- let m = getDateStr("-", "_", "", "_"), h = e.fn ? e.fn.startsWith("userdata:/") ? e.fn : `${PROTOCOL_DL + e.fn + m}.png` : `${PROTOCOL_DL}snapshot${m}.png`, _ = this.cfg.searchPath(h), v = argChk_Num(e, "width", CmnLib.stageW), x = argChk_Num(e, "height", CmnLib.stageH);
381
- return this.#g(e, _, v, x, `snapshot dt:${m}`);
399
+ let t = s("-", "_", "", "_"), n = e.fn ? e.fn.startsWith("userdata:/") ? e.fn : `${A + e.fn + t}.png` : `${A}snapshot${t}.png`, i = this.cfg.searchPath(n), a = r(e, "width", o.stageW), c = r(e, "height", o.stageH);
400
+ return this.#g(e, i, a, c, `snapshot dt:${t}`);
382
401
  }
383
402
  #g = () => !1;
384
- #_({ layer: e }, m, h, g, _) {
385
- if (this.#r.hideAllFrame(), Reading.beginProc(_), !e) return this.sys.capturePage(m, h, g, () => {
386
- this.#r.restoreAllFrame(), Reading.endProc(_);
403
+ #_({ layer: e }, t, n, r, i) {
404
+ if (this.#r.hideAllFrame(), S.beginProc(i), !e) return this.sys.capturePage(t, n, r, () => {
405
+ this.#r.restoreAllFrame(), S.endProc(i);
387
406
  }), !0;
388
- let v = this.#S.map((e) => {
389
- let { ctn: m } = this.#x[e].fore, h = [m, m.visible];
390
- return m.visible = !1, h;
407
+ let a = this.#S.map((e) => {
408
+ let { ctn: t } = this.#x[e].fore, n = [t, t.visible];
409
+ return t.visible = !1, n;
391
410
  });
392
- for (let m of this.#P(e)) this.#x[m].fore.ctn.visible = !0;
393
- return this.sys.capturePage(m, h, g, () => {
394
- for (let [e, m] of v) e.visible = m;
395
- this.#r.restoreAllFrame(), Reading.endProc(_);
411
+ for (let t of this.#P(e)) this.#x[t].fore.ctn.visible = !0;
412
+ return this.sys.capturePage(t, n, r, () => {
413
+ for (let [e, t] of a) e.visible = t;
414
+ this.#r.restoreAllFrame(), S.endProc(i);
396
415
  }), !0;
397
416
  }
398
- #v(m, h, g, _, y) {
399
- Reading.beginProc(y);
400
- let b = argChk_Color(m, "b_color", this.#i), x = autoDetectRenderer({
401
- width: g,
402
- height: _,
403
- backgroundAlpha: b > 16777216 && h.endsWith(".png") ? 0 : 1,
404
- antialias: argChk_Boolean(m, "smoothing", !1),
417
+ #v(t, n, r, i, o) {
418
+ S.beginProc(o);
419
+ let s = e(t, "b_color", this.#i), c = m({
420
+ width: r,
421
+ height: i,
422
+ backgroundAlpha: s > 16777216 && n.endsWith(".png") ? 0 : 1,
423
+ antialias: a(t, "smoothing", !1),
405
424
  preserveDrawingBuffer: !0,
406
- backgroundColor: b & 16777215,
425
+ backgroundColor: s & 16777215,
407
426
  autoDensity: !0
408
- }), C = m.page === "back" ? "back" : "fore", { layer: w } = m;
409
- return Promise.allSettled(this.#P(w).map((e) => new Promise((m) => this.#x[e][C].snapshot(x, m)))).then(async () => {
410
- let e = RenderTexture.create({
411
- width: x.width,
412
- height: x.height
427
+ }), u = t.page === "back" ? "back" : "fore", { layer: d } = t;
428
+ return Promise.allSettled(this.#P(d).map((e) => new Promise((t) => this.#x[e][u].snapshot(c, t)))).then(async () => {
429
+ let e = l.create({
430
+ width: c.width,
431
+ height: c.height
413
432
  });
414
- x.render(this.#e, { renderTexture: e }), await this.sys.savePic(h, x.plugins.extract.base64(e)), e.destroy();
415
- for (let e of this.#P(w)) this.#x[e][C].snapshot_end();
416
- x.destroy(!0), Reading.endProc(y);
433
+ c.render(this.#e, { renderTexture: e }), await this.sys.savePic(n, c.plugins.extract.base64(e)), e.destroy();
434
+ for (let e of this.#P(d)) this.#x[e][u].snapshot_end();
435
+ c.destroy(!0), S.endProc(o);
417
436
  }), !0;
418
437
  }
419
438
  #y(e) {
420
- let { fn: m } = e;
421
- if (!m) throw "fnは必須です";
422
- if (!m.endsWith(".css")) throw "サポートされない拡張子です";
423
- let h = argChk_Boolean(e, "join", !0), g = Reading.procID + `loadplugin fn:${m}`;
424
- return h && Reading.beginProc(g), (async () => {
425
- let e = await fetch(m);
439
+ let { fn: t } = e;
440
+ if (!t) throw "fnは必須です";
441
+ if (!t.endsWith(".css")) throw "サポートされない拡張子です";
442
+ let n = a(e, "join", !0), r = S.procID + `loadplugin fn:${t}`;
443
+ return n && S.beginProc(r), (async () => {
444
+ let e = await fetch(t);
426
445
  if (!e.ok) throw Error("Network response was not ok.");
427
- addStyle(await e.text()), h && Reading.endProc(g);
428
- })(), h;
446
+ i(await e.text()), n && S.endProc(r);
447
+ })(), n;
429
448
  }
430
449
  #b(e) {
431
- let { layer: m, class: h } = e;
432
- if (!m) throw "layerは必須です";
433
- if (m.includes(",")) throw "layer名に「,」は使えません";
434
- if (m in this.#x) throw `layer【${m}】はすでにあります`;
435
- if (!h) throw "clsは必須です";
436
- let g = { isWait: !1 };
437
- switch (this.#x[m] = new Pages(m, h, this.#t, this.#n, e, this.sys, this.val, g), this.#S.push(m), h) {
450
+ let { layer: t, class: n } = e;
451
+ if (!t) throw "layerは必須です";
452
+ if (t.includes(",")) throw "layer名に「,」は使えません";
453
+ if (t in this.#x) throw `layer【${t}】はすでにあります`;
454
+ if (!n) throw "clsは必須です";
455
+ let r = { isWait: !1 };
456
+ switch (this.#x[t] = new j(t, n, this.#t, this.#n, e, this.sys, this.val, r), this.#S.push(t), n) {
438
457
  case "txt":
439
- this.#C || (this.#X = () => {}, this.#G = (e) => this.#K(e), this.#q = (e) => this.#J(e), this.hTag.current({ layer: m }), this.goTxt = () => {
440
- this.#f.isSkipping ? TxtLayer.msecChWait = 0 : this.setNormalChWait();
458
+ this.#C || (this.#X = () => {}, this.#G = (e) => this.#K(e), this.#q = (e) => this.#J(e), this.hTag.current({ layer: t }), this.goTxt = () => {
459
+ this.#f.isSkipping ? E.msecChWait = 0 : this.setNormalChWait();
441
460
  for (let e of this.#S) {
442
- let m = this.#x[e].fore;
443
- m instanceof TxtLayer && this.#m("gotxt|", m, !1);
461
+ let t = this.#x[e].fore;
462
+ t instanceof E && this.#m("gotxt|", t, !1);
444
463
  }
445
- }), this.val.setVal_Nochk("save", "const.sn.layer." + m + ".enabled", !0);
464
+ }), this.val.setVal_Nochk("save", "const.sn.layer." + t + ".enabled", !0);
446
465
  break;
447
466
  case "grp":
448
467
  if (this.#w) break;
449
- this.#w = m;
468
+ this.#w = t;
450
469
  break;
451
470
  }
452
- return this.scrItr.recodeDesign(e), g.isWait;
471
+ return this.scrItr.recodeDesign(e), r.isWait;
453
472
  }
454
473
  #x = {};
455
474
  #S = [];
456
475
  #C = "";
457
476
  #w = "";
458
477
  #T(e) {
459
- let m = this.#Z(e), h = this.#x[m], _ = h.back.ctn, y = h.fore.ctn;
460
- if (argChk_Boolean(e, "float", !1)) this.#n.setChildIndex(_, this.#n.children.length - 1), this.#t.setChildIndex(y, this.#t.children.length - 1), this.#E();
461
- else if (e.index) argChk_Num(e, "index", 0) && (this.#n.setChildIndex(_, e.index), this.#t.setChildIndex(y, e.index), this.#E());
478
+ let t = this.#Z(e), n = this.#x[t], i = n.back.ctn, o = n.fore.ctn;
479
+ if (a(e, "float", !1)) this.#n.setChildIndex(i, this.#n.children.length - 1), this.#t.setChildIndex(o, this.#t.children.length - 1), this.#E();
480
+ else if (e.index) r(e, "index", 0) && (this.#n.setChildIndex(i, e.index), this.#t.setChildIndex(o, e.index), this.#E());
462
481
  else if (e.dive) {
463
- let { dive: h } = e, g = 0;
464
- if (m === h) throw "[lay] 属性 layerとdiveが同じ【" + h + "】です";
465
- let v = this.#x[h];
466
- if (!v) throw "[lay] 属性 dive【" + h + "】が不正です。レイヤーがありません";
467
- let b = v.back, x = v.fore, S = this.#n.getChildIndex(b.ctn), C = this.#t.getChildIndex(x.ctn);
468
- g = S < C ? S : C, g > this.#n.getChildIndex(_) && --g, this.#t.setChildIndex(y, g), this.#n.setChildIndex(_, g), this.#E();
482
+ let { dive: n } = e, r = 0;
483
+ if (t === n) throw "[lay] 属性 layerとdiveが同じ【" + n + "】です";
484
+ let a = this.#x[n];
485
+ if (!a) throw "[lay] 属性 dive【" + n + "】が不正です。レイヤーがありません";
486
+ let s = a.back, c = a.fore, l = this.#n.getChildIndex(s.ctn), u = this.#t.getChildIndex(c.ctn);
487
+ r = l < u ? l : u, r > this.#n.getChildIndex(i) && --r, this.#t.setChildIndex(o, r), this.#n.setChildIndex(i, r), this.#E();
469
488
  }
470
- return e[":id_tag"] = h.fore.name.slice(0, -7), this.scrItr.recodeDesign(e), h.lay(e);
489
+ return e[":id_tag"] = n.fore.name.slice(0, -7), this.scrItr.recodeDesign(e), n.lay(e);
471
490
  }
472
491
  #E() {
473
492
  this.#S = this.#I();
474
493
  }
475
494
  #D(e) {
476
- return this.#F(e, (m) => {
477
- let h = this.#x[this.#Z({ layer: m })];
495
+ return this.#F(e, (t) => {
496
+ let n = this.#x[this.#Z({ layer: t })];
478
497
  if (e.page === "both") {
479
- h.fore.clearLay(e), h.back.clearLay(e);
498
+ n.fore.clearLay(e), n.back.clearLay(e);
480
499
  return;
481
500
  }
482
- h.getPage(e).clearLay(e);
501
+ n.getPage(e).clearLay(e);
483
502
  }), !1;
484
503
  }
485
504
  static #O = "\nprecision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform sampler2D rule;\nuniform float vague;\nuniform float tick;\n\nuniform vec4 inputPixel;\nuniform highp vec4 outputFrame;\nvec2 getUV(vec2 coord) {\n return coord * inputPixel.xy / outputFrame.zw;\n}\n\nvoid main() {\n vec4 fg = texture2D(uSampler, vTextureCoord);\n vec4 ru = texture2D(rule, getUV(vTextureCoord));\n\n float v = ru.r - tick;\n gl_FragColor = abs(v) < vague\n ? vec4(fg.rgb, 1) *fg.a *(0.5 +v /vague *0.5)\n : 0.0 <= v ? fg : vec4(0);\n}";
486
- #k = RenderTexture.create({
487
- width: CmnLib.stageW,
488
- height: CmnLib.stageH
505
+ #k = l.create({
506
+ width: o.stageW,
507
+ height: o.stageH
489
508
  });
490
- #A = new Sprite(this.#k);
491
- #j = RenderTexture.create({
492
- width: CmnLib.stageW,
493
- height: CmnLib.stageH
509
+ #A = new p(this.#k);
510
+ #j = l.create({
511
+ width: o.stageW,
512
+ height: o.stageH
494
513
  });
495
- #M = new Sprite(this.#j);
514
+ #M = new p(this.#j);
496
515
  #N(e) {
497
- let { layer: m } = e, h = /* @__PURE__ */ new Set(), _ = this.#P(m).map((e) => (h.add(e), this.#x[e].fore)), v = () => {
516
+ let { layer: t } = e, n = /* @__PURE__ */ new Set(), i = this.#P(t).map((e) => (n.add(e), this.#x[e].fore)), a = () => {
498
517
  [this.#t, this.#n] = [this.#n, this.#t];
499
518
  let e = [];
500
- for (let [m, g] of Object.entries(this.#x)) {
501
- if (h.has(m)) {
502
- g.transPage(e);
519
+ for (let [t, r] of Object.entries(this.#x)) {
520
+ if (n.has(t)) {
521
+ r.transPage(e);
503
522
  continue;
504
523
  }
505
- let { fore: { ctn: _ }, back: { ctn: v } } = g, y = this.#t.getChildIndex(v);
506
- this.#t.removeChild(v), this.#n.removeChild(_), this.#t.addChildAt(_, y), this.#n.addChildAt(v, y);
524
+ let { fore: { ctn: i }, back: { ctn: a } } = r, o = this.#t.getChildIndex(a);
525
+ this.#t.removeChild(a), this.#n.removeChild(i), this.#t.addChildAt(i, o), this.#n.addChildAt(a, o);
507
526
  }
508
527
  Promise.allSettled(e).then(() => {
509
- this.#t.visible = !0, this.#n.visible = !1, this.#A.visible = !1, this.#M.visible = !1, Reading.notifyEndProc(TW_NM_TRANS);
528
+ this.#t.visible = !0, this.#n.visible = !1, this.#A.visible = !1, this.#M.visible = !1, S.notifyEndProc(b);
510
529
  });
511
530
  };
512
- if (this.#M.filters = [], this.#M.alpha = 1, argChk_Num(e, "time", 0) === 0 || this.#f.isSkipping) return v(), !1;
513
- let y = [], b = this.#S.map((e) => {
514
- let { fore: m, back: g } = this.#x[e], _ = h.has(e) ? g : m;
515
- return _.ctn.visible && y.push(_.ctn), _;
516
- }), { ticker: S, renderer: w } = this.appPixi;
517
- w.render(this.#n, { renderTexture: this.#k });
518
- let T = () => {
519
- for (let e of y) w.render(e, {
531
+ if (this.#M.filters = [], this.#M.alpha = 1, r(e, "time", 0) === 0 || this.#f.isSkipping) return a(), !1;
532
+ let o = [], s = this.#S.map((e) => {
533
+ let { fore: t, back: r } = this.#x[e], i = n.has(e) ? r : t;
534
+ return i.ctn.visible && o.push(i.ctn), i;
535
+ }), { ticker: l, renderer: d } = this.appPixi;
536
+ d.render(this.#n, { renderTexture: this.#k });
537
+ let f = () => {
538
+ for (let e of o) d.render(e, {
520
539
  renderTexture: this.#k,
521
540
  clear: !1
522
541
  });
523
542
  };
524
- if (!b.some((e) => e.containMovement)) {
525
- let e = T;
526
- T = () => {
527
- T = () => {}, e();
543
+ if (!s.some((e) => e.containMovement)) {
544
+ let e = f;
545
+ f = () => {
546
+ f = () => {}, e();
528
547
  };
529
548
  }
530
- let E = () => w.render(this.#t, { renderTexture: this.#j });
531
- E();
532
- let D = () => {
533
- this.#t.visible = !0, E(), this.#t.visible = !1;
549
+ let p = () => d.render(this.#t, { renderTexture: this.#j });
550
+ p();
551
+ let m = () => {
552
+ this.#t.visible = !0, p(), this.#t.visible = !1;
534
553
  };
535
- if (!_.some((e) => e.containMovement)) {
536
- let e = D;
537
- D = () => {
538
- D = () => {}, e();
554
+ if (!i.some((e) => e.containMovement)) {
555
+ let e = m;
556
+ m = () => {
557
+ m = () => {}, e();
539
558
  };
540
559
  }
541
- let O = () => {
542
- T(), this.#A.visible = !0, D(), this.#M.visible = !0;
543
- }, { glsl: A, rule: j } = e, M = () => {
544
- S.remove(O), v();
560
+ let h = () => {
561
+ f(), this.#A.visible = !0, m(), this.#M.visible = !0;
562
+ }, { glsl: _, rule: v } = e, y = () => {
563
+ l.remove(h), a();
545
564
  };
546
- if (!A && !j) return CmnTween.tween(TW_NM_TRANS, e, this.#M, { alpha: 0 }, () => {}, M, () => {}), S.add(O), !1;
547
- let F = {
548
- rule: Texture.EMPTY,
549
- vague: argChk_Num(e, "vague", .04),
565
+ if (!_ && !v) return x.tween(b, e, this.#M, { alpha: 0 }, () => {}, y, () => {}), l.add(h), !1;
566
+ let w = {
567
+ rule: u.EMPTY,
568
+ vague: r(e, "vague", .04),
550
569
  tick: 0
551
570
  };
552
- this.#M.filters = [new Filter(void 0, A ?? x.#O, F)];
553
- let I = CmnTween.tween(TW_NM_TRANS, e, F, { tick: 1 }, () => {}, M, () => {}, !j);
554
- return j ? new SpritesMng(j, void 0, (e) => {
555
- F.rule = e.texture, e.destroy(), S.add(O), I.start();
571
+ this.#M.filters = [new g(void 0, _ ?? c.#O, w)];
572
+ let T = x.tween(b, e, w, { tick: 1 }, () => {}, y, () => {}, !v);
573
+ return v ? new C(v, void 0, (e) => {
574
+ w.rule = e.texture, e.destroy(), l.add(h), T.start();
556
575
  }, (e) => {
557
576
  e && this.main.resume();
558
- }).ret : (S.add(O), !1);
577
+ }).ret : (l.add(h), !1);
559
578
  }
560
579
  #P(e = "") {
561
580
  return e ? e.split(",") : this.#S;
562
581
  }
563
- #F(e, m) {
564
- let h = this.#P(e.layer);
565
- for (let e of h) {
566
- let h = this.#x[e];
567
- if (!h) throw `存在しないlayer【${e}】です`;
568
- m(e, h);
582
+ #F(e, t) {
583
+ let n = this.#P(e.layer);
584
+ for (let e of n) {
585
+ let n = this.#x[e];
586
+ if (!n) throw `存在しないlayer【${e}】です`;
587
+ t(e, n);
569
588
  }
570
- return h;
589
+ return n;
571
590
  }
572
591
  #I(e = "") {
573
- return this.#P(e).sort((e, m) => {
574
- let h = this.#t.getChildIndex(this.#x[e].fore.ctn), g = this.#t.getChildIndex(this.#x[m].fore.ctn);
575
- return h < g ? -1 : h > g ? 1 : 0;
592
+ return this.#P(e).sort((e, t) => {
593
+ let n = this.#t.getChildIndex(this.#x[e].fore.ctn), r = this.#t.getChildIndex(this.#x[t].fore.ctn);
594
+ return n < r ? -1 : +(n > r);
576
595
  });
577
596
  }
578
597
  setAllStyle2TxtLay(e) {
579
- for (let m of this.#S) {
580
- let h = this.#x[m].fore;
581
- h instanceof TxtLayer && h.lay({ style: e });
598
+ for (let t of this.#S) {
599
+ let n = this.#x[t].fore;
600
+ n instanceof E && n.lay({ style: e });
582
601
  }
583
602
  }
584
603
  #L(e) {
585
- if (argChk_Num(e, "time", NaN) === 0) return !1;
586
- let h = this.#P(e.layer).map((e) => this.#x[e].fore.ctn), { renderer: _, ticker: v } = this.appPixi;
587
- this.#j.resize(CmnLib.stageW, CmnLib.stageH);
588
- let b = () => {
604
+ if (r(e, "time", NaN) === 0) return !1;
605
+ let n = this.#P(e.layer).map((e) => this.#x[e].fore.ctn), { renderer: i, ticker: a } = this.appPixi;
606
+ this.#j.resize(o.stageW, o.stageH);
607
+ let s = () => {
589
608
  this.#t.visible = !0;
590
- for (let e of h) _.render(e, {
609
+ for (let e of n) i.render(e, {
591
610
  renderTexture: this.#j,
592
611
  clear: !1
593
612
  });
594
613
  this.#t.visible = !1;
595
614
  };
596
615
  this.#M.visible = !0, this.#M.alpha = 1;
597
- let x = uint(argChk_Num(e, "hmax", 10)), S = uint(argChk_Num(e, "vmax", 10)), C = x === 0 ? () => {} : () => {
598
- this.#M.x = Math.round(Math.random() * x * 2) - x;
599
- }, w = S === 0 ? () => {} : () => {
600
- this.#M.y = Math.round(Math.random() * S * 2) - S;
616
+ let c = t(r(e, "hmax", 10)), l = t(r(e, "vmax", 10)), u = c === 0 ? () => {} : () => {
617
+ this.#M.x = Math.round(Math.random() * c * 2) - c;
618
+ }, d = l === 0 ? () => {} : () => {
619
+ this.#M.y = Math.round(Math.random() * l * 2) - l;
601
620
  };
602
- return this.#M.filters = [], CmnTween.tween(TW_NM_TRANS, e, this.#M, {
621
+ return this.#M.filters = [], x.tween(b, e, this.#M, {
603
622
  x: 0,
604
623
  y: 0
605
624
  }, () => {
606
- C(), w();
625
+ u(), d();
607
626
  }, () => {
608
- v.remove(b), this.#t.visible = !0, this.#M.visible = !1, this.#M.x = 0, this.#M.y = 0, Reading.notifyEndProc(TW_NM_TRANS);
609
- }, () => {}), v.add(b), !1;
627
+ a.remove(s), this.#t.visible = !0, this.#M.visible = !1, this.#M.x = 0, this.#M.y = 0, S.notifyEndProc(b);
628
+ }, () => {}), a.add(s), !1;
610
629
  }
611
630
  #R(e) {
612
- let { layer: m, render: h, name: g } = e;
613
- if (!m) throw "layerは必須です";
614
- let _ = this.#x[this.#Z(e)], y = _.fore, b = () => {};
615
- h && (this.#f.isSkipping ? y.renderStart(!0) : (y.renderStart(!1), b = () => y.renderEnd()));
616
- let x = CmnTween.cnvTweenArg(e, y), S = argChk_Boolean(e, "arrive", !1), C = argChk_Boolean(e, "backlay", !1), w = _.back.ctn;
617
- return CmnTween.tween(g ?? m, e, y, CmnTween.cnvTweenArg(e, y), () => {}, b, () => {
618
- if (S && Object.assign(y, x), C) for (let e of CmnTween.aLayerPrpNm) w[e] = y[e];
619
- }), "filter" in e && (y.ctn.filters = [Layer.bldFilters(e)], y.aFltHArg = [e]), !1;
631
+ let { layer: t, render: n, name: r } = e;
632
+ if (!t) throw "layerは必須です";
633
+ let i = this.#x[this.#Z(e)], o = i.fore, s = () => {};
634
+ n && (this.#f.isSkipping ? o.renderStart(!0) : (o.renderStart(!1), s = () => o.renderEnd()));
635
+ let c = x.cnvTweenArg(e, o), l = a(e, "arrive", !1), u = a(e, "backlay", !1), d = i.back.ctn;
636
+ return x.tween(r ?? t, e, o, x.cnvTweenArg(e, o), () => {}, s, () => {
637
+ if (l && Object.assign(o, c), u) for (let e of x.aLayerPrpNm) d[e] = o[e];
638
+ }), "filter" in e && (o.ctn.filters = [y.bldFilters(e)], o.aFltHArg = [e]), !1;
620
639
  }
621
640
  #z(e) {
622
- return this.#F(e, (m) => {
623
- let h = this.#x[this.#Z({ layer: m })];
641
+ return this.#F(e, (t) => {
642
+ let n = this.#x[this.#Z({ layer: t })];
624
643
  if (e.page === "both") {
625
- this.#B(h.fore, e), this.#B(h.back, e);
644
+ this.#B(n.fore, e), this.#B(n.back, e);
626
645
  return;
627
646
  }
628
- let g = h.getPage(e);
629
- this.#B(g, e);
647
+ let r = n.getPage(e);
648
+ this.#B(r, e);
630
649
  }), !1;
631
650
  }
632
- #B(e, m) {
633
- let h = e.ctn;
634
- h.filters ??= [], h.filters = [...h.filters, Layer.bldFilters(m)], e.aFltHArg.push(m);
651
+ #B(e, t) {
652
+ let n = e.ctn;
653
+ n.filters ??= [], n.filters = [...n.filters, y.bldFilters(t)], e.aFltHArg.push(t);
635
654
  }
636
655
  #V(e) {
637
- return this.#F(e, (m) => {
638
- let h = this.#x[this.#Z({ layer: m })];
656
+ return this.#F(e, (t) => {
657
+ let n = this.#x[this.#Z({ layer: t })];
639
658
  if (e.page === "both") {
640
- let e = h.fore, m = h.back;
641
- e.ctn.filters = null, m.ctn.filters = null, e.aFltHArg = [], m.aFltHArg = [];
659
+ let e = n.fore, t = n.back;
660
+ e.ctn.filters = null, t.ctn.filters = null, e.aFltHArg = [], t.aFltHArg = [];
642
661
  return;
643
662
  }
644
- let g = h.getPage(e);
645
- g.ctn.filters = null, g.aFltHArg = [];
663
+ let r = n.getPage(e);
664
+ r.ctn.filters = null, r.aFltHArg = [];
646
665
  }), !1;
647
666
  }
648
667
  #H(e) {
649
- return this.#F(e, (m) => {
650
- let h = this.#x[this.#Z({ layer: m })];
668
+ return this.#F(e, (t) => {
669
+ let n = this.#x[this.#Z({ layer: t })];
651
670
  if (e.page === "both") {
652
- this.#U(h.fore, e), this.#U(h.back, e);
671
+ this.#U(n.fore, e), this.#U(n.back, e);
653
672
  return;
654
673
  }
655
- let g = h.getPage(e);
656
- this.#U(g, e);
674
+ let r = n.getPage(e);
675
+ this.#U(r, e);
657
676
  }), !1;
658
677
  }
659
- #U(e, h) {
660
- let _ = e.ctn;
661
- if (!_.filters) throw "フィルターがありません";
662
- let y = uint(argChk_Num(h, "index", 0)), b = _.filters.length;
663
- if (b <= y) throw `フィルターの個数(${String(b)})を越えています`;
664
- e.aFltHArg[y].enabled = _.filters[y].enabled = argChk_Boolean(h, "enabled", !0);
678
+ #U(e, n) {
679
+ let i = e.ctn;
680
+ if (!i.filters) throw "フィルターがありません";
681
+ let o = t(r(n, "index", 0)), s = i.filters.length;
682
+ if (s <= o) throw `フィルターの個数(${String(s)})を越えています`;
683
+ e.aFltHArg[o].enabled = i.filters[o].enabled = a(n, "enabled", !0);
665
684
  }
666
685
  #W(e) {
667
- let { text: m } = e;
668
- if (!m) throw "textは必須です";
669
- let h = this.#G(e);
670
- delete e.text, this.setNormalChWait(), this.#f.isSkipping ? e.wait = 0 : "wait" in e && argChk_Num(e, "wait", NaN), this.#m("add|" + cnvSArg(e), h);
671
- let _ = argChk_Boolean(e, "record", !0), y = this.val.doRecLog();
672
- return _ || this.val.setVal_Nochk("save", "sn.doRecLog", _), h.tagCh(m.replaceAll("[r]", "\n")), this.val.setVal_Nochk("save", "sn.doRecLog", y), this.#m("add_close|", h), !1;
686
+ let { text: t } = e;
687
+ if (!t) throw "textは必須です";
688
+ let n = this.#G(e);
689
+ delete e.text, this.setNormalChWait(), this.#f.isSkipping ? e.wait = 0 : "wait" in e && r(e, "wait", NaN), this.#m("add|" + P(e), n);
690
+ let i = a(e, "record", !0), o = this.val.doRecLog();
691
+ return i || this.val.setVal_Nochk("save", "sn.doRecLog", i), n.tagCh(t.replaceAll("[r]", "\n")), this.val.setVal_Nochk("save", "sn.doRecLog", o), this.#m("add_close|", n), !1;
673
692
  }
674
693
  #G = (e) => {
675
694
  throw this.#X(), 0;
676
695
  };
677
696
  #K(e) {
678
- let m = this.#Z(e, this.#C), h = this.#x[m].getPage(e);
679
- if (!(h instanceof TxtLayer)) throw m + "はTxtLayerではありません";
680
- return h;
697
+ let t = this.#Z(e, this.#C), n = this.#x[t].getPage(e);
698
+ if (!(n instanceof E)) throw t + "はTxtLayerではありません";
699
+ return n;
681
700
  }
682
701
  setNormalChWait() {
683
- TxtLayer.msecChWait = this.scrItr.normalWait;
702
+ E.msecChWait = this.scrItr.normalWait;
684
703
  }
685
704
  #q = (e) => {
686
705
  throw this.#X(), 0;
687
706
  };
688
707
  #J(e) {
689
- let { layer: m } = e;
690
- if (!m) throw "[current] layerは必須です";
691
- let h = this.#x[m];
692
- if (!h || !(h.getPage(e) instanceof TxtLayer)) throw `${m}はTxtLayerではありません`;
693
- this.#Y = h, this.#a.pagebreak(), this.#C = m, this.val.setVal_Nochk("save", "const.sn.mesLayer", m);
708
+ let { layer: t } = e;
709
+ if (!t) throw "[current] layerは必須です";
710
+ let n = this.#x[t];
711
+ if (!n || !(n.getPage(e) instanceof E)) throw `${t}はTxtLayerではありません`;
712
+ this.#Y = n, this.#a.pagebreak(), this.#C = t, this.val.setVal_Nochk("save", "const.sn.mesLayer", t);
694
713
  for (let e of this.#S) {
695
- let { fore: h, back: g } = this.#x[e];
696
- h instanceof TxtLayer && (h.isCur = g.isCur = e === m);
714
+ let { fore: n, back: r } = this.#x[e];
715
+ n instanceof E && (n.isCur = r.isCur = e === t);
697
716
  }
698
717
  return !1;
699
718
  }
@@ -707,32 +726,32 @@ var LayerMng = class x {
707
726
  #X = () => {
708
727
  throw "文字レイヤーがありません。文字表示や操作する前に、[add_lay layer=(レイヤ名) class=txt]で文字レイヤを追加して下さい";
709
728
  };
710
- #Z(e, m = "") {
711
- let h = e.layer ?? m;
712
- if (h.includes(",")) throw "layer名に「,」は使えません";
713
- if (!(h in this.#x)) throw "属性 layer【" + h + "】が不正です。レイヤーがありません";
714
- return e.layer = h, h;
729
+ #Z(e, t = "") {
730
+ let n = e.layer ?? t;
731
+ if (n.includes(",")) throw "layer名に「,」は使えません";
732
+ if (!(n in this.#x)) throw "属性 layer【" + n + "】が不正です。レイヤーがありません";
733
+ return e.layer = n, n;
715
734
  }
716
735
  recPagebreak() {
717
736
  this.#a.pagebreak();
718
737
  }
719
738
  #Q(e) {
720
- let m = this.#G(e);
721
- return e.layer === this.#C && e.page === "fore" && this.#a.pagebreak(), m.clearText(), !1;
739
+ let t = this.#G(e);
740
+ return e.layer === this.#C && e.page === "fore" && this.#a.pagebreak(), t.clearText(), !1;
722
741
  }
723
742
  #$(e) {
724
743
  return this.#m("endlink|", this.#G(e)), !1;
725
744
  }
726
745
  #ee(e) {
727
- return argChk_Boolean(e, "rec_page_break", !0) && this.#a.pagebreak(), this.#Y && (this.#Y.fore.clearLay(e), this.#Y.back.clearLay(e)), !1;
746
+ return a(e, "rec_page_break", !0) && this.#a.pagebreak(), this.#Y && (this.#Y.fore.clearLay(e), this.#Y.back.clearLay(e)), !1;
728
747
  }
729
748
  #te(e) {
730
749
  if (!e.pic) throw "[graph] picは必須です";
731
- return this.#m("grp|" + cnvSArg(e), this.#G(e)), !1;
750
+ return this.#m("grp|" + P(e), this.#G(e)), !1;
732
751
  }
733
752
  #ne(e) {
734
753
  if (!e.fn && !e.label && !e.url) throw "fn,label,url いずれかは必須です";
735
- return e.fn ??= this.scrItr.scriptFn, e.style ??= "background-color: rgba(255,0,0,0.5);", e.style_hover ??= "background-color: rgba(255,0,0,0.9);", e.style_clicked ??= e.style, this.#m("link|" + cnvSArg(e), this.#G(e)), !1;
754
+ return e.fn ??= this.scrItr.scriptFn, e.style ??= "background-color: rgba(255,0,0,0.5);", e.style_hover ??= "background-color: rgba(255,0,0,0.9);", e.style_clicked ??= e.style, this.#m("link|" + P(e), this.#G(e)), !1;
736
755
  }
737
756
  #re(e) {
738
757
  return this.#W({
@@ -741,72 +760,73 @@ var LayerMng = class x {
741
760
  });
742
761
  }
743
762
  #ie(e) {
744
- let { t: m, r: h } = e;
745
- if (!m) throw "[ruby2] tは必須です";
746
- if (!h) throw "[ruby2] rは必須です";
747
- return e.text = "|" + encodeURIComponent(m) + "《" + encodeURIComponent(h) + "》", delete e.t, delete e.r, this.#W(e);
763
+ let { t, r: n } = e;
764
+ if (!t) throw "[ruby2] tは必須です";
765
+ if (!n) throw "[ruby2] rは必須です";
766
+ return e.text = "|" + encodeURIComponent(t) + "《" + encodeURIComponent(n) + "》", delete e.t, delete e.r, this.#W(e);
748
767
  }
749
768
  #ae(e) {
750
- return this.#m("span|" + cnvSArg(e), this.#G(e)), !1;
769
+ return this.#m("span|" + P(e), this.#G(e)), !1;
751
770
  }
752
771
  #oe(e) {
753
772
  if (!e.t) throw "[tcy] tは必須です";
754
- return this.#m("tcy|" + cnvSArg(e), this.#G(e)), !1;
773
+ return this.#m("tcy|" + P(e), this.#G(e)), !1;
755
774
  }
756
775
  #se({ layer: e }) {
757
776
  console.group("🥟 [dump_lay]");
758
- for (let m of this.#P(e)) {
759
- let { fore: e, back: h } = this.#x[m];
777
+ for (let t of this.#P(e)) {
778
+ let { fore: e, back: n } = this.#x[t];
760
779
  try {
761
- console.info(`%c${e.name.slice(0, -7)} %o`, `color:#${CmnLib.isDarkMode ? "49F" : "05A"};`, JSON.parse(`{"back":{${h.dump()}}, "fore":{${e.dump()}}}`));
762
- } catch (m) {
763
- console.error("dump_lay err:%o", m), console.error(` back:${h.dump()}`), console.error(` fore:${e.dump()}`);
780
+ console.info(`%c${e.name.slice(0, -7)} %o`, `color:#${o.isDarkMode ? "49F" : "05A"};`, JSON.parse(`{"back":{${n.dump()}}, "fore":{${e.dump()}}}`));
781
+ } catch (t) {
782
+ console.error("dump_lay err:%o", t), console.error(` back:${n.dump()}`), console.error(` fore:${e.dump()}`);
764
783
  }
765
784
  }
766
785
  return console.groupEnd(), !1;
767
786
  }
768
787
  #ce(e) {
769
- let m = this.#Z(e, this.#C), h = argChk_Boolean(e, "enabled", !0);
770
- return this.#G(e).enabled = h, this.val.setVal_Nochk("save", "const.sn.layer." + m + ".enabled", h), !1;
788
+ let t = this.#Z(e, this.#C), n = a(e, "enabled", !0);
789
+ return this.#G(e).enabled = n, this.val.setVal_Nochk("save", "const.sn.layer." + t + ".enabled", n), !1;
771
790
  }
772
791
  #le(e) {
773
- return Pages.argChk_page(e, "back"), e.fn ??= this.scrItr.scriptFn, this.#G(e).addButton(e), this.scrItr.recodeDesign(e), !1;
792
+ return j.argChk_page(e, "back"), e.fn ??= this.scrItr.scriptFn, this.#G(e).addButton(e), this.scrItr.recodeDesign(e), !1;
774
793
  }
775
794
  record() {
776
795
  let e = {};
777
- for (let m of this.#S) {
778
- let h = this.#x[m];
779
- e[m] = {
780
- cls: h.cls,
781
- fore: h.fore.record(),
782
- back: h.back.record()
796
+ for (let t of this.#S) {
797
+ let n = this.#x[t];
798
+ e[t] = {
799
+ cls: n.cls,
800
+ fore: n.fore.record(),
801
+ back: n.back.record()
783
802
  };
784
803
  }
785
804
  return e;
786
805
  }
787
806
  playback(e) {
788
807
  this.#a.playback();
789
- let m = [], h = [];
790
- for (let [g, { fore: _, fore: { idx: v }, back: y, cls: b }] of Object.entries(e)) {
791
- h.push({
792
- ln: g,
793
- idx: v
808
+ let t = [], n = [];
809
+ for (let [r, { fore: i, fore: { idx: a }, back: o, cls: s }] of Object.entries(e)) {
810
+ n.push({
811
+ ln: r,
812
+ idx: a
794
813
  });
795
- let e = this.#x[g] ??= new Pages(g, b, this.#t, this.#n, {}, this.sys, this.val, { isWait: !1 });
796
- e.fore.playback(_, m), e.back.playback(y, m);
814
+ let e = this.#x[r] ??= new j(r, s, this.#t, this.#n, {}, this.sys, this.val, { isWait: !1 });
815
+ e.fore.playback(i, t), e.back.playback(o, t);
797
816
  }
798
- let g = this.#t.children.length;
799
- return m.push(new Promise((e) => {
800
- for (let { ln: e, idx: m } of h.sort(({ idx: e }, { idx: m }) => e === m ? 0 : e < m ? -1 : 1)) {
801
- let h = this.#x[e];
802
- if (!h) continue;
803
- let _ = g > m ? m : g - 1, { fore: v, back: y } = h;
804
- this.#t.setChildIndex(v.ctn, _), this.#n.setChildIndex(y.ctn, _);
817
+ let r = this.#t.children.length;
818
+ return t.push(new Promise((e) => {
819
+ for (let { ln: e, idx: t } of n.sort(({ idx: e }, { idx: t }) => e === t ? 0 : e < t ? -1 : 1)) {
820
+ let n = this.#x[e];
821
+ if (!n) continue;
822
+ let i = r > t ? t : r - 1, { fore: a, back: o } = n;
823
+ this.#t.setChildIndex(a.ctn, i), this.#n.setChildIndex(o.ctn, i);
805
824
  }
806
825
  e();
807
- })), m;
826
+ })), t;
808
827
  }
809
828
  };
810
- export { LayerMng };
829
+ //#endregion
830
+ export { F as LayerMng };
811
831
 
812
832
  //# sourceMappingURL=LayerMng.js.map