brd-ui-kit 0.1.72 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brd-ui-kit.css +1 -1
- package/dist/calendar-C0DXP3T-.js +3118 -0
- package/dist/calendar-C0DXP3T-.js.map +1 -0
- package/dist/calendar-DReGV_22.cjs +2 -0
- package/dist/calendar-DReGV_22.cjs.map +1 -0
- package/dist/calendar-locale-CP2pxhFK.cjs +2 -0
- package/dist/calendar-locale-CP2pxhFK.cjs.map +1 -0
- package/dist/calendar-locale-DJf03PI9.js +592 -0
- package/dist/calendar-locale-DJf03PI9.js.map +1 -0
- package/dist/{chart-CgVfpT_X.cjs → chart-C69jBlXa.cjs} +2 -2
- package/dist/{chart-CgVfpT_X.cjs.map → chart-C69jBlXa.cjs.map} +1 -1
- package/dist/{chart-D15EtNmb.js → chart-CAPCe8o5.js} +3 -3
- package/dist/{chart-D15EtNmb.js.map → chart-CAPCe8o5.js.map} +1 -1
- package/dist/components/basic-table/basic-table.d.ts +33 -2
- package/dist/components/basic-table/index.d.ts +1 -1
- package/dist/components/data-table/data-table-actions-column.d.ts +23 -0
- package/dist/components/data-table/data-table-bulk-actions.d.ts +20 -0
- package/dist/components/data-table/data-table-column-visibility.d.ts +17 -0
- package/dist/components/data-table/data-table-editable-column.d.ts +12 -0
- package/dist/components/data-table/data-table-filter.d.ts +12 -0
- package/dist/components/data-table/data-table-row-actions-column.d.ts +53 -0
- package/dist/components/data-table/data-table-select-column.d.ts +2 -0
- package/dist/components/data-table/data-table.d.ts +2 -0
- package/dist/components/data-table/data-table.styles.d.ts +8 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/data-table/use-data-table-editable-rows.d.ts +60 -0
- package/dist/components/data-table.d.ts +2 -0
- package/dist/components/files-uploader/files-uploader.d.ts +8 -6
- package/dist/components/textarea-field/index.d.ts +1 -1
- package/dist/components/ui/button/button.styles.d.ts +2 -2
- package/dist/components/ui/calendar/calendar.d.ts +14 -10
- package/dist/components/ui/calendar/calendar.styles.d.ts +60 -2
- package/dist/components/ui/calendar/index.d.ts +3 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +102 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.styles.d.ts +9 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu.d.ts +2 -0
- package/dist/components/ui/icon/icon-presets.d.ts +5 -5
- package/dist/components/ui/icon/icon.d.ts +2 -1
- package/dist/components/ui/pagination/pagination.d.ts +6 -5
- package/dist/components/ui/select/select.styles.d.ts +2 -2
- package/dist/components/ui/select-calendar-menu/index.d.ts +1 -0
- package/dist/components/ui/select-calendar-menu/select-calendar-menu.d.ts +33 -0
- package/dist/components/ui/select-calendar-menu.d.ts +2 -0
- package/dist/components/ui/textarea/textarea.d.ts +2 -2
- package/dist/components/ui/toggle/index.d.ts +3 -0
- package/dist/components/ui/toggle/toggle.d.ts +5 -0
- package/dist/components/ui/toggle/toggle.styles.d.ts +10 -0
- package/dist/components/ui/toggle-group/index.d.ts +1 -0
- package/dist/components/ui/toggle-group/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group/toggle-group.styles.d.ts +14 -0
- package/dist/components/ui/toggle-group.d.ts +2 -0
- package/dist/components/ui/toggle.d.ts +2 -0
- package/dist/components-app-pagination-app-pagination.cjs +1 -1
- package/dist/components-app-pagination-app-pagination.cjs.map +1 -1
- package/dist/components-app-pagination-app-pagination.js +46 -30
- package/dist/components-app-pagination-app-pagination.js.map +1 -1
- package/dist/components-app-pagination-app-pagination.styles.cjs +2 -2
- package/dist/components-app-pagination-app-pagination.styles.cjs.map +1 -1
- package/dist/components-app-pagination-app-pagination.styles.js +12 -12
- package/dist/components-app-pagination-app-pagination.styles.js.map +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.cjs +2 -2
- package/dist/components-avatar-uploader-avatar-uploader.cjs.map +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.js +8 -4
- package/dist/components-avatar-uploader-avatar-uploader.js.map +1 -1
- package/dist/components-basic-avatar-basic-avatar.cjs +2 -2
- package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -1
- package/dist/components-basic-avatar-basic-avatar.js +8 -4
- package/dist/components-basic-avatar-basic-avatar.js.map +1 -1
- package/dist/components-basic-chart-basic-chart.cjs +1 -1
- package/dist/components-basic-chart-basic-chart.js +1 -1
- package/dist/components-basic-drawer-basic-drawer.cjs +1 -1
- package/dist/components-basic-drawer-basic-drawer.cjs.map +1 -1
- package/dist/components-basic-drawer-basic-drawer.js +13 -14
- package/dist/components-basic-drawer-basic-drawer.js.map +1 -1
- package/dist/components-basic-table-basic-table.cjs +2 -2
- package/dist/components-basic-table-basic-table.cjs.map +1 -1
- package/dist/components-basic-table-basic-table.js +874 -757
- package/dist/components-basic-table-basic-table.js.map +1 -1
- package/dist/components-data-table-data-table-actions-column.cjs +2 -0
- package/dist/components-data-table-data-table-actions-column.cjs.map +1 -0
- package/dist/components-data-table-data-table-actions-column.js +72 -0
- package/dist/components-data-table-data-table-actions-column.js.map +1 -0
- package/dist/components-data-table-data-table-bulk-actions.cjs +2 -0
- package/dist/components-data-table-data-table-bulk-actions.cjs.map +1 -0
- package/dist/components-data-table-data-table-bulk-actions.js +60 -0
- package/dist/components-data-table-data-table-bulk-actions.js.map +1 -0
- package/dist/components-data-table-data-table-column-visibility.cjs +3 -0
- package/dist/components-data-table-data-table-column-visibility.cjs.map +1 -0
- package/dist/components-data-table-data-table-column-visibility.js +100 -0
- package/dist/components-data-table-data-table-column-visibility.js.map +1 -0
- package/dist/components-data-table-data-table-editable-column.cjs +2 -0
- package/dist/components-data-table-data-table-editable-column.cjs.map +1 -0
- package/dist/components-data-table-data-table-editable-column.js +15 -0
- package/dist/components-data-table-data-table-editable-column.js.map +1 -0
- package/dist/components-data-table-data-table-filter.cjs +2 -0
- package/dist/components-data-table-data-table-filter.cjs.map +1 -0
- package/dist/components-data-table-data-table-filter.js +39 -0
- package/dist/components-data-table-data-table-filter.js.map +1 -0
- package/dist/components-data-table-data-table-row-actions-column.cjs +2 -0
- package/dist/components-data-table-data-table-row-actions-column.cjs.map +1 -0
- package/dist/components-data-table-data-table-row-actions-column.js +174 -0
- package/dist/components-data-table-data-table-row-actions-column.js.map +1 -0
- package/dist/components-data-table-data-table-select-column.cjs +2 -0
- package/dist/components-data-table-data-table-select-column.cjs.map +1 -0
- package/dist/components-data-table-data-table-select-column.js +44 -0
- package/dist/components-data-table-data-table-select-column.js.map +1 -0
- package/dist/components-data-table-data-table.cjs +2 -0
- package/dist/components-data-table-data-table.cjs.map +1 -0
- package/dist/components-data-table-data-table.js +37 -0
- package/dist/components-data-table-data-table.js.map +1 -0
- package/dist/components-data-table-data-table.styles.cjs +4 -0
- package/dist/components-data-table-data-table.styles.cjs.map +1 -0
- package/dist/components-data-table-data-table.styles.js +22 -0
- package/dist/components-data-table-data-table.styles.js.map +1 -0
- package/dist/components-data-table-use-data-table-editable-rows.cjs +2 -0
- package/dist/components-data-table-use-data-table-editable-rows.cjs.map +1 -0
- package/dist/components-data-table-use-data-table-editable-rows.js +156 -0
- package/dist/components-data-table-use-data-table-editable-rows.js.map +1 -0
- package/dist/components-data-table.cjs +2 -0
- package/dist/components-data-table.cjs.map +1 -0
- package/dist/components-data-table.js +21 -0
- package/dist/components-data-table.js.map +1 -0
- package/dist/components-files-uploader-files-uploader.cjs +6 -6
- package/dist/components-files-uploader-files-uploader.cjs.map +1 -1
- package/dist/components-files-uploader-files-uploader.js +108 -109
- package/dist/components-files-uploader-files-uploader.js.map +1 -1
- package/dist/components-input-contact-input-contact.cjs +1 -1
- package/dist/components-input-contact-input-contact.cjs.map +1 -1
- package/dist/components-input-contact-input-contact.js +8 -4
- package/dist/components-input-contact-input-contact.js.map +1 -1
- package/dist/components-input-password-input-password.cjs +1 -1
- package/dist/components-input-password-input-password.cjs.map +1 -1
- package/dist/components-input-password-input-password.js +8 -4
- package/dist/components-input-password-input-password.js.map +1 -1
- package/dist/components-popover-modal-popover-modal.cjs.map +1 -1
- package/dist/components-popover-modal-popover-modal.js +27 -20
- package/dist/components-popover-modal-popover-modal.js.map +1 -1
- package/dist/components-textarea-field-textarea-field.cjs.map +1 -1
- package/dist/components-textarea-field-textarea-field.js.map +1 -1
- package/dist/components-ui-button-button.styles.cjs +18 -8
- package/dist/components-ui-button-button.styles.cjs.map +1 -1
- package/dist/components-ui-button-button.styles.js +49 -33
- package/dist/components-ui-button-button.styles.js.map +1 -1
- package/dist/components-ui-calendar-calendar.cjs +1 -12
- package/dist/components-ui-calendar-calendar.cjs.map +1 -1
- package/dist/components-ui-calendar-calendar.js +12 -3757
- package/dist/components-ui-calendar-calendar.js.map +1 -1
- package/dist/components-ui-calendar-calendar.styles.cjs +17 -13
- package/dist/components-ui-calendar-calendar.styles.cjs.map +1 -1
- package/dist/components-ui-calendar-calendar.styles.js +193 -24
- package/dist/components-ui-calendar-calendar.styles.js.map +1 -1
- package/dist/components-ui-calendar.cjs +1 -1
- package/dist/components-ui-calendar.js +3 -2
- package/dist/components-ui-calendar.js.map +1 -1
- package/dist/components-ui-card-card.styles.cjs +2 -2
- package/dist/components-ui-card-card.styles.cjs.map +1 -1
- package/dist/components-ui-card-card.styles.js +2 -2
- package/dist/components-ui-card-card.styles.js.map +1 -1
- package/dist/components-ui-chart-chart.cjs +1 -1
- package/dist/components-ui-chart-chart.js +1 -1
- package/dist/components-ui-chart.cjs +1 -1
- package/dist/components-ui-chart.js +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs +3 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs.map +1 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.js +293 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.js.map +1 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.styles.cjs +29 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.styles.cjs.map +1 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.styles.js +43 -0
- package/dist/components-ui-dropdown-menu-dropdown-menu.styles.js.map +1 -0
- package/dist/components-ui-dropdown-menu.cjs +2 -0
- package/dist/components-ui-dropdown-menu.cjs.map +1 -0
- package/dist/components-ui-dropdown-menu.js +17 -0
- package/dist/components-ui-dropdown-menu.js.map +1 -0
- package/dist/components-ui-field-field.cjs +1 -1
- package/dist/components-ui-field-field.cjs.map +1 -1
- package/dist/components-ui-field-field.js +14 -14
- package/dist/components-ui-field-field.js.map +1 -1
- package/dist/components-ui-icon-icon-presets.cjs +1 -1
- package/dist/components-ui-icon-icon-presets.cjs.map +1 -1
- package/dist/components-ui-icon-icon-presets.js +3 -3
- package/dist/components-ui-icon-icon-presets.js.map +1 -1
- package/dist/components-ui-icon-icon.cjs +1 -1
- package/dist/components-ui-icon-icon.cjs.map +1 -1
- package/dist/components-ui-icon-icon.js +2621 -3595
- package/dist/components-ui-icon-icon.js.map +1 -1
- package/dist/components-ui-input-group-input-group.cjs.map +1 -1
- package/dist/components-ui-input-group-input-group.js.map +1 -1
- package/dist/components-ui-pagination-pagination.cjs +2 -1
- package/dist/components-ui-pagination-pagination.cjs.map +1 -1
- package/dist/components-ui-pagination-pagination.js +93 -62
- package/dist/components-ui-pagination-pagination.js.map +1 -1
- package/dist/components-ui-popover-popover.cjs.map +1 -1
- package/dist/components-ui-popover-popover.js +24 -14
- package/dist/components-ui-popover-popover.js.map +1 -1
- package/dist/components-ui-popover-popover.styles.cjs.map +1 -1
- package/dist/components-ui-popover-popover.styles.js.map +1 -1
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs +2 -0
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs.map +1 -0
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.js +138 -0
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.js.map +1 -0
- package/dist/components-ui-select-calendar-menu.cjs +2 -0
- package/dist/components-ui-select-calendar-menu.cjs.map +1 -0
- package/dist/components-ui-select-calendar-menu.js +5 -0
- package/dist/components-ui-select-calendar-menu.js.map +1 -0
- package/dist/components-ui-select-select.cjs.map +1 -1
- package/dist/components-ui-select-select.js.map +1 -1
- package/dist/components-ui-select-select.styles.cjs +2 -2
- package/dist/components-ui-select-select.styles.cjs.map +1 -1
- package/dist/components-ui-select-select.styles.js +5 -5
- package/dist/components-ui-select-select.styles.js.map +1 -1
- package/dist/components-ui-sonner-sonner.styles.cjs.map +1 -1
- package/dist/components-ui-sonner-sonner.styles.js.map +1 -1
- package/dist/components-ui-textarea-textarea.cjs +1 -1
- package/dist/components-ui-textarea-textarea.cjs.map +1 -1
- package/dist/components-ui-textarea-textarea.js +2 -3
- package/dist/components-ui-textarea-textarea.js.map +1 -1
- package/dist/components-ui-textarea-textarea.styles.cjs +1 -1
- package/dist/components-ui-textarea-textarea.styles.cjs.map +1 -1
- package/dist/components-ui-textarea-textarea.styles.js +1 -1
- package/dist/components-ui-textarea-textarea.styles.js.map +1 -1
- package/dist/components-ui-toggle-group-toggle-group.cjs +2 -0
- package/dist/components-ui-toggle-group-toggle-group.cjs.map +1 -0
- package/dist/components-ui-toggle-group-toggle-group.js +122 -0
- package/dist/components-ui-toggle-group-toggle-group.js.map +1 -0
- package/dist/components-ui-toggle-group-toggle-group.styles.cjs +2 -0
- package/dist/components-ui-toggle-group-toggle-group.styles.cjs.map +1 -0
- package/dist/components-ui-toggle-group-toggle-group.styles.js +81 -0
- package/dist/components-ui-toggle-group-toggle-group.styles.js.map +1 -0
- package/dist/components-ui-toggle-group.cjs +2 -0
- package/dist/components-ui-toggle-group.cjs.map +1 -0
- package/dist/components-ui-toggle-group.js +6 -0
- package/dist/components-ui-toggle-group.js.map +1 -0
- package/dist/components-ui-toggle-toggle.cjs +2 -0
- package/dist/components-ui-toggle-toggle.cjs.map +1 -0
- package/dist/components-ui-toggle-toggle.js +57 -0
- package/dist/components-ui-toggle-toggle.js.map +1 -0
- package/dist/components-ui-toggle-toggle.styles.cjs +7 -0
- package/dist/components-ui-toggle-toggle.styles.cjs.map +1 -0
- package/dist/components-ui-toggle-toggle.styles.js +33 -0
- package/dist/components-ui-toggle-toggle.styles.js.map +1 -0
- package/dist/components-ui-toggle.cjs +2 -0
- package/dist/components-ui-toggle.cjs.map +1 -0
- package/dist/components-ui-toggle.js +7 -0
- package/dist/components-ui-toggle.js.map +1 -0
- package/dist/constants/calendar-locale.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +227 -191
- package/dist/index.js.map +1 -1
- package/package.json +62 -17
|
@@ -1,3761 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "./lib-utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "./components-ui-button-button.js";
|
|
5
|
+
import "./components-ui-button-button.styles.js";
|
|
6
|
+
import "./components-ui-card-card.js";
|
|
7
|
+
import "./components-ui-icon-icon.js";
|
|
8
|
+
import "./components-ui-typography-typography.js";
|
|
9
9
|
import "./components-ui-typography-typography.styles.js";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
const Kn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
13
|
-
const Zn = (e) => e.replace(
|
|
14
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
15
|
-
(t, n, r) => r ? r.toUpperCase() : n.toLowerCase()
|
|
16
|
-
);
|
|
17
|
-
const bt = (e) => {
|
|
18
|
-
const t = Zn(e);
|
|
19
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
20
|
-
};
|
|
21
|
-
var Jn = {
|
|
22
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
width: 24,
|
|
24
|
-
height: 24,
|
|
25
|
-
viewBox: "0 0 24 24",
|
|
26
|
-
fill: "none",
|
|
27
|
-
stroke: "currentColor",
|
|
28
|
-
strokeWidth: 2,
|
|
29
|
-
strokeLinecap: "round",
|
|
30
|
-
strokeLinejoin: "round"
|
|
31
|
-
};
|
|
32
|
-
const Ln = (e) => {
|
|
33
|
-
for (const t in e)
|
|
34
|
-
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
35
|
-
return !0;
|
|
36
|
-
return !1;
|
|
37
|
-
};
|
|
38
|
-
const er = Tt(
|
|
39
|
-
({
|
|
40
|
-
color: e = "currentColor",
|
|
41
|
-
size: t = 24,
|
|
42
|
-
strokeWidth: n = 2,
|
|
43
|
-
absoluteStrokeWidth: r,
|
|
44
|
-
className: o = "",
|
|
45
|
-
children: a,
|
|
46
|
-
iconNode: i,
|
|
47
|
-
...s
|
|
48
|
-
}, u) => Qe(
|
|
49
|
-
"svg",
|
|
50
|
-
{
|
|
51
|
-
ref: u,
|
|
52
|
-
...Jn,
|
|
53
|
-
width: t,
|
|
54
|
-
height: t,
|
|
55
|
-
stroke: e,
|
|
56
|
-
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
|
|
57
|
-
className: Et("lucide", o),
|
|
58
|
-
...!a && !Ln(s) && { "aria-hidden": "true" },
|
|
59
|
-
...s
|
|
60
|
-
},
|
|
61
|
-
[
|
|
62
|
-
...i.map(([c, d]) => Qe(c, d)),
|
|
63
|
-
...Array.isArray(a) ? a : [a]
|
|
64
|
-
]
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
const Ze = (e, t) => {
|
|
68
|
-
const n = Tt(
|
|
69
|
-
({ className: r, ...o }, a) => Qe(er, {
|
|
70
|
-
ref: a,
|
|
71
|
-
iconNode: t,
|
|
72
|
-
className: Et(
|
|
73
|
-
`lucide-${Kn(bt(e))}`,
|
|
74
|
-
`lucide-${e}`,
|
|
75
|
-
r
|
|
76
|
-
),
|
|
77
|
-
...o
|
|
78
|
-
})
|
|
79
|
-
);
|
|
80
|
-
return n.displayName = bt(e), n;
|
|
81
|
-
};
|
|
82
|
-
const tr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], nr = Ze("chevron-down", tr);
|
|
83
|
-
const rr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], or = Ze("chevron-left", rr);
|
|
84
|
-
const ar = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], sr = Ze("chevron-right", ar);
|
|
85
|
-
function ir(e, t, n = "long") {
|
|
86
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
87
|
-
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
88
|
-
hour: "numeric",
|
|
89
|
-
timeZone: e,
|
|
90
|
-
timeZoneName: n
|
|
91
|
-
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
92
|
-
}
|
|
93
|
-
const ze = {}, ve = {};
|
|
94
|
-
function fe(e, t) {
|
|
95
|
-
try {
|
|
96
|
-
const r = (ze[e] || (ze[e] = new Intl.DateTimeFormat("en-US", {
|
|
97
|
-
timeZone: e,
|
|
98
|
-
timeZoneName: "longOffset"
|
|
99
|
-
}).format))(t).split("GMT")[1];
|
|
100
|
-
return r in ve ? ve[r] : pt(r, r.split(":"));
|
|
101
|
-
} catch {
|
|
102
|
-
if (e in ve) return ve[e];
|
|
103
|
-
const n = e?.match(ur);
|
|
104
|
-
return n ? pt(e, n.slice(1)) : NaN;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const ur = /([+-]\d\d):?(\d\d)?/;
|
|
108
|
-
function pt(e, t) {
|
|
109
|
-
const n = +(t[0] || 0), r = +(t[1] || 0), o = +(t[2] || 0) / 60;
|
|
110
|
-
return ve[e] = n * 60 + r > 0 ? n * 60 + r + o : n * 60 - r - o;
|
|
111
|
-
}
|
|
112
|
-
class ne extends Date {
|
|
113
|
-
//#region static
|
|
114
|
-
constructor(...t) {
|
|
115
|
-
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(fe(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Ft(this), Ke(this)) : this.setTime(Date.now());
|
|
116
|
-
}
|
|
117
|
-
static tz(t, ...n) {
|
|
118
|
-
return n.length ? new ne(...n, t) : new ne(Date.now(), t);
|
|
119
|
-
}
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region time zone
|
|
122
|
-
withTimeZone(t) {
|
|
123
|
-
return new ne(+this, t);
|
|
124
|
-
}
|
|
125
|
-
getTimezoneOffset() {
|
|
126
|
-
const t = -fe(this.timeZone, this);
|
|
127
|
-
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region time
|
|
131
|
-
setTime(t) {
|
|
132
|
-
return Date.prototype.setTime.apply(this, arguments), Ke(this), +this;
|
|
133
|
-
}
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region date-fns integration
|
|
136
|
-
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
137
|
-
return new ne(+new Date(t), this.timeZone);
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
}
|
|
141
|
-
const wt = /^(get|set)(?!UTC)/;
|
|
142
|
-
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
143
|
-
if (!wt.test(e)) return;
|
|
144
|
-
const t = e.replace(wt, "$1UTC");
|
|
145
|
-
ne.prototype[t] && (e.startsWith("get") ? ne.prototype[e] = function() {
|
|
146
|
-
return this.internal[t]();
|
|
147
|
-
} : (ne.prototype[e] = function() {
|
|
148
|
-
return Date.prototype[t].apply(this.internal, arguments), cr(this), +this;
|
|
149
|
-
}, ne.prototype[t] = function() {
|
|
150
|
-
return Date.prototype[t].apply(this, arguments), Ke(this), +this;
|
|
151
|
-
}));
|
|
152
|
-
});
|
|
153
|
-
function Ke(e) {
|
|
154
|
-
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-fe(e.timeZone, e) * 60));
|
|
155
|
-
}
|
|
156
|
-
function cr(e) {
|
|
157
|
-
Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Ft(e);
|
|
158
|
-
}
|
|
159
|
-
function Ft(e) {
|
|
160
|
-
const t = fe(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
|
|
161
|
-
r.setUTCHours(r.getUTCHours() - 1);
|
|
162
|
-
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), i = o - a, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
163
|
-
i && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
164
|
-
const u = o - n;
|
|
165
|
-
u && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + u);
|
|
166
|
-
const c = /* @__PURE__ */ new Date(+e);
|
|
167
|
-
c.setUTCSeconds(0);
|
|
168
|
-
const d = o > 0 ? c.getSeconds() : (c.getSeconds() - 60) % 60, l = Math.round(-(fe(e.timeZone, e) * 60)) % 60;
|
|
169
|
-
(l || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + l), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + l + d));
|
|
170
|
-
const f = fe(e.timeZone, e), m = f > 0 ? Math.floor(f) : Math.ceil(f), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - m, O = m !== n, Y = W - u;
|
|
171
|
-
if (O && Y) {
|
|
172
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + Y);
|
|
173
|
-
const M = fe(e.timeZone, e), p = M > 0 ? Math.floor(M) : Math.ceil(M), k = m - p;
|
|
174
|
-
k && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + k), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + k));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
class H extends ne {
|
|
178
|
-
//#region static
|
|
179
|
-
static tz(t, ...n) {
|
|
180
|
-
return n.length ? new H(...n, t) : new H(Date.now(), t);
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
|
-
//#region representation
|
|
184
|
-
toISOString() {
|
|
185
|
-
const [t, n, r] = this.tzComponents(), o = `${t}${n}:${r}`;
|
|
186
|
-
return this.internal.toISOString().slice(0, -1) + o;
|
|
187
|
-
}
|
|
188
|
-
toString() {
|
|
189
|
-
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
190
|
-
}
|
|
191
|
-
toDateString() {
|
|
192
|
-
const [t, n, r, o] = this.internal.toUTCString().split(" ");
|
|
193
|
-
return `${t?.slice(0, -1)} ${r} ${n} ${o}`;
|
|
194
|
-
}
|
|
195
|
-
toTimeString() {
|
|
196
|
-
const t = this.internal.toUTCString().split(" ")[4], [n, r, o] = this.tzComponents();
|
|
197
|
-
return `${t} GMT${n}${r}${o} (${ir(this.timeZone, this)})`;
|
|
198
|
-
}
|
|
199
|
-
toLocaleString(t, n) {
|
|
200
|
-
return Date.prototype.toLocaleString.call(this, t, {
|
|
201
|
-
...n,
|
|
202
|
-
timeZone: n?.timeZone || this.timeZone
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
toLocaleDateString(t, n) {
|
|
206
|
-
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
207
|
-
...n,
|
|
208
|
-
timeZone: n?.timeZone || this.timeZone
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
toLocaleTimeString(t, n) {
|
|
212
|
-
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
213
|
-
...n,
|
|
214
|
-
timeZone: n?.timeZone || this.timeZone
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region private
|
|
219
|
-
tzComponents() {
|
|
220
|
-
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), o = String(Math.abs(t) % 60).padStart(2, "0");
|
|
221
|
-
return [n, r, o];
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
withTimeZone(t) {
|
|
225
|
-
return new H(+this, t);
|
|
226
|
-
}
|
|
227
|
-
//#region date-fns integration
|
|
228
|
-
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
229
|
-
return new H(+new Date(t), this.timeZone);
|
|
230
|
-
}
|
|
231
|
-
//#endregion
|
|
232
|
-
}
|
|
233
|
-
const Bt = 6048e5, lr = 864e5, vt = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
234
|
-
function G(e, t) {
|
|
235
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" && vt in e ? e[vt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
236
|
-
}
|
|
237
|
-
function T(e, t) {
|
|
238
|
-
return G(t || e, e);
|
|
239
|
-
}
|
|
240
|
-
function Gt(e, t, n) {
|
|
241
|
-
const r = T(e, n?.in);
|
|
242
|
-
return isNaN(t) ? G(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
243
|
-
}
|
|
244
|
-
function It(e, t, n) {
|
|
245
|
-
const r = T(e, n?.in);
|
|
246
|
-
if (isNaN(t)) return G(e, NaN);
|
|
247
|
-
if (!t)
|
|
248
|
-
return r;
|
|
249
|
-
const o = r.getDate(), a = G(e, r.getTime());
|
|
250
|
-
a.setMonth(r.getMonth() + t + 1, 0);
|
|
251
|
-
const i = a.getDate();
|
|
252
|
-
return o >= i ? a : (r.setFullYear(
|
|
253
|
-
a.getFullYear(),
|
|
254
|
-
a.getMonth(),
|
|
255
|
-
o
|
|
256
|
-
), r);
|
|
257
|
-
}
|
|
258
|
-
let dr = {};
|
|
259
|
-
function Oe() {
|
|
260
|
-
return dr;
|
|
261
|
-
}
|
|
262
|
-
function le(e, t) {
|
|
263
|
-
const n = Oe(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = T(e, t?.in), a = o.getDay(), i = (a < r ? 7 : 0) + a - r;
|
|
264
|
-
return o.setDate(o.getDate() - i), o.setHours(0, 0, 0, 0), o;
|
|
265
|
-
}
|
|
266
|
-
function ke(e, t) {
|
|
267
|
-
return le(e, { ...t, weekStartsOn: 1 });
|
|
268
|
-
}
|
|
269
|
-
function $t(e, t) {
|
|
270
|
-
const n = T(e, t?.in), r = n.getFullYear(), o = G(n, 0);
|
|
271
|
-
o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
272
|
-
const a = ke(o), i = G(n, 0);
|
|
273
|
-
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
274
|
-
const s = ke(i);
|
|
275
|
-
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
|
|
276
|
-
}
|
|
277
|
-
function Mt(e) {
|
|
278
|
-
const t = T(e), n = new Date(
|
|
279
|
-
Date.UTC(
|
|
280
|
-
t.getFullYear(),
|
|
281
|
-
t.getMonth(),
|
|
282
|
-
t.getDate(),
|
|
283
|
-
t.getHours(),
|
|
284
|
-
t.getMinutes(),
|
|
285
|
-
t.getSeconds(),
|
|
286
|
-
t.getMilliseconds()
|
|
287
|
-
)
|
|
288
|
-
);
|
|
289
|
-
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
290
|
-
}
|
|
291
|
-
function he(e, ...t) {
|
|
292
|
-
const n = G.bind(
|
|
293
|
-
null,
|
|
294
|
-
e || t.find((r) => typeof r == "object")
|
|
295
|
-
);
|
|
296
|
-
return t.map(n);
|
|
297
|
-
}
|
|
298
|
-
function De(e, t) {
|
|
299
|
-
const n = T(e, t?.in);
|
|
300
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
301
|
-
}
|
|
302
|
-
function Je(e, t, n) {
|
|
303
|
-
const [r, o] = he(
|
|
304
|
-
n?.in,
|
|
305
|
-
e,
|
|
306
|
-
t
|
|
307
|
-
), a = De(r), i = De(o), s = +a - Mt(a), u = +i - Mt(i);
|
|
308
|
-
return Math.round((s - u) / lr);
|
|
309
|
-
}
|
|
310
|
-
function fr(e, t) {
|
|
311
|
-
const n = $t(e, t), r = G(e, 0);
|
|
312
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), ke(r);
|
|
313
|
-
}
|
|
314
|
-
function hr(e, t, n) {
|
|
315
|
-
return Gt(e, t * 7, n);
|
|
316
|
-
}
|
|
317
|
-
function mr(e, t, n) {
|
|
318
|
-
return It(e, t * 12, n);
|
|
319
|
-
}
|
|
320
|
-
function yr(e, t) {
|
|
321
|
-
let n, r = t?.in;
|
|
322
|
-
return e.forEach((o) => {
|
|
323
|
-
!r && typeof o == "object" && (r = G.bind(null, o));
|
|
324
|
-
const a = T(o, r);
|
|
325
|
-
(!n || n < a || isNaN(+a)) && (n = a);
|
|
326
|
-
}), G(r, n || NaN);
|
|
327
|
-
}
|
|
328
|
-
function gr(e, t) {
|
|
329
|
-
let n, r = t?.in;
|
|
330
|
-
return e.forEach((o) => {
|
|
331
|
-
!r && typeof o == "object" && (r = G.bind(null, o));
|
|
332
|
-
const a = T(o, r);
|
|
333
|
-
(!n || n > a || isNaN(+a)) && (n = a);
|
|
334
|
-
}), G(r, n || NaN);
|
|
335
|
-
}
|
|
336
|
-
function br(e, t, n) {
|
|
337
|
-
const [r, o] = he(
|
|
338
|
-
n?.in,
|
|
339
|
-
e,
|
|
340
|
-
t
|
|
341
|
-
);
|
|
342
|
-
return +De(r) == +De(o);
|
|
343
|
-
}
|
|
344
|
-
function Ht(e) {
|
|
345
|
-
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
346
|
-
}
|
|
347
|
-
function pr(e) {
|
|
348
|
-
return !(!Ht(e) && typeof e != "number" || isNaN(+T(e)));
|
|
349
|
-
}
|
|
350
|
-
function At(e, t, n) {
|
|
351
|
-
const [r, o] = he(
|
|
352
|
-
n?.in,
|
|
353
|
-
e,
|
|
354
|
-
t
|
|
355
|
-
), a = r.getFullYear() - o.getFullYear(), i = r.getMonth() - o.getMonth();
|
|
356
|
-
return a * 12 + i;
|
|
357
|
-
}
|
|
358
|
-
function wr(e, t) {
|
|
359
|
-
const n = T(e, t?.in), r = n.getMonth();
|
|
360
|
-
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
361
|
-
}
|
|
362
|
-
function qt(e, t) {
|
|
363
|
-
const [n, r] = he(e, t.start, t.end);
|
|
364
|
-
return { start: n, end: r };
|
|
365
|
-
}
|
|
366
|
-
function vr(e, t) {
|
|
367
|
-
const { start: n, end: r } = qt(t?.in, e);
|
|
368
|
-
let o = +n > +r;
|
|
369
|
-
const a = o ? +n : +r, i = o ? r : n;
|
|
370
|
-
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
371
|
-
let s = 1;
|
|
372
|
-
const u = [];
|
|
373
|
-
for (; +i <= a; )
|
|
374
|
-
u.push(G(n, i)), i.setMonth(i.getMonth() + s);
|
|
375
|
-
return o ? u.reverse() : u;
|
|
376
|
-
}
|
|
377
|
-
function Mr(e, t) {
|
|
378
|
-
const n = T(e, t?.in);
|
|
379
|
-
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
380
|
-
}
|
|
381
|
-
function kr(e, t) {
|
|
382
|
-
const n = T(e, t?.in), r = n.getFullYear();
|
|
383
|
-
return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
384
|
-
}
|
|
385
|
-
function zt(e, t) {
|
|
386
|
-
const n = T(e, t?.in);
|
|
387
|
-
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
388
|
-
}
|
|
389
|
-
function Dr(e, t) {
|
|
390
|
-
const { start: n, end: r } = qt(t?.in, e);
|
|
391
|
-
let o = +n > +r;
|
|
392
|
-
const a = o ? +n : +r, i = o ? r : n;
|
|
393
|
-
i.setHours(0, 0, 0, 0), i.setMonth(0, 1);
|
|
394
|
-
let s = 1;
|
|
395
|
-
const u = [];
|
|
396
|
-
for (; +i <= a; )
|
|
397
|
-
u.push(G(n, i)), i.setFullYear(i.getFullYear() + s);
|
|
398
|
-
return o ? u.reverse() : u;
|
|
399
|
-
}
|
|
400
|
-
function jt(e, t) {
|
|
401
|
-
const n = Oe(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = T(e, t?.in), a = o.getDay(), i = (a < r ? -7 : 0) + 6 - (a - r);
|
|
402
|
-
return o.setDate(o.getDate() + i), o.setHours(23, 59, 59, 999), o;
|
|
403
|
-
}
|
|
404
|
-
function Or(e, t) {
|
|
405
|
-
return jt(e, { ...t, weekStartsOn: 1 });
|
|
406
|
-
}
|
|
407
|
-
const Wr = {
|
|
408
|
-
lessThanXSeconds: {
|
|
409
|
-
one: "less than a second",
|
|
410
|
-
other: "less than {{count}} seconds"
|
|
411
|
-
},
|
|
412
|
-
xSeconds: {
|
|
413
|
-
one: "1 second",
|
|
414
|
-
other: "{{count}} seconds"
|
|
415
|
-
},
|
|
416
|
-
halfAMinute: "half a minute",
|
|
417
|
-
lessThanXMinutes: {
|
|
418
|
-
one: "less than a minute",
|
|
419
|
-
other: "less than {{count}} minutes"
|
|
420
|
-
},
|
|
421
|
-
xMinutes: {
|
|
422
|
-
one: "1 minute",
|
|
423
|
-
other: "{{count}} minutes"
|
|
424
|
-
},
|
|
425
|
-
aboutXHours: {
|
|
426
|
-
one: "about 1 hour",
|
|
427
|
-
other: "about {{count}} hours"
|
|
428
|
-
},
|
|
429
|
-
xHours: {
|
|
430
|
-
one: "1 hour",
|
|
431
|
-
other: "{{count}} hours"
|
|
432
|
-
},
|
|
433
|
-
xDays: {
|
|
434
|
-
one: "1 day",
|
|
435
|
-
other: "{{count}} days"
|
|
436
|
-
},
|
|
437
|
-
aboutXWeeks: {
|
|
438
|
-
one: "about 1 week",
|
|
439
|
-
other: "about {{count}} weeks"
|
|
440
|
-
},
|
|
441
|
-
xWeeks: {
|
|
442
|
-
one: "1 week",
|
|
443
|
-
other: "{{count}} weeks"
|
|
444
|
-
},
|
|
445
|
-
aboutXMonths: {
|
|
446
|
-
one: "about 1 month",
|
|
447
|
-
other: "about {{count}} months"
|
|
448
|
-
},
|
|
449
|
-
xMonths: {
|
|
450
|
-
one: "1 month",
|
|
451
|
-
other: "{{count}} months"
|
|
452
|
-
},
|
|
453
|
-
aboutXYears: {
|
|
454
|
-
one: "about 1 year",
|
|
455
|
-
other: "about {{count}} years"
|
|
456
|
-
},
|
|
457
|
-
xYears: {
|
|
458
|
-
one: "1 year",
|
|
459
|
-
other: "{{count}} years"
|
|
460
|
-
},
|
|
461
|
-
overXYears: {
|
|
462
|
-
one: "over 1 year",
|
|
463
|
-
other: "over {{count}} years"
|
|
464
|
-
},
|
|
465
|
-
almostXYears: {
|
|
466
|
-
one: "almost 1 year",
|
|
467
|
-
other: "almost {{count}} years"
|
|
468
|
-
}
|
|
469
|
-
}, Nr = (e, t, n) => {
|
|
470
|
-
let r;
|
|
471
|
-
const o = Wr[e];
|
|
472
|
-
return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
473
|
-
};
|
|
474
|
-
function pe(e) {
|
|
475
|
-
return (t = {}) => {
|
|
476
|
-
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
477
|
-
return e.formats[n] || e.formats[e.defaultWidth];
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
const Sr = {
|
|
481
|
-
full: "EEEE, MMMM do, y",
|
|
482
|
-
long: "MMMM do, y",
|
|
483
|
-
medium: "MMM d, y",
|
|
484
|
-
short: "MM/dd/yyyy"
|
|
485
|
-
}, Cr = {
|
|
486
|
-
full: "h:mm:ss a zzzz",
|
|
487
|
-
long: "h:mm:ss a z",
|
|
488
|
-
medium: "h:mm:ss a",
|
|
489
|
-
short: "h:mm a"
|
|
490
|
-
}, xr = {
|
|
491
|
-
full: "{{date}} 'at' {{time}}",
|
|
492
|
-
long: "{{date}} 'at' {{time}}",
|
|
493
|
-
medium: "{{date}}, {{time}}",
|
|
494
|
-
short: "{{date}}, {{time}}"
|
|
495
|
-
}, Pr = {
|
|
496
|
-
date: pe({
|
|
497
|
-
formats: Sr,
|
|
498
|
-
defaultWidth: "full"
|
|
499
|
-
}),
|
|
500
|
-
time: pe({
|
|
501
|
-
formats: Cr,
|
|
502
|
-
defaultWidth: "full"
|
|
503
|
-
}),
|
|
504
|
-
dateTime: pe({
|
|
505
|
-
formats: xr,
|
|
506
|
-
defaultWidth: "full"
|
|
507
|
-
})
|
|
508
|
-
}, Yr = {
|
|
509
|
-
lastWeek: "'last' eeee 'at' p",
|
|
510
|
-
yesterday: "'yesterday at' p",
|
|
511
|
-
today: "'today at' p",
|
|
512
|
-
tomorrow: "'tomorrow at' p",
|
|
513
|
-
nextWeek: "eeee 'at' p",
|
|
514
|
-
other: "P"
|
|
515
|
-
}, _r = (e, t, n, r) => Yr[e];
|
|
516
|
-
function ee(e) {
|
|
517
|
-
return (t, n) => {
|
|
518
|
-
const r = n?.context ? String(n.context) : "standalone";
|
|
519
|
-
let o;
|
|
520
|
-
if (r === "formatting" && e.formattingValues) {
|
|
521
|
-
const i = e.defaultFormattingWidth || e.defaultWidth, s = n?.width ? String(n.width) : i;
|
|
522
|
-
o = e.formattingValues[s] || e.formattingValues[i];
|
|
523
|
-
} else {
|
|
524
|
-
const i = e.defaultWidth, s = n?.width ? String(n.width) : e.defaultWidth;
|
|
525
|
-
o = e.values[s] || e.values[i];
|
|
526
|
-
}
|
|
527
|
-
const a = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
528
|
-
return o[a];
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
const Tr = {
|
|
532
|
-
narrow: ["B", "A"],
|
|
533
|
-
abbreviated: ["BC", "AD"],
|
|
534
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
535
|
-
}, Er = {
|
|
536
|
-
narrow: ["1", "2", "3", "4"],
|
|
537
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
538
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
539
|
-
}, Fr = {
|
|
540
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
541
|
-
abbreviated: [
|
|
542
|
-
"Jan",
|
|
543
|
-
"Feb",
|
|
544
|
-
"Mar",
|
|
545
|
-
"Apr",
|
|
546
|
-
"May",
|
|
547
|
-
"Jun",
|
|
548
|
-
"Jul",
|
|
549
|
-
"Aug",
|
|
550
|
-
"Sep",
|
|
551
|
-
"Oct",
|
|
552
|
-
"Nov",
|
|
553
|
-
"Dec"
|
|
554
|
-
],
|
|
555
|
-
wide: [
|
|
556
|
-
"January",
|
|
557
|
-
"February",
|
|
558
|
-
"March",
|
|
559
|
-
"April",
|
|
560
|
-
"May",
|
|
561
|
-
"June",
|
|
562
|
-
"July",
|
|
563
|
-
"August",
|
|
564
|
-
"September",
|
|
565
|
-
"October",
|
|
566
|
-
"November",
|
|
567
|
-
"December"
|
|
568
|
-
]
|
|
569
|
-
}, Br = {
|
|
570
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
571
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
572
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
573
|
-
wide: [
|
|
574
|
-
"Sunday",
|
|
575
|
-
"Monday",
|
|
576
|
-
"Tuesday",
|
|
577
|
-
"Wednesday",
|
|
578
|
-
"Thursday",
|
|
579
|
-
"Friday",
|
|
580
|
-
"Saturday"
|
|
581
|
-
]
|
|
582
|
-
}, Gr = {
|
|
583
|
-
narrow: {
|
|
584
|
-
am: "a",
|
|
585
|
-
pm: "p",
|
|
586
|
-
midnight: "mi",
|
|
587
|
-
noon: "n",
|
|
588
|
-
morning: "morning",
|
|
589
|
-
afternoon: "afternoon",
|
|
590
|
-
evening: "evening",
|
|
591
|
-
night: "night"
|
|
592
|
-
},
|
|
593
|
-
abbreviated: {
|
|
594
|
-
am: "AM",
|
|
595
|
-
pm: "PM",
|
|
596
|
-
midnight: "midnight",
|
|
597
|
-
noon: "noon",
|
|
598
|
-
morning: "morning",
|
|
599
|
-
afternoon: "afternoon",
|
|
600
|
-
evening: "evening",
|
|
601
|
-
night: "night"
|
|
602
|
-
},
|
|
603
|
-
wide: {
|
|
604
|
-
am: "a.m.",
|
|
605
|
-
pm: "p.m.",
|
|
606
|
-
midnight: "midnight",
|
|
607
|
-
noon: "noon",
|
|
608
|
-
morning: "morning",
|
|
609
|
-
afternoon: "afternoon",
|
|
610
|
-
evening: "evening",
|
|
611
|
-
night: "night"
|
|
612
|
-
}
|
|
613
|
-
}, Ir = {
|
|
614
|
-
narrow: {
|
|
615
|
-
am: "a",
|
|
616
|
-
pm: "p",
|
|
617
|
-
midnight: "mi",
|
|
618
|
-
noon: "n",
|
|
619
|
-
morning: "in the morning",
|
|
620
|
-
afternoon: "in the afternoon",
|
|
621
|
-
evening: "in the evening",
|
|
622
|
-
night: "at night"
|
|
623
|
-
},
|
|
624
|
-
abbreviated: {
|
|
625
|
-
am: "AM",
|
|
626
|
-
pm: "PM",
|
|
627
|
-
midnight: "midnight",
|
|
628
|
-
noon: "noon",
|
|
629
|
-
morning: "in the morning",
|
|
630
|
-
afternoon: "in the afternoon",
|
|
631
|
-
evening: "in the evening",
|
|
632
|
-
night: "at night"
|
|
633
|
-
},
|
|
634
|
-
wide: {
|
|
635
|
-
am: "a.m.",
|
|
636
|
-
pm: "p.m.",
|
|
637
|
-
midnight: "midnight",
|
|
638
|
-
noon: "noon",
|
|
639
|
-
morning: "in the morning",
|
|
640
|
-
afternoon: "in the afternoon",
|
|
641
|
-
evening: "in the evening",
|
|
642
|
-
night: "at night"
|
|
643
|
-
}
|
|
644
|
-
}, $r = (e, t) => {
|
|
645
|
-
const n = Number(e), r = n % 100;
|
|
646
|
-
if (r > 20 || r < 10)
|
|
647
|
-
switch (r % 10) {
|
|
648
|
-
case 1:
|
|
649
|
-
return n + "st";
|
|
650
|
-
case 2:
|
|
651
|
-
return n + "nd";
|
|
652
|
-
case 3:
|
|
653
|
-
return n + "rd";
|
|
654
|
-
}
|
|
655
|
-
return n + "th";
|
|
656
|
-
}, Hr = {
|
|
657
|
-
ordinalNumber: $r,
|
|
658
|
-
era: ee({
|
|
659
|
-
values: Tr,
|
|
660
|
-
defaultWidth: "wide"
|
|
661
|
-
}),
|
|
662
|
-
quarter: ee({
|
|
663
|
-
values: Er,
|
|
664
|
-
defaultWidth: "wide",
|
|
665
|
-
argumentCallback: (e) => e - 1
|
|
666
|
-
}),
|
|
667
|
-
month: ee({
|
|
668
|
-
values: Fr,
|
|
669
|
-
defaultWidth: "wide"
|
|
670
|
-
}),
|
|
671
|
-
day: ee({
|
|
672
|
-
values: Br,
|
|
673
|
-
defaultWidth: "wide"
|
|
674
|
-
}),
|
|
675
|
-
dayPeriod: ee({
|
|
676
|
-
values: Gr,
|
|
677
|
-
defaultWidth: "wide",
|
|
678
|
-
formattingValues: Ir,
|
|
679
|
-
defaultFormattingWidth: "wide"
|
|
680
|
-
})
|
|
681
|
-
};
|
|
682
|
-
function te(e) {
|
|
683
|
-
return (t, n = {}) => {
|
|
684
|
-
const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(o);
|
|
685
|
-
if (!a)
|
|
686
|
-
return null;
|
|
687
|
-
const i = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(s) ? qr(s, (l) => l.test(i)) : (
|
|
688
|
-
// [TODO] -- I challenge you to fix the type
|
|
689
|
-
Ar(s, (l) => l.test(i))
|
|
690
|
-
);
|
|
691
|
-
let c;
|
|
692
|
-
c = e.valueCallback ? e.valueCallback(u) : u, c = n.valueCallback ? (
|
|
693
|
-
// [TODO] -- I challenge you to fix the type
|
|
694
|
-
n.valueCallback(c)
|
|
695
|
-
) : c;
|
|
696
|
-
const d = t.slice(i.length);
|
|
697
|
-
return { value: c, rest: d };
|
|
698
|
-
};
|
|
699
|
-
}
|
|
700
|
-
function Ar(e, t) {
|
|
701
|
-
for (const n in e)
|
|
702
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
703
|
-
return n;
|
|
704
|
-
}
|
|
705
|
-
function qr(e, t) {
|
|
706
|
-
for (let n = 0; n < e.length; n++)
|
|
707
|
-
if (t(e[n]))
|
|
708
|
-
return n;
|
|
709
|
-
}
|
|
710
|
-
function Rt(e) {
|
|
711
|
-
return (t, n = {}) => {
|
|
712
|
-
const r = t.match(e.matchPattern);
|
|
713
|
-
if (!r) return null;
|
|
714
|
-
const o = r[0], a = t.match(e.parsePattern);
|
|
715
|
-
if (!a) return null;
|
|
716
|
-
let i = e.valueCallback ? e.valueCallback(a[0]) : a[0];
|
|
717
|
-
i = n.valueCallback ? n.valueCallback(i) : i;
|
|
718
|
-
const s = t.slice(o.length);
|
|
719
|
-
return { value: i, rest: s };
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
const zr = /^(\d+)(th|st|nd|rd)?/i, jr = /\d+/i, Rr = {
|
|
723
|
-
narrow: /^(b|a)/i,
|
|
724
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
725
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
726
|
-
}, Vr = {
|
|
727
|
-
any: [/^b/i, /^(a|c)/i]
|
|
728
|
-
}, Xr = {
|
|
729
|
-
narrow: /^[1234]/i,
|
|
730
|
-
abbreviated: /^q[1234]/i,
|
|
731
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
732
|
-
}, Qr = {
|
|
733
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
734
|
-
}, Ur = {
|
|
735
|
-
narrow: /^[jfmasond]/i,
|
|
736
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
737
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
738
|
-
}, Kr = {
|
|
739
|
-
narrow: [
|
|
740
|
-
/^j/i,
|
|
741
|
-
/^f/i,
|
|
742
|
-
/^m/i,
|
|
743
|
-
/^a/i,
|
|
744
|
-
/^m/i,
|
|
745
|
-
/^j/i,
|
|
746
|
-
/^j/i,
|
|
747
|
-
/^a/i,
|
|
748
|
-
/^s/i,
|
|
749
|
-
/^o/i,
|
|
750
|
-
/^n/i,
|
|
751
|
-
/^d/i
|
|
752
|
-
],
|
|
753
|
-
any: [
|
|
754
|
-
/^ja/i,
|
|
755
|
-
/^f/i,
|
|
756
|
-
/^mar/i,
|
|
757
|
-
/^ap/i,
|
|
758
|
-
/^may/i,
|
|
759
|
-
/^jun/i,
|
|
760
|
-
/^jul/i,
|
|
761
|
-
/^au/i,
|
|
762
|
-
/^s/i,
|
|
763
|
-
/^o/i,
|
|
764
|
-
/^n/i,
|
|
765
|
-
/^d/i
|
|
766
|
-
]
|
|
767
|
-
}, Zr = {
|
|
768
|
-
narrow: /^[smtwf]/i,
|
|
769
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
770
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
771
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
772
|
-
}, Jr = {
|
|
773
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
774
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
775
|
-
}, Lr = {
|
|
776
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
777
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
778
|
-
}, eo = {
|
|
779
|
-
any: {
|
|
780
|
-
am: /^a/i,
|
|
781
|
-
pm: /^p/i,
|
|
782
|
-
midnight: /^mi/i,
|
|
783
|
-
noon: /^no/i,
|
|
784
|
-
morning: /morning/i,
|
|
785
|
-
afternoon: /afternoon/i,
|
|
786
|
-
evening: /evening/i,
|
|
787
|
-
night: /night/i
|
|
788
|
-
}
|
|
789
|
-
}, to = {
|
|
790
|
-
ordinalNumber: Rt({
|
|
791
|
-
matchPattern: zr,
|
|
792
|
-
parsePattern: jr,
|
|
793
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
794
|
-
}),
|
|
795
|
-
era: te({
|
|
796
|
-
matchPatterns: Rr,
|
|
797
|
-
defaultMatchWidth: "wide",
|
|
798
|
-
parsePatterns: Vr,
|
|
799
|
-
defaultParseWidth: "any"
|
|
800
|
-
}),
|
|
801
|
-
quarter: te({
|
|
802
|
-
matchPatterns: Xr,
|
|
803
|
-
defaultMatchWidth: "wide",
|
|
804
|
-
parsePatterns: Qr,
|
|
805
|
-
defaultParseWidth: "any",
|
|
806
|
-
valueCallback: (e) => e + 1
|
|
807
|
-
}),
|
|
808
|
-
month: te({
|
|
809
|
-
matchPatterns: Ur,
|
|
810
|
-
defaultMatchWidth: "wide",
|
|
811
|
-
parsePatterns: Kr,
|
|
812
|
-
defaultParseWidth: "any"
|
|
813
|
-
}),
|
|
814
|
-
day: te({
|
|
815
|
-
matchPatterns: Zr,
|
|
816
|
-
defaultMatchWidth: "wide",
|
|
817
|
-
parsePatterns: Jr,
|
|
818
|
-
defaultParseWidth: "any"
|
|
819
|
-
}),
|
|
820
|
-
dayPeriod: te({
|
|
821
|
-
matchPatterns: Lr,
|
|
822
|
-
defaultMatchWidth: "any",
|
|
823
|
-
parsePatterns: eo,
|
|
824
|
-
defaultParseWidth: "any"
|
|
825
|
-
})
|
|
826
|
-
}, be = {
|
|
827
|
-
code: "en-US",
|
|
828
|
-
formatDistance: Nr,
|
|
829
|
-
formatLong: Pr,
|
|
830
|
-
formatRelative: _r,
|
|
831
|
-
localize: Hr,
|
|
832
|
-
match: to,
|
|
833
|
-
options: {
|
|
834
|
-
weekStartsOn: 0,
|
|
835
|
-
firstWeekContainsDate: 1
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
function no(e, t) {
|
|
839
|
-
const n = T(e, t?.in);
|
|
840
|
-
return Je(n, zt(n)) + 1;
|
|
841
|
-
}
|
|
842
|
-
function Le(e, t) {
|
|
843
|
-
const n = T(e, t?.in), r = +ke(n) - +fr(n);
|
|
844
|
-
return Math.round(r / Bt) + 1;
|
|
845
|
-
}
|
|
846
|
-
function Vt(e, t) {
|
|
847
|
-
const n = T(e, t?.in), r = n.getFullYear(), o = Oe(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = G(t?.in || e, 0);
|
|
848
|
-
i.setFullYear(r + 1, 0, a), i.setHours(0, 0, 0, 0);
|
|
849
|
-
const s = le(i, t), u = G(t?.in || e, 0);
|
|
850
|
-
u.setFullYear(r, 0, a), u.setHours(0, 0, 0, 0);
|
|
851
|
-
const c = le(u, t);
|
|
852
|
-
return +n >= +s ? r + 1 : +n >= +c ? r : r - 1;
|
|
853
|
-
}
|
|
854
|
-
function ro(e, t) {
|
|
855
|
-
const n = Oe(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = Vt(e, t), a = G(t?.in || e, 0);
|
|
856
|
-
return a.setFullYear(o, 0, r), a.setHours(0, 0, 0, 0), le(a, t);
|
|
857
|
-
}
|
|
858
|
-
function et(e, t) {
|
|
859
|
-
const n = T(e, t?.in), r = +le(n, t) - +ro(n, t);
|
|
860
|
-
return Math.round(r / Bt) + 1;
|
|
861
|
-
}
|
|
862
|
-
function _(e, t) {
|
|
863
|
-
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
864
|
-
return n + r;
|
|
865
|
-
}
|
|
866
|
-
const ce = {
|
|
867
|
-
// Year
|
|
868
|
-
y(e, t) {
|
|
869
|
-
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
870
|
-
return _(t === "yy" ? r % 100 : r, t.length);
|
|
871
|
-
},
|
|
872
|
-
// Month
|
|
873
|
-
M(e, t) {
|
|
874
|
-
const n = e.getMonth();
|
|
875
|
-
return t === "M" ? String(n + 1) : _(n + 1, 2);
|
|
876
|
-
},
|
|
877
|
-
// Day of the month
|
|
878
|
-
d(e, t) {
|
|
879
|
-
return _(e.getDate(), t.length);
|
|
880
|
-
},
|
|
881
|
-
// AM or PM
|
|
882
|
-
a(e, t) {
|
|
883
|
-
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
884
|
-
switch (t) {
|
|
885
|
-
case "a":
|
|
886
|
-
case "aa":
|
|
887
|
-
return n.toUpperCase();
|
|
888
|
-
case "aaa":
|
|
889
|
-
return n;
|
|
890
|
-
case "aaaaa":
|
|
891
|
-
return n[0];
|
|
892
|
-
default:
|
|
893
|
-
return n === "am" ? "a.m." : "p.m.";
|
|
894
|
-
}
|
|
895
|
-
},
|
|
896
|
-
// Hour [1-12]
|
|
897
|
-
h(e, t) {
|
|
898
|
-
return _(e.getHours() % 12 || 12, t.length);
|
|
899
|
-
},
|
|
900
|
-
// Hour [0-23]
|
|
901
|
-
H(e, t) {
|
|
902
|
-
return _(e.getHours(), t.length);
|
|
903
|
-
},
|
|
904
|
-
// Minute
|
|
905
|
-
m(e, t) {
|
|
906
|
-
return _(e.getMinutes(), t.length);
|
|
907
|
-
},
|
|
908
|
-
// Second
|
|
909
|
-
s(e, t) {
|
|
910
|
-
return _(e.getSeconds(), t.length);
|
|
911
|
-
},
|
|
912
|
-
// Fraction of second
|
|
913
|
-
S(e, t) {
|
|
914
|
-
const n = t.length, r = e.getMilliseconds(), o = Math.trunc(
|
|
915
|
-
r * Math.pow(10, n - 3)
|
|
916
|
-
);
|
|
917
|
-
return _(o, t.length);
|
|
918
|
-
}
|
|
919
|
-
}, ye = {
|
|
920
|
-
midnight: "midnight",
|
|
921
|
-
noon: "noon",
|
|
922
|
-
morning: "morning",
|
|
923
|
-
afternoon: "afternoon",
|
|
924
|
-
evening: "evening",
|
|
925
|
-
night: "night"
|
|
926
|
-
}, kt = {
|
|
927
|
-
// Era
|
|
928
|
-
G: function(e, t, n) {
|
|
929
|
-
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
930
|
-
switch (t) {
|
|
931
|
-
// AD, BC
|
|
932
|
-
case "G":
|
|
933
|
-
case "GG":
|
|
934
|
-
case "GGG":
|
|
935
|
-
return n.era(r, { width: "abbreviated" });
|
|
936
|
-
// A, B
|
|
937
|
-
case "GGGGG":
|
|
938
|
-
return n.era(r, { width: "narrow" });
|
|
939
|
-
default:
|
|
940
|
-
return n.era(r, { width: "wide" });
|
|
941
|
-
}
|
|
942
|
-
},
|
|
943
|
-
// Year
|
|
944
|
-
y: function(e, t, n) {
|
|
945
|
-
if (t === "yo") {
|
|
946
|
-
const r = e.getFullYear(), o = r > 0 ? r : 1 - r;
|
|
947
|
-
return n.ordinalNumber(o, { unit: "year" });
|
|
948
|
-
}
|
|
949
|
-
return ce.y(e, t);
|
|
950
|
-
},
|
|
951
|
-
// Local week-numbering year
|
|
952
|
-
Y: function(e, t, n, r) {
|
|
953
|
-
const o = Vt(e, r), a = o > 0 ? o : 1 - o;
|
|
954
|
-
if (t === "YY") {
|
|
955
|
-
const i = a % 100;
|
|
956
|
-
return _(i, 2);
|
|
957
|
-
}
|
|
958
|
-
return t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : _(a, t.length);
|
|
959
|
-
},
|
|
960
|
-
// ISO week-numbering year
|
|
961
|
-
R: function(e, t) {
|
|
962
|
-
const n = $t(e);
|
|
963
|
-
return _(n, t.length);
|
|
964
|
-
},
|
|
965
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
966
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
967
|
-
// | Year | `y` | `u` |
|
|
968
|
-
// |------|-----|-----|
|
|
969
|
-
// | AC 1 | 1 | 1 |
|
|
970
|
-
// | BC 1 | 1 | 0 |
|
|
971
|
-
// | BC 2 | 2 | -1 |
|
|
972
|
-
// Also `yy` always returns the last two digits of a year,
|
|
973
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
974
|
-
u: function(e, t) {
|
|
975
|
-
const n = e.getFullYear();
|
|
976
|
-
return _(n, t.length);
|
|
977
|
-
},
|
|
978
|
-
// Quarter
|
|
979
|
-
Q: function(e, t, n) {
|
|
980
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
981
|
-
switch (t) {
|
|
982
|
-
// 1, 2, 3, 4
|
|
983
|
-
case "Q":
|
|
984
|
-
return String(r);
|
|
985
|
-
// 01, 02, 03, 04
|
|
986
|
-
case "QQ":
|
|
987
|
-
return _(r, 2);
|
|
988
|
-
// 1st, 2nd, 3rd, 4th
|
|
989
|
-
case "Qo":
|
|
990
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
991
|
-
// Q1, Q2, Q3, Q4
|
|
992
|
-
case "QQQ":
|
|
993
|
-
return n.quarter(r, {
|
|
994
|
-
width: "abbreviated",
|
|
995
|
-
context: "formatting"
|
|
996
|
-
});
|
|
997
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
998
|
-
case "QQQQQ":
|
|
999
|
-
return n.quarter(r, {
|
|
1000
|
-
width: "narrow",
|
|
1001
|
-
context: "formatting"
|
|
1002
|
-
});
|
|
1003
|
-
default:
|
|
1004
|
-
return n.quarter(r, {
|
|
1005
|
-
width: "wide",
|
|
1006
|
-
context: "formatting"
|
|
1007
|
-
});
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
// Stand-alone quarter
|
|
1011
|
-
q: function(e, t, n) {
|
|
1012
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
1013
|
-
switch (t) {
|
|
1014
|
-
// 1, 2, 3, 4
|
|
1015
|
-
case "q":
|
|
1016
|
-
return String(r);
|
|
1017
|
-
// 01, 02, 03, 04
|
|
1018
|
-
case "qq":
|
|
1019
|
-
return _(r, 2);
|
|
1020
|
-
// 1st, 2nd, 3rd, 4th
|
|
1021
|
-
case "qo":
|
|
1022
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
1023
|
-
// Q1, Q2, Q3, Q4
|
|
1024
|
-
case "qqq":
|
|
1025
|
-
return n.quarter(r, {
|
|
1026
|
-
width: "abbreviated",
|
|
1027
|
-
context: "standalone"
|
|
1028
|
-
});
|
|
1029
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1030
|
-
case "qqqqq":
|
|
1031
|
-
return n.quarter(r, {
|
|
1032
|
-
width: "narrow",
|
|
1033
|
-
context: "standalone"
|
|
1034
|
-
});
|
|
1035
|
-
default:
|
|
1036
|
-
return n.quarter(r, {
|
|
1037
|
-
width: "wide",
|
|
1038
|
-
context: "standalone"
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
1041
|
-
},
|
|
1042
|
-
// Month
|
|
1043
|
-
M: function(e, t, n) {
|
|
1044
|
-
const r = e.getMonth();
|
|
1045
|
-
switch (t) {
|
|
1046
|
-
case "M":
|
|
1047
|
-
case "MM":
|
|
1048
|
-
return ce.M(e, t);
|
|
1049
|
-
// 1st, 2nd, ..., 12th
|
|
1050
|
-
case "Mo":
|
|
1051
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
1052
|
-
// Jan, Feb, ..., Dec
|
|
1053
|
-
case "MMM":
|
|
1054
|
-
return n.month(r, {
|
|
1055
|
-
width: "abbreviated",
|
|
1056
|
-
context: "formatting"
|
|
1057
|
-
});
|
|
1058
|
-
// J, F, ..., D
|
|
1059
|
-
case "MMMMM":
|
|
1060
|
-
return n.month(r, {
|
|
1061
|
-
width: "narrow",
|
|
1062
|
-
context: "formatting"
|
|
1063
|
-
});
|
|
1064
|
-
default:
|
|
1065
|
-
return n.month(r, { width: "wide", context: "formatting" });
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
// Stand-alone month
|
|
1069
|
-
L: function(e, t, n) {
|
|
1070
|
-
const r = e.getMonth();
|
|
1071
|
-
switch (t) {
|
|
1072
|
-
// 1, 2, ..., 12
|
|
1073
|
-
case "L":
|
|
1074
|
-
return String(r + 1);
|
|
1075
|
-
// 01, 02, ..., 12
|
|
1076
|
-
case "LL":
|
|
1077
|
-
return _(r + 1, 2);
|
|
1078
|
-
// 1st, 2nd, ..., 12th
|
|
1079
|
-
case "Lo":
|
|
1080
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
1081
|
-
// Jan, Feb, ..., Dec
|
|
1082
|
-
case "LLL":
|
|
1083
|
-
return n.month(r, {
|
|
1084
|
-
width: "abbreviated",
|
|
1085
|
-
context: "standalone"
|
|
1086
|
-
});
|
|
1087
|
-
// J, F, ..., D
|
|
1088
|
-
case "LLLLL":
|
|
1089
|
-
return n.month(r, {
|
|
1090
|
-
width: "narrow",
|
|
1091
|
-
context: "standalone"
|
|
1092
|
-
});
|
|
1093
|
-
default:
|
|
1094
|
-
return n.month(r, { width: "wide", context: "standalone" });
|
|
1095
|
-
}
|
|
1096
|
-
},
|
|
1097
|
-
// Local week of year
|
|
1098
|
-
w: function(e, t, n, r) {
|
|
1099
|
-
const o = et(e, r);
|
|
1100
|
-
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : _(o, t.length);
|
|
1101
|
-
},
|
|
1102
|
-
// ISO week of year
|
|
1103
|
-
I: function(e, t, n) {
|
|
1104
|
-
const r = Le(e);
|
|
1105
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : _(r, t.length);
|
|
1106
|
-
},
|
|
1107
|
-
// Day of the month
|
|
1108
|
-
d: function(e, t, n) {
|
|
1109
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : ce.d(e, t);
|
|
1110
|
-
},
|
|
1111
|
-
// Day of year
|
|
1112
|
-
D: function(e, t, n) {
|
|
1113
|
-
const r = no(e);
|
|
1114
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : _(r, t.length);
|
|
1115
|
-
},
|
|
1116
|
-
// Day of week
|
|
1117
|
-
E: function(e, t, n) {
|
|
1118
|
-
const r = e.getDay();
|
|
1119
|
-
switch (t) {
|
|
1120
|
-
// Tue
|
|
1121
|
-
case "E":
|
|
1122
|
-
case "EE":
|
|
1123
|
-
case "EEE":
|
|
1124
|
-
return n.day(r, {
|
|
1125
|
-
width: "abbreviated",
|
|
1126
|
-
context: "formatting"
|
|
1127
|
-
});
|
|
1128
|
-
// T
|
|
1129
|
-
case "EEEEE":
|
|
1130
|
-
return n.day(r, {
|
|
1131
|
-
width: "narrow",
|
|
1132
|
-
context: "formatting"
|
|
1133
|
-
});
|
|
1134
|
-
// Tu
|
|
1135
|
-
case "EEEEEE":
|
|
1136
|
-
return n.day(r, {
|
|
1137
|
-
width: "short",
|
|
1138
|
-
context: "formatting"
|
|
1139
|
-
});
|
|
1140
|
-
default:
|
|
1141
|
-
return n.day(r, {
|
|
1142
|
-
width: "wide",
|
|
1143
|
-
context: "formatting"
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
},
|
|
1147
|
-
// Local day of week
|
|
1148
|
-
e: function(e, t, n, r) {
|
|
1149
|
-
const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1150
|
-
switch (t) {
|
|
1151
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1152
|
-
case "e":
|
|
1153
|
-
return String(a);
|
|
1154
|
-
// Padded numerical value
|
|
1155
|
-
case "ee":
|
|
1156
|
-
return _(a, 2);
|
|
1157
|
-
// 1st, 2nd, ..., 7th
|
|
1158
|
-
case "eo":
|
|
1159
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
1160
|
-
case "eee":
|
|
1161
|
-
return n.day(o, {
|
|
1162
|
-
width: "abbreviated",
|
|
1163
|
-
context: "formatting"
|
|
1164
|
-
});
|
|
1165
|
-
// T
|
|
1166
|
-
case "eeeee":
|
|
1167
|
-
return n.day(o, {
|
|
1168
|
-
width: "narrow",
|
|
1169
|
-
context: "formatting"
|
|
1170
|
-
});
|
|
1171
|
-
// Tu
|
|
1172
|
-
case "eeeeee":
|
|
1173
|
-
return n.day(o, {
|
|
1174
|
-
width: "short",
|
|
1175
|
-
context: "formatting"
|
|
1176
|
-
});
|
|
1177
|
-
default:
|
|
1178
|
-
return n.day(o, {
|
|
1179
|
-
width: "wide",
|
|
1180
|
-
context: "formatting"
|
|
1181
|
-
});
|
|
1182
|
-
}
|
|
1183
|
-
},
|
|
1184
|
-
// Stand-alone local day of week
|
|
1185
|
-
c: function(e, t, n, r) {
|
|
1186
|
-
const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1187
|
-
switch (t) {
|
|
1188
|
-
// Numerical value (same as in `e`)
|
|
1189
|
-
case "c":
|
|
1190
|
-
return String(a);
|
|
1191
|
-
// Padded numerical value
|
|
1192
|
-
case "cc":
|
|
1193
|
-
return _(a, t.length);
|
|
1194
|
-
// 1st, 2nd, ..., 7th
|
|
1195
|
-
case "co":
|
|
1196
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
1197
|
-
case "ccc":
|
|
1198
|
-
return n.day(o, {
|
|
1199
|
-
width: "abbreviated",
|
|
1200
|
-
context: "standalone"
|
|
1201
|
-
});
|
|
1202
|
-
// T
|
|
1203
|
-
case "ccccc":
|
|
1204
|
-
return n.day(o, {
|
|
1205
|
-
width: "narrow",
|
|
1206
|
-
context: "standalone"
|
|
1207
|
-
});
|
|
1208
|
-
// Tu
|
|
1209
|
-
case "cccccc":
|
|
1210
|
-
return n.day(o, {
|
|
1211
|
-
width: "short",
|
|
1212
|
-
context: "standalone"
|
|
1213
|
-
});
|
|
1214
|
-
default:
|
|
1215
|
-
return n.day(o, {
|
|
1216
|
-
width: "wide",
|
|
1217
|
-
context: "standalone"
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
},
|
|
1221
|
-
// ISO day of week
|
|
1222
|
-
i: function(e, t, n) {
|
|
1223
|
-
const r = e.getDay(), o = r === 0 ? 7 : r;
|
|
1224
|
-
switch (t) {
|
|
1225
|
-
// 2
|
|
1226
|
-
case "i":
|
|
1227
|
-
return String(o);
|
|
1228
|
-
// 02
|
|
1229
|
-
case "ii":
|
|
1230
|
-
return _(o, t.length);
|
|
1231
|
-
// 2nd
|
|
1232
|
-
case "io":
|
|
1233
|
-
return n.ordinalNumber(o, { unit: "day" });
|
|
1234
|
-
// Tue
|
|
1235
|
-
case "iii":
|
|
1236
|
-
return n.day(r, {
|
|
1237
|
-
width: "abbreviated",
|
|
1238
|
-
context: "formatting"
|
|
1239
|
-
});
|
|
1240
|
-
// T
|
|
1241
|
-
case "iiiii":
|
|
1242
|
-
return n.day(r, {
|
|
1243
|
-
width: "narrow",
|
|
1244
|
-
context: "formatting"
|
|
1245
|
-
});
|
|
1246
|
-
// Tu
|
|
1247
|
-
case "iiiiii":
|
|
1248
|
-
return n.day(r, {
|
|
1249
|
-
width: "short",
|
|
1250
|
-
context: "formatting"
|
|
1251
|
-
});
|
|
1252
|
-
default:
|
|
1253
|
-
return n.day(r, {
|
|
1254
|
-
width: "wide",
|
|
1255
|
-
context: "formatting"
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
},
|
|
1259
|
-
// AM or PM
|
|
1260
|
-
a: function(e, t, n) {
|
|
1261
|
-
const o = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1262
|
-
switch (t) {
|
|
1263
|
-
case "a":
|
|
1264
|
-
case "aa":
|
|
1265
|
-
return n.dayPeriod(o, {
|
|
1266
|
-
width: "abbreviated",
|
|
1267
|
-
context: "formatting"
|
|
1268
|
-
});
|
|
1269
|
-
case "aaa":
|
|
1270
|
-
return n.dayPeriod(o, {
|
|
1271
|
-
width: "abbreviated",
|
|
1272
|
-
context: "formatting"
|
|
1273
|
-
}).toLowerCase();
|
|
1274
|
-
case "aaaaa":
|
|
1275
|
-
return n.dayPeriod(o, {
|
|
1276
|
-
width: "narrow",
|
|
1277
|
-
context: "formatting"
|
|
1278
|
-
});
|
|
1279
|
-
default:
|
|
1280
|
-
return n.dayPeriod(o, {
|
|
1281
|
-
width: "wide",
|
|
1282
|
-
context: "formatting"
|
|
1283
|
-
});
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
// AM, PM, midnight, noon
|
|
1287
|
-
b: function(e, t, n) {
|
|
1288
|
-
const r = e.getHours();
|
|
1289
|
-
let o;
|
|
1290
|
-
switch (r === 12 ? o = ye.noon : r === 0 ? o = ye.midnight : o = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1291
|
-
case "b":
|
|
1292
|
-
case "bb":
|
|
1293
|
-
return n.dayPeriod(o, {
|
|
1294
|
-
width: "abbreviated",
|
|
1295
|
-
context: "formatting"
|
|
1296
|
-
});
|
|
1297
|
-
case "bbb":
|
|
1298
|
-
return n.dayPeriod(o, {
|
|
1299
|
-
width: "abbreviated",
|
|
1300
|
-
context: "formatting"
|
|
1301
|
-
}).toLowerCase();
|
|
1302
|
-
case "bbbbb":
|
|
1303
|
-
return n.dayPeriod(o, {
|
|
1304
|
-
width: "narrow",
|
|
1305
|
-
context: "formatting"
|
|
1306
|
-
});
|
|
1307
|
-
default:
|
|
1308
|
-
return n.dayPeriod(o, {
|
|
1309
|
-
width: "wide",
|
|
1310
|
-
context: "formatting"
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
},
|
|
1314
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
1315
|
-
B: function(e, t, n) {
|
|
1316
|
-
const r = e.getHours();
|
|
1317
|
-
let o;
|
|
1318
|
-
switch (r >= 17 ? o = ye.evening : r >= 12 ? o = ye.afternoon : r >= 4 ? o = ye.morning : o = ye.night, t) {
|
|
1319
|
-
case "B":
|
|
1320
|
-
case "BB":
|
|
1321
|
-
case "BBB":
|
|
1322
|
-
return n.dayPeriod(o, {
|
|
1323
|
-
width: "abbreviated",
|
|
1324
|
-
context: "formatting"
|
|
1325
|
-
});
|
|
1326
|
-
case "BBBBB":
|
|
1327
|
-
return n.dayPeriod(o, {
|
|
1328
|
-
width: "narrow",
|
|
1329
|
-
context: "formatting"
|
|
1330
|
-
});
|
|
1331
|
-
default:
|
|
1332
|
-
return n.dayPeriod(o, {
|
|
1333
|
-
width: "wide",
|
|
1334
|
-
context: "formatting"
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
},
|
|
1338
|
-
// Hour [1-12]
|
|
1339
|
-
h: function(e, t, n) {
|
|
1340
|
-
if (t === "ho") {
|
|
1341
|
-
let r = e.getHours() % 12;
|
|
1342
|
-
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1343
|
-
}
|
|
1344
|
-
return ce.h(e, t);
|
|
1345
|
-
},
|
|
1346
|
-
// Hour [0-23]
|
|
1347
|
-
H: function(e, t, n) {
|
|
1348
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : ce.H(e, t);
|
|
1349
|
-
},
|
|
1350
|
-
// Hour [0-11]
|
|
1351
|
-
K: function(e, t, n) {
|
|
1352
|
-
const r = e.getHours() % 12;
|
|
1353
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : _(r, t.length);
|
|
1354
|
-
},
|
|
1355
|
-
// Hour [1-24]
|
|
1356
|
-
k: function(e, t, n) {
|
|
1357
|
-
let r = e.getHours();
|
|
1358
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : _(r, t.length);
|
|
1359
|
-
},
|
|
1360
|
-
// Minute
|
|
1361
|
-
m: function(e, t, n) {
|
|
1362
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : ce.m(e, t);
|
|
1363
|
-
},
|
|
1364
|
-
// Second
|
|
1365
|
-
s: function(e, t, n) {
|
|
1366
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : ce.s(e, t);
|
|
1367
|
-
},
|
|
1368
|
-
// Fraction of second
|
|
1369
|
-
S: function(e, t) {
|
|
1370
|
-
return ce.S(e, t);
|
|
1371
|
-
},
|
|
1372
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1373
|
-
X: function(e, t, n) {
|
|
1374
|
-
const r = e.getTimezoneOffset();
|
|
1375
|
-
if (r === 0)
|
|
1376
|
-
return "Z";
|
|
1377
|
-
switch (t) {
|
|
1378
|
-
// Hours and optional minutes
|
|
1379
|
-
case "X":
|
|
1380
|
-
return Ot(r);
|
|
1381
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1382
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1383
|
-
// so this token always has the same output as `XX`
|
|
1384
|
-
case "XXXX":
|
|
1385
|
-
case "XX":
|
|
1386
|
-
return de(r);
|
|
1387
|
-
// Hours and minutes with `:` delimiter
|
|
1388
|
-
default:
|
|
1389
|
-
return de(r, ":");
|
|
1390
|
-
}
|
|
1391
|
-
},
|
|
1392
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1393
|
-
x: function(e, t, n) {
|
|
1394
|
-
const r = e.getTimezoneOffset();
|
|
1395
|
-
switch (t) {
|
|
1396
|
-
// Hours and optional minutes
|
|
1397
|
-
case "x":
|
|
1398
|
-
return Ot(r);
|
|
1399
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1400
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1401
|
-
// so this token always has the same output as `xx`
|
|
1402
|
-
case "xxxx":
|
|
1403
|
-
case "xx":
|
|
1404
|
-
return de(r);
|
|
1405
|
-
// Hours and minutes with `:` delimiter
|
|
1406
|
-
default:
|
|
1407
|
-
return de(r, ":");
|
|
1408
|
-
}
|
|
1409
|
-
},
|
|
1410
|
-
// Timezone (GMT)
|
|
1411
|
-
O: function(e, t, n) {
|
|
1412
|
-
const r = e.getTimezoneOffset();
|
|
1413
|
-
switch (t) {
|
|
1414
|
-
// Short
|
|
1415
|
-
case "O":
|
|
1416
|
-
case "OO":
|
|
1417
|
-
case "OOO":
|
|
1418
|
-
return "GMT" + Dt(r, ":");
|
|
1419
|
-
default:
|
|
1420
|
-
return "GMT" + de(r, ":");
|
|
1421
|
-
}
|
|
1422
|
-
},
|
|
1423
|
-
// Timezone (specific non-location)
|
|
1424
|
-
z: function(e, t, n) {
|
|
1425
|
-
const r = e.getTimezoneOffset();
|
|
1426
|
-
switch (t) {
|
|
1427
|
-
// Short
|
|
1428
|
-
case "z":
|
|
1429
|
-
case "zz":
|
|
1430
|
-
case "zzz":
|
|
1431
|
-
return "GMT" + Dt(r, ":");
|
|
1432
|
-
default:
|
|
1433
|
-
return "GMT" + de(r, ":");
|
|
1434
|
-
}
|
|
1435
|
-
},
|
|
1436
|
-
// Seconds timestamp
|
|
1437
|
-
t: function(e, t, n) {
|
|
1438
|
-
const r = Math.trunc(+e / 1e3);
|
|
1439
|
-
return _(r, t.length);
|
|
1440
|
-
},
|
|
1441
|
-
// Milliseconds timestamp
|
|
1442
|
-
T: function(e, t, n) {
|
|
1443
|
-
return _(+e, t.length);
|
|
1444
|
-
}
|
|
1445
|
-
};
|
|
1446
|
-
function Dt(e, t = "") {
|
|
1447
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), a = r % 60;
|
|
1448
|
-
return a === 0 ? n + String(o) : n + String(o) + t + _(a, 2);
|
|
1449
|
-
}
|
|
1450
|
-
function Ot(e, t) {
|
|
1451
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + _(Math.abs(e) / 60, 2) : de(e, t);
|
|
1452
|
-
}
|
|
1453
|
-
function de(e, t = "") {
|
|
1454
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = _(Math.trunc(r / 60), 2), a = _(r % 60, 2);
|
|
1455
|
-
return n + o + t + a;
|
|
1456
|
-
}
|
|
1457
|
-
const Wt = (e, t) => {
|
|
1458
|
-
switch (e) {
|
|
1459
|
-
case "P":
|
|
1460
|
-
return t.date({ width: "short" });
|
|
1461
|
-
case "PP":
|
|
1462
|
-
return t.date({ width: "medium" });
|
|
1463
|
-
case "PPP":
|
|
1464
|
-
return t.date({ width: "long" });
|
|
1465
|
-
default:
|
|
1466
|
-
return t.date({ width: "full" });
|
|
1467
|
-
}
|
|
1468
|
-
}, Xt = (e, t) => {
|
|
1469
|
-
switch (e) {
|
|
1470
|
-
case "p":
|
|
1471
|
-
return t.time({ width: "short" });
|
|
1472
|
-
case "pp":
|
|
1473
|
-
return t.time({ width: "medium" });
|
|
1474
|
-
case "ppp":
|
|
1475
|
-
return t.time({ width: "long" });
|
|
1476
|
-
default:
|
|
1477
|
-
return t.time({ width: "full" });
|
|
1478
|
-
}
|
|
1479
|
-
}, oo = (e, t) => {
|
|
1480
|
-
const n = e.match(/(P+)(p+)?/) || [], r = n[1], o = n[2];
|
|
1481
|
-
if (!o)
|
|
1482
|
-
return Wt(e, t);
|
|
1483
|
-
let a;
|
|
1484
|
-
switch (r) {
|
|
1485
|
-
case "P":
|
|
1486
|
-
a = t.dateTime({ width: "short" });
|
|
1487
|
-
break;
|
|
1488
|
-
case "PP":
|
|
1489
|
-
a = t.dateTime({ width: "medium" });
|
|
1490
|
-
break;
|
|
1491
|
-
case "PPP":
|
|
1492
|
-
a = t.dateTime({ width: "long" });
|
|
1493
|
-
break;
|
|
1494
|
-
default:
|
|
1495
|
-
a = t.dateTime({ width: "full" });
|
|
1496
|
-
break;
|
|
1497
|
-
}
|
|
1498
|
-
return a.replace("{{date}}", Wt(r, t)).replace("{{time}}", Xt(o, t));
|
|
1499
|
-
}, ao = {
|
|
1500
|
-
p: Xt,
|
|
1501
|
-
P: oo
|
|
1502
|
-
}, so = /^D+$/, io = /^Y+$/, uo = ["D", "DD", "YY", "YYYY"];
|
|
1503
|
-
function co(e) {
|
|
1504
|
-
return so.test(e);
|
|
1505
|
-
}
|
|
1506
|
-
function lo(e) {
|
|
1507
|
-
return io.test(e);
|
|
1508
|
-
}
|
|
1509
|
-
function fo(e, t, n) {
|
|
1510
|
-
const r = ho(e, t, n);
|
|
1511
|
-
if (console.warn(r), uo.includes(e)) throw new RangeError(r);
|
|
1512
|
-
}
|
|
1513
|
-
function ho(e, t, n) {
|
|
1514
|
-
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1515
|
-
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1516
|
-
}
|
|
1517
|
-
const mo = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, yo = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, go = /^'([^]*?)'?$/, bo = /''/g, po = /[a-zA-Z]/;
|
|
1518
|
-
function Me(e, t, n) {
|
|
1519
|
-
const r = Oe(), o = n?.locale ?? r.locale ?? be, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = T(e, n?.in);
|
|
1520
|
-
if (!pr(s))
|
|
1521
|
-
throw new RangeError("Invalid time value");
|
|
1522
|
-
let u = t.match(yo).map((d) => {
|
|
1523
|
-
const l = d[0];
|
|
1524
|
-
if (l === "p" || l === "P") {
|
|
1525
|
-
const f = ao[l];
|
|
1526
|
-
return f(d, o.formatLong);
|
|
1527
|
-
}
|
|
1528
|
-
return d;
|
|
1529
|
-
}).join("").match(mo).map((d) => {
|
|
1530
|
-
if (d === "''")
|
|
1531
|
-
return { isToken: !1, value: "'" };
|
|
1532
|
-
const l = d[0];
|
|
1533
|
-
if (l === "'")
|
|
1534
|
-
return { isToken: !1, value: wo(d) };
|
|
1535
|
-
if (kt[l])
|
|
1536
|
-
return { isToken: !0, value: d };
|
|
1537
|
-
if (l.match(po))
|
|
1538
|
-
throw new RangeError(
|
|
1539
|
-
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1540
|
-
);
|
|
1541
|
-
return { isToken: !1, value: d };
|
|
1542
|
-
});
|
|
1543
|
-
o.localize.preprocessor && (u = o.localize.preprocessor(s, u));
|
|
1544
|
-
const c = {
|
|
1545
|
-
firstWeekContainsDate: a,
|
|
1546
|
-
weekStartsOn: i,
|
|
1547
|
-
locale: o
|
|
1548
|
-
};
|
|
1549
|
-
return u.map((d) => {
|
|
1550
|
-
if (!d.isToken) return d.value;
|
|
1551
|
-
const l = d.value;
|
|
1552
|
-
(!n?.useAdditionalWeekYearTokens && lo(l) || !n?.useAdditionalDayOfYearTokens && co(l)) && fo(l, t, String(e));
|
|
1553
|
-
const f = kt[l[0]];
|
|
1554
|
-
return f(s, l, o.localize, c);
|
|
1555
|
-
}).join("");
|
|
1556
|
-
}
|
|
1557
|
-
function wo(e) {
|
|
1558
|
-
const t = e.match(go);
|
|
1559
|
-
return t ? t[1].replace(bo, "'") : e;
|
|
1560
|
-
}
|
|
1561
|
-
function vo(e, t) {
|
|
1562
|
-
const n = T(e, t?.in), r = n.getFullYear(), o = n.getMonth(), a = G(n, 0);
|
|
1563
|
-
return a.setFullYear(r, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1564
|
-
}
|
|
1565
|
-
function Mo(e, t) {
|
|
1566
|
-
return T(e, t?.in).getMonth();
|
|
1567
|
-
}
|
|
1568
|
-
function ko(e, t) {
|
|
1569
|
-
return T(e, t?.in).getFullYear();
|
|
1570
|
-
}
|
|
1571
|
-
function Do(e, t) {
|
|
1572
|
-
return +T(e) > +T(t);
|
|
1573
|
-
}
|
|
1574
|
-
function Oo(e, t) {
|
|
1575
|
-
return +T(e) < +T(t);
|
|
1576
|
-
}
|
|
1577
|
-
function Nt(e, t, n) {
|
|
1578
|
-
const [r, o] = he(
|
|
1579
|
-
n?.in,
|
|
1580
|
-
e,
|
|
1581
|
-
t
|
|
1582
|
-
);
|
|
1583
|
-
return +le(r, n) == +le(o, n);
|
|
1584
|
-
}
|
|
1585
|
-
function Wo(e, t, n) {
|
|
1586
|
-
const [r, o] = he(
|
|
1587
|
-
n?.in,
|
|
1588
|
-
e,
|
|
1589
|
-
t
|
|
1590
|
-
);
|
|
1591
|
-
return r.getFullYear() === o.getFullYear() && r.getMonth() === o.getMonth();
|
|
1592
|
-
}
|
|
1593
|
-
function No(e, t, n) {
|
|
1594
|
-
const [r, o] = he(
|
|
1595
|
-
n?.in,
|
|
1596
|
-
e,
|
|
1597
|
-
t
|
|
1598
|
-
);
|
|
1599
|
-
return r.getFullYear() === o.getFullYear();
|
|
1600
|
-
}
|
|
1601
|
-
function So(e, t, n) {
|
|
1602
|
-
const r = T(e, n?.in), o = r.getFullYear(), a = r.getDate(), i = G(e, 0);
|
|
1603
|
-
i.setFullYear(o, t, 15), i.setHours(0, 0, 0, 0);
|
|
1604
|
-
const s = vo(i);
|
|
1605
|
-
return r.setMonth(t, Math.min(a, s)), r;
|
|
1606
|
-
}
|
|
1607
|
-
function Co(e, t, n) {
|
|
1608
|
-
const r = T(e, n?.in);
|
|
1609
|
-
return isNaN(+r) ? G(e, NaN) : (r.setFullYear(t), r);
|
|
1610
|
-
}
|
|
1611
|
-
const St = 5, xo = 4;
|
|
1612
|
-
function Po(e, t) {
|
|
1613
|
-
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), a = t.addDays(o, St * 7 - 1);
|
|
1614
|
-
return t.getMonth(e) === t.getMonth(a) ? St : xo;
|
|
1615
|
-
}
|
|
1616
|
-
function Qt(e, t) {
|
|
1617
|
-
const n = t.startOfMonth(e), r = n.getDay();
|
|
1618
|
-
return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1));
|
|
1619
|
-
}
|
|
1620
|
-
function Yo(e, t) {
|
|
1621
|
-
const n = Qt(e, t), r = Po(e, t);
|
|
1622
|
-
return t.addDays(n, r * 7 - 1);
|
|
1623
|
-
}
|
|
1624
|
-
function we(e, t) {
|
|
1625
|
-
if (e.one !== void 0 && t === 1)
|
|
1626
|
-
return e.one;
|
|
1627
|
-
const n = t % 10, r = t % 100;
|
|
1628
|
-
return n === 1 && r !== 11 ? e.singularNominative.replace("{{count}}", String(t)) : n >= 2 && n <= 4 && (r < 10 || r > 20) ? e.singularGenitive.replace("{{count}}", String(t)) : e.pluralGenitive.replace("{{count}}", String(t));
|
|
1629
|
-
}
|
|
1630
|
-
function A(e) {
|
|
1631
|
-
return (t, n) => n?.addSuffix ? n.comparison && n.comparison > 0 ? e.future ? we(e.future, t) : "через " + we(e.regular, t) : e.past ? we(e.past, t) : we(e.regular, t) + " назад" : we(e.regular, t);
|
|
1632
|
-
}
|
|
1633
|
-
const _o = {
|
|
1634
|
-
lessThanXSeconds: A({
|
|
1635
|
-
regular: {
|
|
1636
|
-
one: "меньше секунды",
|
|
1637
|
-
singularNominative: "меньше {{count}} секунды",
|
|
1638
|
-
singularGenitive: "меньше {{count}} секунд",
|
|
1639
|
-
pluralGenitive: "меньше {{count}} секунд"
|
|
1640
|
-
},
|
|
1641
|
-
future: {
|
|
1642
|
-
one: "меньше, чем через секунду",
|
|
1643
|
-
singularNominative: "меньше, чем через {{count}} секунду",
|
|
1644
|
-
singularGenitive: "меньше, чем через {{count}} секунды",
|
|
1645
|
-
pluralGenitive: "меньше, чем через {{count}} секунд"
|
|
1646
|
-
}
|
|
1647
|
-
}),
|
|
1648
|
-
xSeconds: A({
|
|
1649
|
-
regular: {
|
|
1650
|
-
singularNominative: "{{count}} секунда",
|
|
1651
|
-
singularGenitive: "{{count}} секунды",
|
|
1652
|
-
pluralGenitive: "{{count}} секунд"
|
|
1653
|
-
},
|
|
1654
|
-
past: {
|
|
1655
|
-
singularNominative: "{{count}} секунду назад",
|
|
1656
|
-
singularGenitive: "{{count}} секунды назад",
|
|
1657
|
-
pluralGenitive: "{{count}} секунд назад"
|
|
1658
|
-
},
|
|
1659
|
-
future: {
|
|
1660
|
-
singularNominative: "через {{count}} секунду",
|
|
1661
|
-
singularGenitive: "через {{count}} секунды",
|
|
1662
|
-
pluralGenitive: "через {{count}} секунд"
|
|
1663
|
-
}
|
|
1664
|
-
}),
|
|
1665
|
-
halfAMinute: (e, t) => t?.addSuffix ? t.comparison && t.comparison > 0 ? "через полминуты" : "полминуты назад" : "полминуты",
|
|
1666
|
-
lessThanXMinutes: A({
|
|
1667
|
-
regular: {
|
|
1668
|
-
one: "меньше минуты",
|
|
1669
|
-
singularNominative: "меньше {{count}} минуты",
|
|
1670
|
-
singularGenitive: "меньше {{count}} минут",
|
|
1671
|
-
pluralGenitive: "меньше {{count}} минут"
|
|
1672
|
-
},
|
|
1673
|
-
future: {
|
|
1674
|
-
one: "меньше, чем через минуту",
|
|
1675
|
-
singularNominative: "меньше, чем через {{count}} минуту",
|
|
1676
|
-
singularGenitive: "меньше, чем через {{count}} минуты",
|
|
1677
|
-
pluralGenitive: "меньше, чем через {{count}} минут"
|
|
1678
|
-
}
|
|
1679
|
-
}),
|
|
1680
|
-
xMinutes: A({
|
|
1681
|
-
regular: {
|
|
1682
|
-
singularNominative: "{{count}} минута",
|
|
1683
|
-
singularGenitive: "{{count}} минуты",
|
|
1684
|
-
pluralGenitive: "{{count}} минут"
|
|
1685
|
-
},
|
|
1686
|
-
past: {
|
|
1687
|
-
singularNominative: "{{count}} минуту назад",
|
|
1688
|
-
singularGenitive: "{{count}} минуты назад",
|
|
1689
|
-
pluralGenitive: "{{count}} минут назад"
|
|
1690
|
-
},
|
|
1691
|
-
future: {
|
|
1692
|
-
singularNominative: "через {{count}} минуту",
|
|
1693
|
-
singularGenitive: "через {{count}} минуты",
|
|
1694
|
-
pluralGenitive: "через {{count}} минут"
|
|
1695
|
-
}
|
|
1696
|
-
}),
|
|
1697
|
-
aboutXHours: A({
|
|
1698
|
-
regular: {
|
|
1699
|
-
singularNominative: "около {{count}} часа",
|
|
1700
|
-
singularGenitive: "около {{count}} часов",
|
|
1701
|
-
pluralGenitive: "около {{count}} часов"
|
|
1702
|
-
},
|
|
1703
|
-
future: {
|
|
1704
|
-
singularNominative: "приблизительно через {{count}} час",
|
|
1705
|
-
singularGenitive: "приблизительно через {{count}} часа",
|
|
1706
|
-
pluralGenitive: "приблизительно через {{count}} часов"
|
|
1707
|
-
}
|
|
1708
|
-
}),
|
|
1709
|
-
xHours: A({
|
|
1710
|
-
regular: {
|
|
1711
|
-
singularNominative: "{{count}} час",
|
|
1712
|
-
singularGenitive: "{{count}} часа",
|
|
1713
|
-
pluralGenitive: "{{count}} часов"
|
|
1714
|
-
}
|
|
1715
|
-
}),
|
|
1716
|
-
xDays: A({
|
|
1717
|
-
regular: {
|
|
1718
|
-
singularNominative: "{{count}} день",
|
|
1719
|
-
singularGenitive: "{{count}} дня",
|
|
1720
|
-
pluralGenitive: "{{count}} дней"
|
|
1721
|
-
}
|
|
1722
|
-
}),
|
|
1723
|
-
aboutXWeeks: A({
|
|
1724
|
-
regular: {
|
|
1725
|
-
singularNominative: "около {{count}} недели",
|
|
1726
|
-
singularGenitive: "около {{count}} недель",
|
|
1727
|
-
pluralGenitive: "около {{count}} недель"
|
|
1728
|
-
},
|
|
1729
|
-
future: {
|
|
1730
|
-
singularNominative: "приблизительно через {{count}} неделю",
|
|
1731
|
-
singularGenitive: "приблизительно через {{count}} недели",
|
|
1732
|
-
pluralGenitive: "приблизительно через {{count}} недель"
|
|
1733
|
-
}
|
|
1734
|
-
}),
|
|
1735
|
-
xWeeks: A({
|
|
1736
|
-
regular: {
|
|
1737
|
-
singularNominative: "{{count}} неделя",
|
|
1738
|
-
singularGenitive: "{{count}} недели",
|
|
1739
|
-
pluralGenitive: "{{count}} недель"
|
|
1740
|
-
}
|
|
1741
|
-
}),
|
|
1742
|
-
aboutXMonths: A({
|
|
1743
|
-
regular: {
|
|
1744
|
-
singularNominative: "около {{count}} месяца",
|
|
1745
|
-
singularGenitive: "около {{count}} месяцев",
|
|
1746
|
-
pluralGenitive: "около {{count}} месяцев"
|
|
1747
|
-
},
|
|
1748
|
-
future: {
|
|
1749
|
-
singularNominative: "приблизительно через {{count}} месяц",
|
|
1750
|
-
singularGenitive: "приблизительно через {{count}} месяца",
|
|
1751
|
-
pluralGenitive: "приблизительно через {{count}} месяцев"
|
|
1752
|
-
}
|
|
1753
|
-
}),
|
|
1754
|
-
xMonths: A({
|
|
1755
|
-
regular: {
|
|
1756
|
-
singularNominative: "{{count}} месяц",
|
|
1757
|
-
singularGenitive: "{{count}} месяца",
|
|
1758
|
-
pluralGenitive: "{{count}} месяцев"
|
|
1759
|
-
}
|
|
1760
|
-
}),
|
|
1761
|
-
aboutXYears: A({
|
|
1762
|
-
regular: {
|
|
1763
|
-
singularNominative: "около {{count}} года",
|
|
1764
|
-
singularGenitive: "около {{count}} лет",
|
|
1765
|
-
pluralGenitive: "около {{count}} лет"
|
|
1766
|
-
},
|
|
1767
|
-
future: {
|
|
1768
|
-
singularNominative: "приблизительно через {{count}} год",
|
|
1769
|
-
singularGenitive: "приблизительно через {{count}} года",
|
|
1770
|
-
pluralGenitive: "приблизительно через {{count}} лет"
|
|
1771
|
-
}
|
|
1772
|
-
}),
|
|
1773
|
-
xYears: A({
|
|
1774
|
-
regular: {
|
|
1775
|
-
singularNominative: "{{count}} год",
|
|
1776
|
-
singularGenitive: "{{count}} года",
|
|
1777
|
-
pluralGenitive: "{{count}} лет"
|
|
1778
|
-
}
|
|
1779
|
-
}),
|
|
1780
|
-
overXYears: A({
|
|
1781
|
-
regular: {
|
|
1782
|
-
singularNominative: "больше {{count}} года",
|
|
1783
|
-
singularGenitive: "больше {{count}} лет",
|
|
1784
|
-
pluralGenitive: "больше {{count}} лет"
|
|
1785
|
-
},
|
|
1786
|
-
future: {
|
|
1787
|
-
singularNominative: "больше, чем через {{count}} год",
|
|
1788
|
-
singularGenitive: "больше, чем через {{count}} года",
|
|
1789
|
-
pluralGenitive: "больше, чем через {{count}} лет"
|
|
1790
|
-
}
|
|
1791
|
-
}),
|
|
1792
|
-
almostXYears: A({
|
|
1793
|
-
regular: {
|
|
1794
|
-
singularNominative: "почти {{count}} год",
|
|
1795
|
-
singularGenitive: "почти {{count}} года",
|
|
1796
|
-
pluralGenitive: "почти {{count}} лет"
|
|
1797
|
-
},
|
|
1798
|
-
future: {
|
|
1799
|
-
singularNominative: "почти через {{count}} год",
|
|
1800
|
-
singularGenitive: "почти через {{count}} года",
|
|
1801
|
-
pluralGenitive: "почти через {{count}} лет"
|
|
1802
|
-
}
|
|
1803
|
-
})
|
|
1804
|
-
}, To = (e, t, n) => _o[e](t, n), Eo = {
|
|
1805
|
-
full: "EEEE, d MMMM y 'г.'",
|
|
1806
|
-
long: "d MMMM y 'г.'",
|
|
1807
|
-
medium: "d MMM y 'г.'",
|
|
1808
|
-
short: "dd.MM.y"
|
|
1809
|
-
}, Fo = {
|
|
1810
|
-
full: "H:mm:ss zzzz",
|
|
1811
|
-
long: "H:mm:ss z",
|
|
1812
|
-
medium: "H:mm:ss",
|
|
1813
|
-
short: "H:mm"
|
|
1814
|
-
}, Bo = {
|
|
1815
|
-
any: "{{date}}, {{time}}"
|
|
1816
|
-
}, Go = {
|
|
1817
|
-
date: pe({
|
|
1818
|
-
formats: Eo,
|
|
1819
|
-
defaultWidth: "full"
|
|
1820
|
-
}),
|
|
1821
|
-
time: pe({
|
|
1822
|
-
formats: Fo,
|
|
1823
|
-
defaultWidth: "full"
|
|
1824
|
-
}),
|
|
1825
|
-
dateTime: pe({
|
|
1826
|
-
formats: Bo,
|
|
1827
|
-
defaultWidth: "any"
|
|
1828
|
-
})
|
|
1829
|
-
}, tt = [
|
|
1830
|
-
"воскресенье",
|
|
1831
|
-
"понедельник",
|
|
1832
|
-
"вторник",
|
|
1833
|
-
"среду",
|
|
1834
|
-
"четверг",
|
|
1835
|
-
"пятницу",
|
|
1836
|
-
"субботу"
|
|
1837
|
-
];
|
|
1838
|
-
function Io(e) {
|
|
1839
|
-
const t = tt[e];
|
|
1840
|
-
switch (e) {
|
|
1841
|
-
case 0:
|
|
1842
|
-
return "'в прошлое " + t + " в' p";
|
|
1843
|
-
case 1:
|
|
1844
|
-
case 2:
|
|
1845
|
-
case 4:
|
|
1846
|
-
return "'в прошлый " + t + " в' p";
|
|
1847
|
-
case 3:
|
|
1848
|
-
case 5:
|
|
1849
|
-
case 6:
|
|
1850
|
-
return "'в прошлую " + t + " в' p";
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
function Ct(e) {
|
|
1854
|
-
const t = tt[e];
|
|
1855
|
-
return e === 2 ? "'во " + t + " в' p" : "'в " + t + " в' p";
|
|
1856
|
-
}
|
|
1857
|
-
function $o(e) {
|
|
1858
|
-
const t = tt[e];
|
|
1859
|
-
switch (e) {
|
|
1860
|
-
case 0:
|
|
1861
|
-
return "'в следующее " + t + " в' p";
|
|
1862
|
-
case 1:
|
|
1863
|
-
case 2:
|
|
1864
|
-
case 4:
|
|
1865
|
-
return "'в следующий " + t + " в' p";
|
|
1866
|
-
case 3:
|
|
1867
|
-
case 5:
|
|
1868
|
-
case 6:
|
|
1869
|
-
return "'в следующую " + t + " в' p";
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
const Ho = {
|
|
1873
|
-
lastWeek: (e, t, n) => {
|
|
1874
|
-
const r = e.getDay();
|
|
1875
|
-
return Nt(e, t, n) ? Ct(r) : Io(r);
|
|
1876
|
-
},
|
|
1877
|
-
yesterday: "'вчера в' p",
|
|
1878
|
-
today: "'сегодня в' p",
|
|
1879
|
-
tomorrow: "'завтра в' p",
|
|
1880
|
-
nextWeek: (e, t, n) => {
|
|
1881
|
-
const r = e.getDay();
|
|
1882
|
-
return Nt(e, t, n) ? Ct(r) : $o(r);
|
|
1883
|
-
},
|
|
1884
|
-
other: "P"
|
|
1885
|
-
}, Ao = (e, t, n, r) => {
|
|
1886
|
-
const o = Ho[e];
|
|
1887
|
-
return typeof o == "function" ? o(t, n, r) : o;
|
|
1888
|
-
}, qo = {
|
|
1889
|
-
narrow: ["до н.э.", "н.э."],
|
|
1890
|
-
abbreviated: ["до н. э.", "н. э."],
|
|
1891
|
-
wide: ["до нашей эры", "нашей эры"]
|
|
1892
|
-
}, zo = {
|
|
1893
|
-
narrow: ["1", "2", "3", "4"],
|
|
1894
|
-
abbreviated: ["1-й кв.", "2-й кв.", "3-й кв.", "4-й кв."],
|
|
1895
|
-
wide: ["1-й квартал", "2-й квартал", "3-й квартал", "4-й квартал"]
|
|
1896
|
-
}, jo = {
|
|
1897
|
-
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
|
|
1898
|
-
abbreviated: [
|
|
1899
|
-
"янв.",
|
|
1900
|
-
"фев.",
|
|
1901
|
-
"март",
|
|
1902
|
-
"апр.",
|
|
1903
|
-
"май",
|
|
1904
|
-
"июнь",
|
|
1905
|
-
"июль",
|
|
1906
|
-
"авг.",
|
|
1907
|
-
"сент.",
|
|
1908
|
-
"окт.",
|
|
1909
|
-
"нояб.",
|
|
1910
|
-
"дек."
|
|
1911
|
-
],
|
|
1912
|
-
wide: [
|
|
1913
|
-
"январь",
|
|
1914
|
-
"февраль",
|
|
1915
|
-
"март",
|
|
1916
|
-
"апрель",
|
|
1917
|
-
"май",
|
|
1918
|
-
"июнь",
|
|
1919
|
-
"июль",
|
|
1920
|
-
"август",
|
|
1921
|
-
"сентябрь",
|
|
1922
|
-
"октябрь",
|
|
1923
|
-
"ноябрь",
|
|
1924
|
-
"декабрь"
|
|
1925
|
-
]
|
|
1926
|
-
}, Ro = {
|
|
1927
|
-
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
|
|
1928
|
-
abbreviated: [
|
|
1929
|
-
"янв.",
|
|
1930
|
-
"фев.",
|
|
1931
|
-
"мар.",
|
|
1932
|
-
"апр.",
|
|
1933
|
-
"мая",
|
|
1934
|
-
"июн.",
|
|
1935
|
-
"июл.",
|
|
1936
|
-
"авг.",
|
|
1937
|
-
"сент.",
|
|
1938
|
-
"окт.",
|
|
1939
|
-
"нояб.",
|
|
1940
|
-
"дек."
|
|
1941
|
-
],
|
|
1942
|
-
wide: [
|
|
1943
|
-
"января",
|
|
1944
|
-
"февраля",
|
|
1945
|
-
"марта",
|
|
1946
|
-
"апреля",
|
|
1947
|
-
"мая",
|
|
1948
|
-
"июня",
|
|
1949
|
-
"июля",
|
|
1950
|
-
"августа",
|
|
1951
|
-
"сентября",
|
|
1952
|
-
"октября",
|
|
1953
|
-
"ноября",
|
|
1954
|
-
"декабря"
|
|
1955
|
-
]
|
|
1956
|
-
}, Vo = {
|
|
1957
|
-
narrow: ["В", "П", "В", "С", "Ч", "П", "С"],
|
|
1958
|
-
short: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"],
|
|
1959
|
-
abbreviated: ["вск", "пнд", "втр", "срд", "чтв", "птн", "суб"],
|
|
1960
|
-
wide: [
|
|
1961
|
-
"воскресенье",
|
|
1962
|
-
"понедельник",
|
|
1963
|
-
"вторник",
|
|
1964
|
-
"среда",
|
|
1965
|
-
"четверг",
|
|
1966
|
-
"пятница",
|
|
1967
|
-
"суббота"
|
|
1968
|
-
]
|
|
1969
|
-
}, Xo = {
|
|
1970
|
-
narrow: {
|
|
1971
|
-
am: "ДП",
|
|
1972
|
-
pm: "ПП",
|
|
1973
|
-
midnight: "полн.",
|
|
1974
|
-
noon: "полд.",
|
|
1975
|
-
morning: "утро",
|
|
1976
|
-
afternoon: "день",
|
|
1977
|
-
evening: "веч.",
|
|
1978
|
-
night: "ночь"
|
|
1979
|
-
},
|
|
1980
|
-
abbreviated: {
|
|
1981
|
-
am: "ДП",
|
|
1982
|
-
pm: "ПП",
|
|
1983
|
-
midnight: "полн.",
|
|
1984
|
-
noon: "полд.",
|
|
1985
|
-
morning: "утро",
|
|
1986
|
-
afternoon: "день",
|
|
1987
|
-
evening: "веч.",
|
|
1988
|
-
night: "ночь"
|
|
1989
|
-
},
|
|
1990
|
-
wide: {
|
|
1991
|
-
am: "ДП",
|
|
1992
|
-
pm: "ПП",
|
|
1993
|
-
midnight: "полночь",
|
|
1994
|
-
noon: "полдень",
|
|
1995
|
-
morning: "утро",
|
|
1996
|
-
afternoon: "день",
|
|
1997
|
-
evening: "вечер",
|
|
1998
|
-
night: "ночь"
|
|
1999
|
-
}
|
|
2000
|
-
}, Qo = {
|
|
2001
|
-
narrow: {
|
|
2002
|
-
am: "ДП",
|
|
2003
|
-
pm: "ПП",
|
|
2004
|
-
midnight: "полн.",
|
|
2005
|
-
noon: "полд.",
|
|
2006
|
-
morning: "утра",
|
|
2007
|
-
afternoon: "дня",
|
|
2008
|
-
evening: "веч.",
|
|
2009
|
-
night: "ночи"
|
|
2010
|
-
},
|
|
2011
|
-
abbreviated: {
|
|
2012
|
-
am: "ДП",
|
|
2013
|
-
pm: "ПП",
|
|
2014
|
-
midnight: "полн.",
|
|
2015
|
-
noon: "полд.",
|
|
2016
|
-
morning: "утра",
|
|
2017
|
-
afternoon: "дня",
|
|
2018
|
-
evening: "веч.",
|
|
2019
|
-
night: "ночи"
|
|
2020
|
-
},
|
|
2021
|
-
wide: {
|
|
2022
|
-
am: "ДП",
|
|
2023
|
-
pm: "ПП",
|
|
2024
|
-
midnight: "полночь",
|
|
2025
|
-
noon: "полдень",
|
|
2026
|
-
morning: "утра",
|
|
2027
|
-
afternoon: "дня",
|
|
2028
|
-
evening: "вечера",
|
|
2029
|
-
night: "ночи"
|
|
2030
|
-
}
|
|
2031
|
-
}, Uo = (e, t) => {
|
|
2032
|
-
const n = Number(e), r = t?.unit;
|
|
2033
|
-
let o;
|
|
2034
|
-
return r === "date" ? o = "-е" : r === "week" || r === "minute" || r === "second" ? o = "-я" : o = "-й", n + o;
|
|
2035
|
-
}, Ko = {
|
|
2036
|
-
ordinalNumber: Uo,
|
|
2037
|
-
era: ee({
|
|
2038
|
-
values: qo,
|
|
2039
|
-
defaultWidth: "wide"
|
|
2040
|
-
}),
|
|
2041
|
-
quarter: ee({
|
|
2042
|
-
values: zo,
|
|
2043
|
-
defaultWidth: "wide",
|
|
2044
|
-
argumentCallback: (e) => e - 1
|
|
2045
|
-
}),
|
|
2046
|
-
month: ee({
|
|
2047
|
-
values: jo,
|
|
2048
|
-
defaultWidth: "wide",
|
|
2049
|
-
formattingValues: Ro,
|
|
2050
|
-
defaultFormattingWidth: "wide"
|
|
2051
|
-
}),
|
|
2052
|
-
day: ee({
|
|
2053
|
-
values: Vo,
|
|
2054
|
-
defaultWidth: "wide"
|
|
2055
|
-
}),
|
|
2056
|
-
dayPeriod: ee({
|
|
2057
|
-
values: Xo,
|
|
2058
|
-
defaultWidth: "any",
|
|
2059
|
-
formattingValues: Qo,
|
|
2060
|
-
defaultFormattingWidth: "wide"
|
|
2061
|
-
})
|
|
2062
|
-
}, Zo = /^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i, Jo = /\d+/i, Lo = {
|
|
2063
|
-
narrow: /^((до )?н\.?\s?э\.?)/i,
|
|
2064
|
-
abbreviated: /^((до )?н\.?\s?э\.?)/i,
|
|
2065
|
-
wide: /^(до нашей эры|нашей эры|наша эра)/i
|
|
2066
|
-
}, ea = {
|
|
2067
|
-
any: [/^д/i, /^н/i]
|
|
2068
|
-
}, ta = {
|
|
2069
|
-
narrow: /^[1234]/i,
|
|
2070
|
-
abbreviated: /^[1234](-?[ыои]?й?)? кв.?/i,
|
|
2071
|
-
wide: /^[1234](-?[ыои]?й?)? квартал/i
|
|
2072
|
-
}, na = {
|
|
2073
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
2074
|
-
}, ra = {
|
|
2075
|
-
narrow: /^[яфмаисонд]/i,
|
|
2076
|
-
abbreviated: /^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,
|
|
2077
|
-
wide: /^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i
|
|
2078
|
-
}, oa = {
|
|
2079
|
-
narrow: [
|
|
2080
|
-
/^я/i,
|
|
2081
|
-
/^ф/i,
|
|
2082
|
-
/^м/i,
|
|
2083
|
-
/^а/i,
|
|
2084
|
-
/^м/i,
|
|
2085
|
-
/^и/i,
|
|
2086
|
-
/^и/i,
|
|
2087
|
-
/^а/i,
|
|
2088
|
-
/^с/i,
|
|
2089
|
-
/^о/i,
|
|
2090
|
-
/^н/i,
|
|
2091
|
-
/^я/i
|
|
2092
|
-
],
|
|
2093
|
-
any: [
|
|
2094
|
-
/^я/i,
|
|
2095
|
-
/^ф/i,
|
|
2096
|
-
/^мар/i,
|
|
2097
|
-
/^ап/i,
|
|
2098
|
-
/^ма[йя]/i,
|
|
2099
|
-
/^июн/i,
|
|
2100
|
-
/^июл/i,
|
|
2101
|
-
/^ав/i,
|
|
2102
|
-
/^с/i,
|
|
2103
|
-
/^о/i,
|
|
2104
|
-
/^н/i,
|
|
2105
|
-
/^д/i
|
|
2106
|
-
]
|
|
2107
|
-
}, aa = {
|
|
2108
|
-
narrow: /^[впсч]/i,
|
|
2109
|
-
short: /^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,
|
|
2110
|
-
abbreviated: /^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,
|
|
2111
|
-
wide: /^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i
|
|
2112
|
-
}, sa = {
|
|
2113
|
-
narrow: [/^в/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
|
|
2114
|
-
any: [/^в[ос]/i, /^п[он]/i, /^в/i, /^ср/i, /^ч/i, /^п[ят]/i, /^с[уб]/i]
|
|
2115
|
-
}, ia = {
|
|
2116
|
-
narrow: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
|
|
2117
|
-
abbreviated: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
|
|
2118
|
-
wide: /^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i
|
|
2119
|
-
}, ua = {
|
|
2120
|
-
any: {
|
|
2121
|
-
am: /^дп/i,
|
|
2122
|
-
pm: /^пп/i,
|
|
2123
|
-
midnight: /^полн/i,
|
|
2124
|
-
noon: /^полд/i,
|
|
2125
|
-
morning: /^у/i,
|
|
2126
|
-
afternoon: /^д[ен]/i,
|
|
2127
|
-
evening: /^в/i,
|
|
2128
|
-
night: /^н/i
|
|
2129
|
-
}
|
|
2130
|
-
}, ca = {
|
|
2131
|
-
ordinalNumber: Rt({
|
|
2132
|
-
matchPattern: Zo,
|
|
2133
|
-
parsePattern: Jo,
|
|
2134
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
2135
|
-
}),
|
|
2136
|
-
era: te({
|
|
2137
|
-
matchPatterns: Lo,
|
|
2138
|
-
defaultMatchWidth: "wide",
|
|
2139
|
-
parsePatterns: ea,
|
|
2140
|
-
defaultParseWidth: "any"
|
|
2141
|
-
}),
|
|
2142
|
-
quarter: te({
|
|
2143
|
-
matchPatterns: ta,
|
|
2144
|
-
defaultMatchWidth: "wide",
|
|
2145
|
-
parsePatterns: na,
|
|
2146
|
-
defaultParseWidth: "any",
|
|
2147
|
-
valueCallback: (e) => e + 1
|
|
2148
|
-
}),
|
|
2149
|
-
month: te({
|
|
2150
|
-
matchPatterns: ra,
|
|
2151
|
-
defaultMatchWidth: "wide",
|
|
2152
|
-
parsePatterns: oa,
|
|
2153
|
-
defaultParseWidth: "any"
|
|
2154
|
-
}),
|
|
2155
|
-
day: te({
|
|
2156
|
-
matchPatterns: aa,
|
|
2157
|
-
defaultMatchWidth: "wide",
|
|
2158
|
-
parsePatterns: sa,
|
|
2159
|
-
defaultParseWidth: "any"
|
|
2160
|
-
}),
|
|
2161
|
-
dayPeriod: te({
|
|
2162
|
-
matchPatterns: ia,
|
|
2163
|
-
defaultMatchWidth: "wide",
|
|
2164
|
-
parsePatterns: ua,
|
|
2165
|
-
defaultParseWidth: "any"
|
|
2166
|
-
})
|
|
2167
|
-
}, la = {
|
|
2168
|
-
code: "ru",
|
|
2169
|
-
formatDistance: To,
|
|
2170
|
-
formatLong: Go,
|
|
2171
|
-
formatRelative: Ao,
|
|
2172
|
-
localize: Ko,
|
|
2173
|
-
match: ca,
|
|
2174
|
-
options: {
|
|
2175
|
-
weekStartsOn: 1,
|
|
2176
|
-
firstWeekContainsDate: 1
|
|
2177
|
-
}
|
|
2178
|
-
}, nt = {
|
|
2179
|
-
...be,
|
|
2180
|
-
labels: {
|
|
2181
|
-
labelDayButton: (e, t, n, r) => {
|
|
2182
|
-
let o;
|
|
2183
|
-
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (i, s) => Me(i, s, { locale: be, ...n });
|
|
2184
|
-
let a = o(e, "PPPP");
|
|
2185
|
-
return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
|
|
2186
|
-
},
|
|
2187
|
-
labelMonthDropdown: "Choose the Month",
|
|
2188
|
-
labelNext: "Go to the Next Month",
|
|
2189
|
-
labelPrevious: "Go to the Previous Month",
|
|
2190
|
-
labelWeekNumber: (e) => `Week ${e}`,
|
|
2191
|
-
labelYearDropdown: "Choose the Year",
|
|
2192
|
-
labelGrid: (e, t, n) => {
|
|
2193
|
-
let r;
|
|
2194
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => Me(o, a, { locale: be, ...t }), r(e, "LLLL yyyy");
|
|
2195
|
-
},
|
|
2196
|
-
labelGridcell: (e, t, n, r) => {
|
|
2197
|
-
let o;
|
|
2198
|
-
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (i, s) => Me(i, s, { locale: be, ...n });
|
|
2199
|
-
let a = o(e, "PPPP");
|
|
2200
|
-
return t?.today && (a = `Today, ${a}`), a;
|
|
2201
|
-
},
|
|
2202
|
-
labelNav: "Navigation bar",
|
|
2203
|
-
labelWeekNumberHeader: "Week Number",
|
|
2204
|
-
labelWeekday: (e, t, n) => {
|
|
2205
|
-
let r;
|
|
2206
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => Me(o, a, { locale: be, ...t }), r(e, "cccc");
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
};
|
|
2210
|
-
class $ {
|
|
2211
|
-
/**
|
|
2212
|
-
* Creates an instance of `DateLib`.
|
|
2213
|
-
*
|
|
2214
|
-
* @param options Configuration options for the date library.
|
|
2215
|
-
* @param overrides Custom overrides for the date library functions.
|
|
2216
|
-
*/
|
|
2217
|
-
constructor(t, n) {
|
|
2218
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? H.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, o, a) => this.overrides?.newDate ? this.overrides.newDate(r, o, a) : this.options.timeZone ? new H(r, o, a, this.options.timeZone) : new Date(r, o, a), this.addDays = (r, o) => this.overrides?.addDays ? this.overrides.addDays(r, o) : Gt(r, o), this.addMonths = (r, o) => this.overrides?.addMonths ? this.overrides.addMonths(r, o) : It(r, o), this.addWeeks = (r, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, o) : hr(r, o), this.addYears = (r, o) => this.overrides?.addYears ? this.overrides.addYears(r, o) : mr(r, o), this.differenceInCalendarDays = (r, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : Je(r, o), this.differenceInCalendarMonths = (r, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : At(r, o), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : vr(r), this.eachYearOfInterval = (r) => {
|
|
2219
|
-
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : Dr(r), a = new Set(o.map((s) => this.getYear(s)));
|
|
2220
|
-
if (a.size === o.length)
|
|
2221
|
-
return o;
|
|
2222
|
-
const i = [];
|
|
2223
|
-
return a.forEach((s) => {
|
|
2224
|
-
i.push(new Date(s, 0, 1));
|
|
2225
|
-
}), i;
|
|
2226
|
-
}, this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : Yo(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : Or(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : wr(r), this.endOfWeek = (r, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, o) : jt(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : kr(r), this.format = (r, o, a) => {
|
|
2227
|
-
const i = this.overrides?.format ? this.overrides.format(r, o, this.options) : Me(r, o, this.options);
|
|
2228
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
2229
|
-
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : Le(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : Mo(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : ko(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : et(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : Do(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : Oo(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : Ht(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : br(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : Wo(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : No(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : yr(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : gr(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : So(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : Co(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : Qt(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : De(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : ke(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : Mr(r), this.startOfWeek = (r, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : le(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : zt(r), this.options = { locale: nt, ...t }, this.overrides = n;
|
|
2230
|
-
}
|
|
2231
|
-
/**
|
|
2232
|
-
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
2233
|
-
* digits.
|
|
2234
|
-
*
|
|
2235
|
-
* @since 9.5.0
|
|
2236
|
-
* @returns A record mapping Arabic digits to the target numerals.
|
|
2237
|
-
*/
|
|
2238
|
-
getDigitMap() {
|
|
2239
|
-
const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
|
|
2240
|
-
numberingSystem: t
|
|
2241
|
-
}), r = {};
|
|
2242
|
-
for (let o = 0; o < 10; o++)
|
|
2243
|
-
r[o.toString()] = n.format(o);
|
|
2244
|
-
return r;
|
|
2245
|
-
}
|
|
2246
|
-
/**
|
|
2247
|
-
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
2248
|
-
*
|
|
2249
|
-
* @since 9.5.0
|
|
2250
|
-
* @param input The string containing Arabic digits.
|
|
2251
|
-
* @returns The string with digits replaced.
|
|
2252
|
-
*/
|
|
2253
|
-
replaceDigits(t) {
|
|
2254
|
-
const n = this.getDigitMap();
|
|
2255
|
-
return t.replace(/\d/g, (r) => n[r] || r);
|
|
2256
|
-
}
|
|
2257
|
-
/**
|
|
2258
|
-
* Formats a number using the configured numbering system.
|
|
2259
|
-
*
|
|
2260
|
-
* @since 9.5.0
|
|
2261
|
-
* @param value The number to format.
|
|
2262
|
-
* @returns The formatted number as a string.
|
|
2263
|
-
*/
|
|
2264
|
-
formatNumber(t) {
|
|
2265
|
-
return this.replaceDigits(t.toString());
|
|
2266
|
-
}
|
|
2267
|
-
/**
|
|
2268
|
-
* Returns the preferred ordering for month and year labels for the current
|
|
2269
|
-
* locale.
|
|
2270
|
-
*/
|
|
2271
|
-
getMonthYearOrder() {
|
|
2272
|
-
const t = this.options.locale?.code;
|
|
2273
|
-
return t && $.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
2274
|
-
}
|
|
2275
|
-
/**
|
|
2276
|
-
* Formats the month/year pair respecting locale conventions.
|
|
2277
|
-
*
|
|
2278
|
-
* @since 9.11.0
|
|
2279
|
-
*/
|
|
2280
|
-
formatMonthYear(t) {
|
|
2281
|
-
const { locale: n, timeZone: r, numerals: o } = this.options, a = n?.code;
|
|
2282
|
-
if (a && $.yearFirstLocales.has(a))
|
|
2283
|
-
try {
|
|
2284
|
-
return new Intl.DateTimeFormat(a, {
|
|
2285
|
-
month: "long",
|
|
2286
|
-
year: "numeric",
|
|
2287
|
-
timeZone: r,
|
|
2288
|
-
numberingSystem: o
|
|
2289
|
-
}).format(t);
|
|
2290
|
-
} catch {
|
|
2291
|
-
}
|
|
2292
|
-
const i = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
2293
|
-
return this.format(t, i);
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
$.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
2297
|
-
"eu",
|
|
2298
|
-
"hu",
|
|
2299
|
-
"ja",
|
|
2300
|
-
"ja-Hira",
|
|
2301
|
-
"ja-JP",
|
|
2302
|
-
"ko",
|
|
2303
|
-
"ko-KR",
|
|
2304
|
-
"lt",
|
|
2305
|
-
"lt-LT",
|
|
2306
|
-
"lv",
|
|
2307
|
-
"lv-LV",
|
|
2308
|
-
"mn",
|
|
2309
|
-
"mn-MN",
|
|
2310
|
-
"zh",
|
|
2311
|
-
"zh-CN",
|
|
2312
|
-
"zh-HK",
|
|
2313
|
-
"zh-TW"
|
|
2314
|
-
]);
|
|
2315
|
-
const re = new $();
|
|
2316
|
-
class Ut {
|
|
2317
|
-
constructor(t, n, r = re) {
|
|
2318
|
-
this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r, this.isoDate = r.format(t, "yyyy-MM-dd"), this.displayMonthId = r.format(n, "yyyy-MM"), this.dateMonthId = r.format(t, "yyyy-MM");
|
|
2319
|
-
}
|
|
2320
|
-
/**
|
|
2321
|
-
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
2322
|
-
* date and the displayed month.
|
|
2323
|
-
*
|
|
2324
|
-
* @param day The `CalendarDay` to compare with.
|
|
2325
|
-
* @returns `true` if the days are equal, otherwise `false`.
|
|
2326
|
-
*/
|
|
2327
|
-
isEqualTo(t) {
|
|
2328
|
-
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
class da {
|
|
2332
|
-
constructor(t, n) {
|
|
2333
|
-
this.date = t, this.weeks = n;
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
class fa {
|
|
2337
|
-
constructor(t, n) {
|
|
2338
|
-
this.days = n, this.weekNumber = t;
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
function ha(e) {
|
|
2342
|
-
return h.createElement("button", { ...e });
|
|
2343
|
-
}
|
|
2344
|
-
function ma(e) {
|
|
2345
|
-
return h.createElement("span", { ...e });
|
|
2346
|
-
}
|
|
2347
|
-
function ya(e) {
|
|
2348
|
-
const { size: t = 24, orientation: n = "left", className: r } = e;
|
|
2349
|
-
return (
|
|
2350
|
-
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
2351
|
-
h.createElement(
|
|
2352
|
-
"svg",
|
|
2353
|
-
{ className: r, width: t, height: t, viewBox: "0 0 24 24" },
|
|
2354
|
-
n === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
2355
|
-
n === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
2356
|
-
n === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
2357
|
-
n === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
2358
|
-
)
|
|
2359
|
-
);
|
|
2360
|
-
}
|
|
2361
|
-
function ga(e) {
|
|
2362
|
-
const { day: t, modifiers: n, ...r } = e;
|
|
2363
|
-
return h.createElement("td", { ...r });
|
|
2364
|
-
}
|
|
2365
|
-
function ba(e) {
|
|
2366
|
-
const { day: t, modifiers: n, ...r } = e, o = h.useRef(null);
|
|
2367
|
-
return h.useEffect(() => {
|
|
2368
|
-
n.focused && o.current?.focus();
|
|
2369
|
-
}, [n.focused]), h.createElement("button", { ref: o, ...r });
|
|
2370
|
-
}
|
|
2371
|
-
var g;
|
|
2372
|
-
(function(e) {
|
|
2373
|
-
e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
|
|
2374
|
-
})(g || (g = {}));
|
|
2375
|
-
var F;
|
|
2376
|
-
(function(e) {
|
|
2377
|
-
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
2378
|
-
})(F || (F = {}));
|
|
2379
|
-
var Z;
|
|
2380
|
-
(function(e) {
|
|
2381
|
-
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
2382
|
-
})(Z || (Z = {}));
|
|
2383
|
-
var z;
|
|
2384
|
-
(function(e) {
|
|
2385
|
-
e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
|
|
2386
|
-
})(z || (z = {}));
|
|
2387
|
-
function pa(e) {
|
|
2388
|
-
const { options: t, className: n, components: r, classNames: o, ...a } = e, i = [o[g.Dropdown], n].join(" "), s = t?.find(({ value: u }) => u === a.value);
|
|
2389
|
-
return h.createElement(
|
|
2390
|
-
"span",
|
|
2391
|
-
{ "data-disabled": a.disabled, className: o[g.DropdownRoot] },
|
|
2392
|
-
h.createElement(r.Select, { className: i, ...a }, t?.map(({ value: u, label: c, disabled: d }) => h.createElement(r.Option, { key: u, value: u, disabled: d }, c))),
|
|
2393
|
-
h.createElement(
|
|
2394
|
-
"span",
|
|
2395
|
-
{ className: o[g.CaptionLabel], "aria-hidden": !0 },
|
|
2396
|
-
s?.label,
|
|
2397
|
-
h.createElement(r.Chevron, { orientation: "down", size: 18, className: o[g.Chevron] })
|
|
2398
|
-
)
|
|
2399
|
-
);
|
|
2400
|
-
}
|
|
2401
|
-
function wa(e) {
|
|
2402
|
-
return h.createElement("div", { ...e });
|
|
2403
|
-
}
|
|
2404
|
-
function va(e) {
|
|
2405
|
-
return h.createElement("div", { ...e });
|
|
2406
|
-
}
|
|
2407
|
-
function Ma(e) {
|
|
2408
|
-
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
2409
|
-
return h.createElement("div", { ...r }, e.children);
|
|
2410
|
-
}
|
|
2411
|
-
function ka(e) {
|
|
2412
|
-
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
2413
|
-
return h.createElement("div", { ...r });
|
|
2414
|
-
}
|
|
2415
|
-
function Da(e) {
|
|
2416
|
-
return h.createElement("table", { ...e });
|
|
2417
|
-
}
|
|
2418
|
-
function Oa(e) {
|
|
2419
|
-
return h.createElement("div", { ...e });
|
|
2420
|
-
}
|
|
2421
|
-
const Kt = Hn(void 0);
|
|
2422
|
-
function We() {
|
|
2423
|
-
const e = An(Kt);
|
|
2424
|
-
if (e === void 0)
|
|
2425
|
-
throw new Error("useDayPicker() must be used within a custom component.");
|
|
2426
|
-
return e;
|
|
2427
|
-
}
|
|
2428
|
-
function Wa(e) {
|
|
2429
|
-
const { components: t } = We();
|
|
2430
|
-
return h.createElement(t.Dropdown, { ...e });
|
|
2431
|
-
}
|
|
2432
|
-
function Na(e) {
|
|
2433
|
-
const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: u, labelNext: c } } = We(), d = V((f) => {
|
|
2434
|
-
o && n?.(f);
|
|
2435
|
-
}, [o, n]), l = V((f) => {
|
|
2436
|
-
r && t?.(f);
|
|
2437
|
-
}, [r, t]);
|
|
2438
|
-
return h.createElement(
|
|
2439
|
-
"nav",
|
|
2440
|
-
{ ...a },
|
|
2441
|
-
h.createElement(
|
|
2442
|
-
i.PreviousMonthButton,
|
|
2443
|
-
{ type: "button", className: s[g.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": u(r), onClick: l },
|
|
2444
|
-
h.createElement(i.Chevron, { disabled: r ? void 0 : !0, className: s[g.Chevron], orientation: "left" })
|
|
2445
|
-
),
|
|
2446
|
-
h.createElement(
|
|
2447
|
-
i.NextMonthButton,
|
|
2448
|
-
{ type: "button", className: s[g.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": c(o), onClick: d },
|
|
2449
|
-
h.createElement(i.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: s[g.Chevron] })
|
|
2450
|
-
)
|
|
2451
|
-
);
|
|
2452
|
-
}
|
|
2453
|
-
function Sa(e) {
|
|
2454
|
-
const { components: t } = We();
|
|
2455
|
-
return h.createElement(t.Button, { ...e });
|
|
2456
|
-
}
|
|
2457
|
-
function Ca(e) {
|
|
2458
|
-
return h.createElement("option", { ...e });
|
|
2459
|
-
}
|
|
2460
|
-
function xa(e) {
|
|
2461
|
-
const { components: t } = We();
|
|
2462
|
-
return h.createElement(t.Button, { ...e });
|
|
2463
|
-
}
|
|
2464
|
-
function Pa(e) {
|
|
2465
|
-
const { rootRef: t, ...n } = e;
|
|
2466
|
-
return h.createElement("div", { ...n, ref: t });
|
|
2467
|
-
}
|
|
2468
|
-
function Ya(e) {
|
|
2469
|
-
return h.createElement("select", { ...e });
|
|
2470
|
-
}
|
|
2471
|
-
function _a(e) {
|
|
2472
|
-
const { week: t, ...n } = e;
|
|
2473
|
-
return h.createElement("tr", { ...n });
|
|
2474
|
-
}
|
|
2475
|
-
function Ta(e) {
|
|
2476
|
-
return h.createElement("th", { ...e });
|
|
2477
|
-
}
|
|
2478
|
-
function Ea(e) {
|
|
2479
|
-
return h.createElement(
|
|
2480
|
-
"thead",
|
|
2481
|
-
{ "aria-hidden": !0 },
|
|
2482
|
-
h.createElement("tr", { ...e })
|
|
2483
|
-
);
|
|
2484
|
-
}
|
|
2485
|
-
function Fa(e) {
|
|
2486
|
-
const { week: t, ...n } = e;
|
|
2487
|
-
return h.createElement("th", { ...n });
|
|
2488
|
-
}
|
|
2489
|
-
function Ba(e) {
|
|
2490
|
-
return h.createElement("th", { ...e });
|
|
2491
|
-
}
|
|
2492
|
-
function Ga(e) {
|
|
2493
|
-
return h.createElement("tbody", { ...e });
|
|
2494
|
-
}
|
|
2495
|
-
function Ia(e) {
|
|
2496
|
-
const { components: t } = We();
|
|
2497
|
-
return h.createElement(t.Dropdown, { ...e });
|
|
2498
|
-
}
|
|
2499
|
-
const $a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2500
|
-
__proto__: null,
|
|
2501
|
-
Button: ha,
|
|
2502
|
-
CaptionLabel: ma,
|
|
2503
|
-
Chevron: ya,
|
|
2504
|
-
Day: ga,
|
|
2505
|
-
DayButton: ba,
|
|
2506
|
-
Dropdown: pa,
|
|
2507
|
-
DropdownNav: wa,
|
|
2508
|
-
Footer: va,
|
|
2509
|
-
Month: Ma,
|
|
2510
|
-
MonthCaption: ka,
|
|
2511
|
-
MonthGrid: Da,
|
|
2512
|
-
Months: Oa,
|
|
2513
|
-
MonthsDropdown: Wa,
|
|
2514
|
-
Nav: Na,
|
|
2515
|
-
NextMonthButton: Sa,
|
|
2516
|
-
Option: Ca,
|
|
2517
|
-
PreviousMonthButton: xa,
|
|
2518
|
-
Root: Pa,
|
|
2519
|
-
Select: Ya,
|
|
2520
|
-
Week: _a,
|
|
2521
|
-
WeekNumber: Fa,
|
|
2522
|
-
WeekNumberHeader: Ba,
|
|
2523
|
-
Weekday: Ta,
|
|
2524
|
-
Weekdays: Ea,
|
|
2525
|
-
Weeks: Ga,
|
|
2526
|
-
YearsDropdown: Ia
|
|
2527
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2528
|
-
function se(e, t, n = !1, r = re) {
|
|
2529
|
-
let { from: o, to: a } = e;
|
|
2530
|
-
const { differenceInCalendarDays: i, isSameDay: s } = r;
|
|
2531
|
-
return o && a ? (i(a, o) < 0 && ([o, a] = [a, o]), i(t, o) >= (n ? 1 : 0) && i(a, t) >= (n ? 1 : 0)) : !n && a ? s(a, t) : !n && o ? s(o, t) : !1;
|
|
2532
|
-
}
|
|
2533
|
-
function rt(e) {
|
|
2534
|
-
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
2535
|
-
}
|
|
2536
|
-
function _e(e) {
|
|
2537
|
-
return !!(e && typeof e == "object" && "from" in e);
|
|
2538
|
-
}
|
|
2539
|
-
function ot(e) {
|
|
2540
|
-
return !!(e && typeof e == "object" && "after" in e);
|
|
2541
|
-
}
|
|
2542
|
-
function at(e) {
|
|
2543
|
-
return !!(e && typeof e == "object" && "before" in e);
|
|
2544
|
-
}
|
|
2545
|
-
function Zt(e) {
|
|
2546
|
-
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
2547
|
-
}
|
|
2548
|
-
function Jt(e, t) {
|
|
2549
|
-
return Array.isArray(e) && e.every(t.isDate);
|
|
2550
|
-
}
|
|
2551
|
-
function ie(e, t, n = re) {
|
|
2552
|
-
const r = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: a, isAfter: i } = n;
|
|
2553
|
-
return r.some((s) => {
|
|
2554
|
-
if (typeof s == "boolean")
|
|
2555
|
-
return s;
|
|
2556
|
-
if (n.isDate(s))
|
|
2557
|
-
return o(e, s);
|
|
2558
|
-
if (Jt(s, n))
|
|
2559
|
-
return s.some((u) => o(e, u));
|
|
2560
|
-
if (_e(s))
|
|
2561
|
-
return se(s, e, !1, n);
|
|
2562
|
-
if (Zt(s))
|
|
2563
|
-
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
2564
|
-
if (rt(s)) {
|
|
2565
|
-
const u = a(s.before, e), c = a(s.after, e), d = u > 0, l = c < 0;
|
|
2566
|
-
return i(s.before, s.after) ? l && d : d || l;
|
|
2567
|
-
}
|
|
2568
|
-
return ot(s) ? a(e, s.after) > 0 : at(s) ? a(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
|
|
2569
|
-
});
|
|
2570
|
-
}
|
|
2571
|
-
function Ha(e, t, n, r, o) {
|
|
2572
|
-
const { disabled: a, hidden: i, modifiers: s, showOutsideDays: u, broadcastCalendar: c, today: d = o.today() } = t, { isSameDay: l, isSameMonth: f, startOfMonth: m, isBefore: v, endOfMonth: W, isAfter: O } = o, Y = n && m(n), M = r && W(r), p = {
|
|
2573
|
-
[F.focused]: [],
|
|
2574
|
-
[F.outside]: [],
|
|
2575
|
-
[F.disabled]: [],
|
|
2576
|
-
[F.hidden]: [],
|
|
2577
|
-
[F.today]: []
|
|
2578
|
-
}, k = {};
|
|
2579
|
-
for (const b of e) {
|
|
2580
|
-
const { date: y, displayMonth: N } = b, E = !!(N && !f(y, N)), I = !!(Y && v(y, Y)), B = !!(M && O(y, M)), J = !!(a && ie(y, a, o)), ue = !!(i && ie(y, i, o)) || I || B || // Broadcast calendar will show outside days as default
|
|
2581
|
-
!c && !u && E || c && u === !1 && E, oe = l(y, d);
|
|
2582
|
-
E && p.outside.push(b), J && p.disabled.push(b), ue && p.hidden.push(b), oe && p.today.push(b), s && Object.keys(s).forEach((j) => {
|
|
2583
|
-
const me = s?.[j];
|
|
2584
|
-
me && ie(y, me, o) && (k[j] ? k[j].push(b) : k[j] = [b]);
|
|
2585
|
-
});
|
|
2586
|
-
}
|
|
2587
|
-
return (b) => {
|
|
2588
|
-
const y = {
|
|
2589
|
-
[F.focused]: !1,
|
|
2590
|
-
[F.disabled]: !1,
|
|
2591
|
-
[F.hidden]: !1,
|
|
2592
|
-
[F.outside]: !1,
|
|
2593
|
-
[F.today]: !1
|
|
2594
|
-
}, N = {};
|
|
2595
|
-
for (const E in p) {
|
|
2596
|
-
const I = p[E];
|
|
2597
|
-
y[E] = I.some((B) => B === b);
|
|
2598
|
-
}
|
|
2599
|
-
for (const E in k)
|
|
2600
|
-
N[E] = k[E].some((I) => I === b);
|
|
2601
|
-
return {
|
|
2602
|
-
...y,
|
|
2603
|
-
// custom modifiers should override all the previous ones
|
|
2604
|
-
...N
|
|
2605
|
-
};
|
|
2606
|
-
};
|
|
2607
|
-
}
|
|
2608
|
-
function Aa(e, t, n = {}) {
|
|
2609
|
-
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (n[a] ? o.push(n[a]) : t[F[a]] ? o.push(t[F[a]]) : t[Z[a]] && o.push(t[Z[a]]), o), [t[g.Day]]);
|
|
2610
|
-
}
|
|
2611
|
-
function qa(e) {
|
|
2612
|
-
return {
|
|
2613
|
-
...$a,
|
|
2614
|
-
...e
|
|
2615
|
-
};
|
|
2616
|
-
}
|
|
2617
|
-
function za(e) {
|
|
2618
|
-
const t = {
|
|
2619
|
-
"data-mode": e.mode ?? void 0,
|
|
2620
|
-
"data-required": "required" in e ? e.required : void 0,
|
|
2621
|
-
"data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
|
|
2622
|
-
"data-week-numbers": e.showWeekNumber || void 0,
|
|
2623
|
-
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
2624
|
-
"data-nav-layout": e.navLayout || void 0
|
|
2625
|
-
};
|
|
2626
|
-
return Object.entries(e).forEach(([n, r]) => {
|
|
2627
|
-
n.startsWith("data-") && (t[n] = r);
|
|
2628
|
-
}), t;
|
|
2629
|
-
}
|
|
2630
|
-
function st() {
|
|
2631
|
-
const e = {};
|
|
2632
|
-
for (const t in g)
|
|
2633
|
-
e[g[t]] = `rdp-${g[t]}`;
|
|
2634
|
-
for (const t in F)
|
|
2635
|
-
e[F[t]] = `rdp-${F[t]}`;
|
|
2636
|
-
for (const t in Z)
|
|
2637
|
-
e[Z[t]] = `rdp-${Z[t]}`;
|
|
2638
|
-
for (const t in z)
|
|
2639
|
-
e[z[t]] = `rdp-${z[t]}`;
|
|
2640
|
-
return e;
|
|
2641
|
-
}
|
|
2642
|
-
function Lt(e, t, n) {
|
|
2643
|
-
return (n ?? new $(t)).formatMonthYear(e);
|
|
2644
|
-
}
|
|
2645
|
-
const ja = Lt;
|
|
2646
|
-
function Ra(e, t, n) {
|
|
2647
|
-
return (n ?? new $(t)).format(e, "d");
|
|
2648
|
-
}
|
|
2649
|
-
function Va(e, t = re) {
|
|
2650
|
-
return t.format(e, "LLLL");
|
|
2651
|
-
}
|
|
2652
|
-
function Xa(e, t, n) {
|
|
2653
|
-
return (n ?? new $(t)).format(e, "cccccc");
|
|
2654
|
-
}
|
|
2655
|
-
function Qa(e, t = re) {
|
|
2656
|
-
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
2657
|
-
}
|
|
2658
|
-
function Ua() {
|
|
2659
|
-
return "";
|
|
2660
|
-
}
|
|
2661
|
-
function en(e, t = re) {
|
|
2662
|
-
return t.format(e, "yyyy");
|
|
2663
|
-
}
|
|
2664
|
-
const Ka = en, Za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2665
|
-
__proto__: null,
|
|
2666
|
-
formatCaption: Lt,
|
|
2667
|
-
formatDay: Ra,
|
|
2668
|
-
formatMonthCaption: ja,
|
|
2669
|
-
formatMonthDropdown: Va,
|
|
2670
|
-
formatWeekNumber: Qa,
|
|
2671
|
-
formatWeekNumberHeader: Ua,
|
|
2672
|
-
formatWeekdayName: Xa,
|
|
2673
|
-
formatYearCaption: Ka,
|
|
2674
|
-
formatYearDropdown: en
|
|
2675
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2676
|
-
function Ja(e) {
|
|
2677
|
-
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
2678
|
-
...Za,
|
|
2679
|
-
...e
|
|
2680
|
-
};
|
|
2681
|
-
}
|
|
2682
|
-
function it(e, t, n, r) {
|
|
2683
|
-
let o = (r ?? new $(n)).format(e, "PPPP");
|
|
2684
|
-
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
2685
|
-
}
|
|
2686
|
-
const La = it;
|
|
2687
|
-
function ut(e, t, n) {
|
|
2688
|
-
return (n ?? new $(t)).formatMonthYear(e);
|
|
2689
|
-
}
|
|
2690
|
-
const es = ut;
|
|
2691
|
-
function tn(e, t, n, r) {
|
|
2692
|
-
let o = (r ?? new $(n)).format(e, "PPPP");
|
|
2693
|
-
return t?.today && (o = `Today, ${o}`), o;
|
|
2694
|
-
}
|
|
2695
|
-
function nn(e) {
|
|
2696
|
-
return "Choose the Month";
|
|
2697
|
-
}
|
|
2698
|
-
function rn() {
|
|
2699
|
-
return "";
|
|
2700
|
-
}
|
|
2701
|
-
const ts = "Go to the Next Month";
|
|
2702
|
-
function on(e, t) {
|
|
2703
|
-
return ts;
|
|
2704
|
-
}
|
|
2705
|
-
function an(e) {
|
|
2706
|
-
return "Go to the Previous Month";
|
|
2707
|
-
}
|
|
2708
|
-
function sn(e, t, n) {
|
|
2709
|
-
return (n ?? new $(t)).format(e, "cccc");
|
|
2710
|
-
}
|
|
2711
|
-
function un(e, t) {
|
|
2712
|
-
return `Week ${e}`;
|
|
2713
|
-
}
|
|
2714
|
-
function cn(e) {
|
|
2715
|
-
return "Week Number";
|
|
2716
|
-
}
|
|
2717
|
-
function ln(e) {
|
|
2718
|
-
return "Choose the Year";
|
|
2719
|
-
}
|
|
2720
|
-
const ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2721
|
-
__proto__: null,
|
|
2722
|
-
labelCaption: es,
|
|
2723
|
-
labelDay: La,
|
|
2724
|
-
labelDayButton: it,
|
|
2725
|
-
labelGrid: ut,
|
|
2726
|
-
labelGridcell: tn,
|
|
2727
|
-
labelMonthDropdown: nn,
|
|
2728
|
-
labelNav: rn,
|
|
2729
|
-
labelNext: on,
|
|
2730
|
-
labelPrevious: an,
|
|
2731
|
-
labelWeekNumber: un,
|
|
2732
|
-
labelWeekNumberHeader: cn,
|
|
2733
|
-
labelWeekday: sn,
|
|
2734
|
-
labelYearDropdown: ln
|
|
2735
|
-
}, Symbol.toStringTag, { value: "Module" })), K = (e, t, n) => t || (n ? typeof n == "function" ? n : (...r) => n : e);
|
|
2736
|
-
function rs(e, t) {
|
|
2737
|
-
const n = t.locale?.labels ?? {};
|
|
2738
|
-
return {
|
|
2739
|
-
...ns,
|
|
2740
|
-
...e ?? {},
|
|
2741
|
-
labelDayButton: K(it, e?.labelDayButton, n.labelDayButton),
|
|
2742
|
-
labelMonthDropdown: K(nn, e?.labelMonthDropdown, n.labelMonthDropdown),
|
|
2743
|
-
labelNext: K(on, e?.labelNext, n.labelNext),
|
|
2744
|
-
labelPrevious: K(an, e?.labelPrevious, n.labelPrevious),
|
|
2745
|
-
labelWeekNumber: K(un, e?.labelWeekNumber, n.labelWeekNumber),
|
|
2746
|
-
labelYearDropdown: K(ln, e?.labelYearDropdown, n.labelYearDropdown),
|
|
2747
|
-
labelGrid: K(ut, e?.labelGrid, n.labelGrid),
|
|
2748
|
-
labelGridcell: K(tn, e?.labelGridcell, n.labelGridcell),
|
|
2749
|
-
labelNav: K(rn, e?.labelNav, n.labelNav),
|
|
2750
|
-
labelWeekNumberHeader: K(cn, e?.labelWeekNumberHeader, n.labelWeekNumberHeader),
|
|
2751
|
-
labelWeekday: K(sn, e?.labelWeekday, n.labelWeekday)
|
|
2752
|
-
};
|
|
2753
|
-
}
|
|
2754
|
-
function os(e, t, n, r, o) {
|
|
2755
|
-
const { startOfMonth: a, startOfYear: i, endOfYear: s, eachMonthOfInterval: u, getMonth: c } = o;
|
|
2756
|
-
return u({
|
|
2757
|
-
start: i(e),
|
|
2758
|
-
end: s(e)
|
|
2759
|
-
}).map((f) => {
|
|
2760
|
-
const m = r.formatMonthDropdown(f, o), v = c(f), W = t && f < a(t) || n && f > a(n) || !1;
|
|
2761
|
-
return { value: v, label: m, disabled: W };
|
|
2762
|
-
});
|
|
2763
|
-
}
|
|
2764
|
-
function as(e, t = {}, n = {}) {
|
|
2765
|
-
let r = { ...t?.[g.Day] };
|
|
2766
|
-
return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
|
|
2767
|
-
r = {
|
|
2768
|
-
...r,
|
|
2769
|
-
...n?.[o]
|
|
2770
|
-
};
|
|
2771
|
-
}), r;
|
|
2772
|
-
}
|
|
2773
|
-
function ss(e, t, n, r) {
|
|
2774
|
-
const o = r ?? e.today(), a = n ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), i = [];
|
|
2775
|
-
for (let s = 0; s < 7; s++) {
|
|
2776
|
-
const u = e.addDays(a, s);
|
|
2777
|
-
i.push(u);
|
|
2778
|
-
}
|
|
2779
|
-
return i;
|
|
2780
|
-
}
|
|
2781
|
-
function is(e, t, n, r, o = !1) {
|
|
2782
|
-
if (!e || !t)
|
|
2783
|
-
return;
|
|
2784
|
-
const { startOfYear: a, endOfYear: i, eachYearOfInterval: s, getYear: u } = r, c = a(e), d = i(t), l = s({ start: c, end: d });
|
|
2785
|
-
return o && l.reverse(), l.map((f) => {
|
|
2786
|
-
const m = n.formatYearDropdown(f, r);
|
|
2787
|
-
return {
|
|
2788
|
-
value: u(f),
|
|
2789
|
-
label: m,
|
|
2790
|
-
disabled: !1
|
|
2791
|
-
};
|
|
2792
|
-
});
|
|
2793
|
-
}
|
|
2794
|
-
function us(e, t = {}) {
|
|
2795
|
-
const { weekStartsOn: n, locale: r } = t, o = n ?? r?.options?.weekStartsOn ?? 0, a = (s) => {
|
|
2796
|
-
const u = typeof s == "number" || typeof s == "string" ? new Date(s) : s;
|
|
2797
|
-
return new H(u.getFullYear(), u.getMonth(), u.getDate(), 12, 0, 0, e);
|
|
2798
|
-
}, i = (s) => {
|
|
2799
|
-
const u = a(s);
|
|
2800
|
-
return new Date(u.getFullYear(), u.getMonth(), u.getDate(), 0, 0, 0, 0);
|
|
2801
|
-
};
|
|
2802
|
-
return {
|
|
2803
|
-
today: () => a(H.tz(e)),
|
|
2804
|
-
newDate: (s, u, c) => new H(s, u, c, 12, 0, 0, e),
|
|
2805
|
-
startOfDay: (s) => a(s),
|
|
2806
|
-
startOfWeek: (s, u) => {
|
|
2807
|
-
const c = a(s), d = u?.weekStartsOn ?? o, l = (c.getDay() - d + 7) % 7;
|
|
2808
|
-
return c.setDate(c.getDate() - l), c;
|
|
2809
|
-
},
|
|
2810
|
-
startOfISOWeek: (s) => {
|
|
2811
|
-
const u = a(s), c = (u.getDay() - 1 + 7) % 7;
|
|
2812
|
-
return u.setDate(u.getDate() - c), u;
|
|
2813
|
-
},
|
|
2814
|
-
startOfMonth: (s) => {
|
|
2815
|
-
const u = a(s);
|
|
2816
|
-
return u.setDate(1), u;
|
|
2817
|
-
},
|
|
2818
|
-
startOfYear: (s) => {
|
|
2819
|
-
const u = a(s);
|
|
2820
|
-
return u.setMonth(0, 1), u;
|
|
2821
|
-
},
|
|
2822
|
-
endOfWeek: (s, u) => {
|
|
2823
|
-
const c = a(s), f = (((u?.weekStartsOn ?? o) + 6) % 7 - c.getDay() + 7) % 7;
|
|
2824
|
-
return c.setDate(c.getDate() + f), c;
|
|
2825
|
-
},
|
|
2826
|
-
endOfISOWeek: (s) => {
|
|
2827
|
-
const u = a(s), c = (7 - u.getDay()) % 7;
|
|
2828
|
-
return u.setDate(u.getDate() + c), u;
|
|
2829
|
-
},
|
|
2830
|
-
endOfMonth: (s) => {
|
|
2831
|
-
const u = a(s);
|
|
2832
|
-
return u.setMonth(u.getMonth() + 1, 0), u;
|
|
2833
|
-
},
|
|
2834
|
-
endOfYear: (s) => {
|
|
2835
|
-
const u = a(s);
|
|
2836
|
-
return u.setMonth(11, 31), u;
|
|
2837
|
-
},
|
|
2838
|
-
eachMonthOfInterval: (s) => {
|
|
2839
|
-
const u = a(s.start), c = a(s.end), d = [], l = new H(u.getFullYear(), u.getMonth(), 1, 12, 0, 0, e), f = c.getFullYear() * 12 + c.getMonth();
|
|
2840
|
-
for (; l.getFullYear() * 12 + l.getMonth() <= f; )
|
|
2841
|
-
d.push(new H(l, e)), l.setMonth(l.getMonth() + 1, 1);
|
|
2842
|
-
return d;
|
|
2843
|
-
},
|
|
2844
|
-
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2845
|
-
// mutate the same TZDate, and return it.
|
|
2846
|
-
addDays: (s, u) => {
|
|
2847
|
-
const c = a(s);
|
|
2848
|
-
return c.setDate(c.getDate() + u), c;
|
|
2849
|
-
},
|
|
2850
|
-
addWeeks: (s, u) => {
|
|
2851
|
-
const c = a(s);
|
|
2852
|
-
return c.setDate(c.getDate() + u * 7), c;
|
|
2853
|
-
},
|
|
2854
|
-
addMonths: (s, u) => {
|
|
2855
|
-
const c = a(s);
|
|
2856
|
-
return c.setMonth(c.getMonth() + u), c;
|
|
2857
|
-
},
|
|
2858
|
-
addYears: (s, u) => {
|
|
2859
|
-
const c = a(s);
|
|
2860
|
-
return c.setFullYear(c.getFullYear() + u), c;
|
|
2861
|
-
},
|
|
2862
|
-
eachYearOfInterval: (s) => {
|
|
2863
|
-
const u = a(s.start), c = a(s.end), d = [], l = new H(u.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2864
|
-
for (; l.getFullYear() <= c.getFullYear(); )
|
|
2865
|
-
d.push(new H(l, e)), l.setFullYear(l.getFullYear() + 1, 0, 1);
|
|
2866
|
-
return d;
|
|
2867
|
-
},
|
|
2868
|
-
getWeek: (s, u) => {
|
|
2869
|
-
const c = i(s);
|
|
2870
|
-
return et(c, {
|
|
2871
|
-
weekStartsOn: u?.weekStartsOn ?? o,
|
|
2872
|
-
firstWeekContainsDate: u?.firstWeekContainsDate ?? r?.options?.firstWeekContainsDate ?? 1
|
|
2873
|
-
});
|
|
2874
|
-
},
|
|
2875
|
-
getISOWeek: (s) => {
|
|
2876
|
-
const u = i(s);
|
|
2877
|
-
return Le(u);
|
|
2878
|
-
},
|
|
2879
|
-
differenceInCalendarDays: (s, u) => {
|
|
2880
|
-
const c = i(s), d = i(u);
|
|
2881
|
-
return Je(c, d);
|
|
2882
|
-
},
|
|
2883
|
-
differenceInCalendarMonths: (s, u) => {
|
|
2884
|
-
const c = i(s), d = i(u);
|
|
2885
|
-
return At(c, d);
|
|
2886
|
-
}
|
|
2887
|
-
};
|
|
2888
|
-
}
|
|
2889
|
-
const Ne = (e) => e instanceof HTMLElement ? e : null, je = (e) => [
|
|
2890
|
-
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2891
|
-
], cs = (e) => Ne(e.querySelector("[data-animated-month]")), Re = (e) => Ne(e.querySelector("[data-animated-caption]")), Ve = (e) => Ne(e.querySelector("[data-animated-weeks]")), ls = (e) => Ne(e.querySelector("[data-animated-nav]")), ds = (e) => Ne(e.querySelector("[data-animated-weekdays]"));
|
|
2892
|
-
function fs(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
|
|
2893
|
-
const i = Pe(null), s = Pe(r), u = Pe(!1);
|
|
2894
|
-
qn(() => {
|
|
2895
|
-
const c = s.current;
|
|
2896
|
-
if (s.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2897
|
-
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2898
|
-
r.length === 0 || c.length === 0 || r.length !== c.length)
|
|
2899
|
-
return;
|
|
2900
|
-
const d = a.isSameMonth(r[0].date, c[0].date), l = a.isAfter(r[0].date, c[0].date), f = l ? n[z.caption_after_enter] : n[z.caption_before_enter], m = l ? n[z.weeks_after_enter] : n[z.weeks_before_enter], v = i.current, W = e.current.cloneNode(!0);
|
|
2901
|
-
if (W instanceof HTMLElement ? (je(W).forEach((p) => {
|
|
2902
|
-
if (!(p instanceof HTMLElement))
|
|
2903
|
-
return;
|
|
2904
|
-
const k = cs(p);
|
|
2905
|
-
k && p.contains(k) && p.removeChild(k);
|
|
2906
|
-
const b = Re(p);
|
|
2907
|
-
b && b.classList.remove(f);
|
|
2908
|
-
const y = Ve(p);
|
|
2909
|
-
y && y.classList.remove(m);
|
|
2910
|
-
}), i.current = W) : i.current = null, u.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2911
|
-
o)
|
|
2912
|
-
return;
|
|
2913
|
-
const O = v instanceof HTMLElement ? je(v) : [], Y = je(e.current);
|
|
2914
|
-
if (Y?.every((M) => M instanceof HTMLElement) && O && O.every((M) => M instanceof HTMLElement)) {
|
|
2915
|
-
u.current = !0, e.current.style.isolation = "isolate";
|
|
2916
|
-
const M = ls(e.current);
|
|
2917
|
-
M && (M.style.zIndex = "1"), Y.forEach((p, k) => {
|
|
2918
|
-
const b = O[k];
|
|
2919
|
-
if (!b)
|
|
2920
|
-
return;
|
|
2921
|
-
p.style.position = "relative", p.style.overflow = "hidden";
|
|
2922
|
-
const y = Re(p);
|
|
2923
|
-
y && y.classList.add(f);
|
|
2924
|
-
const N = Ve(p);
|
|
2925
|
-
N && N.classList.add(m);
|
|
2926
|
-
const E = () => {
|
|
2927
|
-
u.current = !1, e.current && (e.current.style.isolation = ""), M && (M.style.zIndex = ""), y && y.classList.remove(f), N && N.classList.remove(m), p.style.position = "", p.style.overflow = "", p.contains(b) && p.removeChild(b);
|
|
2928
|
-
};
|
|
2929
|
-
b.style.pointerEvents = "none", b.style.position = "absolute", b.style.overflow = "hidden", b.setAttribute("aria-hidden", "true");
|
|
2930
|
-
const I = ds(b);
|
|
2931
|
-
I && (I.style.opacity = "0");
|
|
2932
|
-
const B = Re(b);
|
|
2933
|
-
B && (B.classList.add(l ? n[z.caption_before_exit] : n[z.caption_after_exit]), B.addEventListener("animationend", E));
|
|
2934
|
-
const J = Ve(b);
|
|
2935
|
-
J && J.classList.add(l ? n[z.weeks_before_exit] : n[z.weeks_after_exit]), p.insertBefore(b, p.firstChild);
|
|
2936
|
-
});
|
|
2937
|
-
}
|
|
2938
|
-
});
|
|
2939
|
-
}
|
|
2940
|
-
function hs(e, t, n, r) {
|
|
2941
|
-
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: u } = n ?? {}, { addDays: c, differenceInCalendarDays: d, differenceInCalendarMonths: l, endOfBroadcastWeek: f, endOfISOWeek: m, endOfMonth: v, endOfWeek: W, isAfter: O, startOfBroadcastWeek: Y, startOfISOWeek: M, startOfWeek: p } = r, k = u ? Y(o, r) : i ? M(o) : p(o), b = u ? f(a) : i ? m(v(a)) : W(v(a)), y = t && (u ? f(t) : i ? m(t) : W(t)), N = y && O(b, y) ? y : b, E = d(N, k), I = l(a, o) + 1, B = [];
|
|
2942
|
-
for (let oe = 0; oe <= E; oe++) {
|
|
2943
|
-
const j = c(k, oe);
|
|
2944
|
-
B.push(j);
|
|
2945
|
-
}
|
|
2946
|
-
const ue = (u ? 35 : 42) * I;
|
|
2947
|
-
if (s && B.length < ue) {
|
|
2948
|
-
const oe = ue - B.length;
|
|
2949
|
-
for (let j = 0; j < oe; j++) {
|
|
2950
|
-
const me = c(B[B.length - 1], 1);
|
|
2951
|
-
B.push(me);
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
2954
|
-
return B;
|
|
2955
|
-
}
|
|
2956
|
-
function ms(e) {
|
|
2957
|
-
const t = [];
|
|
2958
|
-
return e.reduce((n, r) => {
|
|
2959
|
-
const o = r.weeks.reduce((a, i) => a.concat(i.days.slice()), t.slice());
|
|
2960
|
-
return n.concat(o.slice());
|
|
2961
|
-
}, t.slice());
|
|
2962
|
-
}
|
|
2963
|
-
function ys(e, t, n, r) {
|
|
2964
|
-
const { numberOfMonths: o = 1 } = n, a = [];
|
|
2965
|
-
for (let i = 0; i < o; i++) {
|
|
2966
|
-
const s = r.addMonths(e, i);
|
|
2967
|
-
if (t && s > t)
|
|
2968
|
-
break;
|
|
2969
|
-
a.push(s);
|
|
2970
|
-
}
|
|
2971
|
-
return a;
|
|
2972
|
-
}
|
|
2973
|
-
function xt(e, t, n, r) {
|
|
2974
|
-
const { month: o, defaultMonth: a, today: i = r.today(), numberOfMonths: s = 1 } = e;
|
|
2975
|
-
let u = o || a || i;
|
|
2976
|
-
const { differenceInCalendarMonths: c, addMonths: d, startOfMonth: l } = r;
|
|
2977
|
-
if (n && c(n, u) < s - 1) {
|
|
2978
|
-
const f = -1 * (s - 1);
|
|
2979
|
-
u = d(n, f);
|
|
2980
|
-
}
|
|
2981
|
-
return t && c(u, t) < 0 && (u = t), l(u);
|
|
2982
|
-
}
|
|
2983
|
-
function gs(e, t, n, r) {
|
|
2984
|
-
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: u, getISOWeek: c, getWeek: d, startOfBroadcastWeek: l, startOfISOWeek: f, startOfWeek: m } = r, v = e.reduce((W, O) => {
|
|
2985
|
-
const Y = n.broadcastCalendar ? l(O, r) : n.ISOWeek ? f(O) : m(O), M = n.broadcastCalendar ? a(O) : n.ISOWeek ? i(s(O)) : u(s(O)), p = t.filter((N) => N >= Y && N <= M), k = n.broadcastCalendar ? 35 : 42;
|
|
2986
|
-
if (n.fixedWeeks && p.length < k) {
|
|
2987
|
-
const N = t.filter((E) => {
|
|
2988
|
-
const I = k - p.length;
|
|
2989
|
-
return E > M && E <= o(M, I);
|
|
2990
|
-
});
|
|
2991
|
-
p.push(...N);
|
|
2992
|
-
}
|
|
2993
|
-
const b = p.reduce((N, E) => {
|
|
2994
|
-
const I = n.ISOWeek ? c(E) : d(E), B = N.find((ue) => ue.weekNumber === I), J = new Ut(E, O, r);
|
|
2995
|
-
return B ? B.days.push(J) : N.push(new fa(I, [J])), N;
|
|
2996
|
-
}, []), y = new da(O, b);
|
|
2997
|
-
return W.push(y), W;
|
|
2998
|
-
}, []);
|
|
2999
|
-
return n.reverseMonths ? v.reverse() : v;
|
|
3000
|
-
}
|
|
3001
|
-
function bs(e, t) {
|
|
3002
|
-
let { startMonth: n, endMonth: r } = e;
|
|
3003
|
-
const { startOfYear: o, startOfDay: a, startOfMonth: i, endOfMonth: s, addYears: u, endOfYear: c, newDate: d, today: l } = t, { fromYear: f, toYear: m, fromMonth: v, toMonth: W } = e;
|
|
3004
|
-
!n && v && (n = v), !n && f && (n = t.newDate(f, 0, 1)), !r && W && (r = W), !r && m && (r = d(m, 11, 31));
|
|
3005
|
-
const O = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
3006
|
-
return n ? n = i(n) : f ? n = d(f, 0, 1) : !n && O && (n = o(u(e.today ?? l(), -100))), r ? r = s(r) : m ? r = d(m, 11, 31) : !r && O && (r = c(e.today ?? l())), [
|
|
3007
|
-
n && a(n),
|
|
3008
|
-
r && a(r)
|
|
3009
|
-
];
|
|
3010
|
-
}
|
|
3011
|
-
function ps(e, t, n, r) {
|
|
3012
|
-
if (n.disableNavigation)
|
|
3013
|
-
return;
|
|
3014
|
-
const { pagedNavigation: o, numberOfMonths: a = 1 } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: u } = r, c = o ? a : 1, d = i(e);
|
|
3015
|
-
if (!t)
|
|
3016
|
-
return s(d, c);
|
|
3017
|
-
if (!(u(t, e) < a))
|
|
3018
|
-
return s(d, c);
|
|
3019
|
-
}
|
|
3020
|
-
function ws(e, t, n, r) {
|
|
3021
|
-
if (n.disableNavigation)
|
|
3022
|
-
return;
|
|
3023
|
-
const { pagedNavigation: o, numberOfMonths: a } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: u } = r, c = o ? a ?? 1 : 1, d = i(e);
|
|
3024
|
-
if (!t)
|
|
3025
|
-
return s(d, -c);
|
|
3026
|
-
if (!(u(d, t) <= 0))
|
|
3027
|
-
return s(d, -c);
|
|
3028
|
-
}
|
|
3029
|
-
function vs(e) {
|
|
3030
|
-
const t = [];
|
|
3031
|
-
return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
|
|
3032
|
-
}
|
|
3033
|
-
function Te(e, t) {
|
|
3034
|
-
const [n, r] = Ue(e);
|
|
3035
|
-
return [t === void 0 ? n : t, r];
|
|
3036
|
-
}
|
|
3037
|
-
function Ms(e, t) {
|
|
3038
|
-
const [n, r] = bs(e, t), { startOfMonth: o, endOfMonth: a } = t, i = xt(e, n, r, t), [s, u] = Te(
|
|
3039
|
-
i,
|
|
3040
|
-
// initialMonth is always computed from props.month if provided
|
|
3041
|
-
e.month ? i : void 0
|
|
3042
|
-
);
|
|
3043
|
-
zn(() => {
|
|
3044
|
-
const k = xt(e, n, r, t);
|
|
3045
|
-
u(k);
|
|
3046
|
-
}, [e.timeZone]);
|
|
3047
|
-
const { months: c, weeks: d, days: l, previousMonth: f, nextMonth: m } = Ye(() => {
|
|
3048
|
-
const k = ys(s, r, { numberOfMonths: e.numberOfMonths }, t), b = hs(k, e.endMonth ? a(e.endMonth) : void 0, {
|
|
3049
|
-
ISOWeek: e.ISOWeek,
|
|
3050
|
-
fixedWeeks: e.fixedWeeks,
|
|
3051
|
-
broadcastCalendar: e.broadcastCalendar
|
|
3052
|
-
}, t), y = gs(k, b, {
|
|
3053
|
-
broadcastCalendar: e.broadcastCalendar,
|
|
3054
|
-
fixedWeeks: e.fixedWeeks,
|
|
3055
|
-
ISOWeek: e.ISOWeek,
|
|
3056
|
-
reverseMonths: e.reverseMonths
|
|
3057
|
-
}, t), N = vs(y), E = ms(y), I = ws(s, n, e, t), B = ps(s, r, e, t);
|
|
3058
|
-
return {
|
|
3059
|
-
months: y,
|
|
3060
|
-
weeks: N,
|
|
3061
|
-
days: E,
|
|
3062
|
-
previousMonth: I,
|
|
3063
|
-
nextMonth: B
|
|
3064
|
-
};
|
|
3065
|
-
}, [
|
|
3066
|
-
t,
|
|
3067
|
-
s.getTime(),
|
|
3068
|
-
r?.getTime(),
|
|
3069
|
-
n?.getTime(),
|
|
3070
|
-
e.disableNavigation,
|
|
3071
|
-
e.broadcastCalendar,
|
|
3072
|
-
e.endMonth?.getTime(),
|
|
3073
|
-
e.fixedWeeks,
|
|
3074
|
-
e.ISOWeek,
|
|
3075
|
-
e.numberOfMonths,
|
|
3076
|
-
e.pagedNavigation,
|
|
3077
|
-
e.reverseMonths
|
|
3078
|
-
]), { disableNavigation: v, onMonthChange: W } = e, O = (k) => d.some((b) => b.days.some((y) => y.isEqualTo(k))), Y = (k) => {
|
|
3079
|
-
if (v)
|
|
3080
|
-
return;
|
|
3081
|
-
let b = o(k);
|
|
3082
|
-
n && b < o(n) && (b = o(n)), r && b > o(r) && (b = o(r)), u(b), W?.(b);
|
|
3083
|
-
};
|
|
3084
|
-
return {
|
|
3085
|
-
months: c,
|
|
3086
|
-
weeks: d,
|
|
3087
|
-
days: l,
|
|
3088
|
-
navStart: n,
|
|
3089
|
-
navEnd: r,
|
|
3090
|
-
previousMonth: f,
|
|
3091
|
-
nextMonth: m,
|
|
3092
|
-
goToMonth: Y,
|
|
3093
|
-
goToDay: (k) => {
|
|
3094
|
-
O(k) || Y(k.date);
|
|
3095
|
-
}
|
|
3096
|
-
};
|
|
3097
|
-
}
|
|
3098
|
-
var L;
|
|
3099
|
-
(function(e) {
|
|
3100
|
-
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
3101
|
-
})(L || (L = {}));
|
|
3102
|
-
function Pt(e) {
|
|
3103
|
-
return !e[F.disabled] && !e[F.hidden] && !e[F.outside];
|
|
3104
|
-
}
|
|
3105
|
-
function ks(e, t, n, r) {
|
|
3106
|
-
let o, a = -1;
|
|
3107
|
-
for (const i of e) {
|
|
3108
|
-
const s = t(i);
|
|
3109
|
-
Pt(s) && (s[F.focused] && a < L.FocusedModifier ? (o = i, a = L.FocusedModifier) : r?.isEqualTo(i) && a < L.LastFocused ? (o = i, a = L.LastFocused) : n(i.date) && a < L.Selected ? (o = i, a = L.Selected) : s[F.today] && a < L.Today && (o = i, a = L.Today));
|
|
3110
|
-
}
|
|
3111
|
-
return o || (o = e.find((i) => Pt(t(i)))), o;
|
|
3112
|
-
}
|
|
3113
|
-
function Ds(e, t, n, r, o, a, i) {
|
|
3114
|
-
const { ISOWeek: s, broadcastCalendar: u } = a, { addDays: c, addMonths: d, addWeeks: l, addYears: f, endOfBroadcastWeek: m, endOfISOWeek: v, endOfWeek: W, max: O, min: Y, startOfBroadcastWeek: M, startOfISOWeek: p, startOfWeek: k } = i;
|
|
3115
|
-
let y = {
|
|
3116
|
-
day: c,
|
|
3117
|
-
week: l,
|
|
3118
|
-
month: d,
|
|
3119
|
-
year: f,
|
|
3120
|
-
startOfWeek: (N) => u ? M(N, i) : s ? p(N) : k(N),
|
|
3121
|
-
endOfWeek: (N) => u ? m(N) : s ? v(N) : W(N)
|
|
3122
|
-
}[e](n, t === "after" ? 1 : -1);
|
|
3123
|
-
return t === "before" && r ? y = O([r, y]) : t === "after" && o && (y = Y([o, y])), y;
|
|
3124
|
-
}
|
|
3125
|
-
function dn(e, t, n, r, o, a, i, s = 0) {
|
|
3126
|
-
if (s > 365)
|
|
3127
|
-
return;
|
|
3128
|
-
const u = Ds(e, t, n.date, r, o, a, i), c = !!(a.disabled && ie(u, a.disabled, i)), d = !!(a.hidden && ie(u, a.hidden, i)), l = u, f = new Ut(u, l, i);
|
|
3129
|
-
return !c && !d ? f : dn(e, t, f, r, o, a, i, s + 1);
|
|
3130
|
-
}
|
|
3131
|
-
function Os(e, t, n, r, o) {
|
|
3132
|
-
const { autoFocus: a } = e, [i, s] = Ue(), u = ks(t.days, n, r || (() => !1), i), [c, d] = Ue(a ? u : void 0);
|
|
3133
|
-
return {
|
|
3134
|
-
isFocusTarget: (W) => !!u?.isEqualTo(W),
|
|
3135
|
-
setFocused: d,
|
|
3136
|
-
focused: c,
|
|
3137
|
-
blur: () => {
|
|
3138
|
-
s(c), d(void 0);
|
|
3139
|
-
},
|
|
3140
|
-
moveFocus: (W, O) => {
|
|
3141
|
-
if (!c)
|
|
3142
|
-
return;
|
|
3143
|
-
const Y = dn(W, O, c, t.navStart, t.navEnd, e, o);
|
|
3144
|
-
Y && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(Y)) || (t.goToDay(Y), d(Y)));
|
|
3145
|
-
}
|
|
3146
|
-
};
|
|
3147
|
-
}
|
|
3148
|
-
function Ws(e, t) {
|
|
3149
|
-
const { selected: n, required: r, onSelect: o } = e, [a, i] = Te(n, o ? n : void 0), s = o ? n : a, { isSameDay: u } = t, c = (m) => s?.some((v) => u(v, m)) ?? !1, { min: d, max: l } = e;
|
|
3150
|
-
return {
|
|
3151
|
-
selected: s,
|
|
3152
|
-
select: (m, v, W) => {
|
|
3153
|
-
let O = [...s ?? []];
|
|
3154
|
-
if (c(m)) {
|
|
3155
|
-
if (s?.length === d || r && s?.length === 1)
|
|
3156
|
-
return;
|
|
3157
|
-
O = s?.filter((Y) => !u(Y, m));
|
|
3158
|
-
} else
|
|
3159
|
-
s?.length === l ? O = [m] : O = [...O, m];
|
|
3160
|
-
return o || i(O), o?.(O, m, v, W), O;
|
|
3161
|
-
},
|
|
3162
|
-
isSelected: c
|
|
3163
|
-
};
|
|
3164
|
-
}
|
|
3165
|
-
function Ns(e, t, n = 0, r = 0, o = !1, a = re) {
|
|
3166
|
-
const { from: i, to: s } = t || {}, { isSameDay: u, isAfter: c, isBefore: d } = a;
|
|
3167
|
-
let l;
|
|
3168
|
-
if (!i && !s)
|
|
3169
|
-
l = { from: e, to: n > 0 ? void 0 : e };
|
|
3170
|
-
else if (i && !s)
|
|
3171
|
-
u(i, e) ? n === 0 ? l = { from: i, to: e } : o ? l = { from: i, to: void 0 } : l = void 0 : d(e, i) ? l = { from: e, to: i } : l = { from: i, to: e };
|
|
3172
|
-
else if (i && s)
|
|
3173
|
-
if (u(i, e) && u(s, e))
|
|
3174
|
-
o ? l = { from: i, to: s } : l = void 0;
|
|
3175
|
-
else if (u(i, e))
|
|
3176
|
-
l = { from: i, to: n > 0 ? void 0 : e };
|
|
3177
|
-
else if (u(s, e))
|
|
3178
|
-
l = { from: e, to: n > 0 ? void 0 : e };
|
|
3179
|
-
else if (d(e, i))
|
|
3180
|
-
l = { from: e, to: s };
|
|
3181
|
-
else if (c(e, i))
|
|
3182
|
-
l = { from: i, to: e };
|
|
3183
|
-
else if (c(e, s))
|
|
3184
|
-
l = { from: i, to: e };
|
|
3185
|
-
else
|
|
3186
|
-
throw new Error("Invalid range");
|
|
3187
|
-
if (l?.from && l?.to) {
|
|
3188
|
-
const f = a.differenceInCalendarDays(l.to, l.from);
|
|
3189
|
-
r > 0 && f > r ? l = { from: e, to: void 0 } : n > 1 && f < n && (l = { from: e, to: void 0 });
|
|
3190
|
-
}
|
|
3191
|
-
return l;
|
|
3192
|
-
}
|
|
3193
|
-
function Ss(e, t, n = re) {
|
|
3194
|
-
const r = Array.isArray(t) ? t : [t];
|
|
3195
|
-
let o = e.from;
|
|
3196
|
-
const a = n.differenceInCalendarDays(e.to, e.from), i = Math.min(a, 6);
|
|
3197
|
-
for (let s = 0; s <= i; s++) {
|
|
3198
|
-
if (r.includes(o.getDay()))
|
|
3199
|
-
return !0;
|
|
3200
|
-
o = n.addDays(o, 1);
|
|
3201
|
-
}
|
|
3202
|
-
return !1;
|
|
3203
|
-
}
|
|
3204
|
-
function Yt(e, t, n = re) {
|
|
3205
|
-
return se(e, t.from, !1, n) || se(e, t.to, !1, n) || se(t, e.from, !1, n) || se(t, e.to, !1, n);
|
|
3206
|
-
}
|
|
3207
|
-
function Cs(e, t, n = re) {
|
|
3208
|
-
const r = Array.isArray(t) ? t : [t];
|
|
3209
|
-
if (r.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? se(e, s, !1, n) : Jt(s, n) ? s.some((u) => se(e, u, !1, n)) : _e(s) ? s.from && s.to ? Yt(e, { from: s.from, to: s.to }, n) : !1 : Zt(s) ? Ss(e, s.dayOfWeek, n) : rt(s) ? n.isAfter(s.before, s.after) ? Yt(e, {
|
|
3210
|
-
from: n.addDays(s.after, 1),
|
|
3211
|
-
to: n.addDays(s.before, -1)
|
|
3212
|
-
}, n) : ie(e.from, s, n) || ie(e.to, s, n) : ot(s) || at(s) ? ie(e.from, s, n) || ie(e.to, s, n) : !1))
|
|
3213
|
-
return !0;
|
|
3214
|
-
const i = r.filter((s) => typeof s == "function");
|
|
3215
|
-
if (i.length) {
|
|
3216
|
-
let s = e.from;
|
|
3217
|
-
const u = n.differenceInCalendarDays(e.to, e.from);
|
|
3218
|
-
for (let c = 0; c <= u; c++) {
|
|
3219
|
-
if (i.some((d) => d(s)))
|
|
3220
|
-
return !0;
|
|
3221
|
-
s = n.addDays(s, 1);
|
|
3222
|
-
}
|
|
3223
|
-
}
|
|
3224
|
-
return !1;
|
|
3225
|
-
}
|
|
3226
|
-
function xs(e, t) {
|
|
3227
|
-
const { disabled: n, excludeDisabled: r, resetOnSelect: o, selected: a, required: i, onSelect: s } = e, [u, c] = Te(a, s ? a : void 0), d = s ? a : u;
|
|
3228
|
-
return {
|
|
3229
|
-
selected: d,
|
|
3230
|
-
select: (m, v, W) => {
|
|
3231
|
-
const { min: O, max: Y } = e;
|
|
3232
|
-
let M;
|
|
3233
|
-
if (m) {
|
|
3234
|
-
const p = d?.from, k = d?.to, b = !!p && !!k, y = !!p && !!k && t.isSameDay(p, k) && t.isSameDay(m, p);
|
|
3235
|
-
o && (b || !d?.from) ? !i && y ? M = void 0 : M = { from: m, to: void 0 } : M = Ns(m, d, O, Y, i, t);
|
|
3236
|
-
}
|
|
3237
|
-
return r && n && M?.from && M.to && Cs({ from: M.from, to: M.to }, n, t) && (M.from = m, M.to = void 0), s || c(M), s?.(M, m, v, W), M;
|
|
3238
|
-
},
|
|
3239
|
-
isSelected: (m) => d && se(d, m, !1, t)
|
|
3240
|
-
};
|
|
3241
|
-
}
|
|
3242
|
-
function Ps(e, t) {
|
|
3243
|
-
const { selected: n, required: r, onSelect: o } = e, [a, i] = Te(n, o ? n : void 0), s = o ? n : a, { isSameDay: u } = t;
|
|
3244
|
-
return {
|
|
3245
|
-
selected: s,
|
|
3246
|
-
select: (l, f, m) => {
|
|
3247
|
-
let v = l;
|
|
3248
|
-
return !r && s && s && u(l, s) && (v = void 0), o || i(v), o?.(v, l, f, m), v;
|
|
3249
|
-
},
|
|
3250
|
-
isSelected: (l) => s ? u(s, l) : !1
|
|
3251
|
-
};
|
|
3252
|
-
}
|
|
3253
|
-
function Ys(e, t) {
|
|
3254
|
-
const n = Ps(e, t), r = Ws(e, t), o = xs(e, t);
|
|
3255
|
-
switch (e.mode) {
|
|
3256
|
-
case "single":
|
|
3257
|
-
return n;
|
|
3258
|
-
case "multiple":
|
|
3259
|
-
return r;
|
|
3260
|
-
case "range":
|
|
3261
|
-
return o;
|
|
3262
|
-
default:
|
|
3263
|
-
return;
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
function X(e, t) {
|
|
3267
|
-
return e instanceof H && e.timeZone === t ? e : new H(e, t);
|
|
3268
|
-
}
|
|
3269
|
-
function ge(e, t, n) {
|
|
3270
|
-
return X(e, t);
|
|
3271
|
-
}
|
|
3272
|
-
function _t(e, t, n) {
|
|
3273
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? ge(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? ge(r, t) : r) : _e(e) ? {
|
|
3274
|
-
...e,
|
|
3275
|
-
from: e.from ? X(e.from, t) : e.from,
|
|
3276
|
-
to: e.to ? X(e.to, t) : e.to
|
|
3277
|
-
} : rt(e) ? {
|
|
3278
|
-
before: ge(e.before, t),
|
|
3279
|
-
after: ge(e.after, t)
|
|
3280
|
-
} : ot(e) ? {
|
|
3281
|
-
after: ge(e.after, t)
|
|
3282
|
-
} : at(e) ? {
|
|
3283
|
-
before: ge(e.before, t)
|
|
3284
|
-
} : e;
|
|
3285
|
-
}
|
|
3286
|
-
function Xe(e, t, n) {
|
|
3287
|
-
return e && (Array.isArray(e) ? e.map((r) => _t(r, t)) : _t(e, t));
|
|
3288
|
-
}
|
|
3289
|
-
function _s(e) {
|
|
3290
|
-
let t = e;
|
|
3291
|
-
const n = t.timeZone;
|
|
3292
|
-
if (n && (t = {
|
|
3293
|
-
...e,
|
|
3294
|
-
timeZone: n
|
|
3295
|
-
}, t.today && (t.today = X(t.today, n)), t.month && (t.month = X(t.month, n)), t.defaultMonth && (t.defaultMonth = X(t.defaultMonth, n)), t.startMonth && (t.startMonth = X(t.startMonth, n)), t.endMonth && (t.endMonth = X(t.endMonth, n)), t.mode === "single" && t.selected ? t.selected = X(t.selected, n) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((D) => X(D, n)) : t.mode === "range" && t.selected && (t.selected = {
|
|
3296
|
-
from: t.selected.from ? X(t.selected.from, n) : t.selected.from,
|
|
3297
|
-
to: t.selected.to ? X(t.selected.to, n) : t.selected.to
|
|
3298
|
-
}), t.disabled !== void 0 && (t.disabled = Xe(t.disabled, n)), t.hidden !== void 0 && (t.hidden = Xe(t.hidden, n)), t.modifiers)) {
|
|
3299
|
-
const D = {};
|
|
3300
|
-
Object.keys(t.modifiers).forEach((P) => {
|
|
3301
|
-
D[P] = Xe(t.modifiers?.[P], n);
|
|
3302
|
-
}), t.modifiers = D;
|
|
3303
|
-
}
|
|
3304
|
-
const { components: r, formatters: o, labels: a, dateLib: i, locale: s, classNames: u } = Ye(() => {
|
|
3305
|
-
const D = { ...nt, ...t.locale }, P = t.broadcastCalendar ? 1 : t.weekStartsOn, w = t.noonSafe && t.timeZone ? us(t.timeZone, {
|
|
3306
|
-
weekStartsOn: P,
|
|
3307
|
-
locale: D
|
|
3308
|
-
}) : void 0, x = t.dateLib && w ? { ...w, ...t.dateLib } : t.dateLib ?? w, q = new $({
|
|
3309
|
-
locale: D,
|
|
3310
|
-
weekStartsOn: P,
|
|
3311
|
-
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
3312
|
-
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
3313
|
-
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
3314
|
-
timeZone: t.timeZone,
|
|
3315
|
-
numerals: t.numerals
|
|
3316
|
-
}, x);
|
|
3317
|
-
return {
|
|
3318
|
-
dateLib: q,
|
|
3319
|
-
components: qa(t.components),
|
|
3320
|
-
formatters: Ja(t.formatters),
|
|
3321
|
-
labels: rs(t.labels, q.options),
|
|
3322
|
-
locale: D,
|
|
3323
|
-
classNames: { ...st(), ...t.classNames }
|
|
3324
|
-
};
|
|
3325
|
-
}, [
|
|
3326
|
-
t.locale,
|
|
3327
|
-
t.broadcastCalendar,
|
|
3328
|
-
t.weekStartsOn,
|
|
3329
|
-
t.firstWeekContainsDate,
|
|
3330
|
-
t.useAdditionalWeekYearTokens,
|
|
3331
|
-
t.useAdditionalDayOfYearTokens,
|
|
3332
|
-
t.timeZone,
|
|
3333
|
-
t.numerals,
|
|
3334
|
-
t.dateLib,
|
|
3335
|
-
t.noonSafe,
|
|
3336
|
-
t.components,
|
|
3337
|
-
t.formatters,
|
|
3338
|
-
t.labels,
|
|
3339
|
-
t.classNames
|
|
3340
|
-
]);
|
|
3341
|
-
t.today || (t = { ...t, today: i.today() });
|
|
3342
|
-
const { captionLayout: c, mode: d, navLayout: l, numberOfMonths: f = 1, onDayBlur: m, onDayClick: v, onDayFocus: W, onDayKeyDown: O, onDayMouseEnter: Y, onDayMouseLeave: M, onNextClick: p, onPrevClick: k, showWeekNumber: b, styles: y } = t, { formatCaption: N, formatDay: E, formatMonthDropdown: I, formatWeekNumber: B, formatWeekNumberHeader: J, formatWeekdayName: ue, formatYearDropdown: oe } = o, j = Ms(t, i), { days: me, months: Se, navStart: Ee, navEnd: Fe, previousMonth: Q, nextMonth: U, goToMonth: ae } = j, Be = Ha(me, t, Ee, Fe, i), { isSelected: Ge, select: Ie, selected: Ce } = Ys(t, i) ?? {}, { blur: ct, focused: lt, isFocusTarget: fn, moveFocus: dt, setFocused: xe } = Os(t, j, Be, Ge ?? (() => !1), i), { labelDayButton: hn, labelGridcell: mn, labelGrid: yn, labelMonthDropdown: gn, labelNav: ft, labelPrevious: bn, labelNext: pn, labelWeekday: wn, labelWeekNumber: vn, labelWeekNumberHeader: Mn, labelYearDropdown: kn } = a, Dn = Ye(() => ss(i, t.ISOWeek, t.broadcastCalendar, t.today), [i, t.ISOWeek, t.broadcastCalendar, t.today]), ht = d !== void 0 || v !== void 0, $e = V(() => {
|
|
3343
|
-
Q && (ae(Q), k?.(Q));
|
|
3344
|
-
}, [Q, ae, k]), He = V(() => {
|
|
3345
|
-
U && (ae(U), p?.(U));
|
|
3346
|
-
}, [ae, U, p]), On = V((D, P) => (w) => {
|
|
3347
|
-
w.preventDefault(), w.stopPropagation(), xe(D), !P.disabled && (Ie?.(D.date, P, w), v?.(D.date, P, w));
|
|
3348
|
-
}, [Ie, v, xe]), Wn = V((D, P) => (w) => {
|
|
3349
|
-
xe(D), W?.(D.date, P, w);
|
|
3350
|
-
}, [W, xe]), Nn = V((D, P) => (w) => {
|
|
3351
|
-
ct(), m?.(D.date, P, w);
|
|
3352
|
-
}, [ct, m]), Sn = V((D, P) => (w) => {
|
|
3353
|
-
const x = {
|
|
3354
|
-
ArrowLeft: [
|
|
3355
|
-
w.shiftKey ? "month" : "day",
|
|
3356
|
-
t.dir === "rtl" ? "after" : "before"
|
|
3357
|
-
],
|
|
3358
|
-
ArrowRight: [
|
|
3359
|
-
w.shiftKey ? "month" : "day",
|
|
3360
|
-
t.dir === "rtl" ? "before" : "after"
|
|
3361
|
-
],
|
|
3362
|
-
ArrowDown: [w.shiftKey ? "year" : "week", "after"],
|
|
3363
|
-
ArrowUp: [w.shiftKey ? "year" : "week", "before"],
|
|
3364
|
-
PageUp: [w.shiftKey ? "year" : "month", "before"],
|
|
3365
|
-
PageDown: [w.shiftKey ? "year" : "month", "after"],
|
|
3366
|
-
Home: ["startOfWeek", "before"],
|
|
3367
|
-
End: ["endOfWeek", "after"]
|
|
3368
|
-
};
|
|
3369
|
-
if (x[w.key]) {
|
|
3370
|
-
w.preventDefault(), w.stopPropagation();
|
|
3371
|
-
const [q, S] = x[w.key];
|
|
3372
|
-
dt(q, S);
|
|
3373
|
-
}
|
|
3374
|
-
O?.(D.date, P, w);
|
|
3375
|
-
}, [dt, O, t.dir]), Cn = V((D, P) => (w) => {
|
|
3376
|
-
Y?.(D.date, P, w);
|
|
3377
|
-
}, [Y]), xn = V((D, P) => (w) => {
|
|
3378
|
-
M?.(D.date, P, w);
|
|
3379
|
-
}, [M]), Pn = V((D) => (P) => {
|
|
3380
|
-
const w = Number(P.target.value), x = i.setMonth(i.startOfMonth(D), w);
|
|
3381
|
-
ae(x);
|
|
3382
|
-
}, [i, ae]), Yn = V((D) => (P) => {
|
|
3383
|
-
const w = Number(P.target.value), x = i.setYear(i.startOfMonth(D), w);
|
|
3384
|
-
ae(x);
|
|
3385
|
-
}, [i, ae]), { className: _n, style: Tn } = Ye(() => ({
|
|
3386
|
-
className: [u[g.Root], t.className].filter(Boolean).join(" "),
|
|
3387
|
-
style: { ...y?.[g.Root], ...t.style }
|
|
3388
|
-
}), [u, t.className, t.style, y]), En = za(t), mt = Pe(null);
|
|
3389
|
-
fs(mt, !!t.animate, {
|
|
3390
|
-
classNames: u,
|
|
3391
|
-
months: Se,
|
|
3392
|
-
focused: lt,
|
|
3393
|
-
dateLib: i
|
|
3394
|
-
});
|
|
3395
|
-
const Fn = {
|
|
3396
|
-
dayPickerProps: t,
|
|
3397
|
-
selected: Ce,
|
|
3398
|
-
select: Ie,
|
|
3399
|
-
isSelected: Ge,
|
|
3400
|
-
months: Se,
|
|
3401
|
-
nextMonth: U,
|
|
3402
|
-
previousMonth: Q,
|
|
3403
|
-
goToMonth: ae,
|
|
3404
|
-
getModifiers: Be,
|
|
3405
|
-
components: r,
|
|
3406
|
-
classNames: u,
|
|
3407
|
-
styles: y,
|
|
3408
|
-
labels: a,
|
|
3409
|
-
formatters: o
|
|
3410
|
-
};
|
|
3411
|
-
return h.createElement(
|
|
3412
|
-
Kt.Provider,
|
|
3413
|
-
{ value: Fn },
|
|
3414
|
-
h.createElement(
|
|
3415
|
-
r.Root,
|
|
3416
|
-
{ rootRef: t.animate ? mt : void 0, className: _n, style: Tn, dir: t.dir, id: t.id, lang: t.lang ?? s.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...En },
|
|
3417
|
-
h.createElement(
|
|
3418
|
-
r.Months,
|
|
3419
|
-
{ className: u[g.Months], style: y?.[g.Months] },
|
|
3420
|
-
!t.hideNavigation && !l && h.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: u[g.Nav], style: y?.[g.Nav], "aria-label": ft(), onPreviousClick: $e, onNextClick: He, previousMonth: Q, nextMonth: U }),
|
|
3421
|
-
Se.map((D, P) => h.createElement(
|
|
3422
|
-
r.Month,
|
|
3423
|
-
{
|
|
3424
|
-
"data-animated-month": t.animate ? "true" : void 0,
|
|
3425
|
-
className: u[g.Month],
|
|
3426
|
-
style: y?.[g.Month],
|
|
3427
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
3428
|
-
key: P,
|
|
3429
|
-
displayIndex: P,
|
|
3430
|
-
calendarMonth: D
|
|
3431
|
-
},
|
|
3432
|
-
l === "around" && !t.hideNavigation && P === 0 && h.createElement(
|
|
3433
|
-
r.PreviousMonthButton,
|
|
3434
|
-
{ type: "button", className: u[g.PreviousMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": bn(Q), onClick: $e, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3435
|
-
h.createElement(r.Chevron, { disabled: Q ? void 0 : !0, className: u[g.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
3436
|
-
),
|
|
3437
|
-
h.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: u[g.MonthCaption], style: y?.[g.MonthCaption], calendarMonth: D, displayIndex: P }, c?.startsWith("dropdown") ? h.createElement(
|
|
3438
|
-
r.DropdownNav,
|
|
3439
|
-
{ className: u[g.Dropdowns], style: y?.[g.Dropdowns] },
|
|
3440
|
-
(() => {
|
|
3441
|
-
const w = c === "dropdown" || c === "dropdown-months" ? h.createElement(r.MonthsDropdown, { key: "month", className: u[g.MonthsDropdown], "aria-label": gn(), classNames: u, components: r, disabled: !!t.disableNavigation, onChange: Pn(D.date), options: os(D.date, Ee, Fe, o, i), style: y?.[g.Dropdown], value: i.getMonth(D.date) }) : h.createElement("span", { key: "month" }, I(D.date, i)), x = c === "dropdown" || c === "dropdown-years" ? h.createElement(r.YearsDropdown, { key: "year", className: u[g.YearsDropdown], "aria-label": kn(i.options), classNames: u, components: r, disabled: !!t.disableNavigation, onChange: Yn(D.date), options: is(Ee, Fe, o, i, !!t.reverseYears), style: y?.[g.Dropdown], value: i.getYear(D.date) }) : h.createElement("span", { key: "year" }, oe(D.date, i));
|
|
3442
|
-
return i.getMonthYearOrder() === "year-first" ? [x, w] : [w, x];
|
|
3443
|
-
})(),
|
|
3444
|
-
h.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
3445
|
-
border: 0,
|
|
3446
|
-
clip: "rect(0 0 0 0)",
|
|
3447
|
-
height: "1px",
|
|
3448
|
-
margin: "-1px",
|
|
3449
|
-
overflow: "hidden",
|
|
3450
|
-
padding: 0,
|
|
3451
|
-
position: "absolute",
|
|
3452
|
-
width: "1px",
|
|
3453
|
-
whiteSpace: "nowrap",
|
|
3454
|
-
wordWrap: "normal"
|
|
3455
|
-
} }, N(D.date, i.options, i))
|
|
3456
|
-
) : h.createElement(r.CaptionLabel, { className: u[g.CaptionLabel], role: "status", "aria-live": "polite" }, N(D.date, i.options, i))),
|
|
3457
|
-
l === "around" && !t.hideNavigation && P === f - 1 && h.createElement(
|
|
3458
|
-
r.NextMonthButton,
|
|
3459
|
-
{ type: "button", className: u[g.NextMonthButton], tabIndex: U ? void 0 : -1, "aria-disabled": U ? void 0 : !0, "aria-label": pn(U), onClick: He, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3460
|
-
h.createElement(r.Chevron, { disabled: U ? void 0 : !0, className: u[g.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
3461
|
-
),
|
|
3462
|
-
P === f - 1 && l === "after" && !t.hideNavigation && h.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: u[g.Nav], style: y?.[g.Nav], "aria-label": ft(), onPreviousClick: $e, onNextClick: He, previousMonth: Q, nextMonth: U }),
|
|
3463
|
-
h.createElement(
|
|
3464
|
-
r.MonthGrid,
|
|
3465
|
-
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": yn(D.date, i.options, i) || void 0, className: u[g.MonthGrid], style: y?.[g.MonthGrid] },
|
|
3466
|
-
!t.hideWeekdays && h.createElement(
|
|
3467
|
-
r.Weekdays,
|
|
3468
|
-
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: u[g.Weekdays], style: y?.[g.Weekdays] },
|
|
3469
|
-
b && h.createElement(r.WeekNumberHeader, { "aria-label": Mn(i.options), className: u[g.WeekNumberHeader], style: y?.[g.WeekNumberHeader], scope: "col" }, J()),
|
|
3470
|
-
Dn.map((w) => h.createElement(r.Weekday, { "aria-label": wn(w, i.options, i), className: u[g.Weekday], key: String(w), style: y?.[g.Weekday], scope: "col" }, ue(w, i.options, i)))
|
|
3471
|
-
),
|
|
3472
|
-
h.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: u[g.Weeks], style: y?.[g.Weeks] }, D.weeks.map((w) => h.createElement(
|
|
3473
|
-
r.Week,
|
|
3474
|
-
{ className: u[g.Week], key: w.weekNumber, style: y?.[g.Week], week: w },
|
|
3475
|
-
b && h.createElement(r.WeekNumber, { week: w, style: y?.[g.WeekNumber], "aria-label": vn(w.weekNumber, {
|
|
3476
|
-
locale: s
|
|
3477
|
-
}), className: u[g.WeekNumber], scope: "row", role: "rowheader" }, B(w.weekNumber, i)),
|
|
3478
|
-
w.days.map((x) => {
|
|
3479
|
-
const { date: q } = x, S = Be(x);
|
|
3480
|
-
if (S[F.focused] = !S.hidden && !!lt?.isEqualTo(x), S[Z.selected] = Ge?.(q) || S.selected, _e(Ce)) {
|
|
3481
|
-
const { from: Ae, to: qe } = Ce;
|
|
3482
|
-
S[Z.range_start] = !!(Ae && qe && i.isSameDay(q, Ae)), S[Z.range_end] = !!(Ae && qe && i.isSameDay(q, qe)), S[Z.range_middle] = se(Ce, q, !0, i);
|
|
3483
|
-
}
|
|
3484
|
-
const Bn = as(S, y, t.modifiersStyles), Gn = Aa(S, u, t.modifiersClassNames), In = !ht && !S.hidden ? mn(q, S, i.options, i) : void 0;
|
|
3485
|
-
return h.createElement(r.Day, { key: `${x.isoDate}_${x.displayMonthId}`, day: x, modifiers: S, className: Gn.join(" "), style: Bn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": In, "data-day": x.isoDate, "data-month": x.outside ? x.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": x.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && ht ? h.createElement(r.DayButton, { className: u[g.DayButton], style: y?.[g.DayButton], type: "button", day: x, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: fn(x) ? 0 : -1, "aria-label": hn(q, S, i.options, i), onClick: On(x, S), onBlur: Nn(x, S), onFocus: Wn(x, S), onKeyDown: Sn(x, S), onMouseEnter: Cn(x, S), onMouseLeave: xn(x, S) }, E(q, i.options, i)) : !S.hidden && E(x.date, i.options, i));
|
|
3486
|
-
})
|
|
3487
|
-
)))
|
|
3488
|
-
)
|
|
3489
|
-
))
|
|
3490
|
-
),
|
|
3491
|
-
t.footer && h.createElement(r.Footer, { className: u[g.Footer], style: y?.[g.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
3492
|
-
)
|
|
3493
|
-
);
|
|
3494
|
-
}
|
|
3495
|
-
const Ts = {
|
|
3496
|
-
...la,
|
|
3497
|
-
labels: {
|
|
3498
|
-
labelDayButton: (e, t, n, r) => {
|
|
3499
|
-
let a = (r ?? new $(n)).format(e, "PPPP");
|
|
3500
|
-
return t.today && (a = `Сегодня, ${a}`), t.selected && (a = `${a}, выбрано`), a;
|
|
3501
|
-
},
|
|
3502
|
-
labelMonthDropdown: "Выберите месяц",
|
|
3503
|
-
labelNext: "Перейти к следующему месяцу",
|
|
3504
|
-
labelPrevious: "Перейти к предыдущему месяцу",
|
|
3505
|
-
labelWeekNumber: (e) => `Неделя ${e}`,
|
|
3506
|
-
labelYearDropdown: "Выберите год",
|
|
3507
|
-
labelGrid: (e, t, n) => (n ?? new $(t)).formatMonthYear(e),
|
|
3508
|
-
labelGridcell: (e, t, n, r) => {
|
|
3509
|
-
let a = (r ?? new $(n)).format(e, "PPPP");
|
|
3510
|
-
return t?.today && (a = `Сегодня, ${a}`), a;
|
|
3511
|
-
},
|
|
3512
|
-
labelNav: "Панель навигации",
|
|
3513
|
-
labelWeekNumberHeader: "Номер недели",
|
|
3514
|
-
labelWeekday: (e, t, n) => (n ?? new $(t)).format(e, "cccc")
|
|
3515
|
-
}
|
|
3516
|
-
}, js = {
|
|
3517
|
-
ru: Ts,
|
|
3518
|
-
es: nt
|
|
3519
|
-
};
|
|
3520
|
-
function Rs({
|
|
3521
|
-
className: e,
|
|
3522
|
-
classNames: t,
|
|
3523
|
-
classNameWrapper: n,
|
|
3524
|
-
classNameFooter: r,
|
|
3525
|
-
showOutsideDays: o = !0,
|
|
3526
|
-
captionLayout: a = "label",
|
|
3527
|
-
buttonVariant: i = "ghost",
|
|
3528
|
-
locale: s,
|
|
3529
|
-
formatters: u,
|
|
3530
|
-
components: c,
|
|
3531
|
-
footer: d,
|
|
3532
|
-
...l
|
|
3533
|
-
}) {
|
|
3534
|
-
const f = st();
|
|
3535
|
-
return /* @__PURE__ */ $n(
|
|
3536
|
-
Rn,
|
|
3537
|
-
{
|
|
3538
|
-
className: C(
|
|
3539
|
-
"border-delicate-border bg-[rgba(0, 0, 0, 0.15)] rounded-[7.35px] border",
|
|
3540
|
-
n
|
|
3541
|
-
),
|
|
3542
|
-
children: [
|
|
3543
|
-
/* @__PURE__ */ R(Vn, { children: /* @__PURE__ */ R(
|
|
3544
|
-
_s,
|
|
3545
|
-
{
|
|
3546
|
-
showOutsideDays: o,
|
|
3547
|
-
className: C(
|
|
3548
|
-
`group/calendar w-full [--cell-radius:var(--radius-md)]
|
|
3549
|
-
[--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent
|
|
3550
|
-
in-data-[slot=popover-content]:bg-transparent`,
|
|
3551
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
3552
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
3553
|
-
e
|
|
3554
|
-
),
|
|
3555
|
-
captionLayout: a,
|
|
3556
|
-
locale: s,
|
|
3557
|
-
formatters: {
|
|
3558
|
-
formatMonthDropdown: (m) => m.toLocaleString(s?.code, { month: "short" }),
|
|
3559
|
-
...u
|
|
3560
|
-
},
|
|
3561
|
-
classNames: {
|
|
3562
|
-
root: C("w-fit", f.root),
|
|
3563
|
-
months: C(
|
|
3564
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
3565
|
-
f.months
|
|
3566
|
-
),
|
|
3567
|
-
month: C("flex w-full flex-col gap-4", f.month),
|
|
3568
|
-
nav: C(
|
|
3569
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
3570
|
-
f.nav
|
|
3571
|
-
),
|
|
3572
|
-
button_previous: C(
|
|
3573
|
-
gt({ variant: i }),
|
|
3574
|
-
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
3575
|
-
f.button_previous
|
|
3576
|
-
),
|
|
3577
|
-
button_next: C(
|
|
3578
|
-
gt({ variant: i }),
|
|
3579
|
-
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
3580
|
-
f.button_next
|
|
3581
|
-
),
|
|
3582
|
-
month_caption: C(
|
|
3583
|
-
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
3584
|
-
f.month_caption
|
|
3585
|
-
),
|
|
3586
|
-
dropdowns: C(
|
|
3587
|
-
`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm
|
|
3588
|
-
font-medium`,
|
|
3589
|
-
f.dropdowns
|
|
3590
|
-
),
|
|
3591
|
-
dropdown_root: C(
|
|
3592
|
-
"cn-calendar-dropdown-root relative rounded-(--cell-radius)",
|
|
3593
|
-
f.dropdown_root
|
|
3594
|
-
),
|
|
3595
|
-
dropdown: C(
|
|
3596
|
-
"bg-popover absolute inset-0 opacity-0",
|
|
3597
|
-
f.dropdown
|
|
3598
|
-
),
|
|
3599
|
-
caption_label: C(
|
|
3600
|
-
"font-medium select-none",
|
|
3601
|
-
a === "label" ? "text-sm" : `cn-calendar-caption-label [&>svg]:text-muted-foreground flex
|
|
3602
|
-
items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5`,
|
|
3603
|
-
f.caption_label
|
|
3604
|
-
),
|
|
3605
|
-
table: "w-full border-collapse",
|
|
3606
|
-
weekdays: C("flex", f.weekdays),
|
|
3607
|
-
weekday: C(
|
|
3608
|
-
`text-muted-foreground flex-1 rounded-(--cell-radius) text-[0.8rem]
|
|
3609
|
-
font-normal select-none`,
|
|
3610
|
-
f.weekday
|
|
3611
|
-
),
|
|
3612
|
-
week: C("mt-2 flex w-full", f.week),
|
|
3613
|
-
week_number_header: C(
|
|
3614
|
-
"w-(--cell-size) select-none",
|
|
3615
|
-
f.week_number_header
|
|
3616
|
-
),
|
|
3617
|
-
week_number: C(
|
|
3618
|
-
"text-muted-foreground text-[0.8rem] select-none",
|
|
3619
|
-
f.week_number
|
|
3620
|
-
),
|
|
3621
|
-
day: C(
|
|
3622
|
-
`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0
|
|
3623
|
-
text-center select-none
|
|
3624
|
-
[&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,
|
|
3625
|
-
l.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
|
|
3626
|
-
f.day
|
|
3627
|
-
),
|
|
3628
|
-
range_start: C(
|
|
3629
|
-
`bg-muted after:bg-muted relative isolate z-0 rounded-l-(--cell-radius)
|
|
3630
|
-
after:absolute after:inset-y-0 after:right-0 after:w-4`,
|
|
3631
|
-
f.range_start
|
|
3632
|
-
),
|
|
3633
|
-
range_middle: C("rounded-none", f.range_middle),
|
|
3634
|
-
range_end: C(
|
|
3635
|
-
`bg-muted after:bg-muted relative isolate z-0 rounded-r-(--cell-radius)
|
|
3636
|
-
after:absolute after:inset-y-0 after:left-0 after:w-4`,
|
|
3637
|
-
f.range_end
|
|
3638
|
-
),
|
|
3639
|
-
today: C(
|
|
3640
|
-
`bg-muted text-foreground rounded-(--cell-radius)
|
|
3641
|
-
data-[selected=true]:rounded-none`,
|
|
3642
|
-
f.today
|
|
3643
|
-
),
|
|
3644
|
-
outside: C(
|
|
3645
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
3646
|
-
f.outside
|
|
3647
|
-
),
|
|
3648
|
-
disabled: C("text-muted-foreground opacity-50", f.disabled),
|
|
3649
|
-
hidden: C("invisible", f.hidden),
|
|
3650
|
-
...t
|
|
3651
|
-
},
|
|
3652
|
-
components: {
|
|
3653
|
-
Root: ({ className: m, rootRef: v, ...W }) => /* @__PURE__ */ R(
|
|
3654
|
-
"div",
|
|
3655
|
-
{
|
|
3656
|
-
"data-slot": "calendar",
|
|
3657
|
-
ref: v,
|
|
3658
|
-
className: C(m),
|
|
3659
|
-
...W
|
|
3660
|
-
}
|
|
3661
|
-
),
|
|
3662
|
-
Chevron: ({ className: m, orientation: v, ...W }) => v === "left" ? /* @__PURE__ */ R(
|
|
3663
|
-
or,
|
|
3664
|
-
{
|
|
3665
|
-
className: C("cn-rtl-flip size-4", m),
|
|
3666
|
-
...W
|
|
3667
|
-
}
|
|
3668
|
-
) : v === "right" ? /* @__PURE__ */ R(
|
|
3669
|
-
sr,
|
|
3670
|
-
{
|
|
3671
|
-
className: C("cn-rtl-flip size-4", m),
|
|
3672
|
-
...W
|
|
3673
|
-
}
|
|
3674
|
-
) : /* @__PURE__ */ R(
|
|
3675
|
-
nr,
|
|
3676
|
-
{
|
|
3677
|
-
className: C("size-4", m),
|
|
3678
|
-
...W
|
|
3679
|
-
}
|
|
3680
|
-
),
|
|
3681
|
-
DayButton: ({ ...m }) => /* @__PURE__ */ R(
|
|
3682
|
-
Es,
|
|
3683
|
-
{
|
|
3684
|
-
locale: s,
|
|
3685
|
-
...m
|
|
3686
|
-
}
|
|
3687
|
-
),
|
|
3688
|
-
WeekNumber: ({ children: m, ...v }) => /* @__PURE__ */ R("td", { ...v, children: /* @__PURE__ */ R(
|
|
3689
|
-
"div",
|
|
3690
|
-
{
|
|
3691
|
-
className: `flex size-(--cell-size) items-center justify-center
|
|
3692
|
-
text-center`,
|
|
3693
|
-
children: m
|
|
3694
|
-
}
|
|
3695
|
-
) }),
|
|
3696
|
-
...c
|
|
3697
|
-
},
|
|
3698
|
-
...l
|
|
3699
|
-
}
|
|
3700
|
-
) }),
|
|
3701
|
-
d && /* @__PURE__ */ R(
|
|
3702
|
-
Xn,
|
|
3703
|
-
{
|
|
3704
|
-
className: C(
|
|
3705
|
-
"border-delicate-border mx-6 flex flex-wrap gap-2 border-t pt-3",
|
|
3706
|
-
r
|
|
3707
|
-
),
|
|
3708
|
-
children: d
|
|
3709
|
-
}
|
|
3710
|
-
)
|
|
3711
|
-
]
|
|
3712
|
-
}
|
|
3713
|
-
);
|
|
3714
|
-
}
|
|
3715
|
-
function Es({
|
|
3716
|
-
className: e,
|
|
3717
|
-
day: t,
|
|
3718
|
-
modifiers: n,
|
|
3719
|
-
locale: r,
|
|
3720
|
-
children: o,
|
|
3721
|
-
...a
|
|
3722
|
-
}) {
|
|
3723
|
-
const i = st(), s = yt.useRef(null);
|
|
3724
|
-
yt.useEffect(() => {
|
|
3725
|
-
n.focused && s.current?.focus();
|
|
3726
|
-
}, [n.focused]);
|
|
3727
|
-
const u = () => n.range_start ? "start" : n.range_end ? "end" : n.range_middle ? "middle" : n.selected && !n.range_start && !n.range_end && !n.range_middle ? "single" : "none";
|
|
3728
|
-
return /* @__PURE__ */ R(
|
|
3729
|
-
jn,
|
|
3730
|
-
{
|
|
3731
|
-
ref: s,
|
|
3732
|
-
variant: "ghost",
|
|
3733
|
-
size: "sm",
|
|
3734
|
-
"data-day": t.date.toLocaleDateString(r?.code),
|
|
3735
|
-
"data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
|
|
3736
|
-
"data-range-start": n.range_start,
|
|
3737
|
-
"data-range-end": n.range_end,
|
|
3738
|
-
"data-range-middle": n.range_middle,
|
|
3739
|
-
className: C(
|
|
3740
|
-
Un({ rangeType: u() }),
|
|
3741
|
-
i.day,
|
|
3742
|
-
e
|
|
3743
|
-
),
|
|
3744
|
-
...a,
|
|
3745
|
-
children: /* @__PURE__ */ R(
|
|
3746
|
-
Qn,
|
|
3747
|
-
{
|
|
3748
|
-
variant: "body-xxs-regular",
|
|
3749
|
-
className: "leading-none",
|
|
3750
|
-
children: o
|
|
3751
|
-
}
|
|
3752
|
-
)
|
|
3753
|
-
}
|
|
3754
|
-
);
|
|
3755
|
-
}
|
|
10
|
+
import "./components-ui-calendar-calendar.styles.js";
|
|
11
|
+
import { C as l, f as s } from "./calendar-C0DXP3T-.js";
|
|
3756
12
|
export {
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
js as localeMode
|
|
13
|
+
l as Calendar,
|
|
14
|
+
s as CalendarDayButton
|
|
3760
15
|
};
|
|
3761
16
|
//# sourceMappingURL=components-ui-calendar-calendar.js.map
|