@dxtmisha/functional-basic 0.14.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.d.ts +2420 -841
- package/dist/library.js +1623 -850
- package/package.json +5 -4
package/dist/library.js
CHANGED
|
@@ -9,46 +9,61 @@ function n(e) {
|
|
|
9
9
|
return t(e) && !Array.isArray(e);
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region src/functions/copyObjectLite.ts
|
|
13
|
-
function r(e, t) {
|
|
14
|
-
return t ? Object.assign({}, e, t) : Object.assign({}, e);
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
12
|
//#region src/functions/forEach.ts
|
|
18
|
-
function
|
|
13
|
+
function r(e, n, r) {
|
|
19
14
|
if (t(e)) {
|
|
20
|
-
let t = []
|
|
21
|
-
|
|
15
|
+
let t = [], i = (e, i, a) => {
|
|
16
|
+
let o = n(e, i, a);
|
|
17
|
+
(r || o !== void 0) && t.push(o);
|
|
18
|
+
};
|
|
19
|
+
if (Array.isArray(e)) e.forEach((t, n) => i(t, n, e));
|
|
20
|
+
else if (e instanceof Map) e.forEach((t, n) => i(t, n, e));
|
|
21
|
+
else if (e instanceof Set) e.forEach((t) => i(t, t, e));
|
|
22
|
+
else for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && i(e[t], t, e);
|
|
23
|
+
return t;
|
|
22
24
|
}
|
|
23
25
|
return [];
|
|
24
26
|
}
|
|
25
27
|
//#endregion
|
|
28
|
+
//#region src/functions/isArray.ts
|
|
29
|
+
function i(e) {
|
|
30
|
+
return Array.isArray(e);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/functions/toString.ts
|
|
34
|
+
function a(e) {
|
|
35
|
+
return String(e == null ? "" : e);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
26
38
|
//#region src/functions/getRequestString.ts
|
|
27
|
-
function
|
|
28
|
-
return
|
|
39
|
+
function o(e, n = "=", s = "&", c) {
|
|
40
|
+
return r(e, (r, l) => {
|
|
41
|
+
let u = encodeURIComponent(a(l).trim());
|
|
42
|
+
if (u !== "") {
|
|
43
|
+
let l = c ? `${c}[${i(e) ? "" : u}]` : u;
|
|
44
|
+
return t(r) ? o(r, n, s, l) : `${l}${n}${encodeURIComponent(a(r))}`;
|
|
45
|
+
}
|
|
46
|
+
}).sort().join(s);
|
|
29
47
|
}
|
|
30
48
|
//#endregion
|
|
31
|
-
//#region src/functions/
|
|
32
|
-
function
|
|
33
|
-
return
|
|
49
|
+
//#region src/functions/isDomRuntime.ts
|
|
50
|
+
function s() {
|
|
51
|
+
return typeof window < "u" && !!window.document;
|
|
34
52
|
}
|
|
35
53
|
//#endregion
|
|
36
54
|
//#region src/functions/isNull.ts
|
|
37
|
-
function
|
|
55
|
+
function c(e) {
|
|
38
56
|
return e == null;
|
|
39
57
|
}
|
|
40
58
|
//#endregion
|
|
41
59
|
//#region src/functions/isFilled.ts
|
|
42
|
-
function
|
|
60
|
+
function l(e, t) {
|
|
43
61
|
if (e) {
|
|
44
62
|
if (t && e === "0") return !0;
|
|
45
63
|
switch (typeof e) {
|
|
46
|
-
case "bigint":
|
|
47
|
-
case "number": return e !== 0;
|
|
48
|
-
case "boolean": return e;
|
|
49
64
|
case "function":
|
|
50
65
|
case "symbol": return !0;
|
|
51
|
-
case "object": return Array.isArray(e) ? e.length > 0 : Object.values(e).some((e) => !
|
|
66
|
+
case "object": return Array.isArray(e) ? e.length > 0 : e instanceof RegExp ? !0 : e instanceof Map || e instanceof Set ? e.size > 0 : Object.values(e).some((e) => !c(e));
|
|
52
67
|
case "string": return ![
|
|
53
68
|
"",
|
|
54
69
|
"undefined",
|
|
@@ -56,8 +71,7 @@ function c(e, t) {
|
|
|
56
71
|
"0",
|
|
57
72
|
"false",
|
|
58
73
|
"[]"
|
|
59
|
-
].includes(e);
|
|
60
|
-
case "undefined": return !1;
|
|
74
|
+
].includes(e.trim());
|
|
61
75
|
default: return !!e;
|
|
62
76
|
}
|
|
63
77
|
}
|
|
@@ -65,73 +79,79 @@ function c(e, t) {
|
|
|
65
79
|
}
|
|
66
80
|
//#endregion
|
|
67
81
|
//#region src/functions/isOnLine.ts
|
|
68
|
-
function
|
|
82
|
+
function u() {
|
|
69
83
|
return typeof navigator > "u" || navigator.onLine;
|
|
70
84
|
}
|
|
71
85
|
//#endregion
|
|
72
86
|
//#region src/functions/isString.ts
|
|
73
|
-
function
|
|
87
|
+
function d(e) {
|
|
74
88
|
return typeof e == "string";
|
|
75
89
|
}
|
|
76
90
|
//#endregion
|
|
77
91
|
//#region src/functions/random.ts
|
|
78
|
-
function
|
|
92
|
+
function f(e, t) {
|
|
79
93
|
return Math.floor(Math.random() * (t - e + 1) + e);
|
|
80
94
|
}
|
|
81
95
|
//#endregion
|
|
82
96
|
//#region src/functions/sleep.ts
|
|
83
|
-
function f(e) {
|
|
84
|
-
return new Promise((t) => setTimeout(t, e));
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/functions/copyObject.ts
|
|
88
97
|
function p(e) {
|
|
89
|
-
return
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/functions/isDomRuntime.ts
|
|
93
|
-
function m() {
|
|
94
|
-
return typeof window < "u" && !!window.document;
|
|
98
|
+
return new Promise((t) => setTimeout(t, e));
|
|
95
99
|
}
|
|
96
100
|
//#endregion
|
|
97
101
|
//#region src/functions/isNumber.ts
|
|
102
|
+
var m = /^-?[0-9]+(\.[0-9]+)?$/;
|
|
98
103
|
function h(e) {
|
|
99
104
|
switch (typeof e) {
|
|
100
|
-
case "number": return
|
|
101
|
-
case "
|
|
105
|
+
case "number": return Number.isFinite(e);
|
|
106
|
+
case "bigint": return !0;
|
|
107
|
+
case "string": return m.test(e.trim());
|
|
102
108
|
default: return !1;
|
|
103
109
|
}
|
|
104
110
|
}
|
|
105
111
|
//#endregion
|
|
106
112
|
//#region src/functions/toNumber.ts
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
var ee = /[^-+\d., ]+/g, te = /( [0-9]{3}[ ,.]|[0-9] [0-9])/, ne = / /g, g = /,/g, re = /,[0-9]{3}[,.]/, ie = /[.][0-9]{3}[,.]/, ae = /[.]/g;
|
|
114
|
+
function _(e) {
|
|
115
|
+
if (typeof e == "number") return Number.isFinite(e) && e || 0;
|
|
109
116
|
if (!e) return 0;
|
|
110
|
-
let t = e.replace(
|
|
111
|
-
return t =
|
|
117
|
+
let t = e.replace(ee, "");
|
|
118
|
+
return t = te.test(t) ? t.replace(ne, "").replace(g, ".") : re.test(t) ? t.replace(g, "") : ie.test(t) ? t.replace(ae, "").replace(g, ".") : t.replace(g, "."), parseFloat(t) || 0;
|
|
112
119
|
}
|
|
113
120
|
//#endregion
|
|
114
121
|
//#region src/functions/isSelected.ts
|
|
115
|
-
function
|
|
116
|
-
return
|
|
122
|
+
function v(e, t) {
|
|
123
|
+
return c(e) ? !1 : Array.isArray(t) ? t.includes(e) : h(e) && h(t) ? _(e) === _(t) : e === t;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/functions/encodeLiteAttribute.ts
|
|
127
|
+
var oe = {
|
|
128
|
+
"<": "<",
|
|
129
|
+
">": ">",
|
|
130
|
+
"&": "&"
|
|
131
|
+
};
|
|
132
|
+
function se(e) {
|
|
133
|
+
return String(e).replace(/[<>&]/g, (e) => {
|
|
134
|
+
var t;
|
|
135
|
+
return (t = oe == null ? void 0 : oe[e]) == null ? e : t;
|
|
136
|
+
});
|
|
117
137
|
}
|
|
118
138
|
//#endregion
|
|
119
139
|
//#region src/functions/isFunction.ts
|
|
120
|
-
function
|
|
140
|
+
function y(e) {
|
|
121
141
|
return e instanceof Function || typeof e == "function";
|
|
122
142
|
}
|
|
123
143
|
//#endregion
|
|
124
144
|
//#region src/functions/executeFunction.ts
|
|
125
|
-
function
|
|
126
|
-
return
|
|
145
|
+
function b(e, ...t) {
|
|
146
|
+
return y(e) ? e(...t) : e;
|
|
127
147
|
}
|
|
128
148
|
//#endregion
|
|
129
149
|
//#region src/functions/isDomData.ts
|
|
130
|
-
function
|
|
131
|
-
return location.href.startsWith("data:");
|
|
150
|
+
function ce() {
|
|
151
|
+
return s() && location.href.startsWith("data:");
|
|
132
152
|
}
|
|
133
153
|
//#endregion
|
|
134
|
-
//#region \0@oxc-project+runtime@0.
|
|
154
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
|
|
135
155
|
function x(e) {
|
|
136
156
|
"@babel/helpers - typeof";
|
|
137
157
|
return x = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -141,8 +161,8 @@ function x(e) {
|
|
|
141
161
|
}, x(e);
|
|
142
162
|
}
|
|
143
163
|
//#endregion
|
|
144
|
-
//#region \0@oxc-project+runtime@0.
|
|
145
|
-
function
|
|
164
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
|
|
165
|
+
function le(e, t) {
|
|
146
166
|
if (x(e) != "object" || !e) return e;
|
|
147
167
|
var n = e[Symbol.toPrimitive];
|
|
148
168
|
if (n !== void 0) {
|
|
@@ -153,15 +173,15 @@ function ee(e, t) {
|
|
|
153
173
|
return (t === "string" ? String : Number)(e);
|
|
154
174
|
}
|
|
155
175
|
//#endregion
|
|
156
|
-
//#region \0@oxc-project+runtime@0.
|
|
157
|
-
function
|
|
158
|
-
var t =
|
|
176
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
|
|
177
|
+
function ue(e) {
|
|
178
|
+
var t = le(e, "string");
|
|
159
179
|
return x(t) == "symbol" ? t : t + "";
|
|
160
180
|
}
|
|
161
181
|
//#endregion
|
|
162
|
-
//#region \0@oxc-project+runtime@0.
|
|
182
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
|
|
163
183
|
function S(e, t, n) {
|
|
164
|
-
return (t =
|
|
184
|
+
return (t = ue(t)) in e ? Object.defineProperty(e, t, {
|
|
165
185
|
value: n,
|
|
166
186
|
enumerable: !0,
|
|
167
187
|
configurable: !0,
|
|
@@ -170,7 +190,7 @@ function S(e, t, n) {
|
|
|
170
190
|
}
|
|
171
191
|
//#endregion
|
|
172
192
|
//#region src/classes/ErrorCenterHandler.ts
|
|
173
|
-
var
|
|
193
|
+
var de = class {
|
|
174
194
|
constructor(e) {
|
|
175
195
|
S(this, "handlers", []), e && this.addList(e);
|
|
176
196
|
}
|
|
@@ -191,18 +211,15 @@ var ne = class {
|
|
|
191
211
|
return e.forEach((e) => e.handlers.forEach((t) => this.add(e.group, t))), this;
|
|
192
212
|
}
|
|
193
213
|
on(e) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
n && n.handlers.forEach((t) => t(e)), this.toConsole(e);
|
|
198
|
-
}
|
|
199
|
-
return this;
|
|
214
|
+
var t;
|
|
215
|
+
let n = (t = this.get(e.group)) == null ? this.get(void 0) : t;
|
|
216
|
+
return n && n.handlers.forEach((t) => t(e)), this.toConsole(e), this;
|
|
200
217
|
}
|
|
201
218
|
toConsole(e) {
|
|
202
219
|
return console.error(`Error Center: ${e.code}`), console.error(e.message), this;
|
|
203
220
|
}
|
|
204
|
-
},
|
|
205
|
-
constructor(e, t = new
|
|
221
|
+
}, fe = class {
|
|
222
|
+
constructor(e, t = new de()) {
|
|
206
223
|
S(this, "causes", []), this.handler = t, e && this.addList(e);
|
|
207
224
|
}
|
|
208
225
|
has(e, t) {
|
|
@@ -228,29 +245,48 @@ var ne = class {
|
|
|
228
245
|
}
|
|
229
246
|
assign(e) {
|
|
230
247
|
let t = this.get(e.code, e.group);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
if (t) {
|
|
249
|
+
var n, r;
|
|
250
|
+
return ((n = t.priority) == null ? 500 : n) > ((r = e.priority) == null ? 500 : r) ? {
|
|
251
|
+
...e,
|
|
252
|
+
...t
|
|
253
|
+
} : {
|
|
254
|
+
...t,
|
|
255
|
+
...e
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
return e;
|
|
235
259
|
}
|
|
236
|
-
},
|
|
260
|
+
}, pe = [
|
|
237
261
|
{
|
|
238
262
|
group: "api",
|
|
239
|
-
code: "
|
|
240
|
-
label: "
|
|
241
|
-
message: "An
|
|
263
|
+
code: "cacheClear",
|
|
264
|
+
label: "Cache Clearing Error",
|
|
265
|
+
message: "An error occurred during background cache cleaning."
|
|
242
266
|
},
|
|
243
267
|
{
|
|
244
268
|
group: "api",
|
|
245
|
-
code: "
|
|
246
|
-
label: "
|
|
247
|
-
message: "
|
|
269
|
+
code: "cacheGet",
|
|
270
|
+
label: "Cache Get Error",
|
|
271
|
+
message: "Failed to retrieve data from the cache."
|
|
248
272
|
},
|
|
249
273
|
{
|
|
250
274
|
group: "api",
|
|
251
|
-
code: "
|
|
252
|
-
label: "
|
|
253
|
-
message: "
|
|
275
|
+
code: "cacheRemove",
|
|
276
|
+
label: "Cache Remove Error",
|
|
277
|
+
message: "Failed to remove data from the cache."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
group: "api",
|
|
281
|
+
code: "cacheSet",
|
|
282
|
+
label: "Cache Set Error",
|
|
283
|
+
message: "Failed to save data to cache."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
group: "api",
|
|
287
|
+
code: "forbidden",
|
|
288
|
+
label: "Forbidden",
|
|
289
|
+
message: "You do not have the necessary permissions to access this resource."
|
|
254
290
|
},
|
|
255
291
|
{
|
|
256
292
|
group: "api",
|
|
@@ -258,12 +294,36 @@ var ne = class {
|
|
|
258
294
|
label: "Resource Not Found",
|
|
259
295
|
message: "The requested resource could not be found on the server."
|
|
260
296
|
},
|
|
297
|
+
{
|
|
298
|
+
group: "api",
|
|
299
|
+
code: "offline",
|
|
300
|
+
label: "No Internet Connection",
|
|
301
|
+
message: "Your device is currently offline. Please check your network settings."
|
|
302
|
+
},
|
|
261
303
|
{
|
|
262
304
|
group: "api",
|
|
263
305
|
code: "server",
|
|
264
306
|
label: "Internal Server Error",
|
|
265
307
|
message: "Something went wrong on our end. We are working to fix it."
|
|
266
308
|
},
|
|
309
|
+
{
|
|
310
|
+
group: "api",
|
|
311
|
+
code: "timeout",
|
|
312
|
+
label: "Request Timeout",
|
|
313
|
+
message: "The request took too long to complete. Please check your connection."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
group: "api",
|
|
317
|
+
code: "unauthorized",
|
|
318
|
+
label: "Unauthorized access",
|
|
319
|
+
message: "Your session has expired, or you do not have permission to access this resource."
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
group: "api",
|
|
323
|
+
code: "unknown",
|
|
324
|
+
label: "Unknown Error",
|
|
325
|
+
message: "An unexpected error occurred. Please try again later."
|
|
326
|
+
},
|
|
267
327
|
{
|
|
268
328
|
group: "broadcast",
|
|
269
329
|
code: "error",
|
|
@@ -271,17 +331,41 @@ var ne = class {
|
|
|
271
331
|
message: "An unexpected error occurred. Please try again later."
|
|
272
332
|
},
|
|
273
333
|
{
|
|
274
|
-
group: "
|
|
334
|
+
group: "clipboard",
|
|
275
335
|
code: "error",
|
|
276
|
-
label: "
|
|
336
|
+
label: "Clipboard Error",
|
|
337
|
+
message: "An unexpected error occurred while accessing the clipboard."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
group: "hydration",
|
|
341
|
+
code: "error",
|
|
342
|
+
label: "Hydration Error",
|
|
343
|
+
message: "An error occurred during data hydration."
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
group: "intl",
|
|
347
|
+
code: "datetime",
|
|
348
|
+
label: "Intl Datetime Error",
|
|
277
349
|
message: "An unexpected error occurred. Please try again later."
|
|
278
350
|
},
|
|
351
|
+
{
|
|
352
|
+
group: "intl",
|
|
353
|
+
code: "invalid",
|
|
354
|
+
label: "Invalid Date",
|
|
355
|
+
message: "The provided date is invalid or in an incorrect format."
|
|
356
|
+
},
|
|
279
357
|
{
|
|
280
358
|
group: "intl",
|
|
281
359
|
code: "display",
|
|
282
360
|
label: "Intl Display Error",
|
|
283
361
|
message: "An unexpected error occurred. Please try again later."
|
|
284
362
|
},
|
|
363
|
+
{
|
|
364
|
+
group: "intl",
|
|
365
|
+
code: "number",
|
|
366
|
+
label: "Intl Number Error",
|
|
367
|
+
message: "An unexpected error occurred. Please try again later."
|
|
368
|
+
},
|
|
285
369
|
{
|
|
286
370
|
group: "intl",
|
|
287
371
|
code: "plural",
|
|
@@ -295,68 +379,175 @@ var ne = class {
|
|
|
295
379
|
message: "An unexpected error occurred. Please try again later."
|
|
296
380
|
},
|
|
297
381
|
{
|
|
298
|
-
group: "
|
|
299
|
-
code: "
|
|
300
|
-
label: "
|
|
301
|
-
message: "An unexpected error occurred
|
|
382
|
+
group: "share",
|
|
383
|
+
code: "error",
|
|
384
|
+
label: "Share Error",
|
|
385
|
+
message: "An unexpected error occurred during sharing."
|
|
302
386
|
},
|
|
303
387
|
{
|
|
304
|
-
group: "
|
|
305
|
-
code: "
|
|
306
|
-
label: "
|
|
388
|
+
group: "storage",
|
|
389
|
+
code: "context",
|
|
390
|
+
label: "Context Missing Error",
|
|
391
|
+
message: "Storage context is missing (is init() called?). Isolation failed: data will not be saved for this request."
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
group: "storage",
|
|
395
|
+
code: "error",
|
|
396
|
+
label: "Storage Error",
|
|
307
397
|
message: "An unexpected error occurred. Please try again later."
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
group: "transformation",
|
|
401
|
+
code: "error",
|
|
402
|
+
label: "Transformation Error",
|
|
403
|
+
message: "An error occurred during data transformation."
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
group: "translate",
|
|
407
|
+
code: "error",
|
|
408
|
+
label: "Translate Error",
|
|
409
|
+
message: "An error occurred while loading translations."
|
|
308
410
|
}
|
|
309
411
|
], C = class {
|
|
412
|
+
static getItem() {
|
|
413
|
+
return this.item;
|
|
414
|
+
}
|
|
310
415
|
static has(e, t) {
|
|
311
|
-
return this.
|
|
416
|
+
return this.getItem().has(e, t);
|
|
312
417
|
}
|
|
313
418
|
static get(e, t) {
|
|
314
|
-
return this.
|
|
315
|
-
}
|
|
316
|
-
static getItem() {
|
|
317
|
-
return this.item;
|
|
419
|
+
return this.getItem().get(e, t);
|
|
318
420
|
}
|
|
319
421
|
static add(e) {
|
|
320
|
-
|
|
422
|
+
this.getItem().add(e);
|
|
321
423
|
}
|
|
322
424
|
static addList(e) {
|
|
323
|
-
|
|
425
|
+
this.getItem().addList(e);
|
|
324
426
|
}
|
|
325
427
|
static addHandler(e, t) {
|
|
326
|
-
|
|
428
|
+
this.getItem().addHandler(e, t);
|
|
327
429
|
}
|
|
328
430
|
static addHandlerList(e) {
|
|
329
|
-
|
|
431
|
+
this.getItem().addHandlerList(e);
|
|
330
432
|
}
|
|
331
433
|
static on(e) {
|
|
332
|
-
|
|
434
|
+
this.getItem().on(e);
|
|
333
435
|
}
|
|
334
436
|
};
|
|
335
|
-
S(C, "item", new
|
|
437
|
+
S(C, "item", new fe(pe));
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/functions/getElementSafeScript.ts
|
|
440
|
+
function me(e, t) {
|
|
441
|
+
return `<script id="${e.replace(/"/g, """)}" type="application/json">${JSON.stringify(t).replace(/<\/(script)>/gi, "<\\/$1>")}<\/script>`;
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/functions/getHydrationData.ts
|
|
445
|
+
function he(e, t, n = !0) {
|
|
446
|
+
if (typeof document < "u") {
|
|
447
|
+
let t = document.getElementById(e);
|
|
448
|
+
if (t) try {
|
|
449
|
+
let e = JSON.parse(t.textContent || "");
|
|
450
|
+
return n && t.remove(), e;
|
|
451
|
+
} catch (t) {
|
|
452
|
+
C.on({
|
|
453
|
+
group: "hydration",
|
|
454
|
+
code: "error",
|
|
455
|
+
details: {
|
|
456
|
+
id: e,
|
|
457
|
+
error: t
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return t;
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/classes/ServerStorage.ts
|
|
466
|
+
var w = "__ui:server-storage__", ge = "__ui:server:storage:id__", T = class {
|
|
467
|
+
static init(e) {
|
|
468
|
+
return this.listener || (this.listener = e), this;
|
|
469
|
+
}
|
|
470
|
+
static reset() {
|
|
471
|
+
this.storage = void 0, this.listener = void 0;
|
|
472
|
+
}
|
|
473
|
+
static has(e) {
|
|
474
|
+
return e in this.getStorage();
|
|
475
|
+
}
|
|
476
|
+
static get(e, t, n = !1) {
|
|
477
|
+
let r = this.getStorage();
|
|
478
|
+
if (e in r) return r[e].value;
|
|
479
|
+
if (t) return this.set(e, t, n);
|
|
480
|
+
}
|
|
481
|
+
static set(e, t, n = !1) {
|
|
482
|
+
let r = this.getStorage(), i = t();
|
|
483
|
+
return r[e] = {
|
|
484
|
+
value: i,
|
|
485
|
+
hydration: n
|
|
486
|
+
}, i;
|
|
487
|
+
}
|
|
488
|
+
static setErrorStatus(e) {
|
|
489
|
+
this.hideError = e;
|
|
490
|
+
}
|
|
491
|
+
static remove(e) {
|
|
492
|
+
let t = this.getStorage();
|
|
493
|
+
e in t && delete t[e];
|
|
494
|
+
}
|
|
495
|
+
static toString() {
|
|
496
|
+
return me(ge, this.getDataForHydration());
|
|
497
|
+
}
|
|
498
|
+
static getStorage() {
|
|
499
|
+
var e;
|
|
500
|
+
if (s()) return this.getStorageDom();
|
|
501
|
+
let t = (e = this.listener) == null ? void 0 : e.call(this);
|
|
502
|
+
return t ? (w in t || (t[w] = {}), t[w]) : (this.hideError || C.on({
|
|
503
|
+
group: "storage",
|
|
504
|
+
code: "context"
|
|
505
|
+
}), this.storage || (this.storage = {}), this.storage);
|
|
506
|
+
}
|
|
507
|
+
static getStorageDom() {
|
|
508
|
+
if (!this.storage) {
|
|
509
|
+
let e = he(ge, {});
|
|
510
|
+
this.storage = {}, r(e, (e, t) => {
|
|
511
|
+
this.storage[t] = {
|
|
512
|
+
value: e,
|
|
513
|
+
hydration: !0
|
|
514
|
+
};
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
return this.storage;
|
|
518
|
+
}
|
|
519
|
+
static getDataForHydration() {
|
|
520
|
+
let e = this.getStorage(), t = {};
|
|
521
|
+
return r(e, (e, n) => {
|
|
522
|
+
e.hydration && (t[n] = e.value);
|
|
523
|
+
}), t;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
S(T, "storage", void 0), S(T, "listener", void 0), S(T, "hideError", void 0);
|
|
336
527
|
//#endregion
|
|
337
528
|
//#region src/classes/DataStorage.ts
|
|
338
|
-
var
|
|
529
|
+
var _e = "ui-storage", ve = () => T.get("__ui:data-storage__", () => ({})), E = class {
|
|
339
530
|
static setPrefix(e) {
|
|
340
|
-
|
|
531
|
+
_e = e;
|
|
341
532
|
}
|
|
342
533
|
constructor(e, t = !1, n = C.getItem()) {
|
|
343
534
|
S(this, "value", void 0), S(this, "age", void 0), this.name = e, this.isSession = t, this.errorCenter = n;
|
|
344
|
-
let r = `${t ? "session" : "storage"}#${e}
|
|
345
|
-
if (r in
|
|
346
|
-
this.make(),
|
|
535
|
+
let r = `${t ? "session" : "storage"}#${e}`, i = ve();
|
|
536
|
+
if (r in i) return i[r];
|
|
537
|
+
this.make(), i[r] = this;
|
|
347
538
|
}
|
|
348
539
|
get(e, t) {
|
|
349
|
-
if (this.value
|
|
540
|
+
if (!c(this.value) && this.isCache(t)) return this.value;
|
|
350
541
|
if (e !== void 0) return this.set(e);
|
|
351
542
|
}
|
|
352
543
|
set(e) {
|
|
353
|
-
if (this.value =
|
|
544
|
+
if (this.value = b(e), this.age = Date.now(), this.value === void 0) this.remove();
|
|
354
545
|
else {
|
|
355
546
|
var t;
|
|
356
|
-
(t = this.getMethod()) == null || t.setItem(this.getIndex(), JSON.stringify({
|
|
547
|
+
(t = this.getMethod()) == null || t.setItem(this.getIndex(), se(JSON.stringify({
|
|
357
548
|
value: this.value,
|
|
358
549
|
age: this.age
|
|
359
|
-
}));
|
|
550
|
+
})));
|
|
360
551
|
}
|
|
361
552
|
return this.value;
|
|
362
553
|
}
|
|
@@ -368,23 +559,23 @@ var w = {}, ae = "ui-storage", T = class {
|
|
|
368
559
|
return this.make(), this;
|
|
369
560
|
}
|
|
370
561
|
isCache(e) {
|
|
371
|
-
return
|
|
562
|
+
return c(e) || this.age && this.age + e * 1e3 >= Date.now();
|
|
372
563
|
}
|
|
373
564
|
getMethod() {
|
|
374
|
-
if (
|
|
565
|
+
if (s() && !ce()) {
|
|
375
566
|
var e, t;
|
|
376
567
|
let n = this.isSession ? (e = window) == null ? void 0 : e.sessionStorage : (t = window) == null ? void 0 : t.localStorage;
|
|
377
568
|
if (n) return n;
|
|
378
569
|
}
|
|
379
570
|
}
|
|
380
571
|
getIndex() {
|
|
381
|
-
return `${
|
|
572
|
+
return `${_e}__${this.name}`;
|
|
382
573
|
}
|
|
383
574
|
getValue() {
|
|
384
|
-
var e;
|
|
385
|
-
let
|
|
386
|
-
if (
|
|
387
|
-
return JSON.parse(
|
|
575
|
+
var e, t;
|
|
576
|
+
let n = (e = this.getMethod()) == null || (t = e.getItem) == null ? void 0 : t.call(e, this.getIndex());
|
|
577
|
+
if (n) try {
|
|
578
|
+
return JSON.parse(n);
|
|
388
579
|
} catch (e) {
|
|
389
580
|
this.errorCenter.on({
|
|
390
581
|
group: "storage",
|
|
@@ -397,134 +588,198 @@ var w = {}, ae = "ui-storage", T = class {
|
|
|
397
588
|
let e = this.getValue();
|
|
398
589
|
return e ? (this.value = e.value, this.age = e.age) : (this.value = void 0, this.age = void 0), this;
|
|
399
590
|
}
|
|
400
|
-
},
|
|
401
|
-
|
|
591
|
+
}, ye = "__ui:geo-code__", be = class {
|
|
592
|
+
constructor() {
|
|
593
|
+
S(this, "storage", new E(ye)), S(this, "location", void 0), S(this, "item", void 0), S(this, "language", void 0), S(this, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), this.location = this.findLocation(), this.item = this.getByCode(this.location), this.language = this.findLanguage(this.location);
|
|
594
|
+
}
|
|
595
|
+
get() {
|
|
402
596
|
return this.item;
|
|
403
597
|
}
|
|
404
|
-
|
|
598
|
+
getCountry() {
|
|
405
599
|
return this.item.country;
|
|
406
600
|
}
|
|
407
|
-
|
|
601
|
+
getLanguage() {
|
|
408
602
|
return this.language;
|
|
409
603
|
}
|
|
410
|
-
|
|
411
|
-
return this.
|
|
604
|
+
getStandard() {
|
|
605
|
+
return this.getItem().standard;
|
|
412
606
|
}
|
|
413
|
-
|
|
607
|
+
getFirstDay() {
|
|
414
608
|
return this.item.firstDay;
|
|
415
609
|
}
|
|
416
|
-
|
|
610
|
+
getLocation() {
|
|
417
611
|
return this.location;
|
|
418
612
|
}
|
|
419
|
-
|
|
420
|
-
return
|
|
613
|
+
getItem() {
|
|
614
|
+
return {
|
|
615
|
+
...this.item,
|
|
616
|
+
language: this.language,
|
|
617
|
+
standard: `${this.language}-${this.item.country}`
|
|
618
|
+
};
|
|
421
619
|
}
|
|
422
|
-
|
|
620
|
+
getList() {
|
|
423
621
|
return e;
|
|
424
622
|
}
|
|
425
|
-
|
|
623
|
+
getByCode(e) {
|
|
426
624
|
var t;
|
|
427
625
|
let n;
|
|
428
|
-
return e && (
|
|
626
|
+
return e && (/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/.test(e) && (n = this.getByCodeFull(e)), !n && /[a-z]{2}/.test(e) && (n = this.getByLanguage(this.toLanguage(e))), !n && /[A-Z]{2}/.test(e) && (n = this.getByCountry(this.toCountry(e)))), this.toFull((t = n) == null ? this.getList()[0] : t);
|
|
429
627
|
}
|
|
430
|
-
|
|
431
|
-
return this.getList().find((t) =>
|
|
628
|
+
getByCodeFull(e) {
|
|
629
|
+
return this.getList().find((t) => v(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
|
|
432
630
|
}
|
|
433
|
-
|
|
631
|
+
getByCountry(e) {
|
|
434
632
|
return this.getList().find((t) => {
|
|
435
633
|
var n;
|
|
436
|
-
return t.country === e || (t == null || (n = t.countryAlternative) == null ? void 0 : n.
|
|
634
|
+
return t.country === e || (t == null || (n = t.countryAlternative) == null ? void 0 : n.includes(e));
|
|
437
635
|
});
|
|
438
636
|
}
|
|
439
|
-
|
|
637
|
+
getByLanguage(e) {
|
|
440
638
|
return this.getList().find((t) => {
|
|
441
639
|
var n;
|
|
442
|
-
return t.language === e || (t == null || (n = t.languageAlternative) == null ? void 0 : n.
|
|
640
|
+
return t.language === e || (t == null || (n = t.languageAlternative) == null ? void 0 : n.includes(e));
|
|
443
641
|
});
|
|
444
642
|
}
|
|
445
|
-
|
|
643
|
+
getTimezone() {
|
|
446
644
|
return this.timezone;
|
|
447
645
|
}
|
|
448
|
-
|
|
646
|
+
getTimezoneFormat() {
|
|
449
647
|
let e = Math.abs(Math.trunc(this.timezone / 60)).toString().padStart(2, "0"), t = Math.abs(this.timezone % 60).toString().padStart(2, "0");
|
|
450
648
|
return this.timezone >= 0 ? `-${e}:${t}` : `+${e}:${t}`;
|
|
451
649
|
}
|
|
452
|
-
|
|
650
|
+
find(e) {
|
|
453
651
|
return this.getByCode(e);
|
|
454
652
|
}
|
|
455
|
-
|
|
653
|
+
toStandard(e) {
|
|
456
654
|
return `${e.language}-${e.country}`;
|
|
457
655
|
}
|
|
458
|
-
|
|
656
|
+
set(e, t) {
|
|
459
657
|
this.location = e, this.item = this.getByCode(this.location), this.language = this.findLanguage(this.location), t && this.storage.set(this.location);
|
|
460
658
|
}
|
|
461
|
-
|
|
659
|
+
setTimezone(e) {
|
|
462
660
|
this.timezone = e;
|
|
463
661
|
}
|
|
464
|
-
|
|
662
|
+
findLocation() {
|
|
465
663
|
var e;
|
|
466
|
-
return
|
|
664
|
+
return s() && (this.storage.get() || ((e = document.querySelector("html")) == null ? void 0 : e.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
|
|
467
665
|
}
|
|
468
|
-
|
|
469
|
-
return e &&
|
|
666
|
+
findLanguage(e) {
|
|
667
|
+
return e && /[a-z]{2}/.test(e) ? this.toLanguage(e) : this.item.language;
|
|
470
668
|
}
|
|
471
|
-
|
|
669
|
+
toCountry(e) {
|
|
472
670
|
return e.replace(/[^A-Z]+/g, "");
|
|
473
671
|
}
|
|
474
|
-
|
|
672
|
+
toLanguage(e) {
|
|
475
673
|
return e.replace(/[^a-z]+/g, "");
|
|
476
674
|
}
|
|
477
|
-
|
|
478
|
-
return
|
|
675
|
+
toFull(e) {
|
|
676
|
+
return {
|
|
677
|
+
...e,
|
|
479
678
|
standard: this.toStandard(e),
|
|
480
679
|
firstDay: (e == null ? void 0 : e.firstDay) || "Mo"
|
|
481
|
-
}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
}, D = class {
|
|
683
|
+
static getObject() {
|
|
684
|
+
return T.get("__ui:geo-instance__", () => new be());
|
|
685
|
+
}
|
|
686
|
+
static get() {
|
|
687
|
+
return this.getObject().get();
|
|
688
|
+
}
|
|
689
|
+
static getCountry() {
|
|
690
|
+
return this.getObject().getCountry();
|
|
691
|
+
}
|
|
692
|
+
static getLanguage() {
|
|
693
|
+
return this.getObject().getLanguage();
|
|
694
|
+
}
|
|
695
|
+
static getStandard() {
|
|
696
|
+
return this.getObject().getStandard();
|
|
697
|
+
}
|
|
698
|
+
static getFirstDay() {
|
|
699
|
+
return this.getObject().getFirstDay();
|
|
700
|
+
}
|
|
701
|
+
static getLocation() {
|
|
702
|
+
return this.getObject().getLocation();
|
|
703
|
+
}
|
|
704
|
+
static getItem() {
|
|
705
|
+
return this.getObject().getItem();
|
|
706
|
+
}
|
|
707
|
+
static getList() {
|
|
708
|
+
return this.getObject().getList();
|
|
709
|
+
}
|
|
710
|
+
static getByCode(e) {
|
|
711
|
+
return this.getObject().getByCode(e);
|
|
712
|
+
}
|
|
713
|
+
static getByCodeFull(e) {
|
|
714
|
+
return this.getObject().getByCodeFull(e);
|
|
715
|
+
}
|
|
716
|
+
static getByCountry(e) {
|
|
717
|
+
return this.getObject().getByCountry(e);
|
|
718
|
+
}
|
|
719
|
+
static getByLanguage(e) {
|
|
720
|
+
return this.getObject().getByLanguage(e);
|
|
721
|
+
}
|
|
722
|
+
static getTimezone() {
|
|
723
|
+
return this.getObject().getTimezone();
|
|
724
|
+
}
|
|
725
|
+
static getTimezoneFormat() {
|
|
726
|
+
return this.getObject().getTimezoneFormat();
|
|
727
|
+
}
|
|
728
|
+
static find(e) {
|
|
729
|
+
return this.getObject().find(e);
|
|
730
|
+
}
|
|
731
|
+
static toStandard(e) {
|
|
732
|
+
return this.getObject().toStandard(e);
|
|
733
|
+
}
|
|
734
|
+
static set(e, t) {
|
|
735
|
+
this.getObject().set(e, t);
|
|
736
|
+
}
|
|
737
|
+
static setTimezone(e) {
|
|
738
|
+
this.getObject().setTimezone(e);
|
|
482
739
|
}
|
|
483
740
|
};
|
|
484
|
-
E = D, S(D, "storage", new T(oe)), S(D, "location", void 0), S(D, "item", void 0), S(D, "language", void 0), S(D, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), E.location = E.findLocation(), E.language = E.findLanguage(E.location), E.item = E.getByCode(E.location);
|
|
485
741
|
//#endregion
|
|
486
742
|
//#region src/functions/isWindow.ts
|
|
487
|
-
function
|
|
488
|
-
return
|
|
743
|
+
function xe(e) {
|
|
744
|
+
return s() && e === window;
|
|
489
745
|
}
|
|
490
746
|
//#endregion
|
|
491
747
|
//#region src/functions/getElement.ts
|
|
492
|
-
function
|
|
493
|
-
if (
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
return e;
|
|
748
|
+
function O(e) {
|
|
749
|
+
if (!s()) return d(e) ? void 0 : e;
|
|
750
|
+
if (xe(e)) return document.body;
|
|
751
|
+
if (d(e)) {
|
|
752
|
+
var t;
|
|
753
|
+
return (t = document.querySelector(e)) == null ? void 0 : t;
|
|
500
754
|
}
|
|
755
|
+
return e;
|
|
501
756
|
}
|
|
502
757
|
//#endregion
|
|
503
758
|
//#region src/functions/getElementOrWindow.ts
|
|
504
|
-
function
|
|
505
|
-
return
|
|
759
|
+
function Se(e) {
|
|
760
|
+
return xe(e) ? e : O(e);
|
|
506
761
|
}
|
|
507
762
|
//#endregion
|
|
508
763
|
//#region src/functions/isInDom.ts
|
|
509
|
-
function
|
|
764
|
+
function Ce(e) {
|
|
510
765
|
var t;
|
|
511
|
-
return !!((t =
|
|
766
|
+
return (e == null ? void 0 : e.isConnected) || !!((t = O(e)) != null && t.closest("html"));
|
|
512
767
|
}
|
|
513
768
|
//#endregion
|
|
514
769
|
//#region src/functions/toArray.ts
|
|
515
|
-
function
|
|
770
|
+
function k(e) {
|
|
516
771
|
return Array.isArray(e) ? e : [e];
|
|
517
772
|
}
|
|
518
773
|
//#endregion
|
|
519
774
|
//#region src/classes/EventItem.ts
|
|
520
|
-
var
|
|
775
|
+
var we = class {
|
|
521
776
|
constructor(e, n = ["click"], r, i, a) {
|
|
522
777
|
S(this, "element", void 0), S(this, "elementControl", void 0), S(this, "elementControlEdit", void 0), S(this, "type", void 0), S(this, "listenerRecent", (e) => {
|
|
523
|
-
if (
|
|
778
|
+
if (Ce(this.elementControl)) {
|
|
524
779
|
var n, r;
|
|
525
780
|
(n = this.listener) == null || n.call(this.element, e, this.detail), t(this.options) && (r = this.options) != null && r.once && this.stop();
|
|
526
781
|
} else this.stop();
|
|
527
|
-
}), S(this, "activity", !1), S(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element =
|
|
782
|
+
}), S(this, "activity", !1), S(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element = Se(e), this.elementControl = O(e), this.type = k(n);
|
|
528
783
|
}
|
|
529
784
|
isActive() {
|
|
530
785
|
return this.activity;
|
|
@@ -533,14 +788,14 @@ var le = class {
|
|
|
533
788
|
return this.element;
|
|
534
789
|
}
|
|
535
790
|
setElement(e) {
|
|
536
|
-
let t =
|
|
537
|
-
return this.elementControlEdit || (this.elementControl =
|
|
791
|
+
let t = Se(e);
|
|
792
|
+
return this.elementControlEdit || (this.elementControl = O(e)), this.element = t, this.reset(), this;
|
|
538
793
|
}
|
|
539
794
|
setElementControl(e) {
|
|
540
|
-
return this.elementControl =
|
|
795
|
+
return this.elementControl = O(e), this.elementControlEdit = !c(this.elementControl), this.elementControlEdit || (this.elementControl = O(this.element)), this;
|
|
541
796
|
}
|
|
542
797
|
setType(e) {
|
|
543
|
-
return this.type =
|
|
798
|
+
return this.type = k(e), this.reset(), this;
|
|
544
799
|
}
|
|
545
800
|
setListener(e) {
|
|
546
801
|
return this.listener = e, this;
|
|
@@ -558,7 +813,7 @@ var le = class {
|
|
|
558
813
|
}), this;
|
|
559
814
|
}
|
|
560
815
|
start() {
|
|
561
|
-
return this.activity
|
|
816
|
+
return !this.activity && s() && (this.activity = !0, this.activityItems = [], this.type.forEach((e) => {
|
|
562
817
|
this.element && !(e === "resize" && this.makeResize()) && !(e === "scroll-sync" && this.makeScroll()) && (this.element.addEventListener(e, this.listenerRecent, this.options), this.activityItems.push({
|
|
563
818
|
element: this.element,
|
|
564
819
|
type: e
|
|
@@ -577,7 +832,7 @@ var le = class {
|
|
|
577
832
|
return this.activity && (this.stop(), this.start()), this;
|
|
578
833
|
}
|
|
579
834
|
isObserver() {
|
|
580
|
-
return "ResizeObserver" in window;
|
|
835
|
+
return s() && "ResizeObserver" in window;
|
|
581
836
|
}
|
|
582
837
|
makeResize() {
|
|
583
838
|
if (this.element && this.element instanceof HTMLElement && this.element !== document.body && this.isObserver()) {
|
|
@@ -609,9 +864,9 @@ var le = class {
|
|
|
609
864
|
}
|
|
610
865
|
return !1;
|
|
611
866
|
}
|
|
612
|
-
},
|
|
613
|
-
constructor(e =
|
|
614
|
-
S(this, "value", 0), S(this, "event", void 0), S(this, "registrationList", []), this.eventName = e,
|
|
867
|
+
}, Te = "ui-loading", Ee = class {
|
|
868
|
+
constructor(e = Te) {
|
|
869
|
+
S(this, "value", 0), S(this, "event", void 0), S(this, "registrationList", []), this.eventName = e, s() && (this.event = new we(window, this.eventName));
|
|
615
870
|
}
|
|
616
871
|
is() {
|
|
617
872
|
return this.value > 0;
|
|
@@ -626,8 +881,8 @@ var le = class {
|
|
|
626
881
|
this.is() && (this.value--, this.dispatch());
|
|
627
882
|
}
|
|
628
883
|
registrationEvent(e, t) {
|
|
629
|
-
if (
|
|
630
|
-
let n = new
|
|
884
|
+
if (s()) {
|
|
885
|
+
let n = new we(window, this.eventName, e).setElementControl(t).start();
|
|
631
886
|
this.registrationList.push({
|
|
632
887
|
item: n,
|
|
633
888
|
listener: e,
|
|
@@ -642,72 +897,117 @@ var le = class {
|
|
|
642
897
|
var e;
|
|
643
898
|
(e = this.event) == null || e.dispatch({ loading: this.is() });
|
|
644
899
|
}
|
|
645
|
-
},
|
|
900
|
+
}, A = class {
|
|
646
901
|
static is() {
|
|
647
|
-
return this.
|
|
902
|
+
return this.getItem().is();
|
|
648
903
|
}
|
|
649
904
|
static get() {
|
|
650
|
-
return this.
|
|
905
|
+
return this.getItem().get();
|
|
651
906
|
}
|
|
652
907
|
static getItem() {
|
|
653
|
-
return
|
|
908
|
+
return T.get("__ui:loading-instance__", () => new Ee());
|
|
654
909
|
}
|
|
655
910
|
static show() {
|
|
656
|
-
this.
|
|
911
|
+
this.getItem().show();
|
|
657
912
|
}
|
|
658
913
|
static hide() {
|
|
659
|
-
this.
|
|
914
|
+
this.getItem().hide();
|
|
660
915
|
}
|
|
661
916
|
static registrationEvent(e, t) {
|
|
662
|
-
this.
|
|
917
|
+
this.getItem().registrationEvent(e, t);
|
|
663
918
|
}
|
|
664
919
|
static unregistrationEvent(e, t) {
|
|
665
|
-
this.
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
S(j, "item", new de());
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/classes/ApiHeaders.ts
|
|
671
|
-
var fe = class {
|
|
672
|
-
constructor() {
|
|
673
|
-
S(this, "headers", {});
|
|
920
|
+
this.getItem().unregistrationEvent(e, t);
|
|
674
921
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
return c(t) && (n["Content-Type"] = t), n;
|
|
679
|
-
}
|
|
922
|
+
}, De, Oe = 1440 * 60, j = class {
|
|
923
|
+
static init(e, t, n, r) {
|
|
924
|
+
this.getListener = e, this.setListener = t, this.removeListener = n, r && (this.cacheStepAgeClearOld = r, this.stepAgeClearOld = r);
|
|
680
925
|
}
|
|
681
|
-
|
|
682
|
-
|
|
926
|
+
static reset() {
|
|
927
|
+
this.items = void 0, this.getListener = void 0, this.setListener = void 0, this.removeListener = void 0, this.stepAgeClearOld = this.cacheStepAgeClearOld;
|
|
683
928
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
929
|
+
static async get(e) {
|
|
930
|
+
let t = await this.getItemOrListener(e);
|
|
931
|
+
return this.clearOld().catch((e) => {
|
|
932
|
+
C.on({
|
|
933
|
+
group: "api",
|
|
934
|
+
code: "cacheClear",
|
|
935
|
+
details: e
|
|
936
|
+
});
|
|
937
|
+
}), t == null ? void 0 : t.value;
|
|
689
938
|
}
|
|
690
|
-
|
|
691
|
-
|
|
939
|
+
static async getByFetch(e) {
|
|
940
|
+
if (!this.isCache(e)) return;
|
|
941
|
+
let t = this.generateKey(e);
|
|
942
|
+
return await this.get(t);
|
|
692
943
|
}
|
|
693
|
-
|
|
694
|
-
|
|
944
|
+
static async set(e, t, n = Oe) {
|
|
945
|
+
let r = {
|
|
946
|
+
value: t,
|
|
947
|
+
age: n,
|
|
948
|
+
cacheAge: Date.now()
|
|
949
|
+
};
|
|
950
|
+
await this.setItemOrListener(e, r);
|
|
695
951
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
else if (n(e)) return r(t, e);
|
|
952
|
+
static async setByFetch(e, t) {
|
|
953
|
+
if (this.isCache(e)) {
|
|
954
|
+
let n = this.generateKey(e);
|
|
955
|
+
await this.set(n, t, e.cache);
|
|
701
956
|
}
|
|
702
|
-
return e;
|
|
703
957
|
}
|
|
704
|
-
|
|
705
|
-
this.
|
|
958
|
+
static async remove(e) {
|
|
959
|
+
await this.removeItemOrListener(e);
|
|
960
|
+
}
|
|
961
|
+
static isCache(e) {
|
|
962
|
+
let { cache: t, enableClientCache: n } = e;
|
|
963
|
+
return s() && !n ? !1 : !!t;
|
|
964
|
+
}
|
|
965
|
+
static isAge(e) {
|
|
966
|
+
return e ? e.age ? e.age * 1e3 + e.cacheAge >= Date.now() : !0 : !1;
|
|
967
|
+
}
|
|
968
|
+
static isItem(e) {
|
|
969
|
+
return e in this.getList();
|
|
970
|
+
}
|
|
971
|
+
static generateKey(e) {
|
|
972
|
+
return JSON.stringify({
|
|
973
|
+
api: e.api,
|
|
974
|
+
auth: e.auth,
|
|
975
|
+
method: e.method,
|
|
976
|
+
path: e.path,
|
|
977
|
+
pathFull: e.pathFull,
|
|
978
|
+
request: e.request,
|
|
979
|
+
toData: e.toData,
|
|
980
|
+
cacheId: e.cacheId
|
|
981
|
+
});
|
|
706
982
|
}
|
|
707
|
-
|
|
708
|
-
|
|
983
|
+
static async getItemOrListener(e) {
|
|
984
|
+
let t = this.getListener ? await this.getListener(e) : this.getList()[e];
|
|
985
|
+
if (this.isAge(t)) return t;
|
|
709
986
|
}
|
|
710
|
-
|
|
987
|
+
static getList() {
|
|
988
|
+
return this.items || (this.items = {}), this.items;
|
|
989
|
+
}
|
|
990
|
+
static async setItemOrListener(e, t) {
|
|
991
|
+
let n = this.setListener ? await this.setListener(e, t) : !1;
|
|
992
|
+
this.getList()[e] = {
|
|
993
|
+
...t,
|
|
994
|
+
value: n ? void 0 : t.value
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
static async removeItemOrListener(e) {
|
|
998
|
+
this.removeListener && await this.removeListener(e), this.isItem(e) && delete this.getList()[e];
|
|
999
|
+
}
|
|
1000
|
+
static async clearOld() {
|
|
1001
|
+
if (!(this.stepAgeClearOld-- > 0) && (this.stepAgeClearOld = this.cacheStepAgeClearOld, this.items)) for (let e in this.items) {
|
|
1002
|
+
let t = this.items[e];
|
|
1003
|
+
this.isAge(t) || await this.removeItemOrListener(e);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
De = j, S(j, "items", void 0), S(j, "getListener", void 0), S(j, "setListener", void 0), S(j, "removeListener", void 0), S(j, "cacheStepAgeClearOld", 16384), S(j, "stepAgeClearOld", De.cacheStepAgeClearOld);
|
|
1008
|
+
//#endregion
|
|
1009
|
+
//#region src/classes/ApiStatus.ts
|
|
1010
|
+
var ke = class {
|
|
711
1011
|
constructor() {
|
|
712
1012
|
S(this, "value", void 0);
|
|
713
1013
|
}
|
|
@@ -726,6 +1026,10 @@ var fe = class {
|
|
|
726
1026
|
var e;
|
|
727
1027
|
return (e = this.get()) == null ? void 0 : e.lastStatus;
|
|
728
1028
|
}
|
|
1029
|
+
getCode() {
|
|
1030
|
+
var e;
|
|
1031
|
+
return (e = this.get()) == null ? void 0 : e.lastCode;
|
|
1032
|
+
}
|
|
729
1033
|
getError() {
|
|
730
1034
|
var e;
|
|
731
1035
|
return (e = this.get()) == null ? void 0 : e.error;
|
|
@@ -739,7 +1043,7 @@ var fe = class {
|
|
|
739
1043
|
return ((e = this.get()) == null ? void 0 : e.lastMessage) || "";
|
|
740
1044
|
}
|
|
741
1045
|
set(e) {
|
|
742
|
-
return "status" in e && this.setValue("status", e.status), "statusText" in e && this.setValue("statusText", e.statusText), "error" in e && this.setValue("error", e.error), "lastResponse" in e && this.setValue("lastResponse", e.lastResponse), "lastMessage" in e && this.setValue("lastMessage", e.lastMessage), this;
|
|
1046
|
+
return "status" in e && this.setValue("status", e.status), "statusText" in e && this.setValue("statusText", e.statusText), "error" in e && this.setValue("error", e.error), "lastResponse" in e && this.setValue("lastResponse", e.lastResponse), "lastMessage" in e && this.setValue("lastMessage", e.lastMessage), "lastStatus" in e && this.setValue("lastStatus", e.lastStatus), "lastCode" in e && this.setValue("lastCode", e.lastCode), this;
|
|
743
1047
|
}
|
|
744
1048
|
setStatus(e, t) {
|
|
745
1049
|
return this.set({
|
|
@@ -751,27 +1055,163 @@ var fe = class {
|
|
|
751
1055
|
return this.set({ error: e }), this;
|
|
752
1056
|
}
|
|
753
1057
|
setLastResponse(e) {
|
|
754
|
-
return e && n(e) && ("message" in e && this.setLastMessage(String(e.message)), "status" in e && this.setLastStatus(String(e.status))), this.set({ lastResponse: e }), this;
|
|
1058
|
+
return e && n(e) && ("message" in e && this.setLastMessage(String(e.message)), "status" in e && this.setLastStatus(String(e.status)), "code" in e && this.setLastCode(String(e.code))), this.set({ lastResponse: e }), this;
|
|
755
1059
|
}
|
|
756
1060
|
setLastStatus(e) {
|
|
757
1061
|
return this.set({ lastStatus: e }), this;
|
|
758
1062
|
}
|
|
1063
|
+
setLastCode(e) {
|
|
1064
|
+
return this.set({ lastCode: e }), this;
|
|
1065
|
+
}
|
|
759
1066
|
setLastMessage(e) {
|
|
760
1067
|
return this.set({ lastMessage: e }), this;
|
|
761
1068
|
}
|
|
762
1069
|
setValue(e, t) {
|
|
763
1070
|
this.value || (this.value = {}), this.value[e] = t;
|
|
764
1071
|
}
|
|
1072
|
+
}, Ae = [
|
|
1073
|
+
"success",
|
|
1074
|
+
"status",
|
|
1075
|
+
"code",
|
|
1076
|
+
"message"
|
|
1077
|
+
], je = class {
|
|
1078
|
+
constructor(e, t, n) {
|
|
1079
|
+
S(this, "data", void 0), S(this, "dataMod", void 0), this.apiFetch = e, this.query = t, this.end = n;
|
|
1080
|
+
}
|
|
1081
|
+
async init() {
|
|
1082
|
+
return this.data = await this.readData(), this;
|
|
1083
|
+
}
|
|
1084
|
+
get() {
|
|
1085
|
+
return this.dataMod || (this.dataMod = this.initData()), this.dataMod;
|
|
1086
|
+
}
|
|
1087
|
+
getAndStatus(e) {
|
|
1088
|
+
let t = this.get();
|
|
1089
|
+
return t && n(t) ? {
|
|
1090
|
+
...t,
|
|
1091
|
+
statusObject: e.get()
|
|
1092
|
+
} : t;
|
|
1093
|
+
}
|
|
1094
|
+
getData() {
|
|
1095
|
+
return this.data;
|
|
1096
|
+
}
|
|
1097
|
+
async readData() {
|
|
1098
|
+
var e;
|
|
1099
|
+
let { queryReturn: t } = this.apiFetch, n = this.query;
|
|
1100
|
+
return t ? await t(n) : "data" in this.end ? this.end.data : ((e = n.headers.get("Content-Type")) == null ? "" : e).includes("application/json") ? await n.json() : { data: await n.text() };
|
|
1101
|
+
}
|
|
1102
|
+
initData() {
|
|
1103
|
+
let { toData: e = !0 } = this.apiFetch, t = this.getData();
|
|
1104
|
+
return t ? !e || !t || !n(t) || !("data" in t) ? t : t.data !== null && typeof t.data != "object" || i(t.data) ? t.data : this.initItem(t) : {};
|
|
1105
|
+
}
|
|
1106
|
+
initItem(e) {
|
|
1107
|
+
let t = { ...e.data };
|
|
1108
|
+
return Ae.forEach((n) => {
|
|
1109
|
+
n in e && !(n in t) && (t[n] = e[n]);
|
|
1110
|
+
}), t;
|
|
1111
|
+
}
|
|
1112
|
+
}, M = /* @__PURE__ */ function(e) {
|
|
1113
|
+
return e.delete = "DELETE", e.get = "GET", e.post = "POST", e.put = "PUT", e.patch = "PATCH", e;
|
|
1114
|
+
}({}), Me = class {
|
|
1115
|
+
constructor() {
|
|
1116
|
+
S(this, "value", void 0);
|
|
1117
|
+
}
|
|
1118
|
+
is() {
|
|
1119
|
+
return !!this.value;
|
|
1120
|
+
}
|
|
1121
|
+
get() {
|
|
1122
|
+
return this.value;
|
|
1123
|
+
}
|
|
1124
|
+
request(e) {
|
|
1125
|
+
let t = this.get();
|
|
1126
|
+
if (l(t)) {
|
|
1127
|
+
if (e instanceof FormData) this.addByFormData(e, t);
|
|
1128
|
+
else if (n(e)) return {
|
|
1129
|
+
...t,
|
|
1130
|
+
...e
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
return e;
|
|
1134
|
+
}
|
|
1135
|
+
set(e) {
|
|
1136
|
+
return this.value = e, this;
|
|
1137
|
+
}
|
|
1138
|
+
addByFormData(e, t) {
|
|
1139
|
+
return Object.entries(t).forEach(([t, n]) => {
|
|
1140
|
+
e.has(t) || e.set(t, n);
|
|
1141
|
+
}), this;
|
|
1142
|
+
}
|
|
1143
|
+
}, Ne = class {
|
|
1144
|
+
constructor() {
|
|
1145
|
+
S(this, "headers", {});
|
|
1146
|
+
}
|
|
1147
|
+
get(e, t = "application/json;charset=UTF-8") {
|
|
1148
|
+
if (e === null) return;
|
|
1149
|
+
let r = { ...this.headers };
|
|
1150
|
+
return n(e) && Object.assign(r, e), l(t) && (r["Content-Type"] = t), r;
|
|
1151
|
+
}
|
|
1152
|
+
getByRequest(e, t, n = "application/json;charset=UTF-8") {
|
|
1153
|
+
return e instanceof FormData ? this.get(t, null) : this.get(t, n);
|
|
1154
|
+
}
|
|
1155
|
+
set(e) {
|
|
1156
|
+
return n(e) && (this.headers = e), this;
|
|
1157
|
+
}
|
|
1158
|
+
}, Pe = "__ui:api:hydration:id__", Fe = class {
|
|
1159
|
+
constructor() {
|
|
1160
|
+
S(this, "list", []);
|
|
1161
|
+
}
|
|
1162
|
+
initResponse(e) {
|
|
1163
|
+
s() && e.add(this.getListByClient());
|
|
1164
|
+
}
|
|
1165
|
+
toClient(e, t) {
|
|
1166
|
+
let { path: n, method: r = M.get, request: i, global: a = r === M.get } = e;
|
|
1167
|
+
!a || !n || s() || this.list.push({
|
|
1168
|
+
path: n,
|
|
1169
|
+
method: r,
|
|
1170
|
+
request: i,
|
|
1171
|
+
response: t
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
toString() {
|
|
1175
|
+
return me(Pe, this.list);
|
|
1176
|
+
}
|
|
1177
|
+
getListByClient() {
|
|
1178
|
+
return he(Pe, []);
|
|
1179
|
+
}
|
|
1180
|
+
}, Ie = class {
|
|
1181
|
+
constructor() {
|
|
1182
|
+
S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
|
|
1183
|
+
}
|
|
1184
|
+
async make(e, t) {
|
|
1185
|
+
if (e && this.callback) return this.go(t);
|
|
1186
|
+
}
|
|
1187
|
+
async makeEnd(e, t, n) {
|
|
1188
|
+
return e && this.callbackEnd ? await this.callbackEnd(t, n) : {};
|
|
1189
|
+
}
|
|
1190
|
+
set(e) {
|
|
1191
|
+
return this.callback = e, this;
|
|
1192
|
+
}
|
|
1193
|
+
setEnd(e) {
|
|
1194
|
+
return this.callbackEnd = e, this;
|
|
1195
|
+
}
|
|
1196
|
+
async go(e, t = 32) {
|
|
1197
|
+
return new Promise((n) => {
|
|
1198
|
+
this.loading && t > 0 ? setTimeout(() => this.go(e, t - 1).then(n), 160) : this.callback ? (this.loading = !0, this.callback(e).then(() => {
|
|
1199
|
+
this.loading = !1, n();
|
|
1200
|
+
}).catch(() => {
|
|
1201
|
+
this.loading = !1, n();
|
|
1202
|
+
})) : n();
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
765
1205
|
};
|
|
766
1206
|
//#endregion
|
|
767
1207
|
//#region src/functions/executePromise.ts
|
|
768
|
-
async function
|
|
769
|
-
let n =
|
|
1208
|
+
async function Le(e, ...t) {
|
|
1209
|
+
let n = b(e, ...t);
|
|
770
1210
|
return n instanceof Promise ? await n : n;
|
|
771
1211
|
}
|
|
772
1212
|
//#endregion
|
|
773
1213
|
//#region src/classes/ApiResponse.ts
|
|
774
|
-
var
|
|
1214
|
+
var Re = "d-response-loading", ze = class {
|
|
775
1215
|
constructor(e) {
|
|
776
1216
|
S(this, "first", []), S(this, "response", []), S(this, "loading", void 0), S(this, "devMode", !1), this.requestDefault = e;
|
|
777
1217
|
}
|
|
@@ -782,12 +1222,13 @@ var he = "d-response-loading", ge = class {
|
|
|
782
1222
|
return this.response.filter((e) => e.isForGlobal !== !0);
|
|
783
1223
|
}
|
|
784
1224
|
add(e) {
|
|
785
|
-
return this.response.push(...
|
|
1225
|
+
return this.response.push(...k(e)), this;
|
|
786
1226
|
}
|
|
787
1227
|
setDevMode(e) {
|
|
788
1228
|
return this.devMode = e, this;
|
|
789
1229
|
}
|
|
790
1230
|
async emulator(e) {
|
|
1231
|
+
if (!s()) return;
|
|
791
1232
|
let { path: t = "", method: n = M.get, global: r = n === M.get, devMode: i = !1 } = e;
|
|
792
1233
|
if (r || this.isDevMode(i)) {
|
|
793
1234
|
let r = this.requestDefault.request(e.request), a = this.get(t, n, r, i);
|
|
@@ -798,10 +1239,10 @@ var he = "d-response-loading", ge = class {
|
|
|
798
1239
|
}
|
|
799
1240
|
}
|
|
800
1241
|
isDisable(e) {
|
|
801
|
-
return !!
|
|
1242
|
+
return !!b(e == null ? void 0 : e.disable);
|
|
802
1243
|
}
|
|
803
1244
|
isPath(e, t) {
|
|
804
|
-
return t === e.path || !!(e.path instanceof RegExp &&
|
|
1245
|
+
return t === e.path || !!(e.path instanceof RegExp && e.path.test(t));
|
|
805
1246
|
}
|
|
806
1247
|
isDevMode(e) {
|
|
807
1248
|
return e || this.devMode;
|
|
@@ -811,61 +1252,33 @@ var he = "d-response-loading", ge = class {
|
|
|
811
1252
|
}
|
|
812
1253
|
isResponse(e, t) {
|
|
813
1254
|
let r = this.requestDefault.request(e == null ? void 0 : e.request);
|
|
814
|
-
return t === r || r === "*any" ||
|
|
1255
|
+
return t === r || r === "*any" || l(t) && l(r) && n(t) && n(r) && !(t instanceof FormData) && !(r instanceof FormData) && Object.values(t).length === Object.values(r).length && Object.entries(r).every(([e, n]) => n === (t == null ? void 0 : t[e]) || n === "*any");
|
|
815
1256
|
}
|
|
816
1257
|
fetch(e, t) {
|
|
817
1258
|
return this.startResponseLoading(), new Promise((n) => {
|
|
818
|
-
|
|
819
|
-
e != null && e.lag ? (
|
|
820
|
-
this.stopResponseLoading(), n(t),
|
|
821
|
-
},
|
|
1259
|
+
Le(y(e.response) ? e.response(t) : e.response).then((t) => {
|
|
1260
|
+
e != null && e.lag ? (A.show(), setTimeout(() => {
|
|
1261
|
+
this.stopResponseLoading(), n(t), A.hide();
|
|
1262
|
+
}, f(0, 2e3))) : (this.stopResponseLoading(), n(t));
|
|
822
1263
|
});
|
|
823
1264
|
});
|
|
824
1265
|
}
|
|
825
1266
|
startResponseLoading() {
|
|
826
|
-
this.loading && clearTimeout(this.loading),
|
|
1267
|
+
this.loading && clearTimeout(this.loading), s() && document.body.classList.add(Re);
|
|
827
1268
|
}
|
|
828
1269
|
stopResponseLoading() {
|
|
829
|
-
this.loading = setTimeout(() => {
|
|
830
|
-
this.loading = void 0,
|
|
831
|
-
},
|
|
832
|
-
}
|
|
833
|
-
}, _e = class {
|
|
834
|
-
constructor() {
|
|
835
|
-
S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
|
|
836
|
-
}
|
|
837
|
-
async make(e, t) {
|
|
838
|
-
if (e && this.callback) return this.go(t);
|
|
839
|
-
}
|
|
840
|
-
async makeEnd(e, t, n) {
|
|
841
|
-
let r = {};
|
|
842
|
-
return e && this.callbackEnd && (r = await this.callbackEnd(t, n)), r;
|
|
843
|
-
}
|
|
844
|
-
set(e) {
|
|
845
|
-
return this.callback = e, this;
|
|
1270
|
+
s() && (this.loading = setTimeout(() => {
|
|
1271
|
+
this.loading = void 0, document.body.classList.remove(Re);
|
|
1272
|
+
}, 2400));
|
|
846
1273
|
}
|
|
847
|
-
|
|
848
|
-
return this.callbackEnd = e, this;
|
|
849
|
-
}
|
|
850
|
-
async go(e) {
|
|
851
|
-
return new Promise((t) => {
|
|
852
|
-
this.loading ? setTimeout(() => this.go(e).then(t), 160) : this.callback ? (this.loading = !0, this.callback(e).then(() => {
|
|
853
|
-
this.loading = !1, t();
|
|
854
|
-
})) : t();
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
async end(e, t) {
|
|
858
|
-
let n = {};
|
|
859
|
-
return this.callbackEnd && (n = await this.callbackEnd(e, t)), n;
|
|
860
|
-
}
|
|
861
|
-
}, ve = class {
|
|
1274
|
+
}, Be = class {
|
|
862
1275
|
constructor(e = "/api/", t = {}) {
|
|
863
|
-
S(this, "headers", void 0), S(this, "requestDefault", void 0), S(this, "status", void 0), S(this, "response", void 0), S(this, "preparation", void 0), S(this, "loading", void 0), S(this, "errorCenter", void 0), S(this, "timeout", 16e3), this.url = e;
|
|
864
|
-
let { headersClass: n =
|
|
865
|
-
this.headers = new n(), this.requestDefault = new r(), this.status = new i(), this.response = new a(this.requestDefault), this.preparation = new o(), this.loading = s, this.errorCenter = c;
|
|
1276
|
+
S(this, "headers", void 0), S(this, "requestDefault", void 0), S(this, "status", void 0), S(this, "response", void 0), S(this, "preparation", void 0), S(this, "loading", void 0), S(this, "errorCenter", void 0), S(this, "hydration", void 0), S(this, "timeout", 16e3), this.url = e;
|
|
1277
|
+
let { headersClass: n = Ne, requestDefaultClass: r = Me, statusClass: i = ke, responseClass: a = ze, preparationClass: o = Ie, loadingClass: s = A.getItem(), errorCenterClass: c = C.getItem(), hydrationClass: l = Fe } = t;
|
|
1278
|
+
this.headers = new n(), this.requestDefault = new r(), this.status = new i(), this.response = new a(this.requestDefault), this.preparation = new o(), this.loading = s, this.errorCenter = c, this.hydration = new l(), this.hydration.initResponse(this.response);
|
|
866
1279
|
}
|
|
867
1280
|
isLocalhost() {
|
|
868
|
-
return typeof location
|
|
1281
|
+
return s() && typeof location < "u" && location.hostname === "localhost";
|
|
869
1282
|
}
|
|
870
1283
|
getStatus() {
|
|
871
1284
|
return this.status;
|
|
@@ -873,20 +1286,26 @@ var he = "d-response-loading", ge = class {
|
|
|
873
1286
|
getResponse() {
|
|
874
1287
|
return this.response;
|
|
875
1288
|
}
|
|
1289
|
+
getHydration() {
|
|
1290
|
+
return this.hydration;
|
|
1291
|
+
}
|
|
876
1292
|
getUrl(e, t = !0) {
|
|
877
1293
|
return `${t ? this.url : ""}${e}`.replace("{locale}", D.getLocation()).replace("{country}", D.getCountry()).replace("{language}", D.getLanguage());
|
|
878
1294
|
}
|
|
879
1295
|
getBody(e = {}, t = M.get) {
|
|
880
1296
|
if (e instanceof FormData) return e;
|
|
881
|
-
if (t !== M.get &&
|
|
1297
|
+
if (t !== M.get && l(e)) return d(e) ? e : JSON.stringify(e);
|
|
882
1298
|
}
|
|
883
1299
|
getBodyForGet(e, t = "", n = M.get) {
|
|
884
1300
|
if (n === M.get) {
|
|
885
|
-
let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ?
|
|
886
|
-
if (
|
|
1301
|
+
let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ? o(e) : e;
|
|
1302
|
+
if (l(r)) return `${n}${r}`;
|
|
887
1303
|
}
|
|
888
1304
|
return "";
|
|
889
1305
|
}
|
|
1306
|
+
getHydrationScript() {
|
|
1307
|
+
return this.hydration.toString();
|
|
1308
|
+
}
|
|
890
1309
|
setHeaders(e) {
|
|
891
1310
|
return this.headers.set(e), this;
|
|
892
1311
|
}
|
|
@@ -906,68 +1325,81 @@ var he = "d-response-loading", ge = class {
|
|
|
906
1325
|
return this.timeout = e, this;
|
|
907
1326
|
}
|
|
908
1327
|
async request(e) {
|
|
909
|
-
return
|
|
1328
|
+
return d(e) ? await this.fetch({ path: e }) : await this.fetch(e);
|
|
910
1329
|
}
|
|
911
1330
|
get(e) {
|
|
912
|
-
return this.request(
|
|
1331
|
+
return this.request({
|
|
1332
|
+
...e,
|
|
1333
|
+
method: M.get
|
|
1334
|
+
});
|
|
913
1335
|
}
|
|
914
1336
|
post(e) {
|
|
915
|
-
return this.request(
|
|
1337
|
+
return this.request({
|
|
1338
|
+
...e,
|
|
1339
|
+
method: M.post
|
|
1340
|
+
});
|
|
916
1341
|
}
|
|
917
1342
|
put(e) {
|
|
918
|
-
return this.request(
|
|
1343
|
+
return this.request({
|
|
1344
|
+
...e,
|
|
1345
|
+
method: M.put
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
patch(e) {
|
|
1349
|
+
return this.request({
|
|
1350
|
+
...e,
|
|
1351
|
+
method: M.patch
|
|
1352
|
+
});
|
|
919
1353
|
}
|
|
920
1354
|
delete(e) {
|
|
921
|
-
return this.request(
|
|
1355
|
+
return this.request({
|
|
1356
|
+
...e,
|
|
1357
|
+
method: M.delete
|
|
1358
|
+
});
|
|
922
1359
|
}
|
|
923
1360
|
getRetryDelay(e, t) {
|
|
924
|
-
return
|
|
1361
|
+
return f(t, t + e * t);
|
|
925
1362
|
}
|
|
926
1363
|
async fetch(e, t = 0) {
|
|
927
|
-
let {
|
|
928
|
-
if (
|
|
929
|
-
let
|
|
930
|
-
|
|
1364
|
+
let { hideError: n = !1, hideLoading: r = !1, retry: i = 0, retryDelay: a = 64, globalPreparation: o = !0, globalEnd: s = !0, endResetLimit: c = 8 } = e, l = await this.response.emulator(e);
|
|
1365
|
+
if (l) return l;
|
|
1366
|
+
let u = await j.getByFetch(e);
|
|
1367
|
+
if (u) return this.hydration.toClient(e, u), u;
|
|
1368
|
+
let d = new ke(), f;
|
|
1369
|
+
r || this.loading.show();
|
|
931
1370
|
try {
|
|
932
|
-
await this.preparation.make(
|
|
933
|
-
let { query:
|
|
934
|
-
|
|
935
|
-
let
|
|
936
|
-
if (d.setStatus(
|
|
937
|
-
|
|
1371
|
+
await this.preparation.make(o, e);
|
|
1372
|
+
let { query: l, timeoutId: u } = await this.makeQuery(e);
|
|
1373
|
+
u && clearTimeout(u);
|
|
1374
|
+
let m = await this.preparation.makeEnd(s, l, e);
|
|
1375
|
+
if (d.setStatus(l.status, l.statusText), this.status.setStatus(l.status, l.statusText), !n && l.status >= 400 && this.makeErrorQuery(l), m != null && m.reset && t < c || t < i) return await p(this.getRetryDelay(t, a)), r || this.loading.hide(), await this.fetch(e, t + 1);
|
|
1376
|
+
f = new je(e, l, m), await f.init();
|
|
938
1377
|
} catch (e) {
|
|
939
|
-
throw
|
|
1378
|
+
throw n || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), r || this.loading.hide(), e;
|
|
940
1379
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
var r;
|
|
945
|
-
return t ? await t(e) : "data" in n ? n.data : ((r = e.headers.get("Content-Type")) == null ? "" : r).match("application/json") ? await e.json() : { data: await e.text() };
|
|
1380
|
+
d.setLastResponse(f.getData()), this.status.setLastResponse(f.getData());
|
|
1381
|
+
let m = f.getAndStatus(d);
|
|
1382
|
+
return r || this.loading.hide(), this.hydration.toClient(e, m), await j.setByFetch(e, m), m;
|
|
946
1383
|
}
|
|
947
1384
|
async makeQuery(e) {
|
|
948
|
-
let t = this.requestDefault.request(e.request), { api: n = !0, path:
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1385
|
+
let t = this.requestDefault.request(e.request), { api: n = !0, path: r = "", pathFull: i = void 0, method: a = M.get, headers: o = {}, type: s = "application/json;charset=UTF-8", init: c = {} } = e, l = i == null ? this.getUrl(r, n) : i, u = `${l}${this.getBodyForGet(t, l, a)}`, d = this.headers.getByRequest(e.request, o, s), f = {
|
|
1386
|
+
...c,
|
|
1387
|
+
method: a,
|
|
1388
|
+
body: this.getBody(t, a)
|
|
1389
|
+
};
|
|
1390
|
+
if (d) {
|
|
1391
|
+
var p;
|
|
1392
|
+
f.headers = {
|
|
1393
|
+
...d,
|
|
1394
|
+
...(p = c.headers) == null ? {} : p
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
let m = this.initController(e, f);
|
|
954
1398
|
return {
|
|
955
|
-
query: await fetch(
|
|
1399
|
+
query: await fetch(u, f),
|
|
956
1400
|
timeoutId: m
|
|
957
1401
|
};
|
|
958
1402
|
}
|
|
959
|
-
makeData(e, t) {
|
|
960
|
-
if (!t || !e || !n(e) || !("data" in e)) return e;
|
|
961
|
-
if (e.data !== null && typeof e.data != "object" || o(e.data)) return e.data;
|
|
962
|
-
let i = r(e.data);
|
|
963
|
-
return "success" in e && !("success" in i) && (i.success = e.success), "status" in e && !("status" in i) && (i.status = e.status), "message" in e && !("message" in i) && (i.message = e.message), i;
|
|
964
|
-
}
|
|
965
|
-
makeStatus(e, t) {
|
|
966
|
-
return e && n(e) ? {
|
|
967
|
-
...e,
|
|
968
|
-
statusObject: t.get()
|
|
969
|
-
} : e;
|
|
970
|
-
}
|
|
971
1403
|
makeError(e, t = "api") {
|
|
972
1404
|
switch (e.name) {
|
|
973
1405
|
case "TimeoutError":
|
|
@@ -978,7 +1410,7 @@ var he = "d-response-loading", ge = class {
|
|
|
978
1410
|
});
|
|
979
1411
|
break;
|
|
980
1412
|
case "AbortError": break;
|
|
981
|
-
default:
|
|
1413
|
+
default: u() ? this.errorCenter.on({
|
|
982
1414
|
group: t,
|
|
983
1415
|
code: "unknown",
|
|
984
1416
|
details: e
|
|
@@ -991,6 +1423,20 @@ var he = "d-response-loading", ge = class {
|
|
|
991
1423
|
}
|
|
992
1424
|
makeErrorQuery(e) {
|
|
993
1425
|
switch (e.status) {
|
|
1426
|
+
case 401:
|
|
1427
|
+
this.errorCenter.on({
|
|
1428
|
+
group: "api",
|
|
1429
|
+
code: "unauthorized",
|
|
1430
|
+
details: e
|
|
1431
|
+
});
|
|
1432
|
+
break;
|
|
1433
|
+
case 403:
|
|
1434
|
+
this.errorCenter.on({
|
|
1435
|
+
group: "api",
|
|
1436
|
+
code: "forbidden",
|
|
1437
|
+
details: e
|
|
1438
|
+
});
|
|
1439
|
+
break;
|
|
994
1440
|
case 404:
|
|
995
1441
|
this.errorCenter.on({
|
|
996
1442
|
group: "api",
|
|
@@ -1014,7 +1460,7 @@ var he = "d-response-loading", ge = class {
|
|
|
1014
1460
|
}
|
|
1015
1461
|
initController(e, t) {
|
|
1016
1462
|
let { timeout: n = this.timeout, controller: r } = e;
|
|
1017
|
-
if (n && !r && typeof AbortSignal < "u") {
|
|
1463
|
+
if (n && !r && typeof AbortSignal < "u" && typeof AbortSignal.timeout == "function") {
|
|
1018
1464
|
t.signal = AbortSignal.timeout(n);
|
|
1019
1465
|
return;
|
|
1020
1466
|
}
|
|
@@ -1029,69 +1475,74 @@ var he = "d-response-loading", ge = class {
|
|
|
1029
1475
|
}, n);
|
|
1030
1476
|
}
|
|
1031
1477
|
}
|
|
1032
|
-
},
|
|
1478
|
+
}, N = class {
|
|
1033
1479
|
static isLocalhost() {
|
|
1034
|
-
return this.
|
|
1480
|
+
return this.getItem().isLocalhost();
|
|
1035
1481
|
}
|
|
1036
1482
|
static getItem() {
|
|
1037
|
-
return
|
|
1483
|
+
return T.get("__ui:api-instance__", () => new Be());
|
|
1038
1484
|
}
|
|
1039
1485
|
static getStatus() {
|
|
1040
|
-
return this.
|
|
1486
|
+
return this.getItem().getStatus();
|
|
1041
1487
|
}
|
|
1042
1488
|
static getResponse() {
|
|
1043
|
-
return this.
|
|
1489
|
+
return this.getItem().getResponse();
|
|
1490
|
+
}
|
|
1491
|
+
static getHydration() {
|
|
1492
|
+
return this.getItem().getHydration();
|
|
1493
|
+
}
|
|
1494
|
+
static getHydrationScript() {
|
|
1495
|
+
return this.getItem().getHydrationScript();
|
|
1044
1496
|
}
|
|
1045
1497
|
static getUrl(e, t = !0) {
|
|
1046
|
-
return this.
|
|
1498
|
+
return this.getItem().getUrl(e, t);
|
|
1047
1499
|
}
|
|
1048
1500
|
static getBody(e = {}, t = M.get) {
|
|
1049
|
-
return this.
|
|
1501
|
+
return this.getItem().getBody(e, t);
|
|
1050
1502
|
}
|
|
1051
1503
|
static getBodyForGet(e, t = "", n = M.get) {
|
|
1052
|
-
return this.
|
|
1504
|
+
return this.getItem().getBodyForGet(e, t, n);
|
|
1053
1505
|
}
|
|
1054
|
-
static setHeaders(
|
|
1055
|
-
|
|
1506
|
+
static setHeaders(e) {
|
|
1507
|
+
this.getItem().setHeaders(e);
|
|
1056
1508
|
}
|
|
1057
|
-
static setRequestDefault(
|
|
1058
|
-
|
|
1509
|
+
static setRequestDefault(e) {
|
|
1510
|
+
this.getItem().setRequestDefault(e);
|
|
1059
1511
|
}
|
|
1060
|
-
static setUrl(
|
|
1061
|
-
|
|
1512
|
+
static setUrl(e) {
|
|
1513
|
+
this.getItem().setUrl(e);
|
|
1062
1514
|
}
|
|
1063
|
-
static setPreparation(
|
|
1064
|
-
|
|
1515
|
+
static setPreparation(e) {
|
|
1516
|
+
this.getItem().setPreparation(e);
|
|
1065
1517
|
}
|
|
1066
|
-
static setEnd(
|
|
1067
|
-
|
|
1518
|
+
static setEnd(e) {
|
|
1519
|
+
this.getItem().setEnd(e);
|
|
1068
1520
|
}
|
|
1069
|
-
static setTimeout(
|
|
1070
|
-
|
|
1521
|
+
static setTimeout(e) {
|
|
1522
|
+
this.getItem().setTimeout(e);
|
|
1071
1523
|
}
|
|
1072
1524
|
static setConfig(e) {
|
|
1073
|
-
|
|
1525
|
+
e && n(e) && (e.urlRoot && this.setUrl(e.urlRoot), e.headers && this.setHeaders(e.headers), e.requestDefault && this.setRequestDefault(e.requestDefault), e.preparation && this.setPreparation(e.preparation), e.end && this.setEnd(e.end), e.timeout && this.setTimeout(e.timeout));
|
|
1074
1526
|
}
|
|
1075
1527
|
static async request(e) {
|
|
1076
|
-
return this.
|
|
1528
|
+
return this.getItem().request(e);
|
|
1077
1529
|
}
|
|
1078
1530
|
static get(e) {
|
|
1079
|
-
return this.
|
|
1531
|
+
return this.getItem().get(e);
|
|
1080
1532
|
}
|
|
1081
1533
|
static post(e) {
|
|
1082
|
-
return this.
|
|
1534
|
+
return this.getItem().post(e);
|
|
1083
1535
|
}
|
|
1084
1536
|
static put(e) {
|
|
1085
|
-
return this.
|
|
1537
|
+
return this.getItem().put(e);
|
|
1538
|
+
}
|
|
1539
|
+
static patch(e) {
|
|
1540
|
+
return this.getItem().patch(e);
|
|
1086
1541
|
}
|
|
1087
1542
|
static delete(e) {
|
|
1088
|
-
return this.
|
|
1543
|
+
return this.getItem().delete(e);
|
|
1089
1544
|
}
|
|
1090
|
-
}
|
|
1091
|
-
S(P, "item", new ve());
|
|
1092
|
-
//#endregion
|
|
1093
|
-
//#region src/classes/BroadcastMessage.ts
|
|
1094
|
-
var ye = class {
|
|
1545
|
+
}, Ve = class {
|
|
1095
1546
|
constructor(e, t, n, r = C.getItem()) {
|
|
1096
1547
|
if (S(this, "channel", void 0), S(this, "update", (e) => {
|
|
1097
1548
|
var t;
|
|
@@ -1099,8 +1550,8 @@ var ye = class {
|
|
|
1099
1550
|
}), S(this, "updateError", (e) => {
|
|
1100
1551
|
var t;
|
|
1101
1552
|
return (t = this.callbackError) == null || t.call(this, e), this;
|
|
1102
|
-
}), this.callback = t, this.callbackError = n,
|
|
1103
|
-
this.channel = new BroadcastChannel(`${
|
|
1553
|
+
}), this.callback = t, this.callbackError = n, s()) try {
|
|
1554
|
+
this.channel = new BroadcastChannel(`${He()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
|
|
1104
1555
|
} catch (e) {
|
|
1105
1556
|
r.on({
|
|
1106
1557
|
group: "broadcast",
|
|
@@ -1122,7 +1573,11 @@ var ye = class {
|
|
|
1122
1573
|
setCallbackError(e) {
|
|
1123
1574
|
return this.callbackError = e, this;
|
|
1124
1575
|
}
|
|
1125
|
-
|
|
1576
|
+
destroy() {
|
|
1577
|
+
var e;
|
|
1578
|
+
return (e = this.channel) == null || e.close(), this.channel = void 0, this;
|
|
1579
|
+
}
|
|
1580
|
+
}, He = () => new E("__ui:broadcast-name__").get(() => `name_${f(1e6, 9999999)}`), Ue = class {
|
|
1126
1581
|
constructor(e) {
|
|
1127
1582
|
S(this, "cache", void 0), S(this, "cacheOld", void 0), S(this, "comparisons", []), this.callback = e;
|
|
1128
1583
|
}
|
|
@@ -1144,7 +1599,7 @@ var ye = class {
|
|
|
1144
1599
|
isUpdate(e) {
|
|
1145
1600
|
return this.cache === void 0 || this.comparisons.length !== e.length || this.comparisons.findIndex((t, n) => t !== e[n]) >= 0 ? (this.comparisons = [...e], !0) : !1;
|
|
1146
1601
|
}
|
|
1147
|
-
},
|
|
1602
|
+
}, We = class {
|
|
1148
1603
|
constructor() {
|
|
1149
1604
|
S(this, "cache", {});
|
|
1150
1605
|
}
|
|
@@ -1155,17 +1610,44 @@ var ye = class {
|
|
|
1155
1610
|
return await this.getCacheItem(e, t).getCacheAsync(n == null ? [] : n);
|
|
1156
1611
|
}
|
|
1157
1612
|
getCacheItem(e, t) {
|
|
1158
|
-
return e in this.cache || (this.cache[e] = new
|
|
1613
|
+
return e in this.cache || (this.cache[e] = new Ue(t)), this.cache[e];
|
|
1614
|
+
}
|
|
1615
|
+
}, Ge = class {
|
|
1616
|
+
static getItem() {
|
|
1617
|
+
return T.get("__ui:cache-static__", () => new We());
|
|
1159
1618
|
}
|
|
1160
|
-
}, Ce, F = class {
|
|
1161
1619
|
static get(e, t, n) {
|
|
1162
|
-
return this.
|
|
1620
|
+
return this.getItem().get(e, t, n);
|
|
1621
|
+
}
|
|
1622
|
+
static async getAsync(e, t, n) {
|
|
1623
|
+
return await this.getItem().getAsync(e, t, n);
|
|
1163
1624
|
}
|
|
1164
1625
|
};
|
|
1165
|
-
|
|
1626
|
+
//#endregion
|
|
1627
|
+
//#region src/functions/anyToString.ts
|
|
1628
|
+
function P(e, n = !0, r = !0) {
|
|
1629
|
+
var a;
|
|
1630
|
+
if (d(e)) return r ? e.trim() : e;
|
|
1631
|
+
if (c(e)) return "";
|
|
1632
|
+
if (i(e) && !e.some((e) => t(e)) && n) return e.join(",");
|
|
1633
|
+
if (t(e)) try {
|
|
1634
|
+
return JSON.stringify(e);
|
|
1635
|
+
} catch (t) {
|
|
1636
|
+
return String(e);
|
|
1637
|
+
}
|
|
1638
|
+
return e === !0 ? "1" : e === !1 ? "0" : (a = e == null ? void 0 : e.toString()) == null ? "" : a;
|
|
1639
|
+
}
|
|
1640
|
+
//#endregion
|
|
1641
|
+
//#region src/functions/strSplit.ts
|
|
1642
|
+
function F(e, t, n) {
|
|
1643
|
+
let r = P(e);
|
|
1644
|
+
if (!n || n <= 0) return r.split(t);
|
|
1645
|
+
let i = r.split(t, n), a = r.split(t);
|
|
1646
|
+
return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
|
|
1647
|
+
}
|
|
1166
1648
|
//#endregion
|
|
1167
1649
|
//#region src/functions/transformation.ts
|
|
1168
|
-
function
|
|
1650
|
+
function I(e, t = !1) {
|
|
1169
1651
|
if (typeof e == "string") {
|
|
1170
1652
|
let r = e.trim();
|
|
1171
1653
|
switch (r) {
|
|
@@ -1178,96 +1660,157 @@ function we(e, t = !1) {
|
|
|
1178
1660
|
if (/^[{[]/.exec(r)) try {
|
|
1179
1661
|
return JSON.parse(r);
|
|
1180
1662
|
} catch (e) {
|
|
1181
|
-
|
|
1663
|
+
C.on({
|
|
1664
|
+
group: "transformation",
|
|
1665
|
+
code: "error",
|
|
1666
|
+
details: e
|
|
1667
|
+
});
|
|
1182
1668
|
}
|
|
1183
|
-
else if (
|
|
1184
|
-
else if (
|
|
1185
|
-
else if (t &&
|
|
1669
|
+
else if (/^-?[0-9]+\.[0-9]+$/.exec(r)) return parseFloat(r);
|
|
1670
|
+
else if (/^-?[0-9]+$/.exec(r)) return parseInt(r, 10);
|
|
1671
|
+
else if (t && s() && typeof ((n = window) == null ? void 0 : n[r]) == "function") return window[r];
|
|
1186
1672
|
}
|
|
1187
1673
|
}
|
|
1188
1674
|
return e;
|
|
1189
1675
|
}
|
|
1190
1676
|
//#endregion
|
|
1191
|
-
//#region src/classes/
|
|
1192
|
-
var
|
|
1193
|
-
|
|
1677
|
+
//#region src/classes/CookieBlockInstance.ts
|
|
1678
|
+
var Ke = "__ui:cookie-block__", qe = class {
|
|
1679
|
+
constructor() {
|
|
1680
|
+
S(this, "storage", new E(Ke));
|
|
1681
|
+
}
|
|
1682
|
+
get() {
|
|
1194
1683
|
var e;
|
|
1195
1684
|
return (e = this.storage.get()) == null ? !1 : e;
|
|
1196
1685
|
}
|
|
1197
|
-
|
|
1686
|
+
set(e) {
|
|
1198
1687
|
this.storage.set(e);
|
|
1199
1688
|
}
|
|
1689
|
+
}, Je = class {
|
|
1690
|
+
static getItem() {
|
|
1691
|
+
return T.get("__ui:cookie-block__", () => new qe());
|
|
1692
|
+
}
|
|
1693
|
+
static get() {
|
|
1694
|
+
return this.getItem().get();
|
|
1695
|
+
}
|
|
1696
|
+
static set(e) {
|
|
1697
|
+
this.getItem().set(e);
|
|
1698
|
+
}
|
|
1699
|
+
}, Ye = "__ui:cookie-storage__", L = class {
|
|
1700
|
+
static init(e, t) {
|
|
1701
|
+
this.getListener = e, this.setListener = t;
|
|
1702
|
+
}
|
|
1703
|
+
static reset() {
|
|
1704
|
+
this.getListener = void 0, this.setListener = void 0;
|
|
1705
|
+
}
|
|
1706
|
+
static get(e, t) {
|
|
1707
|
+
let n = this.getListener ? this.getListener(e) : this.initItems()[e];
|
|
1708
|
+
return n === void 0 && t !== void 0 ? this.set(e, t) : I(n);
|
|
1709
|
+
}
|
|
1710
|
+
static set(e, t, n) {
|
|
1711
|
+
let r = b(t);
|
|
1712
|
+
if (Je.get()) return r;
|
|
1713
|
+
let i = P(r, !1);
|
|
1714
|
+
return this.setListener ? this.setListener(e, i, n) : (this.initItems()[e] = i === "" ? void 0 : r, this.hasDom() && (document.cookie = [
|
|
1715
|
+
`${encodeURIComponent(e)}=${encodeURIComponent(i)}`,
|
|
1716
|
+
this.toMaxAge(i, n == null ? void 0 : n.age),
|
|
1717
|
+
this.toSameSite(n == null ? void 0 : n.sameSite),
|
|
1718
|
+
...this.toArguments(n == null ? void 0 : n.arguments)
|
|
1719
|
+
].join("; "))), r;
|
|
1720
|
+
}
|
|
1721
|
+
static remove(e) {
|
|
1722
|
+
this.set(e, "", { age: -1 });
|
|
1723
|
+
}
|
|
1724
|
+
static update() {
|
|
1725
|
+
s() && (T.remove(Ye), this.initItems());
|
|
1726
|
+
}
|
|
1727
|
+
static hasDom() {
|
|
1728
|
+
return s() && !ce();
|
|
1729
|
+
}
|
|
1730
|
+
static initItems() {
|
|
1731
|
+
return T.get(Ye, () => {
|
|
1732
|
+
let e = {};
|
|
1733
|
+
if (this.hasDom()) for (let t of document.cookie.split(";")) {
|
|
1734
|
+
let [n, r] = F(t.trim(), "=", 2);
|
|
1735
|
+
n && l(r) && (e[n] = r);
|
|
1736
|
+
}
|
|
1737
|
+
return e;
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
static toMaxAge(e, t) {
|
|
1741
|
+
return `max-age=${e === "" ? -1 : t == null ? 10080 * 60 : t}`;
|
|
1742
|
+
}
|
|
1743
|
+
static toSameSite(e) {
|
|
1744
|
+
return `SameSite=${e == null ? "strict" : e}`;
|
|
1745
|
+
}
|
|
1746
|
+
static toArguments(e) {
|
|
1747
|
+
return e === void 0 ? [] : Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => `${e}=${P(t)}`);
|
|
1748
|
+
}
|
|
1200
1749
|
};
|
|
1201
|
-
S(
|
|
1750
|
+
S(L, "getListener", void 0), S(L, "setListener", void 0);
|
|
1202
1751
|
//#endregion
|
|
1203
1752
|
//#region src/classes/Cookie.ts
|
|
1204
|
-
var
|
|
1753
|
+
var Xe = () => T.get("__ui:cookie-items__", () => ({})), Ze = class e {
|
|
1754
|
+
static getInstance(t) {
|
|
1755
|
+
var n, r;
|
|
1756
|
+
return (n = (r = Xe()) == null ? void 0 : r[t]) == null ? new e(t) : n;
|
|
1757
|
+
}
|
|
1205
1758
|
constructor(e) {
|
|
1206
|
-
|
|
1207
|
-
|
|
1759
|
+
S(this, "value", void 0), S(this, "options", {}), this.name = e;
|
|
1760
|
+
let t = Xe();
|
|
1761
|
+
if (e in t) return t[e];
|
|
1762
|
+
this.value = L.get(this.name), t[e] = this;
|
|
1208
1763
|
}
|
|
1209
1764
|
get(e, t) {
|
|
1210
1765
|
return this.value === void 0 && e && this.set(e, t), this.value;
|
|
1211
1766
|
}
|
|
1212
1767
|
set(e, t) {
|
|
1213
|
-
this.value =
|
|
1768
|
+
this.value = b(e), Object.assign(this.options, t), this.update();
|
|
1214
1769
|
}
|
|
1215
1770
|
remove() {
|
|
1216
1771
|
this.set("");
|
|
1217
1772
|
}
|
|
1218
|
-
getAge() {
|
|
1219
|
-
var e, t;
|
|
1220
|
-
return (e = (t = this.options) == null ? void 0 : t.age) == null ? 10080 * 60 : e;
|
|
1221
|
-
}
|
|
1222
1773
|
update() {
|
|
1223
|
-
|
|
1224
|
-
var e, t, n, r, i;
|
|
1225
|
-
let a = String((e = this.value) == null ? "" : e);
|
|
1226
|
-
document.cookie = [
|
|
1227
|
-
`${encodeURIComponent(this.name)}=${encodeURIComponent(a)}`,
|
|
1228
|
-
`max-age=${a === "" ? "-1" : this.getAge()}`,
|
|
1229
|
-
`SameSite=${(t = (n = this.options) == null ? void 0 : n.sameSite) == null ? "strict" : t}`,
|
|
1230
|
-
...(r = (i = this.options) == null ? void 0 : i.arguments) == null ? [] : r
|
|
1231
|
-
].join("; ");
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
static updateData() {
|
|
1235
|
-
for (let e of document.cookie.split(";")) {
|
|
1236
|
-
let [t, n] = e.trim().split("=");
|
|
1237
|
-
t && c(n) && (Oe[t] = we(n));
|
|
1238
|
-
}
|
|
1774
|
+
L.set(this.name, this.value, this.options);
|
|
1239
1775
|
}
|
|
1240
1776
|
};
|
|
1241
|
-
De = ke, m() && !b() && De.updateData();
|
|
1242
|
-
var Ae = {};
|
|
1243
1777
|
//#endregion
|
|
1244
1778
|
//#region src/functions/toDate.ts
|
|
1245
|
-
function
|
|
1246
|
-
var t, n, r, i, a, o,
|
|
1779
|
+
function R(e) {
|
|
1780
|
+
var t, n, r, i, a, o, s, l;
|
|
1247
1781
|
if (e instanceof Date) return e;
|
|
1248
|
-
if (
|
|
1782
|
+
if (c(e)) return /* @__PURE__ */ new Date();
|
|
1249
1783
|
if (typeof e == "number") return new Date(e);
|
|
1250
1784
|
let u = e, d = D.getTimezoneFormat().trim();
|
|
1251
1785
|
e.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (e, t, n) => (u = t, d = n.trim(), e));
|
|
1252
|
-
let f = (t = (n = (r = (i = (a = (o = (
|
|
1786
|
+
let f = (t = (n = (r = (i = (a = (o = (s = (l = /^\d{4}\d{2}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")}T00:00:00`) == null ? /^\d{4}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})$/, "$1-$2")}-01T00:00:00` : l) == null ? /^\d{4}\d{2}\d{2} \d{2}:\d{2}:\d{2}$/.exec(u) && u.replace(/^(\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, "$1-$2-$3T$4:$5:$6") : s) == null ? /^\d{4}-\d{2}-\d{2}$/.exec(u) && `${u}T00:00:00` : o) == null ? /^\d{4}-\d{2}$/.exec(u) && `${u}-01T00:00:00` : a) == null ? /^\d{4}$/.exec(u) && `${u}-01-01T00:00:00` : i) == null ? /^\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}:00` : r) == null ? /^\d{2}:\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}` : n) == null ? u.replace(" ", "T") : t;
|
|
1253
1787
|
return /* @__PURE__ */ new Date(`${f.trim()}${d}`);
|
|
1254
1788
|
}
|
|
1255
1789
|
//#endregion
|
|
1256
1790
|
//#region src/functions/getColumn.ts
|
|
1257
|
-
function
|
|
1258
|
-
return
|
|
1791
|
+
function Qe(e, t) {
|
|
1792
|
+
return r(e, (e) => e == null ? void 0 : e[t], !0);
|
|
1259
1793
|
}
|
|
1260
1794
|
//#endregion
|
|
1261
1795
|
//#region src/classes/GeoIntl.ts
|
|
1262
|
-
var
|
|
1796
|
+
var z = class e {
|
|
1797
|
+
static isItem(e = D.getLocation()) {
|
|
1798
|
+
return this.getLocation(e) in V;
|
|
1799
|
+
}
|
|
1800
|
+
static getLocation(e = D.getLocation()) {
|
|
1801
|
+
if (e in B) return B[e];
|
|
1802
|
+
let t = D.find(e);
|
|
1803
|
+
return B[e] = t.standard, t.standard;
|
|
1804
|
+
}
|
|
1263
1805
|
static getInstance(t = D.getLocation()) {
|
|
1264
|
-
|
|
1806
|
+
let n = this.getLocation(t);
|
|
1807
|
+
return n in V ? V[n] : new e(t);
|
|
1265
1808
|
}
|
|
1266
1809
|
constructor(e = D.getLocation(), t = C.getItem()) {
|
|
1267
1810
|
S(this, "geo", void 0), this.errorCenter = t, this.geo = D.find(e);
|
|
1268
1811
|
let n = this.getLocation();
|
|
1269
|
-
if (n in
|
|
1270
|
-
|
|
1812
|
+
if (n in V) return V[n];
|
|
1813
|
+
B[e] = n, V[n] = this;
|
|
1271
1814
|
}
|
|
1272
1815
|
getLocation() {
|
|
1273
1816
|
return this.geo.standard;
|
|
@@ -1309,26 +1852,26 @@ var L = class e {
|
|
|
1309
1852
|
}
|
|
1310
1853
|
fullName(e, t, n, r) {
|
|
1311
1854
|
var i, a;
|
|
1312
|
-
let o = (i = (a = this.geo) == null ? void 0 : a.nameFormat) == null ? "fl" : i, s;
|
|
1855
|
+
let o = (i = (a = this.geo) == null ? void 0 : a.nameFormat) == null ? "fl" : i, s = r ? t[0].toUpperCase() + "." : t, c = r ? (n == null ? void 0 : n[0].toUpperCase()) + "." : n, l;
|
|
1313
1856
|
switch (o) {
|
|
1314
1857
|
case "fsl":
|
|
1315
|
-
|
|
1858
|
+
l = `${s}${c ? ` ${c}` : ""} ${e}`;
|
|
1316
1859
|
break;
|
|
1317
1860
|
case "lf":
|
|
1318
|
-
|
|
1861
|
+
l = `${e} ${s}`;
|
|
1319
1862
|
break;
|
|
1320
1863
|
case "lsf":
|
|
1321
|
-
|
|
1864
|
+
l = `${e}${c ? ` ${c}` : ""} ${s}`;
|
|
1322
1865
|
break;
|
|
1323
1866
|
default:
|
|
1324
|
-
|
|
1867
|
+
l = `${s} ${e}`;
|
|
1325
1868
|
break;
|
|
1326
1869
|
}
|
|
1327
|
-
return
|
|
1870
|
+
return l;
|
|
1328
1871
|
}
|
|
1329
1872
|
number(e, t) {
|
|
1330
1873
|
var n, r;
|
|
1331
|
-
return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n,
|
|
1874
|
+
return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n, _(e))) || e.toString();
|
|
1332
1875
|
}
|
|
1333
1876
|
decimal() {
|
|
1334
1877
|
var e, t, n;
|
|
@@ -1342,7 +1885,7 @@ var L = class e {
|
|
|
1342
1885
|
}, i = e.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...e) => (r.currency = String(e[2]).toUpperCase(), String(e[1])));
|
|
1343
1886
|
if (n) {
|
|
1344
1887
|
let t = this.numberObject(r);
|
|
1345
|
-
return t ?
|
|
1888
|
+
return t ? Qe(t.formatToParts(_(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
|
|
1346
1889
|
} else if ("currency" in r) return this.number(typeof e == "number" ? e : i, r);
|
|
1347
1890
|
else return this.number(typeof e == "number" ? e : i, {
|
|
1348
1891
|
...r,
|
|
@@ -1365,8 +1908,8 @@ var L = class e {
|
|
|
1365
1908
|
return this.number(r, n);
|
|
1366
1909
|
}
|
|
1367
1910
|
sizeFile(e, t = "byte") {
|
|
1368
|
-
let n =
|
|
1369
|
-
if (n > 1024 &&
|
|
1911
|
+
let n = _(e);
|
|
1912
|
+
if (n > 1024 && d(t)) switch (t) {
|
|
1370
1913
|
case "byte": return this.sizeFile(n / 1024, "kilobyte");
|
|
1371
1914
|
case "kilobyte": return this.sizeFile(n / 1024, "megabyte");
|
|
1372
1915
|
case "megabyte": return this.sizeFile(n / 1024, "gigabyte");
|
|
@@ -1382,11 +1925,11 @@ var L = class e {
|
|
|
1382
1925
|
});
|
|
1383
1926
|
}
|
|
1384
1927
|
percentBy100(e, t) {
|
|
1385
|
-
return this.percent(
|
|
1928
|
+
return this.percent(_(e) / 100, t);
|
|
1386
1929
|
}
|
|
1387
1930
|
plural(e, t, n, r) {
|
|
1388
1931
|
var i;
|
|
1389
|
-
let a =
|
|
1932
|
+
let a = _(e), o = t.split("|");
|
|
1390
1933
|
if (o.length > 1) try {
|
|
1391
1934
|
if (typeof Intl < "u") {
|
|
1392
1935
|
var s;
|
|
@@ -1423,18 +1966,18 @@ var L = class e {
|
|
|
1423
1966
|
return `${this.number(a, r)} ${(i = o == null ? void 0 : o[0]) == null ? "" : i}`.trim();
|
|
1424
1967
|
}
|
|
1425
1968
|
date(e, t, n, r) {
|
|
1426
|
-
let i =
|
|
1969
|
+
let i = R(e), a = typeof n == "string", o = this.dateOptions(t, a ? n : "short");
|
|
1427
1970
|
return r && (o.hour12 = !1), a || Object.assign(o, n), i.toLocaleString(this.getLocation(), o);
|
|
1428
1971
|
}
|
|
1429
1972
|
relative(e, t, n) {
|
|
1430
|
-
let r =
|
|
1973
|
+
let r = R(e), i = n || /* @__PURE__ */ new Date(), a = {
|
|
1431
1974
|
numeric: "auto",
|
|
1432
1975
|
...typeof t == "string" ? { style: t } : t || {}
|
|
1433
1976
|
}, o = "second", s = (r.getTime() - i.getTime()) / 1e3;
|
|
1434
1977
|
return Math.abs(s) >= 60 && (o = "minute", s /= 60, Math.abs(s) >= 60 && (o = "hour", s /= 60, Math.abs(s) >= 24 && (o = "day", s /= 24, Math.abs(s) >= 30 && (o = "month", s /= 30, Math.abs(s) >= 12 && (o = "year", s /= 12))))), this.relativeByValue(s, o, a);
|
|
1435
1978
|
}
|
|
1436
1979
|
relativeLimit(e, t, n, r, i, a, o) {
|
|
1437
|
-
let s =
|
|
1980
|
+
let s = R(e), c = n || /* @__PURE__ */ new Date(), l = new Date(c), u = new Date(c);
|
|
1438
1981
|
return l.setDate(c.getDate() - t), u.setDate(c.getDate() + t), s >= l && s <= u ? this.relative(s, r, c) : this.date(s, a, i, o);
|
|
1439
1982
|
}
|
|
1440
1983
|
relativeByValue(e, t, n) {
|
|
@@ -1443,7 +1986,7 @@ var L = class e {
|
|
|
1443
1986
|
...typeof n == "string" ? { style: n } : n || {}
|
|
1444
1987
|
};
|
|
1445
1988
|
try {
|
|
1446
|
-
if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(
|
|
1989
|
+
if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(_(e)), t);
|
|
1447
1990
|
} catch (e) {
|
|
1448
1991
|
this.errorCenter.on({
|
|
1449
1992
|
group: "intl",
|
|
@@ -1455,7 +1998,7 @@ var L = class e {
|
|
|
1455
1998
|
}
|
|
1456
1999
|
month(e, t) {
|
|
1457
2000
|
try {
|
|
1458
|
-
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(
|
|
2001
|
+
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(R(e));
|
|
1459
2002
|
} catch (e) {
|
|
1460
2003
|
this.errorCenter.on({
|
|
1461
2004
|
group: "intl",
|
|
@@ -1472,7 +2015,7 @@ var L = class e {
|
|
|
1472
2015
|
}];
|
|
1473
2016
|
try {
|
|
1474
2017
|
if (this.hasIntlDateTimeFormat()) {
|
|
1475
|
-
let n = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { month: e || "long" });
|
|
2018
|
+
let n = /* @__PURE__ */ new Date(), r = new Intl.DateTimeFormat(this.getLocation(), { month: e || "long" });
|
|
1476
2019
|
for (let e = 0; e < 12; e++) n.setMonth(e), t.push({
|
|
1477
2020
|
label: r.format(n).replace(/^./, (e) => e.toUpperCase()),
|
|
1478
2021
|
value: e + 1
|
|
@@ -1489,7 +2032,7 @@ var L = class e {
|
|
|
1489
2032
|
}
|
|
1490
2033
|
weekday(e, t) {
|
|
1491
2034
|
try {
|
|
1492
|
-
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(
|
|
2035
|
+
if (this.hasIntlDateTimeFormat()) return new Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(R(e));
|
|
1493
2036
|
} catch (e) {
|
|
1494
2037
|
this.errorCenter.on({
|
|
1495
2038
|
group: "intl",
|
|
@@ -1506,7 +2049,7 @@ var L = class e {
|
|
|
1506
2049
|
}];
|
|
1507
2050
|
try {
|
|
1508
2051
|
if (this.hasIntlDateTimeFormat()) {
|
|
1509
|
-
let n = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }), i = n.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
2052
|
+
let n = /* @__PURE__ */ new Date(), r = new Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }), i = n.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
1510
2053
|
n.setDate(n.getDate() - i);
|
|
1511
2054
|
for (let e = 0; e < 7; e++) t.push({
|
|
1512
2055
|
label: r.format(n).replace(/^./, (e) => e.toUpperCase()),
|
|
@@ -1591,12 +2134,15 @@ var L = class e {
|
|
|
1591
2134
|
"second"
|
|
1592
2135
|
].indexOf(e) !== -1 && (n.second = "2-digit")), n;
|
|
1593
2136
|
}
|
|
1594
|
-
},
|
|
2137
|
+
}, B = {}, V = {}, $e = class e {
|
|
1595
2138
|
constructor(e, t = "date", n = D.getLocation()) {
|
|
1596
|
-
S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date =
|
|
2139
|
+
S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date = R(e), isNaN(this.date.getTime()) && C.on({
|
|
2140
|
+
group: "intl",
|
|
2141
|
+
code: "invalid"
|
|
2142
|
+
});
|
|
1597
2143
|
}
|
|
1598
2144
|
getIntl() {
|
|
1599
|
-
return
|
|
2145
|
+
return z.getInstance(this.code);
|
|
1600
2146
|
}
|
|
1601
2147
|
getDate() {
|
|
1602
2148
|
return this.date;
|
|
@@ -1645,7 +2191,7 @@ var L = class e {
|
|
|
1645
2191
|
return this.date.getSeconds();
|
|
1646
2192
|
}
|
|
1647
2193
|
getMaxDay() {
|
|
1648
|
-
return this.
|
|
2194
|
+
return this.cloneDayLast().getDay();
|
|
1649
2195
|
}
|
|
1650
2196
|
locale(e = this.type, t) {
|
|
1651
2197
|
return this.getIntl().date(this.date, e, t, this.hour24);
|
|
@@ -1699,7 +2245,7 @@ var L = class e {
|
|
|
1699
2245
|
].indexOf(this.type) !== -1 && (i = n.locale("time"))), `${r.join("-")}${i ? `T${i}${t ? n.getTimeZone() : ""}` : ""}`;
|
|
1700
2246
|
}
|
|
1701
2247
|
setDate(e) {
|
|
1702
|
-
return this.date =
|
|
2248
|
+
return this.date = R(e), this.update(), this;
|
|
1703
2249
|
}
|
|
1704
2250
|
setType(e) {
|
|
1705
2251
|
return this.type = e, this.update(), this;
|
|
@@ -1841,12 +2387,8 @@ var L = class e {
|
|
|
1841
2387
|
return this.cloneClass().moveDayPrevious();
|
|
1842
2388
|
}
|
|
1843
2389
|
toTimeZoneHourFormat(e) {
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
minimumIntegerDigits: 2
|
|
1847
|
-
});
|
|
1848
|
-
let t = Math.trunc(e).toString();
|
|
1849
|
-
return t.length < 2 && (t = `0${t}`), `${e >= 0 ? "+" : "-"}${t}`;
|
|
2390
|
+
let t = Math.trunc(e).toString().replace("-", "").padStart(2, "0");
|
|
2391
|
+
return `${e >= 0 ? "+" : "-"}${t}`;
|
|
1850
2392
|
}
|
|
1851
2393
|
update() {
|
|
1852
2394
|
var e;
|
|
@@ -1854,37 +2396,23 @@ var L = class e {
|
|
|
1854
2396
|
}
|
|
1855
2397
|
};
|
|
1856
2398
|
//#endregion
|
|
1857
|
-
//#region src/functions/anyToString.ts
|
|
1858
|
-
function z(e, n = !0) {
|
|
1859
|
-
var r;
|
|
1860
|
-
return u(e) ? e.trim() : o(e) && e.findIndex((e) => t(e)) === -1 && n ? e.join(",") : t(e) ? JSON.stringify(e) : e === !0 ? "1" : e === !1 ? "0" : (r = e == null ? void 0 : e.toString()) == null ? "" : r;
|
|
1861
|
-
}
|
|
1862
|
-
//#endregion
|
|
1863
|
-
//#region src/functions/strSplit.ts
|
|
1864
|
-
function Ne(e, t, n) {
|
|
1865
|
-
let r = z(e);
|
|
1866
|
-
if (!n || n <= 0) return r.split(t);
|
|
1867
|
-
let i = r.split(t, n), a = r.split(t);
|
|
1868
|
-
return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
|
|
1869
|
-
}
|
|
1870
|
-
//#endregion
|
|
1871
2399
|
//#region src/functions/getItemByPath.ts
|
|
1872
|
-
function
|
|
2400
|
+
function H(e, n) {
|
|
1873
2401
|
var r;
|
|
1874
|
-
if (!
|
|
1875
|
-
let i =
|
|
1876
|
-
return a && e != null && e[a] && t(e[a]) && i != null && i[1] ?
|
|
2402
|
+
if (!l(n, !0)) return;
|
|
2403
|
+
let i = F(n, ".", 2), a = i[0];
|
|
2404
|
+
return a && e != null && e[a] && t(e[a]) && i != null && i[1] ? H(e[a], i[1]) : (r = e == null ? void 0 : e[a]) == null ? void 0 : r;
|
|
1877
2405
|
}
|
|
1878
2406
|
//#endregion
|
|
1879
2407
|
//#region src/functions/toCamelCase.ts
|
|
1880
|
-
function
|
|
2408
|
+
function et(e) {
|
|
1881
2409
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/-+([a-zA-Z0-9])/g, (...e) => `${String(e[1]).toUpperCase()}`).replace(/^([A-Z])/, (e) => `${e.toLowerCase()}`);
|
|
1882
2410
|
}
|
|
1883
2411
|
//#endregion
|
|
1884
2412
|
//#region src/types/formattersTypes.ts
|
|
1885
|
-
var
|
|
2413
|
+
var U = /* @__PURE__ */ function(e) {
|
|
1886
2414
|
return e.currency = "currency", e.date = "date", e.name = "name", e.number = "number", e.plural = "plural", e.unit = "unit", e;
|
|
1887
|
-
}({}),
|
|
2415
|
+
}({}), tt = class {
|
|
1888
2416
|
constructor(e, t) {
|
|
1889
2417
|
this.options = e, this.list = t;
|
|
1890
2418
|
}
|
|
@@ -1898,7 +2426,7 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
1898
2426
|
return this.list ? this.isArray() ? this.list.length : 1 : 0;
|
|
1899
2427
|
}
|
|
1900
2428
|
getList() {
|
|
1901
|
-
return this.list ?
|
|
2429
|
+
return this.list ? k(this.list) : [];
|
|
1902
2430
|
}
|
|
1903
2431
|
getOptions() {
|
|
1904
2432
|
return this.options;
|
|
@@ -1907,7 +2435,7 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
1907
2435
|
return this.list = e, this;
|
|
1908
2436
|
}
|
|
1909
2437
|
to() {
|
|
1910
|
-
let e =
|
|
2438
|
+
let e = r(this.getList(), (e) => ({
|
|
1911
2439
|
...e,
|
|
1912
2440
|
...this.getFormatData(e)
|
|
1913
2441
|
}));
|
|
@@ -1915,46 +2443,46 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
1915
2443
|
}
|
|
1916
2444
|
getFormatData(e) {
|
|
1917
2445
|
let t = {};
|
|
1918
|
-
return
|
|
1919
|
-
let i = `${
|
|
1920
|
-
n != null && n.transformation ?
|
|
2446
|
+
return r(this.options, (n, r) => {
|
|
2447
|
+
let i = `${et(r)}Format`, a = H(e, r);
|
|
2448
|
+
n != null && n.transformation ? l(a) ? t[i] = n.transformation(a, e, n.options) : t[i] = "" : t[i] = this.transformation(a, e, n.type, n.options);
|
|
1921
2449
|
}), t;
|
|
1922
2450
|
}
|
|
1923
2451
|
transformation(e, t, n, r) {
|
|
1924
|
-
if (
|
|
1925
|
-
case
|
|
1926
|
-
case
|
|
1927
|
-
case
|
|
1928
|
-
case
|
|
1929
|
-
case
|
|
1930
|
-
case
|
|
2452
|
+
if (l(e) || n === U.name) switch (n) {
|
|
2453
|
+
case U.currency: return this.formatCurrency(e, t, r);
|
|
2454
|
+
case U.date: return this.formatDate(e, r);
|
|
2455
|
+
case U.name: return this.formatName(t, r);
|
|
2456
|
+
case U.number: return this.formatNumber(e, r);
|
|
2457
|
+
case U.plural: return this.formatPlural(e, r);
|
|
2458
|
+
case U.unit: return this.formatUnit(e, r);
|
|
1931
2459
|
default: return String(e);
|
|
1932
2460
|
}
|
|
1933
2461
|
return "";
|
|
1934
2462
|
}
|
|
1935
2463
|
formatCurrency(e, t, n) {
|
|
1936
2464
|
var r;
|
|
1937
|
-
let i = n != null && n.currencyPropName ?
|
|
1938
|
-
return
|
|
2465
|
+
let i = n != null && n.currencyPropName ? H(t, n.currencyPropName) : t == null ? void 0 : t.currency;
|
|
2466
|
+
return z.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
|
|
1939
2467
|
}
|
|
1940
2468
|
formatDate(e, t) {
|
|
1941
|
-
return
|
|
2469
|
+
return z.getInstance().date(e, t == null ? void 0 : t.type, t == null ? void 0 : t.options, t == null ? void 0 : t.hour24);
|
|
1942
2470
|
}
|
|
1943
2471
|
formatName(e, t) {
|
|
1944
2472
|
var n, r, i;
|
|
1945
|
-
let a =
|
|
1946
|
-
return a && o ?
|
|
2473
|
+
let a = H(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = H(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = H(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
|
|
2474
|
+
return a && o ? z.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
|
|
1947
2475
|
}
|
|
1948
2476
|
formatNumber(e, t) {
|
|
1949
|
-
return
|
|
2477
|
+
return z.getInstance().number(e, t == null ? void 0 : t.options);
|
|
1950
2478
|
}
|
|
1951
2479
|
formatPlural(e, t) {
|
|
1952
|
-
return t && t.words ?
|
|
2480
|
+
return t && t.words ? z.getInstance().plural(e, t == null ? void 0 : t.words, t == null ? void 0 : t.options, t == null ? void 0 : t.optionsNumber) : e;
|
|
1953
2481
|
}
|
|
1954
2482
|
formatUnit(e, t) {
|
|
1955
|
-
return t && t.unit ?
|
|
2483
|
+
return t && t.unit ? z.getInstance().unit(e, t.unit) : e;
|
|
1956
2484
|
}
|
|
1957
|
-
},
|
|
2485
|
+
}, nt = "f", rt = class e {
|
|
1958
2486
|
constructor(e = D.getLocation()) {
|
|
1959
2487
|
this.code = e;
|
|
1960
2488
|
}
|
|
@@ -1978,10 +2506,10 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
1978
2506
|
return (t = this.get(e)) == null ? void 0 : t.icon;
|
|
1979
2507
|
}
|
|
1980
2508
|
getList(e) {
|
|
1981
|
-
return
|
|
2509
|
+
return r(this.getCodes(e), (e) => this.get(e));
|
|
1982
2510
|
}
|
|
1983
2511
|
getNational(t) {
|
|
1984
|
-
return
|
|
2512
|
+
return r(this.getList(t), (t) => {
|
|
1985
2513
|
let n = new e(t.standard).get(t.standard);
|
|
1986
2514
|
return {
|
|
1987
2515
|
...t,
|
|
@@ -1995,7 +2523,7 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
1995
2523
|
return this.code = e, this;
|
|
1996
2524
|
}
|
|
1997
2525
|
getLocation() {
|
|
1998
|
-
return new
|
|
2526
|
+
return new z(this.code);
|
|
1999
2527
|
}
|
|
2000
2528
|
getCodes(t) {
|
|
2001
2529
|
return t == null ? Object.keys(e.flags) : t;
|
|
@@ -2007,7 +2535,7 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
2007
2535
|
return this.getLocation().countryName(e.country);
|
|
2008
2536
|
}
|
|
2009
2537
|
};
|
|
2010
|
-
S(
|
|
2538
|
+
S(rt, "flags", {
|
|
2011
2539
|
AD: "f-ad",
|
|
2012
2540
|
AE: "f-ae",
|
|
2013
2541
|
AF: "f-af",
|
|
@@ -2252,7 +2780,7 @@ S(Ie, "flags", {
|
|
|
2252
2780
|
});
|
|
2253
2781
|
//#endregion
|
|
2254
2782
|
//#region src/classes/GeoPhone.ts
|
|
2255
|
-
var
|
|
2783
|
+
var it = class {
|
|
2256
2784
|
static get(e) {
|
|
2257
2785
|
return this.getList().find((t) => e === t.value);
|
|
2258
2786
|
}
|
|
@@ -2286,7 +2814,7 @@ var Le = class {
|
|
|
2286
2814
|
return this.map || this.makeMap(), (e = this.map) == null ? {} : e;
|
|
2287
2815
|
}
|
|
2288
2816
|
static toMask(e, t) {
|
|
2289
|
-
if (
|
|
2817
|
+
if (l(e) && Array.isArray(t) && t.length > 0) {
|
|
2290
2818
|
let n = this.removeZero(e), r = n.length;
|
|
2291
2819
|
for (let e of t) if (this.getUnnecessaryLength(e) === r) return this.toStandard(n, e);
|
|
2292
2820
|
}
|
|
@@ -2308,11 +2836,11 @@ var Le = class {
|
|
|
2308
2836
|
return (t = (n = e.match(/\*/g)) == null ? void 0 : n.length) == null ? 0 : t;
|
|
2309
2837
|
}
|
|
2310
2838
|
static makeList() {
|
|
2311
|
-
this.list =
|
|
2839
|
+
this.list = r(D.getList(), (e) => {
|
|
2312
2840
|
if (e != null && e.phoneMask) return {
|
|
2313
|
-
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]
|
|
2841
|
+
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/g, "")) || void 0,
|
|
2314
2842
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
2315
|
-
mask:
|
|
2843
|
+
mask: k(e.phoneMask),
|
|
2316
2844
|
value: e.country
|
|
2317
2845
|
};
|
|
2318
2846
|
}).sort((e, t) => e.phone - t.phone);
|
|
@@ -2350,87 +2878,132 @@ var Le = class {
|
|
|
2350
2878
|
return e.replace(/\*/, this.getWithinSymbol(t));
|
|
2351
2879
|
}
|
|
2352
2880
|
};
|
|
2353
|
-
S(
|
|
2881
|
+
S(it, "list", void 0), S(it, "map", void 0);
|
|
2354
2882
|
//#endregion
|
|
2355
2883
|
//#region src/classes/Global.ts
|
|
2356
|
-
var
|
|
2884
|
+
var at = class {
|
|
2885
|
+
static getItem() {
|
|
2886
|
+
return T.get("__ui:global-instance__", () => ({}));
|
|
2887
|
+
}
|
|
2357
2888
|
static get(e) {
|
|
2358
|
-
|
|
2889
|
+
var t;
|
|
2890
|
+
return (t = this.getItem()) == null ? void 0 : t[e];
|
|
2359
2891
|
}
|
|
2360
2892
|
static add(e) {
|
|
2361
|
-
|
|
2893
|
+
let t = this.getItem();
|
|
2894
|
+
Object.keys(t).length > 0 || Object.assign(t, e);
|
|
2362
2895
|
}
|
|
2363
|
-
},
|
|
2364
|
-
|
|
2365
|
-
|
|
2896
|
+
}, ot = class {
|
|
2897
|
+
constructor() {
|
|
2898
|
+
S(this, "hash", void 0), S(this, "watch", {}), S(this, "block", !1), S(this, "time", void 0);
|
|
2366
2899
|
}
|
|
2367
|
-
|
|
2900
|
+
get(e, t) {
|
|
2901
|
+
let n = this.getHash();
|
|
2902
|
+
return !(e in n) && t && this.set(e, t), n[e];
|
|
2903
|
+
}
|
|
2904
|
+
set(e, t) {
|
|
2368
2905
|
var n;
|
|
2369
|
-
let r =
|
|
2370
|
-
r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.
|
|
2906
|
+
let r = b(t);
|
|
2907
|
+
return r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.getHash()[e] = r, this.update()), this;
|
|
2371
2908
|
}
|
|
2372
|
-
|
|
2909
|
+
addWatch(e, t) {
|
|
2373
2910
|
if (e in this.watch) {
|
|
2374
2911
|
var n;
|
|
2375
2912
|
(n = this.watch[e]) == null || n.push(t);
|
|
2376
2913
|
} else this.watch[e] = [t];
|
|
2914
|
+
return this;
|
|
2377
2915
|
}
|
|
2378
|
-
|
|
2916
|
+
removeWatch(e, t) {
|
|
2379
2917
|
var n;
|
|
2380
2918
|
let r = (n = this.watch) == null ? void 0 : n[e];
|
|
2381
|
-
r && (this.watch[e] = r.filter((e) => e !== t));
|
|
2919
|
+
return r && (this.watch[e] = r.filter((e) => e !== t)), this;
|
|
2382
2920
|
}
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
let e = this.getLocation();
|
|
2386
|
-
this.makeWatch(e), this.hash = e;
|
|
2387
|
-
}
|
|
2921
|
+
reload() {
|
|
2922
|
+
return this.block ? setTimeout(() => this.reload(), 32) : this.initData(), this;
|
|
2388
2923
|
}
|
|
2389
|
-
|
|
2924
|
+
getLocation() {
|
|
2390
2925
|
let e = {};
|
|
2391
|
-
|
|
2926
|
+
if (s()) {
|
|
2927
|
+
let t = location.hash.matchAll(/([\w-]+)[:=]([^;]+)/gi);
|
|
2928
|
+
for (let n of t) e[n[1]] = I(n[2]);
|
|
2929
|
+
}
|
|
2930
|
+
return e;
|
|
2392
2931
|
}
|
|
2393
|
-
|
|
2394
|
-
this.
|
|
2395
|
-
|
|
2396
|
-
|
|
2932
|
+
getHash() {
|
|
2933
|
+
return this.hash || this.init(), this.hash;
|
|
2934
|
+
}
|
|
2935
|
+
init() {
|
|
2936
|
+
return this.initData(), s() && addEventListener("hashchange", () => this.reload()), this;
|
|
2397
2937
|
}
|
|
2398
|
-
|
|
2399
|
-
|
|
2938
|
+
initData() {
|
|
2939
|
+
let e = this.getLocation();
|
|
2940
|
+
return this.makeWatch(e), this.hash = e, this;
|
|
2941
|
+
}
|
|
2942
|
+
update() {
|
|
2943
|
+
if (s()) {
|
|
2944
|
+
clearTimeout(this.time), this.block = !0;
|
|
2945
|
+
try {
|
|
2946
|
+
let e = this.getHash();
|
|
2947
|
+
history.replaceState(null, "", `#${o(e, "=", ";")}`);
|
|
2948
|
+
} finally {
|
|
2949
|
+
this.time = setTimeout(() => {
|
|
2950
|
+
this.block = !1;
|
|
2951
|
+
}, 120);
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
return this;
|
|
2955
|
+
}
|
|
2956
|
+
makeWatch(e) {
|
|
2957
|
+
return r(this.watch, (t, n) => {
|
|
2400
2958
|
var r;
|
|
2401
2959
|
((r = this.hash) == null ? void 0 : r[n]) !== (e == null ? void 0 : e[n]) && t.forEach((t) => t(e[n]));
|
|
2402
|
-
});
|
|
2960
|
+
}), this;
|
|
2403
2961
|
}
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2962
|
+
}, st = class {
|
|
2963
|
+
static getItem() {
|
|
2964
|
+
return T.get("__ui:hash-instance__", () => new ot());
|
|
2965
|
+
}
|
|
2966
|
+
static get(e, t) {
|
|
2967
|
+
return this.getItem().get(e, t);
|
|
2968
|
+
}
|
|
2969
|
+
static set(e, t) {
|
|
2970
|
+
this.getItem().set(e, t);
|
|
2971
|
+
}
|
|
2972
|
+
static addWatch(e, t) {
|
|
2973
|
+
this.getItem().addWatch(e, t);
|
|
2974
|
+
}
|
|
2975
|
+
static removeWatch(e, t) {
|
|
2976
|
+
this.getItem().removeWatch(e, t);
|
|
2977
|
+
}
|
|
2978
|
+
static reload() {
|
|
2979
|
+
this.getItem().reload();
|
|
2980
|
+
}
|
|
2981
|
+
}, ct = 320, lt = "--LOAD--", ut = class {
|
|
2409
2982
|
static is(e) {
|
|
2410
2983
|
return e in this.icons || this.getName(e) in this.icons;
|
|
2411
2984
|
}
|
|
2412
2985
|
static async get(e, t = "", n = 1e3 * 60 * 3) {
|
|
2413
2986
|
var r, i, a, o;
|
|
2414
2987
|
let s = (r = (i = (a = this.icons) == null ? void 0 : a[this.getName(e)]) == null ? (o = this.icons) == null ? void 0 : o[e] : i) == null ? `${e.replace(/^@/, t == null ? this.url : t)}.svg` : r;
|
|
2415
|
-
return typeof s == "string" ? s ===
|
|
2988
|
+
return typeof s == "string" ? s === lt && n > 0 ? (await this.wait(), this.get(e, t, n - ct)) : s : y(s) ? await s() : await s;
|
|
2416
2989
|
}
|
|
2417
2990
|
static getNameList() {
|
|
2418
|
-
return
|
|
2991
|
+
return r(this.icons, (e, t) => t.replace(/^@/, ""));
|
|
2419
2992
|
}
|
|
2420
2993
|
static getUrlGlobal() {
|
|
2421
|
-
return `${
|
|
2994
|
+
return `${N.isLocalhost(), ""}${this.url}`;
|
|
2422
2995
|
}
|
|
2423
2996
|
static add(e, t) {
|
|
2424
2997
|
this.icons[this.getName(e)] = t;
|
|
2425
2998
|
}
|
|
2426
2999
|
static addLoad(e) {
|
|
2427
|
-
this.icons[this.getName(e)] =
|
|
3000
|
+
this.icons[this.getName(e)] = lt;
|
|
2428
3001
|
}
|
|
2429
3002
|
static addGlobal(e, t) {
|
|
2430
3003
|
this.icons[this.getName(e)] = `${this.getUrlGlobal()}${t}`;
|
|
2431
3004
|
}
|
|
2432
3005
|
static addByList(e) {
|
|
2433
|
-
|
|
3006
|
+
r(e, (e, t) => this.add(t, e));
|
|
2434
3007
|
}
|
|
2435
3008
|
static setUrl(e) {
|
|
2436
3009
|
this.url = e;
|
|
@@ -2442,49 +3015,59 @@ var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
|
|
|
2442
3015
|
return `@${e}`;
|
|
2443
3016
|
}
|
|
2444
3017
|
static wait() {
|
|
2445
|
-
return new Promise((e) => setTimeout(() => e(),
|
|
3018
|
+
return new Promise((e) => setTimeout(() => e(), ct));
|
|
2446
3019
|
}
|
|
2447
3020
|
};
|
|
2448
|
-
|
|
3021
|
+
S(ut, "icons", {}), S(ut, "url", "/icons/");
|
|
2449
3022
|
//#endregion
|
|
2450
3023
|
//#region src/functions/getElementItem.ts
|
|
2451
|
-
function
|
|
3024
|
+
function dt(e, t, n) {
|
|
2452
3025
|
var r, i;
|
|
2453
|
-
return (r = (i =
|
|
3026
|
+
return (r = (i = O(e)) == null ? void 0 : i[t]) == null ? n : r;
|
|
2454
3027
|
}
|
|
2455
3028
|
//#endregion
|
|
2456
3029
|
//#region src/functions/setElementItem.ts
|
|
2457
|
-
function
|
|
2458
|
-
let a =
|
|
3030
|
+
function ft(e, n, i) {
|
|
3031
|
+
let a = O(e);
|
|
2459
3032
|
if (a) {
|
|
2460
|
-
let e =
|
|
2461
|
-
if (t(e) && t(
|
|
2462
|
-
e[n] =
|
|
3033
|
+
let e = dt(a, n);
|
|
3034
|
+
if (t(e) && t(i)) r(i, (t, n) => {
|
|
3035
|
+
e[n] = b(t);
|
|
2463
3036
|
});
|
|
2464
3037
|
else {
|
|
2465
|
-
let e =
|
|
2466
|
-
!(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] =
|
|
3038
|
+
let e = b(i);
|
|
3039
|
+
!(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] = e;
|
|
2467
3040
|
}
|
|
2468
3041
|
}
|
|
2469
3042
|
return a;
|
|
2470
3043
|
}
|
|
2471
3044
|
//#endregion
|
|
2472
3045
|
//#region src/functions/createElement.ts
|
|
2473
|
-
function
|
|
2474
|
-
if (!
|
|
3046
|
+
function W(e, t = "div", i, a) {
|
|
3047
|
+
if (!s()) return;
|
|
2475
3048
|
let o = document.createElement(t);
|
|
2476
|
-
return typeof
|
|
2477
|
-
|
|
3049
|
+
return typeof i == "function" ? i(o) : n(i) && r(i, (e, t) => {
|
|
3050
|
+
ft(o, t, e);
|
|
2478
3051
|
}), e == null || e.insertBefore(o, a == null ? null : a), o;
|
|
2479
3052
|
}
|
|
2480
3053
|
//#endregion
|
|
2481
3054
|
//#region src/functions/encodeAttribute.ts
|
|
2482
|
-
|
|
2483
|
-
|
|
3055
|
+
var pt = {
|
|
3056
|
+
"&": "&",
|
|
3057
|
+
"<": "<",
|
|
3058
|
+
">": ">",
|
|
3059
|
+
"\"": """,
|
|
3060
|
+
"'": "'"
|
|
3061
|
+
};
|
|
3062
|
+
function G(e) {
|
|
3063
|
+
return String(e).replace(/[&<>"']/g, (e) => {
|
|
3064
|
+
var t;
|
|
3065
|
+
return (t = pt == null ? void 0 : pt[e]) == null ? e : t;
|
|
3066
|
+
});
|
|
2484
3067
|
}
|
|
2485
3068
|
//#endregion
|
|
2486
3069
|
//#region src/classes/MetaManager.ts
|
|
2487
|
-
var
|
|
3070
|
+
var K = class {
|
|
2488
3071
|
constructor(e, t = !1) {
|
|
2489
3072
|
S(this, "items", {}), this.listMeta = e, this.isProperty = t, this.update();
|
|
2490
3073
|
}
|
|
@@ -2499,19 +3082,19 @@ var q = class {
|
|
|
2499
3082
|
return this.items;
|
|
2500
3083
|
}
|
|
2501
3084
|
html() {
|
|
2502
|
-
return
|
|
3085
|
+
return r(this.listMeta, (e) => this.toHtmlString(e)).join("");
|
|
2503
3086
|
}
|
|
2504
3087
|
set(e, t) {
|
|
2505
3088
|
return this.setItem(e, t).setMeta(e), this;
|
|
2506
3089
|
}
|
|
2507
3090
|
setByList(e) {
|
|
2508
|
-
return
|
|
3091
|
+
return r(e, (e, t) => this.set(t, String(e))), this;
|
|
2509
3092
|
}
|
|
2510
3093
|
getAttributeName() {
|
|
2511
3094
|
return this.isProperty ? "property" : "name";
|
|
2512
3095
|
}
|
|
2513
3096
|
findMetaElement(e) {
|
|
2514
|
-
if (!
|
|
3097
|
+
if (!s()) return;
|
|
2515
3098
|
let t = `meta[${this.getAttributeName()}="${e}"]`;
|
|
2516
3099
|
return document.querySelector(t) || void 0;
|
|
2517
3100
|
}
|
|
@@ -2520,18 +3103,20 @@ var q = class {
|
|
|
2520
3103
|
}
|
|
2521
3104
|
setMeta(e) {
|
|
2522
3105
|
var t;
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
}
|
|
2529
|
-
return this;
|
|
3106
|
+
if (!s()) return this;
|
|
3107
|
+
let n = (t = this.items[e]) == null ? "" : t;
|
|
3108
|
+
if (e === "title") return document.title = n, this;
|
|
3109
|
+
let r = this.findMetaElement(e);
|
|
3110
|
+
if (r) return r.content = n, this;
|
|
3111
|
+
let i = { content: n };
|
|
3112
|
+
return this.isProperty ? i.property = e : i.name = e, W(document.head, "meta", i), this;
|
|
2530
3113
|
}
|
|
2531
3114
|
toHtmlString(e) {
|
|
2532
3115
|
var t;
|
|
2533
|
-
let n =
|
|
2534
|
-
|
|
3116
|
+
let n = (t = this.items[e]) == null ? "" : t;
|
|
3117
|
+
if (e === "title") return `<title>${se(n)}</title>`;
|
|
3118
|
+
let r = G(n);
|
|
3119
|
+
return r ? `<meta ${this.getAttributeName()}="${e}" content="${r}">` : "";
|
|
2535
3120
|
}
|
|
2536
3121
|
update() {
|
|
2537
3122
|
return this.listMeta.forEach((e) => {
|
|
@@ -2539,121 +3124,121 @@ var q = class {
|
|
|
2539
3124
|
this.items[e] = (t = (n = this.findMetaElement(e)) == null ? void 0 : n.content) == null ? "" : t;
|
|
2540
3125
|
}), this;
|
|
2541
3126
|
}
|
|
2542
|
-
},
|
|
2543
|
-
return e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
|
|
2544
|
-
}({}),
|
|
3127
|
+
}, q = /* @__PURE__ */ function(e) {
|
|
3128
|
+
return e.title = "title", e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
|
|
3129
|
+
}({}), mt = /* @__PURE__ */ function(e) {
|
|
2545
3130
|
return e.indexFollow = "index, follow", e.noIndexFollow = "noindex, follow", e.indexNoFollow = "index, nofollow", e.noIndexNoFollow = "noindex, nofollow", e.noArchive = "noarchive", e.noSnippet = "nosnippet", e.noImageIndex = "noimageindex", e.images = "images", e.noTranslate = "notranslate", e.noPreview = "nopreview", e.textOnly = "textonly", e.noIndexSubpages = "noindex, noarchive", e.none = "none", e;
|
|
2546
|
-
}({}),
|
|
3131
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
2547
3132
|
return e.title = "og:title", e.type = "og:type", e.url = "og:url", e.image = "og:image", e.description = "og:description", e.locale = "og:locale", e.siteName = "og:site_name", e.localeAlternate = "og:locale:alternate", e.imageUrl = "og:image:url", e.imageSecureUrl = "og:image:secure_url", e.imageType = "og:image:type", e.imageWidth = "og:image:width", e.imageHeight = "og:image:height", e.imageAlt = "og:image:alt", e.video = "og:video", e.videoUrl = "og:video:url", e.videoSecureUrl = "og:video:secure_url", e.videoType = "og:video:type", e.videoWidth = "og:video:width", e.videoHeight = "og:video:height", e.audio = "og:audio", e.audioSecureUrl = "og:audio:secure_url", e.audioType = "og:audio:type", e.articlePublishedTime = "article:published_time", e.articleModifiedTime = "article:modified_time", e.articleExpirationTime = "article:expiration_time", e.articleAuthor = "article:author", e.articleSection = "article:section", e.articleTag = "article:tag", e.bookAuthor = "book:author", e.bookIsbn = "book:isbn", e.bookReleaseDate = "book:release_date", e.bookTag = "book:tag", e.musicDuration = "music:duration", e.musicAlbum = "music:album", e.musicAlbumDisc = "music:album:disc", e.musicAlbumTrack = "music:album:track", e.musicMusician = "music:musician", e.musicSong = "music:song", e.musicSongDisc = "music:song:disc", e.musicSongTrack = "music:song:track", e.musicReleaseDate = "music:release_date", e.musicCreator = "music:creator", e.videoActor = "video:actor", e.videoActorRole = "video:actor:role", e.videoDirector = "video:director", e.videoWriter = "video:writer", e.videoDuration = "video:duration", e.videoReleaseDate = "video:release_date", e.videoTag = "video:tag", e.videoSeries = "video:series", e.profileFirstName = "profile:first_name", e.profileLastName = "profile:last_name", e.profileUsername = "profile:username", e.profileGender = "profile:gender", e.productBrand = "product:brand", e.productAvailability = "product:availability", e.productCondition = "product:condition", e.productPriceAmount = "product:price:amount", e.productPriceCurrency = "product:price:currency", e.productRetailerItemId = "product:retailer_item_id", e.productCategory = "product:category", e.productEan = "product:ean", e.productIsbn = "product:isbn", e.productMfrPartNo = "product:mfr_part_no", e.productUpc = "product:upc", e.productWeightValue = "product:weight:value", e.productWeightUnits = "product:weight:units", e.productColor = "product:color", e.productMaterial = "product:material", e.productPattern = "product:pattern", e.productAgeGroup = "product:age_group", e.productGender = "product:gender", e;
|
|
2548
|
-
}({}),
|
|
3133
|
+
}({}), ht = /* @__PURE__ */ function(e) {
|
|
2549
3134
|
return e.website = "website", e.article = "article", e.video = "video.other", e.videoTvShow = "video.tv_show", e.videoEpisode = "video.episode", e.videoMovie = "video.movie", e.musicAlbum = "music.album", e.musicPlaylist = "music.playlist", e.musicSong = "music.song", e.musicRadioStation = "music.radio_station", e.app = "app", e.product = "product", e.business = "business.business", e.place = "place", e.event = "event", e.profile = "profile", e.book = "book", e;
|
|
2550
|
-
}({}),
|
|
3135
|
+
}({}), gt = /* @__PURE__ */ function(e) {
|
|
2551
3136
|
return e.inStock = "in stock", e.outOfStock = "out of stock", e.preorder = "preorder", e.backorder = "backorder", e.discontinued = "discontinued", e.pending = "pending", e;
|
|
2552
|
-
}({}),
|
|
3137
|
+
}({}), _t = /* @__PURE__ */ function(e) {
|
|
2553
3138
|
return e.new = "new", e.used = "used", e.refurbished = "refurbished", e;
|
|
2554
|
-
}({}),
|
|
3139
|
+
}({}), vt = /* @__PURE__ */ function(e) {
|
|
2555
3140
|
return e.newborn = "newborn", e.infant = "infant", e.toddler = "toddler", e.kids = "kids", e.adult = "adult", e;
|
|
2556
|
-
}({}),
|
|
3141
|
+
}({}), yt = /* @__PURE__ */ function(e) {
|
|
2557
3142
|
return e.female = "female", e.male = "male", e.unisex = "unisex", e;
|
|
2558
|
-
}({}),
|
|
3143
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
2559
3144
|
return e.card = "twitter:card", e.site = "twitter:site", e.creator = "twitter:creator", e.url = "twitter:url", e.title = "twitter:title", e.description = "twitter:description", e.image = "twitter:image", e.imageAlt = "twitter:image:alt", e.imageSrc = "twitter:image:src", e.imageWidth = "twitter:image:width", e.imageHeight = "twitter:image:height", e.label1 = "twitter:label1", e.data1 = "twitter:data1", e.label2 = "twitter:label2", e.data2 = "twitter:data2", e.appNameIphone = "twitter:app:name:iphone", e.appIdIphone = "twitter:app:id:iphone", e.appUrlIphone = "twitter:app:url:iphone", e.appNameIpad = "twitter:app:name:ipad", e.appIdIpad = "twitter:app:id:ipad", e.appUrlIpad = "twitter:app:url:ipad", e.appNameGooglePlay = "twitter:app:name:googleplay", e.appIdGooglePlay = "twitter:app:id:googleplay", e.appUrlGooglePlay = "twitter:app:url:googleplay", e.player = "twitter:player", e.playerWidth = "twitter:player:width", e.playerHeight = "twitter:player:height", e.playerStream = "twitter:player:stream", e.playerStreamContentType = "twitter:player:stream:content_type", e;
|
|
2560
|
-
}({}),
|
|
3145
|
+
}({}), bt = /* @__PURE__ */ function(e) {
|
|
2561
3146
|
return e.summary = "summary", e.summaryLargeImage = "summary_large_image", e.app = "app", e.player = "player", e.product = "product", e.gallery = "gallery", e.photo = "photo", e.leadGeneration = "lead_generation", e.audio = "audio", e.poll = "poll", e;
|
|
2562
|
-
}({}),
|
|
3147
|
+
}({}), xt = class extends K {
|
|
2563
3148
|
constructor() {
|
|
2564
|
-
super(Object.values(
|
|
3149
|
+
super(Object.values(J), !0);
|
|
2565
3150
|
}
|
|
2566
3151
|
getTitle() {
|
|
2567
|
-
return this.get(
|
|
3152
|
+
return this.get(J.title);
|
|
2568
3153
|
}
|
|
2569
3154
|
getType() {
|
|
2570
|
-
return this.get(
|
|
3155
|
+
return this.get(J.type);
|
|
2571
3156
|
}
|
|
2572
3157
|
getUrl() {
|
|
2573
|
-
return this.get(
|
|
3158
|
+
return this.get(J.url);
|
|
2574
3159
|
}
|
|
2575
3160
|
getImage() {
|
|
2576
|
-
return this.get(
|
|
3161
|
+
return this.get(J.image);
|
|
2577
3162
|
}
|
|
2578
3163
|
getDescription() {
|
|
2579
|
-
return this.get(
|
|
3164
|
+
return this.get(J.description);
|
|
2580
3165
|
}
|
|
2581
3166
|
getLocale() {
|
|
2582
|
-
return this.get(
|
|
3167
|
+
return this.get(J.locale);
|
|
2583
3168
|
}
|
|
2584
3169
|
getSiteName() {
|
|
2585
|
-
return this.get(
|
|
3170
|
+
return this.get(J.siteName);
|
|
2586
3171
|
}
|
|
2587
3172
|
setTitle(e) {
|
|
2588
|
-
return this.set(
|
|
3173
|
+
return this.set(J.title, e);
|
|
2589
3174
|
}
|
|
2590
3175
|
setType(e) {
|
|
2591
|
-
return this.set(
|
|
3176
|
+
return this.set(J.type, e);
|
|
2592
3177
|
}
|
|
2593
3178
|
setUrl(e) {
|
|
2594
|
-
return this.set(
|
|
3179
|
+
return this.set(J.url, e);
|
|
2595
3180
|
}
|
|
2596
3181
|
setImage(e) {
|
|
2597
|
-
return this.set(
|
|
3182
|
+
return this.set(J.image, e);
|
|
2598
3183
|
}
|
|
2599
3184
|
setDescription(e) {
|
|
2600
|
-
return this.set(
|
|
3185
|
+
return this.set(J.description, e);
|
|
2601
3186
|
}
|
|
2602
3187
|
setLocale(e) {
|
|
2603
|
-
return this.set(
|
|
3188
|
+
return this.set(J.locale, e);
|
|
2604
3189
|
}
|
|
2605
3190
|
setSiteName(e) {
|
|
2606
|
-
return this.set(
|
|
3191
|
+
return this.set(J.siteName, e);
|
|
2607
3192
|
}
|
|
2608
|
-
},
|
|
3193
|
+
}, St = class extends K {
|
|
2609
3194
|
constructor() {
|
|
2610
|
-
super(Object.values(
|
|
3195
|
+
super(Object.values(Y));
|
|
2611
3196
|
}
|
|
2612
3197
|
getCard() {
|
|
2613
|
-
return this.get(
|
|
3198
|
+
return this.get(Y.card);
|
|
2614
3199
|
}
|
|
2615
3200
|
getSite() {
|
|
2616
|
-
return this.get(
|
|
3201
|
+
return this.get(Y.site);
|
|
2617
3202
|
}
|
|
2618
3203
|
getCreator() {
|
|
2619
|
-
return this.get(
|
|
3204
|
+
return this.get(Y.creator);
|
|
2620
3205
|
}
|
|
2621
3206
|
getUrl() {
|
|
2622
|
-
return this.get(
|
|
3207
|
+
return this.get(Y.url);
|
|
2623
3208
|
}
|
|
2624
3209
|
getTitle() {
|
|
2625
|
-
return this.get(
|
|
3210
|
+
return this.get(Y.title);
|
|
2626
3211
|
}
|
|
2627
3212
|
getDescription() {
|
|
2628
|
-
return this.get(
|
|
3213
|
+
return this.get(Y.description);
|
|
2629
3214
|
}
|
|
2630
3215
|
getImage() {
|
|
2631
|
-
return this.get(
|
|
3216
|
+
return this.get(Y.image);
|
|
2632
3217
|
}
|
|
2633
3218
|
setCard(e) {
|
|
2634
|
-
return this.set(
|
|
3219
|
+
return this.set(Y.card, e), this;
|
|
2635
3220
|
}
|
|
2636
3221
|
setSite(e) {
|
|
2637
|
-
return this.set(
|
|
3222
|
+
return this.set(Y.site, e), this;
|
|
2638
3223
|
}
|
|
2639
3224
|
setCreator(e) {
|
|
2640
|
-
return this.set(
|
|
3225
|
+
return this.set(Y.creator, e), this;
|
|
2641
3226
|
}
|
|
2642
3227
|
setUrl(e) {
|
|
2643
|
-
return this.set(
|
|
3228
|
+
return this.set(Y.url, e), this;
|
|
2644
3229
|
}
|
|
2645
3230
|
setTitle(e) {
|
|
2646
|
-
return this.set(
|
|
3231
|
+
return this.set(Y.title, e), this;
|
|
2647
3232
|
}
|
|
2648
3233
|
setDescription(e) {
|
|
2649
|
-
return this.set(
|
|
3234
|
+
return this.set(Y.description, e), this;
|
|
2650
3235
|
}
|
|
2651
3236
|
setImage(e) {
|
|
2652
|
-
return this.set(
|
|
3237
|
+
return this.set(Y.image, e), this;
|
|
2653
3238
|
}
|
|
2654
|
-
},
|
|
3239
|
+
}, Ct = class extends K {
|
|
2655
3240
|
constructor() {
|
|
2656
|
-
super(Object.values(
|
|
3241
|
+
super(Object.values(q)), S(this, "suffix", void 0), S(this, "og", void 0), S(this, "twitter", void 0), this.og = new xt(), this.twitter = new St();
|
|
2657
3242
|
}
|
|
2658
3243
|
getOg() {
|
|
2659
3244
|
return this.og;
|
|
@@ -2662,25 +3247,26 @@ var q = class {
|
|
|
2662
3247
|
return this.twitter;
|
|
2663
3248
|
}
|
|
2664
3249
|
getTitle() {
|
|
2665
|
-
|
|
3250
|
+
let e = this.get(q.title);
|
|
3251
|
+
return !l(e) && s() && (e = document.title), e.replace(this.getSuffix(), "").trim();
|
|
2666
3252
|
}
|
|
2667
3253
|
getKeywords() {
|
|
2668
|
-
return this.get(
|
|
3254
|
+
return this.get(q.keywords);
|
|
2669
3255
|
}
|
|
2670
3256
|
getDescription() {
|
|
2671
|
-
return this.get(
|
|
3257
|
+
return this.get(q.description);
|
|
2672
3258
|
}
|
|
2673
3259
|
getImage() {
|
|
2674
3260
|
return this.og.getImage();
|
|
2675
3261
|
}
|
|
2676
3262
|
getCanonical() {
|
|
2677
|
-
return this.get(
|
|
3263
|
+
return this.get(q.canonical);
|
|
2678
3264
|
}
|
|
2679
3265
|
getRobots() {
|
|
2680
|
-
return this.get(
|
|
3266
|
+
return this.get(q.robots);
|
|
2681
3267
|
}
|
|
2682
3268
|
getAuthor() {
|
|
2683
|
-
return this.get(
|
|
3269
|
+
return this.get(q.author);
|
|
2684
3270
|
}
|
|
2685
3271
|
getSiteName() {
|
|
2686
3272
|
return this.og.getSiteName();
|
|
@@ -2689,29 +3275,26 @@ var q = class {
|
|
|
2689
3275
|
return this.og.getLocale();
|
|
2690
3276
|
}
|
|
2691
3277
|
setTitle(e) {
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
document.title = t, this.og.setTitle(t), this.twitter.setTitle(t);
|
|
2695
|
-
}
|
|
2696
|
-
return this;
|
|
3278
|
+
let t = l(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
3279
|
+
return s() && (document.title = t), this.set(q.title, t), this.og.setTitle(t), this.twitter.setTitle(t), this;
|
|
2697
3280
|
}
|
|
2698
3281
|
setKeywords(e) {
|
|
2699
|
-
return this.set(
|
|
3282
|
+
return this.set(q.keywords, k(e).join(", ")), this;
|
|
2700
3283
|
}
|
|
2701
3284
|
setDescription(e) {
|
|
2702
|
-
return this.set(
|
|
3285
|
+
return this.set(q.description, e), this;
|
|
2703
3286
|
}
|
|
2704
3287
|
setImage(e) {
|
|
2705
3288
|
return this.og.setImage(e), this.twitter.setImage(e), this;
|
|
2706
3289
|
}
|
|
2707
3290
|
setCanonical(e) {
|
|
2708
|
-
return this.set(
|
|
3291
|
+
return this.set(q.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
|
|
2709
3292
|
}
|
|
2710
3293
|
setRobots(e) {
|
|
2711
|
-
return this.set(
|
|
3294
|
+
return this.set(q.robots, e), this;
|
|
2712
3295
|
}
|
|
2713
3296
|
setAuthor(e) {
|
|
2714
|
-
return this.set(
|
|
3297
|
+
return this.set(q.author, e), this;
|
|
2715
3298
|
}
|
|
2716
3299
|
setSiteName(e) {
|
|
2717
3300
|
return this.og.setSiteName(e), this.twitter.setSite(e), this;
|
|
@@ -2726,31 +3309,102 @@ var q = class {
|
|
|
2726
3309
|
return `${super.html()}${this.og.html()}${this.twitter.html()}`;
|
|
2727
3310
|
}
|
|
2728
3311
|
getSuffix() {
|
|
2729
|
-
return
|
|
3312
|
+
return l(this.suffix) ? ` - ${this.suffix}` : "";
|
|
3313
|
+
}
|
|
3314
|
+
}, wt = class {
|
|
3315
|
+
static getItem() {
|
|
3316
|
+
return T.get("__ui:meta-instance__", () => new Ct());
|
|
3317
|
+
}
|
|
3318
|
+
static getOg() {
|
|
3319
|
+
return this.getItem().getOg();
|
|
3320
|
+
}
|
|
3321
|
+
static getTwitter() {
|
|
3322
|
+
return this.getItem().getTwitter();
|
|
3323
|
+
}
|
|
3324
|
+
static getTitle() {
|
|
3325
|
+
return this.getItem().getTitle();
|
|
3326
|
+
}
|
|
3327
|
+
static getKeywords() {
|
|
3328
|
+
return this.getItem().getKeywords();
|
|
3329
|
+
}
|
|
3330
|
+
static getDescription() {
|
|
3331
|
+
return this.getItem().getDescription();
|
|
3332
|
+
}
|
|
3333
|
+
static getImage() {
|
|
3334
|
+
return this.getItem().getImage();
|
|
3335
|
+
}
|
|
3336
|
+
static getCanonical() {
|
|
3337
|
+
return this.getItem().getCanonical();
|
|
3338
|
+
}
|
|
3339
|
+
static getRobots() {
|
|
3340
|
+
return this.getItem().getRobots();
|
|
3341
|
+
}
|
|
3342
|
+
static getAuthor() {
|
|
3343
|
+
return this.getItem().getAuthor();
|
|
3344
|
+
}
|
|
3345
|
+
static getSiteName() {
|
|
3346
|
+
return this.getItem().getSiteName();
|
|
3347
|
+
}
|
|
3348
|
+
static getLocale() {
|
|
3349
|
+
return this.getItem().getLocale();
|
|
3350
|
+
}
|
|
3351
|
+
static setTitle(e) {
|
|
3352
|
+
return this.getItem().setTitle(e), this;
|
|
2730
3353
|
}
|
|
2731
|
-
|
|
3354
|
+
static setKeywords(e) {
|
|
3355
|
+
return this.getItem().setKeywords(e), this;
|
|
3356
|
+
}
|
|
3357
|
+
static setDescription(e) {
|
|
3358
|
+
return this.getItem().setDescription(e), this;
|
|
3359
|
+
}
|
|
3360
|
+
static setImage(e) {
|
|
3361
|
+
return this.getItem().setImage(e), this;
|
|
3362
|
+
}
|
|
3363
|
+
static setCanonical(e) {
|
|
3364
|
+
return this.getItem().setCanonical(e), this;
|
|
3365
|
+
}
|
|
3366
|
+
static setRobots(e) {
|
|
3367
|
+
return this.getItem().setRobots(e), this;
|
|
3368
|
+
}
|
|
3369
|
+
static setAuthor(e) {
|
|
3370
|
+
return this.getItem().setAuthor(e), this;
|
|
3371
|
+
}
|
|
3372
|
+
static setSiteName(e) {
|
|
3373
|
+
return this.getItem().setSiteName(e), this;
|
|
3374
|
+
}
|
|
3375
|
+
static setLocale(e) {
|
|
3376
|
+
return this.getItem().setLocale(e), this;
|
|
3377
|
+
}
|
|
3378
|
+
static setSuffix(e) {
|
|
3379
|
+
return this.getItem().setSuffix(e), this;
|
|
3380
|
+
}
|
|
3381
|
+
static html() {
|
|
3382
|
+
return this.getItem().html();
|
|
3383
|
+
}
|
|
3384
|
+
}, Tt = class {
|
|
2732
3385
|
static async is() {
|
|
2733
3386
|
let e = await this.get();
|
|
2734
3387
|
return e !== -1 && e <= 8;
|
|
2735
3388
|
}
|
|
2736
3389
|
static async get() {
|
|
2737
3390
|
var e;
|
|
2738
|
-
|
|
3391
|
+
if (!s()) return 0;
|
|
3392
|
+
let t = (e = this.getStorage().get()) == null ? -1 : e;
|
|
2739
3393
|
if (!this.calculate && t === -1) {
|
|
2740
3394
|
let e = await this.init();
|
|
2741
|
-
return this.
|
|
3395
|
+
return this.getStorage().set(e), e;
|
|
2742
3396
|
}
|
|
2743
3397
|
return t;
|
|
2744
3398
|
}
|
|
2745
3399
|
static getStorage() {
|
|
2746
|
-
return
|
|
3400
|
+
return new E("__ui:scrollbar__", !0);
|
|
2747
3401
|
}
|
|
2748
3402
|
static getCalculate() {
|
|
2749
3403
|
return this.calculate;
|
|
2750
3404
|
}
|
|
2751
3405
|
static createElement() {
|
|
2752
|
-
return
|
|
2753
|
-
e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%",
|
|
3406
|
+
return W(document.body, "div", (e) => {
|
|
3407
|
+
e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%", W(e, "div", (e) => {
|
|
2754
3408
|
e.style.height = "100px";
|
|
2755
3409
|
});
|
|
2756
3410
|
});
|
|
@@ -2765,26 +3419,34 @@ var q = class {
|
|
|
2765
3419
|
});
|
|
2766
3420
|
}
|
|
2767
3421
|
};
|
|
2768
|
-
S(
|
|
3422
|
+
S(Tt, "calculate", !1);
|
|
2769
3423
|
//#endregion
|
|
2770
3424
|
//#region src/functions/escapeExp.ts
|
|
2771
|
-
function
|
|
2772
|
-
return e.replace(/([
|
|
3425
|
+
function X(e) {
|
|
3426
|
+
return String(e).replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
|
|
2773
3427
|
}
|
|
2774
3428
|
//#endregion
|
|
2775
3429
|
//#region src/functions/getSeparatingSearchExp.ts
|
|
2776
|
-
function
|
|
2777
|
-
|
|
2778
|
-
|
|
3430
|
+
function Et(e, t = 128) {
|
|
3431
|
+
if (e instanceof RegExp) return e;
|
|
3432
|
+
if (!e || e.trim().length === 0 || e.length > t) return /^/;
|
|
3433
|
+
let n = String(e).replace(/\s+/g, " ").trim().split(" ").map(X).join("|");
|
|
3434
|
+
return RegExp(`(${n})`, "ig");
|
|
2779
3435
|
}
|
|
2780
3436
|
//#endregion
|
|
2781
3437
|
//#region src/functions/addTagHighlightMatch.ts
|
|
2782
|
-
|
|
2783
|
-
|
|
3438
|
+
var Dt = `___HIGHLIGHT_START_${f(1e5, 999999)}___`, Ot = `___HIGHLIGHT_END_${f(1e5, 999999)}___`, kt = RegExp(`${Dt}|${Ot}`, "g");
|
|
3439
|
+
function At(e, t, n = "sys-highlight-match", r = !1) {
|
|
3440
|
+
let i = a(e);
|
|
3441
|
+
if (l(i) && l(t)) {
|
|
3442
|
+
let e = i.replace(Et(t), `${Dt}$1${Ot}`);
|
|
3443
|
+
return r && (e = G(e)), e.replace(kt, (e) => e === Dt ? `<span class="${n}">` : "</span>");
|
|
3444
|
+
}
|
|
3445
|
+
return r ? G(i) : i;
|
|
2784
3446
|
}
|
|
2785
3447
|
//#endregion
|
|
2786
3448
|
//#region src/classes/SearchListData.ts
|
|
2787
|
-
var
|
|
3449
|
+
var jt = class {
|
|
2788
3450
|
constructor(e, t, n, r) {
|
|
2789
3451
|
S(this, "listCache", void 0), this.list = e, this.columns = t, this.item = n, this.options = r;
|
|
2790
3452
|
}
|
|
@@ -2823,8 +3485,8 @@ var at = class {
|
|
|
2823
3485
|
toFormatItem(e, t) {
|
|
2824
3486
|
let n = {};
|
|
2825
3487
|
return this.columns && this.columns.forEach((r) => {
|
|
2826
|
-
let i = this.getColumnName(r), a =
|
|
2827
|
-
n[i] =
|
|
3488
|
+
let i = this.getColumnName(r), a = H(e, r);
|
|
3489
|
+
n[i] = l(a) && t ? this.addTag(a) : P(a);
|
|
2828
3490
|
}), {
|
|
2829
3491
|
...e,
|
|
2830
3492
|
...n,
|
|
@@ -2835,7 +3497,7 @@ var at = class {
|
|
|
2835
3497
|
return e.replace(/\.([a-z0-9])/gi, (e, t) => t.toUpperCase()) + "Search";
|
|
2836
3498
|
}
|
|
2837
3499
|
addTag(e) {
|
|
2838
|
-
return
|
|
3500
|
+
return At(P(e), this.item.get(), this.options.getClassName());
|
|
2839
3501
|
}
|
|
2840
3502
|
generateCache() {
|
|
2841
3503
|
if (!this.isList()) return [];
|
|
@@ -2843,8 +3505,8 @@ var at = class {
|
|
|
2843
3505
|
for (let t of this.list) {
|
|
2844
3506
|
let n = "";
|
|
2845
3507
|
if (this.columns) for (let e of this.columns) {
|
|
2846
|
-
let r =
|
|
2847
|
-
|
|
3508
|
+
let r = H(t, e);
|
|
3509
|
+
l(r) && (n += ` ${P(r)}`);
|
|
2848
3510
|
}
|
|
2849
3511
|
e.push({
|
|
2850
3512
|
item: t,
|
|
@@ -2859,7 +3521,7 @@ var at = class {
|
|
|
2859
3521
|
resetCache() {
|
|
2860
3522
|
this.listCache = void 0;
|
|
2861
3523
|
}
|
|
2862
|
-
},
|
|
3524
|
+
}, Mt = class {
|
|
2863
3525
|
constructor(e, t) {
|
|
2864
3526
|
this.value = e, this.options = t;
|
|
2865
3527
|
}
|
|
@@ -2879,27 +3541,28 @@ var at = class {
|
|
|
2879
3541
|
};
|
|
2880
3542
|
//#endregion
|
|
2881
3543
|
//#region src/functions/getExp.ts
|
|
2882
|
-
function
|
|
2883
|
-
let r =
|
|
3544
|
+
function Nt(e, t = "ig", n = ":value") {
|
|
3545
|
+
let r = X(e);
|
|
2884
3546
|
return new RegExp(n.replace(/:value/g, r), t);
|
|
2885
3547
|
}
|
|
2886
3548
|
//#endregion
|
|
2887
3549
|
//#region src/functions/getExactSearchExp.ts
|
|
2888
|
-
function
|
|
2889
|
-
return
|
|
3550
|
+
function Pt(e) {
|
|
3551
|
+
return Nt(e, "i", "(:value)");
|
|
2890
3552
|
}
|
|
2891
3553
|
//#endregion
|
|
2892
3554
|
//#region src/functions/getSearchExp.ts
|
|
2893
|
-
function
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
3555
|
+
function Ft(e, t = 128) {
|
|
3556
|
+
if (!d(e) || e.trim().length === 0 || e.length > t) return /^/;
|
|
3557
|
+
let n = [];
|
|
3558
|
+
return a(e).split(" ").forEach((e) => {
|
|
3559
|
+
let t = X(e).trim();
|
|
3560
|
+
l(t) && n.push(`(?=.*?${t})`);
|
|
3561
|
+
}), RegExp(`^${n.join("")}`, "i");
|
|
2899
3562
|
}
|
|
2900
3563
|
//#endregion
|
|
2901
3564
|
//#region src/classes/SearchListMatcher.ts
|
|
2902
|
-
var
|
|
3565
|
+
var It = class {
|
|
2903
3566
|
constructor(e, t) {
|
|
2904
3567
|
S(this, "matcher", void 0), this.item = e, this.options = t, this.initMatcher();
|
|
2905
3568
|
}
|
|
@@ -2916,9 +3579,9 @@ var ut = class {
|
|
|
2916
3579
|
this.initMatcher();
|
|
2917
3580
|
}
|
|
2918
3581
|
initMatcher() {
|
|
2919
|
-
this.item.is() ? this.matcher = this.options.getFindExactMatch() ?
|
|
3582
|
+
this.item.is() ? this.matcher = this.options.getFindExactMatch() ? Pt(this.item.get()) : Ft(this.item.get()) : this.matcher = void 0;
|
|
2920
3583
|
}
|
|
2921
|
-
},
|
|
3584
|
+
}, Lt = class {
|
|
2922
3585
|
constructor(e) {
|
|
2923
3586
|
this.options = e;
|
|
2924
3587
|
}
|
|
@@ -2948,12 +3611,12 @@ var ut = class {
|
|
|
2948
3611
|
setOptions(e) {
|
|
2949
3612
|
return this.options = e, this;
|
|
2950
3613
|
}
|
|
2951
|
-
},
|
|
3614
|
+
}, Rt = class {
|
|
2952
3615
|
constructor(e, t, n, r) {
|
|
2953
3616
|
S(this, "options", void 0), S(this, "item", void 0), S(this, "matcher", void 0), S(this, "data", void 0), S(this, "callbackToSelection", (e, t) => {
|
|
2954
3617
|
if (this.matcher.isSelection(t)) return this.data.toFormatItem(e, !0);
|
|
2955
3618
|
if (this.options.getReturnEverything()) return this.data.toFormatItem(e, !1);
|
|
2956
|
-
}), S(this, "callbackToNone", (e) => this.data.toFormatItem(e, !1)), this.options = new
|
|
3619
|
+
}), S(this, "callbackToNone", (e) => this.data.toFormatItem(e, !1)), this.options = new Lt(r), this.item = new Mt(n, this.options), this.matcher = new It(this.item, this.options), this.data = new jt(e, t, this.item, this.options);
|
|
2957
3620
|
}
|
|
2958
3621
|
getData() {
|
|
2959
3622
|
return this.data;
|
|
@@ -2988,17 +3651,17 @@ var ut = class {
|
|
|
2988
3651
|
to() {
|
|
2989
3652
|
if (this.item.isSearch()) return this.data.forEach(this.callbackToSelection);
|
|
2990
3653
|
let e = this.data.getList();
|
|
2991
|
-
return e ?
|
|
3654
|
+
return e ? r(e, this.callbackToNone) : [];
|
|
2992
3655
|
}
|
|
2993
|
-
},
|
|
3656
|
+
}, zt = () => T.get("__ui:storage-callback__", () => ({})), Bt = class e {
|
|
2994
3657
|
static getInstance(t, n = "main") {
|
|
2995
3658
|
return new e(t, n);
|
|
2996
3659
|
}
|
|
2997
3660
|
constructor(e, t = "main") {
|
|
2998
3661
|
S(this, "callbacks", []), S(this, "loading", !1), this.name = e, this.group = t;
|
|
2999
|
-
let n = `${t}:${e}
|
|
3000
|
-
if (n in
|
|
3001
|
-
|
|
3662
|
+
let n = `${t}:${e}`, r = zt();
|
|
3663
|
+
if (n in r) return r[n];
|
|
3664
|
+
r[n] = this;
|
|
3002
3665
|
}
|
|
3003
3666
|
isLoading() {
|
|
3004
3667
|
return this.loading;
|
|
@@ -3023,10 +3686,10 @@ var ut = class {
|
|
|
3023
3686
|
}
|
|
3024
3687
|
async run(e) {
|
|
3025
3688
|
this.loading = !1;
|
|
3026
|
-
for (let { callback: t, isOnce: n } of this.callbacks) await
|
|
3689
|
+
for (let { callback: t, isOnce: n } of this.callbacks) await Le(t, e), n && this.removeCallback(t);
|
|
3027
3690
|
return this;
|
|
3028
3691
|
}
|
|
3029
|
-
},
|
|
3692
|
+
}, Vt = [
|
|
3030
3693
|
"d",
|
|
3031
3694
|
"e",
|
|
3032
3695
|
"f",
|
|
@@ -3046,18 +3709,32 @@ var ut = class {
|
|
|
3046
3709
|
"t",
|
|
3047
3710
|
"u",
|
|
3048
3711
|
"v"
|
|
3049
|
-
],
|
|
3712
|
+
], Ht = RegExp(`%(${Vt.join("|")})`, "g"), Ut = (e, t = {}) => {
|
|
3050
3713
|
let r = String(e);
|
|
3051
|
-
|
|
3052
|
-
let
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3714
|
+
return Array.isArray(t) && e.match(/%[a-z]/) && (r = r.replace(Ht, (e, n) => {
|
|
3715
|
+
let r = Vt.indexOf(n);
|
|
3716
|
+
if (r !== -1) {
|
|
3717
|
+
var i;
|
|
3718
|
+
return String((i = t == null ? void 0 : t[r]) == null ? "" : i);
|
|
3719
|
+
}
|
|
3720
|
+
return e;
|
|
3721
|
+
})), n(t) && (r = r.replace(/[[{](.*?)[\]}](.*?)[[{]\/\1[\]}]/g, (e, n, r) => {
|
|
3722
|
+
if (n in t) {
|
|
3723
|
+
var i;
|
|
3724
|
+
return String((i = t[n]) == null ? "" : i).replace(/[[{]content[\]}]/g, () => r);
|
|
3725
|
+
}
|
|
3726
|
+
return e;
|
|
3727
|
+
}), r = r.replace(/[[{](.*?)[\]}]/g, (e, n) => {
|
|
3728
|
+
if (n in t) {
|
|
3729
|
+
var r;
|
|
3730
|
+
return String((r = t[n]) == null ? "" : r);
|
|
3731
|
+
}
|
|
3732
|
+
return e;
|
|
3733
|
+
})), r;
|
|
3734
|
+
}, Wt = (e) => {
|
|
3735
|
+
var t;
|
|
3736
|
+
return i(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && /^2/.test(String(e.statusObject.status)) || !("status" in e) && !("success" in e) && !("statusObject" in e) && /^2/.test(String(N.getStatus().getStatus()))));
|
|
3737
|
+
}, Gt = "global", Kt = 160, qt = class {
|
|
3061
3738
|
constructor(e, t = () => D.getLanguage(), n = () => D.getLocation()) {
|
|
3062
3739
|
S(this, "files", {}), S(this, "data", {}), this.language = t, this.location = n, e && this.add(e);
|
|
3063
3740
|
}
|
|
@@ -3065,10 +3742,10 @@ var ut = class {
|
|
|
3065
3742
|
return Object.keys(this.files).length > 0 && this.getIndex() !== void 0;
|
|
3066
3743
|
}
|
|
3067
3744
|
getLocation() {
|
|
3068
|
-
return
|
|
3745
|
+
return b(this.location);
|
|
3069
3746
|
}
|
|
3070
3747
|
getLanguage() {
|
|
3071
|
-
return
|
|
3748
|
+
return b(this.language);
|
|
3072
3749
|
}
|
|
3073
3750
|
async getList() {
|
|
3074
3751
|
let e = this.getIndex();
|
|
@@ -3078,8 +3755,8 @@ var ut = class {
|
|
|
3078
3755
|
}
|
|
3079
3756
|
}
|
|
3080
3757
|
add(e) {
|
|
3081
|
-
|
|
3082
|
-
|
|
3758
|
+
r(e, (e, t) => {
|
|
3759
|
+
y(e) && (this.files[t] = e);
|
|
3083
3760
|
});
|
|
3084
3761
|
}
|
|
3085
3762
|
getIndex() {
|
|
@@ -3087,25 +3764,25 @@ var ut = class {
|
|
|
3087
3764
|
if (e in this.files) return e;
|
|
3088
3765
|
let t = this.getLanguage();
|
|
3089
3766
|
if (t in this.files) return t;
|
|
3090
|
-
if ("global" in this.files) return
|
|
3767
|
+
if ("global" in this.files) return Gt;
|
|
3091
3768
|
}
|
|
3092
3769
|
getByData(e) {
|
|
3093
3770
|
if (e in this.data) return this.data[e];
|
|
3094
3771
|
}
|
|
3095
3772
|
async getByFile(e) {
|
|
3096
3773
|
if (e in this.files) {
|
|
3097
|
-
let t = await
|
|
3774
|
+
let t = await b(this.files[e]);
|
|
3098
3775
|
return t && (this.data[e] = t), t;
|
|
3099
3776
|
}
|
|
3100
3777
|
}
|
|
3101
|
-
},
|
|
3102
|
-
constructor(e = "/api/translate", t = "list", n = new
|
|
3778
|
+
}, Jt = class {
|
|
3779
|
+
constructor(e = "/api/translate", t = "list", n = new qt()) {
|
|
3103
3780
|
S(this, "data", {}), S(this, "cache", []), S(this, "resolveList", []), S(this, "timeout", void 0), S(this, "isReadApi", !0), this.url = e, this.propsName = t, this.files = n;
|
|
3104
3781
|
}
|
|
3105
3782
|
async get(e, t) {
|
|
3106
3783
|
var n;
|
|
3107
3784
|
let r = this.getText(e);
|
|
3108
|
-
return r ? this.replacement(r, t) : (
|
|
3785
|
+
return r ? this.replacement(r, t) : (N.isLocalhost() || await this.add(e), this.replacement((n = this.getText(e)) == null ? e : n));
|
|
3109
3786
|
}
|
|
3110
3787
|
getSync(e, t = !1, n) {
|
|
3111
3788
|
let r = this.getText(e);
|
|
@@ -3141,19 +3818,19 @@ var ut = class {
|
|
|
3141
3818
|
});
|
|
3142
3819
|
}
|
|
3143
3820
|
addSync(e) {
|
|
3144
|
-
|
|
3145
|
-
|
|
3821
|
+
r(e, (e, t) => {
|
|
3822
|
+
d(e) && l(e) && (this.data[this.getName(t)] = e);
|
|
3146
3823
|
});
|
|
3147
3824
|
}
|
|
3148
3825
|
async addNormalOrSync(e) {
|
|
3149
|
-
if (
|
|
3826
|
+
if (l(e)) if (N.isLocalhost()) this.addSync(e);
|
|
3150
3827
|
else {
|
|
3151
3828
|
let t = Object.keys(e);
|
|
3152
3829
|
t.length > 0 && await this.add(t);
|
|
3153
3830
|
}
|
|
3154
3831
|
}
|
|
3155
3832
|
addSyncByLocation(e) {
|
|
3156
|
-
|
|
3833
|
+
r(e, (e, t) => r(e, (e, n) => {
|
|
3157
3834
|
let r = `${t}-${n}`;
|
|
3158
3835
|
r in this.data || (this.data[r] = e);
|
|
3159
3836
|
}));
|
|
@@ -3188,26 +3865,31 @@ var ut = class {
|
|
|
3188
3865
|
return `${this.files.getLanguage()}-${e}`;
|
|
3189
3866
|
}
|
|
3190
3867
|
getNameByGlobal(e) {
|
|
3191
|
-
return `${
|
|
3868
|
+
return `${Gt}-${e}`;
|
|
3192
3869
|
}
|
|
3193
3870
|
getNamesNone(e) {
|
|
3194
3871
|
let t = [];
|
|
3195
|
-
return
|
|
3872
|
+
return k(e).forEach((e) => {
|
|
3196
3873
|
e !== "__TRANSLATE_START__" && e !== "__TRANSLATE_END__" && !this.hasName(e) && t.push(e);
|
|
3197
3874
|
}), t;
|
|
3198
3875
|
}
|
|
3199
3876
|
async getResponse() {
|
|
3200
|
-
let e = await
|
|
3877
|
+
let e = await N.get({
|
|
3201
3878
|
api: !1,
|
|
3202
3879
|
path: this.url,
|
|
3203
3880
|
request: { [this.propsName]: this.cache },
|
|
3204
3881
|
toData: !0,
|
|
3882
|
+
timeout: 12e3,
|
|
3205
3883
|
global: !0
|
|
3206
3884
|
});
|
|
3207
|
-
return e
|
|
3885
|
+
return Wt(e) || C.on({
|
|
3886
|
+
group: "translate",
|
|
3887
|
+
code: "error",
|
|
3888
|
+
details: e
|
|
3889
|
+
}), e == null ? {} : e;
|
|
3208
3890
|
}
|
|
3209
3891
|
replacement(e, t) {
|
|
3210
|
-
return t ?
|
|
3892
|
+
return t ? Ut(e, t) : e;
|
|
3211
3893
|
}
|
|
3212
3894
|
async make() {
|
|
3213
3895
|
let e;
|
|
@@ -3219,132 +3901,188 @@ var ut = class {
|
|
|
3219
3901
|
this.data[this.getName(t)] = (n = e == null ? void 0 : e[t]) == null ? "" : n;
|
|
3220
3902
|
}), this.cache = [];
|
|
3221
3903
|
}
|
|
3222
|
-
},
|
|
3904
|
+
}, Yt = class {
|
|
3223
3905
|
static async get(e, t) {
|
|
3224
|
-
return this.
|
|
3906
|
+
return this.getItem().get(e, t);
|
|
3225
3907
|
}
|
|
3226
3908
|
static getItem() {
|
|
3227
|
-
return this.item;
|
|
3909
|
+
return this.item || (this.item = new Jt()), this.item;
|
|
3228
3910
|
}
|
|
3229
3911
|
static getSync(e, t = !1, n) {
|
|
3230
|
-
return this.
|
|
3912
|
+
return this.getItem().getSync(e, t, n);
|
|
3231
3913
|
}
|
|
3232
3914
|
static getList(e) {
|
|
3233
|
-
return this.
|
|
3915
|
+
return this.getItem().getList(e);
|
|
3234
3916
|
}
|
|
3235
3917
|
static getListSync(e, t = !1) {
|
|
3236
|
-
return this.
|
|
3918
|
+
return this.getItem().getListSync(e, t);
|
|
3237
3919
|
}
|
|
3238
3920
|
static async add(e) {
|
|
3239
|
-
await this.
|
|
3921
|
+
await this.getItem().add(e);
|
|
3240
3922
|
}
|
|
3241
3923
|
static addSync(e) {
|
|
3242
|
-
this.
|
|
3924
|
+
this.getItem().addSync(e);
|
|
3243
3925
|
}
|
|
3244
3926
|
static async addNormalOrSync(e) {
|
|
3245
|
-
await this.
|
|
3927
|
+
await this.getItem().addNormalOrSync(e);
|
|
3246
3928
|
}
|
|
3247
3929
|
static addSyncByLocation(e) {
|
|
3248
|
-
this.
|
|
3930
|
+
this.getItem().addSyncByLocation(e);
|
|
3249
3931
|
}
|
|
3250
3932
|
static addSyncByFile(e) {
|
|
3251
|
-
this.
|
|
3933
|
+
this.getItem().addSyncByFile(e);
|
|
3252
3934
|
}
|
|
3253
3935
|
static setUrl(e) {
|
|
3254
|
-
|
|
3936
|
+
this.getItem().setUrl(e);
|
|
3255
3937
|
}
|
|
3256
3938
|
static setPropsName(e) {
|
|
3257
|
-
|
|
3939
|
+
this.getItem().setPropsName(e);
|
|
3258
3940
|
}
|
|
3259
3941
|
static setReadApi(e) {
|
|
3260
|
-
|
|
3942
|
+
this.getItem().setReadApi(e);
|
|
3261
3943
|
}
|
|
3262
3944
|
static setConfig(e) {
|
|
3263
|
-
|
|
3945
|
+
e.url && this.getItem().setUrl(e.url), e.propsName && this.getItem().setPropsName(e.propsName), typeof e.readApi == "boolean" && this.getItem().setReadApi(e.readApi);
|
|
3264
3946
|
}
|
|
3265
3947
|
};
|
|
3266
|
-
S(
|
|
3948
|
+
S(Yt, "item", void 0);
|
|
3267
3949
|
//#endregion
|
|
3268
3950
|
//#region src/functions/arrFill.ts
|
|
3269
|
-
function
|
|
3951
|
+
function Xt(e, t) {
|
|
3270
3952
|
return Array(t).fill(e);
|
|
3271
3953
|
}
|
|
3272
3954
|
//#endregion
|
|
3273
3955
|
//#region src/functions/blobToBase64.ts
|
|
3274
|
-
|
|
3275
|
-
|
|
3956
|
+
var Zt = () => Qt() !== void 0, Qt = () => {
|
|
3957
|
+
var e;
|
|
3958
|
+
return (e = globalThis) == null ? void 0 : e.Buffer;
|
|
3959
|
+
}, $t = async (e) => new Promise((t, n) => {
|
|
3960
|
+
if (typeof FileReader < "u") {
|
|
3276
3961
|
let r = new FileReader();
|
|
3277
|
-
r.onloadend = () =>
|
|
3278
|
-
|
|
3962
|
+
r.onloadend = () => {
|
|
3963
|
+
if (!(r != null && r.result)) {
|
|
3964
|
+
n(/* @__PURE__ */ Error("Failed to read blob"));
|
|
3965
|
+
return;
|
|
3966
|
+
}
|
|
3967
|
+
t(r.result.replace(/^data:.*?,/, ""));
|
|
3968
|
+
}, r.onerror = n, r.readAsDataURL(e);
|
|
3969
|
+
} else n();
|
|
3970
|
+
}), en = (e) => {
|
|
3971
|
+
var t;
|
|
3972
|
+
return ((t = globalThis) == null ? void 0 : t.Buffer).from(e).toString("base64");
|
|
3973
|
+
};
|
|
3974
|
+
async function tn(e, t = !1) {
|
|
3975
|
+
let n = s() ? await $t(e) : Zt() ? en(await e.arrayBuffer()) : void 0;
|
|
3976
|
+
if (n) return t ? n : `data:${e.type};base64,${n}`;
|
|
3279
3977
|
}
|
|
3280
3978
|
//#endregion
|
|
3281
3979
|
//#region src/functions/capitalize.ts
|
|
3282
|
-
function
|
|
3283
|
-
|
|
3980
|
+
function nn(e, t = !1) {
|
|
3981
|
+
let n = String(e);
|
|
3982
|
+
return n.length > 0 ? t ? n.charAt(0).toLocaleUpperCase(D.getLocation()) + n.slice(1) : n.charAt(0).toUpperCase() + n.slice(1) : n;
|
|
3983
|
+
}
|
|
3984
|
+
//#endregion
|
|
3985
|
+
//#region src/functions/copyObject.ts
|
|
3986
|
+
function Z(e) {
|
|
3987
|
+
return JSON.parse(JSON.stringify(e));
|
|
3988
|
+
}
|
|
3989
|
+
//#endregion
|
|
3990
|
+
//#region src/functions/copyObjectLite.ts
|
|
3991
|
+
function rn(e, t) {
|
|
3992
|
+
return Object.assign({}, e, t);
|
|
3284
3993
|
}
|
|
3285
3994
|
//#endregion
|
|
3286
3995
|
//#region src/functions/domQuerySelector.ts
|
|
3287
|
-
function
|
|
3288
|
-
if (
|
|
3996
|
+
function an(e) {
|
|
3997
|
+
if (s()) {
|
|
3289
3998
|
var t;
|
|
3290
3999
|
return (t = document.querySelector(e)) == null ? void 0 : t;
|
|
3291
4000
|
}
|
|
3292
4001
|
}
|
|
3293
4002
|
//#endregion
|
|
3294
4003
|
//#region src/functions/domQuerySelectorAll.ts
|
|
3295
|
-
function
|
|
3296
|
-
if (
|
|
4004
|
+
function on(e) {
|
|
4005
|
+
if (s()) return document.querySelectorAll(e);
|
|
3297
4006
|
}
|
|
3298
4007
|
//#endregion
|
|
3299
4008
|
//#region src/functions/getElementImage.ts
|
|
3300
|
-
function
|
|
3301
|
-
return
|
|
4009
|
+
function sn(e) {
|
|
4010
|
+
return d(e) ? W(void 0, "img", { src: e }) : e;
|
|
3302
4011
|
}
|
|
3303
4012
|
//#endregion
|
|
3304
4013
|
//#region src/functions/resizeImageByMax.ts
|
|
3305
|
-
function
|
|
4014
|
+
function cn(e, t = "auto") {
|
|
3306
4015
|
switch (t) {
|
|
3307
4016
|
case "auto": return e.naturalWidth >= e.naturalHeight;
|
|
3308
4017
|
case "width": return !0;
|
|
3309
4018
|
case "height": return !1;
|
|
3310
4019
|
}
|
|
3311
4020
|
}
|
|
3312
|
-
function
|
|
3313
|
-
let i =
|
|
3314
|
-
if (i && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
|
|
4021
|
+
function ln(e, t, n = "auto", r) {
|
|
4022
|
+
let i = sn(e);
|
|
4023
|
+
if (s() && i && i.naturalWidth && i.naturalHeight && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
|
|
3315
4024
|
var a;
|
|
3316
|
-
let e =
|
|
4025
|
+
let e = cn(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
|
|
3317
4026
|
if (o) return o.canvas.width = e ? t : i.naturalWidth / i.naturalHeight * t, o.canvas.height = e ? i.naturalHeight / i.naturalWidth * t : t, o.drawImage(i, 0, 0, o.canvas.width, o.canvas.height), o.canvas.toDataURL(r);
|
|
3318
4027
|
}
|
|
3319
4028
|
}
|
|
3320
4029
|
//#endregion
|
|
3321
4030
|
//#region src/functions/ensureMaxSize.ts
|
|
3322
|
-
async function
|
|
4031
|
+
async function un(e, t = .56, n = "image/jpeg") {
|
|
3323
4032
|
return new Promise((r) => {
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
4033
|
+
if (!s()) {
|
|
4034
|
+
r("");
|
|
4035
|
+
return;
|
|
4036
|
+
}
|
|
4037
|
+
let i = new Blob([e], { type: n }), a = URL.createObjectURL(i), o = sn(a);
|
|
4038
|
+
o ? (o.onload = () => {
|
|
4039
|
+
let e = ln(o, t * o.naturalWidth, "width", n);
|
|
4040
|
+
r(e == null ? "" : e), URL.revokeObjectURL(a);
|
|
4041
|
+
}, o.onerror = () => {
|
|
4042
|
+
URL.revokeObjectURL(a), r("");
|
|
4043
|
+
}) : tn(i).then((e) => r(String(e == null ? "" : e)));
|
|
3329
4044
|
});
|
|
3330
4045
|
}
|
|
3331
4046
|
//#endregion
|
|
3332
4047
|
//#region src/functions/eventStopPropagation.ts
|
|
3333
|
-
function
|
|
4048
|
+
function dn(e) {
|
|
3334
4049
|
e.preventDefault(), e.stopPropagation();
|
|
3335
4050
|
}
|
|
3336
4051
|
//#endregion
|
|
3337
4052
|
//#region src/functions/frame.ts
|
|
3338
|
-
function
|
|
4053
|
+
function fn(e, t, n) {
|
|
3339
4054
|
let r = () => {
|
|
3340
|
-
e(), t != null && t() ?
|
|
4055
|
+
e(), s() && t != null && t() ? fn(e, t, n) : n == null || n();
|
|
3341
4056
|
};
|
|
3342
|
-
|
|
4057
|
+
s() ? requestAnimationFrame(r) : r();
|
|
4058
|
+
}
|
|
4059
|
+
//#endregion
|
|
4060
|
+
//#region src/functions/getArrayHighlightMatch.ts
|
|
4061
|
+
function pn(e, t) {
|
|
4062
|
+
let n = a(e);
|
|
4063
|
+
if (l(n) && l(t)) {
|
|
4064
|
+
let e = [], r = Et(t), i = 0, a;
|
|
4065
|
+
for (; (a = r.exec(n)) !== null && a.index !== r.lastIndex;) a.index > i && e.push({
|
|
4066
|
+
text: n.substring(i, a.index),
|
|
4067
|
+
isMatch: !1
|
|
4068
|
+
}), e.push({
|
|
4069
|
+
text: a[0],
|
|
4070
|
+
isMatch: !0
|
|
4071
|
+
}), i = r.lastIndex;
|
|
4072
|
+
return i < n.length && e.push({
|
|
4073
|
+
text: n.substring(i),
|
|
4074
|
+
isMatch: !1
|
|
4075
|
+
}), e;
|
|
4076
|
+
}
|
|
4077
|
+
return [{
|
|
4078
|
+
text: n,
|
|
4079
|
+
isMatch: !1
|
|
4080
|
+
}];
|
|
3343
4081
|
}
|
|
3344
4082
|
//#endregion
|
|
3345
4083
|
//#region src/functions/getAttributes.ts
|
|
3346
|
-
function
|
|
3347
|
-
let t = {}, n =
|
|
4084
|
+
function mn(e) {
|
|
4085
|
+
let t = {}, n = O(e);
|
|
3348
4086
|
if (n) for (let e of n.attributes) {
|
|
3349
4087
|
var r;
|
|
3350
4088
|
t[e.name] = (r = (e == null ? void 0 : e.value) || (e == null ? void 0 : e.textContent)) == null ? void 0 : r;
|
|
@@ -3353,130 +4091,163 @@ function Nt(e) {
|
|
|
3353
4091
|
}
|
|
3354
4092
|
//#endregion
|
|
3355
4093
|
//#region src/functions/getClipboardData.ts
|
|
3356
|
-
async function
|
|
3357
|
-
|
|
3358
|
-
|
|
4094
|
+
async function hn(e) {
|
|
4095
|
+
if (s()) try {
|
|
4096
|
+
var t, n;
|
|
4097
|
+
return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
|
|
4098
|
+
} catch (e) {
|
|
4099
|
+
C.on({
|
|
4100
|
+
group: "clipboard",
|
|
4101
|
+
code: "error",
|
|
4102
|
+
details: e
|
|
4103
|
+
});
|
|
4104
|
+
}
|
|
4105
|
+
return "";
|
|
3359
4106
|
}
|
|
3360
4107
|
//#endregion
|
|
3361
4108
|
//#region src/functions/getCurrentDate.ts
|
|
3362
|
-
function
|
|
3363
|
-
return new
|
|
4109
|
+
function gn(e = "datetime") {
|
|
4110
|
+
return new $e(void 0, e).standard();
|
|
3364
4111
|
}
|
|
3365
4112
|
//#endregion
|
|
3366
4113
|
//#region src/functions/getCurrentTime.ts
|
|
3367
|
-
function
|
|
3368
|
-
return
|
|
4114
|
+
function _n() {
|
|
4115
|
+
return Date.now();
|
|
3369
4116
|
}
|
|
3370
4117
|
//#endregion
|
|
3371
4118
|
//#region src/functions/getElementId.ts
|
|
3372
|
-
var
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
4119
|
+
var Q, vn = () => {
|
|
4120
|
+
let e = Q == null ? void 0 : Q();
|
|
4121
|
+
if (e) return `id-server-${e}`;
|
|
4122
|
+
let t = T.get("__ui:getElementId__", () => ({ id: 1e5 }));
|
|
4123
|
+
return `id-${t.id++}`;
|
|
4124
|
+
};
|
|
4125
|
+
function yn(e, t) {
|
|
4126
|
+
if (e) {
|
|
4127
|
+
let n = O(e);
|
|
4128
|
+
if (n) return l(n.id) || n.setAttribute("id", vn()), t ? `#${n.id}${t}`.trim() : n.id;
|
|
4129
|
+
}
|
|
4130
|
+
return vn();
|
|
4131
|
+
}
|
|
4132
|
+
function bn(e) {
|
|
4133
|
+
Q || (Q = e);
|
|
3376
4134
|
}
|
|
3377
4135
|
//#endregion
|
|
3378
4136
|
//#region src/functions/getKey.ts
|
|
3379
|
-
function
|
|
4137
|
+
function xn(e) {
|
|
3380
4138
|
var t, n, r;
|
|
3381
4139
|
return (t = (n = e == null ? void 0 : e.key) == null ? e == null ? void 0 : e.code : n) == null ? e == null || (r = e.keyCode) == null ? void 0 : r.toString() : t;
|
|
3382
4140
|
}
|
|
3383
4141
|
//#endregion
|
|
3384
4142
|
//#region src/functions/getLengthOfAllArray.ts
|
|
3385
|
-
function
|
|
3386
|
-
return
|
|
4143
|
+
function Sn(e) {
|
|
4144
|
+
return r(e, (e) => {
|
|
4145
|
+
var t;
|
|
4146
|
+
return (t = e == null ? void 0 : e.length) == null ? 0 : t;
|
|
4147
|
+
});
|
|
3387
4148
|
}
|
|
3388
4149
|
//#endregion
|
|
3389
4150
|
//#region src/functions/getMaxLengthAllArray.ts
|
|
3390
|
-
function
|
|
3391
|
-
|
|
4151
|
+
function Cn(e) {
|
|
4152
|
+
if (!l(e)) return 0;
|
|
4153
|
+
let t = Sn(e);
|
|
4154
|
+
return t.length > 1e4 ? t.reduce((e, t) => Math.max(e, t)) : Math.max(...t);
|
|
3392
4155
|
}
|
|
3393
4156
|
//#endregion
|
|
3394
4157
|
//#region src/functions/getMinLengthAllArray.ts
|
|
3395
|
-
function
|
|
3396
|
-
|
|
4158
|
+
function wn(e) {
|
|
4159
|
+
if (!l(e)) return 0;
|
|
4160
|
+
let t = Sn(e);
|
|
4161
|
+
return t.length > 1e4 ? t.reduce((e, t) => Math.min(e, t)) : Math.min(...t);
|
|
3397
4162
|
}
|
|
3398
4163
|
//#endregion
|
|
3399
4164
|
//#region src/functions/getMouseClientX.ts
|
|
3400
|
-
function
|
|
4165
|
+
function Tn(e) {
|
|
3401
4166
|
var t, n;
|
|
3402
4167
|
return (e == null ? void 0 : e.clientX) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientX) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientX) || 0;
|
|
3403
4168
|
}
|
|
3404
4169
|
//#endregion
|
|
3405
4170
|
//#region src/functions/getMouseClientY.ts
|
|
3406
|
-
function
|
|
4171
|
+
function En(e) {
|
|
3407
4172
|
var t, n;
|
|
3408
4173
|
return (e == null ? void 0 : e.clientY) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientY) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientY) || 0;
|
|
3409
4174
|
}
|
|
3410
4175
|
//#endregion
|
|
3411
4176
|
//#region src/functions/getMouseClient.ts
|
|
3412
|
-
function
|
|
4177
|
+
function Dn(e) {
|
|
3413
4178
|
return {
|
|
3414
|
-
x:
|
|
3415
|
-
y:
|
|
4179
|
+
x: Tn(e),
|
|
4180
|
+
y: En(e)
|
|
3416
4181
|
};
|
|
3417
4182
|
}
|
|
3418
4183
|
//#endregion
|
|
3419
4184
|
//#region src/functions/getObjectByKeys.ts
|
|
3420
|
-
function
|
|
3421
|
-
let
|
|
3422
|
-
return t.forEach((t) => {
|
|
3423
|
-
t in e && e[t] !== void 0 && (
|
|
3424
|
-
}),
|
|
4185
|
+
function On(e, t) {
|
|
4186
|
+
let r = {};
|
|
4187
|
+
return n(e) && t.forEach((t) => {
|
|
4188
|
+
t in e && e[t] !== void 0 && (r[t] = e[t]);
|
|
4189
|
+
}), r;
|
|
3425
4190
|
}
|
|
3426
4191
|
//#endregion
|
|
3427
4192
|
//#region src/functions/getObjectNoUndefined.ts
|
|
3428
|
-
function
|
|
4193
|
+
function kn(e, t = void 0) {
|
|
3429
4194
|
let n = {};
|
|
3430
|
-
return
|
|
4195
|
+
return r(e, (e, r) => {
|
|
3431
4196
|
e !== t && (n[r] = e);
|
|
3432
4197
|
}), n;
|
|
3433
4198
|
}
|
|
3434
4199
|
//#endregion
|
|
3435
4200
|
//#region src/functions/getObjectOrNone.ts
|
|
3436
|
-
function
|
|
4201
|
+
function An(e) {
|
|
3437
4202
|
return n(e) ? e : {};
|
|
3438
4203
|
}
|
|
3439
4204
|
//#endregion
|
|
4205
|
+
//#region src/functions/getOnlyText.ts
|
|
4206
|
+
function jn(e) {
|
|
4207
|
+
return P(e).replace(/[^\p{L}\p{N}\s]+/gu, "").trim();
|
|
4208
|
+
}
|
|
4209
|
+
//#endregion
|
|
3440
4210
|
//#region src/functions/strFill.ts
|
|
3441
|
-
function
|
|
3442
|
-
return
|
|
4211
|
+
function Mn(e, t) {
|
|
4212
|
+
return String(e).repeat(t);
|
|
3443
4213
|
}
|
|
3444
4214
|
//#endregion
|
|
3445
4215
|
//#region src/functions/getRandomText.ts
|
|
3446
|
-
function
|
|
3447
|
-
let a =
|
|
3448
|
-
for (let e = 0; e < a; e++) o.push(
|
|
4216
|
+
function Nn(e, t, n = "#", r = 2, i = 12) {
|
|
4217
|
+
let a = f(e, t), o = [];
|
|
4218
|
+
for (let e = 0; e < a; e++) o.push(Mn(n, f(r, i)));
|
|
3449
4219
|
return o.join(" ");
|
|
3450
4220
|
}
|
|
3451
4221
|
//#endregion
|
|
3452
4222
|
//#region src/functions/getStepPercent.ts
|
|
3453
|
-
function
|
|
4223
|
+
function Pn(e, t) {
|
|
3454
4224
|
let n = e == null ? 0 : e;
|
|
3455
4225
|
return t > n ? 100 / (t - n) : 0;
|
|
3456
4226
|
}
|
|
3457
4227
|
//#endregion
|
|
3458
4228
|
//#region src/functions/getStepValue.ts
|
|
3459
|
-
function
|
|
4229
|
+
function Fn(e, t) {
|
|
3460
4230
|
let n = e == null ? 0 : e;
|
|
3461
4231
|
return t > n ? (t - n) / 100 : 0;
|
|
3462
4232
|
}
|
|
3463
4233
|
//#endregion
|
|
3464
4234
|
//#region src/functions/goScroll.ts
|
|
3465
|
-
var
|
|
3466
|
-
function
|
|
4235
|
+
var In = 0;
|
|
4236
|
+
function Ln(e, t, n) {
|
|
4237
|
+
if (!s()) return;
|
|
3467
4238
|
let r = t == null ? void 0 : t.closest(e);
|
|
3468
4239
|
if (t && r && r.scrollHeight !== r.offsetHeight) {
|
|
3469
4240
|
let e = r.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
3470
4241
|
if (n) {
|
|
3471
4242
|
let a = n.getBoundingClientRect();
|
|
3472
4243
|
r.scrollTop = t.offsetTop - (a.top - e.top) - (a.height / 2 - i.height / 2), r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = t.offsetTop + t.offsetHeight - r.offsetHeight);
|
|
3473
|
-
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top -
|
|
4244
|
+
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - In : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + In);
|
|
3474
4245
|
}
|
|
3475
4246
|
}
|
|
3476
4247
|
//#endregion
|
|
3477
4248
|
//#region src/functions/goScrollSmooth.ts
|
|
3478
|
-
function
|
|
3479
|
-
if (!
|
|
4249
|
+
function Rn(e, t, n = 0) {
|
|
4250
|
+
if (!s()) return;
|
|
3480
4251
|
let r = (t == null ? void 0 : t.behavior) || "smooth";
|
|
3481
4252
|
if ("scrollIntoView" in e && !n) {
|
|
3482
4253
|
e.scrollIntoView({
|
|
@@ -3497,8 +4268,8 @@ function tn(e, t, n = 0) {
|
|
|
3497
4268
|
}
|
|
3498
4269
|
//#endregion
|
|
3499
4270
|
//#region src/functions/goScrollTo.ts
|
|
3500
|
-
function
|
|
3501
|
-
if (!
|
|
4271
|
+
function zn(e, t, n = "smooth") {
|
|
4272
|
+
if (!s() || !e || !t) return;
|
|
3502
4273
|
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
3503
4274
|
e.scrollBy({
|
|
3504
4275
|
top: i.top - r.top,
|
|
@@ -3508,95 +4279,93 @@ function nn(e, t, n = "smooth") {
|
|
|
3508
4279
|
}
|
|
3509
4280
|
//#endregion
|
|
3510
4281
|
//#region src/functions/isShare.ts
|
|
3511
|
-
function
|
|
3512
|
-
return
|
|
4282
|
+
function Bn() {
|
|
4283
|
+
return s() && typeof navigator < "u" && !!navigator.share;
|
|
3513
4284
|
}
|
|
3514
4285
|
//#endregion
|
|
3515
4286
|
//#region src/functions/handleShare.ts
|
|
3516
|
-
async function
|
|
3517
|
-
if (
|
|
4287
|
+
async function Vn(e) {
|
|
4288
|
+
if (Bn() && navigator.canShare && navigator.canShare(e)) try {
|
|
3518
4289
|
return await navigator.share(e), !0;
|
|
3519
4290
|
} catch (e) {
|
|
3520
|
-
|
|
4291
|
+
C.on({
|
|
4292
|
+
group: "share",
|
|
4293
|
+
code: "error",
|
|
4294
|
+
details: e
|
|
4295
|
+
});
|
|
3521
4296
|
}
|
|
3522
4297
|
return !1;
|
|
3523
4298
|
}
|
|
3524
4299
|
//#endregion
|
|
3525
4300
|
//#region src/functions/inArray.ts
|
|
3526
|
-
function
|
|
3527
|
-
return e.
|
|
4301
|
+
function Hn(e, t) {
|
|
4302
|
+
return e.includes(t);
|
|
3528
4303
|
}
|
|
3529
4304
|
//#endregion
|
|
3530
4305
|
//#region src/functions/initScrollbarOffset.ts
|
|
3531
|
-
async function
|
|
3532
|
-
if (
|
|
3533
|
-
let e = await
|
|
4306
|
+
async function Un() {
|
|
4307
|
+
if (s()) {
|
|
4308
|
+
let e = await Tt.get();
|
|
3534
4309
|
document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
|
|
3535
4310
|
}
|
|
3536
4311
|
}
|
|
3537
4312
|
//#endregion
|
|
3538
4313
|
//#region src/functions/intersectKey.ts
|
|
3539
|
-
function
|
|
3540
|
-
let
|
|
3541
|
-
return t(e) && t(n) &&
|
|
3542
|
-
t in n && (
|
|
3543
|
-
}),
|
|
4314
|
+
function Wn(e, n) {
|
|
4315
|
+
let i = {};
|
|
4316
|
+
return t(e) && t(n) && r(e, (e, t) => {
|
|
4317
|
+
t in n && (i[t] = e);
|
|
4318
|
+
}), i;
|
|
3544
4319
|
}
|
|
3545
4320
|
//#endregion
|
|
3546
|
-
//#region src/functions/isApiSuccess.ts
|
|
3547
|
-
var ln = (e) => {
|
|
3548
|
-
var t;
|
|
3549
|
-
return o(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && String(e.statusObject.status).match(/^2/) || !("status" in e) && !("success" in e) && !("statusObject" in e) && String(P.getStatus().getStatus()).match(/^2/)));
|
|
3550
|
-
};
|
|
3551
|
-
//#endregion
|
|
3552
4321
|
//#region src/functions/isDifferent.ts
|
|
3553
|
-
function
|
|
4322
|
+
function Gn(e, t) {
|
|
3554
4323
|
let n = Object.keys(e).length !== Object.keys(t).length;
|
|
3555
|
-
return n ||
|
|
4324
|
+
return n || r(e, (e, r) => {
|
|
3556
4325
|
e !== (t == null ? void 0 : t[r]) && (n = !0);
|
|
3557
4326
|
}), n;
|
|
3558
4327
|
}
|
|
3559
4328
|
//#endregion
|
|
3560
4329
|
//#region src/functions/isElementVisible.ts
|
|
3561
|
-
function
|
|
3562
|
-
if (!
|
|
3563
|
-
let t =
|
|
4330
|
+
function Kn(e) {
|
|
4331
|
+
if (!s()) return !1;
|
|
4332
|
+
let t = O(e);
|
|
3564
4333
|
if (!t || "isConnected" in t && t.isConnected === !1) return !1;
|
|
3565
4334
|
let n = window.getComputedStyle(t);
|
|
3566
4335
|
return n.display !== "none" && n.visibility !== "hidden" && n.opacity !== "0" && t.offsetWidth !== 0 && t.offsetHeight !== 0;
|
|
3567
4336
|
}
|
|
3568
4337
|
//#endregion
|
|
3569
4338
|
//#region src/functions/isInput.ts
|
|
3570
|
-
var
|
|
4339
|
+
var qn = (e) => {
|
|
3571
4340
|
if (e instanceof HTMLElement) {
|
|
3572
4341
|
let t = e.tagName.toLowerCase();
|
|
3573
4342
|
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
|
|
3574
4343
|
}
|
|
3575
4344
|
return !1;
|
|
3576
|
-
},
|
|
4345
|
+
}, Jn = (e, t) => e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "Enter" || e.keyCode === 13 || e.keyCode === 32 ? t === void 0 ? !qn(e.target) : !t : !1;
|
|
3577
4346
|
//#endregion
|
|
3578
4347
|
//#region src/functions/isFloat.ts
|
|
3579
|
-
function
|
|
4348
|
+
function Yn(e) {
|
|
3580
4349
|
switch (typeof e) {
|
|
3581
4350
|
case "number": return !0;
|
|
3582
|
-
case "string": return
|
|
4351
|
+
case "string": return /^-?\d+(\.\d+)?$/.test(e);
|
|
3583
4352
|
default: return !1;
|
|
3584
4353
|
}
|
|
3585
4354
|
}
|
|
3586
4355
|
//#endregion
|
|
3587
4356
|
//#region src/functions/isIntegerBetween.ts
|
|
3588
|
-
function
|
|
4357
|
+
function Xn(e, t) {
|
|
3589
4358
|
let n = Math.floor(t);
|
|
3590
4359
|
return e >= n && e < n + 1;
|
|
3591
4360
|
}
|
|
3592
4361
|
//#endregion
|
|
3593
4362
|
//#region src/functions/isSelectedByList.ts
|
|
3594
|
-
function
|
|
3595
|
-
return Array.isArray(e) ? e.every((e) =>
|
|
4363
|
+
function Zn(e, t) {
|
|
4364
|
+
return Array.isArray(e) ? e.every((e) => v(e, t)) : v(e, t);
|
|
3596
4365
|
}
|
|
3597
4366
|
//#endregion
|
|
3598
4367
|
//#region src/functions/removeCommonPrefix.ts
|
|
3599
|
-
function
|
|
4368
|
+
function Qn(e, t) {
|
|
3600
4369
|
if (e.startsWith(t)) return e.slice(t.length).trim();
|
|
3601
4370
|
let n = 0;
|
|
3602
4371
|
for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
|
|
@@ -3604,97 +4373,101 @@ function _n(e, t) {
|
|
|
3604
4373
|
}
|
|
3605
4374
|
//#endregion
|
|
3606
4375
|
//#region src/functions/replaceComponentName.ts
|
|
3607
|
-
var
|
|
4376
|
+
var $n = (e, t, n) => {
|
|
3608
4377
|
var r;
|
|
3609
4378
|
return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
|
|
3610
4379
|
};
|
|
3611
4380
|
//#endregion
|
|
3612
4381
|
//#region src/functions/uniqueArray.ts
|
|
3613
|
-
function
|
|
4382
|
+
function er(e) {
|
|
3614
4383
|
return [...new Set(e)];
|
|
3615
4384
|
}
|
|
3616
4385
|
//#endregion
|
|
3617
4386
|
//#region src/functions/replaceRecursive.ts
|
|
3618
|
-
function $(e, n,
|
|
3619
|
-
let a =
|
|
3620
|
-
return t(e) && t(n) &&
|
|
3621
|
-
let o = e == null ? void 0 : e[
|
|
3622
|
-
t(o) && t(n) ?
|
|
4387
|
+
function $(e, n, i = !0) {
|
|
4388
|
+
let a = Z(e);
|
|
4389
|
+
return t(e) && t(n) && r(n, (n, r) => {
|
|
4390
|
+
let o = e == null ? void 0 : e[r];
|
|
4391
|
+
t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(er([...o, ...n])) : a[r] = $(Array.isArray(o) ? { ...o } : o, n, i) : a[r] = t(n) ? Z(n) : n;
|
|
3623
4392
|
}), a;
|
|
3624
4393
|
}
|
|
3625
4394
|
//#endregion
|
|
3626
4395
|
//#region src/functions/replaceTemplate.ts
|
|
3627
|
-
function
|
|
4396
|
+
function tr(e, t) {
|
|
3628
4397
|
let n = e;
|
|
3629
|
-
return
|
|
3630
|
-
n = n.replace(
|
|
4398
|
+
return r(t, (e, t) => {
|
|
4399
|
+
n = n.replace(Nt(`[${t}]`), b(e));
|
|
3631
4400
|
}), n;
|
|
3632
4401
|
}
|
|
3633
4402
|
//#endregion
|
|
3634
4403
|
//#region src/functions/secondToTime.ts
|
|
3635
|
-
function
|
|
3636
|
-
let
|
|
3637
|
-
|
|
4404
|
+
function nr(e, t) {
|
|
4405
|
+
let n = _(e);
|
|
4406
|
+
if (n > 0) {
|
|
4407
|
+
let e = String(Math.floor(n / 60)).padStart(2, "0"), r = String(n % 60).padStart(2, "0");
|
|
4408
|
+
return t && Number(e) >= 60 ? `${String(Math.floor(Number(e) / 60)).padStart(2, "0")}:${String(Number(e) % 60).padStart(2, "0")}:${r}` : `${e}:${r}`;
|
|
4409
|
+
}
|
|
4410
|
+
return "00:00";
|
|
3638
4411
|
}
|
|
3639
4412
|
//#endregion
|
|
3640
4413
|
//#region src/functions/setValues.ts
|
|
3641
|
-
function
|
|
4414
|
+
function rr(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, notEmpty: o = !1 }) {
|
|
3642
4415
|
if (n) {
|
|
3643
|
-
if (
|
|
4416
|
+
if (i(e)) {
|
|
3644
4417
|
let n = e.indexOf(t), i = [...e];
|
|
3645
|
-
return n === -1 ? (!r || e.length < r) && i.push(t) : (!
|
|
4418
|
+
return n === -1 ? (!r || e.length < r) && i.push(t) : (!o || i.length > 1) && i.splice(n, 1), i;
|
|
3646
4419
|
}
|
|
3647
4420
|
return e === t ? [] : e ? [e, t] : [t];
|
|
3648
4421
|
}
|
|
3649
|
-
return
|
|
4422
|
+
return a || e !== t ? t : e;
|
|
3650
4423
|
}
|
|
3651
4424
|
//#endregion
|
|
3652
4425
|
//#region src/functions/splice.ts
|
|
3653
|
-
function
|
|
4426
|
+
function ir(e, n, i) {
|
|
3654
4427
|
if (t(e) && t(n)) {
|
|
3655
|
-
if (
|
|
4428
|
+
if (i) {
|
|
3656
4429
|
let a = {}, o = !1;
|
|
3657
|
-
return
|
|
3658
|
-
!o && (
|
|
4430
|
+
return r(e, (e, r) => {
|
|
4431
|
+
!o && (i === r || i === e) ? (o = !0, a = $(a, n)) : o ? a = $(a, { [r]: e }) : a[r] = t(e) ? Z(e) : e;
|
|
3659
4432
|
}), o ? a : $(e, n);
|
|
3660
4433
|
}
|
|
3661
4434
|
if (t(n)) return $(e, n);
|
|
3662
4435
|
}
|
|
3663
|
-
return
|
|
4436
|
+
return Z(e);
|
|
3664
4437
|
}
|
|
3665
4438
|
//#endregion
|
|
3666
4439
|
//#region src/functions/toCamelCaseFirst.ts
|
|
3667
|
-
function
|
|
3668
|
-
return
|
|
4440
|
+
function ar(e) {
|
|
4441
|
+
return et(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
|
|
3669
4442
|
}
|
|
3670
4443
|
//#endregion
|
|
3671
4444
|
//#region src/functions/toKebabCase.ts
|
|
3672
|
-
function
|
|
4445
|
+
function or(e) {
|
|
3673
4446
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/^[A-Z]/, (e) => e.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[A-Z]/g, (e) => e.toLowerCase());
|
|
3674
4447
|
}
|
|
3675
4448
|
//#endregion
|
|
3676
4449
|
//#region src/functions/toNumberByMax.ts
|
|
3677
|
-
function
|
|
3678
|
-
let i =
|
|
3679
|
-
return t && a < i ? `${
|
|
4450
|
+
function sr(e, t, n, r) {
|
|
4451
|
+
let i = _(e), a = _(t);
|
|
4452
|
+
return t && a < i ? `${cr(a, n, r)}+` : cr(i, n, r);
|
|
3680
4453
|
}
|
|
3681
|
-
var
|
|
4454
|
+
var cr = (e, t, n) => t ? new z(n).number(e) : e;
|
|
3682
4455
|
//#endregion
|
|
3683
4456
|
//#region src/functions/toPercent.ts
|
|
3684
|
-
function
|
|
3685
|
-
return 1 / e * t;
|
|
4457
|
+
function lr(e, t) {
|
|
4458
|
+
return e === 0 ? t : 1 / e * t;
|
|
3686
4459
|
}
|
|
3687
4460
|
//#endregion
|
|
3688
4461
|
//#region src/functions/toPercentBy100.ts
|
|
3689
|
-
function
|
|
3690
|
-
return
|
|
4462
|
+
function ur(e, t) {
|
|
4463
|
+
return lr(e, t) * 100;
|
|
3691
4464
|
}
|
|
3692
4465
|
//#endregion
|
|
3693
4466
|
//#region src/functions/uint8ArrayToBase64.ts
|
|
3694
|
-
function
|
|
4467
|
+
function dr(e) {
|
|
3695
4468
|
let t = "";
|
|
3696
4469
|
for (let n of e) t += String.fromCharCode(n);
|
|
3697
|
-
if (
|
|
4470
|
+
if (s()) return window.btoa(t);
|
|
3698
4471
|
if (globalThis && globalThis.Buffer) {
|
|
3699
4472
|
var n;
|
|
3700
4473
|
return (n = globalThis) == null ? void 0 : n.Buffer.from(e).toString("base64");
|
|
@@ -3703,13 +4476,13 @@ function An(e) {
|
|
|
3703
4476
|
}
|
|
3704
4477
|
//#endregion
|
|
3705
4478
|
//#region src/functions/writeClipboardData.ts
|
|
3706
|
-
async function
|
|
3707
|
-
if (
|
|
4479
|
+
async function fr(e) {
|
|
4480
|
+
if (s()) try {
|
|
3708
4481
|
await navigator.clipboard.writeText(e);
|
|
3709
4482
|
} catch (n) {
|
|
3710
4483
|
var t;
|
|
3711
|
-
(t = document) == null || t.execCommand(e);
|
|
4484
|
+
(t = document) == null || t.execCommand("copy", !1, e);
|
|
3712
4485
|
}
|
|
3713
4486
|
}
|
|
3714
4487
|
//#endregion
|
|
3715
|
-
export {
|
|
4488
|
+
export { N as Api, j as ApiCache, je as ApiDataReturn, Me as ApiDefault, Ne as ApiHeaders, Fe as ApiHydration, Be as ApiInstance, M as ApiMethodItem, Ie as ApiPreparation, ze as ApiResponse, ke as ApiStatus, Ve as BroadcastMessage, We as Cache, Ue as CacheItem, Ge as CacheStatic, Ze as Cookie, Je as CookieBlock, qe as CookieBlockInstance, L as CookieStorage, E as DataStorage, $e as Datetime, C as ErrorCenter, de as ErrorCenterHandler, fe as ErrorCenterInstance, we as EventItem, tt as Formatters, U as FormattersType, nt as GEO_FLAG_ICON_NAME, D as Geo, rt as GeoFlag, be as GeoInstance, z as GeoIntl, it as GeoPhone, at as Global, st as Hash, ot as HashInstance, ut as Icons, A as Loading, Ee as LoadingInstance, Ct as Meta, K as MetaManager, xt as MetaOg, vt as MetaOpenGraphAge, gt as MetaOpenGraphAvailability, _t as MetaOpenGraphCondition, yt as MetaOpenGraphGender, J as MetaOpenGraphTag, ht as MetaOpenGraphType, mt as MetaRobots, wt as MetaStatic, q as MetaTag, St as MetaTwitter, bt as MetaTwitterCard, Y as MetaTwitterTag, Tt as ScrollbarWidth, Rt as SearchList, jt as SearchListData, Mt as SearchListItem, It as SearchListMatcher, Lt as SearchListOptions, T as ServerStorage, Bt as StorageCallback, Gt as TRANSLATE_GLOBAL_PREFIX, Kt as TRANSLATE_TIME_OUT, Yt as Translate, qt as TranslateFile, Jt as TranslateInstance, At as addTagHighlightMatch, P as anyToString, Ut as applyTemplate, Xt as arrFill, tn as blobToBase64, nn as capitalize, Z as copyObject, rn as copyObjectLite, W as createElement, an as domQuerySelector, on as domQuerySelectorAll, G as encodeAttribute, se as encodeLiteAttribute, un as ensureMaxSize, X as escapeExp, dn as eventStopPropagation, b as executeFunction, Le as executePromise, r as forEach, fn as frame, pn as getArrayHighlightMatch, mn as getAttributes, hn as getClipboardData, Qe as getColumn, gn as getCurrentDate, _n as getCurrentTime, O as getElement, yn as getElementId, sn as getElementImage, dt as getElementItem, Se as getElementOrWindow, me as getElementSafeScript, Pt as getExactSearchExp, Nt as getExp, he as getHydrationData, H as getItemByPath, xn as getKey, Sn as getLengthOfAllArray, Cn as getMaxLengthAllArray, wn as getMinLengthAllArray, Dn as getMouseClient, Tn as getMouseClientX, En as getMouseClientY, On as getObjectByKeys, kn as getObjectNoUndefined, An as getObjectOrNone, jn as getOnlyText, Nn as getRandomText, o as getRequestString, Ft as getSearchExp, Et as getSeparatingSearchExp, Pn as getStepPercent, Fn as getStepValue, Ln as goScroll, Rn as goScrollSmooth, zn as goScrollTo, Vn as handleShare, Hn as inArray, bn as initGetElementId, Un as initScrollbarOffset, Wn as intersectKey, Wt as isApiSuccess, i as isArray, Gn as isDifferent, ce as isDomData, s as isDomRuntime, Kn as isElementVisible, Jn as isEnter, l as isFilled, Yn as isFloat, y as isFunction, Ce as isInDom, qn as isInput, Xn as isIntegerBetween, c as isNull, h as isNumber, t as isObject, n as isObjectNotArray, u as isOnLine, v as isSelected, Zn as isSelectedByList, Bn as isShare, d as isString, xe as isWindow, f as random, Qn as removeCommonPrefix, $n as replaceComponentName, $ as replaceRecursive, tr as replaceTemplate, ln as resizeImageByMax, nr as secondToTime, ft as setElementItem, rr as setValues, p as sleep, ir as splice, Mn as strFill, F as strSplit, k as toArray, et as toCamelCase, ar as toCamelCaseFirst, R as toDate, or as toKebabCase, _ as toNumber, sr as toNumberByMax, lr as toPercent, ur as toPercentBy100, a as toString, I as transformation, dr as uint8ArrayToBase64, er as uniqueArray, fr as writeClipboardData };
|