@famibee/skynovel 1.48.13 → 1.63.11

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 (289) hide show
  1. package/README.md +2 -1
  2. package/dist/CallStack.js +25 -0
  3. package/dist/CallStack.js.map +1 -0
  4. package/dist/EventMng.js +1588 -0
  5. package/dist/EventMng.js.map +1 -0
  6. package/dist/LayerMng.js +2924 -0
  7. package/dist/LayerMng.js.map +1 -0
  8. package/dist/PropParser.js +833 -0
  9. package/dist/PropParser.js.map +1 -0
  10. package/dist/Reading.js +784 -0
  11. package/dist/Reading.js.map +1 -0
  12. package/dist/ScriptIterator.js +1125 -0
  13. package/dist/ScriptIterator.js.map +1 -0
  14. package/dist/SndBuf.js +1519 -0
  15. package/dist/SndBuf.js.map +1 -0
  16. package/dist/SoundMng.js +136 -0
  17. package/dist/SoundMng.js.map +1 -0
  18. package/dist/Variable.js +479 -0
  19. package/dist/Variable.js.map +1 -0
  20. package/dist/app.d.ts +5 -1
  21. package/dist/app.d.ts.map +1 -1
  22. package/dist/appMain.d.ts +6 -6
  23. package/dist/appMain.d.ts.map +1 -1
  24. package/dist/appMain_cmn.d.ts +30 -0
  25. package/dist/appMain_cmn.d.ts.map +1 -0
  26. package/dist/build.d.ts +2 -0
  27. package/dist/build.d.ts.map +1 -0
  28. package/dist/gamepad.js +511 -0
  29. package/dist/gamepad.js.map +1 -0
  30. package/dist/index.d.ts +32 -38
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/preload.d.ts +34 -31
  33. package/dist/preload.d.ts.map +1 -1
  34. package/dist/sn/AnalyzeTagArg.d.ts +10 -6
  35. package/dist/sn/AnalyzeTagArg.d.ts.map +1 -1
  36. package/dist/sn/Areas.d.ts +7 -5
  37. package/dist/sn/Areas.d.ts.map +1 -1
  38. package/dist/sn/Button.d.ts +2 -2
  39. package/dist/sn/Button.d.ts.map +1 -1
  40. package/dist/sn/CallStack.d.ts +12 -5
  41. package/dist/sn/CallStack.d.ts.map +1 -1
  42. package/dist/sn/CmnInterface.d.ts +178 -117
  43. package/dist/sn/CmnInterface.d.ts.map +1 -1
  44. package/dist/sn/CmnLib.d.ts +20 -19
  45. package/dist/sn/CmnLib.d.ts.map +1 -1
  46. package/dist/sn/CmnTween.d.ts +6 -8
  47. package/dist/sn/CmnTween.d.ts.map +1 -1
  48. package/dist/sn/Config.d.ts +6 -4
  49. package/dist/sn/Config.d.ts.map +1 -1
  50. package/dist/sn/ConfigBase.d.ts +39 -24
  51. package/dist/sn/ConfigBase.d.ts.map +1 -1
  52. package/dist/sn/DebugMng.d.ts +3 -2
  53. package/dist/sn/DebugMng.d.ts.map +1 -1
  54. package/dist/sn/DesignCast.d.ts +5 -6
  55. package/dist/sn/DesignCast.d.ts.map +1 -1
  56. package/dist/sn/EventListenerCtn.d.ts +3 -3
  57. package/dist/sn/EventListenerCtn.d.ts.map +1 -1
  58. package/dist/sn/EventMng.d.ts +5 -11
  59. package/dist/sn/EventMng.d.ts.map +1 -1
  60. package/dist/sn/FocusMng.d.ts.map +1 -1
  61. package/dist/sn/FrameMng.d.ts +3 -4
  62. package/dist/sn/FrameMng.d.ts.map +1 -1
  63. package/dist/sn/Grammar.d.ts +133 -16
  64. package/dist/sn/Grammar.d.ts.map +1 -1
  65. package/dist/sn/GrpLayer.d.ts +8 -4
  66. package/dist/sn/GrpLayer.d.ts.map +1 -1
  67. package/dist/sn/Hyphenation.d.ts +42 -0
  68. package/dist/sn/Hyphenation.d.ts.map +1 -0
  69. package/dist/sn/Layer.d.ts +24 -4
  70. package/dist/sn/Layer.d.ts.map +1 -1
  71. package/dist/sn/LayerMng.d.ts +17 -24
  72. package/dist/sn/LayerMng.d.ts.map +1 -1
  73. package/dist/sn/Log.d.ts +18 -0
  74. package/dist/sn/Log.d.ts.map +1 -0
  75. package/dist/sn/Main.d.ts +4 -6
  76. package/dist/sn/Main.d.ts.map +1 -1
  77. package/dist/sn/Pages.d.ts +1 -1
  78. package/dist/sn/Pages.d.ts.map +1 -1
  79. package/dist/sn/PropParser.d.ts +2 -2
  80. package/dist/sn/PropParser.d.ts.map +1 -1
  81. package/dist/sn/Reading.d.ts +86 -0
  82. package/dist/sn/Reading.d.ts.map +1 -0
  83. package/dist/sn/RubySpliter.d.ts +1 -3
  84. package/dist/sn/RubySpliter.d.ts.map +1 -1
  85. package/dist/sn/ScriptIterator.d.ts +20 -10
  86. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  87. package/dist/sn/SndBuf.d.ts +15 -5
  88. package/dist/sn/SndBuf.d.ts.map +1 -1
  89. package/dist/sn/SoundMng.d.ts +3 -2
  90. package/dist/sn/SoundMng.d.ts.map +1 -1
  91. package/dist/sn/SpritesMng.d.ts +4 -4
  92. package/dist/sn/SpritesMng.d.ts.map +1 -1
  93. package/dist/sn/SysApp.d.ts +12 -16
  94. package/dist/sn/SysApp.d.ts.map +1 -1
  95. package/dist/sn/SysBase.d.ts +24 -27
  96. package/dist/sn/SysBase.d.ts.map +1 -1
  97. package/dist/sn/SysNode.d.ts +9 -9
  98. package/dist/sn/SysNode.d.ts.map +1 -1
  99. package/dist/sn/SysWeb.d.ts +10 -14
  100. package/dist/sn/SysWeb.d.ts.map +1 -1
  101. package/dist/sn/TxtLayer.d.ts +79 -7
  102. package/dist/sn/TxtLayer.d.ts.map +1 -1
  103. package/dist/sn/TxtStage.d.ts +45 -30
  104. package/dist/sn/TxtStage.d.ts.map +1 -1
  105. package/dist/sn/Variable.d.ts +33 -13
  106. package/dist/sn/Variable.d.ts.map +1 -1
  107. package/dist/sn/htm2tx.d.ts +3 -0
  108. package/dist/sn/htm2tx.d.ts.map +1 -0
  109. package/dist/test/AnalyzeTagArg.test.d.ts +2 -0
  110. package/dist/test/AnalyzeTagArg.test.d.ts.map +1 -0
  111. package/dist/test/AreasTest.test.d.ts +2 -0
  112. package/dist/test/AreasTest.test.d.ts.map +1 -0
  113. package/dist/test/CmnLib.test.d.ts +2 -0
  114. package/dist/test/CmnLib.test.d.ts.map +1 -0
  115. package/dist/test/Config.test.d.ts +2 -0
  116. package/dist/test/Config.test.d.ts.map +1 -0
  117. package/dist/test/Grammar.test.d.ts +2 -0
  118. package/dist/test/Grammar.test.d.ts.map +1 -0
  119. package/dist/test/HyphTest.test.d.ts +2 -0
  120. package/dist/test/HyphTest.test.d.ts.map +1 -0
  121. package/dist/test/Log.test.d.ts +2 -0
  122. package/dist/test/Log.test.d.ts.map +1 -0
  123. package/dist/test/PropParser.test.d.ts +2 -0
  124. package/dist/test/PropParser.test.d.ts.map +1 -0
  125. package/dist/test/RubySpliter.test.d.ts +2 -0
  126. package/dist/test/RubySpliter.test.d.ts.map +1 -0
  127. package/dist/test/SysTest.d.ts +5 -0
  128. package/dist/test/SysTest.d.ts.map +1 -0
  129. package/dist/test/ValTest.d.ts +31 -0
  130. package/dist/test/ValTest.d.ts.map +1 -0
  131. package/dist/test/Variable.test.d.ts +2 -0
  132. package/dist/test/Variable.test.d.ts.map +1 -0
  133. package/dist/web.d.ts +5 -1
  134. package/dist/web.d.ts.map +1 -1
  135. package/dist/web.js +6 -30102
  136. package/dist/web.js.map +1 -1
  137. package/dist/web2.js +23020 -0
  138. package/dist/web2.js.map +1 -0
  139. package/dist_app/CallStack.js +25 -0
  140. package/dist_app/CallStack.js.map +1 -0
  141. package/dist_app/EventMng.js +1588 -0
  142. package/dist_app/EventMng.js.map +1 -0
  143. package/dist_app/LayerMng.js +2924 -0
  144. package/dist_app/LayerMng.js.map +1 -0
  145. package/dist_app/PropParser.js +833 -0
  146. package/dist_app/PropParser.js.map +1 -0
  147. package/dist_app/Reading.js +784 -0
  148. package/dist_app/Reading.js.map +1 -0
  149. package/dist_app/ScriptIterator.js +1125 -0
  150. package/dist_app/ScriptIterator.js.map +1 -0
  151. package/dist_app/SndBuf.js +1519 -0
  152. package/dist_app/SndBuf.js.map +1 -0
  153. package/dist_app/SoundMng.js +136 -0
  154. package/dist_app/SoundMng.js.map +1 -0
  155. package/dist_app/Variable.js +479 -0
  156. package/dist_app/Variable.js.map +1 -0
  157. package/dist_app/app.d.ts +9 -0
  158. package/dist_app/app.d.ts.map +1 -0
  159. package/dist_app/app.js +9 -0
  160. package/dist_app/app.js.map +1 -0
  161. package/dist_app/app2.js +19819 -0
  162. package/dist_app/app2.js.map +1 -0
  163. package/dist_app/appMain.d.ts +9 -0
  164. package/dist_app/appMain.d.ts.map +1 -0
  165. package/dist_app/appMain.js +23 -0
  166. package/dist_app/appMain.js.map +1 -0
  167. package/dist_app/appMain_cmn.d.ts +30 -0
  168. package/dist_app/appMain_cmn.d.ts.map +1 -0
  169. package/dist_app/build.d.ts +2 -0
  170. package/dist_app/build.d.ts.map +1 -0
  171. package/dist_app/gamepad.js +511 -0
  172. package/dist_app/gamepad.js.map +1 -0
  173. package/dist_app/index.d.ts +33 -0
  174. package/dist_app/index.d.ts.map +1 -0
  175. package/dist_app/preload.d.ts +47 -0
  176. package/dist_app/preload.d.ts.map +1 -0
  177. package/dist_app/preload.js +2 -0
  178. package/dist_app/preload.js.map +1 -0
  179. package/dist_app/sn/AnalyzeTagArg.d.ts +28 -0
  180. package/dist_app/sn/AnalyzeTagArg.d.ts.map +1 -0
  181. package/dist_app/sn/Areas.d.ts +15 -0
  182. package/dist_app/sn/Areas.d.ts.map +1 -0
  183. package/dist_app/sn/Button.d.ts +23 -0
  184. package/dist_app/sn/Button.d.ts.map +1 -0
  185. package/dist_app/sn/CallStack.d.ts +23 -0
  186. package/dist_app/sn/CallStack.d.ts.map +1 -0
  187. package/dist_app/sn/CmnInterface.d.ts +227 -0
  188. package/dist_app/sn/CmnInterface.d.ts.map +1 -0
  189. package/dist_app/sn/CmnLib.d.ts +46 -0
  190. package/dist_app/sn/CmnLib.d.ts.map +1 -0
  191. package/dist_app/sn/CmnTween.d.ts +35 -0
  192. package/dist_app/sn/CmnTween.d.ts.map +1 -0
  193. package/dist_app/sn/Config.d.ts +12 -0
  194. package/dist_app/sn/Config.d.ts.map +1 -0
  195. package/dist_app/sn/ConfigBase.d.ts +111 -0
  196. package/dist_app/sn/ConfigBase.d.ts.map +1 -0
  197. package/dist_app/sn/DebugMng.d.ts +14 -0
  198. package/dist_app/sn/DebugMng.d.ts.map +1 -0
  199. package/dist_app/sn/DesignCast.d.ts +53 -0
  200. package/dist_app/sn/DesignCast.d.ts.map +1 -0
  201. package/dist_app/sn/EventListenerCtn.d.ts +13 -0
  202. package/dist_app/sn/EventListenerCtn.d.ts.map +1 -0
  203. package/dist_app/sn/EventMng.d.ts +29 -0
  204. package/dist_app/sn/EventMng.d.ts.map +1 -0
  205. package/dist_app/sn/FocusMng.d.ts +13 -0
  206. package/dist_app/sn/FocusMng.d.ts.map +1 -0
  207. package/dist_app/sn/FrameMng.d.ts +20 -0
  208. package/dist_app/sn/FrameMng.d.ts.map +1 -0
  209. package/dist_app/sn/Grammar.d.ts +291 -0
  210. package/dist_app/sn/Grammar.d.ts.map +1 -0
  211. package/dist_app/sn/GrpLayer.d.ts +49 -0
  212. package/dist_app/sn/GrpLayer.d.ts.map +1 -0
  213. package/dist_app/sn/Hyphenation.d.ts +42 -0
  214. package/dist_app/sn/Hyphenation.d.ts.map +1 -0
  215. package/dist_app/sn/Layer.d.ts +86 -0
  216. package/dist_app/sn/Layer.d.ts.map +1 -0
  217. package/dist_app/sn/LayerMng.d.ts +46 -0
  218. package/dist_app/sn/LayerMng.d.ts.map +1 -0
  219. package/dist_app/sn/Log.d.ts +18 -0
  220. package/dist_app/sn/Log.d.ts.map +1 -0
  221. package/dist_app/sn/Main.d.ts +16 -0
  222. package/dist_app/sn/Main.d.ts.map +1 -0
  223. package/dist_app/sn/Pages.d.ts +26 -0
  224. package/dist_app/sn/Pages.d.ts.map +1 -0
  225. package/dist_app/sn/PropParser.d.ts +12 -0
  226. package/dist_app/sn/PropParser.d.ts.map +1 -0
  227. package/dist_app/sn/Reading.d.ts +86 -0
  228. package/dist_app/sn/Reading.d.ts.map +1 -0
  229. package/dist_app/sn/RubySpliter.d.ts +14 -0
  230. package/dist_app/sn/RubySpliter.d.ts.map +1 -0
  231. package/dist_app/sn/ScriptIterator.d.ts +58 -0
  232. package/dist_app/sn/ScriptIterator.d.ts.map +1 -0
  233. package/dist_app/sn/SndBuf.d.ts +30 -0
  234. package/dist_app/sn/SndBuf.d.ts.map +1 -0
  235. package/dist_app/sn/SoundMng.d.ts +16 -0
  236. package/dist_app/sn/SoundMng.d.ts.map +1 -0
  237. package/dist_app/sn/SpritesMng.d.ts +27 -0
  238. package/dist_app/sn/SpritesMng.d.ts.map +1 -0
  239. package/dist_app/sn/SysApp.d.ts +32 -0
  240. package/dist_app/sn/SysApp.d.ts.map +1 -0
  241. package/dist_app/sn/SysBase.d.ts +79 -0
  242. package/dist_app/sn/SysBase.d.ts.map +1 -0
  243. package/dist_app/sn/SysNode.d.ts +15 -0
  244. package/dist_app/sn/SysNode.d.ts.map +1 -0
  245. package/dist_app/sn/SysWeb.d.ts +26 -0
  246. package/dist_app/sn/SysWeb.d.ts.map +1 -0
  247. package/dist_app/sn/TxtLayer.d.ts +121 -0
  248. package/dist_app/sn/TxtLayer.d.ts.map +1 -0
  249. package/dist_app/sn/TxtStage.d.ts +90 -0
  250. package/dist_app/sn/TxtStage.d.ts.map +1 -0
  251. package/dist_app/sn/Variable.d.ts +48 -0
  252. package/dist_app/sn/Variable.d.ts.map +1 -0
  253. package/dist_app/sn/htm2tx.d.ts +3 -0
  254. package/dist_app/sn/htm2tx.d.ts.map +1 -0
  255. package/dist_app/test/AnalyzeTagArg.test.d.ts +2 -0
  256. package/dist_app/test/AnalyzeTagArg.test.d.ts.map +1 -0
  257. package/dist_app/test/AreasTest.test.d.ts +2 -0
  258. package/dist_app/test/AreasTest.test.d.ts.map +1 -0
  259. package/dist_app/test/CmnLib.test.d.ts +2 -0
  260. package/dist_app/test/CmnLib.test.d.ts.map +1 -0
  261. package/dist_app/test/Config.test.d.ts +2 -0
  262. package/dist_app/test/Config.test.d.ts.map +1 -0
  263. package/dist_app/test/Grammar.test.d.ts +2 -0
  264. package/dist_app/test/Grammar.test.d.ts.map +1 -0
  265. package/dist_app/test/HyphTest.test.d.ts +2 -0
  266. package/dist_app/test/HyphTest.test.d.ts.map +1 -0
  267. package/dist_app/test/Log.test.d.ts +2 -0
  268. package/dist_app/test/Log.test.d.ts.map +1 -0
  269. package/dist_app/test/PropParser.test.d.ts +2 -0
  270. package/dist_app/test/PropParser.test.d.ts.map +1 -0
  271. package/dist_app/test/RubySpliter.test.d.ts +2 -0
  272. package/dist_app/test/RubySpliter.test.d.ts.map +1 -0
  273. package/dist_app/test/SysTest.d.ts +5 -0
  274. package/dist_app/test/SysTest.d.ts.map +1 -0
  275. package/dist_app/test/ValTest.d.ts +31 -0
  276. package/dist_app/test/ValTest.d.ts.map +1 -0
  277. package/dist_app/test/Variable.test.d.ts +2 -0
  278. package/dist_app/test/Variable.test.d.ts.map +1 -0
  279. package/dist_app/web.d.ts +9 -0
  280. package/dist_app/web.d.ts.map +1 -0
  281. package/package.json +57 -51
  282. package/dist/app.js +0 -28154
  283. package/dist/app.js.map +0 -1
  284. package/dist/appMain.js +0 -16
  285. package/dist/appMain.js.map +0 -1
  286. package/dist/preload.js +0 -2
  287. package/dist/preload.js.map +0 -1
  288. package/dist/sn/ReadState.d.ts +0 -79
  289. package/dist/sn/ReadState.d.ts.map +0 -1
