@chimera-pe/react-saas 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,49 @@
1
- var Ct = Object.defineProperty;
2
- var Wt = (n, r, e) => r in n ? Ct(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
3
- var o = (n, r, e) => Wt(n, typeof r != "symbol" ? r + "" : r, e);
4
- import { jsx as d, jsxs as E, Fragment as It } from "react/jsx-runtime";
5
- import { Box as re, CircularProgress as Ve, Alert as Ue, AlertTitle as qt, Snackbar as Ht, useMediaQuery as Ft, CssBaseline as Nt, Container as Rt, Grid as $, Typography as ge, Card as At, CardHeader as St, CardContent as Qt, AppBar as jt, Toolbar as Bt, Link as zt, InputAdornment as qe, Button as Gt } from "@mui/material";
6
- import { useTranslate as fe, I18n as Xt } from "react-polyglot";
7
- import h from "prop-types";
8
- import { useDispatch as S, useSelector as I, Provider as $t } from "react-redux";
9
- import { createSlice as he, createAsyncThunk as De, configureStore as Vt } from "@reduxjs/toolkit";
10
- import Te from "axios";
11
- import { jwtDecode as He } from "jwt-decode";
12
- import { useState as Ut, useEffect as U, useMemo as Kt, useCallback as Zt } from "react";
13
- import { enGB as Jt, es as er } from "date-fns/locale";
14
- import { LocalizationProvider as tr } from "@mui/x-date-pickers";
15
- import rr from "navigator-languages";
16
- import { createTheme as nr, ThemeProvider as ar } from "@mui/material/styles";
17
- import { grey as Fe } from "@mui/material/colors";
18
- import { useLocation as Ke, Navigate as Ze, BrowserRouter as ir, Routes as sr, Route as Ne } from "react-router-dom";
19
- import { Email as or, Lock as cr } from "@mui/icons-material";
20
- import { Form as ur } from "react-final-form";
21
- import { TextField as Re } from "@chimera-pe/mui-rff";
22
- import Je from "lodash/memoize";
23
- const dr = () => /* @__PURE__ */ d(re, { sx: {
1
+ import { jsx as a, jsxs as d, Fragment as te } from "react/jsx-runtime";
2
+ import { Box as S, CircularProgress as P, Alert as B, AlertTitle as se, Snackbar as ce, useMediaQuery as le, CssBaseline as de, Container as ue, Grid as b, Typography as z, Card as pe, CardHeader as me, CardContent as ge, AppBar as fe, Toolbar as he, Link as ye, InputAdornment as N, Button as xe } from "@mui/material";
3
+ import { useTranslate as R, I18n as ke } from "react-polyglot";
4
+ import t from "prop-types";
5
+ import { useDispatch as f, useSelector as u, Provider as be } from "react-redux";
6
+ import { createSlice as v, createAsyncThunk as D, configureStore as Te } from "@reduxjs/toolkit";
7
+ import q from "axios";
8
+ import { jwtDecode as _ } from "jwt-decode";
9
+ import { useState as Se, useEffect as T, useMemo as we, useCallback as Ce } from "react";
10
+ import { es as Ie, enGB as Re } from "date-fns/locale";
11
+ import { LocalizationProvider as ve } from "@mui/x-date-pickers";
12
+ import { AdapterDateFns as je } from "@mui/x-date-pickers/AdapterDateFnsV3";
13
+ import Ae from "navigator-languages";
14
+ import { createTheme as ze, ThemeProvider as Le } from "@mui/material/styles";
15
+ import { grey as E } from "@mui/material/colors";
16
+ import { useLocation as M, Navigate as G, BrowserRouter as qe, Routes as De, Route as O } from "react-router-dom";
17
+ import { Email as Ne, Lock as _e } from "@mui/icons-material";
18
+ import { Form as Ee } from "react-final-form";
19
+ import { TextField as U } from "mui-rff";
20
+ import $ from "lodash/memoize";
21
+ const Oe = () => /* @__PURE__ */ a(S, { sx: {
24
22
  display: "flex",
25
23
  flexDirection: "column",
26
24
  flexGrow: 1,
27
25
  justifyContent: "center",
28
26
  alignItems: "center"
29
- }, children: /* @__PURE__ */ d(Ve, {}) }), et = ({ titulo: n, texto: r, align: e = "center", severity: t = "error" }) => {
30
- const a = fe();
31
- return /* @__PURE__ */ d(re, { sx: {
27
+ }, children: /* @__PURE__ */ a(P, {}) }), H = ({ titulo: o, texto: e, align: n = "center", severity: r = "error" }) => {
28
+ const i = R();
29
+ return /* @__PURE__ */ a(S, { sx: {
32
30
  display: "flex",
33
31
  flexDirection: "column",
34
32
  flexGrow: 1,
35
33
  justifyContent: "center",
36
- alignItems: e
37
- }, children: /* @__PURE__ */ E(Ue, { severity: t, children: [
38
- /* @__PURE__ */ d(qt, { children: a(n) }),
39
- r && a(r)
34
+ alignItems: n
35
+ }, children: /* @__PURE__ */ d(B, { severity: r, children: [
36
+ /* @__PURE__ */ a(se, { children: i(o) }),
37
+ e && i(e)
40
38
  ] }) });
41
39
  };
42
- et.propTypes = {
43
- titulo: h.string.isRequired,
44
- texto: h.string,
45
- align: h.string,
46
- severity: h.string
40
+ H.propTypes = {
41
+ titulo: t.string.isRequired,
42
+ texto: t.string,
43
+ align: t.string,
44
+ severity: t.string
47
45
  };
48
- const tt = he({
46
+ const K = v({
49
47
  name: "ui",
50
48
  initialState: {
51
49
  tema: "light",
@@ -53,40 +51,40 @@ const tt = he({
53
51
  idioma: "es"
54
52
  },
55
53
  reducers: {
56
- cambiarTema: (n, r) => {
57
- n.tema = r.payload, n.temaSeleccionado = !0, localStorage.setItem("tema", r.payload);
54
+ cambiarTema: (o, e) => {
55
+ o.tema = e.payload, o.temaSeleccionado = !0, localStorage.setItem("tema", e.payload);
58
56
  },
59
- cambiarIdioma: (n, r) => {
60
- n.idioma = r.payload;
57
+ cambiarIdioma: (o, e) => {
58
+ o.idioma = e.payload;
61
59
  }
62
60
  }
63
- }), { cambiarTema: lr, cambiarIdioma: fr } = tt.actions, hr = tt.reducer, mr = "https://saas.chimera.com.pe/backend", gr = "https://saas.chimera.com.pe/oauth", z = "saas-token", G = "saas-token-expiration", X = "saas-refresh-token", rt = (n = gr) => ({
64
- login: (r, e) => Te({
65
- url: `${n}/oauth/token`,
61
+ }), { cambiarTema: Ue, cambiarIdioma: Fe } = K.actions, Pe = K.reducer, Be = "https://saas.chimera.com.pe/backend", Me = "https://saas.chimera.com.pe/oauth", y = "saas-token", x = "saas-token-expiration", k = "saas-refresh-token", V = (o = Me) => ({
62
+ login: (e, n) => q({
63
+ url: `${o}/oauth/token`,
66
64
  headers: {
67
65
  "content-type": "application/x-www-form-urlencoded",
68
- Authorization: `Basic ${r}`
66
+ Authorization: `Basic ${e}`
69
67
  },
70
68
  method: "post",
71
69
  data: {
72
- username: e.correo,
73
- password: e.password,
70
+ username: n.correo,
71
+ password: n.password,
74
72
  grant_type: "password"
75
73
  }
76
74
  }),
77
- refreshToken: (r, e) => Te({
78
- url: `${n}/oauth/token`,
75
+ refreshToken: (e, n) => q({
76
+ url: `${o}/oauth/token`,
79
77
  headers: {
80
78
  "content-type": "application/x-www-form-urlencoded",
81
- Authorization: `Basic ${r}`
79
+ Authorization: `Basic ${e}`
82
80
  },
83
81
  method: "post",
84
82
  data: {
85
- refresh_token: e,
83
+ refresh_token: n,
86
84
  grant_type: "refresh_token"
87
85
  }
88
86
  })
89
- }), nt = he({
87
+ }), Z = v({
90
88
  name: "login",
91
89
  initialState: {
92
90
  cargando: !1,
@@ -99,3298 +97,111 @@ const tt = he({
99
97
  error: null
100
98
  },
101
99
  reducers: {
102
- login: (n, r) => {
103
- const e = r.payload.token, t = He(e), a = /* @__PURE__ */ new Date();
104
- a.setSeconds(a.getSeconds() + r.payload.expiracion), n.cargando = !1, n.autenticado = !0, n.token = e, n.refreshToken = r.payload.refreshToken, n.expiracion = a.getTime(), n.usuario = t.name, n.perfiles = t.authorities;
100
+ login: (o, e) => {
101
+ const n = e.payload.token, r = _(n), i = /* @__PURE__ */ new Date();
102
+ i.setSeconds(i.getSeconds() + e.payload.expiracion), o.cargando = !1, o.autenticado = !0, o.token = n, o.refreshToken = e.payload.refreshToken, o.expiracion = i.getTime(), o.usuario = r.name, o.perfiles = r.authorities;
105
103
  },
106
- logout: (n) => {
107
- n.cargando = !1, n.autenticado = !1, n.token = null, n.refreshToken = null, n.expiracion = null, n.usuario = null, n.perfiles = [], n.error = null, sessionStorage.removeItem(z), sessionStorage.removeItem(X), sessionStorage.removeItem(G);
108
- }
109
- },
110
- extraReducers(n) {
111
- n.addCase(oe.pending, (r) => {
112
- r.cargando = !0, r.error = null;
113
- }).addCase(oe.fulfilled, (r, e) => {
114
- const t = e.payload.access_token, a = He(t), i = /* @__PURE__ */ new Date();
115
- i.setSeconds(i.getSeconds() + e.payload.expires_in), r.cargando = !1, r.autenticado = !0, r.token = t, r.refreshToken = e.payload.refresh_token, r.expiracion = i.getTime(), r.usuario = a.name, r.perfiles = a.authorities, sessionStorage.setItem(z, t), sessionStorage.setItem(X, e.payload.refresh_token), sessionStorage.setItem(G, i.getTime());
116
- }).addCase(oe.rejected, (r, e) => {
117
- var t;
118
- console.log(e), r.cargando = !1, r.autenticado = !1, r.token = null, r.refreshToken = null, r.expiracion = null, r.usuario = null, r.perfiles = [], r.error = (t = e.error) == null ? void 0 : t.message, sessionStorage.removeItem(z), sessionStorage.removeItem(X), sessionStorage.removeItem(G);
119
- }).addCase(ce.pending, (r) => {
120
- r.cargando = !0;
121
- }).addCase(ce.fulfilled, (r, e) => {
122
- const t = /* @__PURE__ */ new Date();
123
- t.setSeconds(t.getSeconds() + e.payload.expires_in), r.token = e.payload.access_token, r.refreshToken = e.payload.refresh_token, r.expiracion = t.getTime(), sessionStorage.setItem(z, e.payload.access_token), sessionStorage.setItem(X, e.payload.refresh_token), sessionStorage.setItem(G, t.getTime());
124
- }).addCase(ce.rejected, (r, e) => {
125
- var t;
126
- r.cargando = !1, r.autenticado = !1, r.token = null, r.refreshToken = null, r.expiracion = null, r.usuario = null, r.perfiles = [], r.error = (t = e.error) == null ? void 0 : t.message, sessionStorage.removeItem(z), sessionStorage.removeItem(X), sessionStorage.removeItem(G);
104
+ logout: (o) => {
105
+ o.cargando = !1, o.autenticado = !1, o.token = null, o.refreshToken = null, o.expiracion = null, o.usuario = null, o.perfiles = [], o.error = null, sessionStorage.removeItem(y), sessionStorage.removeItem(k), sessionStorage.removeItem(x);
106
+ }
107
+ },
108
+ extraReducers(o) {
109
+ o.addCase(w.pending, (e) => {
110
+ e.cargando = !0, e.error = null;
111
+ }).addCase(w.fulfilled, (e, n) => {
112
+ const r = n.payload.access_token, i = _(r), c = /* @__PURE__ */ new Date();
113
+ c.setSeconds(c.getSeconds() + n.payload.expires_in), e.cargando = !1, e.autenticado = !0, e.token = r, e.refreshToken = n.payload.refresh_token, e.expiracion = c.getTime(), e.usuario = i.name, e.perfiles = i.authorities, sessionStorage.setItem(y, r), sessionStorage.setItem(k, n.payload.refresh_token), sessionStorage.setItem(x, c.getTime());
114
+ }).addCase(w.rejected, (e, n) => {
115
+ var r;
116
+ console.log(n), e.cargando = !1, e.autenticado = !1, e.token = null, e.refreshToken = null, e.expiracion = null, e.usuario = null, e.perfiles = [], e.error = (r = n.error) == null ? void 0 : r.message, sessionStorage.removeItem(y), sessionStorage.removeItem(k), sessionStorage.removeItem(x);
117
+ }).addCase(C.pending, (e) => {
118
+ e.cargando = !0;
119
+ }).addCase(C.fulfilled, (e, n) => {
120
+ const r = /* @__PURE__ */ new Date();
121
+ r.setSeconds(r.getSeconds() + n.payload.expires_in), e.token = n.payload.access_token, e.refreshToken = n.payload.refresh_token, e.expiracion = r.getTime(), sessionStorage.setItem(y, n.payload.access_token), sessionStorage.setItem(k, n.payload.refresh_token), sessionStorage.setItem(x, r.getTime());
122
+ }).addCase(C.rejected, (e, n) => {
123
+ var r;
124
+ e.cargando = !1, e.autenticado = !1, e.token = null, e.refreshToken = null, e.expiracion = null, e.usuario = null, e.perfiles = [], e.error = (r = n.error) == null ? void 0 : r.message, sessionStorage.removeItem(y), sessionStorage.removeItem(k), sessionStorage.removeItem(x);
127
125
  });
128
126
  }
129
- }), oe = De("login/requestToken", async (n) => (await rt(n.devURL).login(n.clientCredentials, n.data)).data), ce = De("login/refreshToken", async (n, r, e) => (await rt(n).refreshToken(r, e)).data), { login: yr, logout: Ae } = nt.actions, Ei = (n) => n.login.token, _i = (n) => n.login.usuario, Li = (n) => n.login.perfiles, wr = nt.reducer, at = he({
127
+ }), w = D("login/requestToken", async (o) => (await V(o.devURL).login(o.clientCredentials, o.data)).data), C = D("login/refreshToken", async (o, e, n) => (await V(o).refreshToken(e, n)).data), { login: Ge, logout: F } = Z.actions, jo = (o) => o.login.token, Ao = (o) => o.login.usuario, zo = (o) => o.login.perfiles, $e = Z.reducer, W = v({
130
128
  name: "notificacion",
131
129
  initialState: [],
132
130
  reducers: {
133
- mostrarNotificacion: (n, r) => {
134
- n.push(r.payload);
131
+ mostrarNotificacion: (o, e) => {
132
+ o.push(e.payload);
135
133
  },
136
- ocultarNotificacion: (n) => {
137
- n.pop();
134
+ ocultarNotificacion: (o) => {
135
+ o.pop();
138
136
  }
139
137
  }
140
- }), { mostrarNotificacion: br, ocultarNotificacion: xr } = at.actions, Tr = at.reducer, kr = (n = mr, r) => Te({
141
- url: `${n}/identidad/`,
138
+ }), { mostrarNotificacion: He, ocultarNotificacion: Ke } = W.actions, Ve = W.reducer, Ze = (o = Be, e) => q({
139
+ url: `${o}/identidad/`,
142
140
  params: {
143
- codigoAplicacion: r
141
+ codigoAplicacion: e
144
142
  }
145
- }), ye = {
143
+ }), L = {
146
144
  primary: "#1C6CCC",
147
145
  secondary: "#17A7FF",
148
146
  error: "#f44336",
149
147
  warning: "#ff9800",
150
148
  info: "#2196f3",
151
149
  success: "#4caf50"
152
- }, pr = he({
150
+ }, We = v({
153
151
  name: "inicializar",
154
152
  initialState: {
155
153
  inicializando: !0,
156
154
  inicializado: !1,
157
155
  instancia: {
158
- color: ye
156
+ color: L
159
157
  },
160
158
  error: null
161
159
  },
162
- extraReducers(n) {
163
- n.addCase(ue.pending, (r) => {
164
- r.inicializando = !0;
165
- }).addCase(ue.fulfilled, (r, e) => {
166
- r.inicializando = !1, r.inicializado = !0, r.instancia = {
167
- ...e.payload,
168
- abreviatura: e.payload.nombre.match(/\b([A-Z])/g).join(""),
160
+ extraReducers(o) {
161
+ o.addCase(I.pending, (e) => {
162
+ e.inicializando = !0;
163
+ }).addCase(I.fulfilled, (e, n) => {
164
+ e.inicializando = !1, e.inicializado = !0, e.instancia = {
165
+ ...n.payload,
166
+ abreviatura: n.payload.nombre.match(/\b([A-Z])/g).join(""),
169
167
  color: {
170
- ...ye,
171
- ...e.payload.color
168
+ ...L,
169
+ ...n.payload.color
172
170
  }
173
- }, r.error = null;
174
- }).addCase(ue.rejected, (r, e) => {
175
- r.inicializando = !1, r.inicializado = !1, r.instancia = {
176
- color: ye
177
- }, r.error = e.payload;
171
+ }, e.error = null;
172
+ }).addCase(I.rejected, (e, n) => {
173
+ e.inicializando = !1, e.inicializado = !1, e.instancia = {
174
+ color: L
175
+ }, e.error = n.payload;
178
176
  });
179
177
  }
180
- }), ue = De("inicializar", async (n) => (await kr(n.devURL, n.aplicacion)).data), Ci = (n) => n.aplicacion.instancia, Dr = pr.reducer, Mr = (n) => Vt({
178
+ }), I = D("inicializar", async (o) => (await Ze(o.devURL, o.aplicacion)).data), Lo = (o) => o.aplicacion.instancia, Xe = We.reducer, Je = (o) => Te({
181
179
  reducer: {
182
- ui: hr,
183
- aplicacion: Dr,
184
- login: wr,
185
- notificaciones: Tr,
186
- ...n
187
- }
188
- }), Or = () => {
189
- const [n, r] = Ut(!1), e = S(), t = fe(), a = I((s) => s.notificaciones[0]);
190
- U(() => {
191
- r(!!a);
192
- }, [a]);
193
- const i = () => {
194
- r(!1), e(xr());
180
+ ui: Pe,
181
+ aplicacion: Xe,
182
+ login: $e,
183
+ notificaciones: Ve,
184
+ ...o
185
+ }
186
+ }), Qe = () => {
187
+ const [o, e] = Se(!1), n = f(), r = R(), i = u((s) => s.notificaciones[0]);
188
+ T(() => {
189
+ e(!!i);
190
+ }, [i]);
191
+ const c = () => {
192
+ e(!1), n(Ke());
195
193
  };
196
- return /* @__PURE__ */ d(
197
- Ht,
194
+ return /* @__PURE__ */ a(
195
+ ce,
198
196
  {
199
- open: n,
200
- message: (a == null ? void 0 : a.mensaje) && a.tipo === "default" && t(a.mensaje),
197
+ open: o,
198
+ message: (i == null ? void 0 : i.mensaje) && i.tipo === "default" && r(i.mensaje),
201
199
  autoHideDuration: 5e3,
202
- onClose: i,
203
- children: (a == null ? void 0 : a.mensaje) && a.tipo !== "default" && /* @__PURE__ */ d(Ue, { severity: a.tipo, children: t(a.mensaje) })
200
+ onClose: c,
201
+ children: (i == null ? void 0 : i.mensaje) && i.tipo !== "default" && /* @__PURE__ */ a(B, { severity: i.tipo, children: r(i.mensaje) })
204
202
  }
205
203
  );
206
- }, it = 6048e5, Pr = 864e5, st = 6e4, ot = 36e5, Yr = 1e3, Se = Symbol.for("constructDateFrom");
207
- function b(n, r) {
208
- return typeof n == "function" ? n(r) : n && typeof n == "object" && Se in n ? n[Se](r) : n instanceof Date ? new n.constructor(r) : new Date(r);
209
- }
210
- function u(n, r) {
211
- return b(r || n, n);
212
- }
213
- function ne(n, r, e) {
214
- const t = u(n, e == null ? void 0 : e.in);
215
- return isNaN(r) ? b((e == null ? void 0 : e.in) || n, NaN) : (r && t.setDate(t.getDate() + r), t);
216
- }
217
- function ct(n, r, e) {
218
- return b(n, +u(n) + r);
219
- }
220
- function vr(n, r, e) {
221
- return ct(n, r * 1e3);
222
- }
223
- function Er(n, r, e) {
224
- const t = u(n, e == null ? void 0 : e.in);
225
- return t.setTime(t.getTime() + r * st), t;
226
- }
227
- function _r(n, r, e) {
228
- return ct(n, r * ot);
229
- }
230
- function Lr(n, r, e) {
231
- return ne(n, r * 7, e);
232
- }
233
- function ut(n, r, e) {
234
- const t = u(n, e == null ? void 0 : e.in);
235
- if (isNaN(r)) return b(n, NaN);
236
- if (!r)
237
- return t;
238
- const a = t.getDate(), i = b(n, t.getTime());
239
- i.setMonth(t.getMonth() + r + 1, 0);
240
- const s = i.getDate();
241
- return a >= s ? i : (t.setFullYear(
242
- i.getFullYear(),
243
- i.getMonth(),
244
- a
245
- ), t);
246
- }
247
- function Cr(n, r, e) {
248
- return ut(n, r * 12, e);
249
- }
250
- function Qe(n, r) {
251
- const e = u(n, r == null ? void 0 : r.in);
252
- return e.setHours(23, 59, 59, 999), e;
253
- }
254
- let Wr = {};
255
- function Q() {
256
- return Wr;
257
- }
258
- function Ir(n, r) {
259
- var c, l, f, w;
260
- const e = Q(), t = (r == null ? void 0 : r.weekStartsOn) ?? ((l = (c = r == null ? void 0 : r.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? e.weekStartsOn ?? ((w = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : w.weekStartsOn) ?? 0, a = u(n, r == null ? void 0 : r.in), i = a.getDay(), s = (i < t ? -7 : 0) + 6 - (i - t);
261
- return a.setDate(a.getDate() + s), a.setHours(23, 59, 59, 999), a;
262
- }
263
- function je(n, r) {
264
- const e = u(n, r == null ? void 0 : r.in), t = e.getFullYear();
265
- return e.setFullYear(t + 1, 0, 0), e.setHours(23, 59, 59, 999), e;
266
- }
267
- const qr = {
268
- lessThanXSeconds: {
269
- one: "less than a second",
270
- other: "less than {{count}} seconds"
271
- },
272
- xSeconds: {
273
- one: "1 second",
274
- other: "{{count}} seconds"
275
- },
276
- halfAMinute: "half a minute",
277
- lessThanXMinutes: {
278
- one: "less than a minute",
279
- other: "less than {{count}} minutes"
280
- },
281
- xMinutes: {
282
- one: "1 minute",
283
- other: "{{count}} minutes"
284
- },
285
- aboutXHours: {
286
- one: "about 1 hour",
287
- other: "about {{count}} hours"
288
- },
289
- xHours: {
290
- one: "1 hour",
291
- other: "{{count}} hours"
292
- },
293
- xDays: {
294
- one: "1 day",
295
- other: "{{count}} days"
296
- },
297
- aboutXWeeks: {
298
- one: "about 1 week",
299
- other: "about {{count}} weeks"
300
- },
301
- xWeeks: {
302
- one: "1 week",
303
- other: "{{count}} weeks"
304
- },
305
- aboutXMonths: {
306
- one: "about 1 month",
307
- other: "about {{count}} months"
308
- },
309
- xMonths: {
310
- one: "1 month",
311
- other: "{{count}} months"
312
- },
313
- aboutXYears: {
314
- one: "about 1 year",
315
- other: "about {{count}} years"
316
- },
317
- xYears: {
318
- one: "1 year",
319
- other: "{{count}} years"
320
- },
321
- overXYears: {
322
- one: "over 1 year",
323
- other: "over {{count}} years"
324
- },
325
- almostXYears: {
326
- one: "almost 1 year",
327
- other: "almost {{count}} years"
328
- }
329
- }, Hr = (n, r, e) => {
330
- let t;
331
- const a = qr[n];
332
- return typeof a == "string" ? t = a : r === 1 ? t = a.one : t = a.other.replace("{{count}}", r.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + t : t + " ago" : t;
333
- };
334
- function we(n) {
335
- return (r = {}) => {
336
- const e = r.width ? String(r.width) : n.defaultWidth;
337
- return n.formats[e] || n.formats[n.defaultWidth];
338
- };
339
- }
340
- const Fr = {
341
- full: "EEEE, MMMM do, y",
342
- long: "MMMM do, y",
343
- medium: "MMM d, y",
344
- short: "MM/dd/yyyy"
345
- }, Nr = {
346
- full: "h:mm:ss a zzzz",
347
- long: "h:mm:ss a z",
348
- medium: "h:mm:ss a",
349
- short: "h:mm a"
350
- }, Rr = {
351
- full: "{{date}} 'at' {{time}}",
352
- long: "{{date}} 'at' {{time}}",
353
- medium: "{{date}}, {{time}}",
354
- short: "{{date}}, {{time}}"
355
- }, Ar = {
356
- date: we({
357
- formats: Fr,
358
- defaultWidth: "full"
359
- }),
360
- time: we({
361
- formats: Nr,
362
- defaultWidth: "full"
363
- }),
364
- dateTime: we({
365
- formats: Rr,
366
- defaultWidth: "full"
367
- })
368
- }, Sr = {
369
- lastWeek: "'last' eeee 'at' p",
370
- yesterday: "'yesterday at' p",
371
- today: "'today at' p",
372
- tomorrow: "'tomorrow at' p",
373
- nextWeek: "eeee 'at' p",
374
- other: "P"
375
- }, Qr = (n, r, e, t) => Sr[n];
376
- function ee(n) {
377
- return (r, e) => {
378
- const t = e != null && e.context ? String(e.context) : "standalone";
379
- let a;
380
- if (t === "formatting" && n.formattingValues) {
381
- const s = n.defaultFormattingWidth || n.defaultWidth, c = e != null && e.width ? String(e.width) : s;
382
- a = n.formattingValues[c] || n.formattingValues[s];
383
- } else {
384
- const s = n.defaultWidth, c = e != null && e.width ? String(e.width) : n.defaultWidth;
385
- a = n.values[c] || n.values[s];
386
- }
387
- const i = n.argumentCallback ? n.argumentCallback(r) : r;
388
- return a[i];
389
- };
390
- }
391
- const jr = {
392
- narrow: ["B", "A"],
393
- abbreviated: ["BC", "AD"],
394
- wide: ["Before Christ", "Anno Domini"]
395
- }, Br = {
396
- narrow: ["1", "2", "3", "4"],
397
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
398
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
399
- }, zr = {
400
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
401
- abbreviated: [
402
- "Jan",
403
- "Feb",
404
- "Mar",
405
- "Apr",
406
- "May",
407
- "Jun",
408
- "Jul",
409
- "Aug",
410
- "Sep",
411
- "Oct",
412
- "Nov",
413
- "Dec"
414
- ],
415
- wide: [
416
- "January",
417
- "February",
418
- "March",
419
- "April",
420
- "May",
421
- "June",
422
- "July",
423
- "August",
424
- "September",
425
- "October",
426
- "November",
427
- "December"
428
- ]
429
- }, Gr = {
430
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
431
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
432
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
433
- wide: [
434
- "Sunday",
435
- "Monday",
436
- "Tuesday",
437
- "Wednesday",
438
- "Thursday",
439
- "Friday",
440
- "Saturday"
441
- ]
442
- }, Xr = {
443
- narrow: {
444
- am: "a",
445
- pm: "p",
446
- midnight: "mi",
447
- noon: "n",
448
- morning: "morning",
449
- afternoon: "afternoon",
450
- evening: "evening",
451
- night: "night"
452
- },
453
- abbreviated: {
454
- am: "AM",
455
- pm: "PM",
456
- midnight: "midnight",
457
- noon: "noon",
458
- morning: "morning",
459
- afternoon: "afternoon",
460
- evening: "evening",
461
- night: "night"
462
- },
463
- wide: {
464
- am: "a.m.",
465
- pm: "p.m.",
466
- midnight: "midnight",
467
- noon: "noon",
468
- morning: "morning",
469
- afternoon: "afternoon",
470
- evening: "evening",
471
- night: "night"
472
- }
473
- }, $r = {
474
- narrow: {
475
- am: "a",
476
- pm: "p",
477
- midnight: "mi",
478
- noon: "n",
479
- morning: "in the morning",
480
- afternoon: "in the afternoon",
481
- evening: "in the evening",
482
- night: "at night"
483
- },
484
- abbreviated: {
485
- am: "AM",
486
- pm: "PM",
487
- midnight: "midnight",
488
- noon: "noon",
489
- morning: "in the morning",
490
- afternoon: "in the afternoon",
491
- evening: "in the evening",
492
- night: "at night"
493
- },
494
- wide: {
495
- am: "a.m.",
496
- pm: "p.m.",
497
- midnight: "midnight",
498
- noon: "noon",
499
- morning: "in the morning",
500
- afternoon: "in the afternoon",
501
- evening: "in the evening",
502
- night: "at night"
503
- }
504
- }, Vr = (n, r) => {
505
- const e = Number(n), t = e % 100;
506
- if (t > 20 || t < 10)
507
- switch (t % 10) {
508
- case 1:
509
- return e + "st";
510
- case 2:
511
- return e + "nd";
512
- case 3:
513
- return e + "rd";
514
- }
515
- return e + "th";
516
- }, Ur = {
517
- ordinalNumber: Vr,
518
- era: ee({
519
- values: jr,
520
- defaultWidth: "wide"
521
- }),
522
- quarter: ee({
523
- values: Br,
524
- defaultWidth: "wide",
525
- argumentCallback: (n) => n - 1
526
- }),
527
- month: ee({
528
- values: zr,
529
- defaultWidth: "wide"
530
- }),
531
- day: ee({
532
- values: Gr,
533
- defaultWidth: "wide"
534
- }),
535
- dayPeriod: ee({
536
- values: Xr,
537
- defaultWidth: "wide",
538
- formattingValues: $r,
539
- defaultFormattingWidth: "wide"
540
- })
541
- };
542
- function te(n) {
543
- return (r, e = {}) => {
544
- const t = e.width, a = t && n.matchPatterns[t] || n.matchPatterns[n.defaultMatchWidth], i = r.match(a);
545
- if (!i)
546
- return null;
547
- const s = i[0], c = t && n.parsePatterns[t] || n.parsePatterns[n.defaultParseWidth], l = Array.isArray(c) ? Zr(c, (P) => P.test(s)) : (
548
- // [TODO] -- I challenge you to fix the type
549
- Kr(c, (P) => P.test(s))
550
- );
551
- let f;
552
- f = n.valueCallback ? n.valueCallback(l) : l, f = e.valueCallback ? (
553
- // [TODO] -- I challenge you to fix the type
554
- e.valueCallback(f)
555
- ) : f;
556
- const w = r.slice(s.length);
557
- return { value: f, rest: w };
558
- };
559
- }
560
- function Kr(n, r) {
561
- for (const e in n)
562
- if (Object.prototype.hasOwnProperty.call(n, e) && r(n[e]))
563
- return e;
564
- }
565
- function Zr(n, r) {
566
- for (let e = 0; e < n.length; e++)
567
- if (r(n[e]))
568
- return e;
569
- }
570
- function Jr(n) {
571
- return (r, e = {}) => {
572
- const t = r.match(n.matchPattern);
573
- if (!t) return null;
574
- const a = t[0], i = r.match(n.parsePattern);
575
- if (!i) return null;
576
- let s = n.valueCallback ? n.valueCallback(i[0]) : i[0];
577
- s = e.valueCallback ? e.valueCallback(s) : s;
578
- const c = r.slice(a.length);
579
- return { value: s, rest: c };
580
- };
581
- }
582
- const en = /^(\d+)(th|st|nd|rd)?/i, tn = /\d+/i, rn = {
583
- narrow: /^(b|a)/i,
584
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
585
- wide: /^(before christ|before common era|anno domini|common era)/i
586
- }, nn = {
587
- any: [/^b/i, /^(a|c)/i]
588
- }, an = {
589
- narrow: /^[1234]/i,
590
- abbreviated: /^q[1234]/i,
591
- wide: /^[1234](th|st|nd|rd)? quarter/i
592
- }, sn = {
593
- any: [/1/i, /2/i, /3/i, /4/i]
594
- }, on = {
595
- narrow: /^[jfmasond]/i,
596
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
597
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
598
- }, cn = {
599
- narrow: [
600
- /^j/i,
601
- /^f/i,
602
- /^m/i,
603
- /^a/i,
604
- /^m/i,
605
- /^j/i,
606
- /^j/i,
607
- /^a/i,
608
- /^s/i,
609
- /^o/i,
610
- /^n/i,
611
- /^d/i
612
- ],
613
- any: [
614
- /^ja/i,
615
- /^f/i,
616
- /^mar/i,
617
- /^ap/i,
618
- /^may/i,
619
- /^jun/i,
620
- /^jul/i,
621
- /^au/i,
622
- /^s/i,
623
- /^o/i,
624
- /^n/i,
625
- /^d/i
626
- ]
627
- }, un = {
628
- narrow: /^[smtwf]/i,
629
- short: /^(su|mo|tu|we|th|fr|sa)/i,
630
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
631
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
632
- }, dn = {
633
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
634
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
635
- }, ln = {
636
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
637
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
638
- }, fn = {
639
- any: {
640
- am: /^a/i,
641
- pm: /^p/i,
642
- midnight: /^mi/i,
643
- noon: /^no/i,
644
- morning: /morning/i,
645
- afternoon: /afternoon/i,
646
- evening: /evening/i,
647
- night: /night/i
648
- }
649
- }, hn = {
650
- ordinalNumber: Jr({
651
- matchPattern: en,
652
- parsePattern: tn,
653
- valueCallback: (n) => parseInt(n, 10)
654
- }),
655
- era: te({
656
- matchPatterns: rn,
657
- defaultMatchWidth: "wide",
658
- parsePatterns: nn,
659
- defaultParseWidth: "any"
660
- }),
661
- quarter: te({
662
- matchPatterns: an,
663
- defaultMatchWidth: "wide",
664
- parsePatterns: sn,
665
- defaultParseWidth: "any",
666
- valueCallback: (n) => n + 1
667
- }),
668
- month: te({
669
- matchPatterns: on,
670
- defaultMatchWidth: "wide",
671
- parsePatterns: cn,
672
- defaultParseWidth: "any"
673
- }),
674
- day: te({
675
- matchPatterns: un,
676
- defaultMatchWidth: "wide",
677
- parsePatterns: dn,
678
- defaultParseWidth: "any"
679
- }),
680
- dayPeriod: te({
681
- matchPatterns: ln,
682
- defaultMatchWidth: "any",
683
- parsePatterns: fn,
684
- defaultParseWidth: "any"
685
- })
686
- }, Me = {
687
- code: "en-US",
688
- formatDistance: Hr,
689
- formatLong: Ar,
690
- formatRelative: Qr,
691
- localize: Ur,
692
- match: hn,
693
- options: {
694
- weekStartsOn: 0,
695
- firstWeekContainsDate: 1
696
- }
697
- };
698
- function de(n) {
699
- const r = u(n), e = new Date(
700
- Date.UTC(
701
- r.getFullYear(),
702
- r.getMonth(),
703
- r.getDate(),
704
- r.getHours(),
705
- r.getMinutes(),
706
- r.getSeconds(),
707
- r.getMilliseconds()
708
- )
709
- );
710
- return e.setUTCFullYear(r.getFullYear()), +n - +e;
711
- }
712
- function se(n, ...r) {
713
- const e = b.bind(
714
- null,
715
- r.find((t) => typeof t == "object")
716
- );
717
- return r.map(e);
718
- }
719
- function ae(n, r) {
720
- const e = u(n, r == null ? void 0 : r.in);
721
- return e.setHours(0, 0, 0, 0), e;
722
- }
723
- function mn(n, r, e) {
724
- const [t, a] = se(
725
- e == null ? void 0 : e.in,
726
- n,
727
- r
728
- ), i = ae(t), s = ae(a), c = +i - de(i), l = +s - de(s);
729
- return Math.round((c - l) / Pr);
730
- }
731
- function dt(n, r) {
732
- const e = u(n, r == null ? void 0 : r.in);
733
- return e.setFullYear(e.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
734
- }
735
- function gn(n, r) {
736
- const e = u(n, r == null ? void 0 : r.in);
737
- return mn(e, dt(e)) + 1;
738
- }
739
- function H(n, r) {
740
- var c, l, f, w;
741
- const e = Q(), t = (r == null ? void 0 : r.weekStartsOn) ?? ((l = (c = r == null ? void 0 : r.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? e.weekStartsOn ?? ((w = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : w.weekStartsOn) ?? 0, a = u(n, r == null ? void 0 : r.in), i = a.getDay(), s = (i < t ? 7 : 0) + i - t;
742
- return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
743
- }
744
- function V(n, r) {
745
- return H(n, { ...r, weekStartsOn: 1 });
746
- }
747
- function lt(n, r) {
748
- const e = u(n, r == null ? void 0 : r.in), t = e.getFullYear(), a = b(e, 0);
749
- a.setFullYear(t + 1, 0, 4), a.setHours(0, 0, 0, 0);
750
- const i = V(a), s = b(e, 0);
751
- s.setFullYear(t, 0, 4), s.setHours(0, 0, 0, 0);
752
- const c = V(s);
753
- return e.getTime() >= i.getTime() ? t + 1 : e.getTime() >= c.getTime() ? t : t - 1;
754
- }
755
- function yn(n, r) {
756
- const e = lt(n, r), t = b(n, 0);
757
- return t.setFullYear(e, 0, 4), t.setHours(0, 0, 0, 0), V(t);
758
- }
759
- function ft(n, r) {
760
- const e = u(n, r == null ? void 0 : r.in), t = +V(e) - +yn(e);
761
- return Math.round(t / it) + 1;
762
- }
763
- function Oe(n, r) {
764
- var w, P, Y, _;
765
- const e = u(n, r == null ? void 0 : r.in), t = e.getFullYear(), a = Q(), i = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((P = (w = r == null ? void 0 : r.locale) == null ? void 0 : w.options) == null ? void 0 : P.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((_ = (Y = a.locale) == null ? void 0 : Y.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, s = b((r == null ? void 0 : r.in) || n, 0);
766
- s.setFullYear(t + 1, 0, i), s.setHours(0, 0, 0, 0);
767
- const c = H(s, r), l = b((r == null ? void 0 : r.in) || n, 0);
768
- l.setFullYear(t, 0, i), l.setHours(0, 0, 0, 0);
769
- const f = H(l, r);
770
- return +e >= +c ? t + 1 : +e >= +f ? t : t - 1;
771
- }
772
- function wn(n, r) {
773
- var c, l, f, w;
774
- const e = Q(), t = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((l = (c = r == null ? void 0 : r.locale) == null ? void 0 : c.options) == null ? void 0 : l.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((w = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, a = Oe(n, r), i = b((r == null ? void 0 : r.in) || n, 0);
775
- return i.setFullYear(a, 0, t), i.setHours(0, 0, 0, 0), H(i, r);
776
- }
777
- function Pe(n, r) {
778
- const e = u(n, r == null ? void 0 : r.in), t = +H(e, r) - +wn(e, r);
779
- return Math.round(t / it) + 1;
780
- }
781
- function y(n, r) {
782
- const e = n < 0 ? "-" : "", t = Math.abs(n).toString().padStart(r, "0");
783
- return e + t;
784
- }
785
- const R = {
786
- // Year
787
- y(n, r) {
788
- const e = n.getFullYear(), t = e > 0 ? e : 1 - e;
789
- return y(r === "yy" ? t % 100 : t, r.length);
790
- },
791
- // Month
792
- M(n, r) {
793
- const e = n.getMonth();
794
- return r === "M" ? String(e + 1) : y(e + 1, 2);
795
- },
796
- // Day of the month
797
- d(n, r) {
798
- return y(n.getDate(), r.length);
799
- },
800
- // AM or PM
801
- a(n, r) {
802
- const e = n.getHours() / 12 >= 1 ? "pm" : "am";
803
- switch (r) {
804
- case "a":
805
- case "aa":
806
- return e.toUpperCase();
807
- case "aaa":
808
- return e;
809
- case "aaaaa":
810
- return e[0];
811
- case "aaaa":
812
- default:
813
- return e === "am" ? "a.m." : "p.m.";
814
- }
815
- },
816
- // Hour [1-12]
817
- h(n, r) {
818
- return y(n.getHours() % 12 || 12, r.length);
819
- },
820
- // Hour [0-23]
821
- H(n, r) {
822
- return y(n.getHours(), r.length);
823
- },
824
- // Minute
825
- m(n, r) {
826
- return y(n.getMinutes(), r.length);
827
- },
828
- // Second
829
- s(n, r) {
830
- return y(n.getSeconds(), r.length);
831
- },
832
- // Fraction of second
833
- S(n, r) {
834
- const e = r.length, t = n.getMilliseconds(), a = Math.trunc(
835
- t * Math.pow(10, e - 3)
836
- );
837
- return y(a, r.length);
838
- }
839
- }, B = {
840
- am: "am",
841
- pm: "pm",
842
- midnight: "midnight",
843
- noon: "noon",
844
- morning: "morning",
845
- afternoon: "afternoon",
846
- evening: "evening",
847
- night: "night"
848
- }, Be = {
849
- // Era
850
- G: function(n, r, e) {
851
- const t = n.getFullYear() > 0 ? 1 : 0;
852
- switch (r) {
853
- case "G":
854
- case "GG":
855
- case "GGG":
856
- return e.era(t, { width: "abbreviated" });
857
- case "GGGGG":
858
- return e.era(t, { width: "narrow" });
859
- case "GGGG":
860
- default:
861
- return e.era(t, { width: "wide" });
862
- }
863
- },
864
- // Year
865
- y: function(n, r, e) {
866
- if (r === "yo") {
867
- const t = n.getFullYear(), a = t > 0 ? t : 1 - t;
868
- return e.ordinalNumber(a, { unit: "year" });
869
- }
870
- return R.y(n, r);
871
- },
872
- // Local week-numbering year
873
- Y: function(n, r, e, t) {
874
- const a = Oe(n, t), i = a > 0 ? a : 1 - a;
875
- if (r === "YY") {
876
- const s = i % 100;
877
- return y(s, 2);
878
- }
879
- return r === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : y(i, r.length);
880
- },
881
- // ISO week-numbering year
882
- R: function(n, r) {
883
- const e = lt(n);
884
- return y(e, r.length);
885
- },
886
- // Extended year. This is a single number designating the year of this calendar system.
887
- // The main difference between `y` and `u` localizers are B.C. years:
888
- // | Year | `y` | `u` |
889
- // |------|-----|-----|
890
- // | AC 1 | 1 | 1 |
891
- // | BC 1 | 1 | 0 |
892
- // | BC 2 | 2 | -1 |
893
- // Also `yy` always returns the last two digits of a year,
894
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
895
- u: function(n, r) {
896
- const e = n.getFullYear();
897
- return y(e, r.length);
898
- },
899
- // Quarter
900
- Q: function(n, r, e) {
901
- const t = Math.ceil((n.getMonth() + 1) / 3);
902
- switch (r) {
903
- case "Q":
904
- return String(t);
905
- case "QQ":
906
- return y(t, 2);
907
- case "Qo":
908
- return e.ordinalNumber(t, { unit: "quarter" });
909
- case "QQQ":
910
- return e.quarter(t, {
911
- width: "abbreviated",
912
- context: "formatting"
913
- });
914
- case "QQQQQ":
915
- return e.quarter(t, {
916
- width: "narrow",
917
- context: "formatting"
918
- });
919
- case "QQQQ":
920
- default:
921
- return e.quarter(t, {
922
- width: "wide",
923
- context: "formatting"
924
- });
925
- }
926
- },
927
- // Stand-alone quarter
928
- q: function(n, r, e) {
929
- const t = Math.ceil((n.getMonth() + 1) / 3);
930
- switch (r) {
931
- case "q":
932
- return String(t);
933
- case "qq":
934
- return y(t, 2);
935
- case "qo":
936
- return e.ordinalNumber(t, { unit: "quarter" });
937
- case "qqq":
938
- return e.quarter(t, {
939
- width: "abbreviated",
940
- context: "standalone"
941
- });
942
- case "qqqqq":
943
- return e.quarter(t, {
944
- width: "narrow",
945
- context: "standalone"
946
- });
947
- case "qqqq":
948
- default:
949
- return e.quarter(t, {
950
- width: "wide",
951
- context: "standalone"
952
- });
953
- }
954
- },
955
- // Month
956
- M: function(n, r, e) {
957
- const t = n.getMonth();
958
- switch (r) {
959
- case "M":
960
- case "MM":
961
- return R.M(n, r);
962
- case "Mo":
963
- return e.ordinalNumber(t + 1, { unit: "month" });
964
- case "MMM":
965
- return e.month(t, {
966
- width: "abbreviated",
967
- context: "formatting"
968
- });
969
- case "MMMMM":
970
- return e.month(t, {
971
- width: "narrow",
972
- context: "formatting"
973
- });
974
- case "MMMM":
975
- default:
976
- return e.month(t, { width: "wide", context: "formatting" });
977
- }
978
- },
979
- // Stand-alone month
980
- L: function(n, r, e) {
981
- const t = n.getMonth();
982
- switch (r) {
983
- case "L":
984
- return String(t + 1);
985
- case "LL":
986
- return y(t + 1, 2);
987
- case "Lo":
988
- return e.ordinalNumber(t + 1, { unit: "month" });
989
- case "LLL":
990
- return e.month(t, {
991
- width: "abbreviated",
992
- context: "standalone"
993
- });
994
- case "LLLLL":
995
- return e.month(t, {
996
- width: "narrow",
997
- context: "standalone"
998
- });
999
- case "LLLL":
1000
- default:
1001
- return e.month(t, { width: "wide", context: "standalone" });
1002
- }
1003
- },
1004
- // Local week of year
1005
- w: function(n, r, e, t) {
1006
- const a = Pe(n, t);
1007
- return r === "wo" ? e.ordinalNumber(a, { unit: "week" }) : y(a, r.length);
1008
- },
1009
- // ISO week of year
1010
- I: function(n, r, e) {
1011
- const t = ft(n);
1012
- return r === "Io" ? e.ordinalNumber(t, { unit: "week" }) : y(t, r.length);
1013
- },
1014
- // Day of the month
1015
- d: function(n, r, e) {
1016
- return r === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : R.d(n, r);
1017
- },
1018
- // Day of year
1019
- D: function(n, r, e) {
1020
- const t = gn(n);
1021
- return r === "Do" ? e.ordinalNumber(t, { unit: "dayOfYear" }) : y(t, r.length);
1022
- },
1023
- // Day of week
1024
- E: function(n, r, e) {
1025
- const t = n.getDay();
1026
- switch (r) {
1027
- case "E":
1028
- case "EE":
1029
- case "EEE":
1030
- return e.day(t, {
1031
- width: "abbreviated",
1032
- context: "formatting"
1033
- });
1034
- case "EEEEE":
1035
- return e.day(t, {
1036
- width: "narrow",
1037
- context: "formatting"
1038
- });
1039
- case "EEEEEE":
1040
- return e.day(t, {
1041
- width: "short",
1042
- context: "formatting"
1043
- });
1044
- case "EEEE":
1045
- default:
1046
- return e.day(t, {
1047
- width: "wide",
1048
- context: "formatting"
1049
- });
1050
- }
1051
- },
1052
- // Local day of week
1053
- e: function(n, r, e, t) {
1054
- const a = n.getDay(), i = (a - t.weekStartsOn + 8) % 7 || 7;
1055
- switch (r) {
1056
- case "e":
1057
- return String(i);
1058
- case "ee":
1059
- return y(i, 2);
1060
- case "eo":
1061
- return e.ordinalNumber(i, { unit: "day" });
1062
- case "eee":
1063
- return e.day(a, {
1064
- width: "abbreviated",
1065
- context: "formatting"
1066
- });
1067
- case "eeeee":
1068
- return e.day(a, {
1069
- width: "narrow",
1070
- context: "formatting"
1071
- });
1072
- case "eeeeee":
1073
- return e.day(a, {
1074
- width: "short",
1075
- context: "formatting"
1076
- });
1077
- case "eeee":
1078
- default:
1079
- return e.day(a, {
1080
- width: "wide",
1081
- context: "formatting"
1082
- });
1083
- }
1084
- },
1085
- // Stand-alone local day of week
1086
- c: function(n, r, e, t) {
1087
- const a = n.getDay(), i = (a - t.weekStartsOn + 8) % 7 || 7;
1088
- switch (r) {
1089
- case "c":
1090
- return String(i);
1091
- case "cc":
1092
- return y(i, r.length);
1093
- case "co":
1094
- return e.ordinalNumber(i, { unit: "day" });
1095
- case "ccc":
1096
- return e.day(a, {
1097
- width: "abbreviated",
1098
- context: "standalone"
1099
- });
1100
- case "ccccc":
1101
- return e.day(a, {
1102
- width: "narrow",
1103
- context: "standalone"
1104
- });
1105
- case "cccccc":
1106
- return e.day(a, {
1107
- width: "short",
1108
- context: "standalone"
1109
- });
1110
- case "cccc":
1111
- default:
1112
- return e.day(a, {
1113
- width: "wide",
1114
- context: "standalone"
1115
- });
1116
- }
1117
- },
1118
- // ISO day of week
1119
- i: function(n, r, e) {
1120
- const t = n.getDay(), a = t === 0 ? 7 : t;
1121
- switch (r) {
1122
- case "i":
1123
- return String(a);
1124
- case "ii":
1125
- return y(a, r.length);
1126
- case "io":
1127
- return e.ordinalNumber(a, { unit: "day" });
1128
- case "iii":
1129
- return e.day(t, {
1130
- width: "abbreviated",
1131
- context: "formatting"
1132
- });
1133
- case "iiiii":
1134
- return e.day(t, {
1135
- width: "narrow",
1136
- context: "formatting"
1137
- });
1138
- case "iiiiii":
1139
- return e.day(t, {
1140
- width: "short",
1141
- context: "formatting"
1142
- });
1143
- case "iiii":
1144
- default:
1145
- return e.day(t, {
1146
- width: "wide",
1147
- context: "formatting"
1148
- });
1149
- }
1150
- },
1151
- // AM or PM
1152
- a: function(n, r, e) {
1153
- const a = n.getHours() / 12 >= 1 ? "pm" : "am";
1154
- switch (r) {
1155
- case "a":
1156
- case "aa":
1157
- return e.dayPeriod(a, {
1158
- width: "abbreviated",
1159
- context: "formatting"
1160
- });
1161
- case "aaa":
1162
- return e.dayPeriod(a, {
1163
- width: "abbreviated",
1164
- context: "formatting"
1165
- }).toLowerCase();
1166
- case "aaaaa":
1167
- return e.dayPeriod(a, {
1168
- width: "narrow",
1169
- context: "formatting"
1170
- });
1171
- case "aaaa":
1172
- default:
1173
- return e.dayPeriod(a, {
1174
- width: "wide",
1175
- context: "formatting"
1176
- });
1177
- }
1178
- },
1179
- // AM, PM, midnight, noon
1180
- b: function(n, r, e) {
1181
- const t = n.getHours();
1182
- let a;
1183
- switch (t === 12 ? a = B.noon : t === 0 ? a = B.midnight : a = t / 12 >= 1 ? "pm" : "am", r) {
1184
- case "b":
1185
- case "bb":
1186
- return e.dayPeriod(a, {
1187
- width: "abbreviated",
1188
- context: "formatting"
1189
- });
1190
- case "bbb":
1191
- return e.dayPeriod(a, {
1192
- width: "abbreviated",
1193
- context: "formatting"
1194
- }).toLowerCase();
1195
- case "bbbbb":
1196
- return e.dayPeriod(a, {
1197
- width: "narrow",
1198
- context: "formatting"
1199
- });
1200
- case "bbbb":
1201
- default:
1202
- return e.dayPeriod(a, {
1203
- width: "wide",
1204
- context: "formatting"
1205
- });
1206
- }
1207
- },
1208
- // in the morning, in the afternoon, in the evening, at night
1209
- B: function(n, r, e) {
1210
- const t = n.getHours();
1211
- let a;
1212
- switch (t >= 17 ? a = B.evening : t >= 12 ? a = B.afternoon : t >= 4 ? a = B.morning : a = B.night, r) {
1213
- case "B":
1214
- case "BB":
1215
- case "BBB":
1216
- return e.dayPeriod(a, {
1217
- width: "abbreviated",
1218
- context: "formatting"
1219
- });
1220
- case "BBBBB":
1221
- return e.dayPeriod(a, {
1222
- width: "narrow",
1223
- context: "formatting"
1224
- });
1225
- case "BBBB":
1226
- default:
1227
- return e.dayPeriod(a, {
1228
- width: "wide",
1229
- context: "formatting"
1230
- });
1231
- }
1232
- },
1233
- // Hour [1-12]
1234
- h: function(n, r, e) {
1235
- if (r === "ho") {
1236
- let t = n.getHours() % 12;
1237
- return t === 0 && (t = 12), e.ordinalNumber(t, { unit: "hour" });
1238
- }
1239
- return R.h(n, r);
1240
- },
1241
- // Hour [0-23]
1242
- H: function(n, r, e) {
1243
- return r === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : R.H(n, r);
1244
- },
1245
- // Hour [0-11]
1246
- K: function(n, r, e) {
1247
- const t = n.getHours() % 12;
1248
- return r === "Ko" ? e.ordinalNumber(t, { unit: "hour" }) : y(t, r.length);
1249
- },
1250
- // Hour [1-24]
1251
- k: function(n, r, e) {
1252
- let t = n.getHours();
1253
- return t === 0 && (t = 24), r === "ko" ? e.ordinalNumber(t, { unit: "hour" }) : y(t, r.length);
1254
- },
1255
- // Minute
1256
- m: function(n, r, e) {
1257
- return r === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : R.m(n, r);
1258
- },
1259
- // Second
1260
- s: function(n, r, e) {
1261
- return r === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : R.s(n, r);
1262
- },
1263
- // Fraction of second
1264
- S: function(n, r) {
1265
- return R.S(n, r);
1266
- },
1267
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1268
- X: function(n, r, e) {
1269
- const t = n.getTimezoneOffset();
1270
- if (t === 0)
1271
- return "Z";
1272
- switch (r) {
1273
- case "X":
1274
- return Ge(t);
1275
- case "XXXX":
1276
- case "XX":
1277
- return A(t);
1278
- case "XXXXX":
1279
- case "XXX":
1280
- default:
1281
- return A(t, ":");
1282
- }
1283
- },
1284
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1285
- x: function(n, r, e) {
1286
- const t = n.getTimezoneOffset();
1287
- switch (r) {
1288
- case "x":
1289
- return Ge(t);
1290
- case "xxxx":
1291
- case "xx":
1292
- return A(t);
1293
- case "xxxxx":
1294
- case "xxx":
1295
- default:
1296
- return A(t, ":");
1297
- }
1298
- },
1299
- // Timezone (GMT)
1300
- O: function(n, r, e) {
1301
- const t = n.getTimezoneOffset();
1302
- switch (r) {
1303
- case "O":
1304
- case "OO":
1305
- case "OOO":
1306
- return "GMT" + ze(t, ":");
1307
- case "OOOO":
1308
- default:
1309
- return "GMT" + A(t, ":");
1310
- }
1311
- },
1312
- // Timezone (specific non-location)
1313
- z: function(n, r, e) {
1314
- const t = n.getTimezoneOffset();
1315
- switch (r) {
1316
- case "z":
1317
- case "zz":
1318
- case "zzz":
1319
- return "GMT" + ze(t, ":");
1320
- case "zzzz":
1321
- default:
1322
- return "GMT" + A(t, ":");
1323
- }
1324
- },
1325
- // Seconds timestamp
1326
- t: function(n, r, e) {
1327
- const t = Math.trunc(+n / 1e3);
1328
- return y(t, r.length);
1329
- },
1330
- // Milliseconds timestamp
1331
- T: function(n, r, e) {
1332
- return y(+n, r.length);
1333
- }
1334
- };
1335
- function ze(n, r = "") {
1336
- const e = n > 0 ? "-" : "+", t = Math.abs(n), a = Math.trunc(t / 60), i = t % 60;
1337
- return i === 0 ? e + String(a) : e + String(a) + r + y(i, 2);
1338
- }
1339
- function Ge(n, r) {
1340
- return n % 60 === 0 ? (n > 0 ? "-" : "+") + y(Math.abs(n) / 60, 2) : A(n, r);
1341
- }
1342
- function A(n, r = "") {
1343
- const e = n > 0 ? "-" : "+", t = Math.abs(n), a = y(Math.trunc(t / 60), 2), i = y(t % 60, 2);
1344
- return e + a + r + i;
1345
- }
1346
- const Xe = (n, r) => {
1347
- switch (n) {
1348
- case "P":
1349
- return r.date({ width: "short" });
1350
- case "PP":
1351
- return r.date({ width: "medium" });
1352
- case "PPP":
1353
- return r.date({ width: "long" });
1354
- case "PPPP":
1355
- default:
1356
- return r.date({ width: "full" });
1357
- }
1358
- }, ht = (n, r) => {
1359
- switch (n) {
1360
- case "p":
1361
- return r.time({ width: "short" });
1362
- case "pp":
1363
- return r.time({ width: "medium" });
1364
- case "ppp":
1365
- return r.time({ width: "long" });
1366
- case "pppp":
1367
- default:
1368
- return r.time({ width: "full" });
1369
- }
1370
- }, bn = (n, r) => {
1371
- const e = n.match(/(P+)(p+)?/) || [], t = e[1], a = e[2];
1372
- if (!a)
1373
- return Xe(n, r);
1374
- let i;
1375
- switch (t) {
1376
- case "P":
1377
- i = r.dateTime({ width: "short" });
1378
- break;
1379
- case "PP":
1380
- i = r.dateTime({ width: "medium" });
1381
- break;
1382
- case "PPP":
1383
- i = r.dateTime({ width: "long" });
1384
- break;
1385
- case "PPPP":
1386
- default:
1387
- i = r.dateTime({ width: "full" });
1388
- break;
1389
- }
1390
- return i.replace("{{date}}", Xe(t, r)).replace("{{time}}", ht(a, r));
1391
- }, ie = {
1392
- p: ht,
1393
- P: bn
1394
- }, xn = /^D+$/, Tn = /^Y+$/, kn = ["D", "DD", "YY", "YYYY"];
1395
- function mt(n) {
1396
- return xn.test(n);
1397
- }
1398
- function gt(n) {
1399
- return Tn.test(n);
1400
- }
1401
- function ke(n, r, e) {
1402
- const t = pn(n, r, e);
1403
- if (console.warn(t), kn.includes(n)) throw new RangeError(t);
1404
- }
1405
- function pn(n, r, e) {
1406
- const t = n[0] === "Y" ? "years" : "days of the month";
1407
- return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${r}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1408
- }
1409
- function Dn(n) {
1410
- return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
1411
- }
1412
- function yt(n) {
1413
- return !(!Dn(n) && typeof n != "number" || isNaN(+u(n)));
1414
- }
1415
- const Mn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, On = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Pn = /^'([^]*?)'?$/, Yn = /''/g, vn = /[a-zA-Z]/;
1416
- function En(n, r, e) {
1417
- var w, P, Y, _, v, K, Z, J;
1418
- const t = Q(), a = (e == null ? void 0 : e.locale) ?? t.locale ?? Me, i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((P = (w = e == null ? void 0 : e.locale) == null ? void 0 : w.options) == null ? void 0 : P.firstWeekContainsDate) ?? t.firstWeekContainsDate ?? ((_ = (Y = t.locale) == null ? void 0 : Y.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, s = (e == null ? void 0 : e.weekStartsOn) ?? ((K = (v = e == null ? void 0 : e.locale) == null ? void 0 : v.options) == null ? void 0 : K.weekStartsOn) ?? t.weekStartsOn ?? ((J = (Z = t.locale) == null ? void 0 : Z.options) == null ? void 0 : J.weekStartsOn) ?? 0, c = u(n, e == null ? void 0 : e.in);
1419
- if (!yt(c))
1420
- throw new RangeError("Invalid time value");
1421
- let l = r.match(On).map((O) => {
1422
- const M = O[0];
1423
- if (M === "p" || M === "P") {
1424
- const j = ie[M];
1425
- return j(O, a.formatLong);
1426
- }
1427
- return O;
1428
- }).join("").match(Mn).map((O) => {
1429
- if (O === "''")
1430
- return { isToken: !1, value: "'" };
1431
- const M = O[0];
1432
- if (M === "'")
1433
- return { isToken: !1, value: _n(O) };
1434
- if (Be[M])
1435
- return { isToken: !0, value: O };
1436
- if (M.match(vn))
1437
- throw new RangeError(
1438
- "Format string contains an unescaped latin alphabet character `" + M + "`"
1439
- );
1440
- return { isToken: !1, value: O };
1441
- });
1442
- a.localize.preprocessor && (l = a.localize.preprocessor(c, l));
1443
- const f = {
1444
- firstWeekContainsDate: i,
1445
- weekStartsOn: s,
1446
- locale: a
1447
- };
1448
- return l.map((O) => {
1449
- if (!O.isToken) return O.value;
1450
- const M = O.value;
1451
- (!(e != null && e.useAdditionalWeekYearTokens) && gt(M) || !(e != null && e.useAdditionalDayOfYearTokens) && mt(M)) && ke(M, r, String(n));
1452
- const j = Be[M[0]];
1453
- return j(c, M, a.localize, f);
1454
- }).join("");
1455
- }
1456
- function _n(n) {
1457
- const r = n.match(Pn);
1458
- return r ? r[1].replace(Yn, "'") : n;
1459
- }
1460
- function Ln(n, r) {
1461
- return u(n, r == null ? void 0 : r.in).getDate();
1462
- }
1463
- function wt(n, r) {
1464
- const e = u(n, r == null ? void 0 : r.in), t = e.getFullYear(), a = e.getMonth(), i = b(e, 0);
1465
- return i.setFullYear(t, a + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
1466
- }
1467
- function Cn(n, r) {
1468
- return u(n, r == null ? void 0 : r.in).getHours();
1469
- }
1470
- function Wn(n, r) {
1471
- return u(n, r == null ? void 0 : r.in).getMinutes();
1472
- }
1473
- function In(n, r) {
1474
- return u(n, r == null ? void 0 : r.in).getMonth();
1475
- }
1476
- function qn(n) {
1477
- return u(n).getSeconds();
1478
- }
1479
- function Hn(n) {
1480
- return u(n).getMilliseconds();
1481
- }
1482
- function Fn(n, r) {
1483
- return u(n, r == null ? void 0 : r.in).getFullYear();
1484
- }
1485
- function be(n, r) {
1486
- return +u(n) > +u(r);
1487
- }
1488
- function xe(n, r) {
1489
- return +u(n) < +u(r);
1490
- }
1491
- function Nn(n, r) {
1492
- return +u(n) == +u(r);
1493
- }
1494
- function Rn(n, r, e) {
1495
- const [t, a] = se(
1496
- e == null ? void 0 : e.in,
1497
- n,
1498
- r
1499
- );
1500
- return +ae(t) == +ae(a);
1501
- }
1502
- function An(n, r, e) {
1503
- const [t, a] = se(
1504
- e == null ? void 0 : e.in,
1505
- n,
1506
- r
1507
- );
1508
- return t.getFullYear() === a.getFullYear();
1509
- }
1510
- function Sn(n, r, e) {
1511
- const [t, a] = se(
1512
- e == null ? void 0 : e.in,
1513
- n,
1514
- r
1515
- );
1516
- return t.getFullYear() === a.getFullYear() && t.getMonth() === a.getMonth();
1517
- }
1518
- function $e(n, r) {
1519
- const e = u(n, r == null ? void 0 : r.in);
1520
- return e.setMinutes(0, 0, 0), e;
1521
- }
1522
- function Qn(n, r, e) {
1523
- const [t, a] = se(
1524
- e == null ? void 0 : e.in,
1525
- n,
1526
- r
1527
- );
1528
- return +$e(t) == +$e(a);
1529
- }
1530
- function jn() {
1531
- return Object.assign({}, Q());
1532
- }
1533
- function Bn(n, r) {
1534
- const e = zn(r) ? new r(0) : b(r, 0);
1535
- return e.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), e.setHours(
1536
- n.getHours(),
1537
- n.getMinutes(),
1538
- n.getSeconds(),
1539
- n.getMilliseconds()
1540
- ), e;
1541
- }
1542
- function zn(n) {
1543
- var r;
1544
- return typeof n == "function" && ((r = n.prototype) == null ? void 0 : r.constructor) === n;
1545
- }
1546
- const Gn = 10;
1547
- class bt {
1548
- constructor() {
1549
- o(this, "subPriority", 0);
1550
- }
1551
- validate(r, e) {
1552
- return !0;
1553
- }
1554
- }
1555
- class Xn extends bt {
1556
- constructor(r, e, t, a, i) {
1557
- super(), this.value = r, this.validateValue = e, this.setValue = t, this.priority = a, i && (this.subPriority = i);
1558
- }
1559
- validate(r, e) {
1560
- return this.validateValue(r, this.value, e);
1561
- }
1562
- set(r, e, t) {
1563
- return this.setValue(r, e, this.value, t);
1564
- }
1565
- }
1566
- class $n extends bt {
1567
- constructor(e, t) {
1568
- super();
1569
- o(this, "priority", Gn);
1570
- o(this, "subPriority", -1);
1571
- this.context = e || ((a) => b(t, a));
1572
- }
1573
- set(e, t) {
1574
- return t.timestampIsSet ? e : b(e, Bn(e, this.context));
1575
- }
1576
- }
1577
- class g {
1578
- run(r, e, t, a) {
1579
- const i = this.parse(r, e, t, a);
1580
- return i ? {
1581
- setter: new Xn(
1582
- i.value,
1583
- this.validate,
1584
- this.set,
1585
- this.priority,
1586
- this.subPriority
1587
- ),
1588
- rest: i.rest
1589
- } : null;
1590
- }
1591
- validate(r, e, t) {
1592
- return !0;
1593
- }
1594
- }
1595
- class Vn extends g {
1596
- constructor() {
1597
- super(...arguments);
1598
- o(this, "priority", 140);
1599
- o(this, "incompatibleTokens", ["R", "u", "t", "T"]);
1600
- }
1601
- parse(e, t, a) {
1602
- switch (t) {
1603
- case "G":
1604
- case "GG":
1605
- case "GGG":
1606
- return a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
1607
- case "GGGGG":
1608
- return a.era(e, { width: "narrow" });
1609
- case "GGGG":
1610
- default:
1611
- return a.era(e, { width: "wide" }) || a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
1612
- }
1613
- }
1614
- set(e, t, a) {
1615
- return t.era = a, e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
1616
- }
1617
- }
1618
- const p = {
1619
- month: /^(1[0-2]|0?\d)/,
1620
- // 0 to 12
1621
- date: /^(3[0-1]|[0-2]?\d)/,
1622
- // 0 to 31
1623
- dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
1624
- // 0 to 366
1625
- week: /^(5[0-3]|[0-4]?\d)/,
1626
- // 0 to 53
1627
- hour23h: /^(2[0-3]|[0-1]?\d)/,
1628
- // 0 to 23
1629
- hour24h: /^(2[0-4]|[0-1]?\d)/,
1630
- // 0 to 24
1631
- hour11h: /^(1[0-1]|0?\d)/,
1632
- // 0 to 11
1633
- hour12h: /^(1[0-2]|0?\d)/,
1634
- // 0 to 12
1635
- minute: /^[0-5]?\d/,
1636
- // 0 to 59
1637
- second: /^[0-5]?\d/,
1638
- // 0 to 59
1639
- singleDigit: /^\d/,
1640
- // 0 to 9
1641
- twoDigits: /^\d{1,2}/,
1642
- // 0 to 99
1643
- threeDigits: /^\d{1,3}/,
1644
- // 0 to 999
1645
- fourDigits: /^\d{1,4}/,
1646
- // 0 to 9999
1647
- anyDigitsSigned: /^-?\d+/,
1648
- singleDigitSigned: /^-?\d/,
1649
- // 0 to 9, -0 to -9
1650
- twoDigitsSigned: /^-?\d{1,2}/,
1651
- // 0 to 99, -0 to -99
1652
- threeDigitsSigned: /^-?\d{1,3}/,
1653
- // 0 to 999, -0 to -999
1654
- fourDigitsSigned: /^-?\d{1,4}/
1655
- // 0 to 9999, -0 to -9999
1656
- }, C = {
1657
- basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
1658
- basic: /^([+-])(\d{2})(\d{2})|Z/,
1659
- basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
1660
- extended: /^([+-])(\d{2}):(\d{2})|Z/,
1661
- extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
1662
- };
1663
- function D(n, r) {
1664
- return n && {
1665
- value: r(n.value),
1666
- rest: n.rest
1667
- };
1668
- }
1669
- function x(n, r) {
1670
- const e = r.match(n);
1671
- return e ? {
1672
- value: parseInt(e[0], 10),
1673
- rest: r.slice(e[0].length)
1674
- } : null;
1675
- }
1676
- function W(n, r) {
1677
- const e = r.match(n);
1678
- if (!e)
1679
- return null;
1680
- if (e[0] === "Z")
1681
- return {
1682
- value: 0,
1683
- rest: r.slice(1)
1684
- };
1685
- const t = e[1] === "+" ? 1 : -1, a = e[2] ? parseInt(e[2], 10) : 0, i = e[3] ? parseInt(e[3], 10) : 0, s = e[5] ? parseInt(e[5], 10) : 0;
1686
- return {
1687
- value: t * (a * ot + i * st + s * Yr),
1688
- rest: r.slice(e[0].length)
1689
- };
1690
- }
1691
- function xt(n) {
1692
- return x(p.anyDigitsSigned, n);
1693
- }
1694
- function k(n, r) {
1695
- switch (n) {
1696
- case 1:
1697
- return x(p.singleDigit, r);
1698
- case 2:
1699
- return x(p.twoDigits, r);
1700
- case 3:
1701
- return x(p.threeDigits, r);
1702
- case 4:
1703
- return x(p.fourDigits, r);
1704
- default:
1705
- return x(new RegExp("^\\d{1," + n + "}"), r);
1706
- }
1707
- }
1708
- function le(n, r) {
1709
- switch (n) {
1710
- case 1:
1711
- return x(p.singleDigitSigned, r);
1712
- case 2:
1713
- return x(p.twoDigitsSigned, r);
1714
- case 3:
1715
- return x(p.threeDigitsSigned, r);
1716
- case 4:
1717
- return x(p.fourDigitsSigned, r);
1718
- default:
1719
- return x(new RegExp("^-?\\d{1," + n + "}"), r);
1720
- }
1721
- }
1722
- function Ye(n) {
1723
- switch (n) {
1724
- case "morning":
1725
- return 4;
1726
- case "evening":
1727
- return 17;
1728
- case "pm":
1729
- case "noon":
1730
- case "afternoon":
1731
- return 12;
1732
- case "am":
1733
- case "midnight":
1734
- case "night":
1735
- default:
1736
- return 0;
1737
- }
1738
- }
1739
- function Tt(n, r) {
1740
- const e = r > 0, t = e ? r : 1 - r;
1741
- let a;
1742
- if (t <= 50)
1743
- a = n || 100;
1744
- else {
1745
- const i = t + 50, s = Math.trunc(i / 100) * 100, c = n >= i % 100;
1746
- a = n + s - (c ? 100 : 0);
1747
- }
1748
- return e ? a : 1 - a;
1749
- }
1750
- function kt(n) {
1751
- return n % 400 === 0 || n % 4 === 0 && n % 100 !== 0;
1752
- }
1753
- class Un extends g {
1754
- constructor() {
1755
- super(...arguments);
1756
- o(this, "priority", 130);
1757
- o(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
1758
- }
1759
- parse(e, t, a) {
1760
- const i = (s) => ({
1761
- year: s,
1762
- isTwoDigitYear: t === "yy"
1763
- });
1764
- switch (t) {
1765
- case "y":
1766
- return D(k(4, e), i);
1767
- case "yo":
1768
- return D(
1769
- a.ordinalNumber(e, {
1770
- unit: "year"
1771
- }),
1772
- i
1773
- );
1774
- default:
1775
- return D(k(t.length, e), i);
1776
- }
1777
- }
1778
- validate(e, t) {
1779
- return t.isTwoDigitYear || t.year > 0;
1780
- }
1781
- set(e, t, a) {
1782
- const i = e.getFullYear();
1783
- if (a.isTwoDigitYear) {
1784
- const c = Tt(
1785
- a.year,
1786
- i
1787
- );
1788
- return e.setFullYear(c, 0, 1), e.setHours(0, 0, 0, 0), e;
1789
- }
1790
- const s = !("era" in t) || t.era === 1 ? a.year : 1 - a.year;
1791
- return e.setFullYear(s, 0, 1), e.setHours(0, 0, 0, 0), e;
1792
- }
1793
- }
1794
- class Kn extends g {
1795
- constructor() {
1796
- super(...arguments);
1797
- o(this, "priority", 130);
1798
- o(this, "incompatibleTokens", [
1799
- "y",
1800
- "R",
1801
- "u",
1802
- "Q",
1803
- "q",
1804
- "M",
1805
- "L",
1806
- "I",
1807
- "d",
1808
- "D",
1809
- "i",
1810
- "t",
1811
- "T"
1812
- ]);
1813
- }
1814
- parse(e, t, a) {
1815
- const i = (s) => ({
1816
- year: s,
1817
- isTwoDigitYear: t === "YY"
1818
- });
1819
- switch (t) {
1820
- case "Y":
1821
- return D(k(4, e), i);
1822
- case "Yo":
1823
- return D(
1824
- a.ordinalNumber(e, {
1825
- unit: "year"
1826
- }),
1827
- i
1828
- );
1829
- default:
1830
- return D(k(t.length, e), i);
1831
- }
1832
- }
1833
- validate(e, t) {
1834
- return t.isTwoDigitYear || t.year > 0;
1835
- }
1836
- set(e, t, a, i) {
1837
- const s = Oe(e, i);
1838
- if (a.isTwoDigitYear) {
1839
- const l = Tt(
1840
- a.year,
1841
- s
1842
- );
1843
- return e.setFullYear(
1844
- l,
1845
- 0,
1846
- i.firstWeekContainsDate
1847
- ), e.setHours(0, 0, 0, 0), H(e, i);
1848
- }
1849
- const c = !("era" in t) || t.era === 1 ? a.year : 1 - a.year;
1850
- return e.setFullYear(c, 0, i.firstWeekContainsDate), e.setHours(0, 0, 0, 0), H(e, i);
1851
- }
1852
- }
1853
- class Zn extends g {
1854
- constructor() {
1855
- super(...arguments);
1856
- o(this, "priority", 130);
1857
- o(this, "incompatibleTokens", [
1858
- "G",
1859
- "y",
1860
- "Y",
1861
- "u",
1862
- "Q",
1863
- "q",
1864
- "M",
1865
- "L",
1866
- "w",
1867
- "d",
1868
- "D",
1869
- "e",
1870
- "c",
1871
- "t",
1872
- "T"
1873
- ]);
1874
- }
1875
- parse(e, t) {
1876
- return le(t === "R" ? 4 : t.length, e);
1877
- }
1878
- set(e, t, a) {
1879
- const i = b(e, 0);
1880
- return i.setFullYear(a, 0, 4), i.setHours(0, 0, 0, 0), V(i);
1881
- }
1882
- }
1883
- class Jn extends g {
1884
- constructor() {
1885
- super(...arguments);
1886
- o(this, "priority", 130);
1887
- o(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
1888
- }
1889
- parse(e, t) {
1890
- return le(t === "u" ? 4 : t.length, e);
1891
- }
1892
- set(e, t, a) {
1893
- return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
1894
- }
1895
- }
1896
- class ea extends g {
1897
- constructor() {
1898
- super(...arguments);
1899
- o(this, "priority", 120);
1900
- o(this, "incompatibleTokens", [
1901
- "Y",
1902
- "R",
1903
- "q",
1904
- "M",
1905
- "L",
1906
- "w",
1907
- "I",
1908
- "d",
1909
- "D",
1910
- "i",
1911
- "e",
1912
- "c",
1913
- "t",
1914
- "T"
1915
- ]);
1916
- }
1917
- parse(e, t, a) {
1918
- switch (t) {
1919
- case "Q":
1920
- case "QQ":
1921
- return k(t.length, e);
1922
- case "Qo":
1923
- return a.ordinalNumber(e, { unit: "quarter" });
1924
- case "QQQ":
1925
- return a.quarter(e, {
1926
- width: "abbreviated",
1927
- context: "formatting"
1928
- }) || a.quarter(e, {
1929
- width: "narrow",
1930
- context: "formatting"
1931
- });
1932
- case "QQQQQ":
1933
- return a.quarter(e, {
1934
- width: "narrow",
1935
- context: "formatting"
1936
- });
1937
- case "QQQQ":
1938
- default:
1939
- return a.quarter(e, {
1940
- width: "wide",
1941
- context: "formatting"
1942
- }) || a.quarter(e, {
1943
- width: "abbreviated",
1944
- context: "formatting"
1945
- }) || a.quarter(e, {
1946
- width: "narrow",
1947
- context: "formatting"
1948
- });
1949
- }
1950
- }
1951
- validate(e, t) {
1952
- return t >= 1 && t <= 4;
1953
- }
1954
- set(e, t, a) {
1955
- return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
1956
- }
1957
- }
1958
- class ta extends g {
1959
- constructor() {
1960
- super(...arguments);
1961
- o(this, "priority", 120);
1962
- o(this, "incompatibleTokens", [
1963
- "Y",
1964
- "R",
1965
- "Q",
1966
- "M",
1967
- "L",
1968
- "w",
1969
- "I",
1970
- "d",
1971
- "D",
1972
- "i",
1973
- "e",
1974
- "c",
1975
- "t",
1976
- "T"
1977
- ]);
1978
- }
1979
- parse(e, t, a) {
1980
- switch (t) {
1981
- case "q":
1982
- case "qq":
1983
- return k(t.length, e);
1984
- case "qo":
1985
- return a.ordinalNumber(e, { unit: "quarter" });
1986
- case "qqq":
1987
- return a.quarter(e, {
1988
- width: "abbreviated",
1989
- context: "standalone"
1990
- }) || a.quarter(e, {
1991
- width: "narrow",
1992
- context: "standalone"
1993
- });
1994
- case "qqqqq":
1995
- return a.quarter(e, {
1996
- width: "narrow",
1997
- context: "standalone"
1998
- });
1999
- case "qqqq":
2000
- default:
2001
- return a.quarter(e, {
2002
- width: "wide",
2003
- context: "standalone"
2004
- }) || a.quarter(e, {
2005
- width: "abbreviated",
2006
- context: "standalone"
2007
- }) || a.quarter(e, {
2008
- width: "narrow",
2009
- context: "standalone"
2010
- });
2011
- }
2012
- }
2013
- validate(e, t) {
2014
- return t >= 1 && t <= 4;
2015
- }
2016
- set(e, t, a) {
2017
- return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
2018
- }
2019
- }
2020
- class ra extends g {
2021
- constructor() {
2022
- super(...arguments);
2023
- o(this, "incompatibleTokens", [
2024
- "Y",
2025
- "R",
2026
- "q",
2027
- "Q",
2028
- "L",
2029
- "w",
2030
- "I",
2031
- "D",
2032
- "i",
2033
- "e",
2034
- "c",
2035
- "t",
2036
- "T"
2037
- ]);
2038
- o(this, "priority", 110);
2039
- }
2040
- parse(e, t, a) {
2041
- const i = (s) => s - 1;
2042
- switch (t) {
2043
- case "M":
2044
- return D(
2045
- x(p.month, e),
2046
- i
2047
- );
2048
- case "MM":
2049
- return D(k(2, e), i);
2050
- case "Mo":
2051
- return D(
2052
- a.ordinalNumber(e, {
2053
- unit: "month"
2054
- }),
2055
- i
2056
- );
2057
- case "MMM":
2058
- return a.month(e, {
2059
- width: "abbreviated",
2060
- context: "formatting"
2061
- }) || a.month(e, { width: "narrow", context: "formatting" });
2062
- case "MMMMM":
2063
- return a.month(e, {
2064
- width: "narrow",
2065
- context: "formatting"
2066
- });
2067
- case "MMMM":
2068
- default:
2069
- return a.month(e, { width: "wide", context: "formatting" }) || a.month(e, {
2070
- width: "abbreviated",
2071
- context: "formatting"
2072
- }) || a.month(e, { width: "narrow", context: "formatting" });
2073
- }
2074
- }
2075
- validate(e, t) {
2076
- return t >= 0 && t <= 11;
2077
- }
2078
- set(e, t, a) {
2079
- return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
2080
- }
2081
- }
2082
- class na extends g {
2083
- constructor() {
2084
- super(...arguments);
2085
- o(this, "priority", 110);
2086
- o(this, "incompatibleTokens", [
2087
- "Y",
2088
- "R",
2089
- "q",
2090
- "Q",
2091
- "M",
2092
- "w",
2093
- "I",
2094
- "D",
2095
- "i",
2096
- "e",
2097
- "c",
2098
- "t",
2099
- "T"
2100
- ]);
2101
- }
2102
- parse(e, t, a) {
2103
- const i = (s) => s - 1;
2104
- switch (t) {
2105
- case "L":
2106
- return D(
2107
- x(p.month, e),
2108
- i
2109
- );
2110
- case "LL":
2111
- return D(k(2, e), i);
2112
- case "Lo":
2113
- return D(
2114
- a.ordinalNumber(e, {
2115
- unit: "month"
2116
- }),
2117
- i
2118
- );
2119
- case "LLL":
2120
- return a.month(e, {
2121
- width: "abbreviated",
2122
- context: "standalone"
2123
- }) || a.month(e, { width: "narrow", context: "standalone" });
2124
- case "LLLLL":
2125
- return a.month(e, {
2126
- width: "narrow",
2127
- context: "standalone"
2128
- });
2129
- case "LLLL":
2130
- default:
2131
- return a.month(e, { width: "wide", context: "standalone" }) || a.month(e, {
2132
- width: "abbreviated",
2133
- context: "standalone"
2134
- }) || a.month(e, { width: "narrow", context: "standalone" });
2135
- }
2136
- }
2137
- validate(e, t) {
2138
- return t >= 0 && t <= 11;
2139
- }
2140
- set(e, t, a) {
2141
- return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
2142
- }
2143
- }
2144
- function aa(n, r, e) {
2145
- const t = u(n, e == null ? void 0 : e.in), a = Pe(t, e) - r;
2146
- return t.setDate(t.getDate() - a * 7), u(t, e == null ? void 0 : e.in);
2147
- }
2148
- class ia extends g {
2149
- constructor() {
2150
- super(...arguments);
2151
- o(this, "priority", 100);
2152
- o(this, "incompatibleTokens", [
2153
- "y",
2154
- "R",
2155
- "u",
2156
- "q",
2157
- "Q",
2158
- "M",
2159
- "L",
2160
- "I",
2161
- "d",
2162
- "D",
2163
- "i",
2164
- "t",
2165
- "T"
2166
- ]);
2167
- }
2168
- parse(e, t, a) {
2169
- switch (t) {
2170
- case "w":
2171
- return x(p.week, e);
2172
- case "wo":
2173
- return a.ordinalNumber(e, { unit: "week" });
2174
- default:
2175
- return k(t.length, e);
2176
- }
2177
- }
2178
- validate(e, t) {
2179
- return t >= 1 && t <= 53;
2180
- }
2181
- set(e, t, a, i) {
2182
- return H(aa(e, a, i), i);
2183
- }
2184
- }
2185
- function sa(n, r, e) {
2186
- const t = u(n, e == null ? void 0 : e.in), a = ft(t, e) - r;
2187
- return t.setDate(t.getDate() - a * 7), t;
2188
- }
2189
- class oa extends g {
2190
- constructor() {
2191
- super(...arguments);
2192
- o(this, "priority", 100);
2193
- o(this, "incompatibleTokens", [
2194
- "y",
2195
- "Y",
2196
- "u",
2197
- "q",
2198
- "Q",
2199
- "M",
2200
- "L",
2201
- "w",
2202
- "d",
2203
- "D",
2204
- "e",
2205
- "c",
2206
- "t",
2207
- "T"
2208
- ]);
2209
- }
2210
- parse(e, t, a) {
2211
- switch (t) {
2212
- case "I":
2213
- return x(p.week, e);
2214
- case "Io":
2215
- return a.ordinalNumber(e, { unit: "week" });
2216
- default:
2217
- return k(t.length, e);
2218
- }
2219
- }
2220
- validate(e, t) {
2221
- return t >= 1 && t <= 53;
2222
- }
2223
- set(e, t, a) {
2224
- return V(sa(e, a));
2225
- }
2226
- }
2227
- const ca = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ua = [
2228
- 31,
2229
- 29,
2230
- 31,
2231
- 30,
2232
- 31,
2233
- 30,
2234
- 31,
2235
- 31,
2236
- 30,
2237
- 31,
2238
- 30,
2239
- 31
2240
- ];
2241
- class da extends g {
2242
- constructor() {
2243
- super(...arguments);
2244
- o(this, "priority", 90);
2245
- o(this, "subPriority", 1);
2246
- o(this, "incompatibleTokens", [
2247
- "Y",
2248
- "R",
2249
- "q",
2250
- "Q",
2251
- "w",
2252
- "I",
2253
- "D",
2254
- "i",
2255
- "e",
2256
- "c",
2257
- "t",
2258
- "T"
2259
- ]);
2260
- }
2261
- parse(e, t, a) {
2262
- switch (t) {
2263
- case "d":
2264
- return x(p.date, e);
2265
- case "do":
2266
- return a.ordinalNumber(e, { unit: "date" });
2267
- default:
2268
- return k(t.length, e);
2269
- }
2270
- }
2271
- validate(e, t) {
2272
- const a = e.getFullYear(), i = kt(a), s = e.getMonth();
2273
- return i ? t >= 1 && t <= ua[s] : t >= 1 && t <= ca[s];
2274
- }
2275
- set(e, t, a) {
2276
- return e.setDate(a), e.setHours(0, 0, 0, 0), e;
2277
- }
2278
- }
2279
- class la extends g {
2280
- constructor() {
2281
- super(...arguments);
2282
- o(this, "priority", 90);
2283
- o(this, "subpriority", 1);
2284
- o(this, "incompatibleTokens", [
2285
- "Y",
2286
- "R",
2287
- "q",
2288
- "Q",
2289
- "M",
2290
- "L",
2291
- "w",
2292
- "I",
2293
- "d",
2294
- "E",
2295
- "i",
2296
- "e",
2297
- "c",
2298
- "t",
2299
- "T"
2300
- ]);
2301
- }
2302
- parse(e, t, a) {
2303
- switch (t) {
2304
- case "D":
2305
- case "DD":
2306
- return x(p.dayOfYear, e);
2307
- case "Do":
2308
- return a.ordinalNumber(e, { unit: "date" });
2309
- default:
2310
- return k(t.length, e);
2311
- }
2312
- }
2313
- validate(e, t) {
2314
- const a = e.getFullYear();
2315
- return kt(a) ? t >= 1 && t <= 366 : t >= 1 && t <= 365;
2316
- }
2317
- set(e, t, a) {
2318
- return e.setMonth(0, a), e.setHours(0, 0, 0, 0), e;
2319
- }
2320
- }
2321
- function ve(n, r, e) {
2322
- var P, Y, _, v;
2323
- const t = Q(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((Y = (P = e == null ? void 0 : e.locale) == null ? void 0 : P.options) == null ? void 0 : Y.weekStartsOn) ?? t.weekStartsOn ?? ((v = (_ = t.locale) == null ? void 0 : _.options) == null ? void 0 : v.weekStartsOn) ?? 0, i = u(n, e == null ? void 0 : e.in), s = i.getDay(), l = (r % 7 + 7) % 7, f = 7 - a, w = r < 0 || r > 6 ? r - (s + f) % 7 : (l + f) % 7 - (s + f) % 7;
2324
- return ne(i, w, e);
2325
- }
2326
- class fa extends g {
2327
- constructor() {
2328
- super(...arguments);
2329
- o(this, "priority", 90);
2330
- o(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
2331
- }
2332
- parse(e, t, a) {
2333
- switch (t) {
2334
- case "E":
2335
- case "EE":
2336
- case "EEE":
2337
- return a.day(e, {
2338
- width: "abbreviated",
2339
- context: "formatting"
2340
- }) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2341
- case "EEEEE":
2342
- return a.day(e, {
2343
- width: "narrow",
2344
- context: "formatting"
2345
- });
2346
- case "EEEEEE":
2347
- return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2348
- case "EEEE":
2349
- default:
2350
- return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
2351
- width: "abbreviated",
2352
- context: "formatting"
2353
- }) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2354
- }
2355
- }
2356
- validate(e, t) {
2357
- return t >= 0 && t <= 6;
2358
- }
2359
- set(e, t, a, i) {
2360
- return e = ve(e, a, i), e.setHours(0, 0, 0, 0), e;
2361
- }
2362
- }
2363
- class ha extends g {
2364
- constructor() {
2365
- super(...arguments);
2366
- o(this, "priority", 90);
2367
- o(this, "incompatibleTokens", [
2368
- "y",
2369
- "R",
2370
- "u",
2371
- "q",
2372
- "Q",
2373
- "M",
2374
- "L",
2375
- "I",
2376
- "d",
2377
- "D",
2378
- "E",
2379
- "i",
2380
- "c",
2381
- "t",
2382
- "T"
2383
- ]);
2384
- }
2385
- parse(e, t, a, i) {
2386
- const s = (c) => {
2387
- const l = Math.floor((c - 1) / 7) * 7;
2388
- return (c + i.weekStartsOn + 6) % 7 + l;
2389
- };
2390
- switch (t) {
2391
- case "e":
2392
- case "ee":
2393
- return D(k(t.length, e), s);
2394
- case "eo":
2395
- return D(
2396
- a.ordinalNumber(e, {
2397
- unit: "day"
2398
- }),
2399
- s
2400
- );
2401
- case "eee":
2402
- return a.day(e, {
2403
- width: "abbreviated",
2404
- context: "formatting"
2405
- }) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2406
- case "eeeee":
2407
- return a.day(e, {
2408
- width: "narrow",
2409
- context: "formatting"
2410
- });
2411
- case "eeeeee":
2412
- return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2413
- case "eeee":
2414
- default:
2415
- return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
2416
- width: "abbreviated",
2417
- context: "formatting"
2418
- }) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
2419
- }
2420
- }
2421
- validate(e, t) {
2422
- return t >= 0 && t <= 6;
2423
- }
2424
- set(e, t, a, i) {
2425
- return e = ve(e, a, i), e.setHours(0, 0, 0, 0), e;
2426
- }
2427
- }
2428
- class ma extends g {
2429
- constructor() {
2430
- super(...arguments);
2431
- o(this, "priority", 90);
2432
- o(this, "incompatibleTokens", [
2433
- "y",
2434
- "R",
2435
- "u",
2436
- "q",
2437
- "Q",
2438
- "M",
2439
- "L",
2440
- "I",
2441
- "d",
2442
- "D",
2443
- "E",
2444
- "i",
2445
- "e",
2446
- "t",
2447
- "T"
2448
- ]);
2449
- }
2450
- parse(e, t, a, i) {
2451
- const s = (c) => {
2452
- const l = Math.floor((c - 1) / 7) * 7;
2453
- return (c + i.weekStartsOn + 6) % 7 + l;
2454
- };
2455
- switch (t) {
2456
- case "c":
2457
- case "cc":
2458
- return D(k(t.length, e), s);
2459
- case "co":
2460
- return D(
2461
- a.ordinalNumber(e, {
2462
- unit: "day"
2463
- }),
2464
- s
2465
- );
2466
- case "ccc":
2467
- return a.day(e, {
2468
- width: "abbreviated",
2469
- context: "standalone"
2470
- }) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
2471
- case "ccccc":
2472
- return a.day(e, {
2473
- width: "narrow",
2474
- context: "standalone"
2475
- });
2476
- case "cccccc":
2477
- return a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
2478
- case "cccc":
2479
- default:
2480
- return a.day(e, { width: "wide", context: "standalone" }) || a.day(e, {
2481
- width: "abbreviated",
2482
- context: "standalone"
2483
- }) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
2484
- }
2485
- }
2486
- validate(e, t) {
2487
- return t >= 0 && t <= 6;
2488
- }
2489
- set(e, t, a, i) {
2490
- return e = ve(e, a, i), e.setHours(0, 0, 0, 0), e;
2491
- }
2492
- }
2493
- function ga(n, r) {
2494
- const e = u(n, r == null ? void 0 : r.in).getDay();
2495
- return e === 0 ? 7 : e;
2496
- }
2497
- function ya(n, r, e) {
2498
- const t = u(n, e == null ? void 0 : e.in), a = ga(t, e), i = r - a;
2499
- return ne(t, i, e);
2500
- }
2501
- class wa extends g {
2502
- constructor() {
2503
- super(...arguments);
2504
- o(this, "priority", 90);
2505
- o(this, "incompatibleTokens", [
2506
- "y",
2507
- "Y",
2508
- "u",
2509
- "q",
2510
- "Q",
2511
- "M",
2512
- "L",
2513
- "w",
2514
- "d",
2515
- "D",
2516
- "E",
2517
- "e",
2518
- "c",
2519
- "t",
2520
- "T"
2521
- ]);
2522
- }
2523
- parse(e, t, a) {
2524
- const i = (s) => s === 0 ? 7 : s;
2525
- switch (t) {
2526
- case "i":
2527
- case "ii":
2528
- return k(t.length, e);
2529
- case "io":
2530
- return a.ordinalNumber(e, { unit: "day" });
2531
- case "iii":
2532
- return D(
2533
- a.day(e, {
2534
- width: "abbreviated",
2535
- context: "formatting"
2536
- }) || a.day(e, {
2537
- width: "short",
2538
- context: "formatting"
2539
- }) || a.day(e, {
2540
- width: "narrow",
2541
- context: "formatting"
2542
- }),
2543
- i
2544
- );
2545
- case "iiiii":
2546
- return D(
2547
- a.day(e, {
2548
- width: "narrow",
2549
- context: "formatting"
2550
- }),
2551
- i
2552
- );
2553
- case "iiiiii":
2554
- return D(
2555
- a.day(e, {
2556
- width: "short",
2557
- context: "formatting"
2558
- }) || a.day(e, {
2559
- width: "narrow",
2560
- context: "formatting"
2561
- }),
2562
- i
2563
- );
2564
- case "iiii":
2565
- default:
2566
- return D(
2567
- a.day(e, {
2568
- width: "wide",
2569
- context: "formatting"
2570
- }) || a.day(e, {
2571
- width: "abbreviated",
2572
- context: "formatting"
2573
- }) || a.day(e, {
2574
- width: "short",
2575
- context: "formatting"
2576
- }) || a.day(e, {
2577
- width: "narrow",
2578
- context: "formatting"
2579
- }),
2580
- i
2581
- );
2582
- }
2583
- }
2584
- validate(e, t) {
2585
- return t >= 1 && t <= 7;
2586
- }
2587
- set(e, t, a) {
2588
- return e = ya(e, a), e.setHours(0, 0, 0, 0), e;
2589
- }
2590
- }
2591
- class ba extends g {
2592
- constructor() {
2593
- super(...arguments);
2594
- o(this, "priority", 80);
2595
- o(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
2596
- }
2597
- parse(e, t, a) {
2598
- switch (t) {
2599
- case "a":
2600
- case "aa":
2601
- case "aaa":
2602
- return a.dayPeriod(e, {
2603
- width: "abbreviated",
2604
- context: "formatting"
2605
- }) || a.dayPeriod(e, {
2606
- width: "narrow",
2607
- context: "formatting"
2608
- });
2609
- case "aaaaa":
2610
- return a.dayPeriod(e, {
2611
- width: "narrow",
2612
- context: "formatting"
2613
- });
2614
- case "aaaa":
2615
- default:
2616
- return a.dayPeriod(e, {
2617
- width: "wide",
2618
- context: "formatting"
2619
- }) || a.dayPeriod(e, {
2620
- width: "abbreviated",
2621
- context: "formatting"
2622
- }) || a.dayPeriod(e, {
2623
- width: "narrow",
2624
- context: "formatting"
2625
- });
2626
- }
2627
- }
2628
- set(e, t, a) {
2629
- return e.setHours(Ye(a), 0, 0, 0), e;
2630
- }
2631
- }
2632
- class xa extends g {
2633
- constructor() {
2634
- super(...arguments);
2635
- o(this, "priority", 80);
2636
- o(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
2637
- }
2638
- parse(e, t, a) {
2639
- switch (t) {
2640
- case "b":
2641
- case "bb":
2642
- case "bbb":
2643
- return a.dayPeriod(e, {
2644
- width: "abbreviated",
2645
- context: "formatting"
2646
- }) || a.dayPeriod(e, {
2647
- width: "narrow",
2648
- context: "formatting"
2649
- });
2650
- case "bbbbb":
2651
- return a.dayPeriod(e, {
2652
- width: "narrow",
2653
- context: "formatting"
2654
- });
2655
- case "bbbb":
2656
- default:
2657
- return a.dayPeriod(e, {
2658
- width: "wide",
2659
- context: "formatting"
2660
- }) || a.dayPeriod(e, {
2661
- width: "abbreviated",
2662
- context: "formatting"
2663
- }) || a.dayPeriod(e, {
2664
- width: "narrow",
2665
- context: "formatting"
2666
- });
2667
- }
2668
- }
2669
- set(e, t, a) {
2670
- return e.setHours(Ye(a), 0, 0, 0), e;
2671
- }
2672
- }
2673
- class Ta extends g {
2674
- constructor() {
2675
- super(...arguments);
2676
- o(this, "priority", 80);
2677
- o(this, "incompatibleTokens", ["a", "b", "t", "T"]);
2678
- }
2679
- parse(e, t, a) {
2680
- switch (t) {
2681
- case "B":
2682
- case "BB":
2683
- case "BBB":
2684
- return a.dayPeriod(e, {
2685
- width: "abbreviated",
2686
- context: "formatting"
2687
- }) || a.dayPeriod(e, {
2688
- width: "narrow",
2689
- context: "formatting"
2690
- });
2691
- case "BBBBB":
2692
- return a.dayPeriod(e, {
2693
- width: "narrow",
2694
- context: "formatting"
2695
- });
2696
- case "BBBB":
2697
- default:
2698
- return a.dayPeriod(e, {
2699
- width: "wide",
2700
- context: "formatting"
2701
- }) || a.dayPeriod(e, {
2702
- width: "abbreviated",
2703
- context: "formatting"
2704
- }) || a.dayPeriod(e, {
2705
- width: "narrow",
2706
- context: "formatting"
2707
- });
2708
- }
2709
- }
2710
- set(e, t, a) {
2711
- return e.setHours(Ye(a), 0, 0, 0), e;
2712
- }
2713
- }
2714
- class ka extends g {
2715
- constructor() {
2716
- super(...arguments);
2717
- o(this, "priority", 70);
2718
- o(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
2719
- }
2720
- parse(e, t, a) {
2721
- switch (t) {
2722
- case "h":
2723
- return x(p.hour12h, e);
2724
- case "ho":
2725
- return a.ordinalNumber(e, { unit: "hour" });
2726
- default:
2727
- return k(t.length, e);
2728
- }
2729
- }
2730
- validate(e, t) {
2731
- return t >= 1 && t <= 12;
2732
- }
2733
- set(e, t, a) {
2734
- const i = e.getHours() >= 12;
2735
- return i && a < 12 ? e.setHours(a + 12, 0, 0, 0) : !i && a === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
2736
- }
2737
- }
2738
- class pa extends g {
2739
- constructor() {
2740
- super(...arguments);
2741
- o(this, "priority", 70);
2742
- o(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
2743
- }
2744
- parse(e, t, a) {
2745
- switch (t) {
2746
- case "H":
2747
- return x(p.hour23h, e);
2748
- case "Ho":
2749
- return a.ordinalNumber(e, { unit: "hour" });
2750
- default:
2751
- return k(t.length, e);
2752
- }
2753
- }
2754
- validate(e, t) {
2755
- return t >= 0 && t <= 23;
2756
- }
2757
- set(e, t, a) {
2758
- return e.setHours(a, 0, 0, 0), e;
2759
- }
2760
- }
2761
- class Da extends g {
2762
- constructor() {
2763
- super(...arguments);
2764
- o(this, "priority", 70);
2765
- o(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
2766
- }
2767
- parse(e, t, a) {
2768
- switch (t) {
2769
- case "K":
2770
- return x(p.hour11h, e);
2771
- case "Ko":
2772
- return a.ordinalNumber(e, { unit: "hour" });
2773
- default:
2774
- return k(t.length, e);
2775
- }
2776
- }
2777
- validate(e, t) {
2778
- return t >= 0 && t <= 11;
2779
- }
2780
- set(e, t, a) {
2781
- return e.getHours() >= 12 && a < 12 ? e.setHours(a + 12, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
2782
- }
2783
- }
2784
- class Ma extends g {
2785
- constructor() {
2786
- super(...arguments);
2787
- o(this, "priority", 70);
2788
- o(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
2789
- }
2790
- parse(e, t, a) {
2791
- switch (t) {
2792
- case "k":
2793
- return x(p.hour24h, e);
2794
- case "ko":
2795
- return a.ordinalNumber(e, { unit: "hour" });
2796
- default:
2797
- return k(t.length, e);
2798
- }
2799
- }
2800
- validate(e, t) {
2801
- return t >= 1 && t <= 24;
2802
- }
2803
- set(e, t, a) {
2804
- const i = a <= 24 ? a % 24 : a;
2805
- return e.setHours(i, 0, 0, 0), e;
2806
- }
2807
- }
2808
- class Oa extends g {
2809
- constructor() {
2810
- super(...arguments);
2811
- o(this, "priority", 60);
2812
- o(this, "incompatibleTokens", ["t", "T"]);
2813
- }
2814
- parse(e, t, a) {
2815
- switch (t) {
2816
- case "m":
2817
- return x(p.minute, e);
2818
- case "mo":
2819
- return a.ordinalNumber(e, { unit: "minute" });
2820
- default:
2821
- return k(t.length, e);
2822
- }
2823
- }
2824
- validate(e, t) {
2825
- return t >= 0 && t <= 59;
2826
- }
2827
- set(e, t, a) {
2828
- return e.setMinutes(a, 0, 0), e;
2829
- }
2830
- }
2831
- class Pa extends g {
2832
- constructor() {
2833
- super(...arguments);
2834
- o(this, "priority", 50);
2835
- o(this, "incompatibleTokens", ["t", "T"]);
2836
- }
2837
- parse(e, t, a) {
2838
- switch (t) {
2839
- case "s":
2840
- return x(p.second, e);
2841
- case "so":
2842
- return a.ordinalNumber(e, { unit: "second" });
2843
- default:
2844
- return k(t.length, e);
2845
- }
2846
- }
2847
- validate(e, t) {
2848
- return t >= 0 && t <= 59;
2849
- }
2850
- set(e, t, a) {
2851
- return e.setSeconds(a, 0), e;
2852
- }
2853
- }
2854
- class Ya extends g {
2855
- constructor() {
2856
- super(...arguments);
2857
- o(this, "priority", 30);
2858
- o(this, "incompatibleTokens", ["t", "T"]);
2859
- }
2860
- parse(e, t) {
2861
- const a = (i) => Math.trunc(i * Math.pow(10, -t.length + 3));
2862
- return D(k(t.length, e), a);
2863
- }
2864
- set(e, t, a) {
2865
- return e.setMilliseconds(a), e;
2866
- }
2867
- }
2868
- class va extends g {
2869
- constructor() {
2870
- super(...arguments);
2871
- o(this, "priority", 10);
2872
- o(this, "incompatibleTokens", ["t", "T", "x"]);
2873
- }
2874
- parse(e, t) {
2875
- switch (t) {
2876
- case "X":
2877
- return W(
2878
- C.basicOptionalMinutes,
2879
- e
2880
- );
2881
- case "XX":
2882
- return W(C.basic, e);
2883
- case "XXXX":
2884
- return W(
2885
- C.basicOptionalSeconds,
2886
- e
2887
- );
2888
- case "XXXXX":
2889
- return W(
2890
- C.extendedOptionalSeconds,
2891
- e
2892
- );
2893
- case "XXX":
2894
- default:
2895
- return W(C.extended, e);
2896
- }
2897
- }
2898
- set(e, t, a) {
2899
- return t.timestampIsSet ? e : b(
2900
- e,
2901
- e.getTime() - de(e) - a
2902
- );
2903
- }
2904
- }
2905
- class Ea extends g {
2906
- constructor() {
2907
- super(...arguments);
2908
- o(this, "priority", 10);
2909
- o(this, "incompatibleTokens", ["t", "T", "X"]);
2910
- }
2911
- parse(e, t) {
2912
- switch (t) {
2913
- case "x":
2914
- return W(
2915
- C.basicOptionalMinutes,
2916
- e
2917
- );
2918
- case "xx":
2919
- return W(C.basic, e);
2920
- case "xxxx":
2921
- return W(
2922
- C.basicOptionalSeconds,
2923
- e
2924
- );
2925
- case "xxxxx":
2926
- return W(
2927
- C.extendedOptionalSeconds,
2928
- e
2929
- );
2930
- case "xxx":
2931
- default:
2932
- return W(C.extended, e);
2933
- }
2934
- }
2935
- set(e, t, a) {
2936
- return t.timestampIsSet ? e : b(
2937
- e,
2938
- e.getTime() - de(e) - a
2939
- );
2940
- }
2941
- }
2942
- class _a extends g {
2943
- constructor() {
2944
- super(...arguments);
2945
- o(this, "priority", 40);
2946
- o(this, "incompatibleTokens", "*");
2947
- }
2948
- parse(e) {
2949
- return xt(e);
2950
- }
2951
- set(e, t, a) {
2952
- return [b(e, a * 1e3), { timestampIsSet: !0 }];
2953
- }
2954
- }
2955
- class La extends g {
2956
- constructor() {
2957
- super(...arguments);
2958
- o(this, "priority", 20);
2959
- o(this, "incompatibleTokens", "*");
2960
- }
2961
- parse(e) {
2962
- return xt(e);
2963
- }
2964
- set(e, t, a) {
2965
- return [b(e, a), { timestampIsSet: !0 }];
2966
- }
2967
- }
2968
- const Ca = {
2969
- G: new Vn(),
2970
- y: new Un(),
2971
- Y: new Kn(),
2972
- R: new Zn(),
2973
- u: new Jn(),
2974
- Q: new ea(),
2975
- q: new ta(),
2976
- M: new ra(),
2977
- L: new na(),
2978
- w: new ia(),
2979
- I: new oa(),
2980
- d: new da(),
2981
- D: new la(),
2982
- E: new fa(),
2983
- e: new ha(),
2984
- c: new ma(),
2985
- i: new wa(),
2986
- a: new ba(),
2987
- b: new xa(),
2988
- B: new Ta(),
2989
- h: new ka(),
2990
- H: new pa(),
2991
- K: new Da(),
2992
- k: new Ma(),
2993
- m: new Oa(),
2994
- s: new Pa(),
2995
- S: new Ya(),
2996
- X: new va(),
2997
- x: new Ea(),
2998
- t: new _a(),
2999
- T: new La()
3000
- }, Wa = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ia = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, qa = /^'([^]*?)'?$/, Ha = /''/g, Fa = /\S/, Na = /[a-zA-Z]/;
3001
- function Ra(n, r, e, t) {
3002
- var Z, J, O, M, j, Ee, _e, Le;
3003
- const a = () => b((t == null ? void 0 : t.in) || e, NaN), i = jn(), s = (t == null ? void 0 : t.locale) ?? i.locale ?? Me, c = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((J = (Z = t == null ? void 0 : t.locale) == null ? void 0 : Z.options) == null ? void 0 : J.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((M = (O = i.locale) == null ? void 0 : O.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, l = (t == null ? void 0 : t.weekStartsOn) ?? ((Ee = (j = t == null ? void 0 : t.locale) == null ? void 0 : j.options) == null ? void 0 : Ee.weekStartsOn) ?? i.weekStartsOn ?? ((Le = (_e = i.locale) == null ? void 0 : _e.options) == null ? void 0 : Le.weekStartsOn) ?? 0;
3004
- if (!r)
3005
- return n ? a() : u(e, t == null ? void 0 : t.in);
3006
- const f = {
3007
- firstWeekContainsDate: c,
3008
- weekStartsOn: l,
3009
- locale: s
3010
- }, w = [new $n(t == null ? void 0 : t.in, e)], P = r.match(Ia).map((m) => {
3011
- const T = m[0];
3012
- if (T in ie) {
3013
- const L = ie[T];
3014
- return L(m, s.formatLong);
3015
- }
3016
- return m;
3017
- }).join("").match(Wa), Y = [];
3018
- for (let m of P) {
3019
- !(t != null && t.useAdditionalWeekYearTokens) && gt(m) && ke(m, r, n), !(t != null && t.useAdditionalDayOfYearTokens) && mt(m) && ke(m, r, n);
3020
- const T = m[0], L = Ca[T];
3021
- if (L) {
3022
- const { incompatibleTokens: Ce } = L;
3023
- if (Array.isArray(Ce)) {
3024
- const We = Y.find(
3025
- (Ie) => Ce.includes(Ie.token) || Ie.token === T
3026
- );
3027
- if (We)
3028
- throw new RangeError(
3029
- `The format string mustn't contain \`${We.fullToken}\` and \`${m}\` at the same time`
3030
- );
3031
- } else if (L.incompatibleTokens === "*" && Y.length > 0)
3032
- throw new RangeError(
3033
- `The format string mustn't contain \`${m}\` and any other token at the same time`
3034
- );
3035
- Y.push({ token: T, fullToken: m });
3036
- const me = L.run(
3037
- n,
3038
- m,
3039
- s.match,
3040
- f
3041
- );
3042
- if (!me)
3043
- return a();
3044
- w.push(me.setter), n = me.rest;
3045
- } else {
3046
- if (T.match(Na))
3047
- throw new RangeError(
3048
- "Format string contains an unescaped latin alphabet character `" + T + "`"
3049
- );
3050
- if (m === "''" ? m = "'" : T === "'" && (m = Aa(m)), n.indexOf(m) === 0)
3051
- n = n.slice(m.length);
3052
- else
3053
- return a();
3054
- }
3055
- }
3056
- if (n.length > 0 && Fa.test(n))
3057
- return a();
3058
- const _ = w.map((m) => m.priority).sort((m, T) => T - m).filter((m, T, L) => L.indexOf(m) === T).map(
3059
- (m) => w.filter((T) => T.priority === m).sort((T, L) => L.subPriority - T.subPriority)
3060
- ).map((m) => m[0]);
3061
- let v = u(e, t == null ? void 0 : t.in);
3062
- if (isNaN(+v)) return a();
3063
- const K = {};
3064
- for (const m of _) {
3065
- if (!m.validate(v, f))
3066
- return a();
3067
- const T = m.set(v, K, f);
3068
- Array.isArray(T) ? (v = T[0], Object.assign(K, T[1])) : v = T;
3069
- }
3070
- return v;
3071
- }
3072
- function Aa(n) {
3073
- return n.match(qa)[1].replace(Ha, "'");
3074
- }
3075
- function Sa(n, r, e) {
3076
- const t = u(n, e == null ? void 0 : e.in);
3077
- return t.setDate(r), t;
3078
- }
3079
- function Qa(n, r, e) {
3080
- const t = u(n, e == null ? void 0 : e.in);
3081
- return t.setHours(r), t;
3082
- }
3083
- function ja(n, r, e) {
3084
- const t = u(n, e == null ? void 0 : e.in);
3085
- return t.setMinutes(r), t;
3086
- }
3087
- function Ba(n, r, e) {
3088
- const t = u(n, e == null ? void 0 : e.in), a = t.getFullYear(), i = t.getDate(), s = b(n, 0);
3089
- s.setFullYear(a, r, 15), s.setHours(0, 0, 0, 0);
3090
- const c = wt(s);
3091
- return t.setMonth(r, Math.min(i, c)), t;
3092
- }
3093
- function za(n, r, e) {
3094
- const t = u(n, e == null ? void 0 : e.in);
3095
- return t.setSeconds(r), t;
3096
- }
3097
- function Ga(n, r, e) {
3098
- const t = u(n, e == null ? void 0 : e.in);
3099
- return t.setMilliseconds(r), t;
3100
- }
3101
- function Xa(n, r, e) {
3102
- const t = u(n, e == null ? void 0 : e.in);
3103
- return isNaN(+t) ? b(n, NaN) : (t.setFullYear(r), t);
3104
- }
3105
- function $a(n, r) {
3106
- const e = u(n, r == null ? void 0 : r.in);
3107
- return e.setDate(1), e.setHours(0, 0, 0, 0), e;
3108
- }
3109
- function Va(n, r) {
3110
- const e = u(n, r == null ? void 0 : r.in), t = e.getMonth();
3111
- return e.setFullYear(e.getFullYear(), t + 1, 0), e.setHours(23, 59, 59, 999), e;
3112
- }
3113
- function Ua(n, r, e) {
3114
- const t = +u(n, e == null ? void 0 : e.in), [a, i] = [
3115
- +u(r.start, e == null ? void 0 : e.in),
3116
- +u(r.end, e == null ? void 0 : e.in)
3117
- ].sort((s, c) => s - c);
3118
- return t >= a && t <= i;
3119
- }
3120
- function pe() {
3121
- return pe = Object.assign ? Object.assign.bind() : function(n) {
3122
- for (var r = 1; r < arguments.length; r++) {
3123
- var e = arguments[r];
3124
- for (var t in e) ({}).hasOwnProperty.call(e, t) && (n[t] = e[t]);
3125
- }
3126
- return n;
3127
- }, pe.apply(null, arguments);
3128
- }
3129
- const Ka = {
3130
- // Year
3131
- y: {
3132
- sectionType: "year",
3133
- contentType: "digit",
3134
- maxLength: 4
3135
- },
3136
- yy: "year",
3137
- yyy: {
3138
- sectionType: "year",
3139
- contentType: "digit",
3140
- maxLength: 4
3141
- },
3142
- yyyy: "year",
3143
- // Month
3144
- M: {
3145
- sectionType: "month",
3146
- contentType: "digit",
3147
- maxLength: 2
3148
- },
3149
- MM: "month",
3150
- MMMM: {
3151
- sectionType: "month",
3152
- contentType: "letter"
3153
- },
3154
- MMM: {
3155
- sectionType: "month",
3156
- contentType: "letter"
3157
- },
3158
- L: {
3159
- sectionType: "month",
3160
- contentType: "digit",
3161
- maxLength: 2
3162
- },
3163
- LL: "month",
3164
- LLL: {
3165
- sectionType: "month",
3166
- contentType: "letter"
3167
- },
3168
- LLLL: {
3169
- sectionType: "month",
3170
- contentType: "letter"
3171
- },
3172
- // Day of the month
3173
- d: {
3174
- sectionType: "day",
3175
- contentType: "digit",
3176
- maxLength: 2
3177
- },
3178
- dd: "day",
3179
- do: {
3180
- sectionType: "day",
3181
- contentType: "digit-with-letter"
3182
- },
3183
- // Day of the week
3184
- E: {
3185
- sectionType: "weekDay",
3186
- contentType: "letter"
3187
- },
3188
- EE: {
3189
- sectionType: "weekDay",
3190
- contentType: "letter"
3191
- },
3192
- EEE: {
3193
- sectionType: "weekDay",
3194
- contentType: "letter"
3195
- },
3196
- EEEE: {
3197
- sectionType: "weekDay",
3198
- contentType: "letter"
3199
- },
3200
- EEEEE: {
3201
- sectionType: "weekDay",
3202
- contentType: "letter"
3203
- },
3204
- i: {
3205
- sectionType: "weekDay",
3206
- contentType: "digit",
3207
- maxLength: 1
3208
- },
3209
- ii: "weekDay",
3210
- iii: {
3211
- sectionType: "weekDay",
3212
- contentType: "letter"
3213
- },
3214
- iiii: {
3215
- sectionType: "weekDay",
3216
- contentType: "letter"
3217
- },
3218
- // eslint-disable-next-line id-denylist
3219
- e: {
3220
- sectionType: "weekDay",
3221
- contentType: "digit",
3222
- maxLength: 1
3223
- },
3224
- ee: "weekDay",
3225
- eee: {
3226
- sectionType: "weekDay",
3227
- contentType: "letter"
3228
- },
3229
- eeee: {
3230
- sectionType: "weekDay",
3231
- contentType: "letter"
3232
- },
3233
- eeeee: {
3234
- sectionType: "weekDay",
3235
- contentType: "letter"
3236
- },
3237
- eeeeee: {
3238
- sectionType: "weekDay",
3239
- contentType: "letter"
3240
- },
3241
- c: {
3242
- sectionType: "weekDay",
3243
- contentType: "digit",
3244
- maxLength: 1
3245
- },
3246
- cc: "weekDay",
3247
- ccc: {
3248
- sectionType: "weekDay",
3249
- contentType: "letter"
3250
- },
3251
- cccc: {
3252
- sectionType: "weekDay",
3253
- contentType: "letter"
3254
- },
3255
- ccccc: {
3256
- sectionType: "weekDay",
3257
- contentType: "letter"
3258
- },
3259
- cccccc: {
3260
- sectionType: "weekDay",
3261
- contentType: "letter"
3262
- },
3263
- // Meridiem
3264
- a: "meridiem",
3265
- aa: "meridiem",
3266
- aaa: "meridiem",
3267
- // Hours
3268
- H: {
3269
- sectionType: "hours",
3270
- contentType: "digit",
3271
- maxLength: 2
3272
- },
3273
- HH: "hours",
3274
- h: {
3275
- sectionType: "hours",
3276
- contentType: "digit",
3277
- maxLength: 2
3278
- },
3279
- hh: "hours",
3280
- // Minutes
3281
- m: {
3282
- sectionType: "minutes",
3283
- contentType: "digit",
3284
- maxLength: 2
3285
- },
3286
- mm: "minutes",
3287
- // Seconds
3288
- s: {
3289
- sectionType: "seconds",
3290
- contentType: "digit",
3291
- maxLength: 2
3292
- },
3293
- ss: "seconds"
3294
- }, Za = {
3295
- year: "yyyy",
3296
- month: "LLLL",
3297
- monthShort: "MMM",
3298
- dayOfMonth: "d",
3299
- dayOfMonthFull: "do",
3300
- weekday: "EEEE",
3301
- weekdayShort: "EEEEEE",
3302
- hours24h: "HH",
3303
- hours12h: "hh",
3304
- meridiem: "aa",
3305
- minutes: "mm",
3306
- seconds: "ss",
3307
- fullDate: "PP",
3308
- keyboardDate: "P",
3309
- shortDate: "MMM d",
3310
- normalDate: "d MMMM",
3311
- normalDateWithWeekday: "EEE, MMM d",
3312
- fullTime: "p",
3313
- fullTime12h: "hh:mm aa",
3314
- fullTime24h: "HH:mm",
3315
- keyboardDateTime: "P p",
3316
- keyboardDateTime12h: "P hh:mm aa",
3317
- keyboardDateTime24h: "P HH:mm"
3318
- };
3319
- class Ja {
3320
- constructor(r) {
3321
- this.isMUIAdapter = !0, this.isTimezoneCompatible = !1, this.lib = void 0, this.locale = void 0, this.formats = void 0, this.formatTokenMap = Ka, this.escapedCharacters = {
3322
- start: "'",
3323
- end: "'"
3324
- }, this.longFormatters = void 0, this.date = (s) => typeof s > "u" ? /* @__PURE__ */ new Date() : s === null ? null : new Date(s), this.getInvalidDate = () => /* @__PURE__ */ new Date("Invalid Date"), this.getTimezone = () => "default", this.setTimezone = (s) => s, this.toJsDate = (s) => s, this.getCurrentLocaleCode = () => this.locale.code, this.is12HourCycleInCurrentLocale = () => /a/.test(this.locale.formatLong.time({
3325
- width: "short"
3326
- })), this.expandFormat = (s) => {
3327
- const c = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
3328
- return s.match(c).map((l) => {
3329
- const f = l[0];
3330
- if (f === "p" || f === "P") {
3331
- const w = this.longFormatters[f];
3332
- return w(l, this.locale.formatLong);
3333
- }
3334
- return l;
3335
- }).join("");
3336
- }, this.formatNumber = (s) => s, this.getDayOfWeek = (s) => s.getDay() + 1;
3337
- const {
3338
- locale: e,
3339
- formats: t,
3340
- longFormatters: a,
3341
- lib: i
3342
- } = r;
3343
- this.locale = e, this.formats = pe({}, Za, t), this.longFormatters = a, this.lib = i || "date-fns";
3344
- }
3345
- }
3346
- class ei extends Ja {
3347
- constructor({
3348
- locale: r,
3349
- formats: e
3350
- } = {}) {
3351
- if (process.env.NODE_ENV !== "production") {
3352
- if (typeof ne != "function")
3353
- throw new Error(["MUI: The `date-fns` package v2.x is not compatible with this adapter.", "Please, install v3.x or v4.x of the package or use the `AdapterDateFns` instead."].join(`
3354
- `));
3355
- if (!ie)
3356
- throw new Error("MUI: The minimum supported `date-fns` package version compatible with this adapter is `3.2.x`.");
3357
- }
3358
- super({
3359
- locale: r ?? Me,
3360
- formats: e,
3361
- longFormatters: ie
3362
- }), this.parse = (t, a) => t === "" ? null : Ra(t, a, /* @__PURE__ */ new Date(), {
3363
- locale: this.locale
3364
- }), this.isValid = (t) => t == null ? !1 : yt(t), this.format = (t, a) => this.formatByString(t, this.formats[a]), this.formatByString = (t, a) => En(t, a, {
3365
- locale: this.locale
3366
- }), this.isEqual = (t, a) => t === null && a === null ? !0 : t === null || a === null ? !1 : Nn(t, a), this.isSameYear = (t, a) => An(t, a), this.isSameMonth = (t, a) => Sn(t, a), this.isSameDay = (t, a) => Rn(t, a), this.isSameHour = (t, a) => Qn(t, a), this.isAfter = (t, a) => be(t, a), this.isAfterYear = (t, a) => be(t, je(a)), this.isAfterDay = (t, a) => be(t, Qe(a)), this.isBefore = (t, a) => xe(t, a), this.isBeforeYear = (t, a) => xe(t, this.startOfYear(a)), this.isBeforeDay = (t, a) => xe(t, this.startOfDay(a)), this.isWithinRange = (t, [a, i]) => Ua(t, {
3367
- start: a,
3368
- end: i
3369
- }), this.startOfYear = (t) => dt(t), this.startOfMonth = (t) => $a(t), this.startOfWeek = (t) => H(t, {
3370
- locale: this.locale
3371
- }), this.startOfDay = (t) => ae(t), this.endOfYear = (t) => je(t), this.endOfMonth = (t) => Va(t), this.endOfWeek = (t) => Ir(t, {
3372
- locale: this.locale
3373
- }), this.endOfDay = (t) => Qe(t), this.addYears = (t, a) => Cr(t, a), this.addMonths = (t, a) => ut(t, a), this.addWeeks = (t, a) => Lr(t, a), this.addDays = (t, a) => ne(t, a), this.addHours = (t, a) => _r(t, a), this.addMinutes = (t, a) => Er(t, a), this.addSeconds = (t, a) => vr(t, a), this.getYear = (t) => Fn(t), this.getMonth = (t) => In(t), this.getDate = (t) => Ln(t), this.getHours = (t) => Cn(t), this.getMinutes = (t) => Wn(t), this.getSeconds = (t) => qn(t), this.getMilliseconds = (t) => Hn(t), this.setYear = (t, a) => Xa(t, a), this.setMonth = (t, a) => Ba(t, a), this.setDate = (t, a) => Sa(t, a), this.setHours = (t, a) => Qa(t, a), this.setMinutes = (t, a) => ja(t, a), this.setSeconds = (t, a) => za(t, a), this.setMilliseconds = (t, a) => Ga(t, a), this.getDaysInMonth = (t) => wt(t), this.getWeekArray = (t) => {
3374
- const a = this.startOfWeek(this.startOfMonth(t)), i = this.endOfWeek(this.endOfMonth(t));
3375
- let s = 0, c = a;
3376
- const l = [];
3377
- for (; this.isBefore(c, i); ) {
3378
- const f = Math.floor(s / 7);
3379
- l[f] = l[f] || [], l[f].push(c), c = this.addDays(c, 1), s += 1;
3380
- }
3381
- return l;
3382
- }, this.getWeekNumber = (t) => Pe(t, {
3383
- locale: this.locale
3384
- }), this.getYearRange = ([t, a]) => {
3385
- const i = this.startOfYear(t), s = this.endOfYear(a), c = [];
3386
- let l = i;
3387
- for (; this.isBefore(l, s); )
3388
- c.push(l), l = this.addYears(l, 1);
3389
- return c;
3390
- };
3391
- }
3392
- }
3393
- const ti = {
204
+ }, Ye = {
3394
205
  inicializar: {
3395
206
  error: {
3396
207
  titulo: "Error iniciando aplicación",
@@ -3409,163 +220,163 @@ const ti = {
3409
220
  error: "Usuario o contraseña incorrectos"
3410
221
  },
3411
222
  copy: "Todos los derechos reservados "
3412
- }, ri = {
3413
- es: ti
3414
- }, ni = { en: Jt, es: er }, pt = ({ messages: n, children: r }) => {
3415
- const e = I((t) => t.ui.idioma);
3416
- return /* @__PURE__ */ d(Xt, { locale: e, messages: n[e], children: /* @__PURE__ */ d(tr, { dateAdapter: ei, adapterLocale: ni[e], children: r }) });
223
+ }, eo = {
224
+ es: Ye
225
+ }, oo = { en: Re, es: Ie }, X = ({ messages: o, children: e }) => {
226
+ const n = u((r) => r.ui.idioma);
227
+ return /* @__PURE__ */ a(ke, { locale: n, messages: o[n], children: /* @__PURE__ */ a(ve, { dateAdapter: je, adapterLocale: oo[n], children: e }) });
3417
228
  };
3418
- pt.propTypes = {
3419
- messages: h.object,
3420
- children: h.element.isRequired
229
+ X.propTypes = {
230
+ messages: t.object,
231
+ children: t.element.isRequired
3421
232
  };
3422
- const ai = () => {
3423
- const n = rr();
3424
- if (!(n != null && n.length))
233
+ const no = () => {
234
+ const o = Ae();
235
+ if (!(o != null && o.length))
3425
236
  return;
3426
- const r = n[0];
3427
- return r.indexOf("-") ? r.substring(0, r.indexOf("-")) : r;
3428
- }, Dt = ({ messages: n, idiomaDefecto: r, children: e }) => {
3429
- const t = S(), a = ai();
3430
- U(() => {
3431
- let s = Reflect.ownKeys(n)[0];
3432
- a && Object.hasOwn(n, a) ? s = a : r && Object.hasOwn(n, r) && (s = r), t(fr(s));
3433
- }, [t, n, r, a]);
3434
- const i = {};
3435
- return Object.keys(n).forEach((s) => {
3436
- i[s] = {
3437
- ...n[s],
3438
- saas: ri[s]
237
+ const e = o[0];
238
+ return e.indexOf("-") ? e.substring(0, e.indexOf("-")) : e;
239
+ }, J = ({ messages: o, idiomaDefecto: e, children: n }) => {
240
+ const r = f(), i = no();
241
+ T(() => {
242
+ let s = Reflect.ownKeys(o)[0];
243
+ i && Object.hasOwn(o, i) ? s = i : e && Object.hasOwn(o, e) && (s = e), r(Fe(s));
244
+ }, [r, o, e, i]);
245
+ const c = {};
246
+ return Object.keys(o).forEach((s) => {
247
+ c[s] = {
248
+ ...o[s],
249
+ saas: eo[s]
3439
250
  };
3440
- }), /* @__PURE__ */ d(pt, { messages: i, children: e });
251
+ }), /* @__PURE__ */ a(X, { messages: c, children: n });
3441
252
  };
3442
- Dt.propTypes = {
3443
- messages: h.object,
3444
- idiomaDefecto: h.string,
3445
- children: h.element.isRequired
253
+ J.propTypes = {
254
+ messages: t.object,
255
+ idiomaDefecto: t.string,
256
+ children: t.element.isRequired
3446
257
  };
3447
- const Mt = ({ children: n }) => {
3448
- const r = S(), { instancia: e } = I((s) => s.aplicacion), t = I((s) => s.ui.tema), a = Ft("(prefers-color-scheme: dark)");
3449
- U(() => {
3450
- r(lr(a ? "dark" : "light"));
3451
- }, [r, a]);
3452
- const i = Kt(() => nr({
258
+ const Q = ({ children: o }) => {
259
+ const e = f(), { instancia: n } = u((s) => s.aplicacion), r = u((s) => s.ui.tema), i = le("(prefers-color-scheme: dark)");
260
+ T(() => {
261
+ e(Ue(i ? "dark" : "light"));
262
+ }, [e, i]);
263
+ const c = we(() => ze({
3453
264
  palette: {
3454
- mode: t,
265
+ mode: r,
3455
266
  primary: {
3456
- main: e.color.primary
267
+ main: n.color.primary
3457
268
  },
3458
269
  secondary: {
3459
- main: e.color.secondary
270
+ main: n.color.secondary
3460
271
  },
3461
272
  error: {
3462
- main: e.color.error
273
+ main: n.color.error
3463
274
  },
3464
275
  warning: {
3465
- main: e.color.warning
276
+ main: n.color.warning
3466
277
  },
3467
278
  info: {
3468
- main: e.color.info
279
+ main: n.color.info
3469
280
  },
3470
281
  success: {
3471
- main: e.color.success
282
+ main: n.color.success
3472
283
  },
3473
- ...t === "light" && {
284
+ ...r === "light" && {
3474
285
  background: {
3475
- default: Fe.A200,
3476
- paper: Fe[100]
286
+ default: E.A200,
287
+ paper: E[100]
3477
288
  }
3478
289
  }
3479
290
  },
3480
291
  shape: {
3481
292
  borderRadius: 6
3482
293
  }
3483
- }), [t, e]);
3484
- return /* @__PURE__ */ E(ar, { theme: i, children: [
3485
- /* @__PURE__ */ d(Nt, {}),
3486
- n
294
+ }), [r, n]);
295
+ return /* @__PURE__ */ d(Le, { theme: c, children: [
296
+ /* @__PURE__ */ a(de, {}),
297
+ o
3487
298
  ] });
3488
299
  };
3489
- Mt.propTypes = {
3490
- children: h.element.isRequired
300
+ Q.propTypes = {
301
+ children: t.element.isRequired
3491
302
  };
3492
- const Ot = (n) => {
3493
- const r = S(), e = I((a) => a.login), t = I((a) => a.aplicacion.instancia);
3494
- return U(() => {
3495
- if (e.autenticado)
3496
- e.expiracion && new Date(e.expiracion) < /* @__PURE__ */ new Date() && (e.refreshToken ? r(ce(n, t.clientCredentials, e.refreshToken)) : r(Ae()));
303
+ const Y = (o) => {
304
+ const e = f(), n = u((i) => i.login), r = u((i) => i.aplicacion.instancia);
305
+ return T(() => {
306
+ if (n.autenticado)
307
+ n.expiracion && new Date(n.expiracion) < /* @__PURE__ */ new Date() && (n.refreshToken ? e(C(o, r.clientCredentials, n.refreshToken)) : e(F()));
3497
308
  else {
3498
- const a = sessionStorage.getItem(z), i = sessionStorage.getItem(G), s = sessionStorage.getItem(X);
3499
- a && i && (new Date(i) < /* @__PURE__ */ new Date() ? r(s ? s(n, t.clientCredentials, s) : Ae()) : r(yr({ token: a, expiracion: i, refreshToken: s })));
3500
- }
3501
- }, [n, t.clientCredentials, e, r]), e.autenticado;
3502
- }, ii = () => {
3503
- const n = S();
3504
- return Zt((r, e = "default") => {
3505
- n(br({ mensaje: r, tipo: e }));
3506
- }, [n]);
3507
- }, Pt = ({ devURL: n }) => {
3508
- const r = S(), e = fe(), t = ii(), { cargando: a, error: i } = I((f) => f.login), s = I((f) => f.aplicacion.instancia), c = (f) => {
3509
- r(oe({
3510
- devURL: n,
309
+ const i = sessionStorage.getItem(y), c = sessionStorage.getItem(x), s = sessionStorage.getItem(k);
310
+ i && c && (new Date(c) < /* @__PURE__ */ new Date() ? e(s ? s(o, r.clientCredentials, s) : F()) : e(Ge({ token: i, expiracion: c, refreshToken: s })));
311
+ }
312
+ }, [o, r.clientCredentials, n, e]), n.autenticado;
313
+ }, ro = () => {
314
+ const o = f();
315
+ return Ce((e, n = "default") => {
316
+ o(He({ mensaje: e, tipo: n }));
317
+ }, [o]);
318
+ }, ee = ({ devURL: o }) => {
319
+ const e = f(), n = R(), r = ro(), { cargando: i, error: c } = u((l) => l.login), s = u((l) => l.aplicacion.instancia), h = (l) => {
320
+ e(w({
321
+ devURL: o,
3511
322
  clientCredentials: s.clientCredentials,
3512
323
  data: {
3513
- correo: f.correo,
3514
- password: f.password
324
+ correo: l.correo,
325
+ password: l.password
3515
326
  }
3516
327
  }));
3517
- }, l = (f) => {
3518
- const w = { correo: void 0, password: void 0 };
3519
- return f.correo || (w.correo = e("saas.login.validacion.correo")), f.password || (w.password = e("saas.login.validacion.password")), w;
328
+ }, j = (l) => {
329
+ const A = { correo: void 0, password: void 0 };
330
+ return l.correo || (A.correo = n("saas.login.validacion.correo")), l.password || (A.password = n("saas.login.validacion.password")), A;
3520
331
  };
3521
- return U(() => {
3522
- i && t("saas.login.error", "error");
3523
- }, [t, i]), /* @__PURE__ */ d(
3524
- ur,
332
+ return T(() => {
333
+ c && r("saas.login.error", "error");
334
+ }, [r, c]), /* @__PURE__ */ a(
335
+ Ee,
3525
336
  {
3526
- onSubmit: c,
3527
- validate: l,
3528
- render: ({ handleSubmit: f }) => /* @__PURE__ */ E("form", { onSubmit: f, children: [
3529
- /* @__PURE__ */ d(
3530
- Re,
337
+ onSubmit: h,
338
+ validate: j,
339
+ render: ({ handleSubmit: l }) => /* @__PURE__ */ d("form", { onSubmit: l, children: [
340
+ /* @__PURE__ */ a(
341
+ U,
3531
342
  {
3532
343
  id: "correo",
3533
344
  name: "correo",
3534
- label: e("saas.login.correo"),
345
+ label: n("saas.login.correo"),
3535
346
  variant: "outlined",
3536
347
  autoComplete: "off",
3537
- disabled: a,
348
+ disabled: i,
3538
349
  autoFocus: !0,
3539
350
  InputProps: {
3540
- startAdornment: /* @__PURE__ */ d(qe, { position: "start", children: /* @__PURE__ */ d(or, { color: "primary" }) })
351
+ startAdornment: /* @__PURE__ */ a(N, { position: "start", children: /* @__PURE__ */ a(Ne, { color: "primary" }) })
3541
352
  }
3542
353
  }
3543
354
  ),
3544
- /* @__PURE__ */ d(
3545
- Re,
355
+ /* @__PURE__ */ a(
356
+ U,
3546
357
  {
3547
358
  id: "password",
3548
359
  name: "password",
3549
360
  type: "password",
3550
- label: e("saas.login.password"),
361
+ label: n("saas.login.password"),
3551
362
  variant: "outlined",
3552
363
  autoComplete: "current-password",
3553
- disabled: a,
364
+ disabled: i,
3554
365
  InputProps: {
3555
- startAdornment: /* @__PURE__ */ d(qe, { position: "start", children: /* @__PURE__ */ d(cr, { color: "primary" }) })
366
+ startAdornment: /* @__PURE__ */ a(N, { position: "start", children: /* @__PURE__ */ a(_e, { color: "primary" }) })
3556
367
  }
3557
368
  }
3558
369
  ),
3559
- /* @__PURE__ */ E($, { container: !0, children: [
3560
- /* @__PURE__ */ d($, { item: !0, xs: 6 }),
3561
- /* @__PURE__ */ d($, { item: !0, xs: 6, align: "right", children: /* @__PURE__ */ d(
3562
- Gt,
370
+ /* @__PURE__ */ d(b, { container: !0, children: [
371
+ /* @__PURE__ */ a(b, { item: !0, xs: 6 }),
372
+ /* @__PURE__ */ a(b, { item: !0, xs: 6, align: "right", children: /* @__PURE__ */ a(
373
+ xe,
3563
374
  {
3564
375
  variant: "contained",
3565
376
  color: "primary",
3566
377
  type: "submit",
3567
- disabled: a,
3568
- children: a ? /* @__PURE__ */ d(Ve, { size: 24, thickness: 4 }) : e("saas.login.ingresar")
378
+ disabled: i,
379
+ children: i ? /* @__PURE__ */ a(P, { size: 24, thickness: 4 }) : n("saas.login.ingresar")
3569
380
  }
3570
381
  ) })
3571
382
  ] })
@@ -3573,12 +384,12 @@ const Ot = (n) => {
3573
384
  }
3574
385
  );
3575
386
  };
3576
- Pt.propTypes = {
3577
- devURL: h.string
387
+ ee.propTypes = {
388
+ devURL: t.string
3578
389
  };
3579
- const Yt = ({ devURL: n }) => {
3580
- const r = I((s) => s.aplicacion.instancia), e = fe(), t = Ke(), a = Ot(n), { from: i } = t.state || { from: { pathname: "/" } };
3581
- return !r.requiereLogin || a ? /* @__PURE__ */ d(Ze, { to: i }) : /* @__PURE__ */ E(re, { sx: {
390
+ const oe = ({ devURL: o }) => {
391
+ const e = u((s) => s.aplicacion.instancia), n = R(), r = M(), i = Y(o), { from: c } = r.state || { from: { pathname: "/" } };
392
+ return !e.requiereLogin || i ? /* @__PURE__ */ a(G, { to: c }) : /* @__PURE__ */ d(S, { sx: {
3582
393
  position: "relative",
3583
394
  display: "flex",
3584
395
  flexDirection: "column",
@@ -3587,7 +398,7 @@ const Yt = ({ devURL: n }) => {
3587
398
  backgroundColor: "primary.main",
3588
399
  "&::before": {
3589
400
  content: '""',
3590
- backgroundImage: `url(${r.logo})`,
401
+ backgroundImage: `url(${e.logo})`,
3591
402
  backgroundSize: "contain",
3592
403
  backgroundRepeat: "no-repeat",
3593
404
  backgroundPosition: "right",
@@ -3600,199 +411,199 @@ const Yt = ({ devURL: n }) => {
3600
411
  filter: "grayscale(100%)"
3601
412
  }
3602
413
  }, children: [
3603
- /* @__PURE__ */ d(re, { sx: {
414
+ /* @__PURE__ */ a(S, { sx: {
3604
415
  display: "flex",
3605
416
  justifyContent: "center",
3606
417
  alignItems: "center",
3607
418
  flexGrow: 1
3608
- }, children: /* @__PURE__ */ d(Rt, { maxWidth: "md", children: /* @__PURE__ */ E($, { container: !0, spacing: 3, children: [
3609
- /* @__PURE__ */ E($, { item: !0, xs: 12, lg: 5, align: "center", children: [
3610
- /* @__PURE__ */ d("img", { src: r.logo, alt: r.nombre, style: { maxWidth: "100%" } }),
3611
- /* @__PURE__ */ d(ge, { variant: "h3", align: "center", children: e("aplicacion.nombre", { smart_count: 1 }) }),
3612
- /* @__PURE__ */ d(ge, { variant: "h5", align: "center", children: r.nombre })
419
+ }, children: /* @__PURE__ */ a(ue, { maxWidth: "md", children: /* @__PURE__ */ d(b, { container: !0, spacing: 3, children: [
420
+ /* @__PURE__ */ d(b, { item: !0, xs: 12, lg: 5, align: "center", children: [
421
+ /* @__PURE__ */ a("img", { src: e.logo, alt: e.nombre, style: { maxWidth: "100%" } }),
422
+ /* @__PURE__ */ a(z, { variant: "h3", align: "center", children: n("aplicacion.nombre", { smart_count: 1 }) }),
423
+ /* @__PURE__ */ a(z, { variant: "h5", align: "center", children: e.nombre })
3613
424
  ] }),
3614
- /* @__PURE__ */ d($, { item: !0, xs: 12, lg: 7, sx: {
425
+ /* @__PURE__ */ a(b, { item: !0, xs: 12, lg: 7, sx: {
3615
426
  display: "flex",
3616
427
  alignItems: "center",
3617
428
  justifyContent: "center",
3618
429
  zIndex: 5
3619
- }, children: /* @__PURE__ */ E(At, { elevation: 5, children: [
3620
- /* @__PURE__ */ d(St, { title: e("saas.login.titulo"), titleTypographyProps: { align: "center" } }),
3621
- /* @__PURE__ */ d(Qt, { sx: {
430
+ }, children: /* @__PURE__ */ d(pe, { elevation: 5, children: [
431
+ /* @__PURE__ */ a(me, { title: n("saas.login.titulo"), titleTypographyProps: { align: "center" } }),
432
+ /* @__PURE__ */ a(ge, { sx: {
3622
433
  "& .MuiTextField-root": {
3623
434
  mb: 2
3624
435
  }
3625
- }, children: /* @__PURE__ */ d(Pt, { devURL: n }) })
436
+ }, children: /* @__PURE__ */ a(ee, { devURL: o }) })
3626
437
  ] }) })
3627
438
  ] }) }) }),
3628
- /* @__PURE__ */ d(jt, { position: "static", color: "primary", children: /* @__PURE__ */ d(Bt, { sx: { justifyContent: "center" }, children: /* @__PURE__ */ E(ge, { variant: "caption", children: [
3629
- e("saas.copy"),
3630
- /* @__PURE__ */ d(zt, { href: "//chimera.com.pe", color: "inherit", target: "_blank", rel: "noreferrer", children: "Chimera Software" })
439
+ /* @__PURE__ */ a(fe, { position: "static", color: "primary", children: /* @__PURE__ */ a(he, { sx: { justifyContent: "center" }, children: /* @__PURE__ */ d(z, { variant: "caption", children: [
440
+ n("saas.copy"),
441
+ /* @__PURE__ */ a(ye, { href: "//chimera.com.pe", color: "inherit", target: "_blank", rel: "noreferrer", children: "Chimera Software" })
3631
442
  ] }) }) })
3632
443
  ] });
3633
444
  };
3634
- Yt.propTypes = {
3635
- devURL: h.string
445
+ oe.propTypes = {
446
+ devURL: t.string
3636
447
  };
3637
- const vt = ({ devURL: n, redirectTo: r, children: e }) => {
3638
- const t = Ke();
3639
- return Ot(n) ? e : /* @__PURE__ */ d(Ze, { to: r, state: { from: t }, replace: !0 });
448
+ const ne = ({ devURL: o, redirectTo: e, children: n }) => {
449
+ const r = M();
450
+ return Y(o) ? n : /* @__PURE__ */ a(G, { to: e, state: { from: r }, replace: !0 });
3640
451
  };
3641
- vt.propTypes = {
3642
- devURL: h.string,
3643
- redirectTo: h.string.isRequired,
3644
- children: h.element.isRequired
452
+ ne.propTypes = {
453
+ devURL: t.string,
454
+ redirectTo: t.string.isRequired,
455
+ children: t.element.isRequired
3645
456
  };
3646
- const Et = ({
3647
- devURL: n,
3648
- requiereLogin: r,
3649
- basename: e,
3650
- children: t
3651
- }) => /* @__PURE__ */ d(ir, { basename: e, children: /* @__PURE__ */ E(sr, { children: [
3652
- /* @__PURE__ */ d(Ne, { path: "/login", element: /* @__PURE__ */ d(Yt, { devURL: n }) }),
3653
- /* @__PURE__ */ d(
3654
- Ne,
457
+ const re = ({
458
+ devURL: o,
459
+ requiereLogin: e,
460
+ basename: n,
461
+ children: r
462
+ }) => /* @__PURE__ */ a(qe, { basename: n, children: /* @__PURE__ */ d(De, { children: [
463
+ /* @__PURE__ */ a(O, { path: "/login", element: /* @__PURE__ */ a(oe, { devURL: o }) }),
464
+ /* @__PURE__ */ a(
465
+ O,
3655
466
  {
3656
467
  path: "/*",
3657
- element: r ? /* @__PURE__ */ d(vt, { devURL: n, redirectTo: "/login", children: t }) : t
468
+ element: e ? /* @__PURE__ */ a(ne, { devURL: o, redirectTo: "/login", children: r }) : r
3658
469
  }
3659
470
  )
3660
471
  ] }) });
3661
- Et.propTypes = {
3662
- devURL: h.string,
3663
- requiereLogin: h.bool,
3664
- basename: h.string,
3665
- children: h.element.isRequired
472
+ re.propTypes = {
473
+ devURL: t.string,
474
+ requiereLogin: t.bool,
475
+ basename: t.string,
476
+ children: t.element.isRequired
3666
477
  };
3667
- const _t = ({ devURL: n, basename: r, children: e }) => {
3668
- const t = I((a) => a.aplicacion);
3669
- return /* @__PURE__ */ d(re, { sx: {
478
+ const ie = ({ devURL: o, basename: e, children: n }) => {
479
+ const r = u((i) => i.aplicacion);
480
+ return /* @__PURE__ */ a(S, { sx: {
3670
481
  display: "flex",
3671
482
  flexDirection: "column",
3672
483
  minHeight: "100vh",
3673
484
  justifyContent: "flex-start",
3674
485
  backgroundColor: "background.default"
3675
- }, children: t.inicializando ? /* @__PURE__ */ d(dr, {}) : t.error || !t.inicializado ? /* @__PURE__ */ d(et, { titulo: "saas.inicializar.error.titulo", texto: "saas.inicializar.error.mensaje" }) : /* @__PURE__ */ E(It, { children: [
3676
- /* @__PURE__ */ d(
3677
- Et,
486
+ }, children: r.inicializando ? /* @__PURE__ */ a(Oe, {}) : r.error || !r.inicializado ? /* @__PURE__ */ a(H, { titulo: "saas.inicializar.error.titulo", texto: "saas.inicializar.error.mensaje" }) : /* @__PURE__ */ d(te, { children: [
487
+ /* @__PURE__ */ a(
488
+ re,
3678
489
  {
3679
- devURL: n,
3680
- requiereLogin: t.instancia.requiereLogin,
3681
- basename: r,
3682
- children: e
490
+ devURL: o,
491
+ requiereLogin: r.instancia.requiereLogin,
492
+ basename: e,
493
+ children: n
3683
494
  }
3684
495
  ),
3685
- /* @__PURE__ */ d(Or, {})
496
+ /* @__PURE__ */ a(Qe, {})
3686
497
  ] }) });
3687
498
  };
3688
- _t.propTypes = {
3689
- devURL: h.string,
3690
- basename: h.string,
3691
- children: h.element.isRequired
499
+ ie.propTypes = {
500
+ devURL: t.string,
501
+ basename: t.string,
502
+ children: t.element.isRequired
3692
503
  };
3693
- const Lt = ({
3694
- aplicacion: n,
3695
- devSaasURL: r,
3696
- devAuthURL: e,
3697
- messages: t,
3698
- idiomaDefecto: a,
3699
- basename: i,
504
+ const ae = ({
505
+ aplicacion: o,
506
+ devSaasURL: e,
507
+ devAuthURL: n,
508
+ messages: r,
509
+ idiomaDefecto: i,
510
+ basename: c,
3700
511
  children: s
3701
512
  }) => {
3702
- const c = S();
3703
- return U(() => {
3704
- c(ue({ devURL: r, aplicacion: n }));
3705
- }, [c, n, r]), /* @__PURE__ */ d(Dt, { messages: t, idiomaDefecto: a, children: /* @__PURE__ */ d(Mt, { children: /* @__PURE__ */ d(
3706
- _t,
513
+ const h = f();
514
+ return T(() => {
515
+ h(I({ devURL: e, aplicacion: o }));
516
+ }, [h, o, e]), /* @__PURE__ */ a(J, { messages: r, idiomaDefecto: i, children: /* @__PURE__ */ a(Q, { children: /* @__PURE__ */ a(
517
+ ie,
3707
518
  {
3708
- devURL: e,
3709
- basename: i,
519
+ devURL: n,
520
+ basename: c,
3710
521
  children: s
3711
522
  }
3712
523
  ) }) });
3713
524
  };
3714
- Lt.propTypes = {
3715
- aplicacion: h.string.isRequired,
3716
- devSaasURL: h.string,
3717
- devAuthURL: h.string,
3718
- messages: h.object.isRequired,
3719
- idiomaDefecto: h.string,
3720
- basename: h.string,
3721
- children: h.element.isRequired
525
+ ae.propTypes = {
526
+ aplicacion: t.string.isRequired,
527
+ devSaasURL: t.string,
528
+ devAuthURL: t.string,
529
+ messages: t.object.isRequired,
530
+ idiomaDefecto: t.string,
531
+ basename: t.string,
532
+ children: t.element.isRequired
3722
533
  };
3723
- const si = ({
3724
- customReducers: n,
3725
- aplicacion: r,
3726
- devSaasURL: e,
3727
- devAuthURL: t,
3728
- dev: a = !1,
3729
- idiomaDefecto: i,
534
+ const io = ({
535
+ customReducers: o,
536
+ aplicacion: e,
537
+ devSaasURL: n,
538
+ devAuthURL: r,
539
+ dev: i = !1,
540
+ idiomaDefecto: c,
3730
541
  messages: s,
3731
- basename: c,
3732
- children: l
3733
- }) => /* @__PURE__ */ d($t, { store: Mr(n), children: /* @__PURE__ */ d(
3734
- Lt,
542
+ basename: h,
543
+ children: j
544
+ }) => /* @__PURE__ */ a(be, { store: Je(o), children: /* @__PURE__ */ a(
545
+ ae,
3735
546
  {
3736
- aplicacion: r,
3737
- devSaasURL: a ? e : void 0,
3738
- devAuthURL: a ? t : void 0,
3739
- idiomaDefecto: i,
547
+ aplicacion: e,
548
+ devSaasURL: i ? n : void 0,
549
+ devAuthURL: i ? r : void 0,
550
+ idiomaDefecto: c,
3740
551
  messages: s,
3741
- basename: c,
3742
- children: l
552
+ basename: h,
553
+ children: j
3743
554
  }
3744
555
  ) });
3745
- si.propTypes = {
3746
- customReducers: h.object,
3747
- aplicacion: h.string.isRequired,
3748
- devSaasURL: h.string,
3749
- devAuthURL: h.string,
3750
- dev: h.bool,
3751
- idiomaDefecto: h.string,
3752
- messages: h.object,
3753
- basename: h.string,
3754
- children: h.element.isRequired
556
+ io.propTypes = {
557
+ customReducers: t.object,
558
+ aplicacion: t.string.isRequired,
559
+ devSaasURL: t.string,
560
+ devAuthURL: t.string,
561
+ dev: t.bool,
562
+ idiomaDefecto: t.string,
563
+ messages: t.object,
564
+ basename: t.string,
565
+ children: t.element.isRequired
3755
566
  };
3756
- const oi = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, F = (n) => typeof n > "u" || n === null || n === "" || Array.isArray(n) && n.length === 0, q = (n, r, e, t) => typeof n == "function" ? n({ args: r, value: e, values: t }) : r ? { message: n, args: r } : n, N = (n) => Je(n, (...r) => JSON.stringify(r)), Wi = (...n) => (r, e, t) => (Array.isArray(n[0]) ? n[0] : n).reduce(
3757
- (i, s) => i || typeof s == "function" && s(r, e, t),
567
+ const ao = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, m = (o) => typeof o > "u" || o === null || o === "" || Array.isArray(o) && o.length === 0, p = (o, e, n, r) => typeof o == "function" ? o({ args: e, value: n, values: r }) : e ? { message: o, args: e } : o, g = (o) => $(o, (...e) => JSON.stringify(e)), qo = (...o) => (e, n, r) => (Array.isArray(o[0]) ? o[0] : o).reduce(
568
+ (c, s) => c || typeof s == "function" && s(e, n, r),
3758
569
  void 0
3759
- ), Ii = N((n = "validacion.obligatorio") => Object.assign(
3760
- (r, e) => F(r) ? q(n, void 0, r, e) : void 0,
570
+ ), Do = g((o = "validacion.obligatorio") => Object.assign(
571
+ (e, n) => m(e) ? p(o, void 0, e, n) : void 0,
3761
572
  { isRequired: !0 }
3762
- )), qi = N((n = "validacion.obligatorio") => Object.assign(
3763
- (r, e) => F(r) || !r ? q(n, void 0, r, e) : void 0,
573
+ )), No = g((o = "validacion.obligatorio") => Object.assign(
574
+ (e, n) => m(e) || !e ? p(o, void 0, e, n) : void 0,
3764
575
  { isRequired: !0 }
3765
- )), Hi = N((n = "validacion.numero") => (r, e) => !F(r) && isNaN(r) ? q(n, void 0, r, e) : void 0), Fi = N(
3766
- (n, r = "validacion.longitud.minima") => (e, t) => !F(e) && e.length < n ? q(r, void 0, e, t) : void 0
3767
- ), Ni = N(
3768
- (n, r = "validacion.longitud.maxima") => (e, t) => !F(e) && e.length > n ? q(r, void 0, e, t) : void 0
3769
- ), Ri = N(
3770
- (n, r = "validacion.minimo") => (e, t) => !F(e) && parseFloat(e) < n ? q(r, void 0, e, t) : void 0
3771
- ), Ai = N(
3772
- (n, r = "validacion.maximo") => (e, t) => !F(e) && parseFloat(e) > n ? q(r, void 0, e, t) : void 0
3773
- ), ci = Je(
3774
- (n, r = "validacion.regex") => (e, t) => !F(e) && typeof e == "string" && !n.test(e) ? q(r, void 0, e, t) : void 0,
3775
- (n, r) => n.toString() + r
3776
- ), Si = N((n = "validacion.correo") => ci(oi, n)), Qi = N((n, r, e = "validacion.remote") => (t, a, i) => i.active && !F(t) && n(t, r).then((s) => s ? q(e, void 0, t, a) : void 0).catch((s) => q(s.message, void 0, t, a)));
576
+ )), _o = g((o = "validacion.numero") => (e, n) => !m(e) && isNaN(e) ? p(o, void 0, e, n) : void 0), Eo = g(
577
+ (o, e = "validacion.longitud.minima") => (n, r) => !m(n) && n.length < o ? p(e, void 0, n, r) : void 0
578
+ ), Oo = g(
579
+ (o, e = "validacion.longitud.maxima") => (n, r) => !m(n) && n.length > o ? p(e, void 0, n, r) : void 0
580
+ ), Uo = g(
581
+ (o, e = "validacion.minimo") => (n, r) => !m(n) && parseFloat(n) < o ? p(e, void 0, n, r) : void 0
582
+ ), Fo = g(
583
+ (o, e = "validacion.maximo") => (n, r) => !m(n) && parseFloat(n) > o ? p(e, void 0, n, r) : void 0
584
+ ), to = $(
585
+ (o, e = "validacion.regex") => (n, r) => !m(n) && typeof n == "string" && !o.test(n) ? p(e, void 0, n, r) : void 0,
586
+ (o, e) => o.toString() + e
587
+ ), Po = g((o = "validacion.correo") => to(ao, o)), Bo = g((o, e, n = "validacion.remote") => (r, i, c) => c.active && !m(r) && o(r, e).then((s) => s ? p(n, void 0, r, i) : void 0).catch((s) => p(s.message, void 0, r, i)));
3777
588
  export {
3778
- dr as Cargando,
3779
- et as Error,
3780
- si as SaasApp,
3781
- Wi as composeValidators,
3782
- Si as email,
3783
- Ci as getInstancia,
3784
- Li as getPerfiles,
3785
- Ei as getToken,
3786
- _i as getUsuario,
3787
- Ae as logout,
3788
- Ai as max,
3789
- Ni as maxLength,
3790
- Ri as min,
3791
- Fi as minLength,
3792
- Hi as number,
3793
- ci as regex,
3794
- Qi as remote,
3795
- Ii as required,
3796
- qi as requiredNotFalse,
3797
- ii as useNotificar
589
+ Oe as Cargando,
590
+ H as Error,
591
+ io as SaasApp,
592
+ qo as composeValidators,
593
+ Po as email,
594
+ Lo as getInstancia,
595
+ zo as getPerfiles,
596
+ jo as getToken,
597
+ Ao as getUsuario,
598
+ F as logout,
599
+ Fo as max,
600
+ Oo as maxLength,
601
+ Uo as min,
602
+ Eo as minLength,
603
+ _o as number,
604
+ to as regex,
605
+ Bo as remote,
606
+ Do as required,
607
+ No as requiredNotFalse,
608
+ ro as useNotificar
3798
609
  };