@strapi/plugin-users-permissions 5.0.0-beta.9 → 5.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -3
- package/admin/src/components/FormModal/index.jsx +50 -66
- package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +3 -2
- package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +11 -20
- package/admin/src/components/Permissions/index.jsx +1 -0
- package/admin/src/components/Policies/index.jsx +3 -3
- package/admin/src/components/UsersPermissions/index.jsx +5 -5
- package/admin/src/pages/AdvancedSettings/index.jsx +5 -5
- package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +113 -112
- package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +17 -12
- package/admin/src/pages/EmailTemplates/index.jsx +6 -7
- package/admin/src/pages/Providers/index.jsx +1 -1
- package/admin/src/pages/Roles/pages/CreatePage.jsx +6 -7
- package/admin/src/pages/Roles/pages/EditPage.jsx +6 -7
- package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +6 -5
- package/admin/src/pages/Roles/pages/ListPage/index.jsx +5 -6
- package/dist/_chunks/{index-EQL2s09p-DzUzGVgd.mjs → index-8-k5RCnK-BHUgmsKx.mjs} +1231 -320
- package/dist/_chunks/index-8-k5RCnK-BHUgmsKx.mjs.map +1 -0
- package/dist/_chunks/{index-EQL2s09p-621Sl9hj.js → index-8-k5RCnK-qR3QHvSP.js} +1228 -317
- package/dist/_chunks/index-8-k5RCnK-qR3QHvSP.js.map +1 -0
- package/dist/_chunks/{index-8gj-Xbnv.mjs → index-B9OX-a4A.mjs} +29 -34
- package/dist/_chunks/index-B9OX-a4A.mjs.map +1 -0
- package/dist/_chunks/{index-BBs5I2vg.mjs → index-Cf2sMpyd.mjs} +10 -10
- package/dist/_chunks/{index-BBs5I2vg.mjs.map → index-Cf2sMpyd.mjs.map} +1 -1
- package/dist/_chunks/{index-Cm0m3fu1.mjs → index-DCFIfSfa.mjs} +17 -23
- package/dist/_chunks/index-DCFIfSfa.mjs.map +1 -0
- package/dist/_chunks/{index-CTQmcKdx.js → index-DRoVF6Y7.js} +20 -26
- package/dist/_chunks/index-DRoVF6Y7.js.map +1 -0
- package/dist/_chunks/{index-eXarQ1KK.js → index-DVEZVDjs.js} +28 -33
- package/dist/_chunks/index-DVEZVDjs.js.map +1 -0
- package/dist/_chunks/{index-Dv_hLBLL.js → index-iMO1GC3n.js} +94 -96
- package/dist/_chunks/index-iMO1GC3n.js.map +1 -0
- package/dist/_chunks/{index-DU64Xec_.js → index-iSLj9xJT.js} +4 -4
- package/dist/_chunks/index-iSLj9xJT.js.map +1 -0
- package/dist/_chunks/{index-DbtKSwQT.js → index-iaebB1BT.js} +10 -10
- package/dist/_chunks/{index-DbtKSwQT.js.map → index-iaebB1BT.js.map} +1 -1
- package/dist/_chunks/{index-sXlt_q08.mjs → index-qhy_K2pJ.mjs} +5 -5
- package/dist/_chunks/index-qhy_K2pJ.mjs.map +1 -0
- package/dist/_chunks/{index-CDbrfh8w.mjs → index-zmcUQlrv.mjs} +95 -97
- package/dist/_chunks/index-zmcUQlrv.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +6 -6
- package/dist/_chunks/index-8gj-Xbnv.mjs.map +0 -1
- package/dist/_chunks/index-CDbrfh8w.mjs.map +0 -1
- package/dist/_chunks/index-CTQmcKdx.js.map +0 -1
- package/dist/_chunks/index-Cm0m3fu1.mjs.map +0 -1
- package/dist/_chunks/index-DU64Xec_.js.map +0 -1
- package/dist/_chunks/index-Dv_hLBLL.js.map +0 -1
- package/dist/_chunks/index-EQL2s09p-621Sl9hj.js.map +0 -1
- package/dist/_chunks/index-EQL2s09p-DzUzGVgd.mjs.map +0 -1
- package/dist/_chunks/index-eXarQ1KK.js.map +0 -1
- package/dist/_chunks/index-sXlt_q08.mjs.map +0 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import "react-dom/client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { createContext as createContext$1, useRef, useState, createElement, useEffect, useLayoutEffect, useContext, useReducer, useCallback, useMemo, useDebugValue, forwardRef, memo } from "react";
|
|
5
|
-
import { Link, Alert, Typography, useCallbackRef, useComposedRefs, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Box, Flex, Button } from "@strapi/design-system";
|
|
3
|
+
import { Link, Alert, Typography, Box, Flex, useCallbackRef, useComposedRefs, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Popover, Button } from "@strapi/design-system";
|
|
6
4
|
import "lodash/isFunction";
|
|
7
5
|
import "lodash/merge";
|
|
8
6
|
import "lodash/pick";
|
|
9
|
-
import { shallowEqual, batch, useDispatch, useSelector, useStore } from "react-redux";
|
|
10
7
|
import { NavLink, useLocation, useNavigate } from "react-router-dom";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { createContext as createContext$1, useRef, useState, createElement, useEffect, useLayoutEffect, useContext, useReducer, useCallback, useMemo, useDebugValue, forwardRef, memo } from "react";
|
|
11
10
|
import { useIntl } from "react-intl";
|
|
12
|
-
import { ArrowLeft, Eye, EyeStriked, Filter, CaretDown } from "@strapi/icons";
|
|
11
|
+
import { ArrowLeft, Eye, EyeStriked, WarningCircle, Filter, CaretDown } from "@strapi/icons";
|
|
13
12
|
import "@strapi/icons/symbols";
|
|
14
13
|
import { unstable_batchedUpdates } from "react-dom";
|
|
15
14
|
import createNextState2, { enableES5, isDraftable, isDraft, enablePatches, applyPatches, produceWithPatches, original, produce } from "immer";
|
|
15
|
+
import { shallowEqual, batch, useDispatch, useSelector, useStore } from "react-redux";
|
|
16
16
|
import pipe from "lodash/fp/pipe";
|
|
17
|
+
import clone from "lodash/clone";
|
|
18
|
+
import toPath from "lodash/toPath";
|
|
17
19
|
import isEqual from "lodash/isEqual";
|
|
18
20
|
import "lodash/defaultsDeep";
|
|
19
21
|
import { createGlobalStyle, styled } from "styled-components";
|
|
@@ -22,8 +24,6 @@ import "lodash/get";
|
|
|
22
24
|
import "lodash/set";
|
|
23
25
|
import "lodash/camelCase";
|
|
24
26
|
import * as yup from "yup";
|
|
25
|
-
import clone from "lodash/clone";
|
|
26
|
-
import toPath from "lodash/toPath";
|
|
27
27
|
import "lodash/omit";
|
|
28
28
|
import "formik";
|
|
29
29
|
import "lodash/throttle";
|
|
@@ -8533,6 +8533,10 @@ function createContext(rootComponentName, defaultContext) {
|
|
|
8533
8533
|
return [Provider2, useContext2];
|
|
8534
8534
|
}
|
|
8535
8535
|
createContext("StrapiApp");
|
|
8536
|
+
const STORAGE_KEYS$1 = {
|
|
8537
|
+
TOKEN: "jwtToken",
|
|
8538
|
+
USER: "userInfo"
|
|
8539
|
+
};
|
|
8536
8540
|
const THEME_LOCAL_STORAGE_KEY = "STRAPI_THEME";
|
|
8537
8541
|
const LANGUAGE_LOCAL_STORAGE_KEY = "strapi-admin-language";
|
|
8538
8542
|
const adminSlice = createSlice({
|
|
@@ -8547,7 +8551,8 @@ const adminSlice = createSlice({
|
|
|
8547
8551
|
theme: {
|
|
8548
8552
|
availableThemes: [],
|
|
8549
8553
|
currentTheme: localStorage.getItem(THEME_LOCAL_STORAGE_KEY) || "system"
|
|
8550
|
-
}
|
|
8554
|
+
},
|
|
8555
|
+
token: null
|
|
8551
8556
|
};
|
|
8552
8557
|
},
|
|
8553
8558
|
reducers: {
|
|
@@ -8562,6 +8567,25 @@ const adminSlice = createSlice({
|
|
|
8562
8567
|
state.language.locale = action.payload;
|
|
8563
8568
|
window.localStorage.setItem(LANGUAGE_LOCAL_STORAGE_KEY, action.payload);
|
|
8564
8569
|
document.documentElement.setAttribute("lang", action.payload);
|
|
8570
|
+
},
|
|
8571
|
+
setToken(state, action) {
|
|
8572
|
+
state.token = action.payload;
|
|
8573
|
+
},
|
|
8574
|
+
login(state, action) {
|
|
8575
|
+
const { token, persist } = action.payload;
|
|
8576
|
+
if (!persist) {
|
|
8577
|
+
window.sessionStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
|
|
8578
|
+
} else {
|
|
8579
|
+
window.localStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
|
|
8580
|
+
}
|
|
8581
|
+
state.token = token;
|
|
8582
|
+
},
|
|
8583
|
+
logout(state) {
|
|
8584
|
+
state.token = null;
|
|
8585
|
+
window.localStorage.removeItem(STORAGE_KEYS$1.TOKEN);
|
|
8586
|
+
window.localStorage.removeItem(STORAGE_KEYS$1.USER);
|
|
8587
|
+
window.sessionStorage.removeItem(STORAGE_KEYS$1.TOKEN);
|
|
8588
|
+
window.sessionStorage.removeItem(STORAGE_KEYS$1.USER);
|
|
8565
8589
|
}
|
|
8566
8590
|
}
|
|
8567
8591
|
});
|
|
@@ -8738,6 +8762,46 @@ React.createContext({
|
|
|
8738
8762
|
toggleNotification: () => {
|
|
8739
8763
|
}
|
|
8740
8764
|
});
|
|
8765
|
+
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
8766
|
+
const path = toPath(key);
|
|
8767
|
+
while (obj && pathStartIndex < path.length) {
|
|
8768
|
+
obj = obj[path[pathStartIndex++]];
|
|
8769
|
+
}
|
|
8770
|
+
if (pathStartIndex !== path.length && !obj) {
|
|
8771
|
+
return def;
|
|
8772
|
+
}
|
|
8773
|
+
return obj === void 0 ? def : obj;
|
|
8774
|
+
}
|
|
8775
|
+
const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
|
|
8776
|
+
const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
|
|
8777
|
+
function setIn(obj, path, value) {
|
|
8778
|
+
const res = clone(obj);
|
|
8779
|
+
let resVal = res;
|
|
8780
|
+
let i = 0;
|
|
8781
|
+
const pathArray = toPath(path);
|
|
8782
|
+
for (; i < pathArray.length - 1; i++) {
|
|
8783
|
+
const currentPath = pathArray[i];
|
|
8784
|
+
const currentObj = getIn(obj, pathArray.slice(0, i + 1));
|
|
8785
|
+
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
|
|
8786
|
+
resVal = resVal[currentPath] = clone(currentObj);
|
|
8787
|
+
} else {
|
|
8788
|
+
const nextPath = pathArray[i + 1];
|
|
8789
|
+
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
8790
|
+
}
|
|
8791
|
+
}
|
|
8792
|
+
if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
|
|
8793
|
+
return obj;
|
|
8794
|
+
}
|
|
8795
|
+
if (value === void 0) {
|
|
8796
|
+
delete resVal[pathArray[i]];
|
|
8797
|
+
} else {
|
|
8798
|
+
resVal[pathArray[i]] = value;
|
|
8799
|
+
}
|
|
8800
|
+
if (i === 0 && value === void 0) {
|
|
8801
|
+
delete res[pathArray[i]];
|
|
8802
|
+
}
|
|
8803
|
+
return res;
|
|
8804
|
+
}
|
|
8741
8805
|
const [AppInfoProvider, useAppInfo] = createContext("AppInfo", {});
|
|
8742
8806
|
const TrackingContext = React.createContext({
|
|
8743
8807
|
uuid: false
|
|
@@ -8992,6 +9056,869 @@ function generateNKeysBetween(a2, b, n, digits = BASE_62_DIGITS) {
|
|
|
8992
9056
|
...generateNKeysBetween(c, b, n - mid - 1, digits)
|
|
8993
9057
|
];
|
|
8994
9058
|
}
|
|
9059
|
+
function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
|
|
9060
|
+
return amount - numerator * Math.floor(amount / numerator);
|
|
9061
|
+
}
|
|
9062
|
+
const $3b62074eb05584b2$var$EPOCH = 1721426;
|
|
9063
|
+
function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
|
|
9064
|
+
year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
|
|
9065
|
+
let y1 = year - 1;
|
|
9066
|
+
let monthOffset = -2;
|
|
9067
|
+
if (month <= 2)
|
|
9068
|
+
monthOffset = 0;
|
|
9069
|
+
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year))
|
|
9070
|
+
monthOffset = -1;
|
|
9071
|
+
return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
|
|
9072
|
+
}
|
|
9073
|
+
function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
|
|
9074
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
9075
|
+
}
|
|
9076
|
+
function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
|
|
9077
|
+
return era === "BC" ? 1 - year : year;
|
|
9078
|
+
}
|
|
9079
|
+
function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
|
|
9080
|
+
let era = "AD";
|
|
9081
|
+
if (year <= 0) {
|
|
9082
|
+
era = "BC";
|
|
9083
|
+
year = 1 - year;
|
|
9084
|
+
}
|
|
9085
|
+
return [
|
|
9086
|
+
era,
|
|
9087
|
+
year
|
|
9088
|
+
];
|
|
9089
|
+
}
|
|
9090
|
+
const $3b62074eb05584b2$var$daysInMonth = {
|
|
9091
|
+
standard: [
|
|
9092
|
+
31,
|
|
9093
|
+
28,
|
|
9094
|
+
31,
|
|
9095
|
+
30,
|
|
9096
|
+
31,
|
|
9097
|
+
30,
|
|
9098
|
+
31,
|
|
9099
|
+
31,
|
|
9100
|
+
30,
|
|
9101
|
+
31,
|
|
9102
|
+
30,
|
|
9103
|
+
31
|
|
9104
|
+
],
|
|
9105
|
+
leapyear: [
|
|
9106
|
+
31,
|
|
9107
|
+
29,
|
|
9108
|
+
31,
|
|
9109
|
+
30,
|
|
9110
|
+
31,
|
|
9111
|
+
30,
|
|
9112
|
+
31,
|
|
9113
|
+
31,
|
|
9114
|
+
30,
|
|
9115
|
+
31,
|
|
9116
|
+
30,
|
|
9117
|
+
31
|
|
9118
|
+
]
|
|
9119
|
+
};
|
|
9120
|
+
class $3b62074eb05584b2$export$80ee6245ec4f29ec {
|
|
9121
|
+
fromJulianDay(jd) {
|
|
9122
|
+
let jd0 = jd;
|
|
9123
|
+
let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
|
|
9124
|
+
let quadricent = Math.floor(depoch / 146097);
|
|
9125
|
+
let dqc = $2b4dce13dd5a17fa$export$842a2cf37af977e1(depoch, 146097);
|
|
9126
|
+
let cent = Math.floor(dqc / 36524);
|
|
9127
|
+
let dcent = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dqc, 36524);
|
|
9128
|
+
let quad = Math.floor(dcent / 1461);
|
|
9129
|
+
let dquad = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dcent, 1461);
|
|
9130
|
+
let yindex = Math.floor(dquad / 365);
|
|
9131
|
+
let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
|
|
9132
|
+
let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
|
|
9133
|
+
let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
|
|
9134
|
+
let leapAdj = 2;
|
|
9135
|
+
if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1))
|
|
9136
|
+
leapAdj = 0;
|
|
9137
|
+
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year))
|
|
9138
|
+
leapAdj = 1;
|
|
9139
|
+
let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
|
|
9140
|
+
let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
|
|
9141
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(era, year, month, day);
|
|
9142
|
+
}
|
|
9143
|
+
toJulianDay(date) {
|
|
9144
|
+
return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
|
|
9145
|
+
}
|
|
9146
|
+
getDaysInMonth(date) {
|
|
9147
|
+
return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
|
|
9148
|
+
}
|
|
9149
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9150
|
+
getMonthsInYear(date) {
|
|
9151
|
+
return 12;
|
|
9152
|
+
}
|
|
9153
|
+
getDaysInYear(date) {
|
|
9154
|
+
return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
|
|
9155
|
+
}
|
|
9156
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9157
|
+
getYearsInEra(date) {
|
|
9158
|
+
return 9999;
|
|
9159
|
+
}
|
|
9160
|
+
getEras() {
|
|
9161
|
+
return [
|
|
9162
|
+
"BC",
|
|
9163
|
+
"AD"
|
|
9164
|
+
];
|
|
9165
|
+
}
|
|
9166
|
+
isInverseEra(date) {
|
|
9167
|
+
return date.era === "BC";
|
|
9168
|
+
}
|
|
9169
|
+
balanceDate(date) {
|
|
9170
|
+
if (date.year <= 0) {
|
|
9171
|
+
date.era = date.era === "BC" ? "AD" : "BC";
|
|
9172
|
+
date.year = 1 - date.year;
|
|
9173
|
+
}
|
|
9174
|
+
}
|
|
9175
|
+
constructor() {
|
|
9176
|
+
this.identifier = "gregory";
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a2, b) {
|
|
9180
|
+
return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
|
|
9181
|
+
}
|
|
9182
|
+
function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a2, b) {
|
|
9183
|
+
return $14e0f24ef4ac5c92$var$timeToMs(a2) - $14e0f24ef4ac5c92$var$timeToMs(b);
|
|
9184
|
+
}
|
|
9185
|
+
function $14e0f24ef4ac5c92$var$timeToMs(a2) {
|
|
9186
|
+
return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
|
|
9187
|
+
}
|
|
9188
|
+
let $14e0f24ef4ac5c92$var$localTimeZone = null;
|
|
9189
|
+
function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
|
|
9190
|
+
if ($14e0f24ef4ac5c92$var$localTimeZone == null)
|
|
9191
|
+
$14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
9192
|
+
return $14e0f24ef4ac5c92$var$localTimeZone;
|
|
9193
|
+
}
|
|
9194
|
+
function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
|
|
9195
|
+
date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9196
|
+
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(date.era, date.year);
|
|
9197
|
+
return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
|
|
9198
|
+
}
|
|
9199
|
+
function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
|
|
9200
|
+
let date = /* @__PURE__ */ new Date();
|
|
9201
|
+
date.setUTCHours(hour, minute, second, millisecond);
|
|
9202
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
9203
|
+
return date.getTime();
|
|
9204
|
+
}
|
|
9205
|
+
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
|
|
9206
|
+
if (timeZone === "UTC")
|
|
9207
|
+
return 0;
|
|
9208
|
+
if (ms > 0 && timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2())
|
|
9209
|
+
return new Date(ms).getTimezoneOffset() * -6e4;
|
|
9210
|
+
let { year, month, day, hour, minute, second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
|
|
9211
|
+
let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
|
|
9212
|
+
return utc - Math.floor(ms / 1e3) * 1e3;
|
|
9213
|
+
}
|
|
9214
|
+
const $11d87f3f76e88657$var$formattersByTimeZone = /* @__PURE__ */ new Map();
|
|
9215
|
+
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
|
|
9216
|
+
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
|
|
9217
|
+
if (!formatter) {
|
|
9218
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
9219
|
+
timeZone,
|
|
9220
|
+
hour12: false,
|
|
9221
|
+
era: "short",
|
|
9222
|
+
year: "numeric",
|
|
9223
|
+
month: "numeric",
|
|
9224
|
+
day: "numeric",
|
|
9225
|
+
hour: "numeric",
|
|
9226
|
+
minute: "numeric",
|
|
9227
|
+
second: "numeric"
|
|
9228
|
+
});
|
|
9229
|
+
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
|
|
9230
|
+
}
|
|
9231
|
+
let parts = formatter.formatToParts(new Date(ms));
|
|
9232
|
+
let namedParts = {};
|
|
9233
|
+
for (let part of parts)
|
|
9234
|
+
if (part.type !== "literal")
|
|
9235
|
+
namedParts[part.type] = part.value;
|
|
9236
|
+
return {
|
|
9237
|
+
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
|
|
9238
|
+
year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
|
|
9239
|
+
month: +namedParts.month,
|
|
9240
|
+
day: +namedParts.day,
|
|
9241
|
+
hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
|
|
9242
|
+
minute: +namedParts.minute,
|
|
9243
|
+
second: +namedParts.second
|
|
9244
|
+
};
|
|
9245
|
+
}
|
|
9246
|
+
const $11d87f3f76e88657$var$DAYMILLIS = 864e5;
|
|
9247
|
+
function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
|
|
9248
|
+
let found = earlier === later ? [
|
|
9249
|
+
earlier
|
|
9250
|
+
] : [
|
|
9251
|
+
earlier,
|
|
9252
|
+
later
|
|
9253
|
+
];
|
|
9254
|
+
return found.filter((absolute) => $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
|
|
9255
|
+
}
|
|
9256
|
+
function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
|
|
9257
|
+
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
|
|
9258
|
+
return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
|
|
9259
|
+
}
|
|
9260
|
+
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
|
|
9261
|
+
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
|
|
9262
|
+
if (timeZone === "UTC")
|
|
9263
|
+
return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9264
|
+
if (timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2() && disambiguation === "compatible") {
|
|
9265
|
+
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9266
|
+
let date2 = /* @__PURE__ */ new Date();
|
|
9267
|
+
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(dateTime.era, dateTime.year);
|
|
9268
|
+
date2.setFullYear(year, dateTime.month - 1, dateTime.day);
|
|
9269
|
+
date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
9270
|
+
return date2.getTime();
|
|
9271
|
+
}
|
|
9272
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9273
|
+
let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9274
|
+
let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9275
|
+
let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
|
|
9276
|
+
if (valid.length === 1)
|
|
9277
|
+
return valid[0];
|
|
9278
|
+
if (valid.length > 1)
|
|
9279
|
+
switch (disambiguation) {
|
|
9280
|
+
case "compatible":
|
|
9281
|
+
case "earlier":
|
|
9282
|
+
return valid[0];
|
|
9283
|
+
case "later":
|
|
9284
|
+
return valid[valid.length - 1];
|
|
9285
|
+
case "reject":
|
|
9286
|
+
throw new RangeError("Multiple possible absolute times found");
|
|
9287
|
+
}
|
|
9288
|
+
switch (disambiguation) {
|
|
9289
|
+
case "earlier":
|
|
9290
|
+
return Math.min(ms - offsetBefore, ms - offsetAfter);
|
|
9291
|
+
case "compatible":
|
|
9292
|
+
case "later":
|
|
9293
|
+
return Math.max(ms - offsetBefore, ms - offsetAfter);
|
|
9294
|
+
case "reject":
|
|
9295
|
+
throw new RangeError("No such absolute time found");
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9298
|
+
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
|
|
9299
|
+
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
9300
|
+
}
|
|
9301
|
+
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
9302
|
+
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
|
|
9303
|
+
let date = new Date(ms + offset);
|
|
9304
|
+
let year = date.getUTCFullYear();
|
|
9305
|
+
let month = date.getUTCMonth() + 1;
|
|
9306
|
+
let day = date.getUTCDate();
|
|
9307
|
+
let hour = date.getUTCHours();
|
|
9308
|
+
let minute = date.getUTCMinutes();
|
|
9309
|
+
let second = date.getUTCSeconds();
|
|
9310
|
+
let millisecond = date.getUTCMilliseconds();
|
|
9311
|
+
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
9312
|
+
}
|
|
9313
|
+
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
|
|
9314
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
9315
|
+
}
|
|
9316
|
+
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
9317
|
+
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
9318
|
+
if ("timeZone" in date)
|
|
9319
|
+
({ hour, minute, second, millisecond } = date);
|
|
9320
|
+
else if ("hour" in date && !time)
|
|
9321
|
+
return date;
|
|
9322
|
+
if (time)
|
|
9323
|
+
({ hour, minute, second, millisecond } = time);
|
|
9324
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
9325
|
+
}
|
|
9326
|
+
function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
|
|
9327
|
+
if (date.calendar.identifier === calendar.identifier)
|
|
9328
|
+
return date;
|
|
9329
|
+
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
|
|
9330
|
+
let copy = date.copy();
|
|
9331
|
+
copy.calendar = calendar;
|
|
9332
|
+
copy.era = calendarDate.era;
|
|
9333
|
+
copy.year = calendarDate.year;
|
|
9334
|
+
copy.month = calendarDate.month;
|
|
9335
|
+
copy.day = calendarDate.day;
|
|
9336
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(copy);
|
|
9337
|
+
return copy;
|
|
9338
|
+
}
|
|
9339
|
+
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
9340
|
+
if (date instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
|
|
9341
|
+
if (date.timeZone === timeZone)
|
|
9342
|
+
return date;
|
|
9343
|
+
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
9344
|
+
}
|
|
9345
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
9346
|
+
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
|
|
9347
|
+
}
|
|
9348
|
+
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
|
|
9349
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9350
|
+
return new Date(ms);
|
|
9351
|
+
}
|
|
9352
|
+
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
|
|
9353
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9354
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
9355
|
+
}
|
|
9356
|
+
const $735220c2d4774dd3$var$ONE_HOUR = 36e5;
|
|
9357
|
+
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
|
|
9358
|
+
let mutableDate = date.copy();
|
|
9359
|
+
let days = "hour" in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
|
|
9360
|
+
$735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
|
|
9361
|
+
if (mutableDate.calendar.balanceYearMonth)
|
|
9362
|
+
mutableDate.calendar.balanceYearMonth(mutableDate, date);
|
|
9363
|
+
mutableDate.month += duration.months || 0;
|
|
9364
|
+
$735220c2d4774dd3$var$balanceYearMonth(mutableDate);
|
|
9365
|
+
$735220c2d4774dd3$var$constrainMonthDay(mutableDate);
|
|
9366
|
+
mutableDate.day += (duration.weeks || 0) * 7;
|
|
9367
|
+
mutableDate.day += duration.days || 0;
|
|
9368
|
+
mutableDate.day += days;
|
|
9369
|
+
$735220c2d4774dd3$var$balanceDay(mutableDate);
|
|
9370
|
+
if (mutableDate.calendar.balanceDate)
|
|
9371
|
+
mutableDate.calendar.balanceDate(mutableDate);
|
|
9372
|
+
if (mutableDate.year < 1) {
|
|
9373
|
+
mutableDate.year = 1;
|
|
9374
|
+
mutableDate.month = 1;
|
|
9375
|
+
mutableDate.day = 1;
|
|
9376
|
+
}
|
|
9377
|
+
let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
|
|
9378
|
+
if (mutableDate.year > maxYear) {
|
|
9379
|
+
var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
|
|
9380
|
+
let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
|
|
9381
|
+
mutableDate.year = maxYear;
|
|
9382
|
+
mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9383
|
+
mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9384
|
+
}
|
|
9385
|
+
if (mutableDate.month < 1) {
|
|
9386
|
+
mutableDate.month = 1;
|
|
9387
|
+
mutableDate.day = 1;
|
|
9388
|
+
}
|
|
9389
|
+
let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9390
|
+
if (mutableDate.month > maxMonth) {
|
|
9391
|
+
mutableDate.month = maxMonth;
|
|
9392
|
+
mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9393
|
+
}
|
|
9394
|
+
mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
|
|
9395
|
+
return mutableDate;
|
|
9396
|
+
}
|
|
9397
|
+
function $735220c2d4774dd3$var$addYears(date, years) {
|
|
9398
|
+
var _date_calendar_isInverseEra, _date_calendar;
|
|
9399
|
+
if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date))
|
|
9400
|
+
years = -years;
|
|
9401
|
+
date.year += years;
|
|
9402
|
+
}
|
|
9403
|
+
function $735220c2d4774dd3$var$balanceYearMonth(date) {
|
|
9404
|
+
while (date.month < 1) {
|
|
9405
|
+
$735220c2d4774dd3$var$addYears(date, -1);
|
|
9406
|
+
date.month += date.calendar.getMonthsInYear(date);
|
|
9407
|
+
}
|
|
9408
|
+
let monthsInYear = 0;
|
|
9409
|
+
while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
|
|
9410
|
+
date.month -= monthsInYear;
|
|
9411
|
+
$735220c2d4774dd3$var$addYears(date, 1);
|
|
9412
|
+
}
|
|
9413
|
+
}
|
|
9414
|
+
function $735220c2d4774dd3$var$balanceDay(date) {
|
|
9415
|
+
while (date.day < 1) {
|
|
9416
|
+
date.month--;
|
|
9417
|
+
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9418
|
+
date.day += date.calendar.getDaysInMonth(date);
|
|
9419
|
+
}
|
|
9420
|
+
while (date.day > date.calendar.getDaysInMonth(date)) {
|
|
9421
|
+
date.day -= date.calendar.getDaysInMonth(date);
|
|
9422
|
+
date.month++;
|
|
9423
|
+
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9424
|
+
}
|
|
9425
|
+
}
|
|
9426
|
+
function $735220c2d4774dd3$var$constrainMonthDay(date) {
|
|
9427
|
+
date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
|
|
9428
|
+
date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
|
|
9429
|
+
}
|
|
9430
|
+
function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
|
|
9431
|
+
if (date.calendar.constrainDate)
|
|
9432
|
+
date.calendar.constrainDate(date);
|
|
9433
|
+
date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
|
|
9434
|
+
$735220c2d4774dd3$var$constrainMonthDay(date);
|
|
9435
|
+
}
|
|
9436
|
+
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
|
|
9437
|
+
let inverseDuration = {};
|
|
9438
|
+
for (let key in duration)
|
|
9439
|
+
if (typeof duration[key] === "number")
|
|
9440
|
+
inverseDuration[key] = -duration[key];
|
|
9441
|
+
return inverseDuration;
|
|
9442
|
+
}
|
|
9443
|
+
function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
|
|
9444
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
9445
|
+
}
|
|
9446
|
+
function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
|
|
9447
|
+
let mutableDate = date.copy();
|
|
9448
|
+
if (fields.era != null)
|
|
9449
|
+
mutableDate.era = fields.era;
|
|
9450
|
+
if (fields.year != null)
|
|
9451
|
+
mutableDate.year = fields.year;
|
|
9452
|
+
if (fields.month != null)
|
|
9453
|
+
mutableDate.month = fields.month;
|
|
9454
|
+
if (fields.day != null)
|
|
9455
|
+
mutableDate.day = fields.day;
|
|
9456
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
|
|
9457
|
+
return mutableDate;
|
|
9458
|
+
}
|
|
9459
|
+
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
|
|
9460
|
+
let mutableValue = value.copy();
|
|
9461
|
+
if (fields.hour != null)
|
|
9462
|
+
mutableValue.hour = fields.hour;
|
|
9463
|
+
if (fields.minute != null)
|
|
9464
|
+
mutableValue.minute = fields.minute;
|
|
9465
|
+
if (fields.second != null)
|
|
9466
|
+
mutableValue.second = fields.second;
|
|
9467
|
+
if (fields.millisecond != null)
|
|
9468
|
+
mutableValue.millisecond = fields.millisecond;
|
|
9469
|
+
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
|
|
9470
|
+
return mutableValue;
|
|
9471
|
+
}
|
|
9472
|
+
function $735220c2d4774dd3$var$balanceTime(time) {
|
|
9473
|
+
time.second += Math.floor(time.millisecond / 1e3);
|
|
9474
|
+
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1e3);
|
|
9475
|
+
time.minute += Math.floor(time.second / 60);
|
|
9476
|
+
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
|
|
9477
|
+
time.hour += Math.floor(time.minute / 60);
|
|
9478
|
+
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
|
|
9479
|
+
let days = Math.floor(time.hour / 24);
|
|
9480
|
+
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
|
|
9481
|
+
return days;
|
|
9482
|
+
}
|
|
9483
|
+
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
|
|
9484
|
+
time.millisecond = Math.max(0, Math.min(time.millisecond, 1e3));
|
|
9485
|
+
time.second = Math.max(0, Math.min(time.second, 59));
|
|
9486
|
+
time.minute = Math.max(0, Math.min(time.minute, 59));
|
|
9487
|
+
time.hour = Math.max(0, Math.min(time.hour, 23));
|
|
9488
|
+
}
|
|
9489
|
+
function $735220c2d4774dd3$var$nonNegativeMod(a2, b) {
|
|
9490
|
+
let result = a2 % b;
|
|
9491
|
+
if (result < 0)
|
|
9492
|
+
result += b;
|
|
9493
|
+
return result;
|
|
9494
|
+
}
|
|
9495
|
+
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
|
|
9496
|
+
time.hour += duration.hours || 0;
|
|
9497
|
+
time.minute += duration.minutes || 0;
|
|
9498
|
+
time.second += duration.seconds || 0;
|
|
9499
|
+
time.millisecond += duration.milliseconds || 0;
|
|
9500
|
+
return $735220c2d4774dd3$var$balanceTime(time);
|
|
9501
|
+
}
|
|
9502
|
+
function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
|
|
9503
|
+
let mutable = value.copy();
|
|
9504
|
+
switch (field) {
|
|
9505
|
+
case "era": {
|
|
9506
|
+
let eras = value.calendar.getEras();
|
|
9507
|
+
let eraIndex = eras.indexOf(value.era);
|
|
9508
|
+
if (eraIndex < 0)
|
|
9509
|
+
throw new Error("Invalid era: " + value.era);
|
|
9510
|
+
eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
|
|
9511
|
+
mutable.era = eras[eraIndex];
|
|
9512
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9513
|
+
break;
|
|
9514
|
+
}
|
|
9515
|
+
case "year":
|
|
9516
|
+
var _mutable_calendar_isInverseEra, _mutable_calendar;
|
|
9517
|
+
if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable))
|
|
9518
|
+
amount = -amount;
|
|
9519
|
+
mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
|
|
9520
|
+
if (mutable.year === -Infinity)
|
|
9521
|
+
mutable.year = 1;
|
|
9522
|
+
if (mutable.calendar.balanceYearMonth)
|
|
9523
|
+
mutable.calendar.balanceYearMonth(mutable, value);
|
|
9524
|
+
break;
|
|
9525
|
+
case "month":
|
|
9526
|
+
mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9527
|
+
break;
|
|
9528
|
+
case "day":
|
|
9529
|
+
mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9530
|
+
break;
|
|
9531
|
+
default:
|
|
9532
|
+
throw new Error("Unsupported field " + field);
|
|
9533
|
+
}
|
|
9534
|
+
if (value.calendar.balanceDate)
|
|
9535
|
+
value.calendar.balanceDate(mutable);
|
|
9536
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9537
|
+
return mutable;
|
|
9538
|
+
}
|
|
9539
|
+
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
|
|
9540
|
+
let mutable = value.copy();
|
|
9541
|
+
switch (field) {
|
|
9542
|
+
case "hour": {
|
|
9543
|
+
let hours = value.hour;
|
|
9544
|
+
let min = 0;
|
|
9545
|
+
let max = 23;
|
|
9546
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
9547
|
+
let isPM = hours >= 12;
|
|
9548
|
+
min = isPM ? 12 : 0;
|
|
9549
|
+
max = isPM ? 23 : 11;
|
|
9550
|
+
}
|
|
9551
|
+
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
|
|
9552
|
+
break;
|
|
9553
|
+
}
|
|
9554
|
+
case "minute":
|
|
9555
|
+
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9556
|
+
break;
|
|
9557
|
+
case "second":
|
|
9558
|
+
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9559
|
+
break;
|
|
9560
|
+
case "millisecond":
|
|
9561
|
+
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
|
|
9562
|
+
break;
|
|
9563
|
+
default:
|
|
9564
|
+
throw new Error("Unsupported field " + field);
|
|
9565
|
+
}
|
|
9566
|
+
return mutable;
|
|
9567
|
+
}
|
|
9568
|
+
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
|
|
9569
|
+
if (round) {
|
|
9570
|
+
value += Math.sign(amount);
|
|
9571
|
+
if (value < min)
|
|
9572
|
+
value = max;
|
|
9573
|
+
let div = Math.abs(amount);
|
|
9574
|
+
if (amount > 0)
|
|
9575
|
+
value = Math.ceil(value / div) * div;
|
|
9576
|
+
else
|
|
9577
|
+
value = Math.floor(value / div) * div;
|
|
9578
|
+
if (value > max)
|
|
9579
|
+
value = min;
|
|
9580
|
+
} else {
|
|
9581
|
+
value += amount;
|
|
9582
|
+
if (value < min)
|
|
9583
|
+
value = max - (min - value - 1);
|
|
9584
|
+
else if (value > max)
|
|
9585
|
+
value = min + (value - max - 1);
|
|
9586
|
+
}
|
|
9587
|
+
return value;
|
|
9588
|
+
}
|
|
9589
|
+
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
|
|
9590
|
+
let ms;
|
|
9591
|
+
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
|
|
9592
|
+
let res2 = $735220c2d4774dd3$export$e16d8520af44a096($11d87f3f76e88657$export$b21e0b124e224484(dateTime), {
|
|
9593
|
+
years: duration.years,
|
|
9594
|
+
months: duration.months,
|
|
9595
|
+
weeks: duration.weeks,
|
|
9596
|
+
days: duration.days
|
|
9597
|
+
});
|
|
9598
|
+
ms = $11d87f3f76e88657$export$5107c82f94518f5c(res2, dateTime.timeZone);
|
|
9599
|
+
} else
|
|
9600
|
+
ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
9601
|
+
ms += duration.milliseconds || 0;
|
|
9602
|
+
ms += (duration.seconds || 0) * 1e3;
|
|
9603
|
+
ms += (duration.minutes || 0) * 6e4;
|
|
9604
|
+
ms += (duration.hours || 0) * 36e5;
|
|
9605
|
+
let res = $11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone);
|
|
9606
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032(res, dateTime.calendar);
|
|
9607
|
+
}
|
|
9608
|
+
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
|
|
9609
|
+
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
9610
|
+
}
|
|
9611
|
+
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
9612
|
+
switch (field) {
|
|
9613
|
+
case "hour": {
|
|
9614
|
+
let min = 0;
|
|
9615
|
+
let max = 23;
|
|
9616
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
9617
|
+
let isPM = dateTime.hour >= 12;
|
|
9618
|
+
min = isPM ? 12 : 0;
|
|
9619
|
+
max = isPM ? 23 : 11;
|
|
9620
|
+
}
|
|
9621
|
+
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
9622
|
+
let minDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
9623
|
+
hour: min
|
|
9624
|
+
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9625
|
+
let minAbsolute = [
|
|
9626
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "earlier"),
|
|
9627
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "later")
|
|
9628
|
+
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === minDate.day)[0];
|
|
9629
|
+
let maxDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
9630
|
+
hour: max
|
|
9631
|
+
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9632
|
+
let maxAbsolute = [
|
|
9633
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "earlier"),
|
|
9634
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "later")
|
|
9635
|
+
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === maxDate.day).pop();
|
|
9636
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
9637
|
+
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
|
|
9638
|
+
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
|
|
9639
|
+
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
|
|
9640
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9641
|
+
}
|
|
9642
|
+
case "minute":
|
|
9643
|
+
case "second":
|
|
9644
|
+
case "millisecond":
|
|
9645
|
+
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
9646
|
+
case "era":
|
|
9647
|
+
case "year":
|
|
9648
|
+
case "month":
|
|
9649
|
+
case "day": {
|
|
9650
|
+
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c($11d87f3f76e88657$export$b21e0b124e224484(dateTime), field, amount, options);
|
|
9651
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone);
|
|
9652
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9653
|
+
}
|
|
9654
|
+
default:
|
|
9655
|
+
throw new Error("Unsupported field " + field);
|
|
9656
|
+
}
|
|
9657
|
+
}
|
|
9658
|
+
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
9659
|
+
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
9660
|
+
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
9661
|
+
if (res.compare(plainDateTime) === 0)
|
|
9662
|
+
return dateTime;
|
|
9663
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation);
|
|
9664
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9665
|
+
}
|
|
9666
|
+
const $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
9667
|
+
function $fae977aafc393c5c$export$5adfdab05168c219(value, timeZone) {
|
|
9668
|
+
let m = value.match($fae977aafc393c5c$var$ABSOLUTE_RE);
|
|
9669
|
+
if (!m)
|
|
9670
|
+
throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
9671
|
+
let date = new $35ea8db9cb2ccb90$export$d3b7288e7994edea($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1e3 : 0);
|
|
9672
|
+
date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
9673
|
+
var _m_;
|
|
9674
|
+
if (m[8])
|
|
9675
|
+
date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 36e5 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 6e4;
|
|
9676
|
+
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
9677
|
+
}
|
|
9678
|
+
function $fae977aafc393c5c$var$parseNumber(value, min, max) {
|
|
9679
|
+
let val = Number(value);
|
|
9680
|
+
if (val < min || val > max)
|
|
9681
|
+
throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
9682
|
+
return val;
|
|
9683
|
+
}
|
|
9684
|
+
function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
|
|
9685
|
+
return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
|
|
9686
|
+
}
|
|
9687
|
+
function $fae977aafc393c5c$export$60dfd74aa96791bd(date) {
|
|
9688
|
+
let gregorianDate = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9689
|
+
return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
|
|
9690
|
+
}
|
|
9691
|
+
function $fae977aafc393c5c$export$4223de14708adc63(date) {
|
|
9692
|
+
return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
|
|
9693
|
+
}
|
|
9694
|
+
function $fae977aafc393c5c$var$offsetToString(offset) {
|
|
9695
|
+
let sign = Math.sign(offset) < 0 ? "-" : "+";
|
|
9696
|
+
offset = Math.abs(offset);
|
|
9697
|
+
let offsetHours = Math.floor(offset / 36e5);
|
|
9698
|
+
let offsetMinutes = offset % 36e5 / 6e4;
|
|
9699
|
+
return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
|
|
9700
|
+
}
|
|
9701
|
+
function $fae977aafc393c5c$export$bf79f1ebf4b18792(date) {
|
|
9702
|
+
return `${$fae977aafc393c5c$export$4223de14708adc63(date)}${$fae977aafc393c5c$var$offsetToString(date.offset)}[${date.timeZone}]`;
|
|
9703
|
+
}
|
|
9704
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
9705
|
+
if (privateCollection.has(obj)) {
|
|
9706
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
9707
|
+
}
|
|
9708
|
+
}
|
|
9709
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
9710
|
+
_check_private_redeclaration(obj, privateMap);
|
|
9711
|
+
privateMap.set(obj, value);
|
|
9712
|
+
}
|
|
9713
|
+
function $35ea8db9cb2ccb90$var$shiftArgs(args) {
|
|
9714
|
+
let calendar = typeof args[0] === "object" ? args.shift() : new $3b62074eb05584b2$export$80ee6245ec4f29ec();
|
|
9715
|
+
let era;
|
|
9716
|
+
if (typeof args[0] === "string")
|
|
9717
|
+
era = args.shift();
|
|
9718
|
+
else {
|
|
9719
|
+
let eras = calendar.getEras();
|
|
9720
|
+
era = eras[eras.length - 1];
|
|
9721
|
+
}
|
|
9722
|
+
let year = args.shift();
|
|
9723
|
+
let month = args.shift();
|
|
9724
|
+
let day = args.shift();
|
|
9725
|
+
return [
|
|
9726
|
+
calendar,
|
|
9727
|
+
era,
|
|
9728
|
+
year,
|
|
9729
|
+
month,
|
|
9730
|
+
day
|
|
9731
|
+
];
|
|
9732
|
+
}
|
|
9733
|
+
var $35ea8db9cb2ccb90$var$_type = /* @__PURE__ */ new WeakMap();
|
|
9734
|
+
class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
|
|
9735
|
+
/** Returns a copy of this date. */
|
|
9736
|
+
copy() {
|
|
9737
|
+
if (this.era)
|
|
9738
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
9739
|
+
else
|
|
9740
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
9741
|
+
}
|
|
9742
|
+
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
9743
|
+
add(duration) {
|
|
9744
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
9745
|
+
}
|
|
9746
|
+
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
9747
|
+
subtract(duration) {
|
|
9748
|
+
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
9749
|
+
}
|
|
9750
|
+
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9751
|
+
set(fields) {
|
|
9752
|
+
return $735220c2d4774dd3$export$adaa4cf7ef1b65be(this, fields);
|
|
9753
|
+
}
|
|
9754
|
+
/**
|
|
9755
|
+
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
9756
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9757
|
+
*/
|
|
9758
|
+
cycle(field, amount, options) {
|
|
9759
|
+
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
9760
|
+
}
|
|
9761
|
+
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
9762
|
+
toDate(timeZone) {
|
|
9763
|
+
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone);
|
|
9764
|
+
}
|
|
9765
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
9766
|
+
toString() {
|
|
9767
|
+
return $fae977aafc393c5c$export$60dfd74aa96791bd(this);
|
|
9768
|
+
}
|
|
9769
|
+
/** 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. */
|
|
9770
|
+
compare(b) {
|
|
9771
|
+
return $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
9772
|
+
}
|
|
9773
|
+
constructor(...args) {
|
|
9774
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type, {
|
|
9775
|
+
writable: true,
|
|
9776
|
+
value: void 0
|
|
9777
|
+
});
|
|
9778
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9779
|
+
this.calendar = calendar;
|
|
9780
|
+
this.era = era;
|
|
9781
|
+
this.year = year;
|
|
9782
|
+
this.month = month;
|
|
9783
|
+
this.day = day;
|
|
9784
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9787
|
+
var $35ea8db9cb2ccb90$var$_type2 = /* @__PURE__ */ new WeakMap();
|
|
9788
|
+
class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
|
|
9789
|
+
/** Returns a copy of this date. */
|
|
9790
|
+
copy() {
|
|
9791
|
+
if (this.era)
|
|
9792
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
9793
|
+
else
|
|
9794
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
9795
|
+
}
|
|
9796
|
+
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
9797
|
+
add(duration) {
|
|
9798
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
9799
|
+
}
|
|
9800
|
+
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
9801
|
+
subtract(duration) {
|
|
9802
|
+
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
9803
|
+
}
|
|
9804
|
+
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9805
|
+
set(fields) {
|
|
9806
|
+
return $735220c2d4774dd3$export$adaa4cf7ef1b65be($735220c2d4774dd3$export$e5d5e1c1822b6e56(this, fields), fields);
|
|
9807
|
+
}
|
|
9808
|
+
/**
|
|
9809
|
+
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
9810
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9811
|
+
*/
|
|
9812
|
+
cycle(field, amount, options) {
|
|
9813
|
+
switch (field) {
|
|
9814
|
+
case "era":
|
|
9815
|
+
case "year":
|
|
9816
|
+
case "month":
|
|
9817
|
+
case "day":
|
|
9818
|
+
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
9819
|
+
default:
|
|
9820
|
+
return $735220c2d4774dd3$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
9821
|
+
}
|
|
9822
|
+
}
|
|
9823
|
+
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
9824
|
+
toDate(timeZone, disambiguation) {
|
|
9825
|
+
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone, disambiguation);
|
|
9826
|
+
}
|
|
9827
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
9828
|
+
toString() {
|
|
9829
|
+
return $fae977aafc393c5c$export$4223de14708adc63(this);
|
|
9830
|
+
}
|
|
9831
|
+
/** 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. */
|
|
9832
|
+
compare(b) {
|
|
9833
|
+
let res = $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
9834
|
+
if (res === 0)
|
|
9835
|
+
return $14e0f24ef4ac5c92$export$c19a80a9721b80f6(this, $11d87f3f76e88657$export$b21e0b124e224484(b));
|
|
9836
|
+
return res;
|
|
9837
|
+
}
|
|
9838
|
+
constructor(...args) {
|
|
9839
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type2, {
|
|
9840
|
+
writable: true,
|
|
9841
|
+
value: void 0
|
|
9842
|
+
});
|
|
9843
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9844
|
+
this.calendar = calendar;
|
|
9845
|
+
this.era = era;
|
|
9846
|
+
this.year = year;
|
|
9847
|
+
this.month = month;
|
|
9848
|
+
this.day = day;
|
|
9849
|
+
this.hour = args.shift() || 0;
|
|
9850
|
+
this.minute = args.shift() || 0;
|
|
9851
|
+
this.second = args.shift() || 0;
|
|
9852
|
+
this.millisecond = args.shift() || 0;
|
|
9853
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9854
|
+
}
|
|
9855
|
+
}
|
|
9856
|
+
var $35ea8db9cb2ccb90$var$_type3 = /* @__PURE__ */ new WeakMap();
|
|
9857
|
+
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
|
|
9858
|
+
/** Returns a copy of this date. */
|
|
9859
|
+
copy() {
|
|
9860
|
+
if (this.era)
|
|
9861
|
+
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
9862
|
+
else
|
|
9863
|
+
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
9864
|
+
}
|
|
9865
|
+
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
9866
|
+
add(duration) {
|
|
9867
|
+
return $735220c2d4774dd3$export$96b1d28349274637(this, duration);
|
|
9868
|
+
}
|
|
9869
|
+
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
9870
|
+
subtract(duration) {
|
|
9871
|
+
return $735220c2d4774dd3$export$6814caac34ca03c7(this, duration);
|
|
9872
|
+
}
|
|
9873
|
+
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9874
|
+
set(fields, disambiguation) {
|
|
9875
|
+
return $735220c2d4774dd3$export$31b5430eb18be4f8(this, fields, disambiguation);
|
|
9876
|
+
}
|
|
9877
|
+
/**
|
|
9878
|
+
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
9879
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9880
|
+
*/
|
|
9881
|
+
cycle(field, amount, options) {
|
|
9882
|
+
return $735220c2d4774dd3$export$9a297d111fc86b79(this, field, amount, options);
|
|
9883
|
+
}
|
|
9884
|
+
/** Converts the date to a native JavaScript Date object. */
|
|
9885
|
+
toDate() {
|
|
9886
|
+
return $11d87f3f76e88657$export$83aac07b4c37b25(this);
|
|
9887
|
+
}
|
|
9888
|
+
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
|
|
9889
|
+
toString() {
|
|
9890
|
+
return $fae977aafc393c5c$export$bf79f1ebf4b18792(this);
|
|
9891
|
+
}
|
|
9892
|
+
/** Converts the date to an ISO 8601 formatted string in UTC. */
|
|
9893
|
+
toAbsoluteString() {
|
|
9894
|
+
return this.toDate().toISOString();
|
|
9895
|
+
}
|
|
9896
|
+
/** 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. */
|
|
9897
|
+
compare(b) {
|
|
9898
|
+
return this.toDate().getTime() - $11d87f3f76e88657$export$84c95a83c799e074(b, this.timeZone).toDate().getTime();
|
|
9899
|
+
}
|
|
9900
|
+
constructor(...args) {
|
|
9901
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type3, {
|
|
9902
|
+
writable: true,
|
|
9903
|
+
value: void 0
|
|
9904
|
+
});
|
|
9905
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9906
|
+
let timeZone = args.shift();
|
|
9907
|
+
let offset = args.shift();
|
|
9908
|
+
this.calendar = calendar;
|
|
9909
|
+
this.era = era;
|
|
9910
|
+
this.year = year;
|
|
9911
|
+
this.month = month;
|
|
9912
|
+
this.day = day;
|
|
9913
|
+
this.timeZone = timeZone;
|
|
9914
|
+
this.offset = offset;
|
|
9915
|
+
this.hour = args.shift() || 0;
|
|
9916
|
+
this.minute = args.shift() || 0;
|
|
9917
|
+
this.second = args.shift() || 0;
|
|
9918
|
+
this.millisecond = args.shift() || 0;
|
|
9919
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9920
|
+
}
|
|
9921
|
+
}
|
|
8995
9922
|
const [Provider, useHistory] = createContext("History", {
|
|
8996
9923
|
history: [],
|
|
8997
9924
|
currentLocationIndex: 0,
|
|
@@ -9051,109 +9978,243 @@ styled(Typography)`
|
|
|
9051
9978
|
word-break: break-all;
|
|
9052
9979
|
color: ${({ theme }) => theme.colors.danger600};
|
|
9053
9980
|
`;
|
|
9054
|
-
({
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
});
|
|
9058
|
-
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
9059
|
-
const path = toPath(key);
|
|
9060
|
-
while (obj && pathStartIndex < path.length) {
|
|
9061
|
-
obj = obj[path[pathStartIndex++]];
|
|
9062
|
-
}
|
|
9063
|
-
if (pathStartIndex !== path.length && !obj) {
|
|
9064
|
-
return def;
|
|
9981
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
9982
|
+
if (!startActions && !endActions) {
|
|
9983
|
+
return null;
|
|
9065
9984
|
}
|
|
9066
|
-
return
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
|
|
9079
|
-
resVal = resVal[currentPath] = clone(currentObj);
|
|
9080
|
-
} else {
|
|
9081
|
-
const nextPath = pathArray[i + 1];
|
|
9082
|
-
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
9985
|
+
return /* @__PURE__ */ jsxs(
|
|
9986
|
+
Flex,
|
|
9987
|
+
{
|
|
9988
|
+
justifyContent: "space-between",
|
|
9989
|
+
alignItems: "flex-start",
|
|
9990
|
+
paddingBottom: 4,
|
|
9991
|
+
paddingLeft: 10,
|
|
9992
|
+
paddingRight: 10,
|
|
9993
|
+
children: [
|
|
9994
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
9995
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
9996
|
+
]
|
|
9083
9997
|
}
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
}
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
}
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
})
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9998
|
+
);
|
|
9999
|
+
};
|
|
10000
|
+
const ContentLayout = ({ children }) => {
|
|
10001
|
+
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
10002
|
+
};
|
|
10003
|
+
const GridColSize = {
|
|
10004
|
+
S: 180,
|
|
10005
|
+
M: 250
|
|
10006
|
+
};
|
|
10007
|
+
const StyledGrid = styled(Box)`
|
|
10008
|
+
display: grid;
|
|
10009
|
+
grid-template-columns: repeat(
|
|
10010
|
+
auto-fit,
|
|
10011
|
+
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
10012
|
+
);
|
|
10013
|
+
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
10014
|
+
`;
|
|
10015
|
+
const GridLayout = ({ size, children }) => {
|
|
10016
|
+
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
10017
|
+
};
|
|
10018
|
+
const BaseHeaderLayout = React.forwardRef(
|
|
10019
|
+
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
10020
|
+
const isSubtitleString = typeof subtitle === "string";
|
|
10021
|
+
if (sticky) {
|
|
10022
|
+
return /* @__PURE__ */ jsx(
|
|
10023
|
+
Box,
|
|
10024
|
+
{
|
|
10025
|
+
paddingLeft: 6,
|
|
10026
|
+
paddingRight: 6,
|
|
10027
|
+
paddingTop: 3,
|
|
10028
|
+
paddingBottom: 3,
|
|
10029
|
+
position: "fixed",
|
|
10030
|
+
top: 0,
|
|
10031
|
+
right: 0,
|
|
10032
|
+
background: "neutral0",
|
|
10033
|
+
shadow: "tableShadow",
|
|
10034
|
+
width: `${width}rem`,
|
|
10035
|
+
zIndex: 1,
|
|
10036
|
+
"data-strapi-header-sticky": true,
|
|
10037
|
+
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
10038
|
+
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
10039
|
+
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
10040
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
10041
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
10042
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
10043
|
+
] }),
|
|
10044
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10045
|
+
] }),
|
|
10046
|
+
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
10047
|
+
] })
|
|
10048
|
+
}
|
|
10049
|
+
);
|
|
10050
|
+
}
|
|
10051
|
+
return /* @__PURE__ */ jsxs(
|
|
10052
|
+
Box,
|
|
10053
|
+
{
|
|
10054
|
+
ref,
|
|
10055
|
+
paddingLeft: 10,
|
|
10056
|
+
paddingRight: 10,
|
|
10057
|
+
paddingBottom: 8,
|
|
10058
|
+
paddingTop: navigationAction ? 6 : 8,
|
|
10059
|
+
background: "neutral100",
|
|
10060
|
+
"data-strapi-header": true,
|
|
10061
|
+
children: [
|
|
10062
|
+
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
10063
|
+
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
10064
|
+
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
10065
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
10066
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10067
|
+
] }),
|
|
10068
|
+
primaryAction
|
|
10069
|
+
] }),
|
|
10070
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
10071
|
+
]
|
|
10072
|
+
}
|
|
10073
|
+
);
|
|
10074
|
+
}
|
|
10075
|
+
);
|
|
10076
|
+
const HeaderLayout = (props) => {
|
|
10077
|
+
const baseHeaderLayoutRef = React.useRef(null);
|
|
10078
|
+
const [headerSize, setHeaderSize] = React.useState(null);
|
|
10079
|
+
const [containerRef, isVisible] = useElementOnScreen({
|
|
10080
|
+
root: null,
|
|
10081
|
+
rootMargin: "0px",
|
|
10082
|
+
threshold: 0
|
|
10083
|
+
});
|
|
10084
|
+
useResizeObserver(containerRef, () => {
|
|
10085
|
+
if (containerRef.current) {
|
|
10086
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
10087
|
+
}
|
|
10088
|
+
});
|
|
10089
|
+
React.useEffect(() => {
|
|
10090
|
+
if (baseHeaderLayoutRef.current) {
|
|
10091
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
10092
|
+
}
|
|
10093
|
+
}, [baseHeaderLayoutRef]);
|
|
10094
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10095
|
+
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
10096
|
+
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
10097
|
+
] });
|
|
10098
|
+
};
|
|
10099
|
+
HeaderLayout.displayName = "HeaderLayout";
|
|
10100
|
+
const useElementOnScreen = (options) => {
|
|
10101
|
+
const containerRef = React.useRef(null);
|
|
10102
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
10103
|
+
const callback = ([entry]) => {
|
|
10104
|
+
setIsVisible(entry.isIntersecting);
|
|
10105
|
+
};
|
|
10106
|
+
React.useEffect(() => {
|
|
10107
|
+
const containerEl = containerRef.current;
|
|
10108
|
+
const observer = new IntersectionObserver(callback, options);
|
|
10109
|
+
if (containerEl) {
|
|
10110
|
+
observer.observe(containerRef.current);
|
|
10111
|
+
}
|
|
10112
|
+
return () => {
|
|
10113
|
+
if (containerEl) {
|
|
10114
|
+
observer.disconnect();
|
|
10115
|
+
}
|
|
10116
|
+
};
|
|
10117
|
+
}, [containerRef, options]);
|
|
10118
|
+
return [containerRef, isVisible];
|
|
10119
|
+
};
|
|
10120
|
+
const useResizeObserver = (sources, onResize) => {
|
|
10121
|
+
const handleResize = useCallbackRef(onResize);
|
|
10122
|
+
React.useLayoutEffect(() => {
|
|
10123
|
+
const resizeObs = new ResizeObserver(handleResize);
|
|
10124
|
+
if (Array.isArray(sources)) {
|
|
10125
|
+
sources.forEach((source) => {
|
|
10126
|
+
if (source.current) {
|
|
10127
|
+
resizeObs.observe(source.current);
|
|
10128
|
+
}
|
|
10129
|
+
});
|
|
10130
|
+
} else if (sources.current) {
|
|
10131
|
+
resizeObs.observe(sources.current);
|
|
10132
|
+
}
|
|
10133
|
+
return () => {
|
|
10134
|
+
resizeObs.disconnect();
|
|
10135
|
+
};
|
|
10136
|
+
}, [sources, handleResize]);
|
|
10137
|
+
};
|
|
10138
|
+
const GridContainer = styled(Box)`
|
|
10139
|
+
display: grid;
|
|
10140
|
+
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
10141
|
+
`;
|
|
10142
|
+
const OverflowingItem = styled(Box)`
|
|
10143
|
+
overflow-x: hidden;
|
|
10144
|
+
`;
|
|
10145
|
+
const RootLayout = ({ sideNav, children }) => {
|
|
10146
|
+
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
10147
|
+
sideNav,
|
|
10148
|
+
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
10149
|
+
] });
|
|
10150
|
+
};
|
|
10151
|
+
const Layouts = {
|
|
10152
|
+
Root: RootLayout,
|
|
10153
|
+
Header: HeaderLayout,
|
|
10154
|
+
BaseHeader: BaseHeaderLayout,
|
|
10155
|
+
Grid: GridLayout,
|
|
10156
|
+
Action: ActionLayout,
|
|
10157
|
+
Content: ContentLayout
|
|
10158
|
+
};
|
|
10159
|
+
const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
|
|
10160
|
+
const [FormProvider, useForm] = createContext("Form", {
|
|
10161
|
+
disabled: false,
|
|
10162
|
+
errors: {},
|
|
10163
|
+
initialValues: {},
|
|
10164
|
+
isSubmitting: false,
|
|
10165
|
+
modified: false,
|
|
10166
|
+
addFieldRow: () => {
|
|
10167
|
+
throw new Error(ERR_MSG);
|
|
10168
|
+
},
|
|
10169
|
+
moveFieldRow: () => {
|
|
10170
|
+
throw new Error(ERR_MSG);
|
|
10171
|
+
},
|
|
10172
|
+
onChange: () => {
|
|
10173
|
+
throw new Error(ERR_MSG);
|
|
10174
|
+
},
|
|
10175
|
+
removeFieldRow: () => {
|
|
10176
|
+
throw new Error(ERR_MSG);
|
|
10177
|
+
},
|
|
10178
|
+
resetForm: () => {
|
|
10179
|
+
throw new Error(ERR_MSG);
|
|
10180
|
+
},
|
|
10181
|
+
setErrors: () => {
|
|
10182
|
+
throw new Error(ERR_MSG);
|
|
10183
|
+
},
|
|
10184
|
+
setValues: () => {
|
|
10185
|
+
throw new Error(ERR_MSG);
|
|
10186
|
+
},
|
|
10187
|
+
setSubmitting: () => {
|
|
10188
|
+
throw new Error(ERR_MSG);
|
|
10189
|
+
},
|
|
10190
|
+
validate: async () => {
|
|
10191
|
+
throw new Error(ERR_MSG);
|
|
10192
|
+
},
|
|
10193
|
+
values: {}
|
|
10194
|
+
});
|
|
10195
|
+
React.forwardRef(
|
|
10196
|
+
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
|
|
10197
|
+
const formRef = React.useRef(null);
|
|
10198
|
+
const initialValues = React.useRef(props.initialValues ?? {});
|
|
10199
|
+
const [state, dispatch] = React.useReducer(reducer, {
|
|
10200
|
+
errors: initialErrors ?? {},
|
|
10201
|
+
isSubmitting: false,
|
|
10202
|
+
values: props.initialValues ?? {}
|
|
10203
|
+
});
|
|
10204
|
+
React.useEffect(() => {
|
|
10205
|
+
if (!isEqual(initialValues.current, props.initialValues)) {
|
|
10206
|
+
initialValues.current = props.initialValues ?? {};
|
|
10207
|
+
dispatch({
|
|
10208
|
+
type: "SET_INITIAL_VALUES",
|
|
10209
|
+
payload: props.initialValues ?? {}
|
|
10210
|
+
});
|
|
10211
|
+
}
|
|
10212
|
+
}, [props.initialValues]);
|
|
10213
|
+
const setErrors = React.useCallback((errors) => {
|
|
10214
|
+
dispatch({
|
|
10215
|
+
type: "SET_ERRORS",
|
|
10216
|
+
payload: errors
|
|
10217
|
+
});
|
|
9157
10218
|
}, []);
|
|
9158
10219
|
const setValues = React.useCallback((values) => {
|
|
9159
10220
|
dispatch({
|
|
@@ -9444,7 +10505,7 @@ const reducer = (state, action) => produce(state, (draft) => {
|
|
|
9444
10505
|
draft.values = setIn(
|
|
9445
10506
|
state.values,
|
|
9446
10507
|
action.payload.field,
|
|
9447
|
-
newValue.length > 0 ? newValue :
|
|
10508
|
+
newValue.length > 0 ? newValue : []
|
|
9448
10509
|
);
|
|
9449
10510
|
break;
|
|
9450
10511
|
}
|
|
@@ -9474,11 +10535,18 @@ const useField = (path) => {
|
|
|
9474
10535
|
(state) => getIn(state.values, path)
|
|
9475
10536
|
);
|
|
9476
10537
|
const handleChange = useForm("useField", (state) => state.onChange);
|
|
9477
|
-
const error = useForm("useField", (state) =>
|
|
10538
|
+
const error = useForm("useField", (state) => {
|
|
10539
|
+
const error2 = getIn(state.errors, path);
|
|
10540
|
+
if (isErrorMessageDescriptor(error2)) {
|
|
10541
|
+
const { values, ...message } = error2;
|
|
10542
|
+
return formatMessage(message, values);
|
|
10543
|
+
}
|
|
10544
|
+
return error2;
|
|
10545
|
+
});
|
|
9478
10546
|
return {
|
|
9479
10547
|
initialValue,
|
|
9480
10548
|
/**
|
|
9481
|
-
* Errors can be a string, or a
|
|
10549
|
+
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
|
|
9482
10550
|
* If it's anything else, we don't return it.
|
|
9483
10551
|
*/
|
|
9484
10552
|
error: isErrorMessageDescriptor(error) ? formatMessage(
|
|
@@ -9493,7 +10561,7 @@ const useField = (path) => {
|
|
|
9493
10561
|
};
|
|
9494
10562
|
};
|
|
9495
10563
|
const isErrorMessageDescriptor = (object) => {
|
|
9496
|
-
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
|
10564
|
+
return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
|
|
9497
10565
|
};
|
|
9498
10566
|
const useFocusInputField = (name) => {
|
|
9499
10567
|
const { search: searchString } = useLocation();
|
|
@@ -9541,7 +10609,7 @@ const BooleanInput = forwardRef(
|
|
|
9541
10609
|
);
|
|
9542
10610
|
const MemoizedBooleanInput = memo(BooleanInput);
|
|
9543
10611
|
const CheckboxInput = forwardRef(
|
|
9544
|
-
({ name, required, label, hint, ...props }, ref) => {
|
|
10612
|
+
({ name, required, label, hint, type: _type, ...props }, ref) => {
|
|
9545
10613
|
const field = useField(name);
|
|
9546
10614
|
const fieldRef = useFocusInputField(name);
|
|
9547
10615
|
const composedRefs = useComposedRefs(ref, fieldRef);
|
|
@@ -9549,9 +10617,9 @@ const CheckboxInput = forwardRef(
|
|
|
9549
10617
|
/* @__PURE__ */ jsx(
|
|
9550
10618
|
Checkbox,
|
|
9551
10619
|
{
|
|
9552
|
-
|
|
10620
|
+
onCheckedChange: (checked) => field.onChange(name, !!checked),
|
|
9553
10621
|
ref: composedRefs,
|
|
9554
|
-
|
|
10622
|
+
checked: field.value,
|
|
9555
10623
|
...props,
|
|
9556
10624
|
children: label || props["aria-label"]
|
|
9557
10625
|
}
|
|
@@ -9577,10 +10645,10 @@ const DateInput = forwardRef(
|
|
|
9577
10645
|
ref: composedRefs,
|
|
9578
10646
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9579
10647
|
onChange: (date) => {
|
|
9580
|
-
field.onChange(name, date);
|
|
10648
|
+
field.onChange(name, date ? convertLocalDateToUTCDate(date) : null);
|
|
9581
10649
|
},
|
|
9582
|
-
onClear: () => field.onChange(name,
|
|
9583
|
-
value,
|
|
10650
|
+
onClear: () => field.onChange(name, null),
|
|
10651
|
+
value: value ? convertLocalDateToUTCDate(value) : value,
|
|
9584
10652
|
...props
|
|
9585
10653
|
}
|
|
9586
10654
|
),
|
|
@@ -9589,6 +10657,12 @@ const DateInput = forwardRef(
|
|
|
9589
10657
|
] });
|
|
9590
10658
|
}
|
|
9591
10659
|
);
|
|
10660
|
+
const convertLocalDateToUTCDate = (date) => {
|
|
10661
|
+
const utcDateString = date.toISOString();
|
|
10662
|
+
const timeZone = $14e0f24ef4ac5c92$export$aa8b41735afcabd2();
|
|
10663
|
+
const zonedDateTime = $fae977aafc393c5c$export$5adfdab05168c219(utcDateString, timeZone);
|
|
10664
|
+
return $11d87f3f76e88657$export$93522d1a439f3617(zonedDateTime).toDate("UTC");
|
|
10665
|
+
};
|
|
9592
10666
|
const MemoizedDateInput = memo(DateInput);
|
|
9593
10667
|
const DateTimeInput = forwardRef(
|
|
9594
10668
|
({ name, required, label, hint, labelAction, ...props }, ref) => {
|
|
@@ -9605,9 +10679,9 @@ const DateTimeInput = forwardRef(
|
|
|
9605
10679
|
ref: composedRefs,
|
|
9606
10680
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9607
10681
|
onChange: (date) => {
|
|
9608
|
-
field.onChange(name, date);
|
|
10682
|
+
field.onChange(name, date ? date : null);
|
|
9609
10683
|
},
|
|
9610
|
-
onClear: () => field.onChange(name,
|
|
10684
|
+
onClear: () => field.onChange(name, null),
|
|
9611
10685
|
value,
|
|
9612
10686
|
...props
|
|
9613
10687
|
}
|
|
@@ -9829,7 +10903,7 @@ const TimeInput = forwardRef(
|
|
|
9829
10903
|
ref: composedRefs,
|
|
9830
10904
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9831
10905
|
onChange: (time) => {
|
|
9832
|
-
field.onChange(name, time);
|
|
10906
|
+
field.onChange(name, `${time}:00.000`);
|
|
9833
10907
|
},
|
|
9834
10908
|
onClear: () => field.onChange(name, void 0),
|
|
9835
10909
|
value: field.value ?? "",
|
|
@@ -9848,6 +10922,7 @@ const InputRenderer = memo(
|
|
|
9848
10922
|
case "biginteger":
|
|
9849
10923
|
case "timestamp":
|
|
9850
10924
|
case "string":
|
|
10925
|
+
case "uid":
|
|
9851
10926
|
return /* @__PURE__ */ jsx(MemoizedStringInput, { ref: forwardRef2, ...props });
|
|
9852
10927
|
case "boolean":
|
|
9853
10928
|
return /* @__PURE__ */ jsx(MemoizedBooleanInput, { ref: forwardRef2, ...props });
|
|
@@ -10125,184 +11200,18 @@ yup.object().shape({
|
|
|
10125
11200
|
defaultMessage: "Passwords must match"
|
|
10126
11201
|
})
|
|
10127
11202
|
});
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
paddingLeft: 10,
|
|
10139
|
-
paddingRight: 10,
|
|
10140
|
-
children: [
|
|
10141
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
10142
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
10143
|
-
]
|
|
10144
|
-
}
|
|
10145
|
-
);
|
|
10146
|
-
};
|
|
10147
|
-
const ContentLayout = ({ children }) => {
|
|
10148
|
-
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
10149
|
-
};
|
|
10150
|
-
const GridColSize = {
|
|
10151
|
-
S: 180,
|
|
10152
|
-
M: 250
|
|
10153
|
-
};
|
|
10154
|
-
const StyledGrid = styled(Box)`
|
|
10155
|
-
display: grid;
|
|
10156
|
-
grid-template-columns: repeat(
|
|
10157
|
-
auto-fit,
|
|
10158
|
-
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
10159
|
-
);
|
|
10160
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
10161
|
-
`;
|
|
10162
|
-
const GridLayout = ({ size, children }) => {
|
|
10163
|
-
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
10164
|
-
};
|
|
10165
|
-
const BaseHeaderLayout = React.forwardRef(
|
|
10166
|
-
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
10167
|
-
const isSubtitleString = typeof subtitle === "string";
|
|
10168
|
-
if (sticky) {
|
|
10169
|
-
return /* @__PURE__ */ jsx(
|
|
10170
|
-
Box,
|
|
10171
|
-
{
|
|
10172
|
-
paddingLeft: 6,
|
|
10173
|
-
paddingRight: 6,
|
|
10174
|
-
paddingTop: 3,
|
|
10175
|
-
paddingBottom: 3,
|
|
10176
|
-
position: "fixed",
|
|
10177
|
-
top: 0,
|
|
10178
|
-
right: 0,
|
|
10179
|
-
background: "neutral0",
|
|
10180
|
-
shadow: "tableShadow",
|
|
10181
|
-
width: `${width}rem`,
|
|
10182
|
-
zIndex: 1,
|
|
10183
|
-
"data-strapi-header-sticky": true,
|
|
10184
|
-
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
10185
|
-
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
10186
|
-
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
10187
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
10188
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
10189
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
10190
|
-
] }),
|
|
10191
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10192
|
-
] }),
|
|
10193
|
-
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
10194
|
-
] })
|
|
10195
|
-
}
|
|
10196
|
-
);
|
|
10197
|
-
}
|
|
10198
|
-
return /* @__PURE__ */ jsxs(
|
|
10199
|
-
Box,
|
|
10200
|
-
{
|
|
10201
|
-
ref,
|
|
10202
|
-
paddingLeft: 10,
|
|
10203
|
-
paddingRight: 10,
|
|
10204
|
-
paddingBottom: 8,
|
|
10205
|
-
paddingTop: navigationAction ? 6 : 8,
|
|
10206
|
-
background: "neutral100",
|
|
10207
|
-
"data-strapi-header": true,
|
|
10208
|
-
children: [
|
|
10209
|
-
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
10210
|
-
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
10211
|
-
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
10212
|
-
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
10213
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10214
|
-
] }),
|
|
10215
|
-
primaryAction
|
|
10216
|
-
] }),
|
|
10217
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
10218
|
-
]
|
|
10219
|
-
}
|
|
10220
|
-
);
|
|
11203
|
+
({
|
|
11204
|
+
[adminApi.reducerPath]: adminApi.reducer,
|
|
11205
|
+
admin_app: reducer$1
|
|
11206
|
+
});
|
|
11207
|
+
styled(WarningCircle)`
|
|
11208
|
+
width: 24px;
|
|
11209
|
+
height: 24px;
|
|
11210
|
+
|
|
11211
|
+
path {
|
|
11212
|
+
fill: ${({ theme }) => theme.colors.danger600};
|
|
10221
11213
|
}
|
|
10222
|
-
);
|
|
10223
|
-
const HeaderLayout = (props) => {
|
|
10224
|
-
const baseHeaderLayoutRef = React.useRef(null);
|
|
10225
|
-
const [headerSize, setHeaderSize] = React.useState(null);
|
|
10226
|
-
const [containerRef, isVisible] = useElementOnScreen({
|
|
10227
|
-
root: null,
|
|
10228
|
-
rootMargin: "0px",
|
|
10229
|
-
threshold: 0
|
|
10230
|
-
});
|
|
10231
|
-
useResizeObserver(containerRef, () => {
|
|
10232
|
-
if (containerRef.current) {
|
|
10233
|
-
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
10234
|
-
}
|
|
10235
|
-
});
|
|
10236
|
-
React.useEffect(() => {
|
|
10237
|
-
if (baseHeaderLayoutRef.current) {
|
|
10238
|
-
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
10239
|
-
}
|
|
10240
|
-
}, [baseHeaderLayoutRef]);
|
|
10241
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10242
|
-
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
10243
|
-
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
10244
|
-
] });
|
|
10245
|
-
};
|
|
10246
|
-
HeaderLayout.displayName = "HeaderLayout";
|
|
10247
|
-
const useElementOnScreen = (options) => {
|
|
10248
|
-
const containerRef = React.useRef(null);
|
|
10249
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
10250
|
-
const callback = ([entry]) => {
|
|
10251
|
-
setIsVisible(entry.isIntersecting);
|
|
10252
|
-
};
|
|
10253
|
-
React.useEffect(() => {
|
|
10254
|
-
const containerEl = containerRef.current;
|
|
10255
|
-
const observer = new IntersectionObserver(callback, options);
|
|
10256
|
-
if (containerEl) {
|
|
10257
|
-
observer.observe(containerRef.current);
|
|
10258
|
-
}
|
|
10259
|
-
return () => {
|
|
10260
|
-
if (containerEl) {
|
|
10261
|
-
observer.disconnect();
|
|
10262
|
-
}
|
|
10263
|
-
};
|
|
10264
|
-
}, [containerRef, options]);
|
|
10265
|
-
return [containerRef, isVisible];
|
|
10266
|
-
};
|
|
10267
|
-
const useResizeObserver = (sources, onResize) => {
|
|
10268
|
-
const handleResize = useCallbackRef(onResize);
|
|
10269
|
-
React.useLayoutEffect(() => {
|
|
10270
|
-
const resizeObs = new ResizeObserver(handleResize);
|
|
10271
|
-
if (Array.isArray(sources)) {
|
|
10272
|
-
sources.forEach((source) => {
|
|
10273
|
-
if (source.current) {
|
|
10274
|
-
resizeObs.observe(source.current);
|
|
10275
|
-
}
|
|
10276
|
-
});
|
|
10277
|
-
} else if (sources.current) {
|
|
10278
|
-
resizeObs.observe(sources.current);
|
|
10279
|
-
}
|
|
10280
|
-
return () => {
|
|
10281
|
-
resizeObs.disconnect();
|
|
10282
|
-
};
|
|
10283
|
-
}, [sources, handleResize]);
|
|
10284
|
-
};
|
|
10285
|
-
const GridContainer = styled(Box)`
|
|
10286
|
-
display: grid;
|
|
10287
|
-
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
10288
11214
|
`;
|
|
10289
|
-
const OverflowingItem = styled(Box)`
|
|
10290
|
-
overflow-x: hidden;
|
|
10291
|
-
`;
|
|
10292
|
-
const RootLayout = ({ sideNav, children }) => {
|
|
10293
|
-
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
10294
|
-
sideNav,
|
|
10295
|
-
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
10296
|
-
] });
|
|
10297
|
-
};
|
|
10298
|
-
const Layouts = {
|
|
10299
|
-
Root: RootLayout,
|
|
10300
|
-
Header: HeaderLayout,
|
|
10301
|
-
BaseHeader: BaseHeaderLayout,
|
|
10302
|
-
Grid: GridLayout,
|
|
10303
|
-
Action: ActionLayout,
|
|
10304
|
-
Content: ContentLayout
|
|
10305
|
-
};
|
|
10306
11215
|
React.memo(
|
|
10307
11216
|
({ description, id, props, update }) => {
|
|
10308
11217
|
const comp = description(props);
|
|
@@ -10358,26 +11267,18 @@ const [FiltersProvider, useFilters] = createContext("Filters");
|
|
|
10358
11267
|
React.forwardRef(
|
|
10359
11268
|
({ label }, forwardedRef) => {
|
|
10360
11269
|
const { formatMessage } = useIntl();
|
|
10361
|
-
const { setTriggerNode, setOpen } = useFilters("Trigger", ({ setTriggerNode: setTriggerNode2, setOpen: setOpen2 }) => ({
|
|
10362
|
-
setTriggerNode: setTriggerNode2,
|
|
10363
|
-
setOpen: setOpen2
|
|
10364
|
-
}));
|
|
10365
11270
|
const disabled = useFilters("Trigger", ({ disabled: disabled2 }) => disabled2);
|
|
10366
|
-
|
|
10367
|
-
const composedRefs = useComposedRefs(forwardedRef, setTriggerNode);
|
|
10368
|
-
const handleClick = () => setOpen(!open);
|
|
10369
|
-
return /* @__PURE__ */ jsx(
|
|
11271
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
10370
11272
|
Button,
|
|
10371
11273
|
{
|
|
10372
11274
|
variant: "tertiary",
|
|
10373
|
-
ref:
|
|
11275
|
+
ref: forwardedRef,
|
|
10374
11276
|
startIcon: /* @__PURE__ */ jsx(Filter, {}),
|
|
10375
|
-
onClick: handleClick,
|
|
10376
11277
|
size: "S",
|
|
10377
11278
|
disabled,
|
|
10378
11279
|
children: label || formatMessage({ id: "app.utils.filters", defaultMessage: "Filters" })
|
|
10379
11280
|
}
|
|
10380
|
-
);
|
|
11281
|
+
) });
|
|
10381
11282
|
}
|
|
10382
11283
|
);
|
|
10383
11284
|
const [PaginationProvider, usePagination] = createContext("Pagination");
|
|
@@ -10395,18 +11296,28 @@ React.forwardRef(
|
|
|
10395
11296
|
onPageSizeChange(pageSize);
|
|
10396
11297
|
}
|
|
10397
11298
|
};
|
|
10398
|
-
return /* @__PURE__ */ jsx(
|
|
10399
|
-
|
|
11299
|
+
return /* @__PURE__ */ jsx(
|
|
11300
|
+
Flex,
|
|
10400
11301
|
{
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
11302
|
+
ref: forwardedRef,
|
|
11303
|
+
paddingTop: 4,
|
|
11304
|
+
paddingBottom: 4,
|
|
11305
|
+
alignItems: "flex-end",
|
|
11306
|
+
justifyContent: "space-between",
|
|
11307
|
+
children: /* @__PURE__ */ jsx(
|
|
11308
|
+
PaginationProvider,
|
|
11309
|
+
{
|
|
11310
|
+
currentQuery: query,
|
|
11311
|
+
page: query.page,
|
|
11312
|
+
pageSize: query.pageSize,
|
|
11313
|
+
pageCount: pageCount.toString(),
|
|
11314
|
+
setPageSize,
|
|
11315
|
+
total,
|
|
11316
|
+
children
|
|
11317
|
+
}
|
|
11318
|
+
)
|
|
10408
11319
|
}
|
|
10409
|
-
)
|
|
11320
|
+
);
|
|
10410
11321
|
}
|
|
10411
11322
|
);
|
|
10412
11323
|
createContext("Table");
|
|
@@ -10575,4 +11486,4 @@ export {
|
|
|
10575
11486
|
Layouts as L,
|
|
10576
11487
|
useTracking as u
|
|
10577
11488
|
};
|
|
10578
|
-
//# sourceMappingURL=index-
|
|
11489
|
+
//# sourceMappingURL=index-8-k5RCnK-BHUgmsKx.mjs.map
|