@ryuzaki13/react-foundation-lib 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +154 -100
  2. package/dist/chunks/{formatters-CBgrBeSA.js → formatters-D33Uh3si.js} +7 -8
  3. package/dist/chunks/{formatters-CBgrBeSA.js.map → formatters-D33Uh3si.js.map} +1 -1
  4. package/dist/chunks/odata-service-CWkHASdw.js +2211 -0
  5. package/dist/chunks/odata-service-CWkHASdw.js.map +1 -0
  6. package/dist/chunks/{validate-BW-7BZy_.js → validate-DyzojM0w.js} +2 -2
  7. package/dist/chunks/{validate-BW-7BZy_.js.map → validate-DyzojM0w.js.map} +1 -1
  8. package/dist/error-report/index.js +2 -2
  9. package/dist/excel/index.js +20 -21
  10. package/dist/excel/index.js.map +1 -1
  11. package/dist/formatters/index.js +4 -5
  12. package/dist/{odata → odata-service}/buildSeparatedArrays.d.ts +1 -1
  13. package/dist/odata-service/buildSeparatedArrays.d.ts.map +1 -0
  14. package/dist/{odata/types.d.ts → odata-service/collectionTypes.d.ts} +1 -1
  15. package/dist/odata-service/collectionTypes.d.ts.map +1 -0
  16. package/dist/{odata → odata-service}/dateUtils.d.ts +1 -1
  17. package/dist/odata-service/dateUtils.d.ts.map +1 -0
  18. package/dist/{odata → odata-service}/findCollectionPairs.d.ts +1 -1
  19. package/dist/odata-service/findCollectionPairs.d.ts.map +1 -0
  20. package/dist/odata-service/index.d.ts +5 -0
  21. package/dist/odata-service/index.d.ts.map +1 -1
  22. package/dist/odata-service/index.js +2 -2
  23. package/dist/{odata/store.d.ts → odata-service/odataCollectionStore.d.ts} +1 -1
  24. package/dist/odata-service/odataCollectionStore.d.ts.map +1 -0
  25. package/dist/query-client/index.js.map +1 -1
  26. package/dist/query-client/queryClient.d.ts +1 -3
  27. package/dist/query-client/queryClient.d.ts.map +1 -1
  28. package/package.json +1 -5
  29. package/src/bounded-copy-stack/README.mdx +257 -0
  30. package/src/context-menu/README.mdx +326 -0
  31. package/src/currency/README.mdx +155 -0
  32. package/src/date-segments/README.mdx +319 -0
  33. package/src/error/README.mdx +95 -0
  34. package/src/error-report/README.mdx +612 -0
  35. package/src/excel/README.mdx +449 -0
  36. package/src/fingerprint/README.mdx +100 -0
  37. package/src/form/README.mdx +101 -0
  38. package/src/foundationLib.mdx +70 -54
  39. package/src/hooks/README.mdx +988 -0
  40. package/src/http/README.mdx +126 -0
  41. package/src/media/README.mdx +1853 -0
  42. package/src/notifications/README.mdx +323 -0
  43. package/src/number-scale/README.mdx +318 -0
  44. package/src/odata-service/README.mdx +2916 -0
  45. package/src/presets/README.mdx +136 -0
  46. package/src/pwa/README.mdx +394 -0
  47. package/src/query-client/README.mdx +2500 -0
  48. package/src/range-output/README.mdx +161 -0
  49. package/src/seo/README.mdx +279 -0
  50. package/src/session-storage/README.mdx +125 -0
  51. package/src/string-comparison/README.mdx +96 -0
  52. package/src/table/README.mdx +3106 -0
  53. package/src/three-scene/README.mdx +248 -0
  54. package/src/types/README.mdx +172 -0
  55. package/src/utils/README.mdx +1724 -0
  56. package/src/validators/README.mdx +239 -0
  57. package/src/virtualizer/README.mdx +138 -0
  58. package/src/xml/README.mdx +149 -0
  59. package/dist/chunks/dateUtils-B5V5aXB-.js +0 -847
  60. package/dist/chunks/dateUtils-B5V5aXB-.js.map +0 -1
  61. package/dist/chunks/odata-service-B6TxBSLm.js +0 -1277
  62. package/dist/chunks/odata-service-B6TxBSLm.js.map +0 -1
  63. package/dist/odata/buildSeparatedArrays.d.ts.map +0 -1
  64. package/dist/odata/dateUtils.d.ts.map +0 -1
  65. package/dist/odata/findCollectionPairs.d.ts.map +0 -1
  66. package/dist/odata/index.d.ts +0 -6
  67. package/dist/odata/index.d.ts.map +0 -1
  68. package/dist/odata/index.js +0 -102
  69. package/dist/odata/index.js.map +0 -1
  70. package/dist/odata/store.d.ts.map +0 -1
  71. package/dist/odata/types.d.ts.map +0 -1
  72. package/src/pwa/README.md +0 -638
  73. package/src/query-client/README.md +0 -565