@@ -0,0 +1,833 @@
1
+ import { i as dt } from "./app2.js";
2
+ var lt = { exports: {} }, Ht = lt.exports, Ot;
3
+ function Xt() {
4
+ return Ot || (Ot = 1, function(At, e) {
5
+ (function(c, l) {
6
+ At.exports = l();
7
+ })(typeof self < "u" ? self : Ht, function() {
8
+ return function(c) {
9
+ var l = {};
10
+ function p(o) {
11
+ if (l[o]) return l[o].exports;
12
+ var f = l[o] = { i: o, l: !1, exports: {} };
13
+ return c[o].call(f.exports, f, f.exports, p), f.l = !0, f.exports;
14
+ }
15
+ return p.m = c, p.c = l, p.d = function(o, f, I) {
16
+ p.o(o, f) || Object.defineProperty(o, f, { configurable: !1, enumerable: !0, get: I });
17
+ }, p.r = function(o) {
18
+ Object.defineProperty(o, "__esModule", { value: !0 });
19
+ }, p.n = function(o) {
20
+ var f = o && o.__esModule ? function() {
21
+ return o.default;
22
+ } : function() {
23
+ return o;
24
+ };
25
+ return p.d(f, "a", f), f;
26
+ }, p.o = function(o, f) {
27
+ return Object.prototype.hasOwnProperty.call(o, f);
28
+ }, p.p = "", p(p.s = 0);
29
+ }([function(c, l, p) {
30
+ function o(t) {
31
+ if (!(this instanceof o)) return new o(t);
32
+ this._ = t;
33
+ }
34
+ var f = o.prototype;
35
+ function I(t, r) {
36
+ for (var n = 0; n < t; n++) r(n);
37
+ }
38
+ function x(t, r, n) {
39
+ return function(i, u) {
40
+ I(u.length, function(s) {
41
+ i(u[s], s, u);
42
+ });
43
+ }(function(i, u, s) {
44
+ r = t(r, i, u, s);
45
+ }, n), r;
46
+ }
47
+ function O(t, r) {
48
+ return x(function(n, i, u, s) {
49
+ return n.concat([t(i, u, s)]);
50
+ }, [], r);
51
+ }
52
+ function ht(t, r) {
53
+ var n = { v: 0, buf: r };
54
+ return I(t, function() {
55
+ var i;
56
+ n = { v: n.v << 1 | (i = n.buf, i[0] >> 7), buf: function(u) {
57
+ var s = x(function(a, h, v, S) {
58
+ return a.concat(v === S.length - 1 ? Buffer.from([h, 0]).readUInt16BE(0) : S.readUInt16BE(v));
59
+ }, [], u);
60
+ return Buffer.from(O(function(a) {
61
+ return (a << 1 & 65535) >> 8;
62
+ }, s));
63
+ }(n.buf) };
64
+ }), n;
65
+ }
66
+ function tt() {
67
+ return typeof Buffer < "u";
68
+ }
69
+ function D() {
70
+ if (!tt()) throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.");
71
+ }
72
+ function rt(t) {
73
+ D();
74
+ var r = x(function(s, a) {
75
+ return s + a;
76
+ }, 0, t);
77
+ if (r % 8 != 0) throw new Error("The bits [" + t.join(", ") + "] add up to " + r + " which is not an even number of bytes; the total should be divisible by 8");
78
+ var n, i = r / 8, u = (n = function(s) {
79
+ return s > 48;
80
+ }, x(function(s, a) {
81
+ return s || (n(a) ? a : s);
82
+ }, null, t));
83
+ if (u) throw new Error(u + " bit range requested exceeds 48 bit (6 byte) Number max.");
84
+ return new o(function(s, a) {
85
+ var h = i + a;
86
+ return h > s.length ? B(a, i.toString() + " bytes") : b(h, x(function(v, S) {
87
+ var N = ht(S, v.buf);
88
+ return { coll: v.coll.concat(N.v), buf: N.buf };
89
+ }, { coll: [], buf: s.slice(a, h) }, t).coll);
90
+ });
91
+ }
92
+ function P(t, r) {
93
+ return new o(function(n, i) {
94
+ return D(), i + r > n.length ? B(i, r + " bytes for " + t) : b(i + r, n.slice(i, i + r));
95
+ });
96
+ }
97
+ function W(t, r) {
98
+ if (typeof (n = r) != "number" || Math.floor(n) !== n || r < 0 || r > 6) throw new Error(t + " requires integer length in range [0, 6].");
99
+ var n;
100
+ }
101
+ function Z(t) {
102
+ return W("uintBE", t), P("uintBE(" + t + ")", t).map(function(r) {
103
+ return r.readUIntBE(0, t);
104
+ });
105
+ }
106
+ function $(t) {
107
+ return W("uintLE", t), P("uintLE(" + t + ")", t).map(function(r) {
108
+ return r.readUIntLE(0, t);
109
+ });
110
+ }
111
+ function m(t) {
112
+ return W("intBE", t), P("intBE(" + t + ")", t).map(function(r) {
113
+ return r.readIntBE(0, t);
114
+ });
115
+ }
116
+ function y(t) {
117
+ return W("intLE", t), P("intLE(" + t + ")", t).map(function(r) {
118
+ return r.readIntLE(0, t);
119
+ });
120
+ }
121
+ function d(t) {
122
+ return t instanceof o;
123
+ }
124
+ function E(t) {
125
+ return {}.toString.call(t) === "[object Array]";
126
+ }
127
+ function L(t) {
128
+ return tt() && Buffer.isBuffer(t);
129
+ }
130
+ function b(t, r) {
131
+ return { status: !0, index: t, value: r, furthest: -1, expected: [] };
132
+ }
133
+ function B(t, r) {
134
+ return E(r) || (r = [r]), { status: !1, index: -1, value: null, furthest: t, expected: r };
135
+ }
136
+ function j(t, r) {
137
+ if (!r || t.furthest > r.furthest) return t;
138
+ var n = t.furthest === r.furthest ? function(i, u) {
139
+ if (function() {
140
+ if (o._supportsSet !== void 0) return o._supportsSet;
141
+ var q = typeof Set < "u";
142
+ return o._supportsSet = q, q;
143
+ }() && Array.from) {
144
+ for (var s = new Set(i), a = 0; a < u.length; a++) s.add(u[a]);
145
+ var h = Array.from(s);
146
+ return h.sort(), h;
147
+ }
148
+ for (var v = {}, S = 0; S < i.length; S++) v[i[S]] = !0;
149
+ for (var N = 0; N < u.length; N++) v[u[N]] = !0;
150
+ var k = [];
151
+ for (var _ in v) ({}).hasOwnProperty.call(v, _) && k.push(_);
152
+ return k.sort(), k;
153
+ }(t.expected, r.expected) : r.expected;
154
+ return { status: t.status, index: t.index, value: t.value, furthest: r.furthest, expected: n };
155
+ }
156
+ var nt = {};
157
+ function bt(t, r) {
158
+ if (L(t)) return { offset: r, line: -1, column: -1 };
159
+ t in nt || (nt[t] = {});
160
+ for (var n = nt[t], i = 0, u = 0, s = 0, a = r; a >= 0; ) {
161
+ if (a in n) {
162
+ i = n[a].line, s === 0 && (s = n[a].lineStart);
163
+ break;
164
+ }
165
+ (t.charAt(a) === `
166
+ ` || t.charAt(a) === "\r" && t.charAt(a + 1) !== `
167
+ `) && (u++, s === 0 && (s = a + 1)), a--;
168
+ }
169
+ var h = i + u, v = r - s;
170
+ return n[r] = { line: h, lineStart: s }, { offset: r, line: h + 1, column: v + 1 };
171
+ }
172
+ function G(t) {
173
+ if (!d(t)) throw new Error("not a parser: " + t);
174
+ }
175
+ function et(t, r) {
176
+ return typeof t == "string" ? t.charAt(r) : t[r];
177
+ }
178
+ function U(t) {
179
+ if (typeof t != "number") throw new Error("not a number: " + t);
180
+ }
181
+ function M(t) {
182
+ if (typeof t != "function") throw new Error("not a function: " + t);
183
+ }
184
+ function J(t) {
185
+ if (typeof t != "string") throw new Error("not a string: " + t);
186
+ }
187
+ var kt = 2, qt = 3, R = 8, It = 5 * R, Rt = 4 * R, vt = " ";
188
+ function it(t, r) {
189
+ return new Array(r + 1).join(t);
190
+ }
191
+ function ot(t, r, n) {
192
+ var i = r - t.length;
193
+ return i <= 0 ? t : it(n, i) + t;
194
+ }
195
+ function yt(t, r, n, i) {
196
+ return { from: t - r > 0 ? t - r : 0, to: t + n > i ? i : t + n };
197
+ }
198
+ function Mt(t, r) {
199
+ var n, i, u, s, a, h = r.index, v = h.offset, S = 1;
200
+ if (v === t.length) return "Got the end of the input";
201
+ if (L(t)) {
202
+ var N = v - v % R, k = v - N, _ = yt(N, It, Rt + R, t.length), q = O(function(w) {
203
+ return O(function(C) {
204
+ return ot(C.toString(16), 2, "0");
205
+ }, w);
206
+ }, function(w, C) {
207
+ var H = w.length, V = [], X = 0;
208
+ if (H <= C) return [w.slice()];
209
+ for (var Y = 0; Y < H; Y++) V[X] || V.push([]), V[X].push(w[Y]), (Y + 1) % C == 0 && X++;
210
+ return V;
211
+ }(t.slice(_.from, _.to).toJSON().data, R));
212
+ s = function(w) {
213
+ return w.from === 0 && w.to === 1 ? { from: w.from, to: w.to } : { from: w.from / R, to: Math.floor(w.to / R) };
214
+ }(_), i = N / R, n = 3 * k, k >= 4 && (n += 1), S = 2, u = O(function(w) {
215
+ return w.length <= 4 ? w.join(" ") : w.slice(0, 4).join(" ") + " " + w.slice(4).join(" ");
216
+ }, q), (a = (8 * (s.to > 0 ? s.to - 1 : s.to)).toString(16).length) < 2 && (a = 2);
217
+ } else {
218
+ var T = t.split(/\r\n|[\n\r\u2028\u2029]/);
219
+ n = h.column - 1, i = h.line - 1, s = yt(i, kt, qt, T.length), u = T.slice(s.from, s.to), a = s.to.toString().length;
220
+ }
221
+ var Ct = i - s.from;
222
+ return L(t) && (a = (8 * (s.to > 0 ? s.to - 1 : s.to)).toString(16).length) < 2 && (a = 2), x(function(w, C, H) {
223
+ var V, X = H === Ct, Y = X ? "> " : vt;
224
+ return V = L(t) ? ot((8 * (s.from + H)).toString(16), a, "0") : ot((s.from + H + 1).toString(), a, " "), [].concat(w, [Y + V + " | " + C], X ? [vt + it(" ", a) + " | " + ot("", n, " ") + it("^", S)] : []);
225
+ }, [], u).join(`
226
+ `);
227
+ }
228
+ function Et(t, r) {
229
+ return [`
230
+ `, "-- PARSING FAILED " + it("-", 50), `
231
+
232
+ `, Mt(t, r), `
233
+
234
+ `, (n = r.expected, n.length === 1 ? `Expected:
235
+
236
+ ` + n[0] : `Expected one of the following:
237
+
238
+ ` + n.join(", ")), `
239
+ `].join("");
240
+ var n;
241
+ }
242
+ function wt(t) {
243
+ return t.flags !== void 0 ? t.flags : [t.global ? "g" : "", t.ignoreCase ? "i" : "", t.multiline ? "m" : "", t.unicode ? "u" : "", t.sticky ? "y" : ""].join("");
244
+ }
245
+ function ut() {
246
+ for (var t = [].slice.call(arguments), r = t.length, n = 0; n < r; n += 1) G(t[n]);
247
+ return o(function(i, u) {
248
+ for (var s, a = new Array(r), h = 0; h < r; h += 1) {
249
+ if (!(s = j(t[h]._(i, u), s)).status) return s;
250
+ a[h] = s.value, u = s.index;
251
+ }
252
+ return j(b(u, a), s);
253
+ });
254
+ }
255
+ function F() {
256
+ var t = [].slice.call(arguments);
257
+ if (t.length === 0) throw new Error("seqMap needs at least one argument");
258
+ var r = t.pop();
259
+ return M(r), ut.apply(null, t).map(function(n) {
260
+ return r.apply(null, n);
261
+ });
262
+ }
263
+ function st() {
264
+ var t = [].slice.call(arguments), r = t.length;
265
+ if (r === 0) return at("zero alternates");
266
+ for (var n = 0; n < r; n += 1) G(t[n]);
267
+ return o(function(i, u) {
268
+ for (var s, a = 0; a < t.length; a += 1) if ((s = j(t[a]._(i, u), s)).status) return s;
269
+ return s;
270
+ });
271
+ }
272
+ function xt(t, r) {
273
+ return pt(t, r).or(z([]));
274
+ }
275
+ function pt(t, r) {
276
+ return G(t), G(r), F(t, r.then(t).many(), function(n, i) {
277
+ return [n].concat(i);
278
+ });
279
+ }
280
+ function K(t) {
281
+ J(t);
282
+ var r = "'" + t + "'";
283
+ return o(function(n, i) {
284
+ var u = i + t.length, s = n.slice(i, u);
285
+ return s === t ? b(u, s) : B(i, r);
286
+ });
287
+ }
288
+ function A(t, r) {
289
+ (function(u) {
290
+ if (!(u instanceof RegExp)) throw new Error("not a regexp: " + u);
291
+ for (var s = wt(u), a = 0; a < s.length; a++) {
292
+ var h = s.charAt(a);
293
+ if (h !== "i" && h !== "m" && h !== "u" && h !== "s") throw new Error('unsupported regexp flag "' + h + '": ' + u);
294
+ }
295
+ })(t), arguments.length >= 2 ? U(r) : r = 0;
296
+ var n = function(u) {
297
+ return RegExp("^(?:" + u.source + ")", wt(u));
298
+ }(t), i = "" + t;
299
+ return o(function(u, s) {
300
+ var a = n.exec(u.slice(s));
301
+ if (a) {
302
+ if (0 <= r && r <= a.length) {
303
+ var h = a[0], v = a[r];
304
+ return b(s + h.length, v);
305
+ }
306
+ return B(s, "valid match group (0 to " + a.length + ") in " + i);
307
+ }
308
+ return B(s, i);
309
+ });
310
+ }
311
+ function z(t) {
312
+ return o(function(r, n) {
313
+ return b(n, t);
314
+ });
315
+ }
316
+ function at(t) {
317
+ return o(function(r, n) {
318
+ return B(n, t);
319
+ });
320
+ }
321
+ function ft(t) {
322
+ if (d(t)) return o(function(r, n) {
323
+ var i = t._(r, n);
324
+ return i.index = n, i.value = "", i;
325
+ });
326
+ if (typeof t == "string") return ft(K(t));
327
+ if (t instanceof RegExp) return ft(A(t));
328
+ throw new Error("not a string, regexp, or parser: " + t);
329
+ }
330
+ function Nt(t) {
331
+ return G(t), o(function(r, n) {
332
+ var i = t._(r, n), u = r.slice(n, i.index);
333
+ return i.status ? B(n, 'not "' + u + '"') : b(n, null);
334
+ });
335
+ }
336
+ function ct(t) {
337
+ return M(t), o(function(r, n) {
338
+ var i = et(r, n);
339
+ return n < r.length && t(i) ? b(n + 1, i) : B(n, "a character/byte matching " + t);
340
+ });
341
+ }
342
+ function St(t, r) {
343
+ arguments.length < 2 && (r = t, t = void 0);
344
+ var n = o(function(i, u) {
345
+ return n._ = r()._, n._(i, u);
346
+ });
347
+ return t ? n.desc(t) : n;
348
+ }
349
+ function mt() {
350
+ return at("fantasy-land/empty");
351
+ }
352
+ f.parse = function(t) {
353
+ if (typeof t != "string" && !L(t)) throw new Error(".parse must be called with a string or Buffer as its argument");
354
+ var r, n = this.skip(gt)._(t, 0);
355
+ return r = n.status ? { status: !0, value: n.value } : { status: !1, index: bt(t, n.furthest), expected: n.expected }, delete nt[t], r;
356
+ }, f.tryParse = function(t) {
357
+ var r = this.parse(t);
358
+ if (r.status) return r.value;
359
+ var n = Et(t, r), i = new Error(n);
360
+ throw i.type = "ParsimmonError", i.result = r, i;
361
+ }, f.assert = function(t, r) {
362
+ return this.chain(function(n) {
363
+ return t(n) ? z(n) : at(r);
364
+ });
365
+ }, f.or = function(t) {
366
+ return st(this, t);
367
+ }, f.trim = function(t) {
368
+ return this.wrap(t, t);
369
+ }, f.wrap = function(t, r) {
370
+ return F(t, this, r, function(n, i) {
371
+ return i;
372
+ });
373
+ }, f.thru = function(t) {
374
+ return t(this);
375
+ }, f.then = function(t) {
376
+ return G(t), ut(this, t).map(function(r) {
377
+ return r[1];
378
+ });
379
+ }, f.many = function() {
380
+ var t = this;
381
+ return o(function(r, n) {
382
+ for (var i = [], u = void 0; ; ) {
383
+ if (!(u = j(t._(r, n), u)).status) return j(b(n, i), u);
384
+ if (n === u.index) throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");
385
+ n = u.index, i.push(u.value);
386
+ }
387
+ });
388
+ }, f.tieWith = function(t) {
389
+ return J(t), this.map(function(r) {
390
+ if (function(u) {
391
+ if (!E(u)) throw new Error("not an array: " + u);
392
+ }(r), r.length) {
393
+ J(r[0]);
394
+ for (var n = r[0], i = 1; i < r.length; i++) J(r[i]), n += t + r[i];
395
+ return n;
396
+ }
397
+ return "";
398
+ });
399
+ }, f.tie = function() {
400
+ return this.tieWith("");
401
+ }, f.times = function(t, r) {
402
+ var n = this;
403
+ return arguments.length < 2 && (r = t), U(t), U(r), o(function(i, u) {
404
+ for (var s = [], a = void 0, h = void 0, v = 0; v < t; v += 1) {
405
+ if (h = j(a = n._(i, u), h), !a.status) return h;
406
+ u = a.index, s.push(a.value);
407
+ }
408
+ for (; v < r && (h = j(a = n._(i, u), h), a.status); v += 1) u = a.index, s.push(a.value);
409
+ return j(b(u, s), h);
410
+ });
411
+ }, f.result = function(t) {
412
+ return this.map(function() {
413
+ return t;
414
+ });
415
+ }, f.atMost = function(t) {
416
+ return this.times(0, t);
417
+ }, f.atLeast = function(t) {
418
+ return F(this.times(t), this.many(), function(r, n) {
419
+ return r.concat(n);
420
+ });
421
+ }, f.map = function(t) {
422
+ M(t);
423
+ var r = this;
424
+ return o(function(n, i) {
425
+ var u = r._(n, i);
426
+ return u.status ? j(b(u.index, t(u.value)), u) : u;
427
+ });
428
+ }, f.contramap = function(t) {
429
+ M(t);
430
+ var r = this;
431
+ return o(function(n, i) {
432
+ var u = r.parse(t(n.slice(i)));
433
+ return u.status ? b(i + n.length, u.value) : u;
434
+ });
435
+ }, f.promap = function(t, r) {
436
+ return M(t), M(r), this.contramap(t).map(r);
437
+ }, f.skip = function(t) {
438
+ return ut(this, t).map(function(r) {
439
+ return r[0];
440
+ });
441
+ }, f.mark = function() {
442
+ return F(Q, this, Q, function(t, r, n) {
443
+ return { start: t, value: r, end: n };
444
+ });
445
+ }, f.node = function(t) {
446
+ return F(Q, this, Q, function(r, n, i) {
447
+ return { name: t, value: n, start: r, end: i };
448
+ });
449
+ }, f.sepBy = function(t) {
450
+ return xt(this, t);
451
+ }, f.sepBy1 = function(t) {
452
+ return pt(this, t);
453
+ }, f.lookahead = function(t) {
454
+ return this.skip(ft(t));
455
+ }, f.notFollowedBy = function(t) {
456
+ return this.skip(Nt(t));
457
+ }, f.desc = function(t) {
458
+ E(t) || (t = [t]);
459
+ var r = this;
460
+ return o(function(n, i) {
461
+ var u = r._(n, i);
462
+ return u.status || (u.expected = t), u;
463
+ });
464
+ }, f.fallback = function(t) {
465
+ return this.or(z(t));
466
+ }, f.ap = function(t) {
467
+ return F(t, this, function(r, n) {
468
+ return r(n);
469
+ });
470
+ }, f.chain = function(t) {
471
+ var r = this;
472
+ return o(function(n, i) {
473
+ var u = r._(n, i);
474
+ return u.status ? j(t(u.value)._(n, u.index), u) : u;
475
+ });
476
+ }, f.concat = f.or, f.empty = mt, f.of = z, f["fantasy-land/ap"] = f.ap, f["fantasy-land/chain"] = f.chain, f["fantasy-land/concat"] = f.concat, f["fantasy-land/empty"] = f.empty, f["fantasy-land/of"] = f.of, f["fantasy-land/map"] = f.map;
477
+ var Q = o(function(t, r) {
478
+ return b(r, bt(t, r));
479
+ }), Ft = o(function(t, r) {
480
+ return r >= t.length ? B(r, "any character/byte") : b(r + 1, et(t, r));
481
+ }), zt = o(function(t, r) {
482
+ return b(t.length, t.slice(r));
483
+ }), gt = o(function(t, r) {
484
+ return r < t.length ? B(r, "EOF") : b(r, null);
485
+ }), Vt = A(/[0-9]/).desc("a digit"), Dt = A(/[0-9]*/).desc("optional digits"), Wt = A(/[a-z]/i).desc("a letter"), $t = A(/[a-z]*/i).desc("optional letters"), Gt = A(/\s*/).desc("optional whitespace"), Ut = A(/\s+/).desc("whitespace"), Bt = K("\r"), _t = K(`
486
+ `), Pt = K(`\r
487
+ `), jt = st(Pt, _t, Bt).desc("newline"), Tt = st(jt, gt);
488
+ o.all = zt, o.alt = st, o.any = Ft, o.cr = Bt, o.createLanguage = function(t) {
489
+ var r = {};
490
+ for (var n in t) ({}).hasOwnProperty.call(t, n) && function(i) {
491
+ r[i] = St(function() {
492
+ return t[i](r);
493
+ });
494
+ }(n);
495
+ return r;
496
+ }, o.crlf = Pt, o.custom = function(t) {
497
+ return o(t(b, B));
498
+ }, o.digit = Vt, o.digits = Dt, o.empty = mt, o.end = Tt, o.eof = gt, o.fail = at, o.formatError = Et, o.index = Q, o.isParser = d, o.lazy = St, o.letter = Wt, o.letters = $t, o.lf = _t, o.lookahead = ft, o.makeFailure = B, o.makeSuccess = b, o.newline = jt, o.noneOf = function(t) {
499
+ return ct(function(r) {
500
+ return t.indexOf(r) < 0;
501
+ }).desc("none of '" + t + "'");
502
+ }, o.notFollowedBy = Nt, o.of = z, o.oneOf = function(t) {
503
+ for (var r = t.split(""), n = 0; n < r.length; n++) r[n] = "'" + r[n] + "'";
504
+ return ct(function(i) {
505
+ return t.indexOf(i) >= 0;
506
+ }).desc(r);
507
+ }, o.optWhitespace = Gt, o.Parser = o, o.range = function(t, r) {
508
+ return ct(function(n) {
509
+ return t <= n && n <= r;
510
+ }).desc(t + "-" + r);
511
+ }, o.regex = A, o.regexp = A, o.sepBy = xt, o.sepBy1 = pt, o.seq = ut, o.seqMap = F, o.seqObj = function() {
512
+ for (var t, r = {}, n = 0, i = (t = arguments, Array.prototype.slice.call(t)), u = i.length, s = 0; s < u; s += 1) {
513
+ var a = i[s];
514
+ if (!d(a)) {
515
+ if (E(a) && a.length === 2 && typeof a[0] == "string" && d(a[1])) {
516
+ var h = a[0];
517
+ if (Object.prototype.hasOwnProperty.call(r, h)) throw new Error("seqObj: duplicate key " + h);
518
+ r[h] = !0, n++;
519
+ continue;
520
+ }
521
+ throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.");
522
+ }
523
+ }
524
+ if (n === 0) throw new Error("seqObj expects at least one named parser, found zero");
525
+ return o(function(v, S) {
526
+ for (var N, k = {}, _ = 0; _ < u; _ += 1) {
527
+ var q, T;
528
+ if (E(i[_]) ? (q = i[_][0], T = i[_][1]) : (q = null, T = i[_]), !(N = j(T._(v, S), N)).status) return N;
529
+ q && (k[q] = N.value), S = N.index;
530
+ }
531
+ return j(b(S, k), N);
532
+ });
533
+ }, o.string = K, o.succeed = z, o.takeWhile = function(t) {
534
+ return M(t), o(function(r, n) {
535
+ for (var i = n; i < r.length && t(et(r, i)); ) i++;
536
+ return b(i, r.slice(n, i));
537
+ });
538
+ }, o.test = ct, o.whitespace = Ut, o["fantasy-land/empty"] = mt, o["fantasy-land/of"] = z, o.Binary = { bitSeq: rt, bitSeqObj: function(t) {
539
+ D();
540
+ var r = {}, n = 0, i = O(function(s) {
541
+ if (E(s)) {
542
+ var a = s;
543
+ if (a.length !== 2) throw new Error("[" + a.join(", ") + "] should be length 2, got length " + a.length);
544
+ if (J(a[0]), U(a[1]), Object.prototype.hasOwnProperty.call(r, a[0])) throw new Error("duplicate key in bitSeqObj: " + a[0]);
545
+ return r[a[0]] = !0, n++, a;
546
+ }
547
+ return U(s), [null, s];
548
+ }, t);
549
+ if (n < 1) throw new Error("bitSeqObj expects at least one named pair, got [" + t.join(", ") + "]");
550
+ var u = O(function(s) {
551
+ return s[0];
552
+ }, i);
553
+ return rt(O(function(s) {
554
+ return s[1];
555
+ }, i)).map(function(s) {
556
+ return x(function(a, h) {
557
+ return h[0] !== null && (a[h[0]] = h[1]), a;
558
+ }, {}, O(function(a, h) {
559
+ return [a, s[h]];
560
+ }, u));
561
+ });
562
+ }, byte: function(t) {
563
+ if (D(), U(t), t > 255) throw new Error("Value specified to byte constructor (" + t + "=0x" + t.toString(16) + ") is larger in value than a single byte.");
564
+ var r = (t > 15 ? "0x" : "0x0") + t.toString(16);
565
+ return o(function(n, i) {
566
+ var u = et(n, i);
567
+ return u === t ? b(i + 1, u) : B(i, r);
568
+ });
569
+ }, buffer: function(t) {
570
+ return P("buffer", t).map(function(r) {
571
+ return Buffer.from(r);
572
+ });
573
+ }, encodedString: function(t, r) {
574
+ return P("string", r).map(function(n) {
575
+ return n.toString(t);
576
+ });
577
+ }, uintBE: Z, uint8BE: Z(1), uint16BE: Z(2), uint32BE: Z(4), uintLE: $, uint8LE: $(1), uint16LE: $(2), uint32LE: $(4), intBE: m, int8BE: m(1), int16BE: m(2), int32BE: m(4), intLE: y, int8LE: y(1), int16LE: y(2), int32LE: y(4), floatBE: P("floatBE", 4).map(function(t) {
578
+ return t.readFloatBE(0);
579
+ }), floatLE: P("floatLE", 4).map(function(t) {
580
+ return t.readFloatLE(0);
581
+ }), doubleBE: P("doubleBE", 8).map(function(t) {
582
+ return t.readDoubleBE(0);
583
+ }), doubleLE: P("doubleLE", 8).map(function(t) {
584
+ return t.readDoubleLE(0);
585
+ }) }, c.exports = o;
586
+ }]);
587
+ });
588
+ }(lt)), lt.exports;
589
+ }
590
+ var g = Xt();
591
+ class Lt {
592
+ constructor(e, c = "\\") {
593
+ this.val = e;
594
+ function l(m) {
595
+ const y = [];
596
+ for (const d of m) y.push(
597
+ (typeof d == "string" ? g.string(d) : g.regex(d)).trim(g.optWhitespace)
598
+ );
599
+ return g.alt(...y);
600
+ }
601
+ function p(m) {
602
+ const d = Object.keys(m).sort().map(
603
+ (E) => (typeof m[E] == "string" ? g.string(m[E]) : g.regex(m[E])).trim(g.optWhitespace).result(E)
604
+ );
605
+ return g.alt(...d);
606
+ }
607
+ function o(m, y) {
608
+ const d = g.lazy(() => g.seq(m, d).or(y));
609
+ return d;
610
+ }
611
+ function f(m, y) {
612
+ return g.seqMap(y, m.many(), (d, E) => E.reduce((L, b) => [b, L], d));
613
+ }
614
+ function I(m, y) {
615
+ const d = g.lazy(
616
+ () => y.chain(
617
+ (E) => g.seq(
618
+ m,
619
+ g.of(E),
620
+ d
621
+ ).or(g.of(E))
622
+ )
623
+ );
624
+ return d;
625
+ }
626
+ function x(m, y) {
627
+ return g.seqMap(
628
+ y,
629
+ g.seq(m, y).many(),
630
+ (d, E) => E.reduce((L, b) => [b[0], L, b[1]], d)
631
+ );
632
+ }
633
+ const O = g.alt(
634
+ g.alt(
635
+ g.regex(/-?(0|[1-9][0-9]*)\.[0-9]+/),
636
+ g.regex(/0x[0-9a-fA-F]+/)
637
+ ).map(Number),
638
+ g.alt(
639
+ g.regex(/-?(0|[1-9][0-9]*)/)
640
+ ).map((m) => dt(m))
641
+ ).map((m) => ["!num!", m]).desc("number"), ht = g.string("null").map(() => ["!str!", null]), tt = g.regex(/(true|false)/).map((m) => ["!bool!", m === "true"]).desc("boolean"), D = g.regex(new RegExp(`(?:"(?:\\${c}["'#\\n]|[^"])*"|'(?:\\${c}["'#\\n]|[^'])*'|\\#(?:\\${c}["'#\\n]|[^#])*\\#)`)).map((m) => ["!str!", m.slice(1, -1).replaceAll(c, "")]).desc("string"), rt = /\[[^\]]+\]/g, P = g.regex(/-?(?:(?:tmp|sys|save|mp):)?[^\s!-/:-@[-^`{-~]+(?:\.[^\s!-/:-@[-^`{-~]+|\[[^\]]+\])*(?:@str)?/).map((m) => {
642
+ const y = m.replaceAll(
643
+ rt,
644
+ (E) => (
645
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
646
+ "." + this.parse(E.slice(1, -1))
647
+ )
648
+ ), d = this.val.getVal(y);
649
+ return d == null ? ["!str!", d] : typeof d == "boolean" ? ["!bool!", d] : Object.prototype.toString.call(d) === "[object String]" ? ["!str!", String(d)] : ["!num!", Number(d)];
650
+ }).desc("string"), W = g.lazy(
651
+ () => g.string("(").then(this.#e).skip(g.string(")")).or(O).or(ht).or(tt).or(D).or(P)
652
+ ), $ = [
653
+ // 演算子の優先順位 - JavaScript | MDN https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Operator_precedence
654
+ // 優先順位:18(メンバーへのアクセス、計算値によるメンバーへのアクセス)
655
+ // a.b a[b]
656
+ { type: o, ops: l([/[A-Za-z_][A-Za-z0-9_]*(?=\()/]) },
657
+ // 優先順位:16
658
+ { type: f, ops: p({ PostfixInc: "++" }) },
659
+ { type: f, ops: p({ PostfixDec: "--" }) },
660
+ // 【未サポート】後置インクリメント・デクリメント
661
+ // 優先順位:15
662
+ { type: o, ops: l([/!(?!=)|~/]) },
663
+ // 論理 NOT (!)、ビット単位 NOT (~)
664
+ { type: o, ops: p({ PrefixInc: "++" }) },
665
+ { type: o, ops: p({ PrefixDec: "--" }) },
666
+ // 【未サポート】前置インクリメント・デクリメント
667
+ // {type: PREFIX, ops: opeH({Unaryplus: /\+(?!\+)/})}, // 単項プラス
668
+ { type: o, ops: p({ UnaryNegate: /-(?!-)/ }) },
669
+ // 単項マイナス
670
+ // 優先順位:14以下(並びに注意)
671
+ { type: I, ops: l(["**"]) },
672
+ { type: x, ops: l(["*", "/", "¥", "%"]) },
673
+ { type: x, ops: l(["+", "-"]) },
674
+ { type: x, ops: l([/>>>|<<|>>/]) },
675
+ { type: x, ops: l([/<=|<|>=|>/]) },
676
+ { type: x, ops: l([/===|!==|==|!=/]) },
677
+ { type: x, ops: l([/&(?!&)/]) },
678
+ { type: x, ops: l(["^"]) },
679
+ { type: x, ops: l([/\|(?!\|)/]) },
680
+ { type: x, ops: l(["&&"]) },
681
+ { type: x, ops: l(["||"]) },
682
+ { type: I, ops: l([":"]) },
683
+ { type: I, ops: l(["?"]) }
684
+ ].reduce(
685
+ (m, y) => y.type(y.ops, m),
686
+ W
687
+ );
688
+ this.#e = $.trim(g.optWhitespace);
689
+ }
690
+ #e = null;
691
+ parse(e) {
692
+ const c = this.#e.parse(e);
693
+ if (!c.status) throw Error("(PropParser)文法エラー【" + e + "】");
694
+ const l = c.value;
695
+ return l[0] === "!str!" ? this.#i(l[1]) : this.#t(l);
696
+ }
697
+ #t(e) {
698
+ const c = e.shift();
699
+ if (c instanceof Array) return this.#t(c);
700
+ const l = this.#r[c];
701
+ return l ? l(e) : Object(null);
702
+ }
703
+ #r = {
704
+ "!num!": (e) => e.shift(),
705
+ "!str!": (e) => this.#i(e.shift()),
706
+ "!bool!": (e) => e.shift(),
707
+ PostfixInc: (e) => {
708
+ throw Error("(PropParser)後置インクリメントは未サポートです");
709
+ },
710
+ PostfixDec: (e) => {
711
+ throw Error("(PropParser)後置デクリメントは未サポートです");
712
+ },
713
+ PrefixInc: (e) => {
714
+ throw Error("(PropParser)前置インクリメントは未サポートです");
715
+ },
716
+ PrefixDec: (e) => {
717
+ throw Error("(PropParser)前置デクリメントは未サポートです");
718
+ },
719
+ // 論理 NOT
720
+ "!": (e) => !this.#r.Boolean(e),
721
+ // チルダ演算子(ビット反転)
722
+ "~": (e) => ~Number(this.#t(e.shift())),
723
+ // UnaryNegate: a=> -Number(this.#calc(a.shift())),
724
+ UnaryNegate: (e) => -this.#r.Number(e),
725
+ // Unaryplus: a=> this.#hFnc['Number'](a),
726
+ // 乗算、除算、剰余
727
+ "**": (e) => Number(this.#t(e.shift())) ** Number(this.#t(e.shift())),
728
+ "*": (e) => Number(this.#t(e.shift())) * Number(this.#t(e.shift())),
729
+ "/": (e) => Number(this.#t(e.shift())) / Number(this.#t(e.shift())),
730
+ "¥": (e) => Math.floor(this.#r["/"](e)),
731
+ "%": (e) => Number(this.#t(e.shift())) % Number(this.#t(e.shift())),
732
+ // 加算、減算、文字列の連結
733
+ "+": (e) => {
734
+ const c = this.#t(e.shift()), l = this.#t(e.shift());
735
+ return Object.prototype.toString.call(c) === "[object String]" || Object.prototype.toString.call(l) === "[object String]" ? String(c) + String(l) : Number(c) + Number(l);
736
+ },
737
+ "-": (e) => Number(this.#t(e.shift())) - Number(this.#t(e.shift())),
738
+ // 関数
739
+ int: (e) => dt(this.#n(e.shift())),
740
+ parseInt: (e) => dt(this.#r.Number(e)),
741
+ Number: (e) => {
742
+ const c = this.#t(e.shift());
743
+ return Object.prototype.toString.call(c) === "[object String]" ? this.#n(this.#e.parse(String(c)).value) : Number(c);
744
+ },
745
+ Boolean: (e) => {
746
+ const c = e.shift();
747
+ return c[0] === "!bool!" ? !!c[1] : !!this.#t(c);
748
+ },
749
+ ceil: (e) => Math.ceil(this.#n(e.shift())),
750
+ floor: (e) => Math.floor(this.#n(e.shift())),
751
+ round: (e) => Math.round(this.#n(e.shift())),
752
+ isNaN: (e) => Number.isNaN(this.#n(e.shift())),
753
+ // ビットシフト
754
+ "<<": (e) => Number(this.#t(e.shift())) << Number(this.#t(e.shift())),
755
+ ">>": (e) => Number(this.#t(e.shift())) >> Number(this.#t(e.shift())),
756
+ ">>>": (e) => Number(this.#t(e.shift())) >>> Number(this.#t(e.shift())),
757
+ // 等値、非等値、厳密等価、厳密非等価
758
+ "<": (e) => Number(this.#t(e.shift())) < Number(this.#t(e.shift())),
759
+ "<=": (e) => Number(this.#t(e.shift())) <= Number(this.#t(e.shift())),
760
+ ">": (e) => Number(this.#t(e.shift())) > Number(this.#t(e.shift())),
761
+ ">=": (e) => Number(this.#t(e.shift())) >= Number(this.#t(e.shift())),
762
+ // 小なり、以下、大なり、以上
763
+ "==": (e) => {
764
+ const c = this.#t(e.shift()), l = this.#t(e.shift());
765
+ return c == null && l == null && (!c || !l) ? c == l : String(c) === String(l);
766
+ },
767
+ "!=": (e) => !this.#r["=="](e),
768
+ "===": (e) => {
769
+ const c = this.#t(e.shift()), l = this.#t(e.shift());
770
+ return Object.prototype.toString.call(c) != Object.prototype.toString.call(l) ? !1 : String(c) === String(l);
771
+ },
772
+ "!==": (e) => !this.#r["==="](e),
773
+ // ビット演算子
774
+ "&": (e) => Number(this.#t(e.shift())) & Number(this.#t(e.shift())),
775
+ "^": (e) => Number(this.#t(e.shift())) ^ Number(this.#t(e.shift())),
776
+ "|": (e) => Number(this.#t(e.shift())) | Number(this.#t(e.shift())),
777
+ // 論理 AND,OR
778
+ "&&": (e) => String(this.#t(e.shift())) === "true" && String(this.#t(e.shift())) === "true",
779
+ "||": (e) => String(this.#t(e.shift())) === "true" || String(this.#t(e.shift())) === "true",
780
+ // 条件
781
+ "?": (e) => {
782
+ const c = this.#r.Boolean(e), l = e.shift();
783
+ if (l[0] !== ":") throw Error("(PropParser)三項演算子の文法エラーです。: が見つかりません");
784
+ return this.#t(l[c ? 1 : 2]);
785
+ },
786
+ ":": () => {
787
+ throw Error("(PropParser)三項演算子の文法エラーです。? が見つかりません");
788
+ }
789
+ };
790
+ #n(e) {
791
+ const c = this.#t(e);
792
+ if (Object.prototype.toString.call(c) !== "[object Number]") throw Error("(PropParser)引数【" + String(c) + "】が数値ではありません");
793
+ return Number(c);
794
+ }
795
+ #o = /(\$((tmp|sys|save|mp):)?[^\s!--/:-@[-^`{-~]+|#\{[^}]+})/g;
796
+ #i(e) {
797
+ return e == null ? e : String(e).replaceAll(
798
+ this.#o,
799
+ (c) => String(c.startsWith("$") ? this.val.getVal(c.slice(1)) : this.parse(c.slice(2, -1)))
800
+ );
801
+ }
802
+ getValAmpersand = (e) => e.startsWith("&") ? String(this.parse(e.slice(1))) : e;
803
+ static #u = /^((?<scope>\w+?):)?(?<name>[^\s :@]+)(?<at>@str)?$/;
804
+ // 522 match 18413 step(~10ms) https://regex101.com/r/tmCKuE/1
805
+ // →これは改良しようがない。いい意味で改善の余地なし
806
+ static getValName(e) {
807
+ const l = this.#u.exec(e.trim())?.groups;
808
+ if (!l) return null;
809
+ const { scope: p = "tmp", name: o, at: f = "" } = l;
810
+ return {
811
+ scope: p,
812
+ name: Lt.#s(o),
813
+ at: f
814
+ };
815
+ }
816
+ static #s(e) {
817
+ let c = 0, l = 0, p = e;
818
+ for (; ; ) {
819
+ if (c = p.indexOf('["'), c < 0) {
820
+ if (c = p.indexOf("['"), c < 0) break;
821
+ l = p.indexOf("']", c + 2);
822
+ } else
823
+ l = p.indexOf('"]', c + 2);
824
+ if (l < 0) break;
825
+ p = p.slice(0, c) + "." + p.slice(c + 2, l) + p.slice(l + 2), c = l - 2;
826
+ }
827
+ return p;
828
+ }
829
+ }
830
+ export {
831
+ Lt as PropParser
832
+ };
833
+ //# sourceMappingURL=PropParser.js.map