@dxtmisha/functional-basic 0.13.0 → 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.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 i(e, n, r) {
13
+ function r(e, n, r) {
19
14
  if (t(e)) {
20
- let t = [];
21
- return e instanceof Map || Array.isArray(e) ? e.forEach((r, i) => t.push(n(r, i, e))) : Object.entries(e).forEach(([r, i]) => t.push(n(i, r, e))), r ? t : t.filter((e) => e !== void 0);
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 a(e, t = "=", n = "&") {
28
- return i(e, (e, n) => `${n}${t}${encodeURIComponent(String(e).trim())}`).sort().join(n);
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/isArray.ts
32
- function o(e) {
33
- return Array.isArray(e);
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 s(e) {
55
+ function c(e) {
38
56
  return e == null;
39
57
  }
40
58
  //#endregion
41
59
  //#region src/functions/isFilled.ts
42
- function c(e, t) {
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) => !s(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 l() {
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 u(e) {
87
+ function d(e) {
74
88
  return typeof e == "string";
75
89
  }
76
90
  //#endregion
77
91
  //#region src/functions/random.ts
78
- function d(e, t) {
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 JSON.parse(JSON.stringify(e));
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 !0;
101
- case "string": return !!e.match(/^-?[0-9]+(\.[0-9]+)?$/);
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
- function g(e) {
108
- if (typeof e == "number") return e;
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(/[^\d., ]+/gi, "");
111
- return t = t.match(/( [0-9]{3}[ ,.]|[0-9] [0-9])/gi) ? t.replace(/ /gi, "").replace(/,/gi, ".") : t.match(/,[0-9]{3}[,.]/gi) ? t.replace(/,/gi, "") : t.match(/[.][0-9]{3}[,.]/gi) ? t.replace(/[.]/gi, "").replace(/,/gi, ".") : t.replace(/,/gi, "."), parseFloat(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 _(e, t) {
116
- return s(e) ? !1 : Array.isArray(t) ? t.includes(e) : h(e) && h(t) ? g(e) === g(t) : e === t;
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
+ "<": "&lt;",
129
+ ">": "&gt;",
130
+ "&": "&amp;"
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 v(e) {
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 y(e) {
126
- return v(e) ? e() : e;
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 b() {
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.123.0/helpers/typeof.js
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.123.0/helpers/toPrimitive.js
145
- function ee(e, t) {
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.123.0/helpers/toPropertyKey.js
157
- function te(e) {
158
- var t = ee(e, "string");
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.123.0/helpers/defineProperty.js
182
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
163
183
  function S(e, t, n) {
164
- return (t = te(t)) in e ? Object.defineProperty(e, 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 ne = class {
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
- if (m()) {
195
- var t;
196
- let n = (t = this.get(e.group)) == null ? this.get(void 0) : t;
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
- }, re = class {
205
- constructor(e, t = new ne()) {
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
- return t ? {
232
- ...t,
233
- ...e
234
- } : e;
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
- }, ie = [
260
+ }, pe = [
237
261
  {
238
262
  group: "api",
239
- code: "unknown",
240
- label: "Unknown Error",
241
- message: "An unexpected error occurred. Please try again later."
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: "timeout",
246
- label: "Request Timeout",
247
- message: "The request took too long to complete. Please check your connection."
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: "offline",
252
- label: "No Internet Connection",
253
- message: "Your device is currently offline. Please check your network settings."
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: "storage",
334
+ group: "clipboard",
275
335
  code: "error",
276
- label: "Storage Error",
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: "intl",
299
- code: "datetime",
300
- label: "Intl Datetime Error",
301
- message: "An unexpected error occurred. Please try again later."
382
+ group: "share",
383
+ code: "error",
384
+ label: "Share Error",
385
+ message: "An unexpected error occurred during sharing."
302
386
  },
303
387
  {
304
- group: "intl",
305
- code: "number",
306
- label: "Intl Number Error",
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.item.has(e, t);
416
+ return this.getItem().has(e, t);
312
417
  }
313
418
  static get(e, t) {
314
- return this.item.get(e, t);
315
- }
316
- static getItem() {
317
- return this.item;
419
+ return this.getItem().get(e, t);
318
420
  }
319
421
  static add(e) {
320
- return this.item.add(e), this;
422
+ this.getItem().add(e);
321
423
  }
322
424
  static addList(e) {
323
- return this.item.addList(e), this;
425
+ this.getItem().addList(e);
324
426
  }
325
427
  static addHandler(e, t) {
326
- return this.item.addHandler(e, t), this;
428
+ this.getItem().addHandler(e, t);
327
429
  }
328
430
  static addHandlerList(e) {
329
- return this.item.addHandlerList(e), this;
431
+ this.getItem().addHandlerList(e);
330
432
  }
331
433
  static on(e) {
332
- return this.item.on(e), this;
434
+ this.getItem().on(e);
435
+ }
436
+ };
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, "&quot;")}" 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;
333
524
  }
334
525
  };
335
- S(C, "item", new re(ie));
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 ae = {}, oe = "ui-storage", w = class {
529
+ var _e = "ui-storage", ve = () => T.get("__ui:data-storage__", () => ({})), E = class {
339
530
  static setPrefix(e) {
340
- oe = e;
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 ae) return ae[r];
346
- this.make(), ae[r] = this;
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 !== null && this.value !== void 0 && this.isCache(t)) return 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 = y(e), this.age = (/* @__PURE__ */ new Date()).getTime(), this.value === void 0) this.remove();
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 ae = {}, oe = "ui-storage", w = class {
368
559
  return this.make(), this;
369
560
  }
370
561
  isCache(e) {
371
- return s(e) || this.age && this.age + e * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
562
+ return c(e) || this.age && this.age + e * 1e3 >= Date.now();
372
563
  }
373
564
  getMethod() {
374
- if (m() && !b()) {
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 `${oe}__${this.name}`;
572
+ return `${_e}__${this.name}`;
382
573
  }
383
574
  getValue() {
384
- var e;
385
- let t = (e = this.getMethod()) == null ? void 0 : e.getItem(this.getIndex());
386
- if (t) try {
387
- return JSON.parse(t);
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,118 +588,182 @@ var ae = {}, oe = "ui-storage", w = 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
- }, T, se = "geo-code", E = class {
401
- static get() {
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
- static getCountry() {
598
+ getCountry() {
405
599
  return this.item.country;
406
600
  }
407
- static getLanguage() {
601
+ getLanguage() {
408
602
  return this.language;
409
603
  }
410
- static getStandard() {
411
- return this.item.standard;
604
+ getStandard() {
605
+ return this.getItem().standard;
412
606
  }
413
- static getFirstDay() {
607
+ getFirstDay() {
414
608
  return this.item.firstDay;
415
609
  }
416
- static getLocation() {
610
+ getLocation() {
417
611
  return this.location;
418
612
  }
419
- static getItem() {
420
- return r(this.item, { language: this.language });
613
+ getItem() {
614
+ return {
615
+ ...this.item,
616
+ language: this.language,
617
+ standard: `${this.language}-${this.item.country}`
618
+ };
421
619
  }
422
- static getList() {
620
+ getList() {
423
621
  return e;
424
622
  }
425
- static getByCode(e) {
623
+ getByCode(e) {
426
624
  var t;
427
625
  let n;
428
- return e && (e.match(/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/) && (n = this.getByCodeFull(e)), !n && e.match(/[A-Z]{2}/) && (n = this.getByCountry(this.toCountry(e))), !n && e.match(/[a-z]{2}/) && (n = this.getByLanguage(this.toLanguage(e)))), this.toFull(p((t = n) == null ? this.getList()[0] : t));
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
- static getByCodeFull(e) {
431
- return this.getList().find((t) => _(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
628
+ getByCodeFull(e) {
629
+ return this.getList().find((t) => v(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
432
630
  }
433
- static getByCountry(e) {
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.find((t) => t === e));
634
+ return t.country === e || (t == null || (n = t.countryAlternative) == null ? void 0 : n.includes(e));
437
635
  });
438
636
  }
439
- static getByLanguage(e) {
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.find((t) => t === e));
640
+ return t.language === e || (t == null || (n = t.languageAlternative) == null ? void 0 : n.includes(e));
443
641
  });
444
642
  }
445
- static getTimezone() {
643
+ getTimezone() {
446
644
  return this.timezone;
447
645
  }
448
- static getTimezoneFormat() {
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
- static find(e) {
650
+ find(e) {
453
651
  return this.getByCode(e);
454
652
  }
455
- static toStandard(e) {
653
+ toStandard(e) {
456
654
  return `${e.language}-${e.country}`;
457
655
  }
458
- static set(e, t) {
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
- static setTimezone(e) {
659
+ setTimezone(e) {
462
660
  this.timezone = e;
463
661
  }
464
- static findLocation() {
662
+ findLocation() {
465
663
  var e;
466
- return m() && (this.storage.get() || ((e = document.querySelector("html")) == null ? void 0 : e.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
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
- static findLanguage(e) {
469
- return e && e.match(/[a-z]{2}/) ? this.toLanguage(e) : this.item.language;
666
+ findLanguage(e) {
667
+ return e && /[a-z]{2}/.test(e) ? this.toLanguage(e) : this.item.language;
470
668
  }
471
- static toCountry(e) {
669
+ toCountry(e) {
472
670
  return e.replace(/[^A-Z]+/g, "");
473
671
  }
474
- static toLanguage(e) {
672
+ toLanguage(e) {
475
673
  return e.replace(/[^a-z]+/g, "");
476
674
  }
477
- static toFull(e) {
478
- return r(e, {
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
- T = E, S(E, "storage", new w(se)), S(E, "location", void 0), S(E, "item", void 0), S(E, "language", void 0), S(E, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), T.location = T.findLocation(), T.language = T.findLanguage(T.location), T.item = T.getByCode(T.location);
485
741
  //#endregion
486
742
  //#region src/functions/isWindow.ts
487
- function ce(e) {
488
- return m() && e === window;
743
+ function xe(e) {
744
+ return s() && e === window;
489
745
  }
490
746
  //#endregion
491
747
  //#region src/functions/getElement.ts
492
- function D(e) {
493
- if (m()) {
494
- if (ce(e)) return document.body;
495
- if (u(e)) {
496
- var t;
497
- return (t = document.querySelector(e)) == null ? void 0 : t;
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 O(e) {
505
- return ce(e) ? e : D(e);
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 le(e) {
764
+ function Ce(e) {
510
765
  var t;
511
- return !!((t = D(e)) != null && t.closest("html"));
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
@@ -517,14 +772,14 @@ function k(e) {
517
772
  }
518
773
  //#endregion
519
774
  //#region src/classes/EventItem.ts
520
- var A = class {
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 (le(this.elementControl)) {
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 = O(e), this.elementControl = D(e), this.type = k(n);
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,11 +788,11 @@ var A = class {
533
788
  return this.element;
534
789
  }
535
790
  setElement(e) {
536
- let t = O(e);
537
- return this.elementControlEdit || (this.elementControl = D(e)), this.element = t, this.reset(), this;
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 = D(e), this.elementControlEdit = !s(this.elementControl), this.elementControlEdit || (this.elementControl = D(this.element)), this;
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
798
  return this.type = k(e), this.reset(), this;
@@ -558,7 +813,7 @@ var A = class {
558
813
  }), this;
559
814
  }
560
815
  start() {
561
- return this.activity || (this.activity = !0, this.activityItems = [], this.type.forEach((e) => {
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 A = 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 A = class {
609
864
  }
610
865
  return !1;
611
866
  }
612
- }, ue = "ui-loading", de = class {
613
- constructor(e = ue) {
614
- S(this, "value", 0), S(this, "event", void 0), S(this, "registrationList", []), this.eventName = e, m() && (this.event = new A(window, this.eventName));
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 A = class {
626
881
  this.is() && (this.value--, this.dispatch());
627
882
  }
628
883
  registrationEvent(e, t) {
629
- if (m()) {
630
- let n = new A(window, this.eventName, e).setElementControl(t).start();
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 A = class {
642
897
  var e;
643
898
  (e = this.event) == null || e.dispatch({ loading: this.is() });
644
899
  }
645
- }, j = class {
900
+ }, A = class {
646
901
  static is() {
647
- return this.item.is();
902
+ return this.getItem().is();
648
903
  }
649
904
  static get() {
650
- return this.item.get();
905
+ return this.getItem().get();
651
906
  }
652
907
  static getItem() {
653
- return this.item;
908
+ return T.get("__ui:loading-instance__", () => new Ee());
654
909
  }
655
910
  static show() {
656
- this.item.show();
911
+ this.getItem().show();
657
912
  }
658
913
  static hide() {
659
- this.item.hide();
914
+ this.getItem().hide();
660
915
  }
661
916
  static registrationEvent(e, t) {
662
- this.item.registrationEvent(e, t);
917
+ this.getItem().registrationEvent(e, t);
663
918
  }
664
919
  static unregistrationEvent(e, t) {
665
- this.item.unregistrationEvent(e, t);
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
- get(e, t = "application/json;charset=UTF-8") {
676
- if (e !== null) {
677
- let n = r(this.headers, e);
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
- set(e) {
682
- return n(e) && (this.headers = e), this;
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
- }, M = /* @__PURE__ */ function(e) {
685
- return e.get = "GET", e.post = "POST", e.put = "PUT", e.delete = "DELETE", e;
686
- }({}), pe = class {
687
- constructor() {
688
- S(this, "value", void 0);
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
- is() {
691
- return !!this.value;
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
- get() {
694
- return this.value;
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
- request(e) {
697
- let t = this.get();
698
- if (t) {
699
- if (e instanceof FormData) this.addByFormData(e, t);
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
- set(e) {
705
- this.value = e;
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
- addByFormData(e, t) {
708
- for (let n in t) e.has(n) || e.set(n, t[n]);
983
+ static async getItemOrListener(e) {
984
+ let t = this.getListener ? await this.getListener(e) : this.getList()[e];
985
+ if (this.isAge(t)) return t;
986
+ }
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
+ };
709
996
  }
710
- }, me = class {
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 he(e) {
769
- let t = y(e);
770
- return t instanceof Promise ? await t : t;
1208
+ async function Le(e, ...t) {
1209
+ let n = b(e, ...t);
1210
+ return n instanceof Promise ? await n : n;
771
1211
  }
772
1212
  //#endregion
773
1213
  //#region src/classes/ApiResponse.ts
774
- var ge = "d-response-loading", _e = class {
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
  }
@@ -788,6 +1228,7 @@ var ge = "d-response-loading", _e = class {
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 ge = "d-response-loading", _e = class {
798
1239
  }
799
1240
  }
800
1241
  isDisable(e) {
801
- return !!y(e == null ? void 0 : e.disable);
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 && t.match(e.path));
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 ge = "d-response-loading", _e = 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" || c(t) && c(r) && n(t) && n(r) && !(t instanceof FormData) && !(r instanceof FormData) && Object.values(t).length === Object.values(r).length && Object.entries(r).reduce((e, [n, r]) => e && (r === (t == null ? void 0 : t[n]) || r === "*any"), !0);
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
- he(v(e.response) ? e.response(t) : e.response).then((t) => {
819
- e != null && e.lag ? (j.show(), setTimeout(() => {
820
- this.stopResponseLoading(), n(t), j.hide();
821
- }, d(0, 2e3))) : (this.stopResponseLoading(), n(t));
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), m() && document.body.classList.add(ge);
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, m() && document.body.classList.remove(ge);
831
- }, 1200);
832
- }
833
- }, ve = class {
834
- constructor() {
835
- S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
1270
+ s() && (this.loading = setTimeout(() => {
1271
+ this.loading = void 0, document.body.classList.remove(Re);
1272
+ }, 2400));
836
1273
  }
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;
846
- }
847
- setEnd(e) {
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
- }, ye = 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 = fe, requestDefaultClass: r = pe, statusClass: i = me, responseClass: a = _e, preparationClass: o = ve, loadingClass: s = j.getItem(), errorCenterClass: c = C.getItem() } = t;
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 > "u" || location.hostname === "localhost";
1281
+ return s() && typeof location < "u" && location.hostname === "localhost";
869
1282
  }
870
1283
  getStatus() {
871
1284
  return this.status;
@@ -873,20 +1286,26 @@ var ge = "d-response-loading", _e = 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
- return `${t ? this.url : ""}${e}`.replace("{locale}", E.getLocation()).replace("{country}", E.getCountry()).replace("{language}", E.getLanguage());
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 && c(e)) return u(e) ? e : JSON.stringify(e);
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" ? a(e) : e;
886
- if (c(r)) return `${n}${r}`;
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 ge = "d-response-loading", _e = class {
906
1325
  return this.timeout = e, this;
907
1326
  }
908
1327
  async request(e) {
909
- return u(e) ? await this.fetch({ path: e }) : await this.fetch(e);
1328
+ return d(e) ? await this.fetch({ path: e }) : await this.fetch(e);
910
1329
  }
911
1330
  get(e) {
912
- return this.request(r(e, { method: M.get }));
1331
+ return this.request({
1332
+ ...e,
1333
+ method: M.get
1334
+ });
913
1335
  }
914
1336
  post(e) {
915
- return this.request(r(e, { method: M.post }));
1337
+ return this.request({
1338
+ ...e,
1339
+ method: M.post
1340
+ });
916
1341
  }
917
1342
  put(e) {
918
- return this.request(r(e, { method: M.put }));
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(r(e, { method: M.delete }));
1355
+ return this.request({
1356
+ ...e,
1357
+ method: M.delete
1358
+ });
922
1359
  }
923
1360
  getRetryDelay(e, t) {
924
- return d(t, t + e * t);
1361
+ return f(t, t + e * t);
925
1362
  }
926
1363
  async fetch(e, t = 0) {
927
- let { toData: n = !0, hideError: r = !1, hideLoading: i = !1, retry: a = 0, retryDelay: o = 64, queryReturn: s = void 0, globalPreparation: c = !0, globalEnd: l = !0 } = e, u = await this.response.emulator(e);
928
- if (u) return u;
929
- let d = new me(), p;
930
- i || this.loading.show();
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(c, e);
933
- let { query: n, timeoutId: i } = await this.makeQuery(e);
934
- i && clearTimeout(i);
935
- let u = await this.preparation.makeEnd(l, n, e);
936
- if (d.setStatus(n.status, n.statusText), this.status.setStatus(n.status, n.statusText), !r && n.status >= 400 && this.makeErrorQuery(n), u != null && u.reset || t < a) return await f(this.getRetryDelay(t, o)), this.loading.hide(), await this.fetch(e, t + 1);
937
- p = await this.readData(n, s, u);
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 r || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), i || this.loading.hide(), e;
1378
+ throw n || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), r || this.loading.hide(), e;
940
1379
  }
941
- return i || this.loading.hide(), d.setLastResponse(p), this.status.setLastResponse(p), this.makeStatus(this.makeData(p, n), d);
942
- }
943
- async readData(e, t, n) {
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: i = "", pathFull: a = void 0, method: o = M.get, headers: s = {}, type: c = "application/json;charset=UTF-8", init: l = {} } = e, u = a == null ? this.getUrl(i, n) : a, d = `${u}${this.getBodyForGet(t, u, o)}`, f = this.headers.get(s, c), p = r(l, {
949
- method: o,
950
- body: this.getBody(t, o)
951
- });
952
- f && (p.headers = f);
953
- let m = this.initController(e, p);
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(d, p),
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 ge = "d-response-loading", _e = class {
978
1410
  });
979
1411
  break;
980
1412
  case "AbortError": break;
981
- default: l() ? this.errorCenter.on({
1413
+ default: u() ? this.errorCenter.on({
982
1414
  group: t,
983
1415
  code: "unknown",
984
1416
  details: e
@@ -991,6 +1423,20 @@ var ge = "d-response-loading", _e = 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 ge = "d-response-loading", _e = 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 ge = "d-response-loading", _e = class {
1029
1475
  }, n);
1030
1476
  }
1031
1477
  }
1032
- }, N = class e {
1478
+ }, N = class {
1033
1479
  static isLocalhost() {
1034
- return this.item.isLocalhost();
1480
+ return this.getItem().isLocalhost();
1035
1481
  }
1036
1482
  static getItem() {
1037
- return this.item;
1483
+ return T.get("__ui:api-instance__", () => new Be());
1038
1484
  }
1039
1485
  static getStatus() {
1040
- return this.item.getStatus();
1486
+ return this.getItem().getStatus();
1041
1487
  }
1042
1488
  static getResponse() {
1043
- return this.item.getResponse();
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.item.getUrl(e, t);
1498
+ return this.getItem().getUrl(e, t);
1047
1499
  }
1048
1500
  static getBody(e = {}, t = M.get) {
1049
- return this.item.getBody(e, t);
1501
+ return this.getItem().getBody(e, t);
1050
1502
  }
1051
1503
  static getBodyForGet(e, t = "", n = M.get) {
1052
- return this.item.getBodyForGet(e, t, n);
1504
+ return this.getItem().getBodyForGet(e, t, n);
1053
1505
  }
1054
- static setHeaders(t) {
1055
- return this.item.setHeaders(t), e;
1506
+ static setHeaders(e) {
1507
+ this.getItem().setHeaders(e);
1056
1508
  }
1057
- static setRequestDefault(t) {
1058
- return this.item.setRequestDefault(t), e;
1509
+ static setRequestDefault(e) {
1510
+ this.getItem().setRequestDefault(e);
1059
1511
  }
1060
- static setUrl(t) {
1061
- return this.item.setUrl(t), e;
1512
+ static setUrl(e) {
1513
+ this.getItem().setUrl(e);
1062
1514
  }
1063
- static setPreparation(t) {
1064
- return this.item.setPreparation(t), e;
1515
+ static setPreparation(e) {
1516
+ this.getItem().setPreparation(e);
1065
1517
  }
1066
- static setEnd(t) {
1067
- return this.item.setEnd(t), e;
1518
+ static setEnd(e) {
1519
+ this.getItem().setEnd(e);
1068
1520
  }
1069
- static setTimeout(t) {
1070
- return this.item.setTimeout(t), e;
1521
+ static setTimeout(e) {
1522
+ this.getItem().setTimeout(e);
1071
1523
  }
1072
1524
  static setConfig(e) {
1073
- return 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)), this;
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.item.request(e);
1528
+ return this.getItem().request(e);
1077
1529
  }
1078
1530
  static get(e) {
1079
- return this.item.get(e);
1531
+ return this.getItem().get(e);
1080
1532
  }
1081
1533
  static post(e) {
1082
- return this.item.post(e);
1534
+ return this.getItem().post(e);
1083
1535
  }
1084
1536
  static put(e) {
1085
- return this.item.put(e);
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.item.delete(e);
1543
+ return this.getItem().delete(e);
1089
1544
  }
1090
- };
1091
- S(N, "item", new ye());
1092
- //#endregion
1093
- //#region src/classes/BroadcastMessage.ts
1094
- var be = 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 be = 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, m()) try {
1103
- this.channel = new BroadcastChannel(`${xe()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
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 be = class {
1122
1573
  setCallbackError(e) {
1123
1574
  return this.callbackError = e, this;
1124
1575
  }
1125
- }, xe = () => new w("__broadcast-name").get(() => `name_${d(1e6, 9999999)}`), Se = class {
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 be = 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
- }, Ce = class {
1602
+ }, We = class {
1148
1603
  constructor() {
1149
1604
  S(this, "cache", {});
1150
1605
  }
@@ -1155,17 +1610,44 @@ var be = 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 Se(t)), this.cache[e];
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
- }, we, Te = class {
1161
1619
  static get(e, t, n) {
1162
- return this.cache.get(e, t, n);
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
- we = Te, S(Te, "cache", void 0), we.cache = new Ce();
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 Ee(e, t = !1) {
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 Ee(e, t = !1) {
1178
1660
  if (/^[{[]/.exec(r)) try {
1179
1661
  return JSON.parse(r);
1180
1662
  } catch (e) {
1181
- console.error("transformation: JSON error", e);
1663
+ C.on({
1664
+ group: "transformation",
1665
+ code: "error",
1666
+ details: e
1667
+ });
1182
1668
  }
1183
- else if (/^[0-9]+\.[0-9.]+$/.exec(r)) return parseFloat(r);
1184
- else if (/^[0-9]+$/.exec(r)) return parseInt(r, 10);
1185
- else if (t && m() && typeof ((n = window) == null ? void 0 : n[r]) == "function") return window[r];
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/CookieBlock.ts
1192
- var De = "cookie-block", Oe = class {
1193
- static get() {
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
- static set(e) {
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(Oe, "storage", new w(De));
1750
+ S(L, "getListener", void 0), S(L, "setListener", void 0);
1202
1751
  //#endregion
1203
1752
  //#region src/classes/Cookie.ts
1204
- var ke, Ae = {}, je = class {
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
- if (S(this, "value", void 0), S(this, "options", {}), this.name = e, e in Me) return Me[e];
1207
- this.value = Ae == null ? void 0 : Ae[e], Me[e] = this;
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 = y(e), Object.assign(this.options, t), this.update();
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
- if (m() && !b() && !Oe.get()) {
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) && (Ae[t] = Ee(n));
1238
- }
1774
+ L.set(this.name, this.value, this.options);
1239
1775
  }
1240
1776
  };
1241
- ke = je, m() && !b() && ke.updateData();
1242
- var Me = {};
1243
1777
  //#endregion
1244
1778
  //#region src/functions/toDate.ts
1245
- function P(e) {
1246
- var t, n, r, i, a, o, c, l;
1779
+ function R(e) {
1780
+ var t, n, r, i, a, o, s, l;
1247
1781
  if (e instanceof Date) return e;
1248
- if (s(e)) return /* @__PURE__ */ new Date();
1782
+ if (c(e)) return /* @__PURE__ */ new Date();
1249
1783
  if (typeof e == "number") return new Date(e);
1250
- let u = e, d = E.getTimezoneFormat().trim();
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 = (c = (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") : c) == 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;
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 Ne(e, t) {
1258
- return i(e, (e) => e == null ? void 0 : e[t], !0);
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 F = class e {
1263
- static getInstance(t = E.getLocation()) {
1264
- return new e(t);
1796
+ var z = class e {
1797
+ static isItem(e = D.getLocation()) {
1798
+ return this.getLocation(e) in V;
1265
1799
  }
1266
- constructor(e = E.getLocation(), t = C.getItem()) {
1267
- S(this, "geo", void 0), this.errorCenter = t, this.geo = E.find(e);
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
+ }
1805
+ static getInstance(t = D.getLocation()) {
1806
+ let n = this.getLocation(t);
1807
+ return n in V ? V[n] : new e(t);
1808
+ }
1809
+ constructor(e = D.getLocation(), t = C.getItem()) {
1810
+ S(this, "geo", void 0), this.errorCenter = t, this.geo = D.find(e);
1268
1811
  let n = this.getLocation();
1269
- if (n in I) return I[n];
1270
- I[n] = this;
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;
@@ -1298,7 +1841,7 @@ var F = class e {
1298
1841
  type: "language",
1299
1842
  style: t
1300
1843
  };
1301
- return this.display(E.getByCode(e).language, n);
1844
+ return this.display(D.getByCode(e).language, n);
1302
1845
  }
1303
1846
  countryName(e, t) {
1304
1847
  let n = {
@@ -1309,26 +1852,26 @@ var F = 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
- s = `${t}${n ? ` ${n}` : ""} ${e}`;
1858
+ l = `${s}${c ? ` ${c}` : ""} ${e}`;
1316
1859
  break;
1317
1860
  case "lf":
1318
- s = `${e} ${t}`;
1861
+ l = `${e} ${s}`;
1319
1862
  break;
1320
1863
  case "lsf":
1321
- s = `${e}${n ? ` ${n}` : ""} ${t}`;
1864
+ l = `${e}${c ? ` ${c}` : ""} ${s}`;
1322
1865
  break;
1323
1866
  default:
1324
- s = `${t} ${e}`;
1867
+ l = `${s} ${e}`;
1325
1868
  break;
1326
1869
  }
1327
- return r ? s.replace(/ (.)[^ ]+/gi, " $1.") : s;
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, g(e))) || e.toString();
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 F = 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 ? Ne(t.formatToParts(g(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
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 F = class e {
1365
1908
  return this.number(r, n);
1366
1909
  }
1367
1910
  sizeFile(e, t = "byte") {
1368
- let n = g(e);
1369
- if (n > 1024 && u(t)) switch (t) {
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 F = class e {
1382
1925
  });
1383
1926
  }
1384
1927
  percentBy100(e, t) {
1385
- return this.percent(g(e) / 100, t);
1928
+ return this.percent(_(e) / 100, t);
1386
1929
  }
1387
1930
  plural(e, t, n, r) {
1388
1931
  var i;
1389
- let a = g(e), o = t.split("|");
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 F = 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 = P(e), a = typeof n == "string", o = this.dateOptions(t, a ? n : "short");
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 = P(e), i = n || /* @__PURE__ */ new Date(), a = {
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 = P(e), c = n || /* @__PURE__ */ new Date(), l = new Date(c), u = new Date(c);
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 F = 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(g(e)), t);
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 F = 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(P(e));
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 F = 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 F = 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(P(e));
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 F = 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 F = class e {
1591
2134
  "second"
1592
2135
  ].indexOf(e) !== -1 && (n.second = "2-digit")), n;
1593
2136
  }
1594
- }, I = {}, Pe = class e {
1595
- constructor(e, t = "date", n = E.getLocation()) {
1596
- S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date = P(e);
2137
+ }, B = {}, V = {}, $e = class e {
2138
+ constructor(e, t = "date", n = D.getLocation()) {
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 new F(this.code);
2145
+ return z.getInstance(this.code);
1600
2146
  }
1601
2147
  getDate() {
1602
2148
  return this.date;
@@ -1645,7 +2191,7 @@ var F = class e {
1645
2191
  return this.date.getSeconds();
1646
2192
  }
1647
2193
  getMaxDay() {
1648
- return this.getMonth() > 0 ? this.cloneDayLast().getDay() : 0;
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 F = 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 = P(e), this.update(), this;
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 F = class e {
1841
2387
  return this.cloneClass().moveDayPrevious();
1842
2388
  }
1843
2389
  toTimeZoneHourFormat(e) {
1844
- m() && this.getIntl().number(Math.trunc(e), {
1845
- signDisplay: "always",
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 F = class e {
1854
2396
  }
1855
2397
  };
1856
2398
  //#endregion
1857
- //#region src/functions/anyToString.ts
1858
- function L(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 Fe(e, t, n) {
1865
- let r = L(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 R(e, n) {
2400
+ function H(e, n) {
1873
2401
  var r;
1874
- if (!c(n)) return;
1875
- let i = Fe(n, ".", 2), a = i[0];
1876
- return a && e != null && e[a] && t(e[a]) && i != null && i[1] ? R(e[a], i[1]) : (r = c(a) && (e == null ? void 0 : e[a])) == null ? void 0 : r;
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 z(e) {
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 B = /* @__PURE__ */ function(e) {
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
- }({}), Ie = class {
2415
+ }({}), tt = class {
1888
2416
  constructor(e, t) {
1889
2417
  this.options = e, this.list = t;
1890
2418
  }
@@ -1907,7 +2435,7 @@ var B = /* @__PURE__ */ function(e) {
1907
2435
  return this.list = e, this;
1908
2436
  }
1909
2437
  to() {
1910
- let e = i(this.getList(), (e) => ({
2438
+ let e = r(this.getList(), (e) => ({
1911
2439
  ...e,
1912
2440
  ...this.getFormatData(e)
1913
2441
  }));
@@ -1915,51 +2443,51 @@ var B = /* @__PURE__ */ function(e) {
1915
2443
  }
1916
2444
  getFormatData(e) {
1917
2445
  let t = {};
1918
- return i(this.options, (n, r) => {
1919
- let i = `${z(r)}Format`, a = R(e, r);
1920
- n != null && n.transformation ? c(a) ? t[i] = n.transformation(a, e, n.options) : t[i] = "" : t[i] = this.transformation(a, e, n.type, n.options);
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 (c(e) || n === B.name) switch (n) {
1925
- case B.currency: return this.formatCurrency(e, t, r);
1926
- case B.date: return this.formatDate(e, r);
1927
- case B.name: return this.formatName(t, r);
1928
- case B.number: return this.formatNumber(e, r);
1929
- case B.plural: return this.formatPlural(e, r);
1930
- case B.unit: return this.formatUnit(e, r);
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 ? R(t, n.currencyPropName) : t == null ? void 0 : t.currency;
1938
- return F.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
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 F.getInstance().date(e, t == null ? void 0 : t.type, t == null ? void 0 : t.options, t == null ? void 0 : t.hour24);
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 = R(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = R(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = R(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
1946
- return a && o ? F.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
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 F.getInstance().number(e, t == null ? void 0 : t.options);
2477
+ return z.getInstance().number(e, t == null ? void 0 : t.options);
1950
2478
  }
1951
2479
  formatPlural(e, t) {
1952
- return t && t.words ? F.getInstance().plural(e, t == null ? void 0 : t.words, t == null ? void 0 : t.options, t == null ? void 0 : t.optionsNumber) : e;
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 ? F.getInstance().unit(e, t.unit) : e;
2483
+ return t && t.unit ? z.getInstance().unit(e, t.unit) : e;
1956
2484
  }
1957
- }, Le = "f", Re = class e {
1958
- constructor(e = E.getLocation()) {
2485
+ }, nt = "f", rt = class e {
2486
+ constructor(e = D.getLocation()) {
1959
2487
  this.code = e;
1960
2488
  }
1961
2489
  get(t = this.code) {
1962
- let n = E.find(t);
2490
+ let n = D.find(t);
1963
2491
  if (n) {
1964
2492
  var r;
1965
2493
  let t = this.getCountry(n);
@@ -1978,10 +2506,10 @@ var B = /* @__PURE__ */ function(e) {
1978
2506
  return (t = this.get(e)) == null ? void 0 : t.icon;
1979
2507
  }
1980
2508
  getList(e) {
1981
- return i(this.getCodes(e), (e) => this.get(e));
2509
+ return r(this.getCodes(e), (e) => this.get(e));
1982
2510
  }
1983
2511
  getNational(t) {
1984
- return i(this.getList(t), (t) => {
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 B = /* @__PURE__ */ function(e) {
1995
2523
  return this.code = e, this;
1996
2524
  }
1997
2525
  getLocation() {
1998
- return new F(this.code);
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 B = /* @__PURE__ */ function(e) {
2007
2535
  return this.getLocation().countryName(e.country);
2008
2536
  }
2009
2537
  };
2010
- S(Re, "flags", {
2538
+ S(rt, "flags", {
2011
2539
  AD: "f-ad",
2012
2540
  AE: "f-ae",
2013
2541
  AF: "f-af",
@@ -2252,7 +2780,7 @@ S(Re, "flags", {
2252
2780
  });
2253
2781
  //#endregion
2254
2782
  //#region src/classes/GeoPhone.ts
2255
- var V = class {
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 V = class {
2286
2814
  return this.map || this.makeMap(), (e = this.map) == null ? {} : e;
2287
2815
  }
2288
2816
  static toMask(e, t) {
2289
- if (c(e) && Array.isArray(t) && t.length > 0) {
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,9 +2836,9 @@ var V = 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 = i(E.getList(), (e) => {
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]+/, "")) || void 0,
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
2843
  mask: k(e.phoneMask),
2316
2844
  value: e.country
@@ -2350,72 +2878,117 @@ var V = class {
2350
2878
  return e.replace(/\*/, this.getWithinSymbol(t));
2351
2879
  }
2352
2880
  };
2353
- S(V, "list", void 0), S(V, "map", void 0);
2881
+ S(it, "list", void 0), S(it, "map", void 0);
2354
2882
  //#endregion
2355
2883
  //#region src/classes/Global.ts
2356
- var H, ze = class {
2884
+ var at = class {
2885
+ static getItem() {
2886
+ return T.get("__ui:global-instance__", () => ({}));
2887
+ }
2357
2888
  static get(e) {
2358
- return H && (H == null ? void 0 : H[e]);
2889
+ var t;
2890
+ return (t = this.getItem()) == null ? void 0 : t[e];
2359
2891
  }
2360
2892
  static add(e) {
2361
- H === void 0 && (H = r(e));
2893
+ let t = this.getItem();
2894
+ Object.keys(t).length > 0 || Object.assign(t, e);
2362
2895
  }
2363
- }, U, W = class {
2364
- static get(e, t) {
2365
- return !(e in this.hash) && t && this.set(e, t), this.hash[e];
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
- static set(e, t) {
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 = y(t);
2370
- r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.hash[e] = r, this.update());
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
- static addWatch(e, t) {
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
- static removeWatch(e, t) {
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
- static reload() {
2384
- if (!this.block) {
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
- static getLocation() {
2924
+ getLocation() {
2390
2925
  let e = {};
2391
- return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] = Ee(t[2]), "")), e;
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
- static update() {
2394
- this.block = !0, history.replaceState(null, "", `#${a(this.hash, "=", ";")}`), requestAnimationFrame(() => {
2395
- this.block = !1;
2396
- });
2932
+ getHash() {
2933
+ return this.hash || this.init(), this.hash;
2397
2934
  }
2398
- static makeWatch(e) {
2399
- i(this.watch, (t, n) => {
2935
+ init() {
2936
+ return this.initData(), s() && addEventListener("hashchange", () => this.reload()), this;
2937
+ }
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
- U = W, S(W, "hash", {}), S(W, "watch", {}), S(W, "block", !1), m() && (U.reload(), addEventListener("hashchange", () => U.reload()));
2406
- //#endregion
2407
- //#region src/classes/Icons.ts
2408
- var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
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 === Ue && n > 0 ? (await this.wait(), this.get(e, t, n - He)) : s : v(s) ? await s() : await 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 i(this.icons, (e, t) => t.replace(/^@/, ""));
2991
+ return r(this.icons, (e, t) => t.replace(/^@/, ""));
2419
2992
  }
2420
2993
  static getUrlGlobal() {
2421
2994
  return `${N.isLocalhost(), ""}${this.url}`;
@@ -2424,13 +2997,13 @@ var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
2424
2997
  this.icons[this.getName(e)] = t;
2425
2998
  }
2426
2999
  static addLoad(e) {
2427
- this.icons[this.getName(e)] = Ue;
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
- i(e, (e, t) => this.add(t, e));
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(), He));
3018
+ return new Promise((e) => setTimeout(() => e(), ct));
2446
3019
  }
2447
3020
  };
2448
- Be = G, S(G, "icons", {}), S(G, "url", "/icons/"), m() && (Ve in window || (window[Ve] = {}), Be.icons = window[Ve]);
3021
+ S(ut, "icons", {}), S(ut, "url", "/icons/");
2449
3022
  //#endregion
2450
3023
  //#region src/functions/getElementItem.ts
2451
- function We(e, t, n) {
3024
+ function dt(e, t, n) {
2452
3025
  var r, i;
2453
- return (r = (i = D(e)) == null ? void 0 : i[t]) == null ? n : r;
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 Ge(e, n, r) {
2458
- let a = D(e);
3030
+ function ft(e, n, i) {
3031
+ let a = O(e);
2459
3032
  if (a) {
2460
- let e = We(a, n);
2461
- if (t(e) && t(r)) i(r, (t, n) => {
2462
- e[n] = y(t);
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 = y(r);
2466
- !(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] = y(r);
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 K(e, t = "div", r, a) {
2474
- if (!m()) return;
3046
+ function W(e, t = "div", i, a) {
3047
+ if (!s()) return;
2475
3048
  let o = document.createElement(t);
2476
- return typeof r == "function" ? r(o) : n(r) && i(r, (e, t) => {
2477
- Ge(o, t, e);
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
- function Ke(e) {
2483
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").trim();
3055
+ var pt = {
3056
+ "&": "&amp;",
3057
+ "<": "&lt;",
3058
+ ">": "&gt;",
3059
+ "\"": "&quot;",
3060
+ "'": "&#39;"
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 q = class {
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 i(this.listMeta, (e) => this.toHtmlString(e)).join("");
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 i(e, (e, t) => this.set(t, String(e))), this;
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 (!m()) return;
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
- let n = this.findMetaElement(e), r = (t = this.items[e]) == null ? "" : t;
2524
- if (n) n.content = r;
2525
- else if (m()) {
2526
- let t = { content: r };
2527
- this.isProperty ? t.property = e : t.name = e, K(document.head, "meta", t);
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 = Ke((t = this.items[e]) == null ? "" : t);
2534
- return n ? `<meta ${this.getAttributeName()}="${e}" content="${n}">` : "";
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
- }, J = /* @__PURE__ */ function(e) {
2543
- return e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
2544
- }({}), qe = /* @__PURE__ */ function(e) {
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
- }({}), Y = /* @__PURE__ */ function(e) {
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
- }({}), Je = /* @__PURE__ */ function(e) {
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
- }({}), Ye = /* @__PURE__ */ function(e) {
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
- }({}), Xe = /* @__PURE__ */ function(e) {
3137
+ }({}), _t = /* @__PURE__ */ function(e) {
2553
3138
  return e.new = "new", e.used = "used", e.refurbished = "refurbished", e;
2554
- }({}), Ze = /* @__PURE__ */ function(e) {
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
- }({}), Qe = /* @__PURE__ */ function(e) {
3141
+ }({}), yt = /* @__PURE__ */ function(e) {
2557
3142
  return e.female = "female", e.male = "male", e.unisex = "unisex", e;
2558
- }({}), X = /* @__PURE__ */ function(e) {
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
- }({}), $e = /* @__PURE__ */ function(e) {
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
- }({}), et = class extends q {
3147
+ }({}), xt = class extends K {
2563
3148
  constructor() {
2564
- super(Object.values(Y), !0);
3149
+ super(Object.values(J), !0);
2565
3150
  }
2566
3151
  getTitle() {
2567
- return this.get(Y.title);
3152
+ return this.get(J.title);
2568
3153
  }
2569
3154
  getType() {
2570
- return this.get(Y.type);
3155
+ return this.get(J.type);
2571
3156
  }
2572
3157
  getUrl() {
2573
- return this.get(Y.url);
3158
+ return this.get(J.url);
2574
3159
  }
2575
3160
  getImage() {
2576
- return this.get(Y.image);
3161
+ return this.get(J.image);
2577
3162
  }
2578
3163
  getDescription() {
2579
- return this.get(Y.description);
3164
+ return this.get(J.description);
2580
3165
  }
2581
3166
  getLocale() {
2582
- return this.get(Y.locale);
3167
+ return this.get(J.locale);
2583
3168
  }
2584
3169
  getSiteName() {
2585
- return this.get(Y.siteName);
3170
+ return this.get(J.siteName);
2586
3171
  }
2587
3172
  setTitle(e) {
2588
- return this.set(Y.title, e);
3173
+ return this.set(J.title, e);
2589
3174
  }
2590
3175
  setType(e) {
2591
- return this.set(Y.type, e);
3176
+ return this.set(J.type, e);
2592
3177
  }
2593
3178
  setUrl(e) {
2594
- return this.set(Y.url, e);
3179
+ return this.set(J.url, e);
2595
3180
  }
2596
3181
  setImage(e) {
2597
- return this.set(Y.image, e);
3182
+ return this.set(J.image, e);
2598
3183
  }
2599
3184
  setDescription(e) {
2600
- return this.set(Y.description, e);
3185
+ return this.set(J.description, e);
2601
3186
  }
2602
3187
  setLocale(e) {
2603
- return this.set(Y.locale, e);
3188
+ return this.set(J.locale, e);
2604
3189
  }
2605
3190
  setSiteName(e) {
2606
- return this.set(Y.siteName, e);
3191
+ return this.set(J.siteName, e);
2607
3192
  }
2608
- }, tt = class extends q {
3193
+ }, St = class extends K {
2609
3194
  constructor() {
2610
- super(Object.values(X));
3195
+ super(Object.values(Y));
2611
3196
  }
2612
3197
  getCard() {
2613
- return this.get(X.card);
3198
+ return this.get(Y.card);
2614
3199
  }
2615
3200
  getSite() {
2616
- return this.get(X.site);
3201
+ return this.get(Y.site);
2617
3202
  }
2618
3203
  getCreator() {
2619
- return this.get(X.creator);
3204
+ return this.get(Y.creator);
2620
3205
  }
2621
3206
  getUrl() {
2622
- return this.get(X.url);
3207
+ return this.get(Y.url);
2623
3208
  }
2624
3209
  getTitle() {
2625
- return this.get(X.title);
3210
+ return this.get(Y.title);
2626
3211
  }
2627
3212
  getDescription() {
2628
- return this.get(X.description);
3213
+ return this.get(Y.description);
2629
3214
  }
2630
3215
  getImage() {
2631
- return this.get(X.image);
3216
+ return this.get(Y.image);
2632
3217
  }
2633
3218
  setCard(e) {
2634
- return this.set(X.card, e), this;
3219
+ return this.set(Y.card, e), this;
2635
3220
  }
2636
3221
  setSite(e) {
2637
- return this.set(X.site, e), this;
3222
+ return this.set(Y.site, e), this;
2638
3223
  }
2639
3224
  setCreator(e) {
2640
- return this.set(X.creator, e), this;
3225
+ return this.set(Y.creator, e), this;
2641
3226
  }
2642
3227
  setUrl(e) {
2643
- return this.set(X.url, e), this;
3228
+ return this.set(Y.url, e), this;
2644
3229
  }
2645
3230
  setTitle(e) {
2646
- return this.set(X.title, e), this;
3231
+ return this.set(Y.title, e), this;
2647
3232
  }
2648
3233
  setDescription(e) {
2649
- return this.set(X.description, e), this;
3234
+ return this.set(Y.description, e), this;
2650
3235
  }
2651
3236
  setImage(e) {
2652
- return this.set(X.image, e), this;
3237
+ return this.set(Y.image, e), this;
2653
3238
  }
2654
- }, nt = class extends q {
3239
+ }, Ct = class extends K {
2655
3240
  constructor() {
2656
- super(Object.values(J)), S(this, "suffix", void 0), S(this, "og", void 0), S(this, "twitter", void 0), this.og = new et(), this.twitter = new tt();
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
- return m() ? document.title.replace(this.getSuffix(), "").trim() : "";
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(J.keywords);
3254
+ return this.get(q.keywords);
2669
3255
  }
2670
3256
  getDescription() {
2671
- return this.get(J.description);
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(J.canonical);
3263
+ return this.get(q.canonical);
2678
3264
  }
2679
3265
  getRobots() {
2680
- return this.get(J.robots);
3266
+ return this.get(q.robots);
2681
3267
  }
2682
3268
  getAuthor() {
2683
- return this.get(J.author);
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
- if (m()) {
2693
- let t = c(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
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(J.keywords, k(e).join(", ")), this;
3282
+ return this.set(q.keywords, k(e).join(", ")), this;
2700
3283
  }
2701
3284
  setDescription(e) {
2702
- return this.set(J.description, e), this;
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(J.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
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(J.robots, e), this;
3294
+ return this.set(q.robots, e), this;
2712
3295
  }
2713
3296
  setAuthor(e) {
2714
- return this.set(J.author, e), this;
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 c(this.suffix) ? ` - ${this.suffix}` : "";
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();
2730
3326
  }
2731
- }, Z = class {
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;
3353
+ }
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
- let t = (e = this.storage.get()) == null ? -1 : e;
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.storage.set(e), e;
3395
+ return this.getStorage().set(e), e;
2742
3396
  }
2743
3397
  return t;
2744
3398
  }
2745
3399
  static getStorage() {
2746
- return this.storage;
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 K(document.body, "div", (e) => {
2753
- e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%", K(e, "div", (e) => {
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(Z, "storage", new w("scrollbar", !0)), S(Z, "calculate", !1);
3422
+ S(Tt, "calculate", !1);
2769
3423
  //#endregion
2770
3424
  //#region src/functions/escapeExp.ts
2771
- function Q(e) {
2772
- return e.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
3425
+ function X(e) {
3426
+ return String(e).replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
2773
3427
  }
2774
3428
  //#endregion
2775
3429
  //#region src/functions/getSeparatingSearchExp.ts
2776
- function rt(e) {
2777
- let t = i(e.split(" "), (e) => Q(e)).join("|");
2778
- return RegExp(`(${t})`, "ig");
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
- function it(e, t, n = "sys-highlight-match") {
2783
- return t ? String(e).replace(rt(t), `<span class="${n}">$1</span>`) : e;
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 at = class {
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 = R(e, r);
2827
- n[i] = c(a) && t ? this.addTag(a) : L(a);
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 it(L(e), this.item.get(), this.options.getClassName());
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 = R(t, e);
2847
- c(r) && (n += ` ${L(r)}`);
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
- }, ot = class {
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 st(e, t = "ig", n = ":value") {
2883
- let r = Q(e);
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 ct(e) {
2889
- return st(e, "i", "(:value)");
3550
+ function Pt(e) {
3551
+ return Nt(e, "i", "(:value)");
2890
3552
  }
2891
3553
  //#endregion
2892
3554
  //#region src/functions/getSearchExp.ts
2893
- function lt(e) {
2894
- let t = "";
2895
- return e.split(" ").forEach((e) => {
2896
- let n = Q(e).trim();
2897
- c(n) && (t += `(?=.*?${n})`);
2898
- }), RegExp(`^${t}`, "ig");
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 ut = class {
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() ? ct(this.item.get()) : lt(this.item.get()) : this.matcher = void 0;
3582
+ this.item.is() ? this.matcher = this.options.getFindExactMatch() ? Pt(this.item.get()) : Ft(this.item.get()) : this.matcher = void 0;
2920
3583
  }
2921
- }, dt = class {
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
- }, ft = class {
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 dt(r), this.item = new ot(n, this.options), this.matcher = new ut(this.item, this.options), this.data = new at(e, t, this.item, this.options);
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,9 +3651,45 @@ 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 ? i(e, this.callbackToNone) : [];
3654
+ return e ? r(e, this.callbackToNone) : [];
3655
+ }
3656
+ }, zt = () => T.get("__ui:storage-callback__", () => ({})), Bt = class e {
3657
+ static getInstance(t, n = "main") {
3658
+ return new e(t, n);
3659
+ }
3660
+ constructor(e, t = "main") {
3661
+ S(this, "callbacks", []), S(this, "loading", !1), this.name = e, this.group = t;
3662
+ let n = `${t}:${e}`, r = zt();
3663
+ if (n in r) return r[n];
3664
+ r[n] = this;
3665
+ }
3666
+ isLoading() {
3667
+ return this.loading;
3668
+ }
3669
+ getName() {
3670
+ return this.name;
3671
+ }
3672
+ getLoading() {
3673
+ return this.loading;
3674
+ }
3675
+ addCallback(e, t) {
3676
+ return this.callbacks.push({
3677
+ callback: e,
3678
+ isOnce: t
3679
+ }), this;
3680
+ }
3681
+ removeCallback(e) {
3682
+ return this.callbacks = this.callbacks.filter((t) => t.callback !== e), this;
3683
+ }
3684
+ preparation() {
3685
+ return this.loading = !0, this;
2992
3686
  }
2993
- }, pt = [
3687
+ async run(e) {
3688
+ this.loading = !1;
3689
+ for (let { callback: t, isOnce: n } of this.callbacks) await Le(t, e), n && this.removeCallback(t);
3690
+ return this;
3691
+ }
3692
+ }, Vt = [
2994
3693
  "d",
2995
3694
  "e",
2996
3695
  "f",
@@ -3010,29 +3709,43 @@ var ut = class {
3010
3709
  "t",
3011
3710
  "u",
3012
3711
  "v"
3013
- ], mt = (e, t = {}) => {
3712
+ ], Ht = RegExp(`%(${Vt.join("|")})`, "g"), Ut = (e, t = {}) => {
3014
3713
  let r = String(e);
3015
- if (e.match(/%[a-z]/)) {
3016
- let e = 0;
3017
- i(t, (t) => {
3018
- r = r.replace(RegExp(`%${pt[e++]}`, "g"), String(t));
3019
- });
3020
- }
3021
- return n(t) && i(t, (e, t) => {
3022
- r = r.replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${t}(?:\\]|\\})`, "g"), (t, n) => String(e).replace(/(?:\[|\{)content(?:\]|\})/g, n)).replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})`, "g"), String(e));
3023
- }), r;
3024
- }, ht = "global", gt = 160, _t = class {
3025
- constructor(e, t = () => E.getLanguage(), n = () => E.getLocation()) {
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 {
3738
+ constructor(e, t = () => D.getLanguage(), n = () => D.getLocation()) {
3026
3739
  S(this, "files", {}), S(this, "data", {}), this.language = t, this.location = n, e && this.add(e);
3027
3740
  }
3028
3741
  isFile() {
3029
3742
  return Object.keys(this.files).length > 0 && this.getIndex() !== void 0;
3030
3743
  }
3031
3744
  getLocation() {
3032
- return y(this.location);
3745
+ return b(this.location);
3033
3746
  }
3034
3747
  getLanguage() {
3035
- return y(this.language);
3748
+ return b(this.language);
3036
3749
  }
3037
3750
  async getList() {
3038
3751
  let e = this.getIndex();
@@ -3042,8 +3755,8 @@ var ut = class {
3042
3755
  }
3043
3756
  }
3044
3757
  add(e) {
3045
- i(e, (e, t) => {
3046
- v(e) && (this.files[t] = e);
3758
+ r(e, (e, t) => {
3759
+ y(e) && (this.files[t] = e);
3047
3760
  });
3048
3761
  }
3049
3762
  getIndex() {
@@ -3051,19 +3764,19 @@ var ut = class {
3051
3764
  if (e in this.files) return e;
3052
3765
  let t = this.getLanguage();
3053
3766
  if (t in this.files) return t;
3054
- if ("global" in this.files) return ht;
3767
+ if ("global" in this.files) return Gt;
3055
3768
  }
3056
3769
  getByData(e) {
3057
3770
  if (e in this.data) return this.data[e];
3058
3771
  }
3059
3772
  async getByFile(e) {
3060
3773
  if (e in this.files) {
3061
- let t = await y(this.files[e]);
3774
+ let t = await b(this.files[e]);
3062
3775
  return t && (this.data[e] = t), t;
3063
3776
  }
3064
3777
  }
3065
- }, vt = class {
3066
- constructor(e = "/api/translate", t = "list", n = new _t()) {
3778
+ }, Jt = class {
3779
+ constructor(e = "/api/translate", t = "list", n = new qt()) {
3067
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;
3068
3781
  }
3069
3782
  async get(e, t) {
@@ -3105,19 +3818,19 @@ var ut = class {
3105
3818
  });
3106
3819
  }
3107
3820
  addSync(e) {
3108
- i(e, (e, t) => {
3109
- u(e) && c(e) && (this.data[this.getName(t)] = e);
3821
+ r(e, (e, t) => {
3822
+ d(e) && l(e) && (this.data[this.getName(t)] = e);
3110
3823
  });
3111
3824
  }
3112
3825
  async addNormalOrSync(e) {
3113
- if (c(e)) if (N.isLocalhost()) this.addSync(e);
3826
+ if (l(e)) if (N.isLocalhost()) this.addSync(e);
3114
3827
  else {
3115
3828
  let t = Object.keys(e);
3116
3829
  t.length > 0 && await this.add(t);
3117
3830
  }
3118
3831
  }
3119
3832
  addSyncByLocation(e) {
3120
- i(e, (e, t) => i(e, (e, n) => {
3833
+ r(e, (e, t) => r(e, (e, n) => {
3121
3834
  let r = `${t}-${n}`;
3122
3835
  r in this.data || (this.data[r] = e);
3123
3836
  }));
@@ -3152,7 +3865,7 @@ var ut = class {
3152
3865
  return `${this.files.getLanguage()}-${e}`;
3153
3866
  }
3154
3867
  getNameByGlobal(e) {
3155
- return `${ht}-${e}`;
3868
+ return `${Gt}-${e}`;
3156
3869
  }
3157
3870
  getNamesNone(e) {
3158
3871
  let t = [];
@@ -3166,12 +3879,17 @@ var ut = class {
3166
3879
  path: this.url,
3167
3880
  request: { [this.propsName]: this.cache },
3168
3881
  toData: !0,
3882
+ timeout: 12e3,
3169
3883
  global: !0
3170
3884
  });
3171
- return e == null ? {} : e;
3885
+ return Wt(e) || C.on({
3886
+ group: "translate",
3887
+ code: "error",
3888
+ details: e
3889
+ }), e == null ? {} : e;
3172
3890
  }
3173
3891
  replacement(e, t) {
3174
- return t ? mt(e, t) : e;
3892
+ return t ? Ut(e, t) : e;
3175
3893
  }
3176
3894
  async make() {
3177
3895
  let e;
@@ -3183,132 +3901,188 @@ var ut = class {
3183
3901
  this.data[this.getName(t)] = (n = e == null ? void 0 : e[t]) == null ? "" : n;
3184
3902
  }), this.cache = [];
3185
3903
  }
3186
- }, yt = class {
3904
+ }, Yt = class {
3187
3905
  static async get(e, t) {
3188
- return this.item.get(e, t);
3906
+ return this.getItem().get(e, t);
3189
3907
  }
3190
3908
  static getItem() {
3191
- return this.item;
3909
+ return this.item || (this.item = new Jt()), this.item;
3192
3910
  }
3193
3911
  static getSync(e, t = !1, n) {
3194
- return this.item.getSync(e, t, n);
3912
+ return this.getItem().getSync(e, t, n);
3195
3913
  }
3196
3914
  static getList(e) {
3197
- return this.item.getList(e);
3915
+ return this.getItem().getList(e);
3198
3916
  }
3199
3917
  static getListSync(e, t = !1) {
3200
- return this.item.getListSync(e, t);
3918
+ return this.getItem().getListSync(e, t);
3201
3919
  }
3202
3920
  static async add(e) {
3203
- await this.item.add(e);
3921
+ await this.getItem().add(e);
3204
3922
  }
3205
3923
  static addSync(e) {
3206
- this.item.addSync(e);
3924
+ this.getItem().addSync(e);
3207
3925
  }
3208
3926
  static async addNormalOrSync(e) {
3209
- await this.item.addNormalOrSync(e);
3927
+ await this.getItem().addNormalOrSync(e);
3210
3928
  }
3211
3929
  static addSyncByLocation(e) {
3212
- this.item.addSyncByLocation(e);
3930
+ this.getItem().addSyncByLocation(e);
3213
3931
  }
3214
3932
  static addSyncByFile(e) {
3215
- this.item.addSyncByFile(e);
3933
+ this.getItem().addSyncByFile(e);
3216
3934
  }
3217
3935
  static setUrl(e) {
3218
- return this.item.setUrl(e), this;
3936
+ this.getItem().setUrl(e);
3219
3937
  }
3220
3938
  static setPropsName(e) {
3221
- return this.item.setPropsName(e), this;
3939
+ this.getItem().setPropsName(e);
3222
3940
  }
3223
3941
  static setReadApi(e) {
3224
- return this.item.setReadApi(e), this;
3942
+ this.getItem().setReadApi(e);
3225
3943
  }
3226
3944
  static setConfig(e) {
3227
- return e.url && this.item.setUrl(e.url), e.propsName && this.item.setPropsName(e.propsName), typeof e.readApi == "boolean" && this.item.setReadApi(e.readApi), this;
3945
+ e.url && this.getItem().setUrl(e.url), e.propsName && this.getItem().setPropsName(e.propsName), typeof e.readApi == "boolean" && this.getItem().setReadApi(e.readApi);
3228
3946
  }
3229
3947
  };
3230
- S(yt, "item", new vt());
3948
+ S(Yt, "item", void 0);
3231
3949
  //#endregion
3232
3950
  //#region src/functions/arrFill.ts
3233
- function bt(e, t) {
3951
+ function Xt(e, t) {
3234
3952
  return Array(t).fill(e);
3235
3953
  }
3236
3954
  //#endregion
3237
3955
  //#region src/functions/blobToBase64.ts
3238
- function xt(e) {
3239
- return new Promise((t, n) => {
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") {
3240
3961
  let r = new FileReader();
3241
- r.onloadend = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
3242
- });
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}`;
3243
3977
  }
3244
3978
  //#endregion
3245
3979
  //#region src/functions/capitalize.ts
3246
- function St(e) {
3247
- return c(e) ? e.charAt(0).toUpperCase() + e.slice(1) : e;
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);
3248
3993
  }
3249
3994
  //#endregion
3250
3995
  //#region src/functions/domQuerySelector.ts
3251
- function Ct(e) {
3252
- if (m()) {
3996
+ function an(e) {
3997
+ if (s()) {
3253
3998
  var t;
3254
3999
  return (t = document.querySelector(e)) == null ? void 0 : t;
3255
4000
  }
3256
4001
  }
3257
4002
  //#endregion
3258
4003
  //#region src/functions/domQuerySelectorAll.ts
3259
- function wt(e) {
3260
- if (m()) return document.querySelectorAll(e);
4004
+ function on(e) {
4005
+ if (s()) return document.querySelectorAll(e);
3261
4006
  }
3262
4007
  //#endregion
3263
4008
  //#region src/functions/getElementImage.ts
3264
- function Tt(e) {
3265
- return u(e) ? K(void 0, "img", { src: e }) : e;
4009
+ function sn(e) {
4010
+ return d(e) ? W(void 0, "img", { src: e }) : e;
3266
4011
  }
3267
4012
  //#endregion
3268
4013
  //#region src/functions/resizeImageByMax.ts
3269
- function Et(e, t = "auto") {
4014
+ function cn(e, t = "auto") {
3270
4015
  switch (t) {
3271
4016
  case "auto": return e.naturalWidth >= e.naturalHeight;
3272
4017
  case "width": return !0;
3273
4018
  case "height": return !1;
3274
4019
  }
3275
4020
  }
3276
- function Dt(e, t, n = "auto", r) {
3277
- let i = Tt(e);
3278
- 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"))) {
3279
4024
  var a;
3280
- let e = Et(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
4025
+ let e = cn(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
3281
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);
3282
4027
  }
3283
4028
  }
3284
4029
  //#endregion
3285
4030
  //#region src/functions/ensureMaxSize.ts
3286
- async function Ot(e, t = .56, n = "image/jpeg") {
4031
+ async function un(e, t = .56, n = "image/jpeg") {
3287
4032
  return new Promise((r) => {
3288
- let i = new Blob([e], { type: n }), a = Tt(URL.createObjectURL(i));
3289
- a ? a.onload = () => {
3290
- let e = Dt(a, t * a.naturalWidth, "width", n);
3291
- r(e == null ? "" : e);
3292
- } : xt(i).then((e) => r(String(e == null ? "" : e)));
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)));
3293
4044
  });
3294
4045
  }
3295
4046
  //#endregion
3296
4047
  //#region src/functions/eventStopPropagation.ts
3297
- function kt(e) {
4048
+ function dn(e) {
3298
4049
  e.preventDefault(), e.stopPropagation();
3299
4050
  }
3300
4051
  //#endregion
3301
4052
  //#region src/functions/frame.ts
3302
- function At(e, t, n) {
4053
+ function fn(e, t, n) {
3303
4054
  let r = () => {
3304
- e(), t != null && t() ? At(e, t, n) : n == null || n();
4055
+ e(), s() && t != null && t() ? fn(e, t, n) : n == null || n();
3305
4056
  };
3306
- m() ? requestAnimationFrame(r) : r();
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
+ }];
3307
4081
  }
3308
4082
  //#endregion
3309
4083
  //#region src/functions/getAttributes.ts
3310
- function jt(e) {
3311
- let t = {}, n = D(e);
4084
+ function mn(e) {
4085
+ let t = {}, n = O(e);
3312
4086
  if (n) for (let e of n.attributes) {
3313
4087
  var r;
3314
4088
  t[e.name] = (r = (e == null ? void 0 : e.value) || (e == null ? void 0 : e.textContent)) == null ? void 0 : r;
@@ -3317,130 +4091,163 @@ function jt(e) {
3317
4091
  }
3318
4092
  //#endregion
3319
4093
  //#region src/functions/getClipboardData.ts
3320
- async function Mt(e) {
3321
- var t, n;
3322
- return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
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 "";
3323
4106
  }
3324
4107
  //#endregion
3325
4108
  //#region src/functions/getCurrentDate.ts
3326
- function Nt(e = "datetime") {
3327
- return new Pe(void 0, e).standard();
4109
+ function gn(e = "datetime") {
4110
+ return new $e(void 0, e).standard();
3328
4111
  }
3329
4112
  //#endregion
3330
4113
  //#region src/functions/getCurrentTime.ts
3331
- function Pt() {
3332
- return (/* @__PURE__ */ new Date()).getTime();
4114
+ function _n() {
4115
+ return Date.now();
3333
4116
  }
3334
4117
  //#endregion
3335
4118
  //#region src/functions/getElementId.ts
3336
- var Ft = d(1e5, 9e5);
3337
- function It(e, t) {
3338
- let n = D(e);
3339
- return n ? (c(n.id) || n.setAttribute("id", `id-${Ft++}`), t ? `#${n.id}${t}`.trim() : n.id) : `id-${Ft++}`;
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);
3340
4134
  }
3341
4135
  //#endregion
3342
4136
  //#region src/functions/getKey.ts
3343
- function Lt(e) {
4137
+ function xn(e) {
3344
4138
  var t, n, r;
3345
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;
3346
4140
  }
3347
4141
  //#endregion
3348
4142
  //#region src/functions/getLengthOfAllArray.ts
3349
- function Rt(e) {
3350
- return i(e, (e) => e.length);
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
+ });
3351
4148
  }
3352
4149
  //#endregion
3353
4150
  //#region src/functions/getMaxLengthAllArray.ts
3354
- function zt(e) {
3355
- return Math.max(...Rt(e));
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);
3356
4155
  }
3357
4156
  //#endregion
3358
4157
  //#region src/functions/getMinLengthAllArray.ts
3359
- function Bt(e) {
3360
- return Math.min(...Rt(e));
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);
3361
4162
  }
3362
4163
  //#endregion
3363
4164
  //#region src/functions/getMouseClientX.ts
3364
- function Vt(e) {
4165
+ function Tn(e) {
3365
4166
  var t, n;
3366
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;
3367
4168
  }
3368
4169
  //#endregion
3369
4170
  //#region src/functions/getMouseClientY.ts
3370
- function Ht(e) {
4171
+ function En(e) {
3371
4172
  var t, n;
3372
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;
3373
4174
  }
3374
4175
  //#endregion
3375
4176
  //#region src/functions/getMouseClient.ts
3376
- function Ut(e) {
4177
+ function Dn(e) {
3377
4178
  return {
3378
- x: Vt(e),
3379
- y: Ht(e)
4179
+ x: Tn(e),
4180
+ y: En(e)
3380
4181
  };
3381
4182
  }
3382
4183
  //#endregion
3383
4184
  //#region src/functions/getObjectByKeys.ts
3384
- function Wt(e, t) {
3385
- let n = {};
3386
- return t.forEach((t) => {
3387
- t in e && e[t] !== void 0 && (n[t] = e[t]);
3388
- }), n;
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;
3389
4190
  }
3390
4191
  //#endregion
3391
4192
  //#region src/functions/getObjectNoUndefined.ts
3392
- function Gt(e, t = void 0) {
4193
+ function kn(e, t = void 0) {
3393
4194
  let n = {};
3394
- return i(e, (e, r) => {
4195
+ return r(e, (e, r) => {
3395
4196
  e !== t && (n[r] = e);
3396
4197
  }), n;
3397
4198
  }
3398
4199
  //#endregion
3399
4200
  //#region src/functions/getObjectOrNone.ts
3400
- function Kt(e) {
4201
+ function An(e) {
3401
4202
  return n(e) ? e : {};
3402
4203
  }
3403
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
3404
4210
  //#region src/functions/strFill.ts
3405
- function qt(e, t) {
3406
- return bt(e, t).join("");
4211
+ function Mn(e, t) {
4212
+ return String(e).repeat(t);
3407
4213
  }
3408
4214
  //#endregion
3409
4215
  //#region src/functions/getRandomText.ts
3410
- function Jt(e, t, n = "#", r = 2, i = 12) {
3411
- let a = d(e, t), o = [];
3412
- for (let e = 0; e < a; e++) o.push(qt(n, d(r, i)));
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)));
3413
4219
  return o.join(" ");
3414
4220
  }
3415
4221
  //#endregion
3416
4222
  //#region src/functions/getStepPercent.ts
3417
- function Yt(e, t) {
4223
+ function Pn(e, t) {
3418
4224
  let n = e == null ? 0 : e;
3419
4225
  return t > n ? 100 / (t - n) : 0;
3420
4226
  }
3421
4227
  //#endregion
3422
4228
  //#region src/functions/getStepValue.ts
3423
- function Xt(e, t) {
4229
+ function Fn(e, t) {
3424
4230
  let n = e == null ? 0 : e;
3425
4231
  return t > n ? (t - n) / 100 : 0;
3426
4232
  }
3427
4233
  //#endregion
3428
4234
  //#region src/functions/goScroll.ts
3429
- var Zt = 0;
3430
- function Qt(e, t, n) {
4235
+ var In = 0;
4236
+ function Ln(e, t, n) {
4237
+ if (!s()) return;
3431
4238
  let r = t == null ? void 0 : t.closest(e);
3432
4239
  if (t && r && r.scrollHeight !== r.offsetHeight) {
3433
4240
  let e = r.getBoundingClientRect(), i = t.getBoundingClientRect();
3434
4241
  if (n) {
3435
4242
  let a = n.getBoundingClientRect();
3436
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);
3437
- } else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - Zt : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + Zt);
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);
3438
4245
  }
3439
4246
  }
3440
4247
  //#endregion
3441
4248
  //#region src/functions/goScrollSmooth.ts
3442
- function $t(e, t, n = 0) {
3443
- if (!m()) return;
4249
+ function Rn(e, t, n = 0) {
4250
+ if (!s()) return;
3444
4251
  let r = (t == null ? void 0 : t.behavior) || "smooth";
3445
4252
  if ("scrollIntoView" in e && !n) {
3446
4253
  e.scrollIntoView({
@@ -3461,8 +4268,8 @@ function $t(e, t, n = 0) {
3461
4268
  }
3462
4269
  //#endregion
3463
4270
  //#region src/functions/goScrollTo.ts
3464
- function en(e, t, n = "smooth") {
3465
- if (!m() || !e || !t) return;
4271
+ function zn(e, t, n = "smooth") {
4272
+ if (!s() || !e || !t) return;
3466
4273
  let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
3467
4274
  e.scrollBy({
3468
4275
  top: i.top - r.top,
@@ -3472,95 +4279,93 @@ function en(e, t, n = "smooth") {
3472
4279
  }
3473
4280
  //#endregion
3474
4281
  //#region src/functions/isShare.ts
3475
- function tn() {
3476
- return m() && typeof navigator < "u" && !!navigator.share;
4282
+ function Bn() {
4283
+ return s() && typeof navigator < "u" && !!navigator.share;
3477
4284
  }
3478
4285
  //#endregion
3479
4286
  //#region src/functions/handleShare.ts
3480
- async function nn(e) {
3481
- if (tn() && navigator.canShare && navigator.canShare(e)) try {
4287
+ async function Vn(e) {
4288
+ if (Bn() && navigator.canShare && navigator.canShare(e)) try {
3482
4289
  return await navigator.share(e), !0;
3483
4290
  } catch (e) {
3484
- console.error("handleShare error:", e);
4291
+ C.on({
4292
+ group: "share",
4293
+ code: "error",
4294
+ details: e
4295
+ });
3485
4296
  }
3486
4297
  return !1;
3487
4298
  }
3488
4299
  //#endregion
3489
4300
  //#region src/functions/inArray.ts
3490
- function rn(e, t) {
3491
- return e.indexOf(t) !== -1;
4301
+ function Hn(e, t) {
4302
+ return e.includes(t);
3492
4303
  }
3493
4304
  //#endregion
3494
4305
  //#region src/functions/initScrollbarOffset.ts
3495
- async function an() {
3496
- if (m()) {
3497
- let e = await Z.get();
4306
+ async function Un() {
4307
+ if (s()) {
4308
+ let e = await Tt.get();
3498
4309
  document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
3499
4310
  }
3500
4311
  }
3501
4312
  //#endregion
3502
4313
  //#region src/functions/intersectKey.ts
3503
- function on(e, n) {
3504
- let r = {};
3505
- return t(e) && t(n) && i(e, (e, t) => {
3506
- t in n && (r[t] = e);
3507
- }), r;
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;
3508
4319
  }
3509
4320
  //#endregion
3510
- //#region src/functions/isApiSuccess.ts
3511
- var sn = (e) => {
3512
- var t;
3513
- 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(N.getStatus().getStatus()).match(/^2/)));
3514
- };
3515
- //#endregion
3516
4321
  //#region src/functions/isDifferent.ts
3517
- function cn(e, t) {
4322
+ function Gn(e, t) {
3518
4323
  let n = Object.keys(e).length !== Object.keys(t).length;
3519
- return n || i(e, (e, r) => {
4324
+ return n || r(e, (e, r) => {
3520
4325
  e !== (t == null ? void 0 : t[r]) && (n = !0);
3521
4326
  }), n;
3522
4327
  }
3523
4328
  //#endregion
3524
4329
  //#region src/functions/isElementVisible.ts
3525
- function ln(e) {
3526
- if (!m()) return !1;
3527
- let t = D(e);
4330
+ function Kn(e) {
4331
+ if (!s()) return !1;
4332
+ let t = O(e);
3528
4333
  if (!t || "isConnected" in t && t.isConnected === !1) return !1;
3529
4334
  let n = window.getComputedStyle(t);
3530
4335
  return n.display !== "none" && n.visibility !== "hidden" && n.opacity !== "0" && t.offsetWidth !== 0 && t.offsetHeight !== 0;
3531
4336
  }
3532
4337
  //#endregion
3533
4338
  //#region src/functions/isInput.ts
3534
- var un = (e) => {
4339
+ var qn = (e) => {
3535
4340
  if (e instanceof HTMLElement) {
3536
4341
  let t = e.tagName.toLowerCase();
3537
4342
  return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
3538
4343
  }
3539
4344
  return !1;
3540
- }, dn = (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 ? !un(e.target) : !t : !1;
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;
3541
4346
  //#endregion
3542
4347
  //#region src/functions/isFloat.ts
3543
- function fn(e) {
4348
+ function Yn(e) {
3544
4349
  switch (typeof e) {
3545
4350
  case "number": return !0;
3546
- case "string": return !!e.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
4351
+ case "string": return /^-?\d+(\.\d+)?$/.test(e);
3547
4352
  default: return !1;
3548
4353
  }
3549
4354
  }
3550
4355
  //#endregion
3551
4356
  //#region src/functions/isIntegerBetween.ts
3552
- function pn(e, t) {
4357
+ function Xn(e, t) {
3553
4358
  let n = Math.floor(t);
3554
4359
  return e >= n && e < n + 1;
3555
4360
  }
3556
4361
  //#endregion
3557
4362
  //#region src/functions/isSelectedByList.ts
3558
- function mn(e, t) {
3559
- return Array.isArray(e) ? e.every((e) => _(e, t)) : _(e, t);
4363
+ function Zn(e, t) {
4364
+ return Array.isArray(e) ? e.every((e) => v(e, t)) : v(e, t);
3560
4365
  }
3561
4366
  //#endregion
3562
4367
  //#region src/functions/removeCommonPrefix.ts
3563
- function hn(e, t) {
4368
+ function Qn(e, t) {
3564
4369
  if (e.startsWith(t)) return e.slice(t.length).trim();
3565
4370
  let n = 0;
3566
4371
  for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
@@ -3568,97 +4373,101 @@ function hn(e, t) {
3568
4373
  }
3569
4374
  //#endregion
3570
4375
  //#region src/functions/replaceComponentName.ts
3571
- var gn = (e, t, n) => {
4376
+ var $n = (e, t, n) => {
3572
4377
  var r;
3573
4378
  return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
3574
4379
  };
3575
4380
  //#endregion
3576
4381
  //#region src/functions/uniqueArray.ts
3577
- function _n(e) {
4382
+ function er(e) {
3578
4383
  return [...new Set(e)];
3579
4384
  }
3580
4385
  //#endregion
3581
4386
  //#region src/functions/replaceRecursive.ts
3582
- function $(e, n, r = !0) {
3583
- let a = p(e);
3584
- return t(e) && t(n) && i(n, (n, i) => {
3585
- let o = e == null ? void 0 : e[i];
3586
- t(o) && t(n) ? r && Array.isArray(o) && Array.isArray(n) ? a[i] = p(_n([...o, ...n])) : a[i] = $(Array.isArray(o) ? { ...o } : o, n, r) : a[i] = t(n) ? p(n) : 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;
3587
4392
  }), a;
3588
4393
  }
3589
4394
  //#endregion
3590
4395
  //#region src/functions/replaceTemplate.ts
3591
- function vn(e, t) {
4396
+ function tr(e, t) {
3592
4397
  let n = e;
3593
- return i(t, (e, t) => {
3594
- n = n.replace(st(`[${t}]`), y(e));
4398
+ return r(t, (e, t) => {
4399
+ n = n.replace(Nt(`[${t}]`), b(e));
3595
4400
  }), n;
3596
4401
  }
3597
4402
  //#endregion
3598
4403
  //#region src/functions/secondToTime.ts
3599
- function yn(e) {
3600
- let t = g(e);
3601
- return t > 0 ? `${String(Math.floor(t / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}` : "00:00";
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";
3602
4411
  }
3603
4412
  //#endregion
3604
4413
  //#region src/functions/setValues.ts
3605
- function bn(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, notEmpty: a = !1 }) {
4414
+ function rr(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, notEmpty: o = !1 }) {
3606
4415
  if (n) {
3607
- if (o(e)) {
4416
+ if (i(e)) {
3608
4417
  let n = e.indexOf(t), i = [...e];
3609
- return n === -1 ? (!r || e.length < r) && i.push(t) : (!a || i.length > 1) && i.splice(n, 1), i;
4418
+ return n === -1 ? (!r || e.length < r) && i.push(t) : (!o || i.length > 1) && i.splice(n, 1), i;
3610
4419
  }
3611
4420
  return e === t ? [] : e ? [e, t] : [t];
3612
4421
  }
3613
- return i || e !== t ? t : e;
4422
+ return a || e !== t ? t : e;
3614
4423
  }
3615
4424
  //#endregion
3616
4425
  //#region src/functions/splice.ts
3617
- function xn(e, n, r) {
4426
+ function ir(e, n, i) {
3618
4427
  if (t(e) && t(n)) {
3619
- if (r) {
4428
+ if (i) {
3620
4429
  let a = {}, o = !1;
3621
- return i(e, (e, i) => {
3622
- !o && (r === i || r === e) ? (o = !0, a = $(a, n)) : o ? a = $(a, { [i]: e }) : a[i] = t(e) ? p(e) : e;
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;
3623
4432
  }), o ? a : $(e, n);
3624
4433
  }
3625
4434
  if (t(n)) return $(e, n);
3626
4435
  }
3627
- return p(e);
4436
+ return Z(e);
3628
4437
  }
3629
4438
  //#endregion
3630
4439
  //#region src/functions/toCamelCaseFirst.ts
3631
- function Sn(e) {
3632
- return z(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
4440
+ function ar(e) {
4441
+ return et(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
3633
4442
  }
3634
4443
  //#endregion
3635
4444
  //#region src/functions/toKebabCase.ts
3636
- function Cn(e) {
4445
+ function or(e) {
3637
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());
3638
4447
  }
3639
4448
  //#endregion
3640
4449
  //#region src/functions/toNumberByMax.ts
3641
- function wn(e, t, n, r) {
3642
- let i = g(e), a = g(t);
3643
- return t && a < i ? `${Tn(a, n, r)}+` : Tn(i, n, r);
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);
3644
4453
  }
3645
- var Tn = (e, t, n) => t ? new F(n).number(e) : e;
4454
+ var cr = (e, t, n) => t ? new z(n).number(e) : e;
3646
4455
  //#endregion
3647
4456
  //#region src/functions/toPercent.ts
3648
- function En(e, t) {
3649
- return 1 / e * t;
4457
+ function lr(e, t) {
4458
+ return e === 0 ? t : 1 / e * t;
3650
4459
  }
3651
4460
  //#endregion
3652
4461
  //#region src/functions/toPercentBy100.ts
3653
- function Dn(e, t) {
3654
- return En(e, t) * 100;
4462
+ function ur(e, t) {
4463
+ return lr(e, t) * 100;
3655
4464
  }
3656
4465
  //#endregion
3657
4466
  //#region src/functions/uint8ArrayToBase64.ts
3658
- function On(e) {
4467
+ function dr(e) {
3659
4468
  let t = "";
3660
4469
  for (let n of e) t += String.fromCharCode(n);
3661
- if (m()) return window.btoa(t);
4470
+ if (s()) return window.btoa(t);
3662
4471
  if (globalThis && globalThis.Buffer) {
3663
4472
  var n;
3664
4473
  return (n = globalThis) == null ? void 0 : n.Buffer.from(e).toString("base64");
@@ -3667,13 +4476,13 @@ function On(e) {
3667
4476
  }
3668
4477
  //#endregion
3669
4478
  //#region src/functions/writeClipboardData.ts
3670
- async function kn(e) {
3671
- if (m()) try {
4479
+ async function fr(e) {
4480
+ if (s()) try {
3672
4481
  await navigator.clipboard.writeText(e);
3673
4482
  } catch (n) {
3674
4483
  var t;
3675
- (t = document) == null || t.execCommand(e);
4484
+ (t = document) == null || t.execCommand("copy", !1, e);
3676
4485
  }
3677
4486
  }
3678
4487
  //#endregion
3679
- export { N as Api, pe as ApiDefault, fe as ApiHeaders, ye as ApiInstance, M as ApiMethodItem, ve as ApiPreparation, _e as ApiResponse, me as ApiStatus, be as BroadcastMessage, Ce as Cache, Se as CacheItem, Te as CacheStatic, je as Cookie, Oe as CookieBlock, w as DataStorage, Pe as Datetime, C as ErrorCenter, ne as ErrorCenterHandler, re as ErrorCenterInstance, A as EventItem, Ie as Formatters, B as FormattersType, Le as GEO_FLAG_ICON_NAME, E as Geo, Re as GeoFlag, F as GeoIntl, V as GeoPhone, ze as Global, W as Hash, G as Icons, j as Loading, de as LoadingInstance, nt as Meta, q as MetaManager, et as MetaOg, Ze as MetaOpenGraphAge, Ye as MetaOpenGraphAvailability, Xe as MetaOpenGraphCondition, Qe as MetaOpenGraphGender, Y as MetaOpenGraphTag, Je as MetaOpenGraphType, qe as MetaRobots, J as MetaTag, tt as MetaTwitter, $e as MetaTwitterCard, X as MetaTwitterTag, Z as ScrollbarWidth, ft as SearchList, at as SearchListData, ot as SearchListItem, ut as SearchListMatcher, dt as SearchListOptions, ht as TRANSLATE_GLOBAL_PREFIX, gt as TRANSLATE_TIME_OUT, yt as Translate, _t as TranslateFile, vt as TranslateInstance, it as addTagHighlightMatch, L as anyToString, mt as applyTemplate, bt as arrFill, xt as blobToBase64, St as capitalize, p as copyObject, r as copyObjectLite, K as createElement, Ct as domQuerySelector, wt as domQuerySelectorAll, Ke as encodeAttribute, Ot as ensureMaxSize, Q as escapeExp, kt as eventStopPropagation, y as executeFunction, he as executePromise, i as forEach, At as frame, jt as getAttributes, Mt as getClipboardData, Ne as getColumn, Nt as getCurrentDate, Pt as getCurrentTime, D as getElement, It as getElementId, Tt as getElementImage, We as getElementItem, O as getElementOrWindow, ct as getExactSearchExp, st as getExp, R as getItemByPath, Lt as getKey, Rt as getLengthOfAllArray, zt as getMaxLengthAllArray, Bt as getMinLengthAllArray, Ut as getMouseClient, Vt as getMouseClientX, Ht as getMouseClientY, Wt as getObjectByKeys, Gt as getObjectNoUndefined, Kt as getObjectOrNone, Jt as getRandomText, a as getRequestString, lt as getSearchExp, rt as getSeparatingSearchExp, Yt as getStepPercent, Xt as getStepValue, Qt as goScroll, $t as goScrollSmooth, en as goScrollTo, nn as handleShare, rn as inArray, an as initScrollbarOffset, on as intersectKey, sn as isApiSuccess, o as isArray, cn as isDifferent, b as isDomData, m as isDomRuntime, ln as isElementVisible, dn as isEnter, c as isFilled, fn as isFloat, v as isFunction, le as isInDom, un as isInput, pn as isIntegerBetween, s as isNull, h as isNumber, t as isObject, n as isObjectNotArray, l as isOnLine, _ as isSelected, mn as isSelectedByList, tn as isShare, u as isString, ce as isWindow, d as random, hn as removeCommonPrefix, gn as replaceComponentName, $ as replaceRecursive, vn as replaceTemplate, Dt as resizeImageByMax, yn as secondToTime, Ge as setElementItem, bn as setValues, f as sleep, xn as splice, qt as strFill, Fe as strSplit, k as toArray, z as toCamelCase, Sn as toCamelCaseFirst, P as toDate, Cn as toKebabCase, g as toNumber, wn as toNumberByMax, En as toPercent, Dn as toPercentBy100, Ee as transformation, On as uint8ArrayToBase64, _n as uniqueArray, kn as writeClipboardData };
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 };