@@ -1,847 +0,0 @@
1
- //#region src/formatters/date/pattern.ts
2
- var e = Object.freeze([
3
- "dd",
4
- "MM",
5
- "yyyy",
6
- "yy"
7
- ]), t = Object.freeze([
8
- "HH",
9
- "mm",
10
- "ss"
11
- ]), n = Object.freeze([...e, ...t]), r = /(yyyy|yy|MM|dd|HH|mm|ss)/g, i = new Set(n), a = Object.freeze({
12
- day: new Set(n),
13
- month: /* @__PURE__ */ new Set([
14
- "MM",
15
- "yyyy",
16
- "yy"
17
- ]),
18
- year: /* @__PURE__ */ new Set(["yyyy", "yy"])
19
- });
20
- function o(e) {
21
- return i.has(e);
22
- }
23
- function s(e, t) {
24
- return t.some((t) => e.includes(t));
25
- }
26
- function c(e) {
27
- return r.lastIndex = 0, r.test(e);
28
- }
29
- function l(e) {
30
- return a[e];
31
- }
32
- function u(e, t) {
33
- if (t === "day") return e;
34
- let n = l(t), i = [], a = "", o = !1, s = 0, c = 0, u;
35
- for (r.lastIndex = 0; u = r.exec(e);) {
36
- let t = e.slice(c, u.index), r = u[0];
37
- o && (a += t), n.has(r) && (o && i.push(a), i.push(r), a = "", o = !0, s += 1), c = u.index + r.length;
38
- }
39
- return s === 0 ? e : i.join("");
40
- }
41
- //#endregion
42
- //#region src/formatters/date/presets.ts
43
- var d = "ru-RU", f = Object.freeze([
44
- "short",
45
- "medium",
46
- "long"
47
- ]), p = Object.freeze([
48
- "day",
49
- "month",
50
- "year"
51
- ]), m = {
52
- locale: d,
53
- intlOptions: {
54
- day: "2-digit",
55
- month: "2-digit",
56
- year: "numeric"
57
- },
58
- invalidFallback: ""
59
- }, h = Object.freeze({
60
- date: "date",
61
- dateShort: "date-short",
62
- dateMedium: "date-medium",
63
- dateLong: "date-long",
64
- monthShort: "month-short",
65
- monthMedium: "month-medium",
66
- monthLong: "month-long",
67
- monthYearMedium: "month-year-medium",
68
- monthYearLong: "month-year-long",
69
- datetime: "datetime",
70
- datetimeSeconds: "datetime-seconds",
71
- datetimeShort: "datetime-short",
72
- datetimeMedium: "datetime-medium",
73
- datetimeLong: "datetime-long",
74
- time: "time",
75
- timeSeconds: "time-seconds",
76
- timeShort: "time-short",
77
- timeMedium: "time-medium",
78
- timeLong: "time-long",
79
- odataDate: "odata-date",
80
- odataDatetime: "odata-datetime",
81
- abapDatetime: "abap-datetime",
82
- abapDate: "abap-date",
83
- abapMonth: "abap-month",
84
- abapYear: "abap-year"
85
- }), g = Object.freeze({
86
- short: h.dateShort,
87
- medium: h.dateMedium,
88
- long: h.dateLong
89
- }), _ = /* @__PURE__ */ new Map(), v = [
90
- {
91
- name: h.date,
92
- intlOptions: {
93
- day: "2-digit",
94
- month: "2-digit",
95
- year: "numeric"
96
- }
97
- },
98
- {
99
- name: h.datetime,
100
- intlDateOptions: {
101
- day: "2-digit",
102
- month: "2-digit",
103
- year: "numeric"
104
- },
105
- intlTimeOptions: {
106
- hour: "2-digit",
107
- minute: "2-digit",
108
- hourCycle: "h23"
109
- },
110
- intlJoiner: " "
111
- },
112
- {
113
- name: h.datetimeSeconds,
114
- intlDateOptions: {
115
- day: "2-digit",
116
- month: "2-digit",
117
- year: "numeric"
118
- },
119
- intlTimeOptions: {
120
- hour: "2-digit",
121
- minute: "2-digit",
122
- second: "2-digit",
123
- hourCycle: "h23"
124
- },
125
- intlJoiner: " "
126
- },
127
- {
128
- name: h.time,
129
- intlOptions: {
130
- hour: "2-digit",
131
- minute: "2-digit",
132
- hourCycle: "h23"
133
- },
134
- durationPattern: "HH:mm"
135
- },
136
- {
137
- name: h.timeSeconds,
138
- intlOptions: {
139
- hour: "2-digit",
140
- minute: "2-digit",
141
- second: "2-digit",
142
- hourCycle: "h23"
143
- },
144
- durationPattern: "HH:mm:ss"
145
- },
146
- ...f.map((e) => ({
147
- name: `date-${e}`,
148
- intlOptions: S(e)
149
- })),
150
- ...f.map((e) => ({
151
- name: `month-${e}`,
152
- intlOptions: ee(e)
153
- })),
154
- {
155
- name: h.monthYearMedium,
156
- intlOptions: {
157
- month: "short",
158
- year: "numeric"
159
- }
160
- },
161
- {
162
- name: h.monthYearLong,
163
- intlOptions: {
164
- month: "long",
165
- year: "numeric"
166
- }
167
- },
168
- ...f.map((e) => ({
169
- name: `time-${e}`,
170
- intlOptions: C(e),
171
- durationPattern: e === "short" ? "HH:mm" : "HH:mm:ss"
172
- })),
173
- ...f.map((e) => ({
174
- name: `datetime-${e}`,
175
- intlDateOptions: S(e),
176
- intlTimeOptions: C(e),
177
- intlJoiner: ", "
178
- })),
179
- {
180
- name: h.odataDate,
181
- pattern: "yyyy-MM-dd"
182
- },
183
- {
184
- name: h.odataDatetime,
185
- pattern: "yyyy-MM-ddTHH:mm:ss"
186
- },
187
- {
188
- name: h.abapDatetime,
189
- pattern: "yyyyMMddHHmmss"
190
- },
191
- {
192
- name: h.abapDate,
193
- pattern: "yyyyMMdd"
194
- },
195
- {
196
- name: h.abapMonth,
197
- pattern: "yyyyMM"
198
- },
199
- {
200
- name: h.abapYear,
201
- pattern: "yyyy"
202
- }
203
- ], y = /* @__PURE__ */ new Map([[h.monthYearMedium, "short"], [h.monthYearLong, "long"]]), b = /* @__PURE__ */ new Map();
204
- function x(e, t = 2) {
205
- return String(e).padStart(t, "0");
206
- }
207
- function S(e, t = "day") {
208
- return t === "year" ? { year: "numeric" } : t === "month" ? e === "short" ? {
209
- month: "2-digit",
210
- year: "numeric"
211
- } : e === "medium" ? {
212
- month: "short",
213
- year: "numeric"
214
- } : {
215
- month: "long",
216
- year: "numeric"
217
- } : e === "short" ? {
218
- day: "2-digit",
219
- month: "2-digit",
220
- year: "numeric"
221
- } : e === "medium" ? {
222
- day: "numeric",
223
- month: "short",
224
- year: "numeric"
225
- } : {
226
- day: "numeric",
227
- month: "long",
228
- year: "numeric"
229
- };
230
- }
231
- function ee(e) {
232
- return e === "short" ? {
233
- day: "2-digit",
234
- month: "2-digit"
235
- } : e === "medium" ? {
236
- day: "numeric",
237
- month: "short"
238
- } : {
239
- day: "numeric",
240
- month: "long"
241
- };
242
- }
243
- function C(e) {
244
- return e === "short" ? {
245
- hour: "2-digit",
246
- minute: "2-digit",
247
- hourCycle: "h23"
248
- } : {
249
- hour: "2-digit",
250
- minute: "2-digit",
251
- second: "2-digit",
252
- hourCycle: "h23"
253
- };
254
- }
255
- function te(e) {
256
- let { timeZone: t, timeZoneName: n, ...r } = e;
257
- return r;
258
- }
259
- function ne(e) {
260
- return !!(e.dateStyle || e.year || e.month || e.day);
261
- }
262
- function re(e, t) {
263
- let n = te(e);
264
- return t === "day" || !ne(n) ? n : n.dateStyle ? S(n.dateStyle === "short" || n.dateStyle === "medium" ? n.dateStyle : "long", t) : t === "year" ? { year: n.year ?? "numeric" } : {
265
- month: n.month ?? "2-digit",
266
- year: n.year ?? "numeric"
267
- };
268
- }
269
- function w(e, t) {
270
- let n = te(t), r = /* @__PURE__ */ new Map();
271
- if (n.timeStyle) {
272
- let t = C(n.timeStyle === "short" ? "short" : "medium");
273
- if (n.dateStyle) {
274
- let i = new Intl.DateTimeFormat(e, { dateStyle: n.dateStyle }), a = new Intl.DateTimeFormat(e, t);
275
- return (t, o = "day") => {
276
- if (o === "day") return `${i.format(t)}, ${a.format(t)}`;
277
- let s = re({ dateStyle: n.dateStyle }, o), c = r.get(o);
278
- return c || (c = new Intl.DateTimeFormat(e, s), r.set(o, c)), c.format(t);
279
- };
280
- }
281
- return new Intl.DateTimeFormat(e, t).format;
282
- }
283
- let i = new Intl.DateTimeFormat(e, n);
284
- return (t, a = "day") => {
285
- if (a === "day") return i.format(t);
286
- let o = r.get(a);
287
- return o || (o = new Intl.DateTimeFormat(e, re(n, a)), r.set(a, o)), o.format(t);
288
- };
289
- }
290
- function ie(e, t) {
291
- let n = String(t.getFullYear());
292
- switch (e) {
293
- case "yyyy": return n;
294
- case "yy": return n.slice(-2);
295
- case "MM": return x(t.getMonth() + 1);
296
- case "dd": return x(t.getDate());
297
- case "HH": return x(t.getHours());
298
- case "mm": return x(t.getMinutes());
299
- case "ss": return x(t.getSeconds());
300
- default: return e;
301
- }
302
- }
303
- function ae(e) {
304
- switch (e) {
305
- case "yyyyMMdd": return (e) => `${e.getFullYear()}${x(e.getMonth() + 1)}${x(e.getDate())}`;
306
- case "yyyyMMddHHmmss": return (e) => `${e.getFullYear()}${x(e.getMonth() + 1)}${x(e.getDate())}${x(e.getHours())}${x(e.getMinutes())}${x(e.getSeconds())}`;
307
- case "yyyy-MM-dd": return (e) => `${e.getFullYear()}-${x(e.getMonth() + 1)}-${x(e.getDate())}`;
308
- case "yyyy-MM-ddTHH:mm:ss": return (e) => `${e.getFullYear()}-${x(e.getMonth() + 1)}-${x(e.getDate())}T${x(e.getHours())}:${x(e.getMinutes())}:${x(e.getSeconds())}`;
309
- default: return se(e);
310
- }
311
- }
312
- function oe(e) {
313
- let t = /* @__PURE__ */ new Map();
314
- return (n, r = "day") => {
315
- let i = t.get(r);
316
- return i || (i = ae(u(e, r)), t.set(r, i)), i(n, "day");
317
- };
318
- }
319
- function se(e) {
320
- let t = [], n = 0, i;
321
- for (r.lastIndex = 0; i = r.exec(e);) i.index > n && t.push(e.slice(n, i.index)), t.push(i[0]), n = i.index + i[0].length;
322
- return n < e.length && t.push(e.slice(n)), (e) => {
323
- let n = "";
324
- for (let r of t) n += o(r) ? ie(r, e) : r;
325
- return n;
326
- };
327
- }
328
- function ce(n, r, i) {
329
- if (s(r, e) || !s(r, t)) return i;
330
- let a = n < 0 ? "-" : "", o = Math.trunc(Math.abs(n) / 1e3), c = Math.trunc(o / 3600), l = Math.trunc(o % 3600 / 60), u = o % 60;
331
- return r === "HH:mm" ? `${a}${x(c)}:${x(l)}` : r === "HH:mm:ss" ? `${a}${x(c)}:${x(l)}:${x(u)}` : a + r.replaceAll("HH", x(c)).replaceAll("mm", x(l)).replaceAll("ss", x(u));
332
- }
333
- function T(e) {
334
- let t = {
335
- ...m,
336
- ...e
337
- }, n = le(t), r = t.durationPattern ?? t.pattern, i = {
338
- ...t,
339
- formatDateTime: n
340
- };
341
- return r && (i.formatDuration = (e, t) => ce(e, r, t)), i;
342
- }
343
- function le(e) {
344
- if (e.pattern) return oe(e.pattern);
345
- if (e.intlDateOptions && e.intlTimeOptions) {
346
- let t = w(e.locale, e.intlDateOptions), n = w(e.locale, e.intlTimeOptions), r = e.intlJoiner ?? " ";
347
- return (e, i = "day") => i === "day" ? `${t(e)}${r}${n(e)}` : t(e, i);
348
- }
349
- return w(e.locale, e.intlOptions ?? m.intlOptions);
350
- }
351
- function ue(e, t) {
352
- let n = new Intl.DateTimeFormat(e, t === "short" ? {
353
- day: "numeric",
354
- month: t,
355
- year: "numeric"
356
- } : {
357
- month: t,
358
- year: "numeric"
359
- }), r = new Intl.DateTimeFormat(e, { month: "long" }), i = new Intl.DateTimeFormat(e, { year: "numeric" });
360
- return (e, a = "day") => {
361
- let o = (a === "year" ? i : n).formatToParts(e), s = o.find((e) => e.type === "year")?.value ?? "";
362
- if (a === "year") return s;
363
- let c = o.find((e) => e.type === "month")?.value ?? "";
364
- return `${t === "short" && !c.endsWith(".") ? r.formatToParts(e).find((e) => e.type === "month")?.value ?? c : c} ${s}`;
365
- };
366
- }
367
- function de(e) {
368
- let t = T(e), n = y.get(e.name);
369
- return n ? {
370
- ...t,
371
- formatDateTime: ue(t.locale, n)
372
- } : t;
373
- }
374
- function fe() {
375
- for (let e of v) b.set(e.name, de(e));
376
- }
377
- fe();
378
- function E(e) {
379
- return b.get(e);
380
- }
381
- function pe(e) {
382
- return b.get(e);
383
- }
384
- function me() {
385
- return Array.from(b.keys());
386
- }
387
- function he(e) {
388
- return f.includes(e);
389
- }
390
- function ge(e) {
391
- return p.includes(e);
392
- }
393
- function D(e, t = h.date) {
394
- let n = e?.trim();
395
- return n ? he(n) ? g[n] : n : t;
396
- }
397
- function _e(e, t, n, r) {
398
- let i = `${t}\u0000${n}\u0000${r}\u0000${e}`, a = _.get(i);
399
- if (a) return a;
400
- let o = {
401
- name: `${t}:${e}`,
402
- pattern: e,
403
- locale: n,
404
- invalidFallback: r
405
- };
406
- return _.set(i, o), o;
407
- }
408
- function ve(e, { defaultFormat: t = h.date, patternPresetName: n = "__date_pattern__", locale: r = d, invalidFallback: i = "" } = {}) {
409
- let a = D(e, t);
410
- return E(a) ? a : _e(a, n, r, i);
411
- }
412
- function ye(e) {
413
- let t = T(e);
414
- return b.set(t.name, t), t;
415
- }
416
- function be() {
417
- b.clear(), fe();
418
- }
419
- //#endregion
420
- //#region src/formatters/date/parseDate.ts
421
- var xe = /^\/Date\((-?\d+)([+-]\d{4})?\)\/$/, Se = /^(datetimeoffset|datetime)'(.+)'$/i, Ce = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2})(?::(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?)?)?$/, we = /(Z|([+-])(\d{2}):?(\d{2}))$/i, Te = /^\d{8}$/, Ee = /^\d{14,}$/, De = /^(\d{2})\.(\d{2})\.(\d{4})$/, Oe = /^(\d{2})\/(\d{2})\/(\d{4})$/, ke = /^([+-])?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)(?:\.(\d+))?S)?)?$/, O = /* @__PURE__ */ new Set([
422
- "",
423
- "null",
424
- "undefined"
425
- ]), Ae = 1e3, k = 6e4, A = 36e5, j = 864e5, je = 30, Me = 365, Ne = 70, M = "floating", Pe = Object.freeze({
426
- [h.date]: Object.freeze(["dd.MM.yyyy"]),
427
- [h.dateShort]: Object.freeze(["dd.MM.yyyy"]),
428
- [h.datetime]: Object.freeze(["dd.MM.yyyy HH:mm"]),
429
- [h.datetimeSeconds]: Object.freeze(["dd.MM.yyyy HH:mm:ss"]),
430
- [h.datetimeShort]: Object.freeze(["dd.MM.yyyy, HH:mm"])
431
- }), Fe = /^(\d{1,2})\s+([\p{L}.]+)\s+(\d{4})(?:\s*[\p{L}.]+)?(?:,?\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?$/iu, Ie = /^(\d{1,2})\.(\d{1,2})$/u, Le = /^(\d{1,2})\s+([\p{L}.]+)$/iu, Re = /^([\p{L}.]+)\s+(\d{4})(?:\s*[\p{L}.]+)?$/iu, ze = /^(\d{4})(?:\s*[\p{L}.]+)?$/iu, N = /* @__PURE__ */ new Map(), Be = /* @__PURE__ */ new Set([
432
- h.monthShort,
433
- h.monthMedium,
434
- h.monthLong
435
- ]), Ve = /* @__PURE__ */ new Set([h.monthYearMedium, h.monthYearLong]);
436
- function P(e, t, n, r = 0, i = 0, a = 0, o = 0) {
437
- let s = new Date(e, t - 1, n, r, i, a, o);
438
- return s.getFullYear() === e && s.getMonth() === t - 1 && s.getDate() === n && s.getHours() === r && s.getMinutes() === i && s.getSeconds() === a ? s : null;
439
- }
440
- function F(e, t) {
441
- return e.toLocaleLowerCase(t).replace(/\.$/, "");
442
- }
443
- function I(e, t, n, r) {
444
- e.set(F(t, r), n);
445
- }
446
- function L(e, t, n, r, i) {
447
- let a = t.formatToParts(n).find((e) => e.type === "month");
448
- a && I(e, a.value, r, i);
449
- }
450
- function R(e) {
451
- let t = N.get(e);
452
- if (t) return t;
453
- let n = /* @__PURE__ */ new Map(), r = new Intl.DateTimeFormat(e, { month: "short" }), i = new Intl.DateTimeFormat(e, { month: "long" }), a = new Intl.DateTimeFormat(e, {
454
- day: "numeric",
455
- month: "short",
456
- year: "numeric"
457
- }), o = new Intl.DateTimeFormat(e, {
458
- day: "numeric",
459
- month: "long",
460
- year: "numeric"
461
- });
462
- for (let t = 0; t < 12; t += 1) {
463
- let s = new Date(2026, t, 1);
464
- I(n, r.format(s), t, e), I(n, i.format(s), t, e), L(n, a, s, t, e), L(n, o, s, t, e);
465
- }
466
- return N.set(e, n), n;
467
- }
468
- function He(e, t) {
469
- let n = Fe.exec(e.trim());
470
- if (!n) return null;
471
- let r = Number(n[1]), i = R(t).get(F(n[2], t)), a = Number(n[3]), o = Number(n[4] ?? 0), s = Number(n[5] ?? 0), c = Number(n[6] ?? 0);
472
- if (i === void 0 || !Number.isFinite(r) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c)) return null;
473
- let l = P(a, i + 1, r, o, s, c);
474
- return l ? B(l, "iso-local") : null;
475
- }
476
- function Ue(e, t, n) {
477
- let r = Ie.exec(e.trim());
478
- if (r) {
479
- let e = Number(r[1]), t = P(n, Number(r[2]), e);
480
- return t ? B(t, "iso-local") : null;
481
- }
482
- let i = Le.exec(e.trim());
483
- if (!i) return null;
484
- let a = Number(i[1]), o = R(t).get(F(i[2], t));
485
- if (o === void 0 || !Number.isFinite(a)) return null;
486
- let s = P(n, o + 1, a);
487
- return s ? B(s, "iso-local") : null;
488
- }
489
- function We(e, t) {
490
- let n = Re.exec(e.trim());
491
- if (!n) return null;
492
- let r = R(t).get(F(n[1], t)), i = Number(n[2]);
493
- if (r === void 0 || !Number.isFinite(i)) return null;
494
- let a = P(i, r + 1, 1);
495
- return a ? B(a, "iso-local") : null;
496
- }
497
- function Ge(e) {
498
- let t = ze.exec(e.trim());
499
- if (!t) return null;
500
- let n = Number(t[1]);
501
- if (!Number.isFinite(n)) return null;
502
- let r = P(n, 1, 1);
503
- return r ? B(r, "iso-local") : null;
504
- }
505
- function Ke(e, t, n) {
506
- return n === "year" ? Ge(e) : n === "month" ? We(e, t) : He(e, t);
507
- }
508
- function qe(e) {
509
- return Be.has(e);
510
- }
511
- function Je(e) {
512
- return Ve.has(e);
513
- }
514
- function Ye(e) {
515
- return e instanceof Date && !Number.isNaN(e.getTime()) ? e.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear();
516
- }
517
- function Xe(e) {
518
- return new Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
519
- }
520
- function z(e) {
521
- return new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds());
522
- }
523
- function B(e, t) {
524
- return {
525
- kind: "date-time",
526
- source: t,
527
- date: e
528
- };
529
- }
530
- function Ze(e, t = M) {
531
- if (!Number.isFinite(e)) return null;
532
- let n = Math.abs(e) < 0xe8d4a51000 ? e * 1e3 : e, r = new Date(n);
533
- return Number.isNaN(r.getTime()) ? null : B(t === "instant" ? r : z(r), "timestamp");
534
- }
535
- function Qe(e, t = M) {
536
- let n = xe.exec(e);
537
- if (!n) return null;
538
- let r = Number(n[1]);
539
- if (!Number.isFinite(r)) return null;
540
- if (t === "instant") {
541
- let e = new Date(r);
542
- return Number.isNaN(e.getTime()) ? null : B(e, "odata-ticks");
543
- }
544
- let i = n[2];
545
- if (!i) return B(z(new Date(r)), "odata-ticks");
546
- let a = i.startsWith("-") ? -1 : 1, o = Number(i.slice(1, 3)), s = Number(i.slice(3, 5));
547
- if (!Number.isFinite(o) || !Number.isFinite(s)) return null;
548
- let c = a * (o * A + s * k);
549
- return B(z(new Date(r + c)), "odata-ticks");
550
- }
551
- function V(e) {
552
- let t = Ce.exec(e);
553
- if (!t) return null;
554
- let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a = Number(t[4] ?? 0), o = Number(t[5] ?? 0), s = Number(t[6] ?? 0), c = (t[7] ?? "").slice(0, 3).padEnd(3, "0"), l = P(n, r, i, a, o, s, Number(c || 0));
555
- return l ? B(l, "iso-local") : null;
556
- }
557
- function $e(e) {
558
- if (e[1].toUpperCase() === "Z") return 0;
559
- let t = e[2] === "-" ? -1 : 1, n = Number(e[3]), r = Number(e[4]);
560
- return !Number.isFinite(n) || !Number.isFinite(r) || n > 23 || r > 59 ? null : t * (n * A + r * k);
561
- }
562
- function et(e, t = M) {
563
- let n = we.exec(e);
564
- if (!n) return null;
565
- let r = V(e.slice(0, n.index));
566
- if (!r) return null;
567
- if (t === "floating") return B(r.date, "iso-zoned");
568
- let i = $e(n);
569
- if (i === null) return null;
570
- let a = r.date, o = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds()) - i, s = new Date(o);
571
- return Number.isNaN(s.getTime()) ? null : B(s, "iso-zoned");
572
- }
573
- function tt(e) {
574
- if (!Te.test(e)) return null;
575
- let t = P(Number(e.slice(0, 4)), Number(e.slice(4, 6)), Number(e.slice(6, 8)));
576
- return t ? B(t, "abap-compact") : null;
577
- }
578
- function nt(e) {
579
- if (!Ee.test(e)) return null;
580
- let t = P(Number(e.slice(0, 4)), Number(e.slice(4, 6)), Number(e.slice(6, 8)), Number(e.slice(8, 10)), Number(e.slice(10, 12)), Number(e.slice(12, 14)));
581
- return t ? B(t, "abap-timestamp") : null;
582
- }
583
- function rt(e) {
584
- let t = De.exec(e);
585
- if (!t) return null;
586
- let n = Number(t[1]), r = Number(t[2]), i = P(Number(t[3]), r, n);
587
- return i ? B(i, "abap-dotted") : null;
588
- }
589
- function it(e) {
590
- let t = Oe.exec(e);
591
- if (!t) return null;
592
- let n = Number(t[1]), r = Number(t[2]), i = P(Number(t[3]), n, r);
593
- return i ? B(i, "slash-date") : null;
594
- }
595
- function at(e, t = M) {
596
- let n = Se.exec(e);
597
- return n ? U(n[2].trim(), "odata-literal", t) : null;
598
- }
599
- function ot(e) {
600
- let t = ke.exec(e);
601
- if (!t) return null;
602
- let n = t[1] === "-" ? -1 : 1, r = Number(t[2] ?? 0), i = Number(t[3] ?? 0), a = Number(t[4] ?? 0), o = Number(t[5] ?? 0), s = Number(t[6] ?? 0), c = Number(t[7] ?? 0), l = (t[8] ?? "").slice(0, 3).padEnd(3, "0"), u = Number(l || 0);
603
- return r || i || a || o || s || c || u ? {
604
- kind: "duration",
605
- source: "iso-duration",
606
- durationMs: n * (r * Me * j + i * je * j + a * j + o * A + s * k + c * Ae + u)
607
- } : null;
608
- }
609
- function H(e, t) {
610
- return t ? {
611
- ...e,
612
- source: t
613
- } : e;
614
- }
615
- function U(e, t, n = M) {
616
- let r = et(e, n);
617
- if (r) return H(r, t);
618
- let i = V(e);
619
- if (i) return H(i, t);
620
- let a = rt(e);
621
- if (a) return H(a, t);
622
- let o = it(e);
623
- if (o) return H(o, t);
624
- let s = nt(e);
625
- if (s) return H(s, t);
626
- let c = tt(e);
627
- if (c) return H(c, t);
628
- let l = Number(e);
629
- if (/^-?\d+$/.test(e) && Number.isFinite(l)) {
630
- let e = Ze(l, n);
631
- if (e) return H(e, t);
632
- }
633
- return null;
634
- }
635
- function W(e) {
636
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
637
- }
638
- function st(e) {
639
- return e < Ne ? 2e3 + e : 1900 + e;
640
- }
641
- function G(e, t = "dd.MM.yyyy", n = {}) {
642
- if (typeof e != "string") return q(e);
643
- let i = e.trim();
644
- if (O.has(i.toLowerCase())) return null;
645
- let a = n.precision ?? "day", o = u(t, a), s = [], c = 0, l = "^", d = null;
646
- for (r.lastIndex = 0; (d = r.exec(o)) !== null;) l += W(o.slice(c, d.index)), s.push(d[0]), d[0] === "yyyy" ? l += "(\\d{4})" : l += "(\\d{2})", c = d.index + d[0].length;
647
- if (s.length === 0) return null;
648
- l += `${W(o.slice(c))}$`;
649
- let f = new RegExp(l).exec(i);
650
- if (!f) return null;
651
- let p = null, m = null, h = null, g = 0, _ = 0, v = 0;
652
- for (let e = 0; e < s.length; e += 1) {
653
- let t = s[e], n = f[e + 1], r = Number(n);
654
- if (!Number.isFinite(r)) return null;
655
- t === "yyyy" && (p = r), t === "yy" && (p = st(r)), t === "MM" && (m = r), t === "dd" && (h = r), t === "HH" && (g = r), t === "mm" && (_ = r), t === "ss" && (v = r);
656
- }
657
- if (!p || a !== "year" && !m || a === "day" && !h) return null;
658
- let y = P(p, m ?? 1, h ?? 1, g, _, v);
659
- return y ? B(y, "iso-local") : null;
660
- }
661
- function ct(e, t) {
662
- let n = E(e), r = Pe[e];
663
- return n?.pattern ? [u(n.pattern, t)] : r ? r.map((e) => u(e, t)) : !n && c(e) ? [u(e, t)] : [];
664
- }
665
- function lt(e, t, n = {}) {
666
- if (typeof e != "string") {
667
- let t = q(e);
668
- return t?.kind === "date-time" ? t : null;
669
- }
670
- let r = e.trim();
671
- if (O.has(r.toLowerCase())) return null;
672
- let i = n.precision ?? "day", a = D(t, n.defaultFormat ?? h.date);
673
- for (let e of ct(a, i)) {
674
- let t = G(r, e, { precision: i });
675
- if (t?.kind === "date-time") return t;
676
- }
677
- if (i === "day") {
678
- let e = q(r);
679
- if (e?.kind === "date-time") return e;
680
- }
681
- let o = E(a)?.locale ?? n.locale ?? m.locale;
682
- if (i === "day" && qe(a)) {
683
- let e = Ue(r, o, Ye(n.referenceDate));
684
- if (e) return e;
685
- }
686
- return i !== "year" && Je(a) ? We(r, o) : Ke(r, o, i);
687
- }
688
- function K(e, { mode: t = M } = {}) {
689
- if (e == null) return null;
690
- if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : B(t === "instant" ? new Date(e.getTime()) : Xe(e), "date-object");
691
- if (typeof e == "number") return Ze(e, t);
692
- if (typeof e != "string") return null;
693
- let n = e.trim();
694
- return O.has(n.toLowerCase()) ? null : Qe(n, t) || at(n, t) || ot(n) || U(n, void 0, t);
695
- }
696
- function q(e) {
697
- return K(e);
698
- }
699
- function J(e) {
700
- return K(e, { mode: "instant" });
701
- }
702
- function ut(e) {
703
- if (!e) return null;
704
- if (e.kind === "date-time") return e.date;
705
- let t = new Date(e.durationMs);
706
- return Number.isNaN(t.getTime()) ? null : z(t);
707
- }
708
- function dt(e) {
709
- return ut(q(e));
710
- }
711
- function ft(e) {
712
- return ut(J(e));
713
- }
714
- //#endregion
715
- //#region src/formatters/date/formatDate.ts
716
- var pt = /* @__PURE__ */ new WeakMap();
717
- function Y(e) {
718
- return String(e).padStart(2, "0");
719
- }
720
- function X(e) {
721
- if (typeof e != "string") {
722
- let t = pt.get(e);
723
- if (t) return t;
724
- let n = T(e);
725
- return pt.set(e, n), n;
726
- }
727
- let t = pe(e);
728
- if (!t) throw Error(`Предустановка даты "${e}" не найдена`);
729
- return t;
730
- }
731
- function Z(e, t) {
732
- return t?.fallback ?? e.invalidFallback;
733
- }
734
- function Q(e, t, n, r) {
735
- return e.kind === "duration" ? t.formatDuration ? t.formatDuration(e.durationMs, n) : n : t.formatDateTime(e.date, r);
736
- }
737
- function $(e, t = h.date, n) {
738
- let r = X(t), i = Z(r, n), a = n?.precision ?? "day", o = q(e);
739
- return o ? Q(o, r, i, a) : i;
740
- }
741
- function mt(e, t) {
742
- return $(e, h.date, t);
743
- }
744
- function ht(e, t) {
745
- return $(e, h.datetime, t);
746
- }
747
- function gt(e, t) {
748
- return $(e, h.time, t);
749
- }
750
- function _t(e, t) {
751
- return $(e, h.timeSeconds, t);
752
- }
753
- function vt(e, t) {
754
- return $(e, h.dateShort, t);
755
- }
756
- function yt(e, t) {
757
- return $(e, h.dateMedium, t);
758
- }
759
- function bt(e, t) {
760
- return $(e, h.dateLong, t);
761
- }
762
- function xt(e, t) {
763
- return $(e, h.monthShort, t);
764
- }
765
- function St(e, t) {
766
- return $(e, h.monthMedium, t);
767
- }
768
- function Ct(e, t) {
769
- return $(e, h.monthLong, t);
770
- }
771
- function wt(e, t) {
772
- return $(e, h.monthYearMedium, t);
773
- }
774
- function Tt(e, t) {
775
- return $(e, h.monthYearLong, t);
776
- }
777
- function Et(e, t) {
778
- return $(e, h.timeShort, t);
779
- }
780
- function Dt(e, t) {
781
- return $(e, h.timeMedium, t);
782
- }
783
- function Ot(e, t) {
784
- return $(e, h.timeLong, t);
785
- }
786
- function kt(e, t) {
787
- return $(e, h.datetimeShort, t);
788
- }
789
- function At(e, t) {
790
- return $(e, h.datetimeMedium, t);
791
- }
792
- function jt(e, t) {
793
- return $(e, h.datetimeLong, t);
794
- }
795
- function Mt(e, t, n = h.date, r) {
796
- let i = X(n), a = Z(i, r), o = r?.precision ?? "day", s = q(e), c = q(t);
797
- if (!s || !c) return a;
798
- let l = Q(s, i, a, o), u = Q(c, i, a, o);
799
- return !l || !u ? a : `${l} - ${u}`;
800
- }
801
- function Nt(e, t) {
802
- return $(e, h.abapYear, t);
803
- }
804
- function Pt(e, t) {
805
- return $(e, h.abapMonth, t);
806
- }
807
- function Ft(e, t) {
808
- return $(e, h.abapDate, t);
809
- }
810
- function It(e, t) {
811
- return $(e, h.abapDatetime, t);
812
- }
813
- function Lt(e, t) {
814
- return $(e, h.odataDate, t);
815
- }
816
- function Rt(e, t) {
817
- return $(e, h.odataDatetime, t);
818
- }
819
- function zt(e, t) {
820
- let n = t?.fallback ?? "", r = q(e);
821
- if (!r) return n;
822
- if (r.kind === "duration") {
823
- let e = X(h.timeSeconds).formatDuration?.(r.durationMs, n) ?? n;
824
- if (e === n) return n;
825
- let [t = "00", i = "00", a = "00"] = e.split(":");
826
- return `PT${t}H${i}M${a}S`;
827
- }
828
- let i = r.date;
829
- return `PT${Y(i.getHours())}H${Y(i.getMinutes())}M${Y(i.getSeconds())}S`;
830
- }
831
- //#endregion
832
- //#region src/odata/dateUtils.ts
833
- var Bt = {
834
- datetime(e) {
835
- return `datetime'${Rt(e)}'`;
836
- },
837
- datetimeOffset(e) {
838
- return `datetimeoffset'${e.toISOString()}'`;
839
- },
840
- time(e) {
841
- return `time'${zt(e)}'`;
842
- }
843
- };
844
- //#endregion
845
- export { lt as A, ge as B, gt as C, Et as D, _t as E, m as F, ve as G, ye as H, g as I, n as J, e as K, h as L, ft as M, q as N, Mt as O, J as P, E as R, zt as S, Dt as T, be as U, he as V, D as W, r as Y, xt as _, Pt as a, Lt as b, bt as c, ht as d, jt as f, St as g, Ct as h, It as i, G as j, dt as k, yt as l, kt as m, $ as n, Nt as o, At as p, t as q, Ft as r, mt as s, Bt as t, vt as u, Tt as v, Ot as w, Rt as x, wt as y, me as z };
846
-
847
- //# sourceMappingURL=dateUtils-B5V5aXB-.js.map