@sigtes/ui 0.3.1 → 0.3.2
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/Button-Blvd-lqJ.cjs +6 -0
- package/dist/Button-CjoUyDk1.js +329 -0
- package/dist/components/calendar/DatePicker.d.ts +3 -1
- package/dist/components/table/DataTable.d.ts +2 -1
- package/dist/components/table/ProductsTable.d.ts +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +455 -451
- package/dist/globals.css +1 -1
- package/dist/pages.cjs.js +6 -1
- package/dist/pages.es.js +1982 -35
- package/package.json +1 -1
- package/dist/providers.es-Dbo7mSRf.js +0 -2285
- package/dist/providers.es-c63iqHg7.cjs +0 -11
package/dist/pages.es.js
CHANGED
|
@@ -1,61 +1,2008 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { j as w, B as ot } from "./Button-CjoUyDk1.js";
|
|
3
|
+
import Xt, { useEffect as kt, createContext as Dt, useContext as Qt } from "react";
|
|
4
|
+
import "next-themes";
|
|
5
|
+
function $n({
|
|
6
|
+
error: n,
|
|
7
|
+
reset: e,
|
|
8
|
+
router: r
|
|
8
9
|
}) {
|
|
9
|
-
return
|
|
10
|
-
console.error(
|
|
11
|
-
}, [
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
10
|
+
return kt(() => {
|
|
11
|
+
console.error(n);
|
|
12
|
+
}, [n]), /* @__PURE__ */ w.jsx("div", { className: "h-screen w-screen flex", children: /* @__PURE__ */ w.jsxs("div", { className: "m-auto flex flex-col gap-3", children: [
|
|
13
|
+
/* @__PURE__ */ w.jsxs("div", { className: "inline-flex gap-5 items-center", children: [
|
|
14
|
+
/* @__PURE__ */ w.jsx("h1", { className: "text-2xl border-r-1 p-4", children: "500" }),
|
|
15
|
+
/* @__PURE__ */ w.jsx("h1", { children: "Um erro ocorreu!" })
|
|
15
16
|
] }),
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
17
|
+
/* @__PURE__ */ w.jsx(
|
|
18
|
+
ot,
|
|
18
19
|
{
|
|
19
20
|
onClick: () => {
|
|
20
|
-
|
|
21
|
+
e(), r.replace("/");
|
|
21
22
|
},
|
|
22
23
|
children: "Voltar ao Início"
|
|
23
24
|
}
|
|
24
25
|
)
|
|
25
26
|
] }) });
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
var et = { exports: {} }, E = {}, dt;
|
|
29
|
+
function Jt() {
|
|
30
|
+
if (dt) return E;
|
|
31
|
+
dt = 1;
|
|
32
|
+
var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
33
|
+
function r(t, o, a) {
|
|
34
|
+
var s = null;
|
|
35
|
+
if (a !== void 0 && (s = "" + a), o.key !== void 0 && (s = "" + o.key), "key" in o) {
|
|
36
|
+
a = {};
|
|
37
|
+
for (var u in o)
|
|
38
|
+
u !== "key" && (a[u] = o[u]);
|
|
39
|
+
} else a = o;
|
|
40
|
+
return o = a.ref, {
|
|
41
|
+
$$typeof: n,
|
|
42
|
+
type: t,
|
|
43
|
+
key: s,
|
|
44
|
+
ref: o !== void 0 ? o : null,
|
|
45
|
+
props: a
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return E.Fragment = e, E.jsx = r, E.jsxs = r, E;
|
|
49
|
+
}
|
|
50
|
+
var B = {}, ht;
|
|
51
|
+
function Vt() {
|
|
52
|
+
return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
53
|
+
function n(i) {
|
|
54
|
+
if (i == null) return null;
|
|
55
|
+
if (typeof i == "function")
|
|
56
|
+
return i.$$typeof === Bt ? null : i.displayName || i.name || null;
|
|
57
|
+
if (typeof i == "string") return i;
|
|
58
|
+
switch (i) {
|
|
59
|
+
case N:
|
|
60
|
+
return "Fragment";
|
|
61
|
+
case G:
|
|
62
|
+
return "Profiler";
|
|
63
|
+
case F:
|
|
64
|
+
return "StrictMode";
|
|
65
|
+
case _t:
|
|
66
|
+
return "Suspense";
|
|
67
|
+
case Zt:
|
|
68
|
+
return "SuspenseList";
|
|
69
|
+
case qt:
|
|
70
|
+
return "Activity";
|
|
71
|
+
}
|
|
72
|
+
if (typeof i == "object")
|
|
73
|
+
switch (typeof i.tag == "number" && console.error(
|
|
74
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
75
|
+
), i.$$typeof) {
|
|
76
|
+
case R:
|
|
77
|
+
return "Portal";
|
|
78
|
+
case zt:
|
|
79
|
+
return i.displayName || "Context";
|
|
80
|
+
case $:
|
|
81
|
+
return (i._context.displayName || "Context") + ".Consumer";
|
|
82
|
+
case It:
|
|
83
|
+
var c = i.render;
|
|
84
|
+
return i = i.displayName, i || (i = c.displayName || c.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
|
|
85
|
+
case At:
|
|
86
|
+
return c = i.displayName || null, c !== null ? c : n(i.type) || "Memo";
|
|
87
|
+
case X:
|
|
88
|
+
c = i._payload, i = i._init;
|
|
89
|
+
try {
|
|
90
|
+
return n(i(c));
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
function e(i) {
|
|
97
|
+
return "" + i;
|
|
98
|
+
}
|
|
99
|
+
function r(i) {
|
|
100
|
+
try {
|
|
101
|
+
e(i);
|
|
102
|
+
var c = !1;
|
|
103
|
+
} catch {
|
|
104
|
+
c = !0;
|
|
105
|
+
}
|
|
106
|
+
if (c) {
|
|
107
|
+
c = console;
|
|
108
|
+
var g = c.error, y = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
109
|
+
return g.call(
|
|
110
|
+
c,
|
|
111
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
112
|
+
y
|
|
113
|
+
), e(i);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function t(i) {
|
|
117
|
+
if (i === N) return "<>";
|
|
118
|
+
if (typeof i == "object" && i !== null && i.$$typeof === X)
|
|
119
|
+
return "<...>";
|
|
120
|
+
try {
|
|
121
|
+
var c = n(i);
|
|
122
|
+
return c ? "<" + c + ">" : "<...>";
|
|
123
|
+
} catch {
|
|
124
|
+
return "<...>";
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function o() {
|
|
128
|
+
var i = Q.A;
|
|
129
|
+
return i === null ? null : i.getOwner();
|
|
130
|
+
}
|
|
131
|
+
function a() {
|
|
132
|
+
return Error("react-stack-top-frame");
|
|
133
|
+
}
|
|
134
|
+
function s(i) {
|
|
135
|
+
if (at.call(i, "key")) {
|
|
136
|
+
var c = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
137
|
+
if (c && c.isReactWarning) return !1;
|
|
138
|
+
}
|
|
139
|
+
return i.key !== void 0;
|
|
140
|
+
}
|
|
141
|
+
function u(i, c) {
|
|
142
|
+
function g() {
|
|
143
|
+
it || (it = !0, console.error(
|
|
144
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
145
|
+
c
|
|
146
|
+
));
|
|
147
|
+
}
|
|
148
|
+
g.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
149
|
+
get: g,
|
|
150
|
+
configurable: !0
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function h() {
|
|
154
|
+
var i = n(this.type);
|
|
155
|
+
return st[i] || (st[i] = !0, console.error(
|
|
156
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
157
|
+
)), i = this.props.ref, i !== void 0 ? i : null;
|
|
158
|
+
}
|
|
159
|
+
function v(i, c, g, y, V, K) {
|
|
160
|
+
var b = g.ref;
|
|
161
|
+
return i = {
|
|
162
|
+
$$typeof: q,
|
|
163
|
+
type: i,
|
|
164
|
+
key: c,
|
|
165
|
+
props: g,
|
|
166
|
+
_owner: y
|
|
167
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(i, "ref", {
|
|
168
|
+
enumerable: !1,
|
|
169
|
+
get: h
|
|
170
|
+
}) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
171
|
+
configurable: !1,
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
writable: !0,
|
|
174
|
+
value: 0
|
|
175
|
+
}), Object.defineProperty(i, "_debugInfo", {
|
|
176
|
+
configurable: !1,
|
|
177
|
+
enumerable: !1,
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: null
|
|
180
|
+
}), Object.defineProperty(i, "_debugStack", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: V
|
|
185
|
+
}), Object.defineProperty(i, "_debugTask", {
|
|
186
|
+
configurable: !1,
|
|
187
|
+
enumerable: !1,
|
|
188
|
+
writable: !0,
|
|
189
|
+
value: K
|
|
190
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
191
|
+
}
|
|
192
|
+
function m(i, c, g, y, V, K) {
|
|
193
|
+
var b = c.children;
|
|
194
|
+
if (b !== void 0)
|
|
195
|
+
if (y)
|
|
196
|
+
if (Rt(b)) {
|
|
197
|
+
for (y = 0; y < b.length; y++)
|
|
198
|
+
f(b[y]);
|
|
199
|
+
Object.freeze && Object.freeze(b);
|
|
200
|
+
} else
|
|
201
|
+
console.error(
|
|
202
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
203
|
+
);
|
|
204
|
+
else f(b);
|
|
205
|
+
if (at.call(c, "key")) {
|
|
206
|
+
b = n(i);
|
|
207
|
+
var C = Object.keys(c).filter(function(Gt) {
|
|
208
|
+
return Gt !== "key";
|
|
209
|
+
});
|
|
210
|
+
y = 0 < C.length ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}", lt[b + y] || (C = 0 < C.length ? "{" + C.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
211
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
212
|
+
let props = %s;
|
|
213
|
+
<%s {...props} />
|
|
214
|
+
React keys must be passed directly to JSX without using spread:
|
|
215
|
+
let props = %s;
|
|
216
|
+
<%s key={someKey} {...props} />`,
|
|
217
|
+
y,
|
|
218
|
+
b,
|
|
219
|
+
C,
|
|
220
|
+
b
|
|
221
|
+
), lt[b + y] = !0);
|
|
222
|
+
}
|
|
223
|
+
if (b = null, g !== void 0 && (r(g), b = "" + g), s(c) && (r(c.key), b = "" + c.key), "key" in c) {
|
|
224
|
+
g = {};
|
|
225
|
+
for (var tt in c)
|
|
226
|
+
tt !== "key" && (g[tt] = c[tt]);
|
|
227
|
+
} else g = c;
|
|
228
|
+
return b && u(
|
|
229
|
+
g,
|
|
230
|
+
typeof i == "function" ? i.displayName || i.name || "Unknown" : i
|
|
231
|
+
), v(
|
|
232
|
+
i,
|
|
233
|
+
b,
|
|
234
|
+
g,
|
|
235
|
+
o(),
|
|
236
|
+
V,
|
|
237
|
+
K
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
function f(i) {
|
|
241
|
+
M(i) ? i._store && (i._store.validated = 1) : typeof i == "object" && i !== null && i.$$typeof === X && (i._payload.status === "fulfilled" ? M(i._payload.value) && i._payload.value._store && (i._payload.value._store.validated = 1) : i._store && (i._store.validated = 1));
|
|
242
|
+
}
|
|
243
|
+
function M(i) {
|
|
244
|
+
return typeof i == "object" && i !== null && i.$$typeof === q;
|
|
245
|
+
}
|
|
246
|
+
var k = Xt, q = /* @__PURE__ */ Symbol.for("react.transitional.element"), R = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), F = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), $ = /* @__PURE__ */ Symbol.for("react.consumer"), zt = /* @__PURE__ */ Symbol.for("react.context"), It = /* @__PURE__ */ Symbol.for("react.forward_ref"), _t = /* @__PURE__ */ Symbol.for("react.suspense"), Zt = /* @__PURE__ */ Symbol.for("react.suspense_list"), At = /* @__PURE__ */ Symbol.for("react.memo"), X = /* @__PURE__ */ Symbol.for("react.lazy"), qt = /* @__PURE__ */ Symbol.for("react.activity"), Bt = /* @__PURE__ */ Symbol.for("react.client.reference"), Q = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, at = Object.prototype.hasOwnProperty, Rt = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
247
|
+
return null;
|
|
248
|
+
};
|
|
249
|
+
k = {
|
|
250
|
+
react_stack_bottom_frame: function(i) {
|
|
251
|
+
return i();
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
var it, st = {}, ut = k.react_stack_bottom_frame.bind(
|
|
255
|
+
k,
|
|
256
|
+
a
|
|
257
|
+
)(), ct = J(t(a)), lt = {};
|
|
258
|
+
B.Fragment = N, B.jsx = function(i, c, g) {
|
|
259
|
+
var y = 1e4 > Q.recentlyCreatedOwnerStacks++;
|
|
260
|
+
return m(
|
|
261
|
+
i,
|
|
262
|
+
c,
|
|
263
|
+
g,
|
|
264
|
+
!1,
|
|
265
|
+
y ? Error("react-stack-top-frame") : ut,
|
|
266
|
+
y ? J(t(i)) : ct
|
|
267
|
+
);
|
|
268
|
+
}, B.jsxs = function(i, c, g) {
|
|
269
|
+
var y = 1e4 > Q.recentlyCreatedOwnerStacks++;
|
|
270
|
+
return m(
|
|
271
|
+
i,
|
|
272
|
+
c,
|
|
273
|
+
g,
|
|
274
|
+
!0,
|
|
275
|
+
y ? Error("react-stack-top-frame") : ut,
|
|
276
|
+
y ? J(t(i)) : ct
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
})()), B;
|
|
280
|
+
}
|
|
281
|
+
var ft;
|
|
282
|
+
function Kt() {
|
|
283
|
+
return ft || (ft = 1, process.env.NODE_ENV === "production" ? et.exports = Jt() : et.exports = Vt()), et.exports;
|
|
284
|
+
}
|
|
285
|
+
Kt();
|
|
286
|
+
const te = {
|
|
287
|
+
id: "",
|
|
288
|
+
username: "",
|
|
289
|
+
email: "",
|
|
290
|
+
created_at: null,
|
|
291
|
+
updated_at: null,
|
|
292
|
+
features: []
|
|
293
|
+
}, ee = Dt({
|
|
294
|
+
user: te,
|
|
295
|
+
isLoading: !0,
|
|
296
|
+
fetchUser: async () => {
|
|
297
|
+
},
|
|
298
|
+
logout: async () => {
|
|
299
|
+
},
|
|
300
|
+
login: async () => !1
|
|
301
|
+
});
|
|
302
|
+
function ne() {
|
|
303
|
+
return Qt(ee);
|
|
304
|
+
}
|
|
305
|
+
function nt(n) {
|
|
306
|
+
return (e = {}) => {
|
|
307
|
+
const r = e.width ? String(e.width) : n.defaultWidth;
|
|
308
|
+
return n.formats[r] || n.formats[n.defaultWidth];
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function L(n) {
|
|
312
|
+
return (e, r) => {
|
|
313
|
+
const t = r?.context ? String(r.context) : "standalone";
|
|
314
|
+
let o;
|
|
315
|
+
if (t === "formatting" && n.formattingValues) {
|
|
316
|
+
const s = n.defaultFormattingWidth || n.defaultWidth, u = r?.width ? String(r.width) : s;
|
|
317
|
+
o = n.formattingValues[u] || n.formattingValues[s];
|
|
318
|
+
} else {
|
|
319
|
+
const s = n.defaultWidth, u = r?.width ? String(r.width) : n.defaultWidth;
|
|
320
|
+
o = n.values[u] || n.values[s];
|
|
321
|
+
}
|
|
322
|
+
const a = n.argumentCallback ? n.argumentCallback(e) : e;
|
|
323
|
+
return o[a];
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function U(n) {
|
|
327
|
+
return (e, r = {}) => {
|
|
328
|
+
const t = r.width, o = t && n.matchPatterns[t] || n.matchPatterns[n.defaultMatchWidth], a = e.match(o);
|
|
329
|
+
if (!a)
|
|
330
|
+
return null;
|
|
331
|
+
const s = a[0], u = t && n.parsePatterns[t] || n.parsePatterns[n.defaultParseWidth], h = Array.isArray(u) ? oe(u, (f) => f.test(s)) : (
|
|
332
|
+
// [TODO] -- I challenge you to fix the type
|
|
333
|
+
re(u, (f) => f.test(s))
|
|
334
|
+
);
|
|
335
|
+
let v;
|
|
336
|
+
v = n.valueCallback ? n.valueCallback(h) : h, v = r.valueCallback ? (
|
|
337
|
+
// [TODO] -- I challenge you to fix the type
|
|
338
|
+
r.valueCallback(v)
|
|
339
|
+
) : v;
|
|
340
|
+
const m = e.slice(s.length);
|
|
341
|
+
return { value: v, rest: m };
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
function re(n, e) {
|
|
345
|
+
for (const r in n)
|
|
346
|
+
if (Object.prototype.hasOwnProperty.call(n, r) && e(n[r]))
|
|
347
|
+
return r;
|
|
348
|
+
}
|
|
349
|
+
function oe(n, e) {
|
|
350
|
+
for (let r = 0; r < n.length; r++)
|
|
351
|
+
if (e(n[r]))
|
|
352
|
+
return r;
|
|
353
|
+
}
|
|
354
|
+
function ae(n) {
|
|
355
|
+
return (e, r = {}) => {
|
|
356
|
+
const t = e.match(n.matchPattern);
|
|
357
|
+
if (!t) return null;
|
|
358
|
+
const o = t[0], a = e.match(n.parsePattern);
|
|
359
|
+
if (!a) return null;
|
|
360
|
+
let s = n.valueCallback ? n.valueCallback(a[0]) : a[0];
|
|
361
|
+
s = r.valueCallback ? r.valueCallback(s) : s;
|
|
362
|
+
const u = e.slice(o.length);
|
|
363
|
+
return { value: s, rest: u };
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const xt = 6048e5, ie = 864e5, mt = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
367
|
+
function p(n, e) {
|
|
368
|
+
return typeof n == "function" ? n(e) : n && typeof n == "object" && mt in n ? n[mt](e) : n instanceof Date ? new n.constructor(e) : new Date(e);
|
|
369
|
+
}
|
|
370
|
+
function j(n, ...e) {
|
|
371
|
+
const r = p.bind(
|
|
372
|
+
null,
|
|
373
|
+
e.find((t) => typeof t == "object")
|
|
374
|
+
);
|
|
375
|
+
return e.map(r);
|
|
376
|
+
}
|
|
377
|
+
let se = {};
|
|
378
|
+
function A() {
|
|
379
|
+
return se;
|
|
380
|
+
}
|
|
381
|
+
function d(n, e) {
|
|
382
|
+
return p(e || n, n);
|
|
383
|
+
}
|
|
384
|
+
function P(n, e) {
|
|
385
|
+
const r = A(), t = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = d(n, e?.in), a = o.getDay(), s = (a < t ? 7 : 0) + a - t;
|
|
386
|
+
return o.setDate(o.getDate() - s), o.setHours(0, 0, 0, 0), o;
|
|
387
|
+
}
|
|
388
|
+
const ue = {
|
|
389
|
+
lessThanXSeconds: {
|
|
390
|
+
one: "less than a second",
|
|
391
|
+
other: "less than {{count}} seconds"
|
|
392
|
+
},
|
|
393
|
+
xSeconds: {
|
|
394
|
+
one: "1 second",
|
|
395
|
+
other: "{{count}} seconds"
|
|
396
|
+
},
|
|
397
|
+
halfAMinute: "half a minute",
|
|
398
|
+
lessThanXMinutes: {
|
|
399
|
+
one: "less than a minute",
|
|
400
|
+
other: "less than {{count}} minutes"
|
|
401
|
+
},
|
|
402
|
+
xMinutes: {
|
|
403
|
+
one: "1 minute",
|
|
404
|
+
other: "{{count}} minutes"
|
|
405
|
+
},
|
|
406
|
+
aboutXHours: {
|
|
407
|
+
one: "about 1 hour",
|
|
408
|
+
other: "about {{count}} hours"
|
|
409
|
+
},
|
|
410
|
+
xHours: {
|
|
411
|
+
one: "1 hour",
|
|
412
|
+
other: "{{count}} hours"
|
|
413
|
+
},
|
|
414
|
+
xDays: {
|
|
415
|
+
one: "1 day",
|
|
416
|
+
other: "{{count}} days"
|
|
417
|
+
},
|
|
418
|
+
aboutXWeeks: {
|
|
419
|
+
one: "about 1 week",
|
|
420
|
+
other: "about {{count}} weeks"
|
|
421
|
+
},
|
|
422
|
+
xWeeks: {
|
|
423
|
+
one: "1 week",
|
|
424
|
+
other: "{{count}} weeks"
|
|
425
|
+
},
|
|
426
|
+
aboutXMonths: {
|
|
427
|
+
one: "about 1 month",
|
|
428
|
+
other: "about {{count}} months"
|
|
429
|
+
},
|
|
430
|
+
xMonths: {
|
|
431
|
+
one: "1 month",
|
|
432
|
+
other: "{{count}} months"
|
|
433
|
+
},
|
|
434
|
+
aboutXYears: {
|
|
435
|
+
one: "about 1 year",
|
|
436
|
+
other: "about {{count}} years"
|
|
437
|
+
},
|
|
438
|
+
xYears: {
|
|
439
|
+
one: "1 year",
|
|
440
|
+
other: "{{count}} years"
|
|
441
|
+
},
|
|
442
|
+
overXYears: {
|
|
443
|
+
one: "over 1 year",
|
|
444
|
+
other: "over {{count}} years"
|
|
445
|
+
},
|
|
446
|
+
almostXYears: {
|
|
447
|
+
one: "almost 1 year",
|
|
448
|
+
other: "almost {{count}} years"
|
|
449
|
+
}
|
|
450
|
+
}, ce = (n, e, r) => {
|
|
451
|
+
let t;
|
|
452
|
+
const o = ue[n];
|
|
453
|
+
return typeof o == "string" ? t = o : e === 1 ? t = o.one : t = o.other.replace("{{count}}", e.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + t : t + " ago" : t;
|
|
454
|
+
}, le = {
|
|
455
|
+
lastWeek: "'last' eeee 'at' p",
|
|
456
|
+
yesterday: "'yesterday at' p",
|
|
457
|
+
today: "'today at' p",
|
|
458
|
+
tomorrow: "'tomorrow at' p",
|
|
459
|
+
nextWeek: "eeee 'at' p",
|
|
460
|
+
other: "P"
|
|
461
|
+
}, de = (n, e, r, t) => le[n], he = {
|
|
462
|
+
narrow: ["B", "A"],
|
|
463
|
+
abbreviated: ["BC", "AD"],
|
|
464
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
465
|
+
}, fe = {
|
|
466
|
+
narrow: ["1", "2", "3", "4"],
|
|
467
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
468
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
469
|
+
}, me = {
|
|
470
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
471
|
+
abbreviated: [
|
|
472
|
+
"Jan",
|
|
473
|
+
"Feb",
|
|
474
|
+
"Mar",
|
|
475
|
+
"Apr",
|
|
476
|
+
"May",
|
|
477
|
+
"Jun",
|
|
478
|
+
"Jul",
|
|
479
|
+
"Aug",
|
|
480
|
+
"Sep",
|
|
481
|
+
"Oct",
|
|
482
|
+
"Nov",
|
|
483
|
+
"Dec"
|
|
484
|
+
],
|
|
485
|
+
wide: [
|
|
486
|
+
"January",
|
|
487
|
+
"February",
|
|
488
|
+
"March",
|
|
489
|
+
"April",
|
|
490
|
+
"May",
|
|
491
|
+
"June",
|
|
492
|
+
"July",
|
|
493
|
+
"August",
|
|
494
|
+
"September",
|
|
495
|
+
"October",
|
|
496
|
+
"November",
|
|
497
|
+
"December"
|
|
498
|
+
]
|
|
499
|
+
}, ge = {
|
|
500
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
501
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
502
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
503
|
+
wide: [
|
|
504
|
+
"Sunday",
|
|
505
|
+
"Monday",
|
|
506
|
+
"Tuesday",
|
|
507
|
+
"Wednesday",
|
|
508
|
+
"Thursday",
|
|
509
|
+
"Friday",
|
|
510
|
+
"Saturday"
|
|
511
|
+
]
|
|
512
|
+
}, pe = {
|
|
513
|
+
narrow: {
|
|
514
|
+
am: "a",
|
|
515
|
+
pm: "p",
|
|
516
|
+
midnight: "mi",
|
|
517
|
+
noon: "n",
|
|
518
|
+
morning: "morning",
|
|
519
|
+
afternoon: "afternoon",
|
|
520
|
+
evening: "evening",
|
|
521
|
+
night: "night"
|
|
522
|
+
},
|
|
523
|
+
abbreviated: {
|
|
524
|
+
am: "AM",
|
|
525
|
+
pm: "PM",
|
|
526
|
+
midnight: "midnight",
|
|
527
|
+
noon: "noon",
|
|
528
|
+
morning: "morning",
|
|
529
|
+
afternoon: "afternoon",
|
|
530
|
+
evening: "evening",
|
|
531
|
+
night: "night"
|
|
532
|
+
},
|
|
533
|
+
wide: {
|
|
534
|
+
am: "a.m.",
|
|
535
|
+
pm: "p.m.",
|
|
536
|
+
midnight: "midnight",
|
|
537
|
+
noon: "noon",
|
|
538
|
+
morning: "morning",
|
|
539
|
+
afternoon: "afternoon",
|
|
540
|
+
evening: "evening",
|
|
541
|
+
night: "night"
|
|
542
|
+
}
|
|
543
|
+
}, ye = {
|
|
544
|
+
narrow: {
|
|
545
|
+
am: "a",
|
|
546
|
+
pm: "p",
|
|
547
|
+
midnight: "mi",
|
|
548
|
+
noon: "n",
|
|
549
|
+
morning: "in the morning",
|
|
550
|
+
afternoon: "in the afternoon",
|
|
551
|
+
evening: "in the evening",
|
|
552
|
+
night: "at night"
|
|
553
|
+
},
|
|
554
|
+
abbreviated: {
|
|
555
|
+
am: "AM",
|
|
556
|
+
pm: "PM",
|
|
557
|
+
midnight: "midnight",
|
|
558
|
+
noon: "noon",
|
|
559
|
+
morning: "in the morning",
|
|
560
|
+
afternoon: "in the afternoon",
|
|
561
|
+
evening: "in the evening",
|
|
562
|
+
night: "at night"
|
|
563
|
+
},
|
|
564
|
+
wide: {
|
|
565
|
+
am: "a.m.",
|
|
566
|
+
pm: "p.m.",
|
|
567
|
+
midnight: "midnight",
|
|
568
|
+
noon: "noon",
|
|
569
|
+
morning: "in the morning",
|
|
570
|
+
afternoon: "in the afternoon",
|
|
571
|
+
evening: "in the evening",
|
|
572
|
+
night: "at night"
|
|
573
|
+
}
|
|
574
|
+
}, be = (n, e) => {
|
|
575
|
+
const r = Number(n), t = r % 100;
|
|
576
|
+
if (t > 20 || t < 10)
|
|
577
|
+
switch (t % 10) {
|
|
578
|
+
case 1:
|
|
579
|
+
return r + "st";
|
|
580
|
+
case 2:
|
|
581
|
+
return r + "nd";
|
|
582
|
+
case 3:
|
|
583
|
+
return r + "rd";
|
|
584
|
+
}
|
|
585
|
+
return r + "th";
|
|
586
|
+
}, we = {
|
|
587
|
+
ordinalNumber: be,
|
|
588
|
+
era: L({
|
|
589
|
+
values: he,
|
|
590
|
+
defaultWidth: "wide"
|
|
591
|
+
}),
|
|
592
|
+
quarter: L({
|
|
593
|
+
values: fe,
|
|
594
|
+
defaultWidth: "wide",
|
|
595
|
+
argumentCallback: (n) => n - 1
|
|
596
|
+
}),
|
|
597
|
+
month: L({
|
|
598
|
+
values: me,
|
|
599
|
+
defaultWidth: "wide"
|
|
600
|
+
}),
|
|
601
|
+
day: L({
|
|
602
|
+
values: ge,
|
|
603
|
+
defaultWidth: "wide"
|
|
604
|
+
}),
|
|
605
|
+
dayPeriod: L({
|
|
606
|
+
values: pe,
|
|
607
|
+
defaultWidth: "wide",
|
|
608
|
+
formattingValues: ye,
|
|
609
|
+
defaultFormattingWidth: "wide"
|
|
610
|
+
})
|
|
611
|
+
}, ve = /^(\d+)(th|st|nd|rd)?/i, Me = /\d+/i, Se = {
|
|
612
|
+
narrow: /^(b|a)/i,
|
|
613
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
614
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
615
|
+
}, ke = {
|
|
616
|
+
any: [/^b/i, /^(a|c)/i]
|
|
617
|
+
}, De = {
|
|
618
|
+
narrow: /^[1234]/i,
|
|
619
|
+
abbreviated: /^q[1234]/i,
|
|
620
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
621
|
+
}, xe = {
|
|
622
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
623
|
+
}, Oe = {
|
|
624
|
+
narrow: /^[jfmasond]/i,
|
|
625
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
626
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
627
|
+
}, Te = {
|
|
628
|
+
narrow: [
|
|
629
|
+
/^j/i,
|
|
630
|
+
/^f/i,
|
|
631
|
+
/^m/i,
|
|
632
|
+
/^a/i,
|
|
633
|
+
/^m/i,
|
|
634
|
+
/^j/i,
|
|
635
|
+
/^j/i,
|
|
636
|
+
/^a/i,
|
|
637
|
+
/^s/i,
|
|
638
|
+
/^o/i,
|
|
639
|
+
/^n/i,
|
|
640
|
+
/^d/i
|
|
641
|
+
],
|
|
642
|
+
any: [
|
|
643
|
+
/^ja/i,
|
|
644
|
+
/^f/i,
|
|
645
|
+
/^mar/i,
|
|
646
|
+
/^ap/i,
|
|
647
|
+
/^may/i,
|
|
648
|
+
/^jun/i,
|
|
649
|
+
/^jul/i,
|
|
650
|
+
/^au/i,
|
|
651
|
+
/^s/i,
|
|
652
|
+
/^o/i,
|
|
653
|
+
/^n/i,
|
|
654
|
+
/^d/i
|
|
655
|
+
]
|
|
656
|
+
}, Ne = {
|
|
657
|
+
narrow: /^[smtwf]/i,
|
|
658
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
659
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
660
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
661
|
+
}, Ce = {
|
|
662
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
663
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
664
|
+
}, Ye = {
|
|
665
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
666
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
667
|
+
}, We = {
|
|
668
|
+
any: {
|
|
669
|
+
am: /^a/i,
|
|
670
|
+
pm: /^p/i,
|
|
671
|
+
midnight: /^mi/i,
|
|
672
|
+
noon: /^no/i,
|
|
673
|
+
morning: /morning/i,
|
|
674
|
+
afternoon: /afternoon/i,
|
|
675
|
+
evening: /evening/i,
|
|
676
|
+
night: /night/i
|
|
677
|
+
}
|
|
678
|
+
}, Pe = {
|
|
679
|
+
ordinalNumber: ae({
|
|
680
|
+
matchPattern: ve,
|
|
681
|
+
parsePattern: Me,
|
|
682
|
+
valueCallback: (n) => parseInt(n, 10)
|
|
683
|
+
}),
|
|
684
|
+
era: U({
|
|
685
|
+
matchPatterns: Se,
|
|
686
|
+
defaultMatchWidth: "wide",
|
|
687
|
+
parsePatterns: ke,
|
|
688
|
+
defaultParseWidth: "any"
|
|
689
|
+
}),
|
|
690
|
+
quarter: U({
|
|
691
|
+
matchPatterns: De,
|
|
692
|
+
defaultMatchWidth: "wide",
|
|
693
|
+
parsePatterns: xe,
|
|
694
|
+
defaultParseWidth: "any",
|
|
695
|
+
valueCallback: (n) => n + 1
|
|
696
|
+
}),
|
|
697
|
+
month: U({
|
|
698
|
+
matchPatterns: Oe,
|
|
699
|
+
defaultMatchWidth: "wide",
|
|
700
|
+
parsePatterns: Te,
|
|
701
|
+
defaultParseWidth: "any"
|
|
702
|
+
}),
|
|
703
|
+
day: U({
|
|
704
|
+
matchPatterns: Ne,
|
|
705
|
+
defaultMatchWidth: "wide",
|
|
706
|
+
parsePatterns: Ce,
|
|
707
|
+
defaultParseWidth: "any"
|
|
708
|
+
}),
|
|
709
|
+
dayPeriod: U({
|
|
710
|
+
matchPatterns: Ye,
|
|
711
|
+
defaultMatchWidth: "any",
|
|
712
|
+
parsePatterns: We,
|
|
713
|
+
defaultParseWidth: "any"
|
|
714
|
+
})
|
|
715
|
+
}, je = {
|
|
716
|
+
full: "EEEE, MMMM do, y",
|
|
717
|
+
long: "MMMM do, y",
|
|
718
|
+
medium: "MMM d, y",
|
|
719
|
+
short: "MM/dd/yyyy"
|
|
720
|
+
}, Fe = {
|
|
721
|
+
full: "h:mm:ss a zzzz",
|
|
722
|
+
long: "h:mm:ss a z",
|
|
723
|
+
medium: "h:mm:ss a",
|
|
724
|
+
short: "h:mm a"
|
|
725
|
+
}, $e = {
|
|
726
|
+
full: "{{date}} 'at' {{time}}",
|
|
727
|
+
long: "{{date}} 'at' {{time}}",
|
|
728
|
+
medium: "{{date}}, {{time}}",
|
|
729
|
+
short: "{{date}}, {{time}}"
|
|
730
|
+
}, Ee = {
|
|
731
|
+
date: nt({
|
|
732
|
+
formats: je,
|
|
733
|
+
defaultWidth: "full"
|
|
734
|
+
}),
|
|
735
|
+
time: nt({
|
|
736
|
+
formats: Fe,
|
|
737
|
+
defaultWidth: "full"
|
|
738
|
+
}),
|
|
739
|
+
dateTime: nt({
|
|
740
|
+
formats: $e,
|
|
741
|
+
defaultWidth: "full"
|
|
742
|
+
})
|
|
743
|
+
}, W = {
|
|
744
|
+
code: "en-US",
|
|
745
|
+
formatDistance: ce,
|
|
746
|
+
formatLong: Ee,
|
|
747
|
+
formatRelative: de,
|
|
748
|
+
localize: we,
|
|
749
|
+
match: Pe,
|
|
750
|
+
options: {
|
|
751
|
+
weekStartsOn: 0,
|
|
752
|
+
firstWeekContainsDate: 1
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
function Le(n, e, r = "long") {
|
|
756
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
757
|
+
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
758
|
+
hour: "numeric",
|
|
759
|
+
timeZone: n,
|
|
760
|
+
timeZoneName: r
|
|
761
|
+
}).format(e).split(/\s/g).slice(2).join(" ");
|
|
762
|
+
}
|
|
763
|
+
const Ue = {}, H = {};
|
|
764
|
+
function O(n, e) {
|
|
765
|
+
try {
|
|
766
|
+
const r = (Ue[n] ||= new Intl.DateTimeFormat("en-US", {
|
|
767
|
+
timeZone: n,
|
|
768
|
+
timeZoneName: "longOffset"
|
|
769
|
+
}).format)(e).split("GMT")[1];
|
|
770
|
+
return r in H ? H[r] : gt(r, r.split(":"));
|
|
771
|
+
} catch {
|
|
772
|
+
if (n in H) return H[n];
|
|
773
|
+
const r = n?.match(He);
|
|
774
|
+
return r ? gt(n, r.slice(1)) : NaN;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
const He = /([+-]\d\d):?(\d\d)?/;
|
|
778
|
+
function gt(n, e) {
|
|
779
|
+
const r = +(e[0] || 0), t = +(e[1] || 0), o = +(e[2] || 0) / 60;
|
|
780
|
+
return H[n] = r * 60 + t > 0 ? r * 60 + t + o : r * 60 - t - o;
|
|
781
|
+
}
|
|
782
|
+
class S extends Date {
|
|
783
|
+
//#region static
|
|
784
|
+
constructor(...e) {
|
|
785
|
+
super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(O(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), Ot(this), rt(this)) : this.setTime(Date.now());
|
|
786
|
+
}
|
|
787
|
+
static tz(e, ...r) {
|
|
788
|
+
return r.length ? new S(...r, e) : new S(Date.now(), e);
|
|
789
|
+
}
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region time zone
|
|
792
|
+
withTimeZone(e) {
|
|
793
|
+
return new S(+this, e);
|
|
794
|
+
}
|
|
795
|
+
getTimezoneOffset() {
|
|
796
|
+
const e = -O(this.timeZone, this);
|
|
797
|
+
return e > 0 ? Math.floor(e) : Math.ceil(e);
|
|
798
|
+
}
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region time
|
|
801
|
+
setTime(e) {
|
|
802
|
+
return Date.prototype.setTime.apply(this, arguments), rt(this), +this;
|
|
803
|
+
}
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region date-fns integration
|
|
806
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](e) {
|
|
807
|
+
return new S(+new Date(e), this.timeZone);
|
|
808
|
+
}
|
|
809
|
+
//#endregion
|
|
810
|
+
}
|
|
811
|
+
const pt = /^(get|set)(?!UTC)/;
|
|
812
|
+
Object.getOwnPropertyNames(Date.prototype).forEach((n) => {
|
|
813
|
+
if (!pt.test(n)) return;
|
|
814
|
+
const e = n.replace(pt, "$1UTC");
|
|
815
|
+
S.prototype[e] && (n.startsWith("get") ? S.prototype[n] = function() {
|
|
816
|
+
return this.internal[e]();
|
|
817
|
+
} : (S.prototype[n] = function() {
|
|
818
|
+
return Date.prototype[e].apply(this.internal, arguments), ze(this), +this;
|
|
819
|
+
}, S.prototype[e] = function() {
|
|
820
|
+
return Date.prototype[e].apply(this, arguments), rt(this), +this;
|
|
821
|
+
}));
|
|
822
|
+
});
|
|
823
|
+
function rt(n) {
|
|
824
|
+
n.internal.setTime(+n), n.internal.setUTCSeconds(n.internal.getUTCSeconds() - Math.round(-O(n.timeZone, n) * 60));
|
|
825
|
+
}
|
|
826
|
+
function ze(n) {
|
|
827
|
+
Date.prototype.setFullYear.call(n, n.internal.getUTCFullYear(), n.internal.getUTCMonth(), n.internal.getUTCDate()), Date.prototype.setHours.call(n, n.internal.getUTCHours(), n.internal.getUTCMinutes(), n.internal.getUTCSeconds(), n.internal.getUTCMilliseconds()), Ot(n);
|
|
828
|
+
}
|
|
829
|
+
function Ot(n) {
|
|
830
|
+
const e = O(n.timeZone, n), r = e > 0 ? Math.floor(e) : Math.ceil(e), t = /* @__PURE__ */ new Date(+n);
|
|
831
|
+
t.setUTCHours(t.getUTCHours() - 1);
|
|
832
|
+
const o = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), s = o - a, u = Date.prototype.getHours.apply(n) !== n.internal.getUTCHours();
|
|
833
|
+
s && u && n.internal.setUTCMinutes(n.internal.getUTCMinutes() + s);
|
|
834
|
+
const h = o - r;
|
|
835
|
+
h && Date.prototype.setUTCMinutes.call(n, Date.prototype.getUTCMinutes.call(n) + h);
|
|
836
|
+
const v = /* @__PURE__ */ new Date(+n);
|
|
837
|
+
v.setUTCSeconds(0);
|
|
838
|
+
const m = o > 0 ? v.getSeconds() : (v.getSeconds() - 60) % 60, f = Math.round(-(O(n.timeZone, n) * 60)) % 60;
|
|
839
|
+
(f || m) && (n.internal.setUTCSeconds(n.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(n, Date.prototype.getUTCSeconds.call(n) + f + m));
|
|
840
|
+
const M = O(n.timeZone, n), k = M > 0 ? Math.floor(M) : Math.ceil(M), q = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset() - k, R = k !== r, N = q - h;
|
|
841
|
+
if (R && N) {
|
|
842
|
+
Date.prototype.setUTCMinutes.call(n, Date.prototype.getUTCMinutes.call(n) + N);
|
|
843
|
+
const F = O(n.timeZone, n), G = F > 0 ? Math.floor(F) : Math.ceil(F), $ = k - G;
|
|
844
|
+
$ && (n.internal.setUTCMinutes(n.internal.getUTCMinutes() + $), Date.prototype.setUTCMinutes.call(n, Date.prototype.getUTCMinutes.call(n) + $));
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
class T extends S {
|
|
848
|
+
//#region static
|
|
849
|
+
static tz(e, ...r) {
|
|
850
|
+
return r.length ? new T(...r, e) : new T(Date.now(), e);
|
|
851
|
+
}
|
|
852
|
+
//#endregion
|
|
853
|
+
//#region representation
|
|
854
|
+
toISOString() {
|
|
855
|
+
const [e, r, t] = this.tzComponents(), o = `${e}${r}:${t}`;
|
|
856
|
+
return this.internal.toISOString().slice(0, -1) + o;
|
|
857
|
+
}
|
|
858
|
+
toString() {
|
|
859
|
+
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
860
|
+
}
|
|
861
|
+
toDateString() {
|
|
862
|
+
const [e, r, t, o] = this.internal.toUTCString().split(" ");
|
|
863
|
+
return `${e?.slice(0, -1)} ${t} ${r} ${o}`;
|
|
864
|
+
}
|
|
865
|
+
toTimeString() {
|
|
866
|
+
const e = this.internal.toUTCString().split(" ")[4], [r, t, o] = this.tzComponents();
|
|
867
|
+
return `${e} GMT${r}${t}${o} (${Le(this.timeZone, this)})`;
|
|
868
|
+
}
|
|
869
|
+
toLocaleString(e, r) {
|
|
870
|
+
return Date.prototype.toLocaleString.call(this, e, {
|
|
871
|
+
...r,
|
|
872
|
+
timeZone: r?.timeZone || this.timeZone
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
toLocaleDateString(e, r) {
|
|
876
|
+
return Date.prototype.toLocaleDateString.call(this, e, {
|
|
877
|
+
...r,
|
|
878
|
+
timeZone: r?.timeZone || this.timeZone
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
toLocaleTimeString(e, r) {
|
|
882
|
+
return Date.prototype.toLocaleTimeString.call(this, e, {
|
|
883
|
+
...r,
|
|
884
|
+
timeZone: r?.timeZone || this.timeZone
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region private
|
|
889
|
+
tzComponents() {
|
|
890
|
+
const e = this.getTimezoneOffset(), r = e > 0 ? "-" : "+", t = String(Math.floor(Math.abs(e) / 60)).padStart(2, "0"), o = String(Math.abs(e) % 60).padStart(2, "0");
|
|
891
|
+
return [r, t, o];
|
|
892
|
+
}
|
|
893
|
+
//#endregion
|
|
894
|
+
withTimeZone(e) {
|
|
895
|
+
return new T(+this, e);
|
|
896
|
+
}
|
|
897
|
+
//#region date-fns integration
|
|
898
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](e) {
|
|
899
|
+
return new T(+new Date(e), this.timeZone);
|
|
900
|
+
}
|
|
901
|
+
//#endregion
|
|
902
|
+
}
|
|
903
|
+
function Tt(n, e, r) {
|
|
904
|
+
const t = d(n, r?.in);
|
|
905
|
+
return isNaN(e) ? p(n, NaN) : (e && t.setDate(t.getDate() + e), t);
|
|
906
|
+
}
|
|
907
|
+
function Nt(n, e, r) {
|
|
908
|
+
const t = d(n, r?.in);
|
|
909
|
+
if (isNaN(e)) return p(n, NaN);
|
|
910
|
+
if (!e)
|
|
911
|
+
return t;
|
|
912
|
+
const o = t.getDate(), a = p(n, t.getTime());
|
|
913
|
+
a.setMonth(t.getMonth() + e + 1, 0);
|
|
914
|
+
const s = a.getDate();
|
|
915
|
+
return o >= s ? a : (t.setFullYear(
|
|
916
|
+
a.getFullYear(),
|
|
917
|
+
a.getMonth(),
|
|
918
|
+
o
|
|
919
|
+
), t);
|
|
920
|
+
}
|
|
921
|
+
function I(n, e) {
|
|
922
|
+
return P(n, { ...e, weekStartsOn: 1 });
|
|
923
|
+
}
|
|
924
|
+
function Ct(n, e) {
|
|
925
|
+
const r = d(n, e?.in), t = r.getFullYear(), o = p(r, 0);
|
|
926
|
+
o.setFullYear(t + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
927
|
+
const a = I(o), s = p(r, 0);
|
|
928
|
+
s.setFullYear(t, 0, 4), s.setHours(0, 0, 0, 0);
|
|
929
|
+
const u = I(s);
|
|
930
|
+
return r.getTime() >= a.getTime() ? t + 1 : r.getTime() >= u.getTime() ? t : t - 1;
|
|
931
|
+
}
|
|
932
|
+
function yt(n) {
|
|
933
|
+
const e = d(n), r = new Date(
|
|
934
|
+
Date.UTC(
|
|
935
|
+
e.getFullYear(),
|
|
936
|
+
e.getMonth(),
|
|
937
|
+
e.getDate(),
|
|
938
|
+
e.getHours(),
|
|
939
|
+
e.getMinutes(),
|
|
940
|
+
e.getSeconds(),
|
|
941
|
+
e.getMilliseconds()
|
|
942
|
+
)
|
|
943
|
+
);
|
|
944
|
+
return r.setUTCFullYear(e.getFullYear()), +n - +r;
|
|
945
|
+
}
|
|
946
|
+
function _(n, e) {
|
|
947
|
+
const r = d(n, e?.in);
|
|
948
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
949
|
+
}
|
|
950
|
+
function Yt(n, e, r) {
|
|
951
|
+
const [t, o] = j(
|
|
952
|
+
r?.in,
|
|
953
|
+
n,
|
|
954
|
+
e
|
|
955
|
+
), a = _(t), s = _(o), u = +a - yt(a), h = +s - yt(s);
|
|
956
|
+
return Math.round((u - h) / ie);
|
|
957
|
+
}
|
|
958
|
+
function Ie(n, e) {
|
|
959
|
+
const r = Ct(n, e), t = p(n, 0);
|
|
960
|
+
return t.setFullYear(r, 0, 4), t.setHours(0, 0, 0, 0), I(t);
|
|
961
|
+
}
|
|
962
|
+
function _e(n, e, r) {
|
|
963
|
+
return Tt(n, e * 7, r);
|
|
964
|
+
}
|
|
965
|
+
function Ze(n, e, r) {
|
|
966
|
+
return Nt(n, e * 12, r);
|
|
967
|
+
}
|
|
968
|
+
function Ae(n, e) {
|
|
969
|
+
let r, t = e?.in;
|
|
970
|
+
return n.forEach((o) => {
|
|
971
|
+
!t && typeof o == "object" && (t = p.bind(null, o));
|
|
972
|
+
const a = d(o, t);
|
|
973
|
+
(!r || r < a || isNaN(+a)) && (r = a);
|
|
974
|
+
}), p(t, r || NaN);
|
|
975
|
+
}
|
|
976
|
+
function qe(n, e) {
|
|
977
|
+
let r, t = e?.in;
|
|
978
|
+
return n.forEach((o) => {
|
|
979
|
+
!t && typeof o == "object" && (t = p.bind(null, o));
|
|
980
|
+
const a = d(o, t);
|
|
981
|
+
(!r || r > a || isNaN(+a)) && (r = a);
|
|
982
|
+
}), p(t, r || NaN);
|
|
983
|
+
}
|
|
984
|
+
function Be(n, e, r) {
|
|
985
|
+
const [t, o] = j(
|
|
986
|
+
r?.in,
|
|
987
|
+
n,
|
|
988
|
+
e
|
|
989
|
+
);
|
|
990
|
+
return +_(t) == +_(o);
|
|
991
|
+
}
|
|
992
|
+
function Wt(n) {
|
|
993
|
+
return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
|
|
994
|
+
}
|
|
995
|
+
function Re(n) {
|
|
996
|
+
return !(!Wt(n) && typeof n != "number" || isNaN(+d(n)));
|
|
997
|
+
}
|
|
998
|
+
function Ge(n, e, r) {
|
|
999
|
+
const [t, o] = j(
|
|
1000
|
+
r?.in,
|
|
1001
|
+
n,
|
|
1002
|
+
e
|
|
1003
|
+
), a = t.getFullYear() - o.getFullYear(), s = t.getMonth() - o.getMonth();
|
|
1004
|
+
return a * 12 + s;
|
|
1005
|
+
}
|
|
1006
|
+
function Xe(n, e) {
|
|
1007
|
+
const r = d(n, e?.in), t = r.getMonth();
|
|
1008
|
+
return r.setFullYear(r.getFullYear(), t + 1, 0), r.setHours(23, 59, 59, 999), r;
|
|
1009
|
+
}
|
|
1010
|
+
function Pt(n, e) {
|
|
1011
|
+
const [r, t] = j(n, e.start, e.end);
|
|
1012
|
+
return { start: r, end: t };
|
|
1013
|
+
}
|
|
1014
|
+
function Qe(n, e) {
|
|
1015
|
+
const { start: r, end: t } = Pt(e?.in, n);
|
|
1016
|
+
let o = +r > +t;
|
|
1017
|
+
const a = o ? +r : +t, s = o ? t : r;
|
|
1018
|
+
s.setHours(0, 0, 0, 0), s.setDate(1);
|
|
1019
|
+
let u = 1;
|
|
1020
|
+
const h = [];
|
|
1021
|
+
for (; +s <= a; )
|
|
1022
|
+
h.push(p(r, s)), s.setMonth(s.getMonth() + u);
|
|
1023
|
+
return o ? h.reverse() : h;
|
|
1024
|
+
}
|
|
1025
|
+
function Je(n, e) {
|
|
1026
|
+
const r = d(n, e?.in);
|
|
1027
|
+
return r.setDate(1), r.setHours(0, 0, 0, 0), r;
|
|
1028
|
+
}
|
|
1029
|
+
function Ve(n, e) {
|
|
1030
|
+
const r = d(n, e?.in), t = r.getFullYear();
|
|
1031
|
+
return r.setFullYear(t + 1, 0, 0), r.setHours(23, 59, 59, 999), r;
|
|
1032
|
+
}
|
|
1033
|
+
function jt(n, e) {
|
|
1034
|
+
const r = d(n, e?.in);
|
|
1035
|
+
return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
1036
|
+
}
|
|
1037
|
+
function Ke(n, e) {
|
|
1038
|
+
const { start: r, end: t } = Pt(e?.in, n);
|
|
1039
|
+
let o = +r > +t;
|
|
1040
|
+
const a = o ? +r : +t, s = o ? t : r;
|
|
1041
|
+
s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
|
|
1042
|
+
let u = 1;
|
|
1043
|
+
const h = [];
|
|
1044
|
+
for (; +s <= a; )
|
|
1045
|
+
h.push(p(r, s)), s.setFullYear(s.getFullYear() + u);
|
|
1046
|
+
return o ? h.reverse() : h;
|
|
1047
|
+
}
|
|
1048
|
+
function Ft(n, e) {
|
|
1049
|
+
const r = A(), t = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = d(n, e?.in), a = o.getDay(), s = (a < t ? -7 : 0) + 6 - (a - t);
|
|
1050
|
+
return o.setDate(o.getDate() + s), o.setHours(23, 59, 59, 999), o;
|
|
1051
|
+
}
|
|
1052
|
+
function tn(n, e) {
|
|
1053
|
+
return Ft(n, { ...e, weekStartsOn: 1 });
|
|
1054
|
+
}
|
|
1055
|
+
function en(n, e) {
|
|
1056
|
+
const r = d(n, e?.in);
|
|
1057
|
+
return Yt(r, jt(r)) + 1;
|
|
1058
|
+
}
|
|
1059
|
+
function $t(n, e) {
|
|
1060
|
+
const r = d(n, e?.in), t = +I(r) - +Ie(r);
|
|
1061
|
+
return Math.round(t / xt) + 1;
|
|
1062
|
+
}
|
|
1063
|
+
function Et(n, e) {
|
|
1064
|
+
const r = d(n, e?.in), t = r.getFullYear(), o = A(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, s = p(e?.in || n, 0);
|
|
1065
|
+
s.setFullYear(t + 1, 0, a), s.setHours(0, 0, 0, 0);
|
|
1066
|
+
const u = P(s, e), h = p(e?.in || n, 0);
|
|
1067
|
+
h.setFullYear(t, 0, a), h.setHours(0, 0, 0, 0);
|
|
1068
|
+
const v = P(h, e);
|
|
1069
|
+
return +r >= +u ? t + 1 : +r >= +v ? t : t - 1;
|
|
1070
|
+
}
|
|
1071
|
+
function nn(n, e) {
|
|
1072
|
+
const r = A(), t = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Et(n, e), a = p(e?.in || n, 0);
|
|
1073
|
+
return a.setFullYear(o, 0, t), a.setHours(0, 0, 0, 0), P(a, e);
|
|
1074
|
+
}
|
|
1075
|
+
function Lt(n, e) {
|
|
1076
|
+
const r = d(n, e?.in), t = +P(r, e) - +nn(r, e);
|
|
1077
|
+
return Math.round(t / xt) + 1;
|
|
1078
|
+
}
|
|
1079
|
+
function l(n, e) {
|
|
1080
|
+
const r = n < 0 ? "-" : "", t = Math.abs(n).toString().padStart(e, "0");
|
|
1081
|
+
return r + t;
|
|
1082
|
+
}
|
|
1083
|
+
const D = {
|
|
1084
|
+
// Year
|
|
1085
|
+
y(n, e) {
|
|
1086
|
+
const r = n.getFullYear(), t = r > 0 ? r : 1 - r;
|
|
1087
|
+
return l(e === "yy" ? t % 100 : t, e.length);
|
|
1088
|
+
},
|
|
1089
|
+
// Month
|
|
1090
|
+
M(n, e) {
|
|
1091
|
+
const r = n.getMonth();
|
|
1092
|
+
return e === "M" ? String(r + 1) : l(r + 1, 2);
|
|
1093
|
+
},
|
|
1094
|
+
// Day of the month
|
|
1095
|
+
d(n, e) {
|
|
1096
|
+
return l(n.getDate(), e.length);
|
|
1097
|
+
},
|
|
1098
|
+
// AM or PM
|
|
1099
|
+
a(n, e) {
|
|
1100
|
+
const r = n.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1101
|
+
switch (e) {
|
|
1102
|
+
case "a":
|
|
1103
|
+
case "aa":
|
|
1104
|
+
return r.toUpperCase();
|
|
1105
|
+
case "aaa":
|
|
1106
|
+
return r;
|
|
1107
|
+
case "aaaaa":
|
|
1108
|
+
return r[0];
|
|
1109
|
+
default:
|
|
1110
|
+
return r === "am" ? "a.m." : "p.m.";
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
// Hour [1-12]
|
|
1114
|
+
h(n, e) {
|
|
1115
|
+
return l(n.getHours() % 12 || 12, e.length);
|
|
1116
|
+
},
|
|
1117
|
+
// Hour [0-23]
|
|
1118
|
+
H(n, e) {
|
|
1119
|
+
return l(n.getHours(), e.length);
|
|
1120
|
+
},
|
|
1121
|
+
// Minute
|
|
1122
|
+
m(n, e) {
|
|
1123
|
+
return l(n.getMinutes(), e.length);
|
|
1124
|
+
},
|
|
1125
|
+
// Second
|
|
1126
|
+
s(n, e) {
|
|
1127
|
+
return l(n.getSeconds(), e.length);
|
|
1128
|
+
},
|
|
1129
|
+
// Fraction of second
|
|
1130
|
+
S(n, e) {
|
|
1131
|
+
const r = e.length, t = n.getMilliseconds(), o = Math.trunc(
|
|
1132
|
+
t * Math.pow(10, r - 3)
|
|
1133
|
+
);
|
|
1134
|
+
return l(o, e.length);
|
|
1135
|
+
}
|
|
1136
|
+
}, Y = {
|
|
1137
|
+
midnight: "midnight",
|
|
1138
|
+
noon: "noon",
|
|
1139
|
+
morning: "morning",
|
|
1140
|
+
afternoon: "afternoon",
|
|
1141
|
+
evening: "evening",
|
|
1142
|
+
night: "night"
|
|
1143
|
+
}, bt = {
|
|
1144
|
+
// Era
|
|
1145
|
+
G: function(n, e, r) {
|
|
1146
|
+
const t = n.getFullYear() > 0 ? 1 : 0;
|
|
1147
|
+
switch (e) {
|
|
1148
|
+
// AD, BC
|
|
1149
|
+
case "G":
|
|
1150
|
+
case "GG":
|
|
1151
|
+
case "GGG":
|
|
1152
|
+
return r.era(t, { width: "abbreviated" });
|
|
1153
|
+
// A, B
|
|
1154
|
+
case "GGGGG":
|
|
1155
|
+
return r.era(t, { width: "narrow" });
|
|
1156
|
+
default:
|
|
1157
|
+
return r.era(t, { width: "wide" });
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
// Year
|
|
1161
|
+
y: function(n, e, r) {
|
|
1162
|
+
if (e === "yo") {
|
|
1163
|
+
const t = n.getFullYear(), o = t > 0 ? t : 1 - t;
|
|
1164
|
+
return r.ordinalNumber(o, { unit: "year" });
|
|
1165
|
+
}
|
|
1166
|
+
return D.y(n, e);
|
|
1167
|
+
},
|
|
1168
|
+
// Local week-numbering year
|
|
1169
|
+
Y: function(n, e, r, t) {
|
|
1170
|
+
const o = Et(n, t), a = o > 0 ? o : 1 - o;
|
|
1171
|
+
if (e === "YY") {
|
|
1172
|
+
const s = a % 100;
|
|
1173
|
+
return l(s, 2);
|
|
1174
|
+
}
|
|
1175
|
+
return e === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : l(a, e.length);
|
|
1176
|
+
},
|
|
1177
|
+
// ISO week-numbering year
|
|
1178
|
+
R: function(n, e) {
|
|
1179
|
+
const r = Ct(n);
|
|
1180
|
+
return l(r, e.length);
|
|
1181
|
+
},
|
|
1182
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
1183
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
1184
|
+
// | Year | `y` | `u` |
|
|
1185
|
+
// |------|-----|-----|
|
|
1186
|
+
// | AC 1 | 1 | 1 |
|
|
1187
|
+
// | BC 1 | 1 | 0 |
|
|
1188
|
+
// | BC 2 | 2 | -1 |
|
|
1189
|
+
// Also `yy` always returns the last two digits of a year,
|
|
1190
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
1191
|
+
u: function(n, e) {
|
|
1192
|
+
const r = n.getFullYear();
|
|
1193
|
+
return l(r, e.length);
|
|
1194
|
+
},
|
|
1195
|
+
// Quarter
|
|
1196
|
+
Q: function(n, e, r) {
|
|
1197
|
+
const t = Math.ceil((n.getMonth() + 1) / 3);
|
|
1198
|
+
switch (e) {
|
|
1199
|
+
// 1, 2, 3, 4
|
|
1200
|
+
case "Q":
|
|
1201
|
+
return String(t);
|
|
1202
|
+
// 01, 02, 03, 04
|
|
1203
|
+
case "QQ":
|
|
1204
|
+
return l(t, 2);
|
|
1205
|
+
// 1st, 2nd, 3rd, 4th
|
|
1206
|
+
case "Qo":
|
|
1207
|
+
return r.ordinalNumber(t, { unit: "quarter" });
|
|
1208
|
+
// Q1, Q2, Q3, Q4
|
|
1209
|
+
case "QQQ":
|
|
1210
|
+
return r.quarter(t, {
|
|
1211
|
+
width: "abbreviated",
|
|
1212
|
+
context: "formatting"
|
|
1213
|
+
});
|
|
1214
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1215
|
+
case "QQQQQ":
|
|
1216
|
+
return r.quarter(t, {
|
|
1217
|
+
width: "narrow",
|
|
1218
|
+
context: "formatting"
|
|
1219
|
+
});
|
|
1220
|
+
default:
|
|
1221
|
+
return r.quarter(t, {
|
|
1222
|
+
width: "wide",
|
|
1223
|
+
context: "formatting"
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
// Stand-alone quarter
|
|
1228
|
+
q: function(n, e, r) {
|
|
1229
|
+
const t = Math.ceil((n.getMonth() + 1) / 3);
|
|
1230
|
+
switch (e) {
|
|
1231
|
+
// 1, 2, 3, 4
|
|
1232
|
+
case "q":
|
|
1233
|
+
return String(t);
|
|
1234
|
+
// 01, 02, 03, 04
|
|
1235
|
+
case "qq":
|
|
1236
|
+
return l(t, 2);
|
|
1237
|
+
// 1st, 2nd, 3rd, 4th
|
|
1238
|
+
case "qo":
|
|
1239
|
+
return r.ordinalNumber(t, { unit: "quarter" });
|
|
1240
|
+
// Q1, Q2, Q3, Q4
|
|
1241
|
+
case "qqq":
|
|
1242
|
+
return r.quarter(t, {
|
|
1243
|
+
width: "abbreviated",
|
|
1244
|
+
context: "standalone"
|
|
1245
|
+
});
|
|
1246
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1247
|
+
case "qqqqq":
|
|
1248
|
+
return r.quarter(t, {
|
|
1249
|
+
width: "narrow",
|
|
1250
|
+
context: "standalone"
|
|
1251
|
+
});
|
|
1252
|
+
default:
|
|
1253
|
+
return r.quarter(t, {
|
|
1254
|
+
width: "wide",
|
|
1255
|
+
context: "standalone"
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
// Month
|
|
1260
|
+
M: function(n, e, r) {
|
|
1261
|
+
const t = n.getMonth();
|
|
1262
|
+
switch (e) {
|
|
1263
|
+
case "M":
|
|
1264
|
+
case "MM":
|
|
1265
|
+
return D.M(n, e);
|
|
1266
|
+
// 1st, 2nd, ..., 12th
|
|
1267
|
+
case "Mo":
|
|
1268
|
+
return r.ordinalNumber(t + 1, { unit: "month" });
|
|
1269
|
+
// Jan, Feb, ..., Dec
|
|
1270
|
+
case "MMM":
|
|
1271
|
+
return r.month(t, {
|
|
1272
|
+
width: "abbreviated",
|
|
1273
|
+
context: "formatting"
|
|
1274
|
+
});
|
|
1275
|
+
// J, F, ..., D
|
|
1276
|
+
case "MMMMM":
|
|
1277
|
+
return r.month(t, {
|
|
1278
|
+
width: "narrow",
|
|
1279
|
+
context: "formatting"
|
|
1280
|
+
});
|
|
1281
|
+
default:
|
|
1282
|
+
return r.month(t, { width: "wide", context: "formatting" });
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
// Stand-alone month
|
|
1286
|
+
L: function(n, e, r) {
|
|
1287
|
+
const t = n.getMonth();
|
|
1288
|
+
switch (e) {
|
|
1289
|
+
// 1, 2, ..., 12
|
|
1290
|
+
case "L":
|
|
1291
|
+
return String(t + 1);
|
|
1292
|
+
// 01, 02, ..., 12
|
|
1293
|
+
case "LL":
|
|
1294
|
+
return l(t + 1, 2);
|
|
1295
|
+
// 1st, 2nd, ..., 12th
|
|
1296
|
+
case "Lo":
|
|
1297
|
+
return r.ordinalNumber(t + 1, { unit: "month" });
|
|
1298
|
+
// Jan, Feb, ..., Dec
|
|
1299
|
+
case "LLL":
|
|
1300
|
+
return r.month(t, {
|
|
1301
|
+
width: "abbreviated",
|
|
1302
|
+
context: "standalone"
|
|
1303
|
+
});
|
|
1304
|
+
// J, F, ..., D
|
|
1305
|
+
case "LLLLL":
|
|
1306
|
+
return r.month(t, {
|
|
1307
|
+
width: "narrow",
|
|
1308
|
+
context: "standalone"
|
|
1309
|
+
});
|
|
1310
|
+
default:
|
|
1311
|
+
return r.month(t, { width: "wide", context: "standalone" });
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
// Local week of year
|
|
1315
|
+
w: function(n, e, r, t) {
|
|
1316
|
+
const o = Lt(n, t);
|
|
1317
|
+
return e === "wo" ? r.ordinalNumber(o, { unit: "week" }) : l(o, e.length);
|
|
1318
|
+
},
|
|
1319
|
+
// ISO week of year
|
|
1320
|
+
I: function(n, e, r) {
|
|
1321
|
+
const t = $t(n);
|
|
1322
|
+
return e === "Io" ? r.ordinalNumber(t, { unit: "week" }) : l(t, e.length);
|
|
1323
|
+
},
|
|
1324
|
+
// Day of the month
|
|
1325
|
+
d: function(n, e, r) {
|
|
1326
|
+
return e === "do" ? r.ordinalNumber(n.getDate(), { unit: "date" }) : D.d(n, e);
|
|
1327
|
+
},
|
|
1328
|
+
// Day of year
|
|
1329
|
+
D: function(n, e, r) {
|
|
1330
|
+
const t = en(n);
|
|
1331
|
+
return e === "Do" ? r.ordinalNumber(t, { unit: "dayOfYear" }) : l(t, e.length);
|
|
1332
|
+
},
|
|
1333
|
+
// Day of week
|
|
1334
|
+
E: function(n, e, r) {
|
|
1335
|
+
const t = n.getDay();
|
|
1336
|
+
switch (e) {
|
|
1337
|
+
// Tue
|
|
1338
|
+
case "E":
|
|
1339
|
+
case "EE":
|
|
1340
|
+
case "EEE":
|
|
1341
|
+
return r.day(t, {
|
|
1342
|
+
width: "abbreviated",
|
|
1343
|
+
context: "formatting"
|
|
1344
|
+
});
|
|
1345
|
+
// T
|
|
1346
|
+
case "EEEEE":
|
|
1347
|
+
return r.day(t, {
|
|
1348
|
+
width: "narrow",
|
|
1349
|
+
context: "formatting"
|
|
1350
|
+
});
|
|
1351
|
+
// Tu
|
|
1352
|
+
case "EEEEEE":
|
|
1353
|
+
return r.day(t, {
|
|
1354
|
+
width: "short",
|
|
1355
|
+
context: "formatting"
|
|
1356
|
+
});
|
|
1357
|
+
default:
|
|
1358
|
+
return r.day(t, {
|
|
1359
|
+
width: "wide",
|
|
1360
|
+
context: "formatting"
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
// Local day of week
|
|
1365
|
+
e: function(n, e, r, t) {
|
|
1366
|
+
const o = n.getDay(), a = (o - t.weekStartsOn + 8) % 7 || 7;
|
|
1367
|
+
switch (e) {
|
|
1368
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1369
|
+
case "e":
|
|
1370
|
+
return String(a);
|
|
1371
|
+
// Padded numerical value
|
|
1372
|
+
case "ee":
|
|
1373
|
+
return l(a, 2);
|
|
1374
|
+
// 1st, 2nd, ..., 7th
|
|
1375
|
+
case "eo":
|
|
1376
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1377
|
+
case "eee":
|
|
1378
|
+
return r.day(o, {
|
|
1379
|
+
width: "abbreviated",
|
|
1380
|
+
context: "formatting"
|
|
1381
|
+
});
|
|
1382
|
+
// T
|
|
1383
|
+
case "eeeee":
|
|
1384
|
+
return r.day(o, {
|
|
1385
|
+
width: "narrow",
|
|
1386
|
+
context: "formatting"
|
|
1387
|
+
});
|
|
1388
|
+
// Tu
|
|
1389
|
+
case "eeeeee":
|
|
1390
|
+
return r.day(o, {
|
|
1391
|
+
width: "short",
|
|
1392
|
+
context: "formatting"
|
|
1393
|
+
});
|
|
1394
|
+
default:
|
|
1395
|
+
return r.day(o, {
|
|
1396
|
+
width: "wide",
|
|
1397
|
+
context: "formatting"
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
// Stand-alone local day of week
|
|
1402
|
+
c: function(n, e, r, t) {
|
|
1403
|
+
const o = n.getDay(), a = (o - t.weekStartsOn + 8) % 7 || 7;
|
|
1404
|
+
switch (e) {
|
|
1405
|
+
// Numerical value (same as in `e`)
|
|
1406
|
+
case "c":
|
|
1407
|
+
return String(a);
|
|
1408
|
+
// Padded numerical value
|
|
1409
|
+
case "cc":
|
|
1410
|
+
return l(a, e.length);
|
|
1411
|
+
// 1st, 2nd, ..., 7th
|
|
1412
|
+
case "co":
|
|
1413
|
+
return r.ordinalNumber(a, { unit: "day" });
|
|
1414
|
+
case "ccc":
|
|
1415
|
+
return r.day(o, {
|
|
1416
|
+
width: "abbreviated",
|
|
1417
|
+
context: "standalone"
|
|
1418
|
+
});
|
|
1419
|
+
// T
|
|
1420
|
+
case "ccccc":
|
|
1421
|
+
return r.day(o, {
|
|
1422
|
+
width: "narrow",
|
|
1423
|
+
context: "standalone"
|
|
1424
|
+
});
|
|
1425
|
+
// Tu
|
|
1426
|
+
case "cccccc":
|
|
1427
|
+
return r.day(o, {
|
|
1428
|
+
width: "short",
|
|
1429
|
+
context: "standalone"
|
|
1430
|
+
});
|
|
1431
|
+
default:
|
|
1432
|
+
return r.day(o, {
|
|
1433
|
+
width: "wide",
|
|
1434
|
+
context: "standalone"
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
// ISO day of week
|
|
1439
|
+
i: function(n, e, r) {
|
|
1440
|
+
const t = n.getDay(), o = t === 0 ? 7 : t;
|
|
1441
|
+
switch (e) {
|
|
1442
|
+
// 2
|
|
1443
|
+
case "i":
|
|
1444
|
+
return String(o);
|
|
1445
|
+
// 02
|
|
1446
|
+
case "ii":
|
|
1447
|
+
return l(o, e.length);
|
|
1448
|
+
// 2nd
|
|
1449
|
+
case "io":
|
|
1450
|
+
return r.ordinalNumber(o, { unit: "day" });
|
|
1451
|
+
// Tue
|
|
1452
|
+
case "iii":
|
|
1453
|
+
return r.day(t, {
|
|
1454
|
+
width: "abbreviated",
|
|
1455
|
+
context: "formatting"
|
|
1456
|
+
});
|
|
1457
|
+
// T
|
|
1458
|
+
case "iiiii":
|
|
1459
|
+
return r.day(t, {
|
|
1460
|
+
width: "narrow",
|
|
1461
|
+
context: "formatting"
|
|
1462
|
+
});
|
|
1463
|
+
// Tu
|
|
1464
|
+
case "iiiiii":
|
|
1465
|
+
return r.day(t, {
|
|
1466
|
+
width: "short",
|
|
1467
|
+
context: "formatting"
|
|
1468
|
+
});
|
|
1469
|
+
default:
|
|
1470
|
+
return r.day(t, {
|
|
1471
|
+
width: "wide",
|
|
1472
|
+
context: "formatting"
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
},
|
|
1476
|
+
// AM or PM
|
|
1477
|
+
a: function(n, e, r) {
|
|
1478
|
+
const t = n.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1479
|
+
switch (e) {
|
|
1480
|
+
case "a":
|
|
1481
|
+
case "aa":
|
|
1482
|
+
return r.dayPeriod(t, {
|
|
1483
|
+
width: "abbreviated",
|
|
1484
|
+
context: "formatting"
|
|
1485
|
+
});
|
|
1486
|
+
case "aaa":
|
|
1487
|
+
return r.dayPeriod(t, {
|
|
1488
|
+
width: "abbreviated",
|
|
1489
|
+
context: "formatting"
|
|
1490
|
+
}).toLowerCase();
|
|
1491
|
+
case "aaaaa":
|
|
1492
|
+
return r.dayPeriod(t, {
|
|
1493
|
+
width: "narrow",
|
|
1494
|
+
context: "formatting"
|
|
1495
|
+
});
|
|
1496
|
+
default:
|
|
1497
|
+
return r.dayPeriod(t, {
|
|
1498
|
+
width: "wide",
|
|
1499
|
+
context: "formatting"
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
// AM, PM, midnight, noon
|
|
1504
|
+
b: function(n, e, r) {
|
|
1505
|
+
const t = n.getHours();
|
|
1506
|
+
let o;
|
|
1507
|
+
switch (t === 12 ? o = Y.noon : t === 0 ? o = Y.midnight : o = t / 12 >= 1 ? "pm" : "am", e) {
|
|
1508
|
+
case "b":
|
|
1509
|
+
case "bb":
|
|
1510
|
+
return r.dayPeriod(o, {
|
|
1511
|
+
width: "abbreviated",
|
|
1512
|
+
context: "formatting"
|
|
1513
|
+
});
|
|
1514
|
+
case "bbb":
|
|
1515
|
+
return r.dayPeriod(o, {
|
|
1516
|
+
width: "abbreviated",
|
|
1517
|
+
context: "formatting"
|
|
1518
|
+
}).toLowerCase();
|
|
1519
|
+
case "bbbbb":
|
|
1520
|
+
return r.dayPeriod(o, {
|
|
1521
|
+
width: "narrow",
|
|
1522
|
+
context: "formatting"
|
|
1523
|
+
});
|
|
1524
|
+
default:
|
|
1525
|
+
return r.dayPeriod(o, {
|
|
1526
|
+
width: "wide",
|
|
1527
|
+
context: "formatting"
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1532
|
+
B: function(n, e, r) {
|
|
1533
|
+
const t = n.getHours();
|
|
1534
|
+
let o;
|
|
1535
|
+
switch (t >= 17 ? o = Y.evening : t >= 12 ? o = Y.afternoon : t >= 4 ? o = Y.morning : o = Y.night, e) {
|
|
1536
|
+
case "B":
|
|
1537
|
+
case "BB":
|
|
1538
|
+
case "BBB":
|
|
1539
|
+
return r.dayPeriod(o, {
|
|
1540
|
+
width: "abbreviated",
|
|
1541
|
+
context: "formatting"
|
|
1542
|
+
});
|
|
1543
|
+
case "BBBBB":
|
|
1544
|
+
return r.dayPeriod(o, {
|
|
1545
|
+
width: "narrow",
|
|
1546
|
+
context: "formatting"
|
|
1547
|
+
});
|
|
1548
|
+
default:
|
|
1549
|
+
return r.dayPeriod(o, {
|
|
1550
|
+
width: "wide",
|
|
1551
|
+
context: "formatting"
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
},
|
|
1555
|
+
// Hour [1-12]
|
|
1556
|
+
h: function(n, e, r) {
|
|
1557
|
+
if (e === "ho") {
|
|
1558
|
+
let t = n.getHours() % 12;
|
|
1559
|
+
return t === 0 && (t = 12), r.ordinalNumber(t, { unit: "hour" });
|
|
1560
|
+
}
|
|
1561
|
+
return D.h(n, e);
|
|
1562
|
+
},
|
|
1563
|
+
// Hour [0-23]
|
|
1564
|
+
H: function(n, e, r) {
|
|
1565
|
+
return e === "Ho" ? r.ordinalNumber(n.getHours(), { unit: "hour" }) : D.H(n, e);
|
|
1566
|
+
},
|
|
1567
|
+
// Hour [0-11]
|
|
1568
|
+
K: function(n, e, r) {
|
|
1569
|
+
const t = n.getHours() % 12;
|
|
1570
|
+
return e === "Ko" ? r.ordinalNumber(t, { unit: "hour" }) : l(t, e.length);
|
|
1571
|
+
},
|
|
1572
|
+
// Hour [1-24]
|
|
1573
|
+
k: function(n, e, r) {
|
|
1574
|
+
let t = n.getHours();
|
|
1575
|
+
return t === 0 && (t = 24), e === "ko" ? r.ordinalNumber(t, { unit: "hour" }) : l(t, e.length);
|
|
1576
|
+
},
|
|
1577
|
+
// Minute
|
|
1578
|
+
m: function(n, e, r) {
|
|
1579
|
+
return e === "mo" ? r.ordinalNumber(n.getMinutes(), { unit: "minute" }) : D.m(n, e);
|
|
1580
|
+
},
|
|
1581
|
+
// Second
|
|
1582
|
+
s: function(n, e, r) {
|
|
1583
|
+
return e === "so" ? r.ordinalNumber(n.getSeconds(), { unit: "second" }) : D.s(n, e);
|
|
1584
|
+
},
|
|
1585
|
+
// Fraction of second
|
|
1586
|
+
S: function(n, e) {
|
|
1587
|
+
return D.S(n, e);
|
|
1588
|
+
},
|
|
1589
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1590
|
+
X: function(n, e, r) {
|
|
1591
|
+
const t = n.getTimezoneOffset();
|
|
1592
|
+
if (t === 0)
|
|
1593
|
+
return "Z";
|
|
1594
|
+
switch (e) {
|
|
1595
|
+
// Hours and optional minutes
|
|
1596
|
+
case "X":
|
|
1597
|
+
return vt(t);
|
|
1598
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1599
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1600
|
+
// so this token always has the same output as `XX`
|
|
1601
|
+
case "XXXX":
|
|
1602
|
+
case "XX":
|
|
1603
|
+
return x(t);
|
|
1604
|
+
// Hours and minutes with `:` delimiter
|
|
1605
|
+
default:
|
|
1606
|
+
return x(t, ":");
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1610
|
+
x: function(n, e, r) {
|
|
1611
|
+
const t = n.getTimezoneOffset();
|
|
1612
|
+
switch (e) {
|
|
1613
|
+
// Hours and optional minutes
|
|
1614
|
+
case "x":
|
|
1615
|
+
return vt(t);
|
|
1616
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1617
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1618
|
+
// so this token always has the same output as `xx`
|
|
1619
|
+
case "xxxx":
|
|
1620
|
+
case "xx":
|
|
1621
|
+
return x(t);
|
|
1622
|
+
// Hours and minutes with `:` delimiter
|
|
1623
|
+
default:
|
|
1624
|
+
return x(t, ":");
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
// Timezone (GMT)
|
|
1628
|
+
O: function(n, e, r) {
|
|
1629
|
+
const t = n.getTimezoneOffset();
|
|
1630
|
+
switch (e) {
|
|
1631
|
+
// Short
|
|
1632
|
+
case "O":
|
|
1633
|
+
case "OO":
|
|
1634
|
+
case "OOO":
|
|
1635
|
+
return "GMT" + wt(t, ":");
|
|
1636
|
+
default:
|
|
1637
|
+
return "GMT" + x(t, ":");
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
// Timezone (specific non-location)
|
|
1641
|
+
z: function(n, e, r) {
|
|
1642
|
+
const t = n.getTimezoneOffset();
|
|
1643
|
+
switch (e) {
|
|
1644
|
+
// Short
|
|
1645
|
+
case "z":
|
|
1646
|
+
case "zz":
|
|
1647
|
+
case "zzz":
|
|
1648
|
+
return "GMT" + wt(t, ":");
|
|
1649
|
+
default:
|
|
1650
|
+
return "GMT" + x(t, ":");
|
|
1651
|
+
}
|
|
1652
|
+
},
|
|
1653
|
+
// Seconds timestamp
|
|
1654
|
+
t: function(n, e, r) {
|
|
1655
|
+
const t = Math.trunc(+n / 1e3);
|
|
1656
|
+
return l(t, e.length);
|
|
1657
|
+
},
|
|
1658
|
+
// Milliseconds timestamp
|
|
1659
|
+
T: function(n, e, r) {
|
|
1660
|
+
return l(+n, e.length);
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
function wt(n, e = "") {
|
|
1664
|
+
const r = n > 0 ? "-" : "+", t = Math.abs(n), o = Math.trunc(t / 60), a = t % 60;
|
|
1665
|
+
return a === 0 ? r + String(o) : r + String(o) + e + l(a, 2);
|
|
1666
|
+
}
|
|
1667
|
+
function vt(n, e) {
|
|
1668
|
+
return n % 60 === 0 ? (n > 0 ? "-" : "+") + l(Math.abs(n) / 60, 2) : x(n, e);
|
|
1669
|
+
}
|
|
1670
|
+
function x(n, e = "") {
|
|
1671
|
+
const r = n > 0 ? "-" : "+", t = Math.abs(n), o = l(Math.trunc(t / 60), 2), a = l(t % 60, 2);
|
|
1672
|
+
return r + o + e + a;
|
|
1673
|
+
}
|
|
1674
|
+
const Mt = (n, e) => {
|
|
1675
|
+
switch (n) {
|
|
1676
|
+
case "P":
|
|
1677
|
+
return e.date({ width: "short" });
|
|
1678
|
+
case "PP":
|
|
1679
|
+
return e.date({ width: "medium" });
|
|
1680
|
+
case "PPP":
|
|
1681
|
+
return e.date({ width: "long" });
|
|
1682
|
+
default:
|
|
1683
|
+
return e.date({ width: "full" });
|
|
1684
|
+
}
|
|
1685
|
+
}, Ut = (n, e) => {
|
|
1686
|
+
switch (n) {
|
|
1687
|
+
case "p":
|
|
1688
|
+
return e.time({ width: "short" });
|
|
1689
|
+
case "pp":
|
|
1690
|
+
return e.time({ width: "medium" });
|
|
1691
|
+
case "ppp":
|
|
1692
|
+
return e.time({ width: "long" });
|
|
1693
|
+
default:
|
|
1694
|
+
return e.time({ width: "full" });
|
|
1695
|
+
}
|
|
1696
|
+
}, rn = (n, e) => {
|
|
1697
|
+
const r = n.match(/(P+)(p+)?/) || [], t = r[1], o = r[2];
|
|
1698
|
+
if (!o)
|
|
1699
|
+
return Mt(n, e);
|
|
1700
|
+
let a;
|
|
1701
|
+
switch (t) {
|
|
1702
|
+
case "P":
|
|
1703
|
+
a = e.dateTime({ width: "short" });
|
|
1704
|
+
break;
|
|
1705
|
+
case "PP":
|
|
1706
|
+
a = e.dateTime({ width: "medium" });
|
|
1707
|
+
break;
|
|
1708
|
+
case "PPP":
|
|
1709
|
+
a = e.dateTime({ width: "long" });
|
|
1710
|
+
break;
|
|
1711
|
+
default:
|
|
1712
|
+
a = e.dateTime({ width: "full" });
|
|
1713
|
+
break;
|
|
1714
|
+
}
|
|
1715
|
+
return a.replace("{{date}}", Mt(t, e)).replace("{{time}}", Ut(o, e));
|
|
1716
|
+
}, on = {
|
|
1717
|
+
p: Ut,
|
|
1718
|
+
P: rn
|
|
1719
|
+
}, an = /^D+$/, sn = /^Y+$/, un = ["D", "DD", "YY", "YYYY"];
|
|
1720
|
+
function cn(n) {
|
|
1721
|
+
return an.test(n);
|
|
1722
|
+
}
|
|
1723
|
+
function ln(n) {
|
|
1724
|
+
return sn.test(n);
|
|
1725
|
+
}
|
|
1726
|
+
function dn(n, e, r) {
|
|
1727
|
+
const t = hn(n, e, r);
|
|
1728
|
+
if (console.warn(t), un.includes(n)) throw new RangeError(t);
|
|
1729
|
+
}
|
|
1730
|
+
function hn(n, e, r) {
|
|
1731
|
+
const t = n[0] === "Y" ? "years" : "days of the month";
|
|
1732
|
+
return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${t} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1733
|
+
}
|
|
1734
|
+
const fn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, mn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, gn = /^'([^]*?)'?$/, pn = /''/g, yn = /[a-zA-Z]/;
|
|
1735
|
+
function z(n, e, r) {
|
|
1736
|
+
const t = A(), o = r?.locale ?? t.locale ?? W, a = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? t.firstWeekContainsDate ?? t.locale?.options?.firstWeekContainsDate ?? 1, s = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? t.weekStartsOn ?? t.locale?.options?.weekStartsOn ?? 0, u = d(n, r?.in);
|
|
1737
|
+
if (!Re(u))
|
|
1738
|
+
throw new RangeError("Invalid time value");
|
|
1739
|
+
let h = e.match(mn).map((m) => {
|
|
1740
|
+
const f = m[0];
|
|
1741
|
+
if (f === "p" || f === "P") {
|
|
1742
|
+
const M = on[f];
|
|
1743
|
+
return M(m, o.formatLong);
|
|
1744
|
+
}
|
|
1745
|
+
return m;
|
|
1746
|
+
}).join("").match(fn).map((m) => {
|
|
1747
|
+
if (m === "''")
|
|
1748
|
+
return { isToken: !1, value: "'" };
|
|
1749
|
+
const f = m[0];
|
|
1750
|
+
if (f === "'")
|
|
1751
|
+
return { isToken: !1, value: bn(m) };
|
|
1752
|
+
if (bt[f])
|
|
1753
|
+
return { isToken: !0, value: m };
|
|
1754
|
+
if (f.match(yn))
|
|
1755
|
+
throw new RangeError(
|
|
1756
|
+
"Format string contains an unescaped latin alphabet character `" + f + "`"
|
|
1757
|
+
);
|
|
1758
|
+
return { isToken: !1, value: m };
|
|
1759
|
+
});
|
|
1760
|
+
o.localize.preprocessor && (h = o.localize.preprocessor(u, h));
|
|
1761
|
+
const v = {
|
|
1762
|
+
firstWeekContainsDate: a,
|
|
1763
|
+
weekStartsOn: s,
|
|
1764
|
+
locale: o
|
|
1765
|
+
};
|
|
1766
|
+
return h.map((m) => {
|
|
1767
|
+
if (!m.isToken) return m.value;
|
|
1768
|
+
const f = m.value;
|
|
1769
|
+
(!r?.useAdditionalWeekYearTokens && ln(f) || !r?.useAdditionalDayOfYearTokens && cn(f)) && dn(f, e, String(n));
|
|
1770
|
+
const M = bt[f[0]];
|
|
1771
|
+
return M(u, f, o.localize, v);
|
|
1772
|
+
}).join("");
|
|
1773
|
+
}
|
|
1774
|
+
function bn(n) {
|
|
1775
|
+
const e = n.match(gn);
|
|
1776
|
+
return e ? e[1].replace(pn, "'") : n;
|
|
1777
|
+
}
|
|
1778
|
+
function wn(n, e) {
|
|
1779
|
+
const r = d(n, e?.in), t = r.getFullYear(), o = r.getMonth(), a = p(r, 0);
|
|
1780
|
+
return a.setFullYear(t, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1781
|
+
}
|
|
1782
|
+
function vn(n, e) {
|
|
1783
|
+
return d(n, e?.in).getMonth();
|
|
1784
|
+
}
|
|
1785
|
+
function Mn(n, e) {
|
|
1786
|
+
return d(n, e?.in).getFullYear();
|
|
1787
|
+
}
|
|
1788
|
+
function Sn(n, e) {
|
|
1789
|
+
return +d(n) > +d(e);
|
|
1790
|
+
}
|
|
1791
|
+
function kn(n, e) {
|
|
1792
|
+
return +d(n) < +d(e);
|
|
1793
|
+
}
|
|
1794
|
+
function Dn(n, e, r) {
|
|
1795
|
+
const [t, o] = j(
|
|
1796
|
+
r?.in,
|
|
1797
|
+
n,
|
|
1798
|
+
e
|
|
1799
|
+
);
|
|
1800
|
+
return t.getFullYear() === o.getFullYear() && t.getMonth() === o.getMonth();
|
|
1801
|
+
}
|
|
1802
|
+
function xn(n, e, r) {
|
|
1803
|
+
const [t, o] = j(
|
|
1804
|
+
r?.in,
|
|
1805
|
+
n,
|
|
1806
|
+
e
|
|
1807
|
+
);
|
|
1808
|
+
return t.getFullYear() === o.getFullYear();
|
|
1809
|
+
}
|
|
1810
|
+
function On(n, e, r) {
|
|
1811
|
+
const t = d(n, r?.in), o = t.getFullYear(), a = t.getDate(), s = p(n, 0);
|
|
1812
|
+
s.setFullYear(o, e, 15), s.setHours(0, 0, 0, 0);
|
|
1813
|
+
const u = wn(s);
|
|
1814
|
+
return t.setMonth(e, Math.min(a, u)), t;
|
|
1815
|
+
}
|
|
1816
|
+
function Tn(n, e, r) {
|
|
1817
|
+
const t = d(n, r?.in);
|
|
1818
|
+
return isNaN(+t) ? p(n, NaN) : (t.setFullYear(e), t);
|
|
1819
|
+
}
|
|
1820
|
+
const St = 5, Nn = 4;
|
|
1821
|
+
function Cn(n, e) {
|
|
1822
|
+
const r = e.startOfMonth(n), t = r.getDay() > 0 ? r.getDay() : 7, o = e.addDays(n, -t + 1), a = e.addDays(o, St * 7 - 1);
|
|
1823
|
+
return e.getMonth(n) === e.getMonth(a) ? St : Nn;
|
|
1824
|
+
}
|
|
1825
|
+
function Ht(n, e) {
|
|
1826
|
+
const r = e.startOfMonth(n), t = r.getDay();
|
|
1827
|
+
return t === 1 ? r : t === 0 ? e.addDays(r, -6) : e.addDays(r, -1 * (t - 1));
|
|
1828
|
+
}
|
|
1829
|
+
function Yn(n, e) {
|
|
1830
|
+
const r = Ht(n, e), t = Cn(n, e);
|
|
1831
|
+
return e.addDays(r, t * 7 - 1);
|
|
1832
|
+
}
|
|
1833
|
+
const Wn = {
|
|
1834
|
+
...W,
|
|
1835
|
+
labels: {
|
|
1836
|
+
labelDayButton: (n, e, r, t) => {
|
|
1837
|
+
let o;
|
|
1838
|
+
t && typeof t.format == "function" ? o = t.format.bind(t) : o = (s, u) => z(s, u, { locale: W, ...r });
|
|
1839
|
+
let a = o(n, "PPPP");
|
|
1840
|
+
return e.today && (a = `Today, ${a}`), e.selected && (a = `${a}, selected`), a;
|
|
1841
|
+
},
|
|
1842
|
+
labelMonthDropdown: "Choose the Month",
|
|
1843
|
+
labelNext: "Go to the Next Month",
|
|
1844
|
+
labelPrevious: "Go to the Previous Month",
|
|
1845
|
+
labelWeekNumber: (n) => `Week ${n}`,
|
|
1846
|
+
labelYearDropdown: "Choose the Year",
|
|
1847
|
+
labelGrid: (n, e, r) => {
|
|
1848
|
+
let t;
|
|
1849
|
+
return r && typeof r.format == "function" ? t = r.format.bind(r) : t = (o, a) => z(o, a, { locale: W, ...e }), t(n, "LLLL yyyy");
|
|
1850
|
+
},
|
|
1851
|
+
labelGridcell: (n, e, r, t) => {
|
|
1852
|
+
let o;
|
|
1853
|
+
t && typeof t.format == "function" ? o = t.format.bind(t) : o = (s, u) => z(s, u, { locale: W, ...r });
|
|
1854
|
+
let a = o(n, "PPPP");
|
|
1855
|
+
return e?.today && (a = `Today, ${a}`), a;
|
|
1856
|
+
},
|
|
1857
|
+
labelNav: "Navigation bar",
|
|
1858
|
+
labelWeekNumberHeader: "Week Number",
|
|
1859
|
+
labelWeekday: (n, e, r) => {
|
|
1860
|
+
let t;
|
|
1861
|
+
return r && typeof r.format == "function" ? t = r.format.bind(r) : t = (o, a) => z(o, a, { locale: W, ...e }), t(n, "cccc");
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
class Z {
|
|
1866
|
+
/**
|
|
1867
|
+
* Creates an instance of `DateLib`.
|
|
1868
|
+
*
|
|
1869
|
+
* @param options Configuration options for the date library.
|
|
1870
|
+
* @param overrides Custom overrides for the date library functions.
|
|
1871
|
+
*/
|
|
1872
|
+
constructor(e, r) {
|
|
1873
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? T.tz(this.options.timeZone) : new this.Date(), this.newDate = (t, o, a) => this.overrides?.newDate ? this.overrides.newDate(t, o, a) : this.options.timeZone ? new T(t, o, a, this.options.timeZone) : new Date(t, o, a), this.addDays = (t, o) => this.overrides?.addDays ? this.overrides.addDays(t, o) : Tt(t, o), this.addMonths = (t, o) => this.overrides?.addMonths ? this.overrides.addMonths(t, o) : Nt(t, o), this.addWeeks = (t, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(t, o) : _e(t, o), this.addYears = (t, o) => this.overrides?.addYears ? this.overrides.addYears(t, o) : Ze(t, o), this.differenceInCalendarDays = (t, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(t, o) : Yt(t, o), this.differenceInCalendarMonths = (t, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(t, o) : Ge(t, o), this.eachMonthOfInterval = (t) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(t) : Qe(t), this.eachYearOfInterval = (t) => {
|
|
1874
|
+
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(t) : Ke(t), a = new Set(o.map((u) => this.getYear(u)));
|
|
1875
|
+
if (a.size === o.length)
|
|
1876
|
+
return o;
|
|
1877
|
+
const s = [];
|
|
1878
|
+
return a.forEach((u) => {
|
|
1879
|
+
s.push(new Date(u, 0, 1));
|
|
1880
|
+
}), s;
|
|
1881
|
+
}, this.endOfBroadcastWeek = (t) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(t) : Yn(t, this), this.endOfISOWeek = (t) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(t) : tn(t), this.endOfMonth = (t) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(t) : Xe(t), this.endOfWeek = (t, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(t, o) : Ft(t, this.options), this.endOfYear = (t) => this.overrides?.endOfYear ? this.overrides.endOfYear(t) : Ve(t), this.format = (t, o, a) => {
|
|
1882
|
+
const s = this.overrides?.format ? this.overrides.format(t, o, this.options) : z(t, o, this.options);
|
|
1883
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
|
|
1884
|
+
}, this.getISOWeek = (t) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(t) : $t(t), this.getMonth = (t, o) => this.overrides?.getMonth ? this.overrides.getMonth(t, this.options) : vn(t, this.options), this.getYear = (t, o) => this.overrides?.getYear ? this.overrides.getYear(t, this.options) : Mn(t, this.options), this.getWeek = (t, o) => this.overrides?.getWeek ? this.overrides.getWeek(t, this.options) : Lt(t, this.options), this.isAfter = (t, o) => this.overrides?.isAfter ? this.overrides.isAfter(t, o) : Sn(t, o), this.isBefore = (t, o) => this.overrides?.isBefore ? this.overrides.isBefore(t, o) : kn(t, o), this.isDate = (t) => this.overrides?.isDate ? this.overrides.isDate(t) : Wt(t), this.isSameDay = (t, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(t, o) : Be(t, o), this.isSameMonth = (t, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(t, o) : Dn(t, o), this.isSameYear = (t, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(t, o) : xn(t, o), this.max = (t) => this.overrides?.max ? this.overrides.max(t) : Ae(t), this.min = (t) => this.overrides?.min ? this.overrides.min(t) : qe(t), this.setMonth = (t, o) => this.overrides?.setMonth ? this.overrides.setMonth(t, o) : On(t, o), this.setYear = (t, o) => this.overrides?.setYear ? this.overrides.setYear(t, o) : Tn(t, o), this.startOfBroadcastWeek = (t, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(t, this) : Ht(t, this), this.startOfDay = (t) => this.overrides?.startOfDay ? this.overrides.startOfDay(t) : _(t), this.startOfISOWeek = (t) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(t) : I(t), this.startOfMonth = (t) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(t) : Je(t), this.startOfWeek = (t, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(t, this.options) : P(t, this.options), this.startOfYear = (t) => this.overrides?.startOfYear ? this.overrides.startOfYear(t) : jt(t), this.options = { locale: Wn, ...e }, this.overrides = r;
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
1888
|
+
* digits.
|
|
1889
|
+
*
|
|
1890
|
+
* @since 9.5.0
|
|
1891
|
+
* @returns A record mapping Arabic digits to the target numerals.
|
|
1892
|
+
*/
|
|
1893
|
+
getDigitMap() {
|
|
1894
|
+
const { numerals: e = "latn" } = this.options, r = new Intl.NumberFormat("en-US", {
|
|
1895
|
+
numberingSystem: e
|
|
1896
|
+
}), t = {};
|
|
1897
|
+
for (let o = 0; o < 10; o++)
|
|
1898
|
+
t[o.toString()] = r.format(o);
|
|
1899
|
+
return t;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
1903
|
+
*
|
|
1904
|
+
* @since 9.5.0
|
|
1905
|
+
* @param input The string containing Arabic digits.
|
|
1906
|
+
* @returns The string with digits replaced.
|
|
1907
|
+
*/
|
|
1908
|
+
replaceDigits(e) {
|
|
1909
|
+
const r = this.getDigitMap();
|
|
1910
|
+
return e.replace(/\d/g, (t) => r[t] || t);
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Formats a number using the configured numbering system.
|
|
1914
|
+
*
|
|
1915
|
+
* @since 9.5.0
|
|
1916
|
+
* @param value The number to format.
|
|
1917
|
+
* @returns The formatted number as a string.
|
|
1918
|
+
*/
|
|
1919
|
+
formatNumber(e) {
|
|
1920
|
+
return this.replaceDigits(e.toString());
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
1924
|
+
* locale.
|
|
1925
|
+
*/
|
|
1926
|
+
getMonthYearOrder() {
|
|
1927
|
+
const e = this.options.locale?.code;
|
|
1928
|
+
return e && Z.yearFirstLocales.has(e) ? "year-first" : "month-first";
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Formats the month/year pair respecting locale conventions.
|
|
1932
|
+
*
|
|
1933
|
+
* @since 9.11.0
|
|
1934
|
+
*/
|
|
1935
|
+
formatMonthYear(e) {
|
|
1936
|
+
const { locale: r, timeZone: t, numerals: o } = this.options, a = r?.code;
|
|
1937
|
+
if (a && Z.yearFirstLocales.has(a))
|
|
1938
|
+
try {
|
|
1939
|
+
return new Intl.DateTimeFormat(a, {
|
|
1940
|
+
month: "long",
|
|
1941
|
+
year: "numeric",
|
|
1942
|
+
timeZone: t,
|
|
1943
|
+
numberingSystem: o
|
|
1944
|
+
}).format(e);
|
|
1945
|
+
} catch {
|
|
1946
|
+
}
|
|
1947
|
+
const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1948
|
+
return this.format(e, s);
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
Z.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1952
|
+
"eu",
|
|
1953
|
+
"hu",
|
|
1954
|
+
"ja",
|
|
1955
|
+
"ja-Hira",
|
|
1956
|
+
"ja-JP",
|
|
1957
|
+
"ko",
|
|
1958
|
+
"ko-KR",
|
|
1959
|
+
"lt",
|
|
1960
|
+
"lt-LT",
|
|
1961
|
+
"lv",
|
|
1962
|
+
"lv-LV",
|
|
1963
|
+
"mn",
|
|
1964
|
+
"mn-MN",
|
|
1965
|
+
"zh",
|
|
1966
|
+
"zh-CN",
|
|
1967
|
+
"zh-HK",
|
|
1968
|
+
"zh-TW"
|
|
1969
|
+
]);
|
|
1970
|
+
new Z();
|
|
1971
|
+
Dt({
|
|
1972
|
+
locale: void 0
|
|
1973
|
+
});
|
|
1974
|
+
function En({ router: n }) {
|
|
1975
|
+
const { user: e, logout: r } = ne();
|
|
1976
|
+
return kt(() => {
|
|
1977
|
+
e.id === "" && n.push("/login");
|
|
1978
|
+
}), /* @__PURE__ */ w.jsx("div", { className: "h-screen w-screen flex", children: /* @__PURE__ */ w.jsxs("div", { className: "m-auto flex flex-col gap-3", children: [
|
|
1979
|
+
/* @__PURE__ */ w.jsxs("div", { className: "inline-flex gap-5 items-center", children: [
|
|
1980
|
+
/* @__PURE__ */ w.jsx("h1", { className: "text-2xl border-r-1 p-4", children: "403" }),
|
|
1981
|
+
/* @__PURE__ */ w.jsx("h1", { children: "Acesso Negado" })
|
|
35
1982
|
] }),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
1983
|
+
/* @__PURE__ */ w.jsx(
|
|
1984
|
+
ot,
|
|
38
1985
|
{
|
|
39
1986
|
variant: "destructive",
|
|
40
1987
|
onClick: () => {
|
|
41
|
-
(async () => await
|
|
1988
|
+
(async () => await r())();
|
|
42
1989
|
},
|
|
43
1990
|
children: "Logout"
|
|
44
1991
|
}
|
|
45
1992
|
)
|
|
46
1993
|
] }) });
|
|
47
1994
|
}
|
|
48
|
-
function
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
1995
|
+
function Ln({ router: n }) {
|
|
1996
|
+
return /* @__PURE__ */ w.jsx("div", { className: "h-screen w-screen flex", children: /* @__PURE__ */ w.jsxs("div", { className: "m-auto flex flex-col gap-3", children: [
|
|
1997
|
+
/* @__PURE__ */ w.jsxs("div", { className: "inline-flex gap-5 items-center", children: [
|
|
1998
|
+
/* @__PURE__ */ w.jsx("h1", { className: "text-2xl border-r-1 p-4", children: "404" }),
|
|
1999
|
+
/* @__PURE__ */ w.jsx("h1", { children: "Página não encontrada" })
|
|
53
2000
|
] }),
|
|
54
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ w.jsx(ot, { onClick: () => n.replace("/"), children: "Voltar ao Início" })
|
|
55
2002
|
] }) });
|
|
56
2003
|
}
|
|
57
2004
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
2005
|
+
$n as Error,
|
|
2006
|
+
En as Forbidden,
|
|
2007
|
+
Ln as NotFoundPage
|
|
61
2008
|
};
|