@verbb/formie-browser 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/chunks/{calculations-CgVJcQ2P.js → calculations-CeDgB9jt.js} +13 -13
- package/dist/chunks/{conditions-CZ3FU5QO.js → conditions-DjZOtHfS.js} +3 -3
- package/dist/chunks/dist-BQ4a9hmy.js +2659 -0
- package/dist/chunks/rich-text-D0sb8bmX.js +349 -0
- package/dist/chunks/{signature-CpgqHCEx.js → signature-xz4QO7CR.js} +107 -34
- package/dist/chunks/{text-limit-B09elPDB.js → text-limit-DbgEFHLO.js} +1 -1
- package/dist/chunks/upload-manager-BpqWSHmU.js +2558 -0
- package/dist/css/theme/_buttons.css +16 -0
- package/dist/css/theme/_tokens.css +2 -0
- package/dist/css/theme/fields/_signature.css +19 -0
- package/dist/css/theme/fields/_upload-manager.css +279 -0
- package/dist/index.js +6 -5
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +3 -0
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -0
- package/package.json +4 -2
- package/src/css/theme/_buttons.css +16 -0
- package/src/css/theme/_tokens.css +2 -0
- package/src/css/theme/fields/_signature.css +19 -0
- package/src/css/theme/fields/_upload-manager.css +279 -0
- package/src/js/modules/fields/index.ts +1 -0
- package/src/js/modules/fields/signature.ts +199 -15
- package/src/js/modules/fields/upload-manager.ts +1277 -0
- package/src/vendor.d.ts +1 -1
- package/dist/chunks/dist-BF5GU3_9.js +0 -2674
- package/dist/chunks/rich-text-Cv8ADyk-.js +0 -349
|
@@ -1,2674 +0,0 @@
|
|
|
1
|
-
//#region node_modules/@verbb/formie-core/dist/index.js
|
|
2
|
-
function e(e, t) {
|
|
3
|
-
for (var n = 0; n < t.length; n++) {
|
|
4
|
-
let r = t[n];
|
|
5
|
-
if (typeof r != "string" && !Array.isArray(r)) {
|
|
6
|
-
for (let t in r) if (t !== "default" && !(t in e)) {
|
|
7
|
-
let n = Object.getOwnPropertyDescriptor(r, t);
|
|
8
|
-
n && Object.defineProperty(e, t, n.get ? n : {
|
|
9
|
-
enumerable: !0,
|
|
10
|
-
get: () => r[t]
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
-
}
|
|
17
|
-
function t(e) {
|
|
18
|
-
return Array.isArray(e) ? e.map((e) => String(e ?? "")) : [String(e ?? "")];
|
|
19
|
-
}
|
|
20
|
-
function n(e, t) {
|
|
21
|
-
return e.some((e) => t.includes(e));
|
|
22
|
-
}
|
|
23
|
-
function r(e, t) {
|
|
24
|
-
return e.some((e) => t.some((t) => t === e || t.includes(e)));
|
|
25
|
-
}
|
|
26
|
-
function i(e, t, n) {
|
|
27
|
-
return t.some((t) => e.some((e) => n(e, t)));
|
|
28
|
-
}
|
|
29
|
-
function a(e, t, n) {
|
|
30
|
-
return t.some((t) => {
|
|
31
|
-
let r = Number.parseFloat(t);
|
|
32
|
-
return Number.isFinite(r) ? e.some((e) => {
|
|
33
|
-
let t = Number.parseFloat(e);
|
|
34
|
-
return Number.isFinite(t) ? n(t, r) : !1;
|
|
35
|
-
}) : !1;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function o(e) {
|
|
39
|
-
return e.length === 0 || e.every((e) => e.trim() === "");
|
|
40
|
-
}
|
|
41
|
-
function s(e, s, c = {}) {
|
|
42
|
-
let l = String(e.condition || ""), u = t(e.value), d = c.visibility ?? null;
|
|
43
|
-
switch (l) {
|
|
44
|
-
case "=": return n(u, s);
|
|
45
|
-
case "!=": return !n(u, s);
|
|
46
|
-
case ">": return a(s, u, (e, t) => e > t);
|
|
47
|
-
case "<": return a(s, u, (e, t) => e < t);
|
|
48
|
-
case "contains": return r(u, s);
|
|
49
|
-
case "notContains": return !r(u, s);
|
|
50
|
-
case "startsWith": return i(s, u, (e, t) => e.startsWith(t));
|
|
51
|
-
case "endsWith": return i(s, u, (e, t) => e.endsWith(t));
|
|
52
|
-
case "empty": return o(s);
|
|
53
|
-
case "notEmpty": return !o(s);
|
|
54
|
-
case "visible": return d === !0;
|
|
55
|
-
case "hidden": return d === !1;
|
|
56
|
-
default: return !1;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function c(e, t) {
|
|
60
|
-
let n = e.conditionRule === "any" ? t.includes(!0) : t.every((e) => e === !0);
|
|
61
|
-
return {
|
|
62
|
-
finalResult: n,
|
|
63
|
-
shouldHide: n && e.showRule !== "show" || !n && e.showRule === "show"
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
var l = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
67
|
-
function u(e) {
|
|
68
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
69
|
-
}
|
|
70
|
-
var d = { exports: {} }, f = d.exports, p;
|
|
71
|
-
function m() {
|
|
72
|
-
return p || (p = 1, (function(e, t) {
|
|
73
|
-
(function(e, n) {
|
|
74
|
-
n(t);
|
|
75
|
-
})(f, function(e) {
|
|
76
|
-
function t(e, t, n) {
|
|
77
|
-
return (t = (function(e) {
|
|
78
|
-
var t = (function(e, t) {
|
|
79
|
-
if (typeof e != "object" || !e) return e;
|
|
80
|
-
var n = e[Symbol.toPrimitive];
|
|
81
|
-
if (n !== void 0) {
|
|
82
|
-
var r = n.call(e, t);
|
|
83
|
-
if (typeof r != "object") return r;
|
|
84
|
-
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
85
|
-
}
|
|
86
|
-
return (t === "string" ? String : Number)(e);
|
|
87
|
-
})(e, "string");
|
|
88
|
-
return typeof t == "symbol" ? t : t + "";
|
|
89
|
-
})(t)) in e ? Object.defineProperty(e, t, {
|
|
90
|
-
value: n,
|
|
91
|
-
enumerable: !0,
|
|
92
|
-
configurable: !0,
|
|
93
|
-
writable: !0
|
|
94
|
-
}) : e[t] = n, e;
|
|
95
|
-
}
|
|
96
|
-
let n = function(e, t) {
|
|
97
|
-
if (e.length === 0) return t.length;
|
|
98
|
-
if (t.length === 0) return e.length;
|
|
99
|
-
let n, r, i = [];
|
|
100
|
-
for (n = 0; n <= t.length; n++) i[n] = [n];
|
|
101
|
-
for (r = 0; r <= e.length; r++) i[0] === void 0 && (i[0] = []), i[0][r] = r;
|
|
102
|
-
for (n = 1; n <= t.length; n++) for (r = 1; r <= e.length; r++) t.charAt(n - 1) === e.charAt(r - 1) ? i[n][r] = i[n - 1][r - 1] : i[n][r] = Math.min(i[n - 1][r - 1] + 1, Math.min(i[n][r - 1] + 1, i[n - 1][r] + 1));
|
|
103
|
-
return i[t.length] === void 0 && (i[t.length] = []), i[t.length][e.length];
|
|
104
|
-
};
|
|
105
|
-
class r extends Error {
|
|
106
|
-
constructor(e, t, n, r, i) {
|
|
107
|
-
super(e), this.name = "SyntaxError", this.cursor = t, this.expression = n, this.subject = r, this.proposals = i;
|
|
108
|
-
}
|
|
109
|
-
toString() {
|
|
110
|
-
let e = `${this.name}: ${this.message} around position ${this.cursor}`;
|
|
111
|
-
if (this.expression && (e += ` for expression \`${this.expression}\``), e += ".", this.subject && this.proposals) {
|
|
112
|
-
let t = 2 ** 53 - 1, r = null;
|
|
113
|
-
for (let e of this.proposals) {
|
|
114
|
-
let i = n(this.subject, e);
|
|
115
|
-
i < t && (r = e, t = i);
|
|
116
|
-
}
|
|
117
|
-
r !== null && t < 3 && (e += ` Did you mean "${r}"?`);
|
|
118
|
-
}
|
|
119
|
-
return e;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
class i {
|
|
123
|
-
constructor(e, n) {
|
|
124
|
-
t(this, "next", () => {
|
|
125
|
-
if (this.position += 1, this.tokens[this.position] === void 0) throw new r("Unexpected end of expression", this.last.cursor, this.expression);
|
|
126
|
-
}), t(this, "expect", (e, t, n) => {
|
|
127
|
-
let i = this.current;
|
|
128
|
-
if (!i.test(e, t)) {
|
|
129
|
-
let a = "";
|
|
130
|
-
n && (a = n + ". ");
|
|
131
|
-
let o = "";
|
|
132
|
-
throw t && (o = ` with value "${t}"`), a += `Unexpected token "${i.type}" of value "${i.value}" ("${e}" expected${o})`, new r(a, i.cursor, this.expression);
|
|
133
|
-
}
|
|
134
|
-
this.next();
|
|
135
|
-
}), t(this, "isEOF", () => a.EOF_TYPE === this.current.type), t(this, "isEqualTo", (e) => {
|
|
136
|
-
if (e == null || !e instanceof i || e.tokens.length !== this.tokens.length) return !1;
|
|
137
|
-
let t = e.position;
|
|
138
|
-
e.position = 0;
|
|
139
|
-
let n = !0;
|
|
140
|
-
for (let t of this.tokens) {
|
|
141
|
-
if (!e.current.isEqualTo(t)) {
|
|
142
|
-
n = !1;
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
e.position < e.tokens.length - 1 && e.next();
|
|
146
|
-
}
|
|
147
|
-
return e.position = t, n;
|
|
148
|
-
}), t(this, "diff", (e) => {
|
|
149
|
-
let t = [];
|
|
150
|
-
if (!this.isEqualTo(e)) {
|
|
151
|
-
let n = e.position;
|
|
152
|
-
e.position = 0;
|
|
153
|
-
for (let n of this.tokens) {
|
|
154
|
-
let r = n.diff(e.current);
|
|
155
|
-
r.length > 0 && t.push({
|
|
156
|
-
index: 0,
|
|
157
|
-
diff: r
|
|
158
|
-
}), e.position < e.tokens.length - 1 && e.next();
|
|
159
|
-
}
|
|
160
|
-
e.position = n;
|
|
161
|
-
}
|
|
162
|
-
return t;
|
|
163
|
-
}), this.expression = e, this.position = 0, this.tokens = n;
|
|
164
|
-
}
|
|
165
|
-
get current() {
|
|
166
|
-
return this.tokens[this.position];
|
|
167
|
-
}
|
|
168
|
-
get last() {
|
|
169
|
-
return this.tokens[this.position - 1];
|
|
170
|
-
}
|
|
171
|
-
toString() {
|
|
172
|
-
return this.tokens.join("\n");
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
class a {
|
|
176
|
-
constructor(e, n, r) {
|
|
177
|
-
t(this, "test", (e, t = null) => this.type === e && (t === null || this.value === t)), t(this, "isEqualTo", (e) => !(e == null || !e instanceof a) && e.value == this.value && e.type === this.type && e.cursor === this.cursor), t(this, "diff", (e) => {
|
|
178
|
-
let t = [];
|
|
179
|
-
return this.isEqualTo(e) || (e.value !== this.value && t.push(`Value: ${e.value} != ${this.value}`), e.cursor !== this.cursor && t.push(`Cursor: ${e.cursor} != ${this.cursor}`), e.type !== this.type && t.push(`Type: ${e.type} != ${this.type}`)), t;
|
|
180
|
-
}), this.value = n, this.type = e, this.cursor = r;
|
|
181
|
-
}
|
|
182
|
-
toString() {
|
|
183
|
-
return `${this.cursor} [${this.type}] ${this.value}`;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
function o(e) {
|
|
187
|
-
let t = 0, n = [], o = [], c = (e = e.replace(/\r|\n|\t|\v|\f/g, " ")).length;
|
|
188
|
-
for (; t < c;) {
|
|
189
|
-
if (e[t] === " ") {
|
|
190
|
-
++t;
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
if (e.substr(t, 2) === "/*") {
|
|
194
|
-
let n = e.indexOf("*/", t + 2);
|
|
195
|
-
if (n === -1) {
|
|
196
|
-
t = c;
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
t = n + 2;
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
let i = s(e.substr(t));
|
|
203
|
-
if (i !== null) {
|
|
204
|
-
let e = i.length, r = i.replace(/_/g, "");
|
|
205
|
-
i = r.indexOf(".") === -1 && r.indexOf("e") === -1 && r.indexOf("E") === -1 ? parseInt(r, 10) : parseFloat(r), n.push(new a(a.NUMBER_TYPE, i, t + 1)), t += e;
|
|
206
|
-
} else if ("([{".indexOf(e[t]) >= 0) o.push([e[t], t]), n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
|
|
207
|
-
else if (")]}".indexOf(e[t]) >= 0) {
|
|
208
|
-
if (o.length === 0) throw new r(`Unexpected "${e[t]}"`, t, e);
|
|
209
|
-
let [i, s] = o.pop(), c = i.replace("(", ")").replace("{", "}").replace("[", "]");
|
|
210
|
-
if (e[t] !== c) throw new r(`Unclosed "${i}"`, s, e);
|
|
211
|
-
n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
|
|
212
|
-
} else {
|
|
213
|
-
let i = d(e.substr(t));
|
|
214
|
-
if (i !== null) n.push(new a(a.STRING_TYPE, i.captured, t + 1)), t += i.length;
|
|
215
|
-
else if (e.substr(t, 2) === "\\\\") n.push(new a(a.PUNCTUATION_TYPE, "\\", t + 1)), t += 2;
|
|
216
|
-
else {
|
|
217
|
-
let i = n.length > 0 ? n[n.length - 1] : null;
|
|
218
|
-
if (i && i.type === a.PUNCTUATION_TYPE && (i.value === "." || i.value === "?.")) {
|
|
219
|
-
let i = h(e.substr(t));
|
|
220
|
-
if (i) n.push(new a(a.NAME_TYPE, i, t + 1)), t += i.length;
|
|
221
|
-
else {
|
|
222
|
-
let i = m(e.substr(t));
|
|
223
|
-
if (i) n.push(new a(a.OPERATOR_TYPE, i, t + 1)), t += i.length;
|
|
224
|
-
else if (e.substr(t, 2) === "?." || e.substr(t, 2) === "??") n.push(new a(a.PUNCTUATION_TYPE, e.substr(t, 2), t + 1)), t += 2;
|
|
225
|
-
else {
|
|
226
|
-
if (!(".,?:".indexOf(e[t]) >= 0)) throw new r(`Unexpected character "${e[t]}"`, t, e);
|
|
227
|
-
n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
} else {
|
|
231
|
-
let i = m(e.substr(t));
|
|
232
|
-
if (i) n.push(new a(a.OPERATOR_TYPE, i, t + 1)), t += i.length;
|
|
233
|
-
else if (e.substr(t, 2) === "?." || e.substr(t, 2) === "??") n.push(new a(a.PUNCTUATION_TYPE, e.substr(t, 2), t + 1)), t += 2;
|
|
234
|
-
else if (".,?:".indexOf(e[t]) >= 0) n.push(new a(a.PUNCTUATION_TYPE, e[t], t + 1)), ++t;
|
|
235
|
-
else {
|
|
236
|
-
let i = h(e.substr(t));
|
|
237
|
-
if (!i) throw new r(`Unexpected character "${e[t]}"`, t, e);
|
|
238
|
-
n.push(new a(a.NAME_TYPE, i, t + 1)), t += i.length;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
if (n.push(new a(a.EOF_TYPE, null, t + 1)), o.length > 0) {
|
|
245
|
-
let [t, n] = o.pop();
|
|
246
|
-
throw new r(`Unclosed "${t}"`, n, e);
|
|
247
|
-
}
|
|
248
|
-
return new i(e, n);
|
|
249
|
-
}
|
|
250
|
-
function s(e) {
|
|
251
|
-
let t = null, n = e.match(/^(?:((?:\d(?:_?\d)*)\.(?:\d(?:_?\d)*)|\.(?:\d(?:_?\d)*)|(?:\d(?:_?\d)*))(?:[eE][+-]?\d(?:_?\d)*)?)/);
|
|
252
|
-
return n && n.length > 0 && (t = n[0]), t;
|
|
253
|
-
}
|
|
254
|
-
t(a, "EOF_TYPE", "end of expression"), t(a, "NAME_TYPE", "name"), t(a, "NUMBER_TYPE", "number"), t(a, "STRING_TYPE", "string"), t(a, "OPERATOR_TYPE", "operator"), t(a, "PUNCTUATION_TYPE", "punctuation");
|
|
255
|
-
let c = /^"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/s;
|
|
256
|
-
function u(e, t) {
|
|
257
|
-
return t === "\"" ? e = e.replace(/\\\"/g, "\"") : t === "'" && (e = e.replace(/\\'/g, "'")), e = e.replace(/\\\\/g, "\\");
|
|
258
|
-
}
|
|
259
|
-
function d(e) {
|
|
260
|
-
let t = null;
|
|
261
|
-
if (["'", "\""].indexOf(e.substr(0, 1)) === -1) return t;
|
|
262
|
-
let n = c.exec(e);
|
|
263
|
-
return n !== null && n.length > 0 && (t = n[1] === void 0 ? { captured: u(n[2], "'") } : { captured: u(n[1], "\"") }, t.length = n[0].length), t;
|
|
264
|
-
}
|
|
265
|
-
let f = /* @__PURE__ */ "&&,and,||,or,+,-,**,*,/,%,&,|,^,>>,<<,===,!==,!=,==,<=,>=,<,>,contains,matches,starts with,ends with,not in,in,not,!,xor,~,..".split(","), p = [
|
|
266
|
-
"and",
|
|
267
|
-
"or",
|
|
268
|
-
"matches",
|
|
269
|
-
"contains",
|
|
270
|
-
"starts with",
|
|
271
|
-
"ends with",
|
|
272
|
-
"not in",
|
|
273
|
-
"in",
|
|
274
|
-
"not",
|
|
275
|
-
"xor"
|
|
276
|
-
];
|
|
277
|
-
function m(e) {
|
|
278
|
-
let t = null;
|
|
279
|
-
for (let n of f) if (e.substr(0, n.length) === n) {
|
|
280
|
-
p.indexOf(n) >= 0 ? e.substr(0, n.length + 1) === n + " " && (t = n) : t = n;
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
return t;
|
|
284
|
-
}
|
|
285
|
-
function h(e) {
|
|
286
|
-
let t = null, n = e.match(/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/);
|
|
287
|
-
return n && n.length > 0 && (t = n[0]), t;
|
|
288
|
-
}
|
|
289
|
-
function g(e) {
|
|
290
|
-
return /boolean|number|string/.test(typeof e);
|
|
291
|
-
}
|
|
292
|
-
function _(e, t) {
|
|
293
|
-
var n = "", r = [], i = 0, a = 0, o = "", s = "", c = "", l = "", u = "", d = 0, f = 0, p = 0, m = 0, h = 0, g = [], _ = "", v = /%([\dA-Fa-f]+)/g, y = function(e, t) {
|
|
294
|
-
return (e += "").length < t ? Array(++t - e.length).join("0") + e : e;
|
|
295
|
-
};
|
|
296
|
-
for (i = 0; i < t.length; i++) if (o = t.charAt(i), s = t.charAt(i + 1), o === "\\" && s && /\d/.test(s)) {
|
|
297
|
-
if (m = i + (p = (c = t.slice(i + 1).match(/^\d+/)[0]).length) + 1, t.charAt(m) + t.charAt(m + 1) === "..") {
|
|
298
|
-
if (d = c.charCodeAt(0), /\\\d/.test(t.charAt(m + 2) + t.charAt(m + 3))) l = t.slice(m + 3).match(/^\d+/)[0], i += 1;
|
|
299
|
-
else {
|
|
300
|
-
if (!t.charAt(m + 2)) throw Error("Range with no end point");
|
|
301
|
-
l = t.charAt(m + 2);
|
|
302
|
-
}
|
|
303
|
-
if ((f = l.charCodeAt(0)) > d) for (a = d; a <= f; a++) r.push(String.fromCharCode(a));
|
|
304
|
-
else r.push(".", c, l);
|
|
305
|
-
i += l.length + 2;
|
|
306
|
-
} else u = String.fromCharCode(parseInt(c, 8)), r.push(u);
|
|
307
|
-
i += p;
|
|
308
|
-
} else if (s + t.charAt(i + 2) === "..") {
|
|
309
|
-
if (d = (c = o).charCodeAt(0), /\\\d/.test(t.charAt(i + 3) + t.charAt(i + 4))) l = t.slice(i + 4).match(/^\d+/)[0], i += 1;
|
|
310
|
-
else {
|
|
311
|
-
if (!t.charAt(i + 3)) throw Error("Range with no end point");
|
|
312
|
-
l = t.charAt(i + 3);
|
|
313
|
-
}
|
|
314
|
-
if ((f = l.charCodeAt(0)) > d) for (a = d; a <= f; a++) r.push(String.fromCharCode(a));
|
|
315
|
-
else r.push(".", c, l);
|
|
316
|
-
i += l.length + 2;
|
|
317
|
-
} else r.push(o);
|
|
318
|
-
for (i = 0; i < e.length; i++) if (o = e.charAt(i), r.indexOf(o) !== -1) if (n += "\\", (h = o.charCodeAt(0)) < 32 || h > 126) switch (o) {
|
|
319
|
-
case "\n":
|
|
320
|
-
n += "n";
|
|
321
|
-
break;
|
|
322
|
-
case " ":
|
|
323
|
-
n += "t";
|
|
324
|
-
break;
|
|
325
|
-
case "\r":
|
|
326
|
-
n += "r";
|
|
327
|
-
break;
|
|
328
|
-
case "\x07":
|
|
329
|
-
n += "a";
|
|
330
|
-
break;
|
|
331
|
-
case "\v":
|
|
332
|
-
n += "v";
|
|
333
|
-
break;
|
|
334
|
-
case "\b":
|
|
335
|
-
n += "b";
|
|
336
|
-
break;
|
|
337
|
-
case "\f":
|
|
338
|
-
n += "f";
|
|
339
|
-
break;
|
|
340
|
-
default: for (_ = encodeURIComponent(o), (g = v.exec(_)) !== null && (n += y(parseInt(g[1], 16).toString(8), 3)); (g = v.exec(_)) !== null;) n += "\\" + y(parseInt(g[1], 16).toString(8), 3);
|
|
341
|
-
}
|
|
342
|
-
else n += o;
|
|
343
|
-
else n += o;
|
|
344
|
-
return n;
|
|
345
|
-
}
|
|
346
|
-
class v {
|
|
347
|
-
constructor(e = {}, n = {}) {
|
|
348
|
-
t(this, "compile", (e) => {
|
|
349
|
-
for (let t of Object.values(this.nodes)) t.compile(e);
|
|
350
|
-
}), t(this, "evaluate", (e, t) => {
|
|
351
|
-
let n = [];
|
|
352
|
-
for (let r of Object.values(this.nodes)) n.push(r.evaluate(e, t));
|
|
353
|
-
return n;
|
|
354
|
-
}), t(this, "toArray", () => {
|
|
355
|
-
throw Error(`Dumping a "${this.name}" instance is not supported yet.`);
|
|
356
|
-
}), t(this, "dump", () => {
|
|
357
|
-
let e = "";
|
|
358
|
-
for (let t of this.toArray()) e += g(t) ? t : t.dump();
|
|
359
|
-
return e;
|
|
360
|
-
}), t(this, "dumpString", (e) => `"${_(e, "\0 \"\\")}"`), t(this, "isHash", (e) => {
|
|
361
|
-
let t = 0;
|
|
362
|
-
for (let n of Object.keys(e)) if (n = parseInt(n), n !== t++) return !0;
|
|
363
|
-
return !1;
|
|
364
|
-
}), this.name = "Node", this.nodes = e, this.attributes = n;
|
|
365
|
-
}
|
|
366
|
-
toString() {
|
|
367
|
-
let e = [];
|
|
368
|
-
for (let t of Object.keys(this.attributes)) {
|
|
369
|
-
let n = "null";
|
|
370
|
-
this.attributes[t] && (n = this.attributes[t].toString()), e.push(`${t}: '${n}'`);
|
|
371
|
-
}
|
|
372
|
-
let t = [this.name + "(" + e.join(", ")];
|
|
373
|
-
if (this.nodes.length > 0) {
|
|
374
|
-
for (let e of Object.values(this.nodes)) {
|
|
375
|
-
let n = e.toString().split("\n");
|
|
376
|
-
for (let e of n) t.push(" " + e);
|
|
377
|
-
}
|
|
378
|
-
t.push(")");
|
|
379
|
-
} else t[0] += ")";
|
|
380
|
-
return t.join("\n");
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
class y extends v {
|
|
384
|
-
constructor(e, n, r) {
|
|
385
|
-
super({
|
|
386
|
-
left: n,
|
|
387
|
-
right: r
|
|
388
|
-
}, { operator: e }), t(this, "compile", (e) => {
|
|
389
|
-
let t = this.attributes.operator;
|
|
390
|
-
t === "matches" ? e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")") : t === "contains" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().includes(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "starts with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().startsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : t === "ends with" ? e.raw("(").compile(this.nodes.left).raw(".toString().toLowerCase().endsWith(").compile(this.nodes.right).raw(".toString().toLowerCase())") : y.functions[t] === void 0 ? (y.operators[t] !== void 0 && (t = y.operators[t]), e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")) : e.raw(`${y.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")");
|
|
391
|
-
}), t(this, "evaluate", (e, t) => {
|
|
392
|
-
let n = this.attributes.operator, r = this.nodes.left.evaluate(e, t);
|
|
393
|
-
if (y.functions[n] !== void 0) {
|
|
394
|
-
let i = this.nodes.right.evaluate(e, t);
|
|
395
|
-
switch (n) {
|
|
396
|
-
case "not in": return i.indexOf(r) === -1;
|
|
397
|
-
case "in": return i.indexOf(r) >= 0;
|
|
398
|
-
case "..": return (function(e, t) {
|
|
399
|
-
let n = [];
|
|
400
|
-
for (let r = e; r <= t; r++) n.push(r);
|
|
401
|
-
return n;
|
|
402
|
-
})(r, i);
|
|
403
|
-
case "**": return r ** +i;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
let i = null;
|
|
407
|
-
switch (n) {
|
|
408
|
-
case "or":
|
|
409
|
-
case "||": return r || (i = this.nodes.right.evaluate(e, t)), r || i;
|
|
410
|
-
case "and":
|
|
411
|
-
case "&&": return r && (i = this.nodes.right.evaluate(e, t)), r && i;
|
|
412
|
-
case "xor": return i = this.nodes.right.evaluate(e, t), i && !r || r && !i;
|
|
413
|
-
case "<<": return i = this.nodes.right.evaluate(e, t), r << i;
|
|
414
|
-
case ">>": return i = this.nodes.right.evaluate(e, t), r >> i;
|
|
415
|
-
}
|
|
416
|
-
switch (i = this.nodes.right.evaluate(e, t), n) {
|
|
417
|
-
case "|": return r | i;
|
|
418
|
-
case "^": return r ^ i;
|
|
419
|
-
case "&": return r & i;
|
|
420
|
-
case "==": return r == i;
|
|
421
|
-
case "===": return r === i;
|
|
422
|
-
case "!=": return r != i;
|
|
423
|
-
case "!==": return r !== i;
|
|
424
|
-
case "<": return r < i;
|
|
425
|
-
case ">": return r > i;
|
|
426
|
-
case ">=": return r >= i;
|
|
427
|
-
case "<=": return r <= i;
|
|
428
|
-
case "not in": return i.indexOf(r) === -1;
|
|
429
|
-
case "in": return i.indexOf(r) >= 0;
|
|
430
|
-
case "+": return r + i;
|
|
431
|
-
case "-": return r - i;
|
|
432
|
-
case "~": return r.toString() + i.toString();
|
|
433
|
-
case "*": return r * i;
|
|
434
|
-
case "/": return r / i;
|
|
435
|
-
case "%": return r % i;
|
|
436
|
-
case "matches":
|
|
437
|
-
if (r == null) return !1;
|
|
438
|
-
let e = i.match(y.regex_expression);
|
|
439
|
-
return new RegExp(e[1], e[2]).test(r);
|
|
440
|
-
case "contains": return r.toString().toLowerCase().includes(i.toString().toLowerCase());
|
|
441
|
-
case "starts with": return r.toString().toLowerCase().startsWith(i.toString().toLowerCase());
|
|
442
|
-
case "ends with": return r.toString().toLowerCase().endsWith(i.toString().toLowerCase());
|
|
443
|
-
}
|
|
444
|
-
}), t(this, "toArray", () => [
|
|
445
|
-
"(",
|
|
446
|
-
this.nodes.left,
|
|
447
|
-
" " + this.attributes.operator + " ",
|
|
448
|
-
this.nodes.right,
|
|
449
|
-
")"
|
|
450
|
-
]), this.name = "BinaryNode";
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
t(y, "regex_expression", /\/(.+)\/(.*)/), t(y, "operators", {
|
|
454
|
-
"~": ".",
|
|
455
|
-
and: "&&",
|
|
456
|
-
or: "||",
|
|
457
|
-
xor: "xor",
|
|
458
|
-
"<<": "<<",
|
|
459
|
-
">>": ">>"
|
|
460
|
-
}), t(y, "functions", {
|
|
461
|
-
"**": "Math.pow",
|
|
462
|
-
"..": "range",
|
|
463
|
-
in: "includes",
|
|
464
|
-
"not in": "!includes"
|
|
465
|
-
});
|
|
466
|
-
class b extends v {
|
|
467
|
-
constructor(e, n) {
|
|
468
|
-
super({ node: n }, { operator: e }), t(this, "compile", (e) => {
|
|
469
|
-
e.raw("(").raw(b.operators[this.attributes.operator]).compile(this.nodes.node).raw(")");
|
|
470
|
-
}), t(this, "evaluate", (e, t) => {
|
|
471
|
-
let n = this.nodes.node.evaluate(e, t);
|
|
472
|
-
switch (this.attributes.operator) {
|
|
473
|
-
case "not":
|
|
474
|
-
case "!": return !n;
|
|
475
|
-
case "-": return -n;
|
|
476
|
-
case "~": return ~n;
|
|
477
|
-
}
|
|
478
|
-
return n;
|
|
479
|
-
}), t(this, "toArray", () => [
|
|
480
|
-
"(",
|
|
481
|
-
this.attributes.operator + " ",
|
|
482
|
-
this.nodes.node,
|
|
483
|
-
")"
|
|
484
|
-
]), this.name = "UnaryNode";
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
t(b, "operators", {
|
|
488
|
-
"!": "!",
|
|
489
|
-
not: "!",
|
|
490
|
-
"+": "+",
|
|
491
|
-
"-": "-",
|
|
492
|
-
"~": "~"
|
|
493
|
-
});
|
|
494
|
-
class x extends v {
|
|
495
|
-
constructor(e, n = !1, r = !1) {
|
|
496
|
-
super({}, { value: e }), t(this, "compile", (e) => {
|
|
497
|
-
e.repr(this.attributes.value, this.isIdentifier);
|
|
498
|
-
}), t(this, "evaluate", (e, t) => this.attributes.value), t(this, "toArray", () => {
|
|
499
|
-
let e = [], t = this.attributes.value;
|
|
500
|
-
if (this.isIdentifier) e.push(t);
|
|
501
|
-
else if (t === !0) e.push("true");
|
|
502
|
-
else if (t === !1) e.push("false");
|
|
503
|
-
else if (t === null) e.push("null");
|
|
504
|
-
else if (typeof t == "number") e.push(t);
|
|
505
|
-
else if (typeof t == "string") e.push(this.dumpString(t));
|
|
506
|
-
else if (Array.isArray(t)) {
|
|
507
|
-
for (let n of t) e.push(","), e.push(new x(n));
|
|
508
|
-
e[0] = "[", e.push("]");
|
|
509
|
-
} else if (this.isHash(t)) {
|
|
510
|
-
for (let n of Object.keys(t)) e.push(", "), e.push(new x(n)), e.push(": "), e.push(new x(t[n]));
|
|
511
|
-
e[0] = "{", e.push("}");
|
|
512
|
-
}
|
|
513
|
-
return e;
|
|
514
|
-
}), this.isIdentifier = n, this.isNullSafe = r, this.name = "ConstantNode";
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
class S extends v {
|
|
518
|
-
constructor(e, n, r) {
|
|
519
|
-
super({
|
|
520
|
-
expr1: e,
|
|
521
|
-
expr2: n,
|
|
522
|
-
expr3: r
|
|
523
|
-
}), t(this, "compile", (e) => {
|
|
524
|
-
e.raw("((").compile(this.nodes.expr1).raw(") ? (").compile(this.nodes.expr2).raw(") : (").compile(this.nodes.expr3).raw("))");
|
|
525
|
-
}), t(this, "evaluate", (e, t) => this.nodes.expr1.evaluate(e, t) ? this.nodes.expr2.evaluate(e, t) : this.nodes.expr3.evaluate(e, t)), t(this, "toArray", () => [
|
|
526
|
-
"(",
|
|
527
|
-
this.nodes.expr1,
|
|
528
|
-
" ? ",
|
|
529
|
-
this.nodes.expr2,
|
|
530
|
-
" : ",
|
|
531
|
-
this.nodes.expr3,
|
|
532
|
-
")"
|
|
533
|
-
]), this.name = "ConditionalNode";
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
class C extends v {
|
|
537
|
-
constructor(e, n) {
|
|
538
|
-
super({ fnArguments: n }, { name: e }), t(this, "compile", (e) => {
|
|
539
|
-
let t = [];
|
|
540
|
-
for (let n of Object.values(this.nodes.fnArguments.nodes)) t.push(e.subcompile(n));
|
|
541
|
-
let n = e.getFunction(this.attributes.name);
|
|
542
|
-
e.raw(n.compiler.apply(null, t));
|
|
543
|
-
}), t(this, "evaluate", (e, t) => {
|
|
544
|
-
let n = [t];
|
|
545
|
-
for (let r of Object.values(this.nodes.fnArguments.nodes)) n.push(r.evaluate(e, t));
|
|
546
|
-
return e[this.attributes.name].evaluator.apply(null, n);
|
|
547
|
-
}), t(this, "toArray", () => {
|
|
548
|
-
let e = [];
|
|
549
|
-
e.push(this.attributes.name);
|
|
550
|
-
for (let t of Object.values(this.nodes.fnArguments.nodes)) e.push(", "), e.push(t);
|
|
551
|
-
return e[1] = "(", e.push(")"), e;
|
|
552
|
-
}), this.name = "FunctionNode";
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
class w extends v {
|
|
556
|
-
constructor(e) {
|
|
557
|
-
super({}, { name: e }), t(this, "compile", (e) => {
|
|
558
|
-
e.raw(this.attributes.name);
|
|
559
|
-
}), t(this, "evaluate", (e, t) => t[this.attributes.name]), t(this, "toArray", () => [this.attributes.name]), this.name = "NameNode";
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
class T extends v {
|
|
563
|
-
constructor() {
|
|
564
|
-
super(), t(this, "addElement", (e, t = null) => {
|
|
565
|
-
t === null ? t = new x(++this.index) : this.type === "Array" && (this.type = "Object"), this.nodes[(++this.keyIndex).toString()] = t, this.nodes[(++this.keyIndex).toString()] = e;
|
|
566
|
-
}), t(this, "compile", (e) => {
|
|
567
|
-
this.type === "Object" ? e.raw("{") : e.raw("["), this.compileArguments(e, this.type !== "Array"), this.type === "Object" ? e.raw("}") : e.raw("]");
|
|
568
|
-
}), t(this, "evaluate", (e, t) => {
|
|
569
|
-
let n;
|
|
570
|
-
if (this.type === "Array") {
|
|
571
|
-
n = [];
|
|
572
|
-
for (let r of this.getKeyValuePairs()) n.push(r.value.evaluate(e, t));
|
|
573
|
-
} else {
|
|
574
|
-
n = {};
|
|
575
|
-
for (let r of this.getKeyValuePairs()) n[r.key.evaluate(e, t)] = r.value.evaluate(e, t);
|
|
576
|
-
}
|
|
577
|
-
return n;
|
|
578
|
-
}), t(this, "toArray", () => {
|
|
579
|
-
let e = {};
|
|
580
|
-
for (let t of this.getKeyValuePairs()) e[t.key.attributes.value] = t.value;
|
|
581
|
-
let t = [];
|
|
582
|
-
if (this.isHash(e)) {
|
|
583
|
-
for (let n of Object.keys(e)) t.push(", "), t.push(new x(n)), t.push(": "), t.push(e[n]);
|
|
584
|
-
t[0] = "{", t.push("}");
|
|
585
|
-
} else {
|
|
586
|
-
for (let n of Object.values(e)) t.push(", "), t.push(n);
|
|
587
|
-
t[0] = "[", t.push("]");
|
|
588
|
-
}
|
|
589
|
-
return t;
|
|
590
|
-
}), t(this, "getKeyValuePairs", () => {
|
|
591
|
-
let e, t, n, r = [], i = Object.values(this.nodes);
|
|
592
|
-
for (e = 0, t = i.length; e < t; e += 2) n = i.slice(e, e + 2), r.push({
|
|
593
|
-
key: n[0],
|
|
594
|
-
value: n[1]
|
|
595
|
-
});
|
|
596
|
-
return r;
|
|
597
|
-
}), t(this, "compileArguments", (e, t = !0) => {
|
|
598
|
-
let n = !0;
|
|
599
|
-
for (let r of this.getKeyValuePairs()) n || e.raw(", "), n = !1, t && e.compile(r.key).raw(": "), e.compile(r.value);
|
|
600
|
-
}), this.name = "ArrayNode", this.type = "Array", this.index = -1, this.keyIndex = -1;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
class E extends T {
|
|
604
|
-
constructor() {
|
|
605
|
-
super(), t(this, "compile", (e) => {
|
|
606
|
-
this.compileArguments(e, !1);
|
|
607
|
-
}), t(this, "toArray", () => {
|
|
608
|
-
let e = [];
|
|
609
|
-
for (let t of this.getKeyValuePairs()) e.push(t.value), e.push(", ");
|
|
610
|
-
return e.pop(), e;
|
|
611
|
-
}), this.name = "ArgumentsNode";
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
class D extends v {
|
|
615
|
-
constructor(e, n, r, i) {
|
|
616
|
-
super({
|
|
617
|
-
node: e,
|
|
618
|
-
attribute: n,
|
|
619
|
-
fnArguments: r
|
|
620
|
-
}, {
|
|
621
|
-
type: i,
|
|
622
|
-
is_null_coalesce: !1,
|
|
623
|
-
is_short_circuited: !1
|
|
624
|
-
}), t(this, "compile", (e) => {
|
|
625
|
-
let t = this.nodes.attribute instanceof x && this.nodes.attribute.isNullSafe;
|
|
626
|
-
switch (this.attributes.type) {
|
|
627
|
-
case D.PROPERTY_CALL:
|
|
628
|
-
e.compile(this.nodes.node).raw(t ? "?." : ".").raw(this.nodes.attribute.attributes.value);
|
|
629
|
-
break;
|
|
630
|
-
case D.METHOD_CALL:
|
|
631
|
-
e.compile(this.nodes.node).raw(t ? "?." : ".").raw(this.nodes.attribute.attributes.value).raw("(").compile(this.nodes.fnArguments).raw(")");
|
|
632
|
-
break;
|
|
633
|
-
case D.ARRAY_CALL: e.compile(this.nodes.node).raw("[").compile(this.nodes.attribute).raw("]");
|
|
634
|
-
}
|
|
635
|
-
}), t(this, "evaluate", (e, t) => {
|
|
636
|
-
switch (this.attributes.type) {
|
|
637
|
-
case D.PROPERTY_CALL:
|
|
638
|
-
let n = this.nodes.node.evaluate(e, t);
|
|
639
|
-
if (n === null && (this.nodes.attribute.isNullSafe || this.attributes.is_null_coalesce)) return this.attributes.is_short_circuited = !0, null;
|
|
640
|
-
if (n === null && this.isShortCircuited()) return null;
|
|
641
|
-
if (typeof n != "object") throw Error(`Unable to get property "${r}" on a non-object: ` + typeof n);
|
|
642
|
-
let r = this.nodes.attribute.attributes.value;
|
|
643
|
-
return this.attributes.is_null_coalesce ? n[r] ?? null : n[r];
|
|
644
|
-
case D.METHOD_CALL:
|
|
645
|
-
let i = this.nodes.node.evaluate(e, t);
|
|
646
|
-
if (i === null && this.nodes.attribute.isNullSafe) return this.attributes.is_short_circuited = !0, null;
|
|
647
|
-
if (i === null && this.isShortCircuited()) return null;
|
|
648
|
-
let a = this.nodes.attribute.attributes.value;
|
|
649
|
-
if (typeof i != "object") throw Error(`Unable to call method "${a}" on a non-object: ` + typeof i);
|
|
650
|
-
if (i[a] === void 0) throw Error(`Method "${a}" is undefined on object.`);
|
|
651
|
-
if (typeof i[a] != "function") throw Error(`Method "${a}" is not a function on object.`);
|
|
652
|
-
let o = this.nodes.fnArguments.evaluate(e, t);
|
|
653
|
-
return i[a].apply(null, o);
|
|
654
|
-
case D.ARRAY_CALL:
|
|
655
|
-
let s = this.nodes.node.evaluate(e, t);
|
|
656
|
-
if (s === null && this.isShortCircuited()) return null;
|
|
657
|
-
if (!(Array.isArray(s) || typeof s == "object" || s === null && this.attributes.is_null_coalesce)) throw Error("Unable to get an item on a non-array: " + typeof s);
|
|
658
|
-
return this.attributes.is_null_coalesce ? s ? s[this.nodes.attribute.evaluate(e, t)] ?? null : null : s[this.nodes.attribute.evaluate(e, t)];
|
|
659
|
-
}
|
|
660
|
-
}), t(this, "toArray", () => {
|
|
661
|
-
let e = this.nodes.attribute instanceof x && this.nodes.attribute.isNullSafe;
|
|
662
|
-
switch (this.attributes.type) {
|
|
663
|
-
case D.PROPERTY_CALL: return [
|
|
664
|
-
this.nodes.node,
|
|
665
|
-
e ? "?." : ".",
|
|
666
|
-
this.nodes.attribute
|
|
667
|
-
];
|
|
668
|
-
case D.METHOD_CALL: return [
|
|
669
|
-
this.nodes.node,
|
|
670
|
-
e ? "?." : ".",
|
|
671
|
-
this.nodes.attribute,
|
|
672
|
-
"(",
|
|
673
|
-
this.nodes.fnArguments,
|
|
674
|
-
")"
|
|
675
|
-
];
|
|
676
|
-
case D.ARRAY_CALL: return [
|
|
677
|
-
this.nodes.node,
|
|
678
|
-
"[",
|
|
679
|
-
this.nodes.attribute,
|
|
680
|
-
"]"
|
|
681
|
-
];
|
|
682
|
-
}
|
|
683
|
-
}), this.name = "GetAttrNode";
|
|
684
|
-
}
|
|
685
|
-
isShortCircuited() {
|
|
686
|
-
return this.attributes.is_short_circuited || this.nodes.node instanceof D && this.nodes.node.isShortCircuited();
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
t(D, "PROPERTY_CALL", 1), t(D, "METHOD_CALL", 2), t(D, "ARRAY_CALL", 3);
|
|
690
|
-
class O extends v {
|
|
691
|
-
constructor(e, n) {
|
|
692
|
-
super({
|
|
693
|
-
expr1: e,
|
|
694
|
-
expr2: n
|
|
695
|
-
}), t(this, "compile", (e) => {
|
|
696
|
-
e.raw("((").compile(this.nodes.expr1).raw(") ?? (").compile(this.nodes.expr2).raw("))");
|
|
697
|
-
}), t(this, "evaluate", (e, t) => (this.nodes.expr1 instanceof D && this._addNullCoalesceAttributeToGetAttrNodes(this.nodes.expr1), this.nodes.expr1.evaluate(e, t) ?? this.nodes.expr2.evaluate(e, t))), t(this, "toArray", () => [
|
|
698
|
-
"(",
|
|
699
|
-
this.nodes.expr1,
|
|
700
|
-
") ?? (",
|
|
701
|
-
this.nodes.expr2,
|
|
702
|
-
")"
|
|
703
|
-
]), t(this, "_addNullCoalesceAttributeToGetAttrNodes", (e) => {
|
|
704
|
-
if (!(!e instanceof D)) {
|
|
705
|
-
e.attributes.is_null_coalesce = !0;
|
|
706
|
-
for (let t of Object.values(e.nodes)) this._addNullCoalesceAttributeToGetAttrNodes(t);
|
|
707
|
-
}
|
|
708
|
-
}), this.name = "NullCoalesceNode";
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
class k extends v {
|
|
712
|
-
constructor(e) {
|
|
713
|
-
super({}, { name: e }), t(this, "compile", (e) => {
|
|
714
|
-
e.raw(this.attributes.name + " ?? null");
|
|
715
|
-
}), t(this, "evaluate", (e, t) => null), t(this, "toArray", () => [this.attributes.name + " ?? null"]), this.name = "NullCoalescedNameNode";
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
class A {
|
|
719
|
-
constructor(e = {}) {
|
|
720
|
-
t(this, "functions", {}), t(this, "unaryOperators", {
|
|
721
|
-
not: { precedence: 50 },
|
|
722
|
-
"!": { precedence: 50 },
|
|
723
|
-
"-": { precedence: 500 },
|
|
724
|
-
"+": { precedence: 500 },
|
|
725
|
-
"~": { precedence: 500 }
|
|
726
|
-
}), t(this, "binaryOperators", {
|
|
727
|
-
or: {
|
|
728
|
-
precedence: 10,
|
|
729
|
-
associativity: 1
|
|
730
|
-
},
|
|
731
|
-
"||": {
|
|
732
|
-
precedence: 10,
|
|
733
|
-
associativity: 1
|
|
734
|
-
},
|
|
735
|
-
xor: {
|
|
736
|
-
precedence: 12,
|
|
737
|
-
associativity: 1
|
|
738
|
-
},
|
|
739
|
-
and: {
|
|
740
|
-
precedence: 15,
|
|
741
|
-
associativity: 1
|
|
742
|
-
},
|
|
743
|
-
"&&": {
|
|
744
|
-
precedence: 15,
|
|
745
|
-
associativity: 1
|
|
746
|
-
},
|
|
747
|
-
"|": {
|
|
748
|
-
precedence: 16,
|
|
749
|
-
associativity: 1
|
|
750
|
-
},
|
|
751
|
-
"^": {
|
|
752
|
-
precedence: 17,
|
|
753
|
-
associativity: 1
|
|
754
|
-
},
|
|
755
|
-
"&": {
|
|
756
|
-
precedence: 18,
|
|
757
|
-
associativity: 1
|
|
758
|
-
},
|
|
759
|
-
"==": {
|
|
760
|
-
precedence: 20,
|
|
761
|
-
associativity: 1
|
|
762
|
-
},
|
|
763
|
-
"===": {
|
|
764
|
-
precedence: 20,
|
|
765
|
-
associativity: 1
|
|
766
|
-
},
|
|
767
|
-
"!=": {
|
|
768
|
-
precedence: 20,
|
|
769
|
-
associativity: 1
|
|
770
|
-
},
|
|
771
|
-
"!==": {
|
|
772
|
-
precedence: 20,
|
|
773
|
-
associativity: 1
|
|
774
|
-
},
|
|
775
|
-
"<": {
|
|
776
|
-
precedence: 20,
|
|
777
|
-
associativity: 1
|
|
778
|
-
},
|
|
779
|
-
">": {
|
|
780
|
-
precedence: 20,
|
|
781
|
-
associativity: 1
|
|
782
|
-
},
|
|
783
|
-
">=": {
|
|
784
|
-
precedence: 20,
|
|
785
|
-
associativity: 1
|
|
786
|
-
},
|
|
787
|
-
"<=": {
|
|
788
|
-
precedence: 20,
|
|
789
|
-
associativity: 1
|
|
790
|
-
},
|
|
791
|
-
"not in": {
|
|
792
|
-
precedence: 20,
|
|
793
|
-
associativity: 1
|
|
794
|
-
},
|
|
795
|
-
in: {
|
|
796
|
-
precedence: 20,
|
|
797
|
-
associativity: 1
|
|
798
|
-
},
|
|
799
|
-
matches: {
|
|
800
|
-
precedence: 20,
|
|
801
|
-
associativity: 1
|
|
802
|
-
},
|
|
803
|
-
contains: {
|
|
804
|
-
precedence: 20,
|
|
805
|
-
associativity: 1
|
|
806
|
-
},
|
|
807
|
-
"starts with": {
|
|
808
|
-
precedence: 20,
|
|
809
|
-
associativity: 1
|
|
810
|
-
},
|
|
811
|
-
"ends with": {
|
|
812
|
-
precedence: 20,
|
|
813
|
-
associativity: 1
|
|
814
|
-
},
|
|
815
|
-
"..": {
|
|
816
|
-
precedence: 25,
|
|
817
|
-
associativity: 1
|
|
818
|
-
},
|
|
819
|
-
"<<": {
|
|
820
|
-
precedence: 25,
|
|
821
|
-
associativity: 1
|
|
822
|
-
},
|
|
823
|
-
">>": {
|
|
824
|
-
precedence: 25,
|
|
825
|
-
associativity: 1
|
|
826
|
-
},
|
|
827
|
-
"+": {
|
|
828
|
-
precedence: 30,
|
|
829
|
-
associativity: 1
|
|
830
|
-
},
|
|
831
|
-
"-": {
|
|
832
|
-
precedence: 30,
|
|
833
|
-
associativity: 1
|
|
834
|
-
},
|
|
835
|
-
"~": {
|
|
836
|
-
precedence: 40,
|
|
837
|
-
associativity: 1
|
|
838
|
-
},
|
|
839
|
-
"*": {
|
|
840
|
-
precedence: 60,
|
|
841
|
-
associativity: 1
|
|
842
|
-
},
|
|
843
|
-
"/": {
|
|
844
|
-
precedence: 60,
|
|
845
|
-
associativity: 1
|
|
846
|
-
},
|
|
847
|
-
"%": {
|
|
848
|
-
precedence: 60,
|
|
849
|
-
associativity: 1
|
|
850
|
-
},
|
|
851
|
-
"**": {
|
|
852
|
-
precedence: 200,
|
|
853
|
-
associativity: 2
|
|
854
|
-
}
|
|
855
|
-
}), t(this, "parse", (e, t = [], n = 0) => {
|
|
856
|
-
this.tokenStream = e, this.names = t, this.objectMatches = {}, this.cachedNames = null, this.nestedExecutions = 0, this.flags = n;
|
|
857
|
-
let i = this.parseExpression();
|
|
858
|
-
if (!this.tokenStream.isEOF()) throw new r(`Unexpected token "${this.tokenStream.current.type}" of value "${this.tokenStream.current.value}"`, this.tokenStream.current.cursor, this.tokenStream.expression);
|
|
859
|
-
return i;
|
|
860
|
-
}), t(this, "lint", (e, t = [], n = 0) => {
|
|
861
|
-
t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), this.parse(e, t, n);
|
|
862
|
-
}), t(this, "parseExpression", (e = 0) => {
|
|
863
|
-
let t = this.getPrimary(), n = this.tokenStream.current;
|
|
864
|
-
if (this.nestedExecutions++, this.nestedExecutions > 1e3) throw Error("Way to many executions on '" + n.toString() + "' of '" + this.tokenStream.toString() + "'");
|
|
865
|
-
for (; n.test(a.OPERATOR_TYPE) && this.binaryOperators[n.value] !== void 0 && this.binaryOperators[n.value] !== null && this.binaryOperators[n.value].precedence >= e;) {
|
|
866
|
-
let e = this.binaryOperators[n.value];
|
|
867
|
-
this.tokenStream.next();
|
|
868
|
-
let r = this.parseExpression(e.associativity === 1 ? e.precedence + 1 : e.precedence);
|
|
869
|
-
t = new y(n.value, t, r), n = this.tokenStream.current;
|
|
870
|
-
}
|
|
871
|
-
return e === 0 ? this.parseConditionalExpression(t) : t;
|
|
872
|
-
}), t(this, "getPrimary", () => {
|
|
873
|
-
let e = this.tokenStream.current;
|
|
874
|
-
if (e.test(a.OPERATOR_TYPE) && this.unaryOperators[e.value] !== void 0 && this.unaryOperators[e.value] !== null) {
|
|
875
|
-
let t = this.unaryOperators[e.value];
|
|
876
|
-
this.tokenStream.next();
|
|
877
|
-
let n = this.parseExpression(t.precedence);
|
|
878
|
-
return this.parsePostfixExpression(new b(e.value, n));
|
|
879
|
-
}
|
|
880
|
-
if (e.test(a.PUNCTUATION_TYPE, "(")) {
|
|
881
|
-
this.tokenStream.next();
|
|
882
|
-
let e = this.parseExpression();
|
|
883
|
-
return this.tokenStream.expect(a.PUNCTUATION_TYPE, ")", "An opened parenthesis is not properly closed"), this.parsePostfixExpression(e);
|
|
884
|
-
}
|
|
885
|
-
return this.parsePrimaryExpression();
|
|
886
|
-
}), t(this, "hasVariable", (e) => this.getNames().indexOf(e) >= 0), t(this, "getNames", () => {
|
|
887
|
-
if (this.cachedNames !== null) return this.cachedNames;
|
|
888
|
-
if (this.names && this.names.length > 0) {
|
|
889
|
-
let e = [], t = 0;
|
|
890
|
-
this.objectMatches = {};
|
|
891
|
-
for (let n of this.names) typeof n == "object" ? (this.objectMatches[Object.values(n)[0]] = t, e.push(Object.keys(n)[0]), e.push(Object.values(n)[0])) : e.push(n), t++;
|
|
892
|
-
return this.cachedNames = e, e;
|
|
893
|
-
}
|
|
894
|
-
return [];
|
|
895
|
-
}), t(this, "parseArrayExpression", () => {
|
|
896
|
-
this.tokenStream.expect(a.PUNCTUATION_TYPE, "[", "An array element was expected");
|
|
897
|
-
let e = new T(), t = !0;
|
|
898
|
-
for (; !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "]") && (t || (this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "An array element must be followed by a comma"), !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "]")));) t = !1, e.addElement(this.parseExpression());
|
|
899
|
-
return this.tokenStream.expect(a.PUNCTUATION_TYPE, "]", "An opened array is not properly closed"), e;
|
|
900
|
-
}), t(this, "parseHashExpression", () => {
|
|
901
|
-
this.tokenStream.expect(a.PUNCTUATION_TYPE, "{", "A hash element was expected");
|
|
902
|
-
let e = new T(), t = !0;
|
|
903
|
-
for (; !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "}") && (t || (this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "A hash value must be followed by a comma"), !this.tokenStream.current.test(a.PUNCTUATION_TYPE, "}")));) {
|
|
904
|
-
t = !1;
|
|
905
|
-
let n = null;
|
|
906
|
-
if (this.tokenStream.current.test(a.STRING_TYPE) || this.tokenStream.current.test(a.NAME_TYPE) || this.tokenStream.current.test(a.NUMBER_TYPE)) n = new x(this.tokenStream.current.value), this.tokenStream.next();
|
|
907
|
-
else {
|
|
908
|
-
if (!this.tokenStream.current.test(a.PUNCTUATION_TYPE, "(")) {
|
|
909
|
-
let e = this.tokenStream.current;
|
|
910
|
-
throw new r(`A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "${e.type}" of value "${e.value}"`, e.cursor, this.tokenStream.expression);
|
|
911
|
-
}
|
|
912
|
-
n = this.parseExpression();
|
|
913
|
-
}
|
|
914
|
-
this.tokenStream.expect(a.PUNCTUATION_TYPE, ":", "A hash key must be followed by a colon (:)");
|
|
915
|
-
let i = this.parseExpression();
|
|
916
|
-
e.addElement(i, n);
|
|
917
|
-
}
|
|
918
|
-
return this.tokenStream.expect(a.PUNCTUATION_TYPE, "}", "An opened hash is not properly closed"), e;
|
|
919
|
-
}), t(this, "parsePostfixExpression", (e) => {
|
|
920
|
-
let t = this.tokenStream.current;
|
|
921
|
-
for (; a.PUNCTUATION_TYPE === t.type;) {
|
|
922
|
-
if (t.value === "." || t.value === "?.") {
|
|
923
|
-
let n = t.value === "?.";
|
|
924
|
-
if (this.tokenStream.next(), t = this.tokenStream.current, this.tokenStream.next(), a.NAME_TYPE !== t.type && (a.OPERATOR_TYPE !== t.type || !/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/.test(t.value))) throw new r("Expected name", t.cursor, this.tokenStream.expression);
|
|
925
|
-
let i = new x(t.value, !0, n), o = new E(), s = null;
|
|
926
|
-
if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "(")) {
|
|
927
|
-
s = D.METHOD_CALL;
|
|
928
|
-
for (let e of Object.values(this.parseArguments().nodes)) o.addElement(e);
|
|
929
|
-
} else s = D.PROPERTY_CALL;
|
|
930
|
-
e = new D(e, i, o, s);
|
|
931
|
-
} else {
|
|
932
|
-
if (t.value !== "[") break;
|
|
933
|
-
{
|
|
934
|
-
this.tokenStream.next();
|
|
935
|
-
let t = this.parseExpression();
|
|
936
|
-
this.tokenStream.expect(a.PUNCTUATION_TYPE, "]"), e = new D(e, t, new E(), D.ARRAY_CALL);
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
t = this.tokenStream.current;
|
|
940
|
-
}
|
|
941
|
-
return e;
|
|
942
|
-
}), t(this, "parseArguments", () => {
|
|
943
|
-
let e = [];
|
|
944
|
-
for (this.tokenStream.expect(a.PUNCTUATION_TYPE, "(", "A list of arguments must begin with an opening parenthesis"); !this.tokenStream.current.test(a.PUNCTUATION_TYPE, ")");) e.length !== 0 && this.tokenStream.expect(a.PUNCTUATION_TYPE, ",", "Arguments must be separated by a comma"), e.push(this.parseExpression());
|
|
945
|
-
return this.tokenStream.expect(a.PUNCTUATION_TYPE, ")", "A list of arguments must be closed by a parenthesis"), new v(e);
|
|
946
|
-
}), this.functions = e, this.tokenStream = null, this.names = null, this.objectMatches = {}, this.cachedNames = null, this.nestedExecutions = 0, this.flags = 0;
|
|
947
|
-
}
|
|
948
|
-
parseConditionalExpression(e) {
|
|
949
|
-
for (; this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??");) {
|
|
950
|
-
this.tokenStream.next();
|
|
951
|
-
let t = this.parseExpression();
|
|
952
|
-
e = new O(e, t);
|
|
953
|
-
}
|
|
954
|
-
for (; this.tokenStream.current.test(a.PUNCTUATION_TYPE, "?");) {
|
|
955
|
-
let t, n;
|
|
956
|
-
this.tokenStream.next(), this.tokenStream.current.test(a.PUNCTUATION_TYPE, ":") ? (this.tokenStream.next(), t = e, n = this.parseExpression()) : (t = this.parseExpression(), this.tokenStream.current.test(a.PUNCTUATION_TYPE, ":") ? (this.tokenStream.next(), n = this.parseExpression()) : t instanceof x && typeof t.attributes?.value == "string" ? n = new x("") : t instanceof S ? (n = t.nodes.expr3, t = t.nodes.expr2) : (n = t, t = e)), e = new S(e, t, n);
|
|
957
|
-
}
|
|
958
|
-
return e;
|
|
959
|
-
}
|
|
960
|
-
parsePrimaryExpression() {
|
|
961
|
-
let e = this.tokenStream.current, t = null;
|
|
962
|
-
switch (e.type) {
|
|
963
|
-
case a.NAME_TYPE:
|
|
964
|
-
switch (this.tokenStream.next(), e.value) {
|
|
965
|
-
case "true":
|
|
966
|
-
case "TRUE": return new x(!0);
|
|
967
|
-
case "false":
|
|
968
|
-
case "FALSE": return new x(!1);
|
|
969
|
-
case "null":
|
|
970
|
-
case "NULL": return new x(null);
|
|
971
|
-
default: if (this.tokenStream.current.value === "(") {
|
|
972
|
-
if (this.functions[e.value] === void 0 && !(2 & this.flags)) throw new r(`The function "${e.value}" does not exist`, e.cursor, this.tokenStream.expression, e.values, Object.keys(this.functions));
|
|
973
|
-
t = new C(e.value, this.parseArguments());
|
|
974
|
-
} else {
|
|
975
|
-
let n = null;
|
|
976
|
-
if (1 & this.flags) n = e.value;
|
|
977
|
-
else {
|
|
978
|
-
if (!this.hasVariable(e.value)) {
|
|
979
|
-
if (this.tokenStream.current.test(a.PUNCTUATION_TYPE, "??")) return new k(e.value);
|
|
980
|
-
throw new r(`Variable "${e.value}" is not valid`, e.cursor, this.tokenStream.expression, e.value, this.getNames());
|
|
981
|
-
}
|
|
982
|
-
n = e.value, this.objectMatches[n] !== void 0 && (n = this.getNames()[this.objectMatches[n]]);
|
|
983
|
-
}
|
|
984
|
-
t = new w(n);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
break;
|
|
988
|
-
case a.NUMBER_TYPE:
|
|
989
|
-
case a.STRING_TYPE: return this.tokenStream.next(), new x(e.value);
|
|
990
|
-
default: if (e.test(a.PUNCTUATION_TYPE, "[")) t = this.parseArrayExpression();
|
|
991
|
-
else {
|
|
992
|
-
if (!e.test(a.PUNCTUATION_TYPE, "{")) throw new r(`Unexpected token "${e.type}" of value "${e.value}"`, e.cursor, this.tokenStream.expression);
|
|
993
|
-
t = this.parseHashExpression();
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
return this.parsePostfixExpression(t);
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
class j {
|
|
1000
|
-
constructor(e) {
|
|
1001
|
-
t(this, "getFunction", (e) => this.functions[e]), t(this, "getSource", () => this.source), t(this, "reset", () => (this.source = "", this)), t(this, "compile", (e) => (e.compile(this), this)), t(this, "subcompile", (e) => {
|
|
1002
|
-
let t = this.source;
|
|
1003
|
-
this.source = "", e.compile(this);
|
|
1004
|
-
let n = this.source;
|
|
1005
|
-
return this.source = t, n;
|
|
1006
|
-
}), t(this, "raw", (e) => (this.source += e, this)), t(this, "string", (e) => (this.source += "\"" + _(e, "\0 \"$\\") + "\"", this)), t(this, "repr", (e, t = !1) => {
|
|
1007
|
-
if (t) this.raw(e);
|
|
1008
|
-
else if (Number.isInteger(e) || +e === e && (!isFinite(e) || e % 1)) this.raw(e);
|
|
1009
|
-
else if (e === null) this.raw("null");
|
|
1010
|
-
else if (typeof e == "boolean") this.raw(e ? "true" : "false");
|
|
1011
|
-
else if (typeof e == "object") {
|
|
1012
|
-
this.raw("{");
|
|
1013
|
-
let t = !0;
|
|
1014
|
-
for (let n of Object.keys(e)) t || this.raw(", "), t = !1, this.repr(n), this.raw(":"), this.repr(e[n]);
|
|
1015
|
-
this.raw("}");
|
|
1016
|
-
} else if (Array.isArray(e)) {
|
|
1017
|
-
this.raw("[");
|
|
1018
|
-
let t = !0;
|
|
1019
|
-
for (let n of e) t || this.raw(", "), t = !1, this.repr(n);
|
|
1020
|
-
this.raw("]");
|
|
1021
|
-
} else this.string(e);
|
|
1022
|
-
return this;
|
|
1023
|
-
}), this.source = "", this.functions = e;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
class M {
|
|
1027
|
-
constructor(e) {
|
|
1028
|
-
this.expression = e;
|
|
1029
|
-
}
|
|
1030
|
-
toString() {
|
|
1031
|
-
return this.expression;
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
class N extends M {
|
|
1035
|
-
constructor(e, n) {
|
|
1036
|
-
super(e), t(this, "getNodes", () => this.nodes), this.nodes = n;
|
|
1037
|
-
}
|
|
1038
|
-
static fromJSON(e) {
|
|
1039
|
-
let t = typeof e == "string" ? JSON.parse(e) : e, n = (e) => {
|
|
1040
|
-
if (e == null || e instanceof v || typeof e != "object" || !e.name) return e;
|
|
1041
|
-
switch (e.name) {
|
|
1042
|
-
case "ConstantNode": return new x(e.attributes?.value, !!e.isIdentifier, !!e.isNullSafe);
|
|
1043
|
-
case "NameNode": return new w(e.attributes?.name);
|
|
1044
|
-
case "NullCoalescedNameNode": return new k(e.attributes?.name);
|
|
1045
|
-
case "UnaryNode": return new b(e.attributes?.operator, n(e.nodes?.node));
|
|
1046
|
-
case "BinaryNode": return new y(e.attributes?.operator, n(e.nodes?.left), n(e.nodes?.right));
|
|
1047
|
-
case "ConditionalNode": return new S(n(e.nodes?.expr1), n(e.nodes?.expr2), n(e.nodes?.expr3));
|
|
1048
|
-
case "NullCoalesceNode": return new O(n(e.nodes?.expr1), n(e.nodes?.expr2));
|
|
1049
|
-
case "ArgumentsNode": {
|
|
1050
|
-
let t = new E();
|
|
1051
|
-
typeof e.type == "string" && (t.type = e.type), typeof e.index == "number" && (t.index = e.index), typeof e.keyIndex == "number" && (t.keyIndex = e.keyIndex), t.nodes = {};
|
|
1052
|
-
for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
|
|
1053
|
-
return t;
|
|
1054
|
-
}
|
|
1055
|
-
case "ArrayNode": {
|
|
1056
|
-
let t = new T();
|
|
1057
|
-
typeof e.type == "string" && (t.type = e.type), typeof e.index == "number" && (t.index = e.index), typeof e.keyIndex == "number" && (t.keyIndex = e.keyIndex), t.nodes = {};
|
|
1058
|
-
for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
|
|
1059
|
-
return t;
|
|
1060
|
-
}
|
|
1061
|
-
case "FunctionNode": {
|
|
1062
|
-
let t = n(e.nodes?.arguments);
|
|
1063
|
-
return new C(e.attributes?.name, t);
|
|
1064
|
-
}
|
|
1065
|
-
case "GetAttrNode": {
|
|
1066
|
-
let t = new D(n(e.nodes?.node), n(e.nodes?.attribute), n(e.nodes?.fnArguments), e.attributes?.type);
|
|
1067
|
-
return e.attributes && typeof e.attributes.is_null_coalesce == "boolean" && (t.attributes.is_null_coalesce = e.attributes.is_null_coalesce), e.attributes && typeof e.attributes.is_short_circuited == "boolean" && (t.attributes.is_short_circuited = e.attributes.is_short_circuited), t;
|
|
1068
|
-
}
|
|
1069
|
-
case "Node": {
|
|
1070
|
-
let t = new v();
|
|
1071
|
-
if (Array.isArray(e.nodes)) t.nodes = e.nodes.map(n);
|
|
1072
|
-
else {
|
|
1073
|
-
t.nodes = {};
|
|
1074
|
-
for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
|
|
1075
|
-
}
|
|
1076
|
-
return t.attributes = e.attributes || {}, t;
|
|
1077
|
-
}
|
|
1078
|
-
default: {
|
|
1079
|
-
let t = new v();
|
|
1080
|
-
if (t.name = e.name, Array.isArray(e.nodes)) t.nodes = e.nodes.map(n);
|
|
1081
|
-
else {
|
|
1082
|
-
t.nodes = {};
|
|
1083
|
-
for (let r of Object.keys(e.nodes || {})) t.nodes[r] = n(e.nodes[r]);
|
|
1084
|
-
}
|
|
1085
|
-
return t.attributes = e.attributes || {}, t;
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}, r = t.expression;
|
|
1089
|
-
return new N(r, ((e) => {
|
|
1090
|
-
if (e == null) return e;
|
|
1091
|
-
if (e.name) return n(e);
|
|
1092
|
-
if (Array.isArray(e)) return e.map(n);
|
|
1093
|
-
if (typeof e == "object") {
|
|
1094
|
-
let t = {};
|
|
1095
|
-
for (let r of Object.keys(e)) t[r] = n(e[r]);
|
|
1096
|
-
return t;
|
|
1097
|
-
}
|
|
1098
|
-
return e;
|
|
1099
|
-
})(t.nodes));
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
var P;
|
|
1103
|
-
class F {
|
|
1104
|
-
constructor(e = 0) {
|
|
1105
|
-
t(this, "createCacheItem", (e, t, n) => {
|
|
1106
|
-
let r = new I();
|
|
1107
|
-
return r.key = e, r.value = t, r.isHit = n, r.defaultLifetime = this.defaultLifetime, r;
|
|
1108
|
-
}), t(this, "get", (e, t, n = null, r = null) => {
|
|
1109
|
-
let i = this.getItem(e);
|
|
1110
|
-
return i.isHit || this.save(i.set(t(i, !0))), i.get();
|
|
1111
|
-
}), t(this, "getItem", (e) => {
|
|
1112
|
-
let t = this.hasItem(e), n = null;
|
|
1113
|
-
return t ? n = this.values[e] : this.values[e] = null, (0, this.createCacheItem)(e, n, t);
|
|
1114
|
-
}), t(this, "getItems", (e) => {
|
|
1115
|
-
for (let t of e) typeof t == "string" || this.expiries[t] || I.validateKey(t);
|
|
1116
|
-
return this.generateItems(e, (/* @__PURE__ */ new Date()).getTime() / 1e3, this.createCacheItem);
|
|
1117
|
-
}), t(this, "deleteItems", (e) => {
|
|
1118
|
-
for (let t of e) this.deleteItem(t);
|
|
1119
|
-
return !0;
|
|
1120
|
-
}), t(this, "save", (e) => !(!e instanceof I) && (e.expiry !== null && e.expiry <= (/* @__PURE__ */ new Date()).getTime() / 1e3 ? (this.deleteItem(e.key), !0) : (e.expiry === null && 0 < e.defaultLifetime && (e.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.defaultLifetime), this.values[e.key] = e.value, this.expiries[e.key] = e.expiry || 2 ** 53 - 1, !0))), t(this, "saveDeferred", (e) => this.save(e)), t(this, "commit", () => !0), t(this, "delete", (e) => this.deleteItem(e)), t(this, "getValues", () => this.values), t(this, "hasItem", (e) => !!(typeof e == "string" && this.expiries[e] && this.expiries[e] > (/* @__PURE__ */ new Date()).getTime() / 1e3) || (I.validateKey(e), !!this.expiries[e] && !this.deleteItem(e))), t(this, "clear", () => (this.values = {}, this.expiries = {}, !0)), t(this, "deleteItem", (e) => (typeof e == "string" && this.expiries[e] || I.validateKey(e), delete this.values[e], delete this.expiries[e], !0)), t(this, "reset", () => {
|
|
1121
|
-
this.clear();
|
|
1122
|
-
}), t(this, "generateItems", (e, t, n) => {
|
|
1123
|
-
let r = [];
|
|
1124
|
-
for (let i of e) {
|
|
1125
|
-
let e = null, a = !!this.expiries[i];
|
|
1126
|
-
a || !(this.expiries[i] > t) && this.deleteItem(i) ? e = this.values[i] : this.values[i] = null, r[i] = n(i, e, a);
|
|
1127
|
-
}
|
|
1128
|
-
return r;
|
|
1129
|
-
}), this.defaultLifetime = e, this.values = {}, this.expiries = {};
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
class I {
|
|
1133
|
-
constructor() {
|
|
1134
|
-
t(this, "getKey", () => this.key), t(this, "get", () => this.value), t(this, "set", (e) => (this.value = e, this)), t(this, "expiresAt", (e) => {
|
|
1135
|
-
if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
|
|
1136
|
-
else {
|
|
1137
|
-
if (!(e instanceof Date)) throw Error(`Expiration date must be instance of Date or be null, "${e.name}" given`);
|
|
1138
|
-
this.expiry = e.getTime() / 1e3;
|
|
1139
|
-
}
|
|
1140
|
-
return this;
|
|
1141
|
-
}), t(this, "expiresAfter", (e) => {
|
|
1142
|
-
if (e === null) this.expiry = this.defaultLifetime > 0 ? Date.now() / 1e3 + this.defaultLifetime : null;
|
|
1143
|
-
else {
|
|
1144
|
-
if (!Number.isInteger(e)) throw Error(`Expiration date must be an integer or be null, "${e.name}" given`);
|
|
1145
|
-
this.expiry = (/* @__PURE__ */ new Date()).getTime() / 1e3 + e;
|
|
1146
|
-
}
|
|
1147
|
-
return this;
|
|
1148
|
-
}), t(this, "tag", (e) => {
|
|
1149
|
-
if (!this.isTaggable) throw Error(`Cache item "${this.key}" comes from a non tag-aware pool: you cannot tag it.`);
|
|
1150
|
-
Array.isArray(e) || (e = [e]);
|
|
1151
|
-
for (let t of e) {
|
|
1152
|
-
if (typeof t != "string") throw Error(`Cache tag must by a string, "${typeof t}" given.`);
|
|
1153
|
-
if (this.newMetadata.tags[t] && t === "") throw Error("Cache tag length must be greater than zero");
|
|
1154
|
-
this.newMetadata.tags[t] = t;
|
|
1155
|
-
}
|
|
1156
|
-
return this;
|
|
1157
|
-
}), t(this, "getMetadata", () => this.metadata), this.key = null, this.value = null, this.isHit = !1, this.expiry = null, this.defaultLifetime = null, this.metadata = {}, this.newMetadata = {}, this.innerItem = null, this.poolHash = null, this.isTaggable = !1;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
P = I, t(I, "METADATA_EXPIRY_OFFSET", 1527506807), t(I, "RESERVED_CHARACTERS", [
|
|
1161
|
-
"{",
|
|
1162
|
-
"}",
|
|
1163
|
-
"(",
|
|
1164
|
-
")",
|
|
1165
|
-
"/",
|
|
1166
|
-
"\\",
|
|
1167
|
-
"@",
|
|
1168
|
-
":"
|
|
1169
|
-
]), t(I, "validateKey", (e) => {
|
|
1170
|
-
if (typeof e != "string") throw Error(`Cache key must be string, "${typeof e}" given.`);
|
|
1171
|
-
if (e === "") throw Error("Cache key length must be greater than zero");
|
|
1172
|
-
for (let t of P.RESERVED_CHARACTERS) if (e.indexOf(t) >= 0) throw Error(`Cache key "${e}" contains reserved character "${t}".`);
|
|
1173
|
-
return e;
|
|
1174
|
-
});
|
|
1175
|
-
class ee extends Error {
|
|
1176
|
-
constructor(e) {
|
|
1177
|
-
super(e), this.name = "LogicException";
|
|
1178
|
-
}
|
|
1179
|
-
toString() {
|
|
1180
|
-
return `${this.name}: ${this.message}`;
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
class L {
|
|
1184
|
-
constructor(e, n, r) {
|
|
1185
|
-
t(this, "getName", () => this.name), t(this, "getCompiler", () => this.compiler), t(this, "getEvaluator", () => this.evaluator), this.name = e, this.compiler = n, this.evaluator = r;
|
|
1186
|
-
}
|
|
1187
|
-
static fromJavascript(e, t = null) {
|
|
1188
|
-
if (typeof e != "string" || e.length === 0) throw TypeError("A JavaScript function name (string) must be provided.");
|
|
1189
|
-
let n = e.replace(/^\/+/, ""), r = n.split("."), i = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof l < "u" ? l : {};
|
|
1190
|
-
for (let e of r) {
|
|
1191
|
-
if (i == null) break;
|
|
1192
|
-
i = i[e];
|
|
1193
|
-
}
|
|
1194
|
-
if (typeof i != "function") throw Error(`JavaScript function "${n}" does not exist.`);
|
|
1195
|
-
if (!t && r.length > 1) throw Error(`An expression function name must be defined when JavaScript function "${n}" is namespaced.`);
|
|
1196
|
-
return new this(t || r[r.length - 1], (...e) => `${n}(${e.join(", ")})`, (e, ...t) => i(...t));
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
class R {
|
|
1200
|
-
constructor(e = null, n = []) {
|
|
1201
|
-
t(this, "compile", (e, t = []) => this.getCompiler().compile(this.parse(e, t).getNodes()).getSource()), t(this, "evaluate", (e, t = {}) => this.parse(e, Object.keys(t)).getNodes().evaluate(this.functions, t)), t(this, "parse", (e, t, n = 0) => {
|
|
1202
|
-
if (e instanceof N) return e;
|
|
1203
|
-
t.sort((e, t) => {
|
|
1204
|
-
let n = e, r = t;
|
|
1205
|
-
return typeof e == "object" && (n = Object.values(e)[0]), typeof t == "object" && (r = Object.values(t)[0]), n.localeCompare(r);
|
|
1206
|
-
});
|
|
1207
|
-
let r = [];
|
|
1208
|
-
for (let e of t) {
|
|
1209
|
-
let t = e;
|
|
1210
|
-
typeof e == "object" && (t = Object.keys(e)[0] + ":" + Object.values(e)[0]), r.push(t);
|
|
1211
|
-
}
|
|
1212
|
-
let i = this.cache.getItem(this.fixedEncodeURIComponent(e + "//" + r.join("|"))), a = i.get();
|
|
1213
|
-
return a === null && (a = new N(e, this.getParser().parse(this.getLexer().tokenize(e), t, n)), i.set(a), this.cache.save(i)), a;
|
|
1214
|
-
}), t(this, "lint", (e, t = null, n = 0) => {
|
|
1215
|
-
t === null && (console.log("Deprecated: passing \"null\" as the second argument of lint is deprecated, pass IGNORE_UNKNOWN_VARIABLES instead as the third argument"), n |= 1, t = []), e instanceof N || this.getParser().lint(this.getLexer().tokenize(e), t, n);
|
|
1216
|
-
}), t(this, "fixedEncodeURIComponent", (e) => encodeURIComponent(e).replace(/[!'()*]/g, function(e) {
|
|
1217
|
-
return "%" + e.charCodeAt(0).toString(16);
|
|
1218
|
-
})), t(this, "register", (e, t, n) => {
|
|
1219
|
-
if (this.parser !== null) throw new ee("Registering functions after calling evaluate(), compile(), or parse() is not supported.");
|
|
1220
|
-
this.functions[e] = {
|
|
1221
|
-
compiler: t,
|
|
1222
|
-
evaluator: n
|
|
1223
|
-
};
|
|
1224
|
-
}), t(this, "addFunction", (e) => {
|
|
1225
|
-
this.register(e.getName(), e.getCompiler(), e.getEvaluator());
|
|
1226
|
-
}), t(this, "registerProvider", (e) => {
|
|
1227
|
-
for (let t of e.getFunctions()) this.addFunction(t);
|
|
1228
|
-
}), t(this, "getLexer", () => (this.lexer === null && (this.lexer = { tokenize: o }), this.lexer)), t(this, "getParser", () => (this.parser === null && (this.parser = new A(this.functions)), this.parser)), t(this, "getCompiler", () => (this.compiler === null && (this.compiler = new j(this.functions)), this.compiler.reset())), this.functions = [], this.lexer = null, this.parser = null, this.compiler = null, this.cache = e || new F(), this._registerBuiltinFunctions();
|
|
1229
|
-
for (let e of n) this.registerProvider(e);
|
|
1230
|
-
}
|
|
1231
|
-
_registerBuiltinFunctions() {
|
|
1232
|
-
let e = L.fromJavascript("Math.min", "min"), t = L.fromJavascript("Math.max", "max");
|
|
1233
|
-
this.addFunction(e), this.addFunction(t), this.addFunction(new L("constant", function(e) {
|
|
1234
|
-
return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));return __n.split('.').reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
|
|
1235
|
-
}, function(e, t) {
|
|
1236
|
-
if (typeof t != "string" || !t) return;
|
|
1237
|
-
let n = (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof l < "u" ? l : {}, t.split(".").reduce((e, t) => e?.[t], r));
|
|
1238
|
-
var r;
|
|
1239
|
-
return n === void 0 && e && Object.prototype.hasOwnProperty.call(e, t) && (n = e[t]), n;
|
|
1240
|
-
})), this.addFunction(new L("enum", function(e) {
|
|
1241
|
-
return `(function(__n){var __g=(typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:(typeof global!=='undefined'?global:{})));if(typeof __n!=='string'||!__n)return undefined;var s=String(__n);var keys=[],buf='';for(var i=0;i<s.length;i++){var c=s.charCodeAt(i);if(c===46||c===92){if(buf){keys.push(buf);buf='';}continue;}if(c===58){if(i+1<s.length&&s.charCodeAt(i+1)===58){if(buf){keys.push(buf);buf='';}i++;continue;}}buf+=s[i];}if(buf)keys.push(buf);return keys.reduce(function(o,k){return o==null?undefined:o[k];}, __g)})(${e})`;
|
|
1242
|
-
}, function(e, t) {
|
|
1243
|
-
if (typeof t != "string" || !t) return;
|
|
1244
|
-
let n = String(t).replace(/\\/g, ".").replace(/::/g, ".");
|
|
1245
|
-
var r;
|
|
1246
|
-
return n ? (r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof l < "u" ? l : {}, n.split(".").reduce((e, t) => e?.[t], r)) : void 0;
|
|
1247
|
-
}));
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
class z {
|
|
1251
|
-
getFunctions() {
|
|
1252
|
-
throw Error("getFunctions must be implemented by " + this.name);
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
let te = new L("isset", function(e) {
|
|
1256
|
-
return `isset(${e})`;
|
|
1257
|
-
}, function(e, t) {
|
|
1258
|
-
if (typeof t != "string") return t != null;
|
|
1259
|
-
if (!(t.split(/[.\[]/)[0] in e)) return !0;
|
|
1260
|
-
let n = "", r = [], i = "", a = "";
|
|
1261
|
-
for (let e = 0; e < t.length; e++) {
|
|
1262
|
-
let o = t[e];
|
|
1263
|
-
if (o !== "]") if (o !== "[") {
|
|
1264
|
-
if (i === "object" && (!/[A-z0-9_]/.test(o) || e === t.length - 1)) {
|
|
1265
|
-
let n = !1;
|
|
1266
|
-
if (e === t.length - 1 && (a += o, n = !0), i = "", r.push({
|
|
1267
|
-
type: "object",
|
|
1268
|
-
attribute: a
|
|
1269
|
-
}), a = "", n) continue;
|
|
1270
|
-
}
|
|
1271
|
-
o === "." ? (i = "object", a = "") : i ? a += o : n += o;
|
|
1272
|
-
} else i = "array", a = "";
|
|
1273
|
-
else i = "", r.push({
|
|
1274
|
-
type: "array",
|
|
1275
|
-
index: a.replace(/"/g, "").replace(/'/g, "")
|
|
1276
|
-
}), a = "";
|
|
1277
|
-
}
|
|
1278
|
-
if (r.length > 0) {
|
|
1279
|
-
if (e[n] !== void 0) {
|
|
1280
|
-
let t = e[n];
|
|
1281
|
-
for (let e of r) {
|
|
1282
|
-
if (e.type === "array") {
|
|
1283
|
-
if (t[e.index] === void 0) return !1;
|
|
1284
|
-
t = t[e.index];
|
|
1285
|
-
}
|
|
1286
|
-
if (e.type === "object") {
|
|
1287
|
-
if (t[e.attribute] === void 0) return !1;
|
|
1288
|
-
t = t[e.attribute];
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
return !0;
|
|
1292
|
-
}
|
|
1293
|
-
return !1;
|
|
1294
|
-
}
|
|
1295
|
-
return e[n] !== void 0;
|
|
1296
|
-
}), B = (e) => Object.entries(e);
|
|
1297
|
-
function V(e) {
|
|
1298
|
-
return typeof e == "object" && !!e;
|
|
1299
|
-
}
|
|
1300
|
-
function H(e) {
|
|
1301
|
-
return V(e) && !(function(e) {
|
|
1302
|
-
return Array.isArray(e);
|
|
1303
|
-
})(e);
|
|
1304
|
-
}
|
|
1305
|
-
function U(e) {
|
|
1306
|
-
return (function(e) {
|
|
1307
|
-
return V(e);
|
|
1308
|
-
})(e) ? e : {};
|
|
1309
|
-
}
|
|
1310
|
-
let W = typeof window == "object" && window !== null ? window : typeof l == "object" && l ? l : {};
|
|
1311
|
-
function ne() {
|
|
1312
|
-
let e = (() => {
|
|
1313
|
-
let e = W.$locutus;
|
|
1314
|
-
typeof e == "object" && e || (e = {}, W.$locutus = e);
|
|
1315
|
-
let t = e.php;
|
|
1316
|
-
return typeof t == "object" && t || (t = {}, e.php = t), t;
|
|
1317
|
-
})(), t = e.ini, n = e.locales, r = e.localeCategories, i = e.pointers, a = H(t) ? t : {}, o = ((e) => H(e))(n) ? n : {}, s = ((e) => H(e))(r) ? r : {}, c = Array.isArray(i) ? i : [];
|
|
1318
|
-
t !== a && (e.ini = a), n !== o && (e.locales = o), r !== s && (e.localeCategories = s), i !== c && (e.pointers = c);
|
|
1319
|
-
let l = e.locale_default;
|
|
1320
|
-
return {
|
|
1321
|
-
ini: a,
|
|
1322
|
-
locales: o,
|
|
1323
|
-
localeCategories: s,
|
|
1324
|
-
pointers: c,
|
|
1325
|
-
locale_default: typeof l == "string" ? l : void 0
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
function G(e) {
|
|
1329
|
-
let t = ne().ini[e];
|
|
1330
|
-
return t && t.local_value !== void 0 ? t.local_value === null ? "" : String(t.local_value) : "";
|
|
1331
|
-
}
|
|
1332
|
-
function re(e, t, n) {
|
|
1333
|
-
let r = (function(e) {
|
|
1334
|
-
if (typeof e == "boolean") return e ? "1" : "";
|
|
1335
|
-
if (typeof e == "string") return e;
|
|
1336
|
-
if (typeof e == "number") return isNaN(e) ? "NAN" : isFinite(e) ? e + "" : (e < 0 ? "-" : "") + "INF";
|
|
1337
|
-
if (e === void 0) return "";
|
|
1338
|
-
if (typeof e == "object") return Array.isArray(e) ? "Array" : e === null ? "" : "Object";
|
|
1339
|
-
throw Error("Unsupported value type");
|
|
1340
|
-
})(e), i = G("unicode.semantics") === "on" ? r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || [] : null, a = i ? i.length : r.length, o = a;
|
|
1341
|
-
return t < 0 && (t += o), n !== void 0 && (o = n < 0 ? n + o : n + t), !(t > a || t < 0 || t > o) && (i ? i.slice(t, o).join("") : r.slice(t, o));
|
|
1342
|
-
}
|
|
1343
|
-
function ie(e, ...t) {
|
|
1344
|
-
let n = {};
|
|
1345
|
-
if (t.length < 1) return n;
|
|
1346
|
-
let r = U(e);
|
|
1347
|
-
e: for (let [e, i] of B(r)) {
|
|
1348
|
-
for (let e of t) {
|
|
1349
|
-
let t = U(e), n = !1;
|
|
1350
|
-
for (let [, e] of B(t)) if (e === i) {
|
|
1351
|
-
n = !0;
|
|
1352
|
-
break;
|
|
1353
|
-
}
|
|
1354
|
-
if (!n) continue e;
|
|
1355
|
-
}
|
|
1356
|
-
n[e] = i;
|
|
1357
|
-
}
|
|
1358
|
-
return n;
|
|
1359
|
-
}
|
|
1360
|
-
let K = (e) => {
|
|
1361
|
-
if (!e || typeof e != "object") return !1;
|
|
1362
|
-
let t = Object.getPrototypeOf(e);
|
|
1363
|
-
return t === Array.prototype || t === Object.prototype;
|
|
1364
|
-
};
|
|
1365
|
-
function q(e, t = 0) {
|
|
1366
|
-
let n = 0;
|
|
1367
|
-
if (e == null) return 0;
|
|
1368
|
-
if (typeof e != "object") return 1;
|
|
1369
|
-
let r = Object.getPrototypeOf(e);
|
|
1370
|
-
if (r !== Array.prototype && r !== Object.prototype) return 1;
|
|
1371
|
-
let i = t === "COUNT_RECURSIVE" || t === 1;
|
|
1372
|
-
if (Array.isArray(e)) {
|
|
1373
|
-
for (let t of Object.keys(e)) {
|
|
1374
|
-
n++;
|
|
1375
|
-
let r = e[Number(t)];
|
|
1376
|
-
i && K(r) && (n += q(r, 1));
|
|
1377
|
-
}
|
|
1378
|
-
return n;
|
|
1379
|
-
}
|
|
1380
|
-
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
1381
|
-
n++;
|
|
1382
|
-
let r = e[t];
|
|
1383
|
-
i && K(r) && (n += q(r, 1));
|
|
1384
|
-
}
|
|
1385
|
-
return n;
|
|
1386
|
-
}
|
|
1387
|
-
let ae = new L("implode", function(e, t) {
|
|
1388
|
-
return `implode(${e}, ${t})`;
|
|
1389
|
-
}, function(e, t, n) {
|
|
1390
|
-
return (function(...e) {
|
|
1391
|
-
let t, n = "", r = "", i = "";
|
|
1392
|
-
if (e.length === 1) {
|
|
1393
|
-
let [n] = e;
|
|
1394
|
-
t = n;
|
|
1395
|
-
} else {
|
|
1396
|
-
let [n, r] = e;
|
|
1397
|
-
i = String(n ?? ""), t = r;
|
|
1398
|
-
}
|
|
1399
|
-
if (typeof t == "object" && t) {
|
|
1400
|
-
if (Array.isArray(t)) return t.join(i);
|
|
1401
|
-
for (let e in t) n += r + t[e], r = i;
|
|
1402
|
-
return n;
|
|
1403
|
-
}
|
|
1404
|
-
return String(t);
|
|
1405
|
-
})(t, n);
|
|
1406
|
-
}), oe = new L("count", function(e, t) {
|
|
1407
|
-
let n = "";
|
|
1408
|
-
return t && (n = `, ${t}`), `count(${e}${n})`;
|
|
1409
|
-
}, function(e, t, n) {
|
|
1410
|
-
return q(t, n);
|
|
1411
|
-
}), se = new L("array_intersect", function(e, ...t) {
|
|
1412
|
-
let n = "";
|
|
1413
|
-
return t.length > 0 && (n = ", " + t.join(", ")), `array_intersect(${e}${n})`;
|
|
1414
|
-
}, function(e) {
|
|
1415
|
-
let t = [], n = !0;
|
|
1416
|
-
for (let e = 1; e < arguments.length; e++) t.push(arguments[e]), Array.isArray(arguments[e]) || (n = !1);
|
|
1417
|
-
let r = ie.apply(null, t);
|
|
1418
|
-
return n ? Object.values(r) : r;
|
|
1419
|
-
});
|
|
1420
|
-
function ce(e, t) {
|
|
1421
|
-
let n, r = /* @__PURE__ */ new Date(), i = [
|
|
1422
|
-
"Sun",
|
|
1423
|
-
"Mon",
|
|
1424
|
-
"Tues",
|
|
1425
|
-
"Wednes",
|
|
1426
|
-
"Thurs",
|
|
1427
|
-
"Fri",
|
|
1428
|
-
"Satur",
|
|
1429
|
-
"January",
|
|
1430
|
-
"February",
|
|
1431
|
-
"March",
|
|
1432
|
-
"April",
|
|
1433
|
-
"May",
|
|
1434
|
-
"June",
|
|
1435
|
-
"July",
|
|
1436
|
-
"August",
|
|
1437
|
-
"September",
|
|
1438
|
-
"October",
|
|
1439
|
-
"November",
|
|
1440
|
-
"December"
|
|
1441
|
-
], a = /\\?(.?)/gi, o = function(e, t) {
|
|
1442
|
-
return r = e, Object.prototype.hasOwnProperty.call(n, r) ? String(n[e]()) : t;
|
|
1443
|
-
var r;
|
|
1444
|
-
}, s = function(e, t) {
|
|
1445
|
-
let n = String(e);
|
|
1446
|
-
for (; n.length < t;) n = "0" + n;
|
|
1447
|
-
return n;
|
|
1448
|
-
};
|
|
1449
|
-
return n = {
|
|
1450
|
-
d: function() {
|
|
1451
|
-
return s(n.j(), 2);
|
|
1452
|
-
},
|
|
1453
|
-
D: function() {
|
|
1454
|
-
return String(n.l()).slice(0, 3);
|
|
1455
|
-
},
|
|
1456
|
-
j: function() {
|
|
1457
|
-
return r.getDate();
|
|
1458
|
-
},
|
|
1459
|
-
l: function() {
|
|
1460
|
-
return (i[Number(n.w())] ?? "") + "day";
|
|
1461
|
-
},
|
|
1462
|
-
N: function() {
|
|
1463
|
-
return Number(n.w()) || 7;
|
|
1464
|
-
},
|
|
1465
|
-
S: function() {
|
|
1466
|
-
let e = Number(n.j()), t = e % 10;
|
|
1467
|
-
return t <= 3 && Number.parseInt(String(e % 100 / 10), 10) === 1 && (t = 0), [
|
|
1468
|
-
"st",
|
|
1469
|
-
"nd",
|
|
1470
|
-
"rd"
|
|
1471
|
-
][t - 1] || "th";
|
|
1472
|
-
},
|
|
1473
|
-
w: function() {
|
|
1474
|
-
return r.getDay();
|
|
1475
|
-
},
|
|
1476
|
-
z: function() {
|
|
1477
|
-
let e = new Date(Number(n.Y()), Number(n.n()) - 1, Number(n.j())), t = new Date(Number(n.Y()), 0, 1);
|
|
1478
|
-
return Math.round((e.getTime() - t.getTime()) / 864e5);
|
|
1479
|
-
},
|
|
1480
|
-
W: function() {
|
|
1481
|
-
let e = new Date(Number(n.Y()), Number(n.n()) - 1, Number(n.j()) - Number(n.N()) + 3), t = new Date(e.getFullYear(), 0, 4);
|
|
1482
|
-
return s(1 + Math.round((e.getTime() - t.getTime()) / 864e5 / 7), 2);
|
|
1483
|
-
},
|
|
1484
|
-
F: function() {
|
|
1485
|
-
return i[6 + Number(n.n())] ?? "";
|
|
1486
|
-
},
|
|
1487
|
-
m: function() {
|
|
1488
|
-
return s(n.n(), 2);
|
|
1489
|
-
},
|
|
1490
|
-
M: function() {
|
|
1491
|
-
return String(n.F()).slice(0, 3);
|
|
1492
|
-
},
|
|
1493
|
-
n: function() {
|
|
1494
|
-
return r.getMonth() + 1;
|
|
1495
|
-
},
|
|
1496
|
-
t: function() {
|
|
1497
|
-
return new Date(Number(n.Y()), Number(n.n()), 0).getDate();
|
|
1498
|
-
},
|
|
1499
|
-
L: function() {
|
|
1500
|
-
let e = Number(n.Y());
|
|
1501
|
-
return +(e % 4 == 0 && e % 100 != 0 || e % 400 == 0);
|
|
1502
|
-
},
|
|
1503
|
-
o: function() {
|
|
1504
|
-
let e = Number(n.n()), t = Number(n.W());
|
|
1505
|
-
return Number(n.Y()) + (e === 12 && t < 9 ? 1 : e === 1 && t > 9 ? -1 : 0);
|
|
1506
|
-
},
|
|
1507
|
-
Y: function() {
|
|
1508
|
-
return r.getFullYear();
|
|
1509
|
-
},
|
|
1510
|
-
y: function() {
|
|
1511
|
-
return String(n.Y()).slice(-2);
|
|
1512
|
-
},
|
|
1513
|
-
a: function() {
|
|
1514
|
-
return r.getHours() > 11 ? "pm" : "am";
|
|
1515
|
-
},
|
|
1516
|
-
A: function() {
|
|
1517
|
-
return String(n.a()).toUpperCase();
|
|
1518
|
-
},
|
|
1519
|
-
B: function() {
|
|
1520
|
-
let e = 3600 * r.getUTCHours(), t = 60 * r.getUTCMinutes(), n = r.getUTCSeconds();
|
|
1521
|
-
return s(Math.floor((e + t + n + 3600) / 86.4) % 1e3, 3);
|
|
1522
|
-
},
|
|
1523
|
-
g: function() {
|
|
1524
|
-
return Number(n.G()) % 12 || 12;
|
|
1525
|
-
},
|
|
1526
|
-
G: function() {
|
|
1527
|
-
return r.getHours();
|
|
1528
|
-
},
|
|
1529
|
-
h: function() {
|
|
1530
|
-
return s(n.g(), 2);
|
|
1531
|
-
},
|
|
1532
|
-
H: function() {
|
|
1533
|
-
return s(n.G(), 2);
|
|
1534
|
-
},
|
|
1535
|
-
i: function() {
|
|
1536
|
-
return s(r.getMinutes(), 2);
|
|
1537
|
-
},
|
|
1538
|
-
s: function() {
|
|
1539
|
-
return s(r.getSeconds(), 2);
|
|
1540
|
-
},
|
|
1541
|
-
u: function() {
|
|
1542
|
-
return s(1e3 * r.getMilliseconds(), 6);
|
|
1543
|
-
},
|
|
1544
|
-
e: function() {
|
|
1545
|
-
throw Error("Not supported (see source code of date() for timezone on how to add support)");
|
|
1546
|
-
},
|
|
1547
|
-
I: function() {
|
|
1548
|
-
let e = new Date(Number(n.Y()), 0), t = Date.UTC(Number(n.Y()), 0), r = new Date(Number(n.Y()), 6), i = Date.UTC(Number(n.Y()), 6);
|
|
1549
|
-
return e.getTime() - t === r.getTime() - i ? 0 : 1;
|
|
1550
|
-
},
|
|
1551
|
-
O: function() {
|
|
1552
|
-
let e = r.getTimezoneOffset(), t = Math.abs(e);
|
|
1553
|
-
return (e > 0 ? "-" : "+") + s(100 * Math.floor(t / 60) + t % 60, 4);
|
|
1554
|
-
},
|
|
1555
|
-
P: function() {
|
|
1556
|
-
let e = String(n.O());
|
|
1557
|
-
return e.slice(0, 3) + ":" + e.slice(3, 5);
|
|
1558
|
-
},
|
|
1559
|
-
T: function() {
|
|
1560
|
-
return "UTC";
|
|
1561
|
-
},
|
|
1562
|
-
Z: function() {
|
|
1563
|
-
return 60 * -r.getTimezoneOffset();
|
|
1564
|
-
},
|
|
1565
|
-
c: function() {
|
|
1566
|
-
return "Y-m-d\\TH:i:sP".replace(a, o);
|
|
1567
|
-
},
|
|
1568
|
-
r: function() {
|
|
1569
|
-
return "D, d M Y H:i:s O".replace(a, o);
|
|
1570
|
-
},
|
|
1571
|
-
U: function() {
|
|
1572
|
-
return r.getTime() / 1e3 | 0;
|
|
1573
|
-
}
|
|
1574
|
-
}, c = e, r = (l = t) === void 0 ? /* @__PURE__ */ new Date() : l instanceof Date ? new Date(l) : /* @__PURE__ */ new Date(1e3 * Number(l)), c.replace(a, o);
|
|
1575
|
-
var c, l;
|
|
1576
|
-
}
|
|
1577
|
-
function J(e, t) {
|
|
1578
|
-
switch (t?.toLowerCase()) {
|
|
1579
|
-
case "a":
|
|
1580
|
-
e += e === 12 ? -12 : 0;
|
|
1581
|
-
break;
|
|
1582
|
-
case "p": e += e === 12 ? 0 : 12;
|
|
1583
|
-
}
|
|
1584
|
-
return e;
|
|
1585
|
-
}
|
|
1586
|
-
function Y(e) {
|
|
1587
|
-
let t = +e;
|
|
1588
|
-
return e.length < 4 && t < 100 && (t += t < 70 ? 2e3 : 1900), t;
|
|
1589
|
-
}
|
|
1590
|
-
function X(e) {
|
|
1591
|
-
return {
|
|
1592
|
-
jan: 0,
|
|
1593
|
-
january: 0,
|
|
1594
|
-
i: 0,
|
|
1595
|
-
feb: 1,
|
|
1596
|
-
february: 1,
|
|
1597
|
-
ii: 1,
|
|
1598
|
-
mar: 2,
|
|
1599
|
-
march: 2,
|
|
1600
|
-
iii: 2,
|
|
1601
|
-
apr: 3,
|
|
1602
|
-
april: 3,
|
|
1603
|
-
iv: 3,
|
|
1604
|
-
may: 4,
|
|
1605
|
-
v: 4,
|
|
1606
|
-
jun: 5,
|
|
1607
|
-
june: 5,
|
|
1608
|
-
vi: 5,
|
|
1609
|
-
jul: 6,
|
|
1610
|
-
july: 6,
|
|
1611
|
-
vii: 6,
|
|
1612
|
-
aug: 7,
|
|
1613
|
-
august: 7,
|
|
1614
|
-
viii: 7,
|
|
1615
|
-
sep: 8,
|
|
1616
|
-
sept: 8,
|
|
1617
|
-
september: 8,
|
|
1618
|
-
ix: 8,
|
|
1619
|
-
oct: 9,
|
|
1620
|
-
october: 9,
|
|
1621
|
-
x: 9,
|
|
1622
|
-
nov: 10,
|
|
1623
|
-
november: 10,
|
|
1624
|
-
xi: 10,
|
|
1625
|
-
dec: 11,
|
|
1626
|
-
december: 11,
|
|
1627
|
-
xii: 11
|
|
1628
|
-
}[e.toLowerCase()] ?? NaN;
|
|
1629
|
-
}
|
|
1630
|
-
function Z(e, t = 0) {
|
|
1631
|
-
return {
|
|
1632
|
-
mon: 1,
|
|
1633
|
-
monday: 1,
|
|
1634
|
-
tue: 2,
|
|
1635
|
-
tuesday: 2,
|
|
1636
|
-
wed: 3,
|
|
1637
|
-
wednesday: 3,
|
|
1638
|
-
thu: 4,
|
|
1639
|
-
thursday: 4,
|
|
1640
|
-
fri: 5,
|
|
1641
|
-
friday: 5,
|
|
1642
|
-
sat: 6,
|
|
1643
|
-
saturday: 6,
|
|
1644
|
-
sun: 0,
|
|
1645
|
-
sunday: 0
|
|
1646
|
-
}[e.toLowerCase()] || t;
|
|
1647
|
-
}
|
|
1648
|
-
function Q(e, t = NaN) {
|
|
1649
|
-
let n = e?.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i);
|
|
1650
|
-
if (!n) return t;
|
|
1651
|
-
let r = n[1] === "-" ? -1 : 1, i = +(n[2] ?? 0), a = +(n[4] ?? 0);
|
|
1652
|
-
return n[4] || n[3] || (a = Math.floor(i % 100), i = Math.floor(i / 100)), r * (60 * i + a) * 60;
|
|
1653
|
-
}
|
|
1654
|
-
let le = {
|
|
1655
|
-
acdt: 37800,
|
|
1656
|
-
acst: 34200,
|
|
1657
|
-
addt: -7200,
|
|
1658
|
-
adt: -10800,
|
|
1659
|
-
aedt: 39600,
|
|
1660
|
-
aest: 36e3,
|
|
1661
|
-
ahdt: -32400,
|
|
1662
|
-
ahst: -36e3,
|
|
1663
|
-
akdt: -28800,
|
|
1664
|
-
akst: -32400,
|
|
1665
|
-
amt: -13840,
|
|
1666
|
-
apt: -10800,
|
|
1667
|
-
ast: -14400,
|
|
1668
|
-
awdt: 32400,
|
|
1669
|
-
awst: 28800,
|
|
1670
|
-
awt: -10800,
|
|
1671
|
-
bdst: 7200,
|
|
1672
|
-
bdt: -36e3,
|
|
1673
|
-
bmt: -14309,
|
|
1674
|
-
bst: 3600,
|
|
1675
|
-
cast: 34200,
|
|
1676
|
-
cat: 7200,
|
|
1677
|
-
cddt: -14400,
|
|
1678
|
-
cdt: -18e3,
|
|
1679
|
-
cemt: 10800,
|
|
1680
|
-
cest: 7200,
|
|
1681
|
-
cet: 3600,
|
|
1682
|
-
cmt: -15408,
|
|
1683
|
-
cpt: -18e3,
|
|
1684
|
-
cst: -21600,
|
|
1685
|
-
cwt: -18e3,
|
|
1686
|
-
chst: 36e3,
|
|
1687
|
-
dmt: -1521,
|
|
1688
|
-
eat: 10800,
|
|
1689
|
-
eddt: -10800,
|
|
1690
|
-
edt: -14400,
|
|
1691
|
-
eest: 10800,
|
|
1692
|
-
eet: 7200,
|
|
1693
|
-
emt: -26248,
|
|
1694
|
-
ept: -14400,
|
|
1695
|
-
est: -18e3,
|
|
1696
|
-
ewt: -14400,
|
|
1697
|
-
ffmt: -14660,
|
|
1698
|
-
fmt: -4056,
|
|
1699
|
-
gdt: 39600,
|
|
1700
|
-
gmt: 0,
|
|
1701
|
-
gst: 36e3,
|
|
1702
|
-
hdt: -34200,
|
|
1703
|
-
hkst: 32400,
|
|
1704
|
-
hkt: 28800,
|
|
1705
|
-
hmt: -19776,
|
|
1706
|
-
hpt: -34200,
|
|
1707
|
-
hst: -36e3,
|
|
1708
|
-
hwt: -34200,
|
|
1709
|
-
iddt: 14400,
|
|
1710
|
-
idt: 10800,
|
|
1711
|
-
imt: 25025,
|
|
1712
|
-
ist: 7200,
|
|
1713
|
-
jdt: 36e3,
|
|
1714
|
-
jmt: 8440,
|
|
1715
|
-
jst: 32400,
|
|
1716
|
-
kdt: 36e3,
|
|
1717
|
-
kmt: 5736,
|
|
1718
|
-
kst: 30600,
|
|
1719
|
-
lst: 9394,
|
|
1720
|
-
mddt: -18e3,
|
|
1721
|
-
mdst: 16279,
|
|
1722
|
-
mdt: -21600,
|
|
1723
|
-
mest: 7200,
|
|
1724
|
-
met: 3600,
|
|
1725
|
-
mmt: 9017,
|
|
1726
|
-
mpt: -21600,
|
|
1727
|
-
msd: 14400,
|
|
1728
|
-
msk: 10800,
|
|
1729
|
-
mst: -25200,
|
|
1730
|
-
mwt: -21600,
|
|
1731
|
-
nddt: -5400,
|
|
1732
|
-
ndt: -9052,
|
|
1733
|
-
npt: -9e3,
|
|
1734
|
-
nst: -12600,
|
|
1735
|
-
nwt: -9e3,
|
|
1736
|
-
nzdt: 46800,
|
|
1737
|
-
nzmt: 41400,
|
|
1738
|
-
nzst: 43200,
|
|
1739
|
-
pddt: -21600,
|
|
1740
|
-
pdt: -25200,
|
|
1741
|
-
pkst: 21600,
|
|
1742
|
-
pkt: 18e3,
|
|
1743
|
-
plmt: 25590,
|
|
1744
|
-
pmt: -13236,
|
|
1745
|
-
ppmt: -17340,
|
|
1746
|
-
ppt: -25200,
|
|
1747
|
-
pst: -28800,
|
|
1748
|
-
pwt: -25200,
|
|
1749
|
-
qmt: -18840,
|
|
1750
|
-
rmt: 5794,
|
|
1751
|
-
sast: 7200,
|
|
1752
|
-
sdmt: -16800,
|
|
1753
|
-
sjmt: -20173,
|
|
1754
|
-
smt: -13884,
|
|
1755
|
-
sst: -39600,
|
|
1756
|
-
tbmt: 10751,
|
|
1757
|
-
tmt: 12344,
|
|
1758
|
-
uct: 0,
|
|
1759
|
-
utc: 0,
|
|
1760
|
-
wast: 7200,
|
|
1761
|
-
wat: 3600,
|
|
1762
|
-
wemt: 7200,
|
|
1763
|
-
west: 3600,
|
|
1764
|
-
wet: 0,
|
|
1765
|
-
wib: 25200,
|
|
1766
|
-
wita: 28800,
|
|
1767
|
-
wit: 32400,
|
|
1768
|
-
wmt: 5040,
|
|
1769
|
-
yddt: -25200,
|
|
1770
|
-
ydt: -28800,
|
|
1771
|
-
ypt: -28800,
|
|
1772
|
-
yst: -32400,
|
|
1773
|
-
ywt: -28800,
|
|
1774
|
-
a: 3600,
|
|
1775
|
-
b: 7200,
|
|
1776
|
-
c: 10800,
|
|
1777
|
-
d: 14400,
|
|
1778
|
-
e: 18e3,
|
|
1779
|
-
f: 21600,
|
|
1780
|
-
g: 25200,
|
|
1781
|
-
h: 28800,
|
|
1782
|
-
i: 32400,
|
|
1783
|
-
k: 36e3,
|
|
1784
|
-
l: 39600,
|
|
1785
|
-
m: 43200,
|
|
1786
|
-
n: -3600,
|
|
1787
|
-
o: -7200,
|
|
1788
|
-
p: -10800,
|
|
1789
|
-
q: -14400,
|
|
1790
|
-
r: -18e3,
|
|
1791
|
-
s: -21600,
|
|
1792
|
-
t: -25200,
|
|
1793
|
-
u: -28800,
|
|
1794
|
-
v: -32400,
|
|
1795
|
-
w: -36e3,
|
|
1796
|
-
x: -39600,
|
|
1797
|
-
y: -43200,
|
|
1798
|
-
z: 0
|
|
1799
|
-
}, $ = {
|
|
1800
|
-
yesterday: {
|
|
1801
|
-
regex: /^yesterday/i,
|
|
1802
|
-
name: "yesterday",
|
|
1803
|
-
callback() {
|
|
1804
|
-
return --this.rd, this.resetTime();
|
|
1805
|
-
}
|
|
1806
|
-
},
|
|
1807
|
-
now: {
|
|
1808
|
-
regex: /^now/i,
|
|
1809
|
-
name: "now"
|
|
1810
|
-
},
|
|
1811
|
-
noon: {
|
|
1812
|
-
regex: /^noon/i,
|
|
1813
|
-
name: "noon",
|
|
1814
|
-
callback() {
|
|
1815
|
-
return this.resetTime() && this.time(12, 0, 0, 0);
|
|
1816
|
-
}
|
|
1817
|
-
},
|
|
1818
|
-
midnightOrToday: {
|
|
1819
|
-
regex: /^(midnight|today)/i,
|
|
1820
|
-
name: "midnight | today",
|
|
1821
|
-
callback() {
|
|
1822
|
-
return this.resetTime();
|
|
1823
|
-
}
|
|
1824
|
-
},
|
|
1825
|
-
tomorrow: {
|
|
1826
|
-
regex: /^tomorrow/i,
|
|
1827
|
-
name: "tomorrow",
|
|
1828
|
-
callback() {
|
|
1829
|
-
return this.rd += 1, this.resetTime();
|
|
1830
|
-
}
|
|
1831
|
-
},
|
|
1832
|
-
timestamp: {
|
|
1833
|
-
regex: /^@(-?\d+)/i,
|
|
1834
|
-
name: "timestamp",
|
|
1835
|
-
callback(e, t) {
|
|
1836
|
-
return this.rs += +t, this.y = 1970, this.m = 0, this.d = 1, this.dates = 0, this.resetTime() && this.zone(0);
|
|
1837
|
-
}
|
|
1838
|
-
},
|
|
1839
|
-
firstOrLastDay: {
|
|
1840
|
-
regex: /^(first|last) day of/i,
|
|
1841
|
-
name: "firstdayof | lastdayof",
|
|
1842
|
-
callback(e, t) {
|
|
1843
|
-
t.toLowerCase() === "first" ? this.firstOrLastDayOfMonth = 1 : this.firstOrLastDayOfMonth = -1;
|
|
1844
|
-
}
|
|
1845
|
-
},
|
|
1846
|
-
backOrFrontOf: {
|
|
1847
|
-
regex: /* @__PURE__ */ RegExp("^(back|front) of (2[0-4]|[01]?[0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))?", "i"),
|
|
1848
|
-
name: "backof | frontof",
|
|
1849
|
-
callback(e, t, n, r) {
|
|
1850
|
-
let i = +n, a = 15;
|
|
1851
|
-
return t.toLowerCase() === "back" || (--i, a = 45), i = J(i, r), this.resetTime() && this.time(i, a, 0, 0);
|
|
1852
|
-
}
|
|
1853
|
-
},
|
|
1854
|
-
mssqltime: {
|
|
1855
|
-
regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2]):([0-5][0-9]):(60|[0-5][0-9])[:.]([0-9]+)(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
1856
|
-
name: "mssqltime",
|
|
1857
|
-
callback(e, t, n, r, i, a) {
|
|
1858
|
-
return this.time(J(+t, a), +n, +r, +i.substr(0, 3));
|
|
1859
|
-
}
|
|
1860
|
-
},
|
|
1861
|
-
oracledate: {
|
|
1862
|
-
regex: /^(\d{2})-([A-Z]{3})-(\d{2})$/i,
|
|
1863
|
-
name: "d-M-y",
|
|
1864
|
-
callback(e, t, n, r) {
|
|
1865
|
-
let i = {
|
|
1866
|
-
JAN: 0,
|
|
1867
|
-
FEB: 1,
|
|
1868
|
-
MAR: 2,
|
|
1869
|
-
APR: 3,
|
|
1870
|
-
MAY: 4,
|
|
1871
|
-
JUN: 5,
|
|
1872
|
-
JUL: 6,
|
|
1873
|
-
AUG: 7,
|
|
1874
|
-
SEP: 8,
|
|
1875
|
-
OCT: 9,
|
|
1876
|
-
NOV: 10,
|
|
1877
|
-
DEC: 11
|
|
1878
|
-
}[n.toUpperCase()] ?? NaN;
|
|
1879
|
-
return this.ymd(2e3 + parseInt(r, 10), i, parseInt(t, 10));
|
|
1880
|
-
}
|
|
1881
|
-
},
|
|
1882
|
-
timeLong12: {
|
|
1883
|
-
regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
1884
|
-
name: "timelong12",
|
|
1885
|
-
callback(e, t, n, r, i) {
|
|
1886
|
-
return this.time(J(+t, i), +n, +r, 0);
|
|
1887
|
-
}
|
|
1888
|
-
},
|
|
1889
|
-
timeShort12: {
|
|
1890
|
-
regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
1891
|
-
name: "timeshort12",
|
|
1892
|
-
callback(e, t, n, r) {
|
|
1893
|
-
return this.time(J(+t, r), +n, 0, 0);
|
|
1894
|
-
}
|
|
1895
|
-
},
|
|
1896
|
-
timeTiny12: {
|
|
1897
|
-
regex: /* @__PURE__ */ RegExp("^(0?[1-9]|1[0-2])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
1898
|
-
name: "timetiny12",
|
|
1899
|
-
callback(e, t, n) {
|
|
1900
|
-
return this.time(J(+t, n), 0, 0, 0);
|
|
1901
|
-
}
|
|
1902
|
-
},
|
|
1903
|
-
soap: {
|
|
1904
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(0[0-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[01])T([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])(?:\\.([0-9]+))((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)?", "i"),
|
|
1905
|
-
name: "soap",
|
|
1906
|
-
callback(e, t, n, r, i, a, o, s, c) {
|
|
1907
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, +s.substr(0, 3)) && this.zone(Q(c));
|
|
1908
|
-
}
|
|
1909
|
-
},
|
|
1910
|
-
wddx: {
|
|
1911
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)T(2[0-4]|[01]?[0-9]):([0-5]?[0-9]):(60|[0-5]?[0-9])"),
|
|
1912
|
-
name: "wddx",
|
|
1913
|
-
callback(e, t, n, r, i, a, o) {
|
|
1914
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
exif: {
|
|
1918
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4}):(0[0-9]|1[0-2]):(0[0-9]|[1-2][0-9]|3[01]) ([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])", "i"),
|
|
1919
|
-
name: "exif",
|
|
1920
|
-
callback(e, t, n, r, i, a, o) {
|
|
1921
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1922
|
-
}
|
|
1923
|
-
},
|
|
1924
|
-
xmlRpc: {
|
|
1925
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])T(2[0-4]|[01]?[0-9]):([0-5][0-9]):(60|[0-5][0-9])"),
|
|
1926
|
-
name: "xmlrpc",
|
|
1927
|
-
callback(e, t, n, r, i, a, o) {
|
|
1928
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1929
|
-
}
|
|
1930
|
-
},
|
|
1931
|
-
xmlRpcNoColon: {
|
|
1932
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])[Tt](2[0-4]|[01]?[0-9])([0-5][0-9])(60|[0-5][0-9])"),
|
|
1933
|
-
name: "xmlrpcnocolon",
|
|
1934
|
-
callback(e, t, n, r, i, a, o) {
|
|
1935
|
-
return this.ymd(+t, n - 1, +r) && this.time(+i, +a, +o, 0);
|
|
1936
|
-
}
|
|
1937
|
-
},
|
|
1938
|
-
clf: {
|
|
1939
|
-
regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)/(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)/([0-9]{4}):([01][0-9]|2[0-4]):([0-5][0-9]):(60|[0-5][0-9])[ \\t]+((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
|
|
1940
|
-
name: "clf",
|
|
1941
|
-
callback(e, t, n, r, i, a, o, s) {
|
|
1942
|
-
return this.ymd(+r, X(n), +t) && this.time(+i, +a, +o, 0) && this.zone(Q(s));
|
|
1943
|
-
}
|
|
1944
|
-
},
|
|
1945
|
-
iso8601long: {
|
|
1946
|
-
regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])(?:\\.([0-9]+))", "i"),
|
|
1947
|
-
name: "iso8601long",
|
|
1948
|
-
callback(e, t, n, r, i) {
|
|
1949
|
-
return this.time(+t, +n, +r, +i.substr(0, 3));
|
|
1950
|
-
}
|
|
1951
|
-
},
|
|
1952
|
-
dateTextual: {
|
|
1953
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]+([0-9]{1,4})", "i"),
|
|
1954
|
-
name: "datetextual",
|
|
1955
|
-
callback(e, t, n, r) {
|
|
1956
|
-
return this.ymd(Y(r), X(t), +n);
|
|
1957
|
-
}
|
|
1958
|
-
},
|
|
1959
|
-
pointedDate4: {
|
|
1960
|
-
regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[.\\t-](1[0-2]|0?[0-9])[.-]([0-9]{4})"),
|
|
1961
|
-
name: "pointeddate4",
|
|
1962
|
-
callback(e, t, n, r) {
|
|
1963
|
-
return this.ymd(+r, n - 1, +t);
|
|
1964
|
-
}
|
|
1965
|
-
},
|
|
1966
|
-
pointedDate2: {
|
|
1967
|
-
regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[.\\t](1[0-2]|0?[0-9])\\.([0-9]{2})"),
|
|
1968
|
-
name: "pointeddate2",
|
|
1969
|
-
callback(e, t, n, r) {
|
|
1970
|
-
return this.ymd(Y(r), n - 1, +t);
|
|
1971
|
-
}
|
|
1972
|
-
},
|
|
1973
|
-
timeLong24: {
|
|
1974
|
-
regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])"),
|
|
1975
|
-
name: "timelong24",
|
|
1976
|
-
callback(e, t, n, r) {
|
|
1977
|
-
return this.time(+t, +n, +r, 0);
|
|
1978
|
-
}
|
|
1979
|
-
},
|
|
1980
|
-
dateNoColon: {
|
|
1981
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})(0[0-9]|1[0-2])(0[0-9]|[1-2][0-9]|3[01])"),
|
|
1982
|
-
name: "datenocolon",
|
|
1983
|
-
callback(e, t, n, r) {
|
|
1984
|
-
return this.ymd(+t, n - 1, +r);
|
|
1985
|
-
}
|
|
1986
|
-
},
|
|
1987
|
-
pgydotd: {
|
|
1988
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),
|
|
1989
|
-
name: "pgydotd",
|
|
1990
|
-
callback(e, t, n) {
|
|
1991
|
-
return this.ymd(+t, 0, +n);
|
|
1992
|
-
}
|
|
1993
|
-
},
|
|
1994
|
-
timeShort24: {
|
|
1995
|
-
regex: /* @__PURE__ */ RegExp("^t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])", "i"),
|
|
1996
|
-
name: "timeshort24",
|
|
1997
|
-
callback(e, t, n) {
|
|
1998
|
-
return this.time(+t, +n, 0, 0);
|
|
1999
|
-
}
|
|
2000
|
-
},
|
|
2001
|
-
iso8601noColon: {
|
|
2002
|
-
regex: /* @__PURE__ */ RegExp("^t?([01][0-9]|2[0-4])([0-5][0-9])(60|[0-5][0-9])", "i"),
|
|
2003
|
-
name: "iso8601nocolon",
|
|
2004
|
-
callback(e, t, n, r) {
|
|
2005
|
-
return this.time(+t, +n, +r, 0);
|
|
2006
|
-
}
|
|
2007
|
-
},
|
|
2008
|
-
iso8601dateSlash: {
|
|
2009
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})/(0[0-9]|1[0-2])/(0[0-9]|[1-2][0-9]|3[01])/"),
|
|
2010
|
-
name: "iso8601dateslash",
|
|
2011
|
-
callback(e, t, n, r) {
|
|
2012
|
-
return this.ymd(+t, n - 1, +r);
|
|
2013
|
-
}
|
|
2014
|
-
},
|
|
2015
|
-
dateSlash: {
|
|
2016
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})/(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
|
|
2017
|
-
name: "dateslash",
|
|
2018
|
-
callback(e, t, n, r) {
|
|
2019
|
-
return this.ymd(+t, n - 1, +r);
|
|
2020
|
-
}
|
|
2021
|
-
},
|
|
2022
|
-
american: {
|
|
2023
|
-
regex: /* @__PURE__ */ RegExp("^(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)/([0-9]{1,4})"),
|
|
2024
|
-
name: "american",
|
|
2025
|
-
callback(e, t, n, r) {
|
|
2026
|
-
return this.ymd(Y(r), t - 1, +n);
|
|
2027
|
-
}
|
|
2028
|
-
},
|
|
2029
|
-
americanShort: {
|
|
2030
|
-
regex: /* @__PURE__ */ RegExp("^(1[0-2]|0?[0-9])/(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
|
|
2031
|
-
name: "americanshort",
|
|
2032
|
-
callback(e, t, n) {
|
|
2033
|
-
return this.ymd(this.y, t - 1, +n);
|
|
2034
|
-
}
|
|
2035
|
-
},
|
|
2036
|
-
gnuDateShortOrIso8601date2: {
|
|
2037
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{1,4})-(1[0-2]|0?[0-9])-(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)"),
|
|
2038
|
-
name: "gnudateshort | iso8601date2",
|
|
2039
|
-
callback(e, t, n, r) {
|
|
2040
|
-
return this.ymd(Y(t), n - 1, +r);
|
|
2041
|
-
}
|
|
2042
|
-
},
|
|
2043
|
-
iso8601date4: {
|
|
2044
|
-
regex: /* @__PURE__ */ RegExp("^([+-]?[0-9]{4})-(0[0-9]|1[0-2])-(0[0-9]|[1-2][0-9]|3[01])"),
|
|
2045
|
-
name: "iso8601date4",
|
|
2046
|
-
callback(e, t, n, r) {
|
|
2047
|
-
return this.ymd(+t, n - 1, +r);
|
|
2048
|
-
}
|
|
2049
|
-
},
|
|
2050
|
-
gnuNoColon: {
|
|
2051
|
-
regex: /* @__PURE__ */ RegExp("^t?([01][0-9]|2[0-4])([0-5][0-9])", "i"),
|
|
2052
|
-
name: "gnunocolon",
|
|
2053
|
-
callback(e, t, n) {
|
|
2054
|
-
switch (this.times) {
|
|
2055
|
-
case 0: return this.time(+t, +n, 0, this.f);
|
|
2056
|
-
case 1: return this.y = 100 * t + +n, this.times++, !0;
|
|
2057
|
-
default: return !1;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
},
|
|
2061
|
-
gnuDateShorter: {
|
|
2062
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})-(1[0-2]|0?[0-9])"),
|
|
2063
|
-
name: "gnudateshorter",
|
|
2064
|
-
callback(e, t, n) {
|
|
2065
|
-
return this.ymd(+t, n - 1, 1);
|
|
2066
|
-
}
|
|
2067
|
-
},
|
|
2068
|
-
pgTextReverse: {
|
|
2069
|
-
regex: /* @__PURE__ */ RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)-(0[0-9]|[1-2][0-9]|3[01])", "i"),
|
|
2070
|
-
name: "pgtextreverse",
|
|
2071
|
-
callback(e, t, n, r) {
|
|
2072
|
-
return this.ymd(Y(t), X(n), +r);
|
|
2073
|
-
}
|
|
2074
|
-
},
|
|
2075
|
-
dateFull: {
|
|
2076
|
-
regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[ \\t.-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ \\t.-]*([0-9]{1,4})", "i"),
|
|
2077
|
-
name: "datefull",
|
|
2078
|
-
callback(e, t, n, r) {
|
|
2079
|
-
return this.ymd(Y(r), X(n), +t);
|
|
2080
|
-
}
|
|
2081
|
-
},
|
|
2082
|
-
dateNoDay: {
|
|
2083
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*([0-9]{4})", "i"),
|
|
2084
|
-
name: "datenoday",
|
|
2085
|
-
callback(e, t, n) {
|
|
2086
|
-
return this.ymd(+n, X(t), 1);
|
|
2087
|
-
}
|
|
2088
|
-
},
|
|
2089
|
-
dateNoDayRev: {
|
|
2090
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
|
|
2091
|
-
name: "datenodayrev",
|
|
2092
|
-
callback(e, t, n) {
|
|
2093
|
-
return this.ymd(+t, X(n), 1);
|
|
2094
|
-
}
|
|
2095
|
-
},
|
|
2096
|
-
pgTextShort: {
|
|
2097
|
-
regex: /* @__PURE__ */ RegExp("^(jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)-(0[0-9]|[1-2][0-9]|3[01])-([0-9]{1,4})", "i"),
|
|
2098
|
-
name: "pgtextshort",
|
|
2099
|
-
callback(e, t, n, r) {
|
|
2100
|
-
return this.ymd(Y(r), X(t), +n);
|
|
2101
|
-
}
|
|
2102
|
-
},
|
|
2103
|
-
dateNoYear: {
|
|
2104
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*", "i"),
|
|
2105
|
-
name: "datenoyear",
|
|
2106
|
-
callback(e, t, n) {
|
|
2107
|
-
return this.ymd(this.y, X(t), +n);
|
|
2108
|
-
}
|
|
2109
|
-
},
|
|
2110
|
-
dateNoYearRev: {
|
|
2111
|
-
regex: /* @__PURE__ */ RegExp("^(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[ .\\t-]*(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})", "i"),
|
|
2112
|
-
name: "datenoyearrev",
|
|
2113
|
-
callback(e, t, n) {
|
|
2114
|
-
return this.ymd(this.y, X(n), +t);
|
|
2115
|
-
}
|
|
2116
|
-
},
|
|
2117
|
-
isoWeekDay: {
|
|
2118
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),
|
|
2119
|
-
name: "isoweekday | isoweek",
|
|
2120
|
-
callback(e, t, n, r) {
|
|
2121
|
-
let i = r ? +r : 1;
|
|
2122
|
-
if (!this.ymd(+t, 0, 1)) return !1;
|
|
2123
|
-
let a = new Date(this.y, this.m, this.d).getDay();
|
|
2124
|
-
return a = 0 - (a > 4 ? a - 7 : a), this.rd += a + 7 * (n - 1) + i, !0;
|
|
2125
|
-
}
|
|
2126
|
-
},
|
|
2127
|
-
relativeText: {
|
|
2128
|
-
regex: /* @__PURE__ */ RegExp("^(first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth|next|last|previous|this)[ \\t]+((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?)", "i"),
|
|
2129
|
-
name: "relativetext",
|
|
2130
|
-
callback(e, t, n) {
|
|
2131
|
-
let { amount: r } = (function(e) {
|
|
2132
|
-
let t = e.toLowerCase();
|
|
2133
|
-
return {
|
|
2134
|
-
amount: {
|
|
2135
|
-
last: -1,
|
|
2136
|
-
previous: -1,
|
|
2137
|
-
this: 0,
|
|
2138
|
-
first: 1,
|
|
2139
|
-
next: 1,
|
|
2140
|
-
second: 2,
|
|
2141
|
-
third: 3,
|
|
2142
|
-
fourth: 4,
|
|
2143
|
-
fifth: 5,
|
|
2144
|
-
sixth: 6,
|
|
2145
|
-
seventh: 7,
|
|
2146
|
-
eight: 8,
|
|
2147
|
-
eighth: 8,
|
|
2148
|
-
ninth: 9,
|
|
2149
|
-
tenth: 10,
|
|
2150
|
-
eleventh: 11,
|
|
2151
|
-
twelfth: 12
|
|
2152
|
-
}[t] ?? 0,
|
|
2153
|
-
behavior: { this: 1 }[t] || 0
|
|
2154
|
-
};
|
|
2155
|
-
})(t);
|
|
2156
|
-
switch (n.toLowerCase()) {
|
|
2157
|
-
case "sec":
|
|
2158
|
-
case "secs":
|
|
2159
|
-
case "second":
|
|
2160
|
-
case "seconds":
|
|
2161
|
-
this.rs += r;
|
|
2162
|
-
break;
|
|
2163
|
-
case "min":
|
|
2164
|
-
case "mins":
|
|
2165
|
-
case "minute":
|
|
2166
|
-
case "minutes":
|
|
2167
|
-
this.ri += r;
|
|
2168
|
-
break;
|
|
2169
|
-
case "hour":
|
|
2170
|
-
case "hours":
|
|
2171
|
-
this.rh += r;
|
|
2172
|
-
break;
|
|
2173
|
-
case "day":
|
|
2174
|
-
case "days":
|
|
2175
|
-
this.rd += r;
|
|
2176
|
-
break;
|
|
2177
|
-
case "fortnight":
|
|
2178
|
-
case "fortnights":
|
|
2179
|
-
case "forthnight":
|
|
2180
|
-
case "forthnights":
|
|
2181
|
-
this.rd += 14 * r;
|
|
2182
|
-
break;
|
|
2183
|
-
case "week":
|
|
2184
|
-
case "weeks":
|
|
2185
|
-
this.rd += 7 * r;
|
|
2186
|
-
break;
|
|
2187
|
-
case "month":
|
|
2188
|
-
case "months":
|
|
2189
|
-
this.rm += r;
|
|
2190
|
-
break;
|
|
2191
|
-
case "year":
|
|
2192
|
-
case "years":
|
|
2193
|
-
this.ry += r;
|
|
2194
|
-
break;
|
|
2195
|
-
case "mon":
|
|
2196
|
-
case "monday":
|
|
2197
|
-
case "tue":
|
|
2198
|
-
case "tuesday":
|
|
2199
|
-
case "wed":
|
|
2200
|
-
case "wednesday":
|
|
2201
|
-
case "thu":
|
|
2202
|
-
case "thursday":
|
|
2203
|
-
case "fri":
|
|
2204
|
-
case "friday":
|
|
2205
|
-
case "sat":
|
|
2206
|
-
case "saturday":
|
|
2207
|
-
case "sun":
|
|
2208
|
-
case "sunday": this.resetTime(), this.weekday = Z(n, 7), this.weekdayBehavior = 1, this.rd += 7 * (r > 0 ? r - 1 : r);
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
},
|
|
2212
|
-
relative: {
|
|
2213
|
-
regex: /* @__PURE__ */ RegExp("^([+-]*)[ \\t]*(\\d+)[ \\t]*((?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?|week)", "i"),
|
|
2214
|
-
name: "relative",
|
|
2215
|
-
callback(e, t, n, r) {
|
|
2216
|
-
let i = n * (-1) ** t.replace(/[^-]/g, "").length;
|
|
2217
|
-
switch (r.toLowerCase()) {
|
|
2218
|
-
case "sec":
|
|
2219
|
-
case "secs":
|
|
2220
|
-
case "second":
|
|
2221
|
-
case "seconds":
|
|
2222
|
-
this.rs += i;
|
|
2223
|
-
break;
|
|
2224
|
-
case "min":
|
|
2225
|
-
case "mins":
|
|
2226
|
-
case "minute":
|
|
2227
|
-
case "minutes":
|
|
2228
|
-
this.ri += i;
|
|
2229
|
-
break;
|
|
2230
|
-
case "hour":
|
|
2231
|
-
case "hours":
|
|
2232
|
-
this.rh += i;
|
|
2233
|
-
break;
|
|
2234
|
-
case "day":
|
|
2235
|
-
case "days":
|
|
2236
|
-
this.rd += i;
|
|
2237
|
-
break;
|
|
2238
|
-
case "fortnight":
|
|
2239
|
-
case "fortnights":
|
|
2240
|
-
case "forthnight":
|
|
2241
|
-
case "forthnights":
|
|
2242
|
-
this.rd += 14 * i;
|
|
2243
|
-
break;
|
|
2244
|
-
case "week":
|
|
2245
|
-
case "weeks":
|
|
2246
|
-
this.rd += 7 * i;
|
|
2247
|
-
break;
|
|
2248
|
-
case "month":
|
|
2249
|
-
case "months":
|
|
2250
|
-
this.rm += i;
|
|
2251
|
-
break;
|
|
2252
|
-
case "year":
|
|
2253
|
-
case "years":
|
|
2254
|
-
this.ry += i;
|
|
2255
|
-
break;
|
|
2256
|
-
case "mon":
|
|
2257
|
-
case "monday":
|
|
2258
|
-
case "tue":
|
|
2259
|
-
case "tuesday":
|
|
2260
|
-
case "wed":
|
|
2261
|
-
case "wednesday":
|
|
2262
|
-
case "thu":
|
|
2263
|
-
case "thursday":
|
|
2264
|
-
case "fri":
|
|
2265
|
-
case "friday":
|
|
2266
|
-
case "sat":
|
|
2267
|
-
case "saturday":
|
|
2268
|
-
case "sun":
|
|
2269
|
-
case "sunday": this.resetTime(), this.weekday = Z(r, 7), this.weekdayBehavior = 1, this.rd += 7 * (i > 0 ? i - 1 : i);
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
},
|
|
2273
|
-
dayText: {
|
|
2274
|
-
regex: /* @__PURE__ */ RegExp("^(sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|wed|thu|fri|sat|weekdays?)", "i"),
|
|
2275
|
-
name: "daytext",
|
|
2276
|
-
callback(e, t) {
|
|
2277
|
-
this.resetTime(), this.weekday = Z(t, 0), this.weekdayBehavior !== 2 && (this.weekdayBehavior = 1);
|
|
2278
|
-
}
|
|
2279
|
-
},
|
|
2280
|
-
relativeTextWeek: {
|
|
2281
|
-
regex: /* @__PURE__ */ RegExp("^(next|last|previous|this)[ \\t]+week", "i"),
|
|
2282
|
-
name: "relativetextweek",
|
|
2283
|
-
callback(e, t) {
|
|
2284
|
-
switch (this.weekdayBehavior = 2, t.toLowerCase()) {
|
|
2285
|
-
case "this":
|
|
2286
|
-
this.rd += 0;
|
|
2287
|
-
break;
|
|
2288
|
-
case "next":
|
|
2289
|
-
this.rd += 7;
|
|
2290
|
-
break;
|
|
2291
|
-
case "last":
|
|
2292
|
-
case "previous": this.rd -= 7;
|
|
2293
|
-
}
|
|
2294
|
-
isNaN(this.weekday) && (this.weekday = 1);
|
|
2295
|
-
}
|
|
2296
|
-
},
|
|
2297
|
-
monthFullOrMonthAbbr: {
|
|
2298
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec)", "i"),
|
|
2299
|
-
name: "monthfull | monthabbr",
|
|
2300
|
-
callback(e, t) {
|
|
2301
|
-
return this.ymd(this.y, X(t), this.d);
|
|
2302
|
-
}
|
|
2303
|
-
},
|
|
2304
|
-
tzCorrection: {
|
|
2305
|
-
regex: /* @__PURE__ */ RegExp("^((?:GMT)?([+-])(2[0-4]|[01]?[0-9]):?([0-5]?[0-9])?)", "i"),
|
|
2306
|
-
name: "tzcorrection",
|
|
2307
|
-
callback(e) {
|
|
2308
|
-
return this.zone(Q(e));
|
|
2309
|
-
}
|
|
2310
|
-
},
|
|
2311
|
-
tzAbbr: {
|
|
2312
|
-
regex: /* @__PURE__ */ RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),
|
|
2313
|
-
name: "tzabbr",
|
|
2314
|
-
callback(e, t) {
|
|
2315
|
-
let n = le[t.toLowerCase()];
|
|
2316
|
-
return n != null && !Number.isNaN(n) && this.zone(n);
|
|
2317
|
-
}
|
|
2318
|
-
},
|
|
2319
|
-
ago: {
|
|
2320
|
-
regex: /^ago/i,
|
|
2321
|
-
name: "ago",
|
|
2322
|
-
callback() {
|
|
2323
|
-
this.ry = -this.ry, this.rm = -this.rm, this.rd = -this.rd, this.rh = -this.rh, this.ri = -this.ri, this.rs = -this.rs, this.rf = -this.rf;
|
|
2324
|
-
}
|
|
2325
|
-
},
|
|
2326
|
-
year4: {
|
|
2327
|
-
regex: /* @__PURE__ */ RegExp("^([0-9]{4})"),
|
|
2328
|
-
name: "year4",
|
|
2329
|
-
callback(e, t) {
|
|
2330
|
-
return this.y = +t, !0;
|
|
2331
|
-
}
|
|
2332
|
-
},
|
|
2333
|
-
whitespace: {
|
|
2334
|
-
regex: /^[ .,\t]+/,
|
|
2335
|
-
name: "whitespace"
|
|
2336
|
-
},
|
|
2337
|
-
dateShortWithTimeLong: {
|
|
2338
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])[:.](60|[0-5]?[0-9])", "i"),
|
|
2339
|
-
name: "dateshortwithtimelong",
|
|
2340
|
-
callback(e, t, n, r, i, a) {
|
|
2341
|
-
return this.ymd(this.y, X(t), +n) && this.time(+r, +i, +a, 0);
|
|
2342
|
-
}
|
|
2343
|
-
},
|
|
2344
|
-
dateShortWithTimeLong12: {
|
|
2345
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*(0?[1-9]|1[0-2])[:.]([0-5]?[0-9])[:.](60|[0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
2346
|
-
name: "dateshortwithtimelong12",
|
|
2347
|
-
callback(e, t, n, r, i, a, o) {
|
|
2348
|
-
return this.ymd(this.y, X(t), +n) && this.time(J(+r, o), +i, +a, 0);
|
|
2349
|
-
}
|
|
2350
|
-
},
|
|
2351
|
-
dateShortWithTimeShort: {
|
|
2352
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*t?(2[0-4]|[01]?[0-9])[:.]([0-5]?[0-9])", "i"),
|
|
2353
|
-
name: "dateshortwithtimeshort",
|
|
2354
|
-
callback(e, t, n, r, i) {
|
|
2355
|
-
return this.ymd(this.y, X(t), +n) && this.time(+r, +i, 0, 0);
|
|
2356
|
-
}
|
|
2357
|
-
},
|
|
2358
|
-
dateShortWithTimeShort12: {
|
|
2359
|
-
regex: /* @__PURE__ */ RegExp("^(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec|i[vx]|vi{0,3}|xi{0,2}|i{1,3})[ .\\t-]*(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)[,.stndrh\\t ]*(0?[1-9]|1[0-2])[:.]([0-5][0-9])[ \\t]*(?:([ap])\\.?m\\.?([\\t ]|$))", "i"),
|
|
2360
|
-
name: "dateshortwithtimeshort12",
|
|
2361
|
-
callback(e, t, n, r, i, a) {
|
|
2362
|
-
return this.ymd(this.y, X(t), +n) && this.time(J(+r, a), +i, 0, 0);
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
}, ue = {
|
|
2366
|
-
y: NaN,
|
|
2367
|
-
m: NaN,
|
|
2368
|
-
d: NaN,
|
|
2369
|
-
h: NaN,
|
|
2370
|
-
i: NaN,
|
|
2371
|
-
s: NaN,
|
|
2372
|
-
f: NaN,
|
|
2373
|
-
ry: 0,
|
|
2374
|
-
rm: 0,
|
|
2375
|
-
rd: 0,
|
|
2376
|
-
rh: 0,
|
|
2377
|
-
ri: 0,
|
|
2378
|
-
rs: 0,
|
|
2379
|
-
rf: 0,
|
|
2380
|
-
weekday: NaN,
|
|
2381
|
-
weekdayBehavior: 0,
|
|
2382
|
-
firstOrLastDayOfMonth: 0,
|
|
2383
|
-
z: NaN,
|
|
2384
|
-
dates: 0,
|
|
2385
|
-
times: 0,
|
|
2386
|
-
zones: 0,
|
|
2387
|
-
ymd(e, t, n) {
|
|
2388
|
-
return !(this.dates > 0) && (this.dates++, this.y = e, this.m = t, this.d = n, !0);
|
|
2389
|
-
},
|
|
2390
|
-
time(e, t, n, r) {
|
|
2391
|
-
return !(this.times > 0) && (this.times++, this.h = e, this.i = t, this.s = n, this.f = r, !0);
|
|
2392
|
-
},
|
|
2393
|
-
resetTime() {
|
|
2394
|
-
return this.h = 0, this.i = 0, this.s = 0, this.f = 0, this.times = 0, !0;
|
|
2395
|
-
},
|
|
2396
|
-
zone(e) {
|
|
2397
|
-
return this.zones <= 1 && (this.zones++, this.z = e, !0);
|
|
2398
|
-
},
|
|
2399
|
-
toDate(e) {
|
|
2400
|
-
switch (this.dates && !this.times && (this.h = this.i = this.s = this.f = 0), isNaN(this.y) && (this.y = e.getFullYear()), isNaN(this.m) && (this.m = e.getMonth()), isNaN(this.d) && (this.d = e.getDate()), isNaN(this.h) && (this.h = e.getHours()), isNaN(this.i) && (this.i = e.getMinutes()), isNaN(this.s) && (this.s = e.getSeconds()), isNaN(this.f) && (this.f = e.getMilliseconds()), this.firstOrLastDayOfMonth) {
|
|
2401
|
-
case 1:
|
|
2402
|
-
this.d = 1;
|
|
2403
|
-
break;
|
|
2404
|
-
case -1: this.d = 0, this.m += 1;
|
|
2405
|
-
}
|
|
2406
|
-
if (!isNaN(this.weekday)) {
|
|
2407
|
-
let t = new Date(e.getTime());
|
|
2408
|
-
t.setFullYear(this.y, this.m, this.d), t.setHours(this.h, this.i, this.s, this.f);
|
|
2409
|
-
let n = t.getDay();
|
|
2410
|
-
if (this.weekdayBehavior === 2) n === 0 && this.weekday !== 0 && (this.weekday = -6), this.weekday === 0 && n !== 0 && (this.weekday = 7), this.d -= n, this.d += this.weekday;
|
|
2411
|
-
else {
|
|
2412
|
-
let e = this.weekday - n;
|
|
2413
|
-
(this.rd < 0 && e < 0 || this.rd >= 0 && e <= -this.weekdayBehavior) && (e += 7), this.weekday >= 0 ? this.d += e : this.d -= 7 - (Math.abs(this.weekday) - n), this.weekday = NaN;
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
this.y += this.ry, this.m += this.rm, this.d += this.rd, this.h += this.rh, this.i += this.ri, this.s += this.rs, this.f += this.rf, this.ry = this.rm = this.rd = 0, this.rh = this.ri = this.rs = this.rf = 0;
|
|
2417
|
-
let t = new Date(e.getTime());
|
|
2418
|
-
switch (t.setFullYear(this.y, this.m, this.d), t.setHours(this.h, this.i, this.s, this.f), this.firstOrLastDayOfMonth) {
|
|
2419
|
-
case 1:
|
|
2420
|
-
t.setDate(1);
|
|
2421
|
-
break;
|
|
2422
|
-
case -1: t.setMonth(t.getMonth() + 1, 0);
|
|
2423
|
-
}
|
|
2424
|
-
return isNaN(this.z) || t.getTimezoneOffset() === this.z || (t.setUTCFullYear(t.getFullYear(), t.getMonth(), t.getDate()), t.setUTCHours(t.getHours(), t.getMinutes(), t.getSeconds() - this.z, t.getMilliseconds())), t;
|
|
2425
|
-
}
|
|
2426
|
-
};
|
|
2427
|
-
e.AbstractProvider = z, e.ArrayAdapter = F, e.ArrayProvider = class extends z {
|
|
2428
|
-
getFunctions() {
|
|
2429
|
-
return [
|
|
2430
|
-
ae,
|
|
2431
|
-
oe,
|
|
2432
|
-
se
|
|
2433
|
-
];
|
|
2434
|
-
}
|
|
2435
|
-
}, e.BasicProvider = class extends z {
|
|
2436
|
-
getFunctions() {
|
|
2437
|
-
return [te];
|
|
2438
|
-
}
|
|
2439
|
-
}, e.Compiler = j, e.DateProvider = class extends z {
|
|
2440
|
-
getFunctions() {
|
|
2441
|
-
return [new L("date", function(e, t) {
|
|
2442
|
-
let n = "";
|
|
2443
|
-
return t && (n = `, ${t}`), `date(${e}${n})`;
|
|
2444
|
-
}, function(e, t, n) {
|
|
2445
|
-
return ce(t, n);
|
|
2446
|
-
}), new L("strtotime", function(e, t) {
|
|
2447
|
-
let n = "";
|
|
2448
|
-
return t && (n = `, ${t}`), `strtotime(${e}${n})`;
|
|
2449
|
-
}, function(e, t, n) {
|
|
2450
|
-
return (function(e, t) {
|
|
2451
|
-
let n = t ?? Math.floor(Date.now() / 1e3), r = [
|
|
2452
|
-
$.yesterday,
|
|
2453
|
-
$.now,
|
|
2454
|
-
$.noon,
|
|
2455
|
-
$.midnightOrToday,
|
|
2456
|
-
$.tomorrow,
|
|
2457
|
-
$.timestamp,
|
|
2458
|
-
$.firstOrLastDay,
|
|
2459
|
-
$.backOrFrontOf,
|
|
2460
|
-
$.timeTiny12,
|
|
2461
|
-
$.timeShort12,
|
|
2462
|
-
$.timeLong12,
|
|
2463
|
-
$.mssqltime,
|
|
2464
|
-
$.oracledate,
|
|
2465
|
-
$.timeShort24,
|
|
2466
|
-
$.timeLong24,
|
|
2467
|
-
$.iso8601long,
|
|
2468
|
-
$.gnuNoColon,
|
|
2469
|
-
$.iso8601noColon,
|
|
2470
|
-
$.americanShort,
|
|
2471
|
-
$.american,
|
|
2472
|
-
$.iso8601date4,
|
|
2473
|
-
$.iso8601dateSlash,
|
|
2474
|
-
$.dateSlash,
|
|
2475
|
-
$.gnuDateShortOrIso8601date2,
|
|
2476
|
-
$.gnuDateShorter,
|
|
2477
|
-
$.dateFull,
|
|
2478
|
-
$.pointedDate4,
|
|
2479
|
-
$.pointedDate2,
|
|
2480
|
-
$.dateNoDay,
|
|
2481
|
-
$.dateNoDayRev,
|
|
2482
|
-
$.dateTextual,
|
|
2483
|
-
$.dateNoYear,
|
|
2484
|
-
$.dateNoYearRev,
|
|
2485
|
-
$.dateNoColon,
|
|
2486
|
-
$.xmlRpc,
|
|
2487
|
-
$.xmlRpcNoColon,
|
|
2488
|
-
$.soap,
|
|
2489
|
-
$.wddx,
|
|
2490
|
-
$.exif,
|
|
2491
|
-
$.pgydotd,
|
|
2492
|
-
$.isoWeekDay,
|
|
2493
|
-
$.pgTextShort,
|
|
2494
|
-
$.pgTextReverse,
|
|
2495
|
-
$.clf,
|
|
2496
|
-
$.year4,
|
|
2497
|
-
$.ago,
|
|
2498
|
-
$.dayText,
|
|
2499
|
-
$.relativeTextWeek,
|
|
2500
|
-
$.relativeText,
|
|
2501
|
-
$.monthFullOrMonthAbbr,
|
|
2502
|
-
$.tzCorrection,
|
|
2503
|
-
$.tzAbbr,
|
|
2504
|
-
$.dateShortWithTimeShort12,
|
|
2505
|
-
$.dateShortWithTimeLong12,
|
|
2506
|
-
$.dateShortWithTimeShort,
|
|
2507
|
-
$.dateShortWithTimeLong,
|
|
2508
|
-
$.relative,
|
|
2509
|
-
$.whitespace
|
|
2510
|
-
], i = { ...ue };
|
|
2511
|
-
for (; e.length;) {
|
|
2512
|
-
let t = null, n = null;
|
|
2513
|
-
for (let i of r) {
|
|
2514
|
-
let r = e.match(i.regex);
|
|
2515
|
-
r && (!t || r[0].length > t[0].length) && (t = r, n = i);
|
|
2516
|
-
}
|
|
2517
|
-
if (!n || !t || n.callback && n.callback.apply(i, t) === !1) return !1;
|
|
2518
|
-
e = e.substr(t[0].length), n = null, t = null;
|
|
2519
|
-
}
|
|
2520
|
-
return Math.floor(i.toDate(/* @__PURE__ */ new Date(1e3 * n)).getTime() / 1e3);
|
|
2521
|
-
})(t, n);
|
|
2522
|
-
})];
|
|
2523
|
-
}
|
|
2524
|
-
}, e.ExpressionFunction = L, e.ExpressionLanguage = R, e.IGNORE_UNKNOWN_FUNCTIONS = 2, e.IGNORE_UNKNOWN_VARIABLES = 1, e.Parser = A, e.StringProvider = class extends z {
|
|
2525
|
-
getFunctions() {
|
|
2526
|
-
return [
|
|
2527
|
-
new L("strtolower", (e) => "strtolower(" + e + ")", (e, t) => (function(e) {
|
|
2528
|
-
return (e + "").toLowerCase();
|
|
2529
|
-
})(t)),
|
|
2530
|
-
new L("strtoupper", (e) => "strtoupper(" + e + ")", (e, t) => (function(e) {
|
|
2531
|
-
return (e + "").toUpperCase();
|
|
2532
|
-
})(t)),
|
|
2533
|
-
new L("explode", (e, t, n = "null") => `explode(${e}, ${t}, ${n})`, (e, t, n, r = null) => (function(...e) {
|
|
2534
|
-
let [t, n, r] = e, i = t, a = n;
|
|
2535
|
-
if (e.length < 2 || i === void 0 || a === void 0) return null;
|
|
2536
|
-
if (i === "" || i === !1 || i === null) return !1;
|
|
2537
|
-
if (typeof i == "function" || typeof i == "object" || typeof a == "function" || typeof a == "object") return { 0: "" };
|
|
2538
|
-
i === !0 && (i = "1");
|
|
2539
|
-
let o = i + "", s = (a + "").split(o);
|
|
2540
|
-
return r === void 0 ? s : (r === 0 && (r = 1), r > 0 ? r >= s.length ? s : s.slice(0, r - 1).concat([s.slice(r - 1).join(o)]) : -r >= s.length ? [] : (s.splice(s.length + r), s));
|
|
2541
|
-
})(t, n, r)),
|
|
2542
|
-
new L("strlen", function(e) {
|
|
2543
|
-
return `strlen(${e});`;
|
|
2544
|
-
}, function(e, t) {
|
|
2545
|
-
return (function(e) {
|
|
2546
|
-
let t = e + "";
|
|
2547
|
-
if ((G("unicode.semantics") || "off") === "off") return t.length;
|
|
2548
|
-
let n = 0, r = 0, i = function(e, t) {
|
|
2549
|
-
let n = e.charCodeAt(t);
|
|
2550
|
-
if (n >= 55296 && n <= 56319) {
|
|
2551
|
-
if (e.length <= t + 1) throw Error("High surrogate without following low surrogate");
|
|
2552
|
-
let n = e.charCodeAt(t + 1);
|
|
2553
|
-
if (n < 56320 || n > 57343) throw Error("High surrogate without following low surrogate");
|
|
2554
|
-
return e.charAt(t) + e.charAt(t + 1);
|
|
2555
|
-
}
|
|
2556
|
-
if (n >= 56320 && n <= 57343) {
|
|
2557
|
-
if (t === 0) throw Error("Low surrogate without preceding high surrogate");
|
|
2558
|
-
let n = e.charCodeAt(t - 1);
|
|
2559
|
-
if (n < 55296 || n > 56319) throw Error("Low surrogate without preceding high surrogate");
|
|
2560
|
-
return !1;
|
|
2561
|
-
}
|
|
2562
|
-
return e.charAt(t);
|
|
2563
|
-
};
|
|
2564
|
-
for (n = 0, r = 0; n < t.length; n++) i(t, n) !== !1 && r++;
|
|
2565
|
-
return r;
|
|
2566
|
-
})(t);
|
|
2567
|
-
}),
|
|
2568
|
-
new L("strstr", function(e, t, n) {
|
|
2569
|
-
let r = "";
|
|
2570
|
-
return n && (r = `, ${n}`), `strstr(${e}, ${t}${r});`;
|
|
2571
|
-
}, function(e, t, n, r) {
|
|
2572
|
-
return (function(e, t, n) {
|
|
2573
|
-
let r = 0;
|
|
2574
|
-
return r = (e += "").indexOf(t), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
2575
|
-
})(t, n, r);
|
|
2576
|
-
}),
|
|
2577
|
-
new L("stristr", function(e, t, n) {
|
|
2578
|
-
let r = "";
|
|
2579
|
-
return n && (r = `, ${n}`), `stristr(${e}, ${t}${r});`;
|
|
2580
|
-
}, function(e, t, n, r) {
|
|
2581
|
-
return (function(e, t, n) {
|
|
2582
|
-
let r = 0;
|
|
2583
|
-
return r = (e += "").toLowerCase().indexOf((t + "").toLowerCase()), r !== -1 && (n ? e.substr(0, r) : e.slice(r));
|
|
2584
|
-
})(t, n, r);
|
|
2585
|
-
}),
|
|
2586
|
-
new L("substr", function(e, t, n) {
|
|
2587
|
-
let r = "";
|
|
2588
|
-
return n && (r = `, ${n}`), `substr(${e}, ${t}${r});`;
|
|
2589
|
-
}, function(e, t, n, r) {
|
|
2590
|
-
return re(t, n, r);
|
|
2591
|
-
})
|
|
2592
|
-
];
|
|
2593
|
-
}
|
|
2594
|
-
}, e.default = R, e.tokenize = o, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
2595
|
-
}), (function(e) {
|
|
2596
|
-
var t = e.ExpressionLanguage;
|
|
2597
|
-
if (t && typeof t.ExpressionLanguage == "function") {
|
|
2598
|
-
var n = t.ExpressionLanguage;
|
|
2599
|
-
Object.keys(t).forEach(function(e) {
|
|
2600
|
-
e in n || (n[e] = t[e]);
|
|
2601
|
-
}), e.ExpressionLanguage = n;
|
|
2602
|
-
}
|
|
2603
|
-
})(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : f);
|
|
2604
|
-
})(d, d.exports)), d.exports;
|
|
2605
|
-
}
|
|
2606
|
-
var h = m(), g = /* @__PURE__ */ e({
|
|
2607
|
-
__proto__: null,
|
|
2608
|
-
default: /* @__PURE__ */ u(h)
|
|
2609
|
-
}, [h]), _ = null;
|
|
2610
|
-
function v() {
|
|
2611
|
-
let e = g, t = e.ExpressionLanguage || e.default || g;
|
|
2612
|
-
if (typeof t != "function") throw TypeError("Unable to resolve expression-language constructor.");
|
|
2613
|
-
return t;
|
|
2614
|
-
}
|
|
2615
|
-
function y() {
|
|
2616
|
-
return _ ??= new (v())(), _;
|
|
2617
|
-
}
|
|
2618
|
-
function b(e) {
|
|
2619
|
-
return (e.formula?.expression || e.formula?.formula || "").trim();
|
|
2620
|
-
}
|
|
2621
|
-
function x(e) {
|
|
2622
|
-
return Object.entries(e.formula?.variables || {}).filter((e) => !!e[1]?.sourceKey);
|
|
2623
|
-
}
|
|
2624
|
-
function S(e, t) {
|
|
2625
|
-
return Object.entries(e).forEach(([t, n]) => {
|
|
2626
|
-
if (Array.isArray(n)) {
|
|
2627
|
-
e[t] = n.map((e) => typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : e);
|
|
2628
|
-
return;
|
|
2629
|
-
}
|
|
2630
|
-
typeof n == "string" && n.trim() !== "" && !Number.isNaN(Number(n)) && (e[t] = Number(n));
|
|
2631
|
-
}), e;
|
|
2632
|
-
}
|
|
2633
|
-
function C(e, t) {
|
|
2634
|
-
if (t.formatting !== "number") return typeof e == "number" || typeof e == "string" ? e : "";
|
|
2635
|
-
let n = e;
|
|
2636
|
-
Array.isArray(n) && (n = n.reduce((e, t) => e + Number(t || 0), 0));
|
|
2637
|
-
let r = typeof t.decimals == "number" ? t.decimals : 0, i = Number(n || 0).toFixed(r);
|
|
2638
|
-
return `${t.prefix || ""}${i}${t.suffix || ""}`;
|
|
2639
|
-
}
|
|
2640
|
-
function w(e, t) {
|
|
2641
|
-
let n = e.type?.endsWith("\\Number");
|
|
2642
|
-
return e.type?.endsWith("\\Checkboxes") ? Array.isArray(t) ? t.length ? t : "" : t ? [t] : "" : Array.isArray(t) ? t.length ? n ? t.map((e) => Number(e || 0)) : t : "" : n ? Number(t || 0) : t;
|
|
2643
|
-
}
|
|
2644
|
-
function T(e, t, n) {
|
|
2645
|
-
return C(y().evaluate(e, t), n);
|
|
2646
|
-
}
|
|
2647
|
-
var E = (() => {
|
|
2648
|
-
let e = Intl.Segmenter;
|
|
2649
|
-
return e ? new e(void 0, { granularity: "grapheme" }) : null;
|
|
2650
|
-
})(), D = /[\p{L}\p{N}\p{M}]+(?:['’._-][\p{L}\p{N}\p{M}]+)*/gu;
|
|
2651
|
-
function O(e) {
|
|
2652
|
-
return typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "text/html").body.textContent || "" : e.replace(/<[^>]*>/g, " ");
|
|
2653
|
-
}
|
|
2654
|
-
function k(e) {
|
|
2655
|
-
return O(e);
|
|
2656
|
-
}
|
|
2657
|
-
function A(e) {
|
|
2658
|
-
return k(e).replace(/[\s\t\n\r]+/g, " ").trim();
|
|
2659
|
-
}
|
|
2660
|
-
function j(e) {
|
|
2661
|
-
return E ? Array.from(E.segment(e)).length : Array.from(e).length;
|
|
2662
|
-
}
|
|
2663
|
-
function M(e) {
|
|
2664
|
-
return e.match(D)?.length || 0;
|
|
2665
|
-
}
|
|
2666
|
-
function N(e) {
|
|
2667
|
-
let t = k(e), n = A(e);
|
|
2668
|
-
return {
|
|
2669
|
-
graphemeCount: j(t),
|
|
2670
|
-
wordCount: M(n)
|
|
2671
|
-
};
|
|
2672
|
-
}
|
|
2673
|
-
//#endregion
|
|
2674
|
-
export { w as a, N as c, s as i, c as n, x as o, S as r, b as s, T as t };
|