@oneclick.dev/cms-core-modules 0.0.102 → 0.0.103
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/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
- package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
- package/dist/AppointmentListTable-Dieu9US_.js +1 -0
- package/dist/{ContentEditor-Cjqgb64R.mjs → ContentEditor-B1nfKG_5.mjs} +706 -677
- package/dist/{ContentEditor-YgOS3kxS.js → ContentEditor-DdFU8piH.js} +15 -16
- package/dist/{Create-6uT9HWar.mjs → Create-BRBh0xjM.mjs} +2 -2
- package/dist/{Create-DuZ5nZrX.js → Create-qPeQxkdl.js} +1 -1
- package/dist/{DateFormatter-2B0R-DY4.mjs → DateFormatter-Bw-87W31.mjs} +212 -227
- package/dist/DateFormatter-CYAD4GBN.js +1 -0
- package/dist/{Detail-BZ-iE9vf.js → Detail-C857g62L.js} +1 -1
- package/dist/{Detail-CJVMJDP7.mjs → Detail-CujdFApD.mjs} +2 -2
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
- package/dist/{Entries-DkRhOt95.js → Entries-BaS6H6ak.js} +1 -1
- package/dist/{Entries-dLlCrXXe.mjs → Entries-C8UJkrVC.mjs} +1 -1
- package/dist/{Find-Bd1uLqSa.mjs → Find-B24ZEhYM.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs} +37 -37
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js} +1 -1
- package/dist/{Overview-DoOASlNz.mjs → Overview-3HWhsqaz.mjs} +2 -2
- package/dist/{Overview-37nilXzE.js → Overview-CpHhuiaV.js} +1 -1
- package/dist/{Overview-DeQQ0FY3.js → Overview-DAxCu9XC.js} +1 -1
- package/dist/{Overview-C--dq51X.mjs → Overview-D_T3K6aq.mjs} +1 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +2927 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +349 -0
- package/dist/TableView-CPAw3h8g.js +4 -0
- package/dist/TableView-DXmEF6pY.mjs +6143 -0
- package/dist/agenda-BNG05SAq.js +1 -0
- package/dist/agenda-D1RxMxBS.mjs +1152 -0
- package/dist/availability-CMrRa5y2.mjs +269 -0
- package/dist/availability-Cf2YfMwM.js +1 -0
- package/dist/booking-data-DgJd0BcM.mjs +889 -0
- package/dist/booking-data-Di5GmH_8.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-Bp5BSvxO.js → exceptions-CI0B4xVj.js} +1 -1
- package/dist/{exceptions-C97cNZYl.mjs → exceptions-vo8SA5SE.mjs} +68 -68
- package/dist/index-BtujSJeg.js +35 -0
- package/dist/{index-CrGjxSwa.mjs → index-CrgzoTyR.mjs} +1 -1
- package/dist/{index-D2a6wEPh.js → index-DPd3waTN.js} +1 -1
- package/dist/{index-CABh6Qn6.mjs → index-DrXxXB2F.mjs} +15 -15
- package/dist/{index-B-lVEpFX.mjs → index-MYWjg0zi.mjs} +3 -3
- package/dist/index-dOdMm1pV.mjs +1105 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +196 -143
- package/dist/interpolation-DEDSLETn.mjs +128 -0
- package/dist/interpolation-DERg6Lwt.js +1 -0
- package/dist/orders-CzzcFQha.mjs +559 -0
- package/dist/orders-ETtbA4aQ.js +1 -0
- package/dist/{payment-Bosr0m3u.mjs → payment-C3ohkehF.mjs} +1 -1
- package/dist/{payment-DDnC03jb.js → payment-Dfr-Ro-a.js} +1 -1
- package/dist/{resources-BtF5RUUq.js → resources-CxeFd57z.js} +1 -1
- package/dist/{resources-B7qDBC91.mjs → resources-WI_4SO6T.mjs} +2 -2
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +457 -387
- package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
- package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +17 -5
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +1 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -3
- package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +3 -0
- package/dist/src/appointments/components/edit/EventView.vue.d.ts +6 -1
- package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
- package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/index.d.ts +53 -0
- package/dist/src/appointments/pages/edit/agenda.vue.d.ts +3 -1
- package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -26
- package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +7 -3
- package/dist/src/appointments/tools.d.ts +52 -0
- package/dist/src/appointments/types.d.ts +12 -0
- package/dist/src/table/config.d.ts +200 -0
- package/dist/src/table/get_data_flow-DEFAULT.json.d.ts +129 -0
- package/dist/src/table/index.d.ts +200 -0
- package/dist/utils-CanmrIWO.mjs +47 -0
- package/dist/utils-Yd6F5mea.js +3 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +38 -0
- package/dist/AppointmentListTable-CQ0WIXtj.js +0 -1
- package/dist/AppointmentListTable-aV_UJd6j.mjs +0 -159
- package/dist/DateFormatter-DbtOLV0L.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs +0 -74
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +0 -2782
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +0 -349
- package/dist/TableView-CIJs118q.mjs +0 -5929
- package/dist/TableView-DzZYf34i.js +0 -4
- package/dist/agenda-CCOjPiwP.mjs +0 -1133
- package/dist/agenda-CNPQfaIQ.js +0 -1
- package/dist/availability-B1D4Fyzi.mjs +0 -629
- package/dist/availability-DxrUcYbW.js +0 -1
- package/dist/index-BOnqrBfY.js +0 -35
- package/dist/index-Bj0qaL1N.mjs +0 -1091
- package/dist/interpolation-BBwG_ON6.mjs +0 -65
- package/dist/interpolation-CsOrww73.js +0 -1
- package/dist/orders-BJV5vRQr.mjs +0 -397
- package/dist/orders-C1C5IEIP.js +0 -1
- package/dist/regular-slots-Cc1jmKuC.mjs +0 -222
- package/dist/regular-slots-DBs1XVeN.js +0 -1
- package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +0 -2
- package/dist/utils-BVKy9S2J.mjs +0 -29
- package/dist/utils-D6CaKJbp.js +0 -2
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
function R(e, t) {
|
|
2
2
|
return e - t * Math.floor(e / t);
|
|
3
3
|
}
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
t =
|
|
4
|
+
const _ = 1721426;
|
|
5
|
+
function v(e, t, r, n) {
|
|
6
|
+
t = q(e, t);
|
|
7
7
|
let a = t - 1, o = -2;
|
|
8
|
-
return r <= 2 ? o = 0 : T(t) && (o = -1),
|
|
8
|
+
return r <= 2 ? o = 0 : T(t) && (o = -1), _ - 1 + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + Math.floor((367 * r - 362) / 12 + o + n);
|
|
9
9
|
}
|
|
10
10
|
function T(e) {
|
|
11
11
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function q(e, t) {
|
|
14
14
|
return e === "BC" ? 1 - t : t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function de(e) {
|
|
17
17
|
let t = "AD";
|
|
18
18
|
return e <= 0 && (t = "BC", e = 1 - e), [
|
|
19
19
|
t,
|
|
20
20
|
e
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const $e = {
|
|
24
24
|
standard: [
|
|
25
25
|
31,
|
|
26
26
|
28,
|
|
@@ -50,18 +50,18 @@ const ye = {
|
|
|
50
50
|
31
|
|
51
51
|
]
|
|
52
52
|
};
|
|
53
|
-
class
|
|
53
|
+
class w {
|
|
54
54
|
fromJulianDay(t) {
|
|
55
|
-
let r = t, n = r -
|
|
56
|
-
r <
|
|
57
|
-
let
|
|
58
|
-
return new
|
|
55
|
+
let r = t, n = r - _, a = Math.floor(n / 146097), o = R(n, 146097), c = Math.floor(o / 36524), s = R(o, 36524), i = Math.floor(s / 1461), u = R(s, 1461), p = Math.floor(u / 365), M = a * 400 + c * 100 + i * 4 + p + (c !== 4 && p !== 4 ? 1 : 0), [g, m] = de(M), y = r - v(g, m, 1, 1), O = 2;
|
|
56
|
+
r < v(g, m, 3, 1) ? O = 0 : T(m) && (O = 1);
|
|
57
|
+
let L = Math.floor(((y + O) * 12 + 373) / 367), fe = r - v(g, m, L, 1) + 1;
|
|
58
|
+
return new I(g, m, L, fe);
|
|
59
59
|
}
|
|
60
60
|
toJulianDay(t) {
|
|
61
|
-
return
|
|
61
|
+
return v(t.era, t.year, t.month, t.day);
|
|
62
62
|
}
|
|
63
63
|
getDaysInMonth(t) {
|
|
64
|
-
return
|
|
64
|
+
return $e[T(t.year) ? "leapyear" : "standard"][t.month - 1];
|
|
65
65
|
}
|
|
66
66
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
67
|
getMonthsInYear(t) {
|
|
@@ -96,50 +96,49 @@ class p {
|
|
|
96
96
|
this.identifier = "gregory";
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
return (o = (a = (r = e.isEqual) === null || r === void 0 ? void 0 : r.call(e, t)) !== null && a !== void 0 ? a : (n = t.isEqual) === null || n === void 0 ? void 0 : n.call(t, e)) !== null && o !== void 0 ? o : e.identifier === t.identifier;
|
|
99
|
+
function ye(e, t) {
|
|
100
|
+
return e.isEqual?.(t) ?? t.isEqual?.(e) ?? e.identifier === t.identifier;
|
|
102
101
|
}
|
|
103
|
-
function
|
|
102
|
+
function me(e) {
|
|
104
103
|
return d(Date.now(), e);
|
|
105
104
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
105
|
+
function je(e) {
|
|
106
|
+
return we(me(e));
|
|
108
107
|
}
|
|
109
|
-
function
|
|
108
|
+
function G(e, t) {
|
|
110
109
|
return e.calendar.toJulianDay(e) - t.calendar.toJulianDay(t);
|
|
111
110
|
}
|
|
112
|
-
function
|
|
111
|
+
function be(e, t) {
|
|
113
112
|
return z(e) - z(t);
|
|
114
113
|
}
|
|
115
114
|
function z(e) {
|
|
116
115
|
return e.hour * 36e5 + e.minute * 6e4 + e.second * 1e3 + e.millisecond;
|
|
117
116
|
}
|
|
118
|
-
let P = null,
|
|
119
|
-
function
|
|
117
|
+
let P = null, pe = !1;
|
|
118
|
+
function Q() {
|
|
120
119
|
return P == null && (P = new Intl.DateTimeFormat().resolvedOptions().timeZone), P;
|
|
121
120
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
121
|
+
function X() {
|
|
122
|
+
return pe;
|
|
124
123
|
}
|
|
125
|
-
function
|
|
126
|
-
e = h(e, new
|
|
127
|
-
let t =
|
|
128
|
-
return
|
|
124
|
+
function D(e) {
|
|
125
|
+
e = h(e, new w());
|
|
126
|
+
let t = q(e.era, e.year);
|
|
127
|
+
return ee(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
129
128
|
}
|
|
130
|
-
function
|
|
131
|
-
let
|
|
132
|
-
return
|
|
129
|
+
function ee(e, t, r, n, a, o, c) {
|
|
130
|
+
let s = /* @__PURE__ */ new Date();
|
|
131
|
+
return s.setUTCHours(n, a, o, c), s.setUTCFullYear(e, t - 1, r), s.getTime();
|
|
133
132
|
}
|
|
134
|
-
function
|
|
133
|
+
function k(e, t) {
|
|
135
134
|
if (t === "UTC") return 0;
|
|
136
|
-
if (e > 0 && t ===
|
|
137
|
-
let { year: r, month: n, day: a, hour: o, minute:
|
|
138
|
-
return
|
|
135
|
+
if (e > 0 && t === Q() && !X()) return new Date(e).getTimezoneOffset() * -6e4;
|
|
136
|
+
let { year: r, month: n, day: a, hour: o, minute: c, second: s } = te(e, t);
|
|
137
|
+
return ee(r, n, a, o, c, s, 0) - Math.floor(e / 1e3) * 1e3;
|
|
139
138
|
}
|
|
140
|
-
const
|
|
141
|
-
function
|
|
142
|
-
let r =
|
|
139
|
+
const W = /* @__PURE__ */ new Map();
|
|
140
|
+
function te(e, t) {
|
|
141
|
+
let r = W.get(t);
|
|
143
142
|
r || (r = new Intl.DateTimeFormat("en-US", {
|
|
144
143
|
timeZone: t,
|
|
145
144
|
hour12: !1,
|
|
@@ -150,7 +149,7 @@ function re(e, t) {
|
|
|
150
149
|
hour: "numeric",
|
|
151
150
|
minute: "numeric",
|
|
152
151
|
second: "numeric"
|
|
153
|
-
}),
|
|
152
|
+
}), W.set(t, r));
|
|
154
153
|
let n = r.formatToParts(new Date(e)), a = {};
|
|
155
154
|
for (let o of n) o.type !== "literal" && (a[o.type] = o.value);
|
|
156
155
|
return {
|
|
@@ -164,103 +163,101 @@ function re(e, t) {
|
|
|
164
163
|
};
|
|
165
164
|
}
|
|
166
165
|
const K = 864e5;
|
|
167
|
-
function
|
|
166
|
+
function Me(e, t, r, n) {
|
|
168
167
|
return (r === n ? [
|
|
169
168
|
r
|
|
170
169
|
] : [
|
|
171
170
|
r,
|
|
172
171
|
n
|
|
173
|
-
]).filter((o) =>
|
|
172
|
+
]).filter((o) => ge(e, t, o));
|
|
174
173
|
}
|
|
175
|
-
function
|
|
176
|
-
let n =
|
|
174
|
+
function ge(e, t, r) {
|
|
175
|
+
let n = te(r, t);
|
|
177
176
|
return e.year === n.year && e.month === n.month && e.day === n.day && e.hour === n.hour && e.minute === n.minute && e.second === n.second;
|
|
178
177
|
}
|
|
179
|
-
function
|
|
180
|
-
let n =
|
|
181
|
-
if (t === "UTC") return
|
|
182
|
-
if (t ===
|
|
183
|
-
n = h(n, new
|
|
184
|
-
let
|
|
185
|
-
return
|
|
186
|
-
}
|
|
187
|
-
let a =
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
178
|
+
function f(e, t, r = "compatible") {
|
|
179
|
+
let n = x(e);
|
|
180
|
+
if (t === "UTC") return D(n);
|
|
181
|
+
if (t === Q() && r === "compatible" && !X()) {
|
|
182
|
+
n = h(n, new w());
|
|
183
|
+
let i = /* @__PURE__ */ new Date(), u = q(n.era, n.year);
|
|
184
|
+
return i.setFullYear(u, n.month - 1, n.day), i.setHours(n.hour, n.minute, n.second, n.millisecond), i.getTime();
|
|
185
|
+
}
|
|
186
|
+
let a = D(n), o = k(a - K, t), c = k(a + K, t), s = Me(n, t, a - o, a - c);
|
|
187
|
+
if (s.length === 1) return s[0];
|
|
188
|
+
if (s.length > 1) switch (r) {
|
|
190
189
|
// 'compatible' means 'earlier' for "fall back" transitions
|
|
191
190
|
case "compatible":
|
|
192
191
|
case "earlier":
|
|
193
|
-
return
|
|
192
|
+
return s[0];
|
|
194
193
|
case "later":
|
|
195
|
-
return
|
|
194
|
+
return s[s.length - 1];
|
|
196
195
|
case "reject":
|
|
197
196
|
throw new RangeError("Multiple possible absolute times found");
|
|
198
197
|
}
|
|
199
198
|
switch (r) {
|
|
200
199
|
case "earlier":
|
|
201
|
-
return Math.min(a - o, a -
|
|
200
|
+
return Math.min(a - o, a - c);
|
|
202
201
|
// 'compatible' means 'later' for "spring forward" transitions
|
|
203
202
|
case "compatible":
|
|
204
203
|
case "later":
|
|
205
|
-
return Math.max(a - o, a -
|
|
204
|
+
return Math.max(a - o, a - c);
|
|
206
205
|
case "reject":
|
|
207
206
|
throw new RangeError("No such absolute time found");
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
|
-
function
|
|
211
|
-
return new Date(
|
|
209
|
+
function re(e, t, r = "compatible") {
|
|
210
|
+
return new Date(f(e, t, r));
|
|
212
211
|
}
|
|
213
212
|
function d(e, t) {
|
|
214
|
-
let r =
|
|
215
|
-
return new
|
|
213
|
+
let r = k(e, t), n = new Date(e + r), a = n.getUTCFullYear(), o = n.getUTCMonth() + 1, c = n.getUTCDate(), s = n.getUTCHours(), i = n.getUTCMinutes(), u = n.getUTCSeconds(), p = n.getUTCMilliseconds();
|
|
214
|
+
return new E(a < 1 ? "BC" : "AD", a < 1 ? -a + 1 : a, o, c, t, r, s, i, u, p);
|
|
216
215
|
}
|
|
217
|
-
function
|
|
218
|
-
return new
|
|
216
|
+
function we(e) {
|
|
217
|
+
return new I(e.calendar, e.era, e.year, e.month, e.day);
|
|
219
218
|
}
|
|
220
|
-
function
|
|
219
|
+
function x(e, t) {
|
|
221
220
|
let r = 0, n = 0, a = 0, o = 0;
|
|
222
221
|
if ("timeZone" in e) ({ hour: r, minute: n, second: a, millisecond: o } = e);
|
|
223
222
|
else if ("hour" in e && !t) return e;
|
|
224
|
-
return t && ({ hour: r, minute: n, second: a, millisecond: o } = t), new
|
|
223
|
+
return t && ({ hour: r, minute: n, second: a, millisecond: o } = t), new C(e.calendar, e.era, e.year, e.month, e.day, r, n, a, o);
|
|
225
224
|
}
|
|
226
225
|
function h(e, t) {
|
|
227
|
-
if (
|
|
226
|
+
if (ye(e.calendar, t)) return e;
|
|
228
227
|
let r = t.fromJulianDay(e.calendar.toJulianDay(e)), n = e.copy();
|
|
229
228
|
return n.calendar = t, n.era = r.era, n.year = r.year, n.month = r.month, n.day = r.day, b(n), n;
|
|
230
229
|
}
|
|
231
230
|
function De(e, t, r) {
|
|
232
|
-
if (e instanceof
|
|
231
|
+
if (e instanceof E)
|
|
233
232
|
return e.timeZone === t ? e : Ie(e, t);
|
|
234
|
-
let n =
|
|
233
|
+
let n = f(e, t, r);
|
|
235
234
|
return d(n, t);
|
|
236
235
|
}
|
|
237
236
|
function xe(e) {
|
|
238
|
-
let t =
|
|
237
|
+
let t = D(e) - e.offset;
|
|
239
238
|
return new Date(t);
|
|
240
239
|
}
|
|
241
240
|
function Ie(e, t) {
|
|
242
|
-
let r =
|
|
241
|
+
let r = D(e) - e.offset;
|
|
243
242
|
return h(d(r, t), e.calendar);
|
|
244
243
|
}
|
|
245
|
-
const
|
|
244
|
+
const S = 36e5;
|
|
246
245
|
function B(e, t) {
|
|
247
|
-
let r = e.copy(), n = "hour" in r ?
|
|
248
|
-
F(r, t.years || 0), r.calendar.balanceYearMonth && r.calendar.balanceYearMonth(r, e), r.month += t.months || 0,
|
|
246
|
+
let r = e.copy(), n = "hour" in r ? ve(r, t) : 0;
|
|
247
|
+
F(r, t.years || 0), r.calendar.balanceYearMonth && r.calendar.balanceYearMonth(r, e), r.month += t.months || 0, j(r), ne(r), r.day += (t.weeks || 0) * 7, r.day += t.days || 0, r.day += n, Se(r), r.calendar.balanceDate && r.calendar.balanceDate(r), r.year < 1 && (r.year = 1, r.month = 1, r.day = 1);
|
|
249
248
|
let a = r.calendar.getYearsInEra(r);
|
|
250
249
|
if (r.year > a) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
r.year = a, r.month = l ? 1 : r.calendar.getMonthsInYear(r), r.day = l ? 1 : r.calendar.getDaysInMonth(r);
|
|
250
|
+
let c = r.calendar.isInverseEra?.(r);
|
|
251
|
+
r.year = a, r.month = c ? 1 : r.calendar.getMonthsInYear(r), r.day = c ? 1 : r.calendar.getDaysInMonth(r);
|
|
254
252
|
}
|
|
255
253
|
r.month < 1 && (r.month = 1, r.day = 1);
|
|
256
|
-
let
|
|
257
|
-
return r.month >
|
|
254
|
+
let o = r.calendar.getMonthsInYear(r);
|
|
255
|
+
return r.month > o && (r.month = o, r.day = r.calendar.getDaysInMonth(r)), r.day = Math.max(1, Math.min(r.calendar.getDaysInMonth(r), r.day)), r;
|
|
258
256
|
}
|
|
259
257
|
function F(e, t) {
|
|
260
|
-
|
|
261
|
-
!((r = (n = e.calendar).isInverseEra) === null || r === void 0) && r.call(n, e) && (t = -t), e.year += t;
|
|
258
|
+
e.calendar.isInverseEra?.(e) && (t = -t), e.year += t;
|
|
262
259
|
}
|
|
263
|
-
function
|
|
260
|
+
function j(e) {
|
|
264
261
|
for (; e.month < 1; )
|
|
265
262
|
F(e, -1), e.month += e.calendar.getMonthsInYear(e);
|
|
266
263
|
let t = 0;
|
|
@@ -269,25 +266,25 @@ function q(e) {
|
|
|
269
266
|
}
|
|
270
267
|
function Se(e) {
|
|
271
268
|
for (; e.day < 1; )
|
|
272
|
-
e.month--,
|
|
269
|
+
e.month--, j(e), e.day += e.calendar.getDaysInMonth(e);
|
|
273
270
|
for (; e.day > e.calendar.getDaysInMonth(e); )
|
|
274
|
-
e.day -= e.calendar.getDaysInMonth(e), e.month++,
|
|
271
|
+
e.day -= e.calendar.getDaysInMonth(e), e.month++, j(e);
|
|
275
272
|
}
|
|
276
|
-
function
|
|
273
|
+
function ne(e) {
|
|
277
274
|
e.month = Math.max(1, Math.min(e.calendar.getMonthsInYear(e), e.month)), e.day = Math.max(1, Math.min(e.calendar.getDaysInMonth(e), e.day));
|
|
278
275
|
}
|
|
279
276
|
function b(e) {
|
|
280
|
-
e.calendar.constrainDate && e.calendar.constrainDate(e), e.year = Math.max(1, Math.min(e.calendar.getYearsInEra(e), e.year)),
|
|
277
|
+
e.calendar.constrainDate && e.calendar.constrainDate(e), e.year = Math.max(1, Math.min(e.calendar.getYearsInEra(e), e.year)), ne(e);
|
|
281
278
|
}
|
|
282
|
-
function
|
|
279
|
+
function ae(e) {
|
|
283
280
|
let t = {};
|
|
284
281
|
for (let r in e) typeof e[r] == "number" && (t[r] = -e[r]);
|
|
285
282
|
return t;
|
|
286
283
|
}
|
|
287
|
-
function
|
|
288
|
-
return B(e,
|
|
284
|
+
function oe(e, t) {
|
|
285
|
+
return B(e, ae(t));
|
|
289
286
|
}
|
|
290
|
-
function
|
|
287
|
+
function J(e, t) {
|
|
291
288
|
let r = e.copy();
|
|
292
289
|
return t.era != null && (r.era = t.era), t.year != null && (r.year = t.year), t.month != null && (r.month = t.month), t.day != null && (r.day = t.day), b(r), r;
|
|
293
290
|
}
|
|
@@ -307,21 +304,20 @@ function Y(e, t) {
|
|
|
307
304
|
let r = e % t;
|
|
308
305
|
return r < 0 && (r += t), r;
|
|
309
306
|
}
|
|
310
|
-
function
|
|
307
|
+
function ve(e, t) {
|
|
311
308
|
return e.hour += t.hours || 0, e.minute += t.minutes || 0, e.second += t.seconds || 0, e.millisecond += t.milliseconds || 0, Ce(e);
|
|
312
309
|
}
|
|
313
|
-
function
|
|
310
|
+
function N(e, t, r, n) {
|
|
314
311
|
let a = e.copy();
|
|
315
312
|
switch (t) {
|
|
316
313
|
case "era": {
|
|
317
|
-
let
|
|
318
|
-
if (
|
|
319
|
-
|
|
314
|
+
let o = e.calendar.getEras(), c = o.indexOf(e.era);
|
|
315
|
+
if (c < 0) throw new Error("Invalid era: " + e.era);
|
|
316
|
+
c = $(c, r, 0, o.length - 1, n?.round), a.era = o[c], b(a);
|
|
320
317
|
break;
|
|
321
318
|
}
|
|
322
319
|
case "year":
|
|
323
|
-
|
|
324
|
-
!((o = (i = a.calendar).isInverseEra) === null || o === void 0) && o.call(i, a) && (r = -r), a.year = $(e.year, r, -1 / 0, 9999, n?.round), a.year === -1 / 0 && (a.year = 1), a.calendar.balanceYearMonth && a.calendar.balanceYearMonth(a, e);
|
|
320
|
+
a.calendar.isInverseEra?.(a) && (r = -r), a.year = $(e.year, r, -1 / 0, 9999, n?.round), a.year === -1 / 0 && (a.year = 1), a.calendar.balanceYearMonth && a.calendar.balanceYearMonth(a, e);
|
|
325
321
|
break;
|
|
326
322
|
case "month":
|
|
327
323
|
a.month = $(e.month, r, 1, e.calendar.getMonthsInYear(e), n?.round);
|
|
@@ -338,12 +334,12 @@ function ce(e, t, r, n) {
|
|
|
338
334
|
let a = e.copy();
|
|
339
335
|
switch (t) {
|
|
340
336
|
case "hour": {
|
|
341
|
-
let o = e.hour,
|
|
337
|
+
let o = e.hour, c = 0, s = 23;
|
|
342
338
|
if (n?.hourCycle === 12) {
|
|
343
|
-
let
|
|
344
|
-
|
|
339
|
+
let i = o >= 12;
|
|
340
|
+
c = i ? 12 : 0, s = i ? 23 : 11;
|
|
345
341
|
}
|
|
346
|
-
a.hour = $(o, r,
|
|
342
|
+
a.hour = $(o, r, c, s, n?.round);
|
|
347
343
|
break;
|
|
348
344
|
}
|
|
349
345
|
case "minute":
|
|
@@ -369,26 +365,26 @@ function $(e, t, r, n, a = !1) {
|
|
|
369
365
|
e += t, e < r ? e = n - (r - e - 1) : e > n && (e = r + (e - n - 1));
|
|
370
366
|
return e;
|
|
371
367
|
}
|
|
372
|
-
function
|
|
368
|
+
function se(e, t) {
|
|
373
369
|
let r;
|
|
374
370
|
if (t.years != null && t.years !== 0 || t.months != null && t.months !== 0 || t.weeks != null && t.weeks !== 0 || t.days != null && t.days !== 0) {
|
|
375
|
-
let a = B(
|
|
371
|
+
let a = B(x(e), {
|
|
376
372
|
years: t.years,
|
|
377
373
|
months: t.months,
|
|
378
374
|
weeks: t.weeks,
|
|
379
375
|
days: t.days
|
|
380
376
|
});
|
|
381
|
-
r =
|
|
377
|
+
r = f(a, e.timeZone);
|
|
382
378
|
} else
|
|
383
|
-
r =
|
|
379
|
+
r = D(e) - e.offset;
|
|
384
380
|
r += t.milliseconds || 0, r += (t.seconds || 0) * 1e3, r += (t.minutes || 0) * 6e4, r += (t.hours || 0) * 36e5;
|
|
385
381
|
let n = d(r, e.timeZone);
|
|
386
382
|
return h(n, e.calendar);
|
|
387
383
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
384
|
+
function Ye(e, t) {
|
|
385
|
+
return se(e, ae(t));
|
|
390
386
|
}
|
|
391
|
-
function
|
|
387
|
+
function Te(e, t, r, n) {
|
|
392
388
|
switch (t) {
|
|
393
389
|
case "hour": {
|
|
394
390
|
let a = 0, o = 23;
|
|
@@ -396,18 +392,18 @@ function Ue(e, t, r, n) {
|
|
|
396
392
|
let y = e.hour >= 12;
|
|
397
393
|
a = y ? 12 : 0, o = y ? 23 : 11;
|
|
398
394
|
}
|
|
399
|
-
let
|
|
395
|
+
let c = x(e), s = h(U(c, {
|
|
400
396
|
hour: a
|
|
401
|
-
}), new
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
].filter((y) => d(y, e.timeZone).day ===
|
|
397
|
+
}), new w()), i = [
|
|
398
|
+
f(s, e.timeZone, "earlier"),
|
|
399
|
+
f(s, e.timeZone, "later")
|
|
400
|
+
].filter((y) => d(y, e.timeZone).day === s.day)[0], u = h(U(c, {
|
|
405
401
|
hour: o
|
|
406
|
-
}), new
|
|
407
|
-
u
|
|
408
|
-
u
|
|
409
|
-
].filter((y) => d(y, e.timeZone).day ===
|
|
410
|
-
return
|
|
402
|
+
}), new w()), p = [
|
|
403
|
+
f(u, e.timeZone, "earlier"),
|
|
404
|
+
f(u, e.timeZone, "later")
|
|
405
|
+
].filter((y) => d(y, e.timeZone).day === u.day).pop(), M = D(e) - e.offset, g = Math.floor(M / S), m = M % S;
|
|
406
|
+
return M = $(g, r, Math.floor(i / S), Math.floor(p / S), n?.round) * S + m, h(d(M, e.timeZone), e.calendar);
|
|
411
407
|
}
|
|
412
408
|
case "minute":
|
|
413
409
|
case "second":
|
|
@@ -417,71 +413,64 @@ function Ue(e, t, r, n) {
|
|
|
417
413
|
case "year":
|
|
418
414
|
case "month":
|
|
419
415
|
case "day": {
|
|
420
|
-
let a =
|
|
416
|
+
let a = N(x(e), t, r, n), o = f(a, e.timeZone);
|
|
421
417
|
return h(d(o, e.timeZone), e.calendar);
|
|
422
418
|
}
|
|
423
419
|
default:
|
|
424
420
|
throw new Error("Unsupported field " + t);
|
|
425
421
|
}
|
|
426
422
|
}
|
|
427
|
-
function
|
|
428
|
-
let n =
|
|
423
|
+
function Ue(e, t, r) {
|
|
424
|
+
let n = x(e), a = U(J(n, t), t);
|
|
429
425
|
if (a.compare(n) === 0) return e;
|
|
430
|
-
let o =
|
|
426
|
+
let o = f(a, e.timeZone, r);
|
|
431
427
|
return h(d(o, e.timeZone), e.calendar);
|
|
432
428
|
}
|
|
433
|
-
const
|
|
434
|
-
function
|
|
435
|
-
let t = e.match(
|
|
429
|
+
const Be = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/, Oe = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/, ie = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
430
|
+
function qe(e) {
|
|
431
|
+
let t = e.match(Be);
|
|
436
432
|
if (!t)
|
|
437
|
-
throw
|
|
438
|
-
let r = new
|
|
439
|
-
return r.day =
|
|
433
|
+
throw ie.test(e) ? new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date string: " + e);
|
|
434
|
+
let r = new I(l(t[1], 0, 9999), l(t[2], 1, 12), 1);
|
|
435
|
+
return r.day = l(t[3], 1, r.calendar.getDaysInMonth(r)), r;
|
|
440
436
|
}
|
|
441
|
-
function
|
|
442
|
-
let t = e.match(
|
|
437
|
+
function Je(e) {
|
|
438
|
+
let t = e.match(Oe);
|
|
443
439
|
if (!t)
|
|
444
|
-
throw
|
|
445
|
-
let r =
|
|
446
|
-
return a.day =
|
|
440
|
+
throw ie.test(e) ? new Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date time string: " + e);
|
|
441
|
+
let r = l(t[1], -9999, 9999), n = r < 1 ? "BC" : "AD", a = new C(n, r < 1 ? -r + 1 : r, l(t[2], 1, 12), 1, t[4] ? l(t[4], 0, 23) : 0, t[5] ? l(t[5], 0, 59) : 0, t[6] ? l(t[6], 0, 59) : 0, t[7] ? l(t[7], 0, 1 / 0) * 1e3 : 0);
|
|
442
|
+
return a.day = l(t[3], 0, a.calendar.getDaysInMonth(a)), a;
|
|
447
443
|
}
|
|
448
|
-
function
|
|
444
|
+
function l(e, t, r) {
|
|
449
445
|
let n = Number(e);
|
|
450
446
|
if (n < t || n > r) throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);
|
|
451
447
|
return n;
|
|
452
448
|
}
|
|
453
|
-
function
|
|
449
|
+
function Re(e) {
|
|
454
450
|
return `${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${e.millisecond ? String(e.millisecond / 1e3).slice(1) : ""}`;
|
|
455
451
|
}
|
|
456
|
-
function
|
|
457
|
-
let t = h(e, new
|
|
452
|
+
function le(e) {
|
|
453
|
+
let t = h(e, new w()), r;
|
|
458
454
|
return t.era === "BC" ? r = t.year === 1 ? "0000" : "-" + String(Math.abs(1 - t.year)).padStart(6, "00") : r = String(t.year).padStart(4, "0"), `${r}-${String(t.month).padStart(2, "0")}-${String(t.day).padStart(2, "0")}`;
|
|
459
455
|
}
|
|
460
|
-
function
|
|
461
|
-
return `${
|
|
456
|
+
function he(e) {
|
|
457
|
+
return `${le(e)}T${Re(e)}`;
|
|
462
458
|
}
|
|
463
|
-
function
|
|
459
|
+
function Pe(e) {
|
|
464
460
|
let t = Math.sign(e) < 0 ? "-" : "+";
|
|
465
461
|
e = Math.abs(e);
|
|
466
462
|
let r = Math.floor(e / 36e5), n = Math.floor(e % 36e5 / 6e4), a = Math.floor(e % 36e5 % 6e4 / 1e3), o = `${t}${String(r).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
467
463
|
return a !== 0 && (o += `:${String(a).padStart(2, "0")}`), o;
|
|
468
464
|
}
|
|
469
465
|
function Ae(e) {
|
|
470
|
-
return `${
|
|
471
|
-
}
|
|
472
|
-
function Ze(e, t) {
|
|
473
|
-
if (t.has(e))
|
|
474
|
-
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
475
|
-
}
|
|
476
|
-
function N(e, t, r) {
|
|
477
|
-
Ze(e, t), t.set(e, r);
|
|
466
|
+
return `${he(e)}${Pe(e.offset)}[${e.timeZone}]`;
|
|
478
467
|
}
|
|
479
468
|
function V(e) {
|
|
480
|
-
let t = typeof e[0] == "object" ? e.shift() : new
|
|
469
|
+
let t = typeof e[0] == "object" ? e.shift() : new w(), r;
|
|
481
470
|
if (typeof e[0] == "string") r = e.shift();
|
|
482
471
|
else {
|
|
483
|
-
let
|
|
484
|
-
r =
|
|
472
|
+
let c = t.getEras();
|
|
473
|
+
r = c[c.length - 1];
|
|
485
474
|
}
|
|
486
475
|
let n = e.shift(), a = e.shift(), o = e.shift();
|
|
487
476
|
return [
|
|
@@ -492,11 +481,19 @@ function V(e) {
|
|
|
492
481
|
o
|
|
493
482
|
];
|
|
494
483
|
}
|
|
495
|
-
|
|
496
|
-
|
|
484
|
+
class I {
|
|
485
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
486
|
+
// i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
|
|
487
|
+
// If that behavior is desired, use the AnyCalendarDate interface instead.
|
|
488
|
+
// @ts-ignore
|
|
489
|
+
#e;
|
|
490
|
+
constructor(...t) {
|
|
491
|
+
let [r, n, a, o, c] = V(t);
|
|
492
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, b(this);
|
|
493
|
+
}
|
|
497
494
|
/** Returns a copy of this date. */
|
|
498
495
|
copy() {
|
|
499
|
-
return this.era ? new
|
|
496
|
+
return this.era ? new I(this.calendar, this.era, this.year, this.month, this.day) : new I(this.calendar, this.year, this.month, this.day);
|
|
500
497
|
}
|
|
501
498
|
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
502
499
|
add(t) {
|
|
@@ -504,45 +501,43 @@ class x {
|
|
|
504
501
|
}
|
|
505
502
|
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
506
503
|
subtract(t) {
|
|
507
|
-
return
|
|
504
|
+
return oe(this, t);
|
|
508
505
|
}
|
|
509
506
|
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
510
507
|
set(t) {
|
|
511
|
-
return
|
|
508
|
+
return J(this, t);
|
|
512
509
|
}
|
|
513
510
|
/**
|
|
514
511
|
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
515
512
|
* When the resulting value reaches the limits of the field, it wraps around.
|
|
516
513
|
*/
|
|
517
514
|
cycle(t, r, n) {
|
|
518
|
-
return
|
|
515
|
+
return N(this, t, r, n);
|
|
519
516
|
}
|
|
520
517
|
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
521
518
|
toDate(t) {
|
|
522
|
-
return
|
|
519
|
+
return re(this, t);
|
|
523
520
|
}
|
|
524
521
|
/** Converts the date to an ISO 8601 formatted string. */
|
|
525
522
|
toString() {
|
|
526
|
-
return
|
|
523
|
+
return le(this);
|
|
527
524
|
}
|
|
528
525
|
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
529
526
|
compare(t) {
|
|
530
|
-
return
|
|
527
|
+
return G(this, t);
|
|
531
528
|
}
|
|
529
|
+
}
|
|
530
|
+
class C {
|
|
531
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
532
|
+
// @ts-ignore
|
|
533
|
+
#e;
|
|
532
534
|
constructor(...t) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
value: void 0
|
|
536
|
-
});
|
|
537
|
-
let [r, n, a, o, i] = V(t);
|
|
538
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = i, b(this);
|
|
535
|
+
let [r, n, a, o, c] = V(t);
|
|
536
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
539
537
|
}
|
|
540
|
-
}
|
|
541
|
-
var Fe = /* @__PURE__ */ new WeakMap();
|
|
542
|
-
class S {
|
|
543
538
|
/** Returns a copy of this date. */
|
|
544
539
|
copy() {
|
|
545
|
-
return this.era ? new
|
|
540
|
+
return this.era ? new C(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new C(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
546
541
|
}
|
|
547
542
|
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
548
543
|
add(t) {
|
|
@@ -550,11 +545,11 @@ class S {
|
|
|
550
545
|
}
|
|
551
546
|
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
552
547
|
subtract(t) {
|
|
553
|
-
return
|
|
548
|
+
return oe(this, t);
|
|
554
549
|
}
|
|
555
550
|
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
556
551
|
set(t) {
|
|
557
|
-
return
|
|
552
|
+
return J(U(this, t), t);
|
|
558
553
|
}
|
|
559
554
|
/**
|
|
560
555
|
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
@@ -566,57 +561,55 @@ class S {
|
|
|
566
561
|
case "year":
|
|
567
562
|
case "month":
|
|
568
563
|
case "day":
|
|
569
|
-
return
|
|
564
|
+
return N(this, t, r, n);
|
|
570
565
|
default:
|
|
571
566
|
return ce(this, t, r, n);
|
|
572
567
|
}
|
|
573
568
|
}
|
|
574
569
|
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
575
570
|
toDate(t, r) {
|
|
576
|
-
return
|
|
571
|
+
return re(this, t, r);
|
|
577
572
|
}
|
|
578
573
|
/** Converts the date to an ISO 8601 formatted string. */
|
|
579
574
|
toString() {
|
|
580
|
-
return
|
|
575
|
+
return he(this);
|
|
581
576
|
}
|
|
582
577
|
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
583
578
|
compare(t) {
|
|
584
|
-
let r =
|
|
585
|
-
return r === 0 ?
|
|
579
|
+
let r = G(this, t);
|
|
580
|
+
return r === 0 ? be(this, x(t)) : r;
|
|
586
581
|
}
|
|
582
|
+
}
|
|
583
|
+
class E {
|
|
584
|
+
// This prevents TypeScript from allowing other types with the same fields to match.
|
|
585
|
+
// @ts-ignore
|
|
586
|
+
#e;
|
|
587
587
|
constructor(...t) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
value: void 0
|
|
591
|
-
});
|
|
592
|
-
let [r, n, a, o, i] = V(t);
|
|
593
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = i, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
588
|
+
let [r, n, a, o, c] = V(t), s = t.shift(), i = t.shift();
|
|
589
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, this.timeZone = s, this.offset = i, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
594
590
|
}
|
|
595
|
-
}
|
|
596
|
-
var qe = /* @__PURE__ */ new WeakMap();
|
|
597
|
-
class C {
|
|
598
591
|
/** Returns a copy of this date. */
|
|
599
592
|
copy() {
|
|
600
|
-
return this.era ? new
|
|
593
|
+
return this.era ? new E(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new E(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
601
594
|
}
|
|
602
595
|
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
603
596
|
add(t) {
|
|
604
|
-
return
|
|
597
|
+
return se(this, t);
|
|
605
598
|
}
|
|
606
599
|
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
607
600
|
subtract(t) {
|
|
608
|
-
return
|
|
601
|
+
return Ye(this, t);
|
|
609
602
|
}
|
|
610
603
|
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
611
604
|
set(t, r) {
|
|
612
|
-
return
|
|
605
|
+
return Ue(this, t, r);
|
|
613
606
|
}
|
|
614
607
|
/**
|
|
615
608
|
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
616
609
|
* When the resulting value reaches the limits of the field, it wraps around.
|
|
617
610
|
*/
|
|
618
611
|
cycle(t, r, n) {
|
|
619
|
-
return
|
|
612
|
+
return Te(this, t, r, n);
|
|
620
613
|
}
|
|
621
614
|
/** Converts the date to a native JavaScript Date object. */
|
|
622
615
|
toDate() {
|
|
@@ -634,17 +627,12 @@ class C {
|
|
|
634
627
|
compare(t) {
|
|
635
628
|
return this.toDate().getTime() - De(t, this.timeZone).toDate().getTime();
|
|
636
629
|
}
|
|
637
|
-
constructor(...t) {
|
|
638
|
-
N(this, qe, {
|
|
639
|
-
writable: !0,
|
|
640
|
-
value: void 0
|
|
641
|
-
});
|
|
642
|
-
let [r, n, a, o, i] = V(t), c = t.shift(), l = t.shift();
|
|
643
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = i, this.timeZone = c, this.offset = l, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
644
|
-
}
|
|
645
630
|
}
|
|
646
|
-
let
|
|
647
|
-
class
|
|
631
|
+
let A = /* @__PURE__ */ new Map();
|
|
632
|
+
class Ne {
|
|
633
|
+
constructor(t, r = {}) {
|
|
634
|
+
this.formatter = ue(t, r), this.options = r;
|
|
635
|
+
}
|
|
648
636
|
/** Formats a date as a string according to the locale and format options passed to the constructor. */
|
|
649
637
|
format(t) {
|
|
650
638
|
return this.formatter.format(t);
|
|
@@ -685,13 +673,10 @@ class Le {
|
|
|
685
673
|
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
686
674
|
resolvedOptions() {
|
|
687
675
|
let t = this.formatter.resolvedOptions();
|
|
688
|
-
return
|
|
689
|
-
}
|
|
690
|
-
constructor(t, r = {}) {
|
|
691
|
-
this.formatter = ue(t, r), this.options = r;
|
|
676
|
+
return ke() && (this.resolvedHourCycle || (this.resolvedHourCycle = Fe(t.locale, this.options)), t.hourCycle = this.resolvedHourCycle, t.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12"), t.calendar === "ethiopic-amete-alem" && (t.calendar = "ethioaa"), t;
|
|
692
677
|
}
|
|
693
678
|
}
|
|
694
|
-
const
|
|
679
|
+
const Ze = {
|
|
695
680
|
true: {
|
|
696
681
|
// Only Japanese uses the h11 style for 12 hour time. All others use h12.
|
|
697
682
|
ja: "h11"
|
|
@@ -699,33 +684,33 @@ const je = {
|
|
|
699
684
|
false: {}
|
|
700
685
|
};
|
|
701
686
|
function ue(e, t = {}) {
|
|
702
|
-
if (typeof t.hour12 == "boolean" &&
|
|
687
|
+
if (typeof t.hour12 == "boolean" && He()) {
|
|
703
688
|
t = {
|
|
704
689
|
...t
|
|
705
690
|
};
|
|
706
|
-
let a =
|
|
691
|
+
let a = Ze[String(t.hour12)][e.split("-")[0]], o = t.hour12 ? "h12" : "h23";
|
|
707
692
|
t.hourCycle = a ?? o, delete t.hour12;
|
|
708
693
|
}
|
|
709
694
|
let r = e + (t ? Object.entries(t).sort((a, o) => a[0] < o[0] ? -1 : 1).join() : "");
|
|
710
|
-
if (
|
|
695
|
+
if (A.has(r)) return A.get(r);
|
|
711
696
|
let n = new Intl.DateTimeFormat(e, t);
|
|
712
|
-
return
|
|
697
|
+
return A.set(r, n), n;
|
|
713
698
|
}
|
|
714
|
-
let
|
|
715
|
-
function
|
|
716
|
-
return
|
|
699
|
+
let Z = null;
|
|
700
|
+
function He() {
|
|
701
|
+
return Z == null && (Z = new Intl.DateTimeFormat("en-US", {
|
|
717
702
|
hour: "numeric",
|
|
718
703
|
hour12: !1
|
|
719
|
-
}).format(new Date(2020, 2, 3, 0)) === "24"),
|
|
704
|
+
}).format(new Date(2020, 2, 3, 0)) === "24"), Z;
|
|
720
705
|
}
|
|
721
|
-
let
|
|
722
|
-
function
|
|
723
|
-
return
|
|
706
|
+
let H = null;
|
|
707
|
+
function ke() {
|
|
708
|
+
return H == null && (H = new Intl.DateTimeFormat("fr", {
|
|
724
709
|
hour: "numeric",
|
|
725
710
|
hour12: !1
|
|
726
|
-
}).resolvedOptions().hourCycle === "h12"),
|
|
711
|
+
}).resolvedOptions().hourCycle === "h12"), H;
|
|
727
712
|
}
|
|
728
|
-
function
|
|
713
|
+
function Fe(e, t) {
|
|
729
714
|
if (!t.timeStyle && !t.hour) return;
|
|
730
715
|
e = e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, ""), e += (e.includes("-u-") ? "" : "-u") + "-nu-latn";
|
|
731
716
|
let r = ue(e, {
|
|
@@ -740,10 +725,10 @@ function Ne(e, t) {
|
|
|
740
725
|
throw new Error("Unexpected hour cycle result");
|
|
741
726
|
}
|
|
742
727
|
export {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
728
|
+
Ne as $,
|
|
729
|
+
I as a,
|
|
730
|
+
Q as b,
|
|
731
|
+
je as c,
|
|
732
|
+
Je as d,
|
|
733
|
+
qe as e
|
|
749
734
|
};
|