@strapi/plugin-users-permissions 5.0.0-beta.8 → 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-69WUS0qJ-DzUzGVgd.mjs → index-8-k5RCnK-BHUgmsKx.mjs} +1231 -320
- package/dist/_chunks/index-8-k5RCnK-BHUgmsKx.mjs.map +1 -0
- package/dist/_chunks/{index-69WUS0qJ-621Sl9hj.js → index-8-k5RCnK-qR3QHvSP.js} +1228 -317
- package/dist/_chunks/index-8-k5RCnK-qR3QHvSP.js.map +1 -0
- package/dist/_chunks/{index-B_rNTZBF.mjs → index-B9OX-a4A.mjs} +29 -34
- package/dist/_chunks/index-B9OX-a4A.mjs.map +1 -0
- package/dist/_chunks/{index-B6AAcVOR.mjs → index-Cf2sMpyd.mjs} +10 -10
- package/dist/_chunks/{index-B6AAcVOR.mjs.map → index-Cf2sMpyd.mjs.map} +1 -1
- package/dist/_chunks/{index-00_Lq0-y.mjs → index-DCFIfSfa.mjs} +17 -23
- package/dist/_chunks/index-DCFIfSfa.mjs.map +1 -0
- package/dist/_chunks/{index-DGyiWVHr.js → index-DRoVF6Y7.js} +20 -26
- package/dist/_chunks/index-DRoVF6Y7.js.map +1 -0
- package/dist/_chunks/{index-BSqwdKVh.js → index-DVEZVDjs.js} +28 -33
- package/dist/_chunks/index-DVEZVDjs.js.map +1 -0
- package/dist/_chunks/{index-DTK4DMrt.js → index-iMO1GC3n.js} +94 -96
- package/dist/_chunks/index-iMO1GC3n.js.map +1 -0
- package/dist/_chunks/{index-CIJz4WB2.js → index-iSLj9xJT.js} +4 -4
- package/dist/_chunks/index-iSLj9xJT.js.map +1 -0
- package/dist/_chunks/{index-BGu68xEV.js → index-iaebB1BT.js} +10 -10
- package/dist/_chunks/{index-BGu68xEV.js.map → index-iaebB1BT.js.map} +1 -1
- package/dist/_chunks/{index-DaCuO0x_.mjs → index-qhy_K2pJ.mjs} +5 -5
- package/dist/_chunks/index-qhy_K2pJ.mjs.map +1 -0
- package/dist/_chunks/{index-fnfzDsYv.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/server/config.js +29 -0
- package/server/controllers/auth.js +22 -4
- package/dist/_chunks/index-00_Lq0-y.mjs.map +0 -1
- package/dist/_chunks/index-69WUS0qJ-621Sl9hj.js.map +0 -1
- package/dist/_chunks/index-69WUS0qJ-DzUzGVgd.mjs.map +0 -1
- package/dist/_chunks/index-BSqwdKVh.js.map +0 -1
- package/dist/_chunks/index-B_rNTZBF.mjs.map +0 -1
- package/dist/_chunks/index-CIJz4WB2.js.map +0 -1
- package/dist/_chunks/index-DGyiWVHr.js.map +0 -1
- package/dist/_chunks/index-DTK4DMrt.js.map +0 -1
- package/dist/_chunks/index-DaCuO0x_.mjs.map +0 -1
- package/dist/_chunks/index-fnfzDsYv.mjs.map +0 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require("react-dom/client");
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const React = require("react");
|
|
5
4
|
const designSystem = require("@strapi/design-system");
|
|
6
5
|
require("lodash/isFunction");
|
|
7
6
|
require("lodash/merge");
|
|
8
7
|
require("lodash/pick");
|
|
9
|
-
const reactRedux = require("react-redux");
|
|
10
8
|
const reactRouterDom = require("react-router-dom");
|
|
9
|
+
const React = require("react");
|
|
11
10
|
const reactIntl = require("react-intl");
|
|
12
11
|
const icons = require("@strapi/icons");
|
|
13
12
|
require("@strapi/icons/symbols");
|
|
14
13
|
const reactDom = require("react-dom");
|
|
15
14
|
const createNextState2 = require("immer");
|
|
15
|
+
const reactRedux = require("react-redux");
|
|
16
16
|
const pipe = require("lodash/fp/pipe");
|
|
17
|
+
const clone = require("lodash/clone");
|
|
18
|
+
const toPath = require("lodash/toPath");
|
|
17
19
|
const isEqual = require("lodash/isEqual");
|
|
18
20
|
require("lodash/defaultsDeep");
|
|
19
21
|
const styledComponents = require("styled-components");
|
|
@@ -22,8 +24,6 @@ require("lodash/get");
|
|
|
22
24
|
require("lodash/set");
|
|
23
25
|
require("lodash/camelCase");
|
|
24
26
|
const yup = require("yup");
|
|
25
|
-
const clone = require("lodash/clone");
|
|
26
|
-
const toPath = require("lodash/toPath");
|
|
27
27
|
require("lodash/omit");
|
|
28
28
|
require("formik");
|
|
29
29
|
require("lodash/throttle");
|
|
@@ -49,10 +49,10 @@ function _interopNamespace(e) {
|
|
|
49
49
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
50
50
|
const createNextState2__default = /* @__PURE__ */ _interopDefault(createNextState2);
|
|
51
51
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
|
52
|
-
const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
|
|
53
|
-
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
54
52
|
const clone__default = /* @__PURE__ */ _interopDefault(clone);
|
|
55
53
|
const toPath__default = /* @__PURE__ */ _interopDefault(toPath);
|
|
54
|
+
const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
|
|
55
|
+
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
56
56
|
function getDefaultExportFromCjs(x) {
|
|
57
57
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
58
58
|
}
|
|
@@ -8559,6 +8559,10 @@ function createContext(rootComponentName, defaultContext) {
|
|
|
8559
8559
|
return [Provider2, useContext];
|
|
8560
8560
|
}
|
|
8561
8561
|
createContext("StrapiApp");
|
|
8562
|
+
const STORAGE_KEYS$1 = {
|
|
8563
|
+
TOKEN: "jwtToken",
|
|
8564
|
+
USER: "userInfo"
|
|
8565
|
+
};
|
|
8562
8566
|
const THEME_LOCAL_STORAGE_KEY = "STRAPI_THEME";
|
|
8563
8567
|
const LANGUAGE_LOCAL_STORAGE_KEY = "strapi-admin-language";
|
|
8564
8568
|
const adminSlice = createSlice({
|
|
@@ -8573,7 +8577,8 @@ const adminSlice = createSlice({
|
|
|
8573
8577
|
theme: {
|
|
8574
8578
|
availableThemes: [],
|
|
8575
8579
|
currentTheme: localStorage.getItem(THEME_LOCAL_STORAGE_KEY) || "system"
|
|
8576
|
-
}
|
|
8580
|
+
},
|
|
8581
|
+
token: null
|
|
8577
8582
|
};
|
|
8578
8583
|
},
|
|
8579
8584
|
reducers: {
|
|
@@ -8588,6 +8593,25 @@ const adminSlice = createSlice({
|
|
|
8588
8593
|
state.language.locale = action.payload;
|
|
8589
8594
|
window.localStorage.setItem(LANGUAGE_LOCAL_STORAGE_KEY, action.payload);
|
|
8590
8595
|
document.documentElement.setAttribute("lang", action.payload);
|
|
8596
|
+
},
|
|
8597
|
+
setToken(state, action) {
|
|
8598
|
+
state.token = action.payload;
|
|
8599
|
+
},
|
|
8600
|
+
login(state, action) {
|
|
8601
|
+
const { token, persist } = action.payload;
|
|
8602
|
+
if (!persist) {
|
|
8603
|
+
window.sessionStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
|
|
8604
|
+
} else {
|
|
8605
|
+
window.localStorage.setItem(STORAGE_KEYS$1.TOKEN, JSON.stringify(token));
|
|
8606
|
+
}
|
|
8607
|
+
state.token = token;
|
|
8608
|
+
},
|
|
8609
|
+
logout(state) {
|
|
8610
|
+
state.token = null;
|
|
8611
|
+
window.localStorage.removeItem(STORAGE_KEYS$1.TOKEN);
|
|
8612
|
+
window.localStorage.removeItem(STORAGE_KEYS$1.USER);
|
|
8613
|
+
window.sessionStorage.removeItem(STORAGE_KEYS$1.TOKEN);
|
|
8614
|
+
window.sessionStorage.removeItem(STORAGE_KEYS$1.USER);
|
|
8591
8615
|
}
|
|
8592
8616
|
}
|
|
8593
8617
|
});
|
|
@@ -8764,6 +8788,46 @@ React__namespace.createContext({
|
|
|
8764
8788
|
toggleNotification: () => {
|
|
8765
8789
|
}
|
|
8766
8790
|
});
|
|
8791
|
+
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
8792
|
+
const path = toPath__default.default(key);
|
|
8793
|
+
while (obj && pathStartIndex < path.length) {
|
|
8794
|
+
obj = obj[path[pathStartIndex++]];
|
|
8795
|
+
}
|
|
8796
|
+
if (pathStartIndex !== path.length && !obj) {
|
|
8797
|
+
return def;
|
|
8798
|
+
}
|
|
8799
|
+
return obj === void 0 ? def : obj;
|
|
8800
|
+
}
|
|
8801
|
+
const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
|
|
8802
|
+
const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
|
|
8803
|
+
function setIn(obj, path, value) {
|
|
8804
|
+
const res = clone__default.default(obj);
|
|
8805
|
+
let resVal = res;
|
|
8806
|
+
let i = 0;
|
|
8807
|
+
const pathArray = toPath__default.default(path);
|
|
8808
|
+
for (; i < pathArray.length - 1; i++) {
|
|
8809
|
+
const currentPath = pathArray[i];
|
|
8810
|
+
const currentObj = getIn(obj, pathArray.slice(0, i + 1));
|
|
8811
|
+
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
|
|
8812
|
+
resVal = resVal[currentPath] = clone__default.default(currentObj);
|
|
8813
|
+
} else {
|
|
8814
|
+
const nextPath = pathArray[i + 1];
|
|
8815
|
+
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
8816
|
+
}
|
|
8817
|
+
}
|
|
8818
|
+
if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
|
|
8819
|
+
return obj;
|
|
8820
|
+
}
|
|
8821
|
+
if (value === void 0) {
|
|
8822
|
+
delete resVal[pathArray[i]];
|
|
8823
|
+
} else {
|
|
8824
|
+
resVal[pathArray[i]] = value;
|
|
8825
|
+
}
|
|
8826
|
+
if (i === 0 && value === void 0) {
|
|
8827
|
+
delete res[pathArray[i]];
|
|
8828
|
+
}
|
|
8829
|
+
return res;
|
|
8830
|
+
}
|
|
8767
8831
|
const [AppInfoProvider, useAppInfo] = createContext("AppInfo", {});
|
|
8768
8832
|
const TrackingContext = React__namespace.createContext({
|
|
8769
8833
|
uuid: false
|
|
@@ -9018,6 +9082,869 @@ function generateNKeysBetween(a2, b, n, digits = BASE_62_DIGITS) {
|
|
|
9018
9082
|
...generateNKeysBetween(c, b, n - mid - 1, digits)
|
|
9019
9083
|
];
|
|
9020
9084
|
}
|
|
9085
|
+
function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
|
|
9086
|
+
return amount - numerator * Math.floor(amount / numerator);
|
|
9087
|
+
}
|
|
9088
|
+
const $3b62074eb05584b2$var$EPOCH = 1721426;
|
|
9089
|
+
function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
|
|
9090
|
+
year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
|
|
9091
|
+
let y1 = year - 1;
|
|
9092
|
+
let monthOffset = -2;
|
|
9093
|
+
if (month <= 2)
|
|
9094
|
+
monthOffset = 0;
|
|
9095
|
+
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year))
|
|
9096
|
+
monthOffset = -1;
|
|
9097
|
+
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);
|
|
9098
|
+
}
|
|
9099
|
+
function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
|
|
9100
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
9101
|
+
}
|
|
9102
|
+
function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
|
|
9103
|
+
return era === "BC" ? 1 - year : year;
|
|
9104
|
+
}
|
|
9105
|
+
function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
|
|
9106
|
+
let era = "AD";
|
|
9107
|
+
if (year <= 0) {
|
|
9108
|
+
era = "BC";
|
|
9109
|
+
year = 1 - year;
|
|
9110
|
+
}
|
|
9111
|
+
return [
|
|
9112
|
+
era,
|
|
9113
|
+
year
|
|
9114
|
+
];
|
|
9115
|
+
}
|
|
9116
|
+
const $3b62074eb05584b2$var$daysInMonth = {
|
|
9117
|
+
standard: [
|
|
9118
|
+
31,
|
|
9119
|
+
28,
|
|
9120
|
+
31,
|
|
9121
|
+
30,
|
|
9122
|
+
31,
|
|
9123
|
+
30,
|
|
9124
|
+
31,
|
|
9125
|
+
31,
|
|
9126
|
+
30,
|
|
9127
|
+
31,
|
|
9128
|
+
30,
|
|
9129
|
+
31
|
|
9130
|
+
],
|
|
9131
|
+
leapyear: [
|
|
9132
|
+
31,
|
|
9133
|
+
29,
|
|
9134
|
+
31,
|
|
9135
|
+
30,
|
|
9136
|
+
31,
|
|
9137
|
+
30,
|
|
9138
|
+
31,
|
|
9139
|
+
31,
|
|
9140
|
+
30,
|
|
9141
|
+
31,
|
|
9142
|
+
30,
|
|
9143
|
+
31
|
|
9144
|
+
]
|
|
9145
|
+
};
|
|
9146
|
+
class $3b62074eb05584b2$export$80ee6245ec4f29ec {
|
|
9147
|
+
fromJulianDay(jd) {
|
|
9148
|
+
let jd0 = jd;
|
|
9149
|
+
let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
|
|
9150
|
+
let quadricent = Math.floor(depoch / 146097);
|
|
9151
|
+
let dqc = $2b4dce13dd5a17fa$export$842a2cf37af977e1(depoch, 146097);
|
|
9152
|
+
let cent = Math.floor(dqc / 36524);
|
|
9153
|
+
let dcent = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dqc, 36524);
|
|
9154
|
+
let quad = Math.floor(dcent / 1461);
|
|
9155
|
+
let dquad = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dcent, 1461);
|
|
9156
|
+
let yindex = Math.floor(dquad / 365);
|
|
9157
|
+
let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
|
|
9158
|
+
let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
|
|
9159
|
+
let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
|
|
9160
|
+
let leapAdj = 2;
|
|
9161
|
+
if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1))
|
|
9162
|
+
leapAdj = 0;
|
|
9163
|
+
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year))
|
|
9164
|
+
leapAdj = 1;
|
|
9165
|
+
let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
|
|
9166
|
+
let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
|
|
9167
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(era, year, month, day);
|
|
9168
|
+
}
|
|
9169
|
+
toJulianDay(date) {
|
|
9170
|
+
return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
|
|
9171
|
+
}
|
|
9172
|
+
getDaysInMonth(date) {
|
|
9173
|
+
return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
|
|
9174
|
+
}
|
|
9175
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9176
|
+
getMonthsInYear(date) {
|
|
9177
|
+
return 12;
|
|
9178
|
+
}
|
|
9179
|
+
getDaysInYear(date) {
|
|
9180
|
+
return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
|
|
9181
|
+
}
|
|
9182
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9183
|
+
getYearsInEra(date) {
|
|
9184
|
+
return 9999;
|
|
9185
|
+
}
|
|
9186
|
+
getEras() {
|
|
9187
|
+
return [
|
|
9188
|
+
"BC",
|
|
9189
|
+
"AD"
|
|
9190
|
+
];
|
|
9191
|
+
}
|
|
9192
|
+
isInverseEra(date) {
|
|
9193
|
+
return date.era === "BC";
|
|
9194
|
+
}
|
|
9195
|
+
balanceDate(date) {
|
|
9196
|
+
if (date.year <= 0) {
|
|
9197
|
+
date.era = date.era === "BC" ? "AD" : "BC";
|
|
9198
|
+
date.year = 1 - date.year;
|
|
9199
|
+
}
|
|
9200
|
+
}
|
|
9201
|
+
constructor() {
|
|
9202
|
+
this.identifier = "gregory";
|
|
9203
|
+
}
|
|
9204
|
+
}
|
|
9205
|
+
function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a2, b) {
|
|
9206
|
+
return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
|
|
9207
|
+
}
|
|
9208
|
+
function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a2, b) {
|
|
9209
|
+
return $14e0f24ef4ac5c92$var$timeToMs(a2) - $14e0f24ef4ac5c92$var$timeToMs(b);
|
|
9210
|
+
}
|
|
9211
|
+
function $14e0f24ef4ac5c92$var$timeToMs(a2) {
|
|
9212
|
+
return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
|
|
9213
|
+
}
|
|
9214
|
+
let $14e0f24ef4ac5c92$var$localTimeZone = null;
|
|
9215
|
+
function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
|
|
9216
|
+
if ($14e0f24ef4ac5c92$var$localTimeZone == null)
|
|
9217
|
+
$14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
9218
|
+
return $14e0f24ef4ac5c92$var$localTimeZone;
|
|
9219
|
+
}
|
|
9220
|
+
function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
|
|
9221
|
+
date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9222
|
+
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(date.era, date.year);
|
|
9223
|
+
return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
|
|
9224
|
+
}
|
|
9225
|
+
function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
|
|
9226
|
+
let date = /* @__PURE__ */ new Date();
|
|
9227
|
+
date.setUTCHours(hour, minute, second, millisecond);
|
|
9228
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
9229
|
+
return date.getTime();
|
|
9230
|
+
}
|
|
9231
|
+
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
|
|
9232
|
+
if (timeZone === "UTC")
|
|
9233
|
+
return 0;
|
|
9234
|
+
if (ms > 0 && timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2())
|
|
9235
|
+
return new Date(ms).getTimezoneOffset() * -6e4;
|
|
9236
|
+
let { year, month, day, hour, minute, second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
|
|
9237
|
+
let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
|
|
9238
|
+
return utc - Math.floor(ms / 1e3) * 1e3;
|
|
9239
|
+
}
|
|
9240
|
+
const $11d87f3f76e88657$var$formattersByTimeZone = /* @__PURE__ */ new Map();
|
|
9241
|
+
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
|
|
9242
|
+
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
|
|
9243
|
+
if (!formatter) {
|
|
9244
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
9245
|
+
timeZone,
|
|
9246
|
+
hour12: false,
|
|
9247
|
+
era: "short",
|
|
9248
|
+
year: "numeric",
|
|
9249
|
+
month: "numeric",
|
|
9250
|
+
day: "numeric",
|
|
9251
|
+
hour: "numeric",
|
|
9252
|
+
minute: "numeric",
|
|
9253
|
+
second: "numeric"
|
|
9254
|
+
});
|
|
9255
|
+
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
|
|
9256
|
+
}
|
|
9257
|
+
let parts = formatter.formatToParts(new Date(ms));
|
|
9258
|
+
let namedParts = {};
|
|
9259
|
+
for (let part of parts)
|
|
9260
|
+
if (part.type !== "literal")
|
|
9261
|
+
namedParts[part.type] = part.value;
|
|
9262
|
+
return {
|
|
9263
|
+
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
|
|
9264
|
+
year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
|
|
9265
|
+
month: +namedParts.month,
|
|
9266
|
+
day: +namedParts.day,
|
|
9267
|
+
hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
|
|
9268
|
+
minute: +namedParts.minute,
|
|
9269
|
+
second: +namedParts.second
|
|
9270
|
+
};
|
|
9271
|
+
}
|
|
9272
|
+
const $11d87f3f76e88657$var$DAYMILLIS = 864e5;
|
|
9273
|
+
function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
|
|
9274
|
+
let found = earlier === later ? [
|
|
9275
|
+
earlier
|
|
9276
|
+
] : [
|
|
9277
|
+
earlier,
|
|
9278
|
+
later
|
|
9279
|
+
];
|
|
9280
|
+
return found.filter((absolute) => $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
|
|
9281
|
+
}
|
|
9282
|
+
function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
|
|
9283
|
+
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
|
|
9284
|
+
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;
|
|
9285
|
+
}
|
|
9286
|
+
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
|
|
9287
|
+
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
|
|
9288
|
+
if (timeZone === "UTC")
|
|
9289
|
+
return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9290
|
+
if (timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2() && disambiguation === "compatible") {
|
|
9291
|
+
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9292
|
+
let date2 = /* @__PURE__ */ new Date();
|
|
9293
|
+
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(dateTime.era, dateTime.year);
|
|
9294
|
+
date2.setFullYear(year, dateTime.month - 1, dateTime.day);
|
|
9295
|
+
date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
9296
|
+
return date2.getTime();
|
|
9297
|
+
}
|
|
9298
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9299
|
+
let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9300
|
+
let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9301
|
+
let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
|
|
9302
|
+
if (valid.length === 1)
|
|
9303
|
+
return valid[0];
|
|
9304
|
+
if (valid.length > 1)
|
|
9305
|
+
switch (disambiguation) {
|
|
9306
|
+
case "compatible":
|
|
9307
|
+
case "earlier":
|
|
9308
|
+
return valid[0];
|
|
9309
|
+
case "later":
|
|
9310
|
+
return valid[valid.length - 1];
|
|
9311
|
+
case "reject":
|
|
9312
|
+
throw new RangeError("Multiple possible absolute times found");
|
|
9313
|
+
}
|
|
9314
|
+
switch (disambiguation) {
|
|
9315
|
+
case "earlier":
|
|
9316
|
+
return Math.min(ms - offsetBefore, ms - offsetAfter);
|
|
9317
|
+
case "compatible":
|
|
9318
|
+
case "later":
|
|
9319
|
+
return Math.max(ms - offsetBefore, ms - offsetAfter);
|
|
9320
|
+
case "reject":
|
|
9321
|
+
throw new RangeError("No such absolute time found");
|
|
9322
|
+
}
|
|
9323
|
+
}
|
|
9324
|
+
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
|
|
9325
|
+
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
9326
|
+
}
|
|
9327
|
+
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
9328
|
+
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
|
|
9329
|
+
let date = new Date(ms + offset);
|
|
9330
|
+
let year = date.getUTCFullYear();
|
|
9331
|
+
let month = date.getUTCMonth() + 1;
|
|
9332
|
+
let day = date.getUTCDate();
|
|
9333
|
+
let hour = date.getUTCHours();
|
|
9334
|
+
let minute = date.getUTCMinutes();
|
|
9335
|
+
let second = date.getUTCSeconds();
|
|
9336
|
+
let millisecond = date.getUTCMilliseconds();
|
|
9337
|
+
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
9338
|
+
}
|
|
9339
|
+
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
|
|
9340
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
9341
|
+
}
|
|
9342
|
+
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
9343
|
+
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
9344
|
+
if ("timeZone" in date)
|
|
9345
|
+
({ hour, minute, second, millisecond } = date);
|
|
9346
|
+
else if ("hour" in date && !time)
|
|
9347
|
+
return date;
|
|
9348
|
+
if (time)
|
|
9349
|
+
({ hour, minute, second, millisecond } = time);
|
|
9350
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
9351
|
+
}
|
|
9352
|
+
function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
|
|
9353
|
+
if (date.calendar.identifier === calendar.identifier)
|
|
9354
|
+
return date;
|
|
9355
|
+
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
|
|
9356
|
+
let copy = date.copy();
|
|
9357
|
+
copy.calendar = calendar;
|
|
9358
|
+
copy.era = calendarDate.era;
|
|
9359
|
+
copy.year = calendarDate.year;
|
|
9360
|
+
copy.month = calendarDate.month;
|
|
9361
|
+
copy.day = calendarDate.day;
|
|
9362
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(copy);
|
|
9363
|
+
return copy;
|
|
9364
|
+
}
|
|
9365
|
+
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
9366
|
+
if (date instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
|
|
9367
|
+
if (date.timeZone === timeZone)
|
|
9368
|
+
return date;
|
|
9369
|
+
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
9370
|
+
}
|
|
9371
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
9372
|
+
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
|
|
9373
|
+
}
|
|
9374
|
+
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
|
|
9375
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9376
|
+
return new Date(ms);
|
|
9377
|
+
}
|
|
9378
|
+
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
|
|
9379
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9380
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
9381
|
+
}
|
|
9382
|
+
const $735220c2d4774dd3$var$ONE_HOUR = 36e5;
|
|
9383
|
+
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
|
|
9384
|
+
let mutableDate = date.copy();
|
|
9385
|
+
let days = "hour" in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
|
|
9386
|
+
$735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
|
|
9387
|
+
if (mutableDate.calendar.balanceYearMonth)
|
|
9388
|
+
mutableDate.calendar.balanceYearMonth(mutableDate, date);
|
|
9389
|
+
mutableDate.month += duration.months || 0;
|
|
9390
|
+
$735220c2d4774dd3$var$balanceYearMonth(mutableDate);
|
|
9391
|
+
$735220c2d4774dd3$var$constrainMonthDay(mutableDate);
|
|
9392
|
+
mutableDate.day += (duration.weeks || 0) * 7;
|
|
9393
|
+
mutableDate.day += duration.days || 0;
|
|
9394
|
+
mutableDate.day += days;
|
|
9395
|
+
$735220c2d4774dd3$var$balanceDay(mutableDate);
|
|
9396
|
+
if (mutableDate.calendar.balanceDate)
|
|
9397
|
+
mutableDate.calendar.balanceDate(mutableDate);
|
|
9398
|
+
if (mutableDate.year < 1) {
|
|
9399
|
+
mutableDate.year = 1;
|
|
9400
|
+
mutableDate.month = 1;
|
|
9401
|
+
mutableDate.day = 1;
|
|
9402
|
+
}
|
|
9403
|
+
let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
|
|
9404
|
+
if (mutableDate.year > maxYear) {
|
|
9405
|
+
var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
|
|
9406
|
+
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);
|
|
9407
|
+
mutableDate.year = maxYear;
|
|
9408
|
+
mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9409
|
+
mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9410
|
+
}
|
|
9411
|
+
if (mutableDate.month < 1) {
|
|
9412
|
+
mutableDate.month = 1;
|
|
9413
|
+
mutableDate.day = 1;
|
|
9414
|
+
}
|
|
9415
|
+
let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9416
|
+
if (mutableDate.month > maxMonth) {
|
|
9417
|
+
mutableDate.month = maxMonth;
|
|
9418
|
+
mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9419
|
+
}
|
|
9420
|
+
mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
|
|
9421
|
+
return mutableDate;
|
|
9422
|
+
}
|
|
9423
|
+
function $735220c2d4774dd3$var$addYears(date, years) {
|
|
9424
|
+
var _date_calendar_isInverseEra, _date_calendar;
|
|
9425
|
+
if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date))
|
|
9426
|
+
years = -years;
|
|
9427
|
+
date.year += years;
|
|
9428
|
+
}
|
|
9429
|
+
function $735220c2d4774dd3$var$balanceYearMonth(date) {
|
|
9430
|
+
while (date.month < 1) {
|
|
9431
|
+
$735220c2d4774dd3$var$addYears(date, -1);
|
|
9432
|
+
date.month += date.calendar.getMonthsInYear(date);
|
|
9433
|
+
}
|
|
9434
|
+
let monthsInYear = 0;
|
|
9435
|
+
while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
|
|
9436
|
+
date.month -= monthsInYear;
|
|
9437
|
+
$735220c2d4774dd3$var$addYears(date, 1);
|
|
9438
|
+
}
|
|
9439
|
+
}
|
|
9440
|
+
function $735220c2d4774dd3$var$balanceDay(date) {
|
|
9441
|
+
while (date.day < 1) {
|
|
9442
|
+
date.month--;
|
|
9443
|
+
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9444
|
+
date.day += date.calendar.getDaysInMonth(date);
|
|
9445
|
+
}
|
|
9446
|
+
while (date.day > date.calendar.getDaysInMonth(date)) {
|
|
9447
|
+
date.day -= date.calendar.getDaysInMonth(date);
|
|
9448
|
+
date.month++;
|
|
9449
|
+
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9450
|
+
}
|
|
9451
|
+
}
|
|
9452
|
+
function $735220c2d4774dd3$var$constrainMonthDay(date) {
|
|
9453
|
+
date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
|
|
9454
|
+
date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
|
|
9455
|
+
}
|
|
9456
|
+
function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
|
|
9457
|
+
if (date.calendar.constrainDate)
|
|
9458
|
+
date.calendar.constrainDate(date);
|
|
9459
|
+
date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
|
|
9460
|
+
$735220c2d4774dd3$var$constrainMonthDay(date);
|
|
9461
|
+
}
|
|
9462
|
+
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
|
|
9463
|
+
let inverseDuration = {};
|
|
9464
|
+
for (let key in duration)
|
|
9465
|
+
if (typeof duration[key] === "number")
|
|
9466
|
+
inverseDuration[key] = -duration[key];
|
|
9467
|
+
return inverseDuration;
|
|
9468
|
+
}
|
|
9469
|
+
function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
|
|
9470
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
9471
|
+
}
|
|
9472
|
+
function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
|
|
9473
|
+
let mutableDate = date.copy();
|
|
9474
|
+
if (fields.era != null)
|
|
9475
|
+
mutableDate.era = fields.era;
|
|
9476
|
+
if (fields.year != null)
|
|
9477
|
+
mutableDate.year = fields.year;
|
|
9478
|
+
if (fields.month != null)
|
|
9479
|
+
mutableDate.month = fields.month;
|
|
9480
|
+
if (fields.day != null)
|
|
9481
|
+
mutableDate.day = fields.day;
|
|
9482
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
|
|
9483
|
+
return mutableDate;
|
|
9484
|
+
}
|
|
9485
|
+
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
|
|
9486
|
+
let mutableValue = value.copy();
|
|
9487
|
+
if (fields.hour != null)
|
|
9488
|
+
mutableValue.hour = fields.hour;
|
|
9489
|
+
if (fields.minute != null)
|
|
9490
|
+
mutableValue.minute = fields.minute;
|
|
9491
|
+
if (fields.second != null)
|
|
9492
|
+
mutableValue.second = fields.second;
|
|
9493
|
+
if (fields.millisecond != null)
|
|
9494
|
+
mutableValue.millisecond = fields.millisecond;
|
|
9495
|
+
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
|
|
9496
|
+
return mutableValue;
|
|
9497
|
+
}
|
|
9498
|
+
function $735220c2d4774dd3$var$balanceTime(time) {
|
|
9499
|
+
time.second += Math.floor(time.millisecond / 1e3);
|
|
9500
|
+
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1e3);
|
|
9501
|
+
time.minute += Math.floor(time.second / 60);
|
|
9502
|
+
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
|
|
9503
|
+
time.hour += Math.floor(time.minute / 60);
|
|
9504
|
+
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
|
|
9505
|
+
let days = Math.floor(time.hour / 24);
|
|
9506
|
+
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
|
|
9507
|
+
return days;
|
|
9508
|
+
}
|
|
9509
|
+
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
|
|
9510
|
+
time.millisecond = Math.max(0, Math.min(time.millisecond, 1e3));
|
|
9511
|
+
time.second = Math.max(0, Math.min(time.second, 59));
|
|
9512
|
+
time.minute = Math.max(0, Math.min(time.minute, 59));
|
|
9513
|
+
time.hour = Math.max(0, Math.min(time.hour, 23));
|
|
9514
|
+
}
|
|
9515
|
+
function $735220c2d4774dd3$var$nonNegativeMod(a2, b) {
|
|
9516
|
+
let result = a2 % b;
|
|
9517
|
+
if (result < 0)
|
|
9518
|
+
result += b;
|
|
9519
|
+
return result;
|
|
9520
|
+
}
|
|
9521
|
+
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
|
|
9522
|
+
time.hour += duration.hours || 0;
|
|
9523
|
+
time.minute += duration.minutes || 0;
|
|
9524
|
+
time.second += duration.seconds || 0;
|
|
9525
|
+
time.millisecond += duration.milliseconds || 0;
|
|
9526
|
+
return $735220c2d4774dd3$var$balanceTime(time);
|
|
9527
|
+
}
|
|
9528
|
+
function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
|
|
9529
|
+
let mutable = value.copy();
|
|
9530
|
+
switch (field) {
|
|
9531
|
+
case "era": {
|
|
9532
|
+
let eras = value.calendar.getEras();
|
|
9533
|
+
let eraIndex = eras.indexOf(value.era);
|
|
9534
|
+
if (eraIndex < 0)
|
|
9535
|
+
throw new Error("Invalid era: " + value.era);
|
|
9536
|
+
eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
|
|
9537
|
+
mutable.era = eras[eraIndex];
|
|
9538
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9539
|
+
break;
|
|
9540
|
+
}
|
|
9541
|
+
case "year":
|
|
9542
|
+
var _mutable_calendar_isInverseEra, _mutable_calendar;
|
|
9543
|
+
if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable))
|
|
9544
|
+
amount = -amount;
|
|
9545
|
+
mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
|
|
9546
|
+
if (mutable.year === -Infinity)
|
|
9547
|
+
mutable.year = 1;
|
|
9548
|
+
if (mutable.calendar.balanceYearMonth)
|
|
9549
|
+
mutable.calendar.balanceYearMonth(mutable, value);
|
|
9550
|
+
break;
|
|
9551
|
+
case "month":
|
|
9552
|
+
mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9553
|
+
break;
|
|
9554
|
+
case "day":
|
|
9555
|
+
mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9556
|
+
break;
|
|
9557
|
+
default:
|
|
9558
|
+
throw new Error("Unsupported field " + field);
|
|
9559
|
+
}
|
|
9560
|
+
if (value.calendar.balanceDate)
|
|
9561
|
+
value.calendar.balanceDate(mutable);
|
|
9562
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9563
|
+
return mutable;
|
|
9564
|
+
}
|
|
9565
|
+
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
|
|
9566
|
+
let mutable = value.copy();
|
|
9567
|
+
switch (field) {
|
|
9568
|
+
case "hour": {
|
|
9569
|
+
let hours = value.hour;
|
|
9570
|
+
let min = 0;
|
|
9571
|
+
let max = 23;
|
|
9572
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
9573
|
+
let isPM = hours >= 12;
|
|
9574
|
+
min = isPM ? 12 : 0;
|
|
9575
|
+
max = isPM ? 23 : 11;
|
|
9576
|
+
}
|
|
9577
|
+
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
|
|
9578
|
+
break;
|
|
9579
|
+
}
|
|
9580
|
+
case "minute":
|
|
9581
|
+
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9582
|
+
break;
|
|
9583
|
+
case "second":
|
|
9584
|
+
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9585
|
+
break;
|
|
9586
|
+
case "millisecond":
|
|
9587
|
+
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
|
|
9588
|
+
break;
|
|
9589
|
+
default:
|
|
9590
|
+
throw new Error("Unsupported field " + field);
|
|
9591
|
+
}
|
|
9592
|
+
return mutable;
|
|
9593
|
+
}
|
|
9594
|
+
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
|
|
9595
|
+
if (round) {
|
|
9596
|
+
value += Math.sign(amount);
|
|
9597
|
+
if (value < min)
|
|
9598
|
+
value = max;
|
|
9599
|
+
let div = Math.abs(amount);
|
|
9600
|
+
if (amount > 0)
|
|
9601
|
+
value = Math.ceil(value / div) * div;
|
|
9602
|
+
else
|
|
9603
|
+
value = Math.floor(value / div) * div;
|
|
9604
|
+
if (value > max)
|
|
9605
|
+
value = min;
|
|
9606
|
+
} else {
|
|
9607
|
+
value += amount;
|
|
9608
|
+
if (value < min)
|
|
9609
|
+
value = max - (min - value - 1);
|
|
9610
|
+
else if (value > max)
|
|
9611
|
+
value = min + (value - max - 1);
|
|
9612
|
+
}
|
|
9613
|
+
return value;
|
|
9614
|
+
}
|
|
9615
|
+
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
|
|
9616
|
+
let ms;
|
|
9617
|
+
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) {
|
|
9618
|
+
let res2 = $735220c2d4774dd3$export$e16d8520af44a096($11d87f3f76e88657$export$b21e0b124e224484(dateTime), {
|
|
9619
|
+
years: duration.years,
|
|
9620
|
+
months: duration.months,
|
|
9621
|
+
weeks: duration.weeks,
|
|
9622
|
+
days: duration.days
|
|
9623
|
+
});
|
|
9624
|
+
ms = $11d87f3f76e88657$export$5107c82f94518f5c(res2, dateTime.timeZone);
|
|
9625
|
+
} else
|
|
9626
|
+
ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
9627
|
+
ms += duration.milliseconds || 0;
|
|
9628
|
+
ms += (duration.seconds || 0) * 1e3;
|
|
9629
|
+
ms += (duration.minutes || 0) * 6e4;
|
|
9630
|
+
ms += (duration.hours || 0) * 36e5;
|
|
9631
|
+
let res = $11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone);
|
|
9632
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032(res, dateTime.calendar);
|
|
9633
|
+
}
|
|
9634
|
+
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
|
|
9635
|
+
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
9636
|
+
}
|
|
9637
|
+
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
9638
|
+
switch (field) {
|
|
9639
|
+
case "hour": {
|
|
9640
|
+
let min = 0;
|
|
9641
|
+
let max = 23;
|
|
9642
|
+
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
9643
|
+
let isPM = dateTime.hour >= 12;
|
|
9644
|
+
min = isPM ? 12 : 0;
|
|
9645
|
+
max = isPM ? 23 : 11;
|
|
9646
|
+
}
|
|
9647
|
+
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
9648
|
+
let minDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
9649
|
+
hour: min
|
|
9650
|
+
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9651
|
+
let minAbsolute = [
|
|
9652
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "earlier"),
|
|
9653
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "later")
|
|
9654
|
+
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === minDate.day)[0];
|
|
9655
|
+
let maxDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
9656
|
+
hour: max
|
|
9657
|
+
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9658
|
+
let maxAbsolute = [
|
|
9659
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "earlier"),
|
|
9660
|
+
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "later")
|
|
9661
|
+
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === maxDate.day).pop();
|
|
9662
|
+
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
9663
|
+
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
|
|
9664
|
+
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
|
|
9665
|
+
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;
|
|
9666
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9667
|
+
}
|
|
9668
|
+
case "minute":
|
|
9669
|
+
case "second":
|
|
9670
|
+
case "millisecond":
|
|
9671
|
+
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
9672
|
+
case "era":
|
|
9673
|
+
case "year":
|
|
9674
|
+
case "month":
|
|
9675
|
+
case "day": {
|
|
9676
|
+
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c($11d87f3f76e88657$export$b21e0b124e224484(dateTime), field, amount, options);
|
|
9677
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone);
|
|
9678
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9679
|
+
}
|
|
9680
|
+
default:
|
|
9681
|
+
throw new Error("Unsupported field " + field);
|
|
9682
|
+
}
|
|
9683
|
+
}
|
|
9684
|
+
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
9685
|
+
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
9686
|
+
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
9687
|
+
if (res.compare(plainDateTime) === 0)
|
|
9688
|
+
return dateTime;
|
|
9689
|
+
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation);
|
|
9690
|
+
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
9691
|
+
}
|
|
9692
|
+
const $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
9693
|
+
function $fae977aafc393c5c$export$5adfdab05168c219(value, timeZone) {
|
|
9694
|
+
let m = value.match($fae977aafc393c5c$var$ABSOLUTE_RE);
|
|
9695
|
+
if (!m)
|
|
9696
|
+
throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
9697
|
+
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);
|
|
9698
|
+
date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
9699
|
+
var _m_;
|
|
9700
|
+
if (m[8])
|
|
9701
|
+
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;
|
|
9702
|
+
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
9703
|
+
}
|
|
9704
|
+
function $fae977aafc393c5c$var$parseNumber(value, min, max) {
|
|
9705
|
+
let val = Number(value);
|
|
9706
|
+
if (val < min || val > max)
|
|
9707
|
+
throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
9708
|
+
return val;
|
|
9709
|
+
}
|
|
9710
|
+
function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
|
|
9711
|
+
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) : ""}`;
|
|
9712
|
+
}
|
|
9713
|
+
function $fae977aafc393c5c$export$60dfd74aa96791bd(date) {
|
|
9714
|
+
let gregorianDate = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9715
|
+
return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
|
|
9716
|
+
}
|
|
9717
|
+
function $fae977aafc393c5c$export$4223de14708adc63(date) {
|
|
9718
|
+
return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
|
|
9719
|
+
}
|
|
9720
|
+
function $fae977aafc393c5c$var$offsetToString(offset) {
|
|
9721
|
+
let sign = Math.sign(offset) < 0 ? "-" : "+";
|
|
9722
|
+
offset = Math.abs(offset);
|
|
9723
|
+
let offsetHours = Math.floor(offset / 36e5);
|
|
9724
|
+
let offsetMinutes = offset % 36e5 / 6e4;
|
|
9725
|
+
return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
|
|
9726
|
+
}
|
|
9727
|
+
function $fae977aafc393c5c$export$bf79f1ebf4b18792(date) {
|
|
9728
|
+
return `${$fae977aafc393c5c$export$4223de14708adc63(date)}${$fae977aafc393c5c$var$offsetToString(date.offset)}[${date.timeZone}]`;
|
|
9729
|
+
}
|
|
9730
|
+
function _check_private_redeclaration(obj, privateCollection) {
|
|
9731
|
+
if (privateCollection.has(obj)) {
|
|
9732
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
9733
|
+
}
|
|
9734
|
+
}
|
|
9735
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
9736
|
+
_check_private_redeclaration(obj, privateMap);
|
|
9737
|
+
privateMap.set(obj, value);
|
|
9738
|
+
}
|
|
9739
|
+
function $35ea8db9cb2ccb90$var$shiftArgs(args) {
|
|
9740
|
+
let calendar = typeof args[0] === "object" ? args.shift() : new $3b62074eb05584b2$export$80ee6245ec4f29ec();
|
|
9741
|
+
let era;
|
|
9742
|
+
if (typeof args[0] === "string")
|
|
9743
|
+
era = args.shift();
|
|
9744
|
+
else {
|
|
9745
|
+
let eras = calendar.getEras();
|
|
9746
|
+
era = eras[eras.length - 1];
|
|
9747
|
+
}
|
|
9748
|
+
let year = args.shift();
|
|
9749
|
+
let month = args.shift();
|
|
9750
|
+
let day = args.shift();
|
|
9751
|
+
return [
|
|
9752
|
+
calendar,
|
|
9753
|
+
era,
|
|
9754
|
+
year,
|
|
9755
|
+
month,
|
|
9756
|
+
day
|
|
9757
|
+
];
|
|
9758
|
+
}
|
|
9759
|
+
var $35ea8db9cb2ccb90$var$_type = /* @__PURE__ */ new WeakMap();
|
|
9760
|
+
class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
|
|
9761
|
+
/** Returns a copy of this date. */
|
|
9762
|
+
copy() {
|
|
9763
|
+
if (this.era)
|
|
9764
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
9765
|
+
else
|
|
9766
|
+
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
9767
|
+
}
|
|
9768
|
+
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
9769
|
+
add(duration) {
|
|
9770
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
9771
|
+
}
|
|
9772
|
+
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
9773
|
+
subtract(duration) {
|
|
9774
|
+
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
9775
|
+
}
|
|
9776
|
+
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9777
|
+
set(fields) {
|
|
9778
|
+
return $735220c2d4774dd3$export$adaa4cf7ef1b65be(this, fields);
|
|
9779
|
+
}
|
|
9780
|
+
/**
|
|
9781
|
+
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
9782
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9783
|
+
*/
|
|
9784
|
+
cycle(field, amount, options) {
|
|
9785
|
+
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
9786
|
+
}
|
|
9787
|
+
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
9788
|
+
toDate(timeZone) {
|
|
9789
|
+
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone);
|
|
9790
|
+
}
|
|
9791
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
9792
|
+
toString() {
|
|
9793
|
+
return $fae977aafc393c5c$export$60dfd74aa96791bd(this);
|
|
9794
|
+
}
|
|
9795
|
+
/** 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. */
|
|
9796
|
+
compare(b) {
|
|
9797
|
+
return $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
9798
|
+
}
|
|
9799
|
+
constructor(...args) {
|
|
9800
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type, {
|
|
9801
|
+
writable: true,
|
|
9802
|
+
value: void 0
|
|
9803
|
+
});
|
|
9804
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9805
|
+
this.calendar = calendar;
|
|
9806
|
+
this.era = era;
|
|
9807
|
+
this.year = year;
|
|
9808
|
+
this.month = month;
|
|
9809
|
+
this.day = day;
|
|
9810
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9811
|
+
}
|
|
9812
|
+
}
|
|
9813
|
+
var $35ea8db9cb2ccb90$var$_type2 = /* @__PURE__ */ new WeakMap();
|
|
9814
|
+
class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
|
|
9815
|
+
/** Returns a copy of this date. */
|
|
9816
|
+
copy() {
|
|
9817
|
+
if (this.era)
|
|
9818
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
9819
|
+
else
|
|
9820
|
+
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
9821
|
+
}
|
|
9822
|
+
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
9823
|
+
add(duration) {
|
|
9824
|
+
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
9825
|
+
}
|
|
9826
|
+
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
9827
|
+
subtract(duration) {
|
|
9828
|
+
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
9829
|
+
}
|
|
9830
|
+
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9831
|
+
set(fields) {
|
|
9832
|
+
return $735220c2d4774dd3$export$adaa4cf7ef1b65be($735220c2d4774dd3$export$e5d5e1c1822b6e56(this, fields), fields);
|
|
9833
|
+
}
|
|
9834
|
+
/**
|
|
9835
|
+
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
9836
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9837
|
+
*/
|
|
9838
|
+
cycle(field, amount, options) {
|
|
9839
|
+
switch (field) {
|
|
9840
|
+
case "era":
|
|
9841
|
+
case "year":
|
|
9842
|
+
case "month":
|
|
9843
|
+
case "day":
|
|
9844
|
+
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
9845
|
+
default:
|
|
9846
|
+
return $735220c2d4774dd3$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
9850
|
+
toDate(timeZone, disambiguation) {
|
|
9851
|
+
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone, disambiguation);
|
|
9852
|
+
}
|
|
9853
|
+
/** Converts the date to an ISO 8601 formatted string. */
|
|
9854
|
+
toString() {
|
|
9855
|
+
return $fae977aafc393c5c$export$4223de14708adc63(this);
|
|
9856
|
+
}
|
|
9857
|
+
/** 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. */
|
|
9858
|
+
compare(b) {
|
|
9859
|
+
let res = $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
9860
|
+
if (res === 0)
|
|
9861
|
+
return $14e0f24ef4ac5c92$export$c19a80a9721b80f6(this, $11d87f3f76e88657$export$b21e0b124e224484(b));
|
|
9862
|
+
return res;
|
|
9863
|
+
}
|
|
9864
|
+
constructor(...args) {
|
|
9865
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type2, {
|
|
9866
|
+
writable: true,
|
|
9867
|
+
value: void 0
|
|
9868
|
+
});
|
|
9869
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9870
|
+
this.calendar = calendar;
|
|
9871
|
+
this.era = era;
|
|
9872
|
+
this.year = year;
|
|
9873
|
+
this.month = month;
|
|
9874
|
+
this.day = day;
|
|
9875
|
+
this.hour = args.shift() || 0;
|
|
9876
|
+
this.minute = args.shift() || 0;
|
|
9877
|
+
this.second = args.shift() || 0;
|
|
9878
|
+
this.millisecond = args.shift() || 0;
|
|
9879
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9880
|
+
}
|
|
9881
|
+
}
|
|
9882
|
+
var $35ea8db9cb2ccb90$var$_type3 = /* @__PURE__ */ new WeakMap();
|
|
9883
|
+
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
|
|
9884
|
+
/** Returns a copy of this date. */
|
|
9885
|
+
copy() {
|
|
9886
|
+
if (this.era)
|
|
9887
|
+
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);
|
|
9888
|
+
else
|
|
9889
|
+
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);
|
|
9890
|
+
}
|
|
9891
|
+
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
9892
|
+
add(duration) {
|
|
9893
|
+
return $735220c2d4774dd3$export$96b1d28349274637(this, duration);
|
|
9894
|
+
}
|
|
9895
|
+
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
9896
|
+
subtract(duration) {
|
|
9897
|
+
return $735220c2d4774dd3$export$6814caac34ca03c7(this, duration);
|
|
9898
|
+
}
|
|
9899
|
+
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
9900
|
+
set(fields, disambiguation) {
|
|
9901
|
+
return $735220c2d4774dd3$export$31b5430eb18be4f8(this, fields, disambiguation);
|
|
9902
|
+
}
|
|
9903
|
+
/**
|
|
9904
|
+
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
9905
|
+
* When the resulting value reaches the limits of the field, it wraps around.
|
|
9906
|
+
*/
|
|
9907
|
+
cycle(field, amount, options) {
|
|
9908
|
+
return $735220c2d4774dd3$export$9a297d111fc86b79(this, field, amount, options);
|
|
9909
|
+
}
|
|
9910
|
+
/** Converts the date to a native JavaScript Date object. */
|
|
9911
|
+
toDate() {
|
|
9912
|
+
return $11d87f3f76e88657$export$83aac07b4c37b25(this);
|
|
9913
|
+
}
|
|
9914
|
+
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
|
|
9915
|
+
toString() {
|
|
9916
|
+
return $fae977aafc393c5c$export$bf79f1ebf4b18792(this);
|
|
9917
|
+
}
|
|
9918
|
+
/** Converts the date to an ISO 8601 formatted string in UTC. */
|
|
9919
|
+
toAbsoluteString() {
|
|
9920
|
+
return this.toDate().toISOString();
|
|
9921
|
+
}
|
|
9922
|
+
/** 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. */
|
|
9923
|
+
compare(b) {
|
|
9924
|
+
return this.toDate().getTime() - $11d87f3f76e88657$export$84c95a83c799e074(b, this.timeZone).toDate().getTime();
|
|
9925
|
+
}
|
|
9926
|
+
constructor(...args) {
|
|
9927
|
+
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type3, {
|
|
9928
|
+
writable: true,
|
|
9929
|
+
value: void 0
|
|
9930
|
+
});
|
|
9931
|
+
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
9932
|
+
let timeZone = args.shift();
|
|
9933
|
+
let offset = args.shift();
|
|
9934
|
+
this.calendar = calendar;
|
|
9935
|
+
this.era = era;
|
|
9936
|
+
this.year = year;
|
|
9937
|
+
this.month = month;
|
|
9938
|
+
this.day = day;
|
|
9939
|
+
this.timeZone = timeZone;
|
|
9940
|
+
this.offset = offset;
|
|
9941
|
+
this.hour = args.shift() || 0;
|
|
9942
|
+
this.minute = args.shift() || 0;
|
|
9943
|
+
this.second = args.shift() || 0;
|
|
9944
|
+
this.millisecond = args.shift() || 0;
|
|
9945
|
+
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
9946
|
+
}
|
|
9947
|
+
}
|
|
9021
9948
|
const [Provider, useHistory] = createContext("History", {
|
|
9022
9949
|
history: [],
|
|
9023
9950
|
currentLocationIndex: 0,
|
|
@@ -9077,107 +10004,241 @@ styledComponents.styled(designSystem.Typography)`
|
|
|
9077
10004
|
word-break: break-all;
|
|
9078
10005
|
color: ${({ theme }) => theme.colors.danger600};
|
|
9079
10006
|
`;
|
|
9080
|
-
({
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
});
|
|
9084
|
-
function getIn(obj, key, def, pathStartIndex = 0) {
|
|
9085
|
-
const path = toPath__default.default(key);
|
|
9086
|
-
while (obj && pathStartIndex < path.length) {
|
|
9087
|
-
obj = obj[path[pathStartIndex++]];
|
|
9088
|
-
}
|
|
9089
|
-
if (pathStartIndex !== path.length && !obj) {
|
|
9090
|
-
return def;
|
|
10007
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
10008
|
+
if (!startActions && !endActions) {
|
|
10009
|
+
return null;
|
|
9091
10010
|
}
|
|
9092
|
-
return
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
|
|
9105
|
-
resVal = resVal[currentPath] = clone__default.default(currentObj);
|
|
9106
|
-
} else {
|
|
9107
|
-
const nextPath = pathArray[i + 1];
|
|
9108
|
-
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
10011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10012
|
+
designSystem.Flex,
|
|
10013
|
+
{
|
|
10014
|
+
justifyContent: "space-between",
|
|
10015
|
+
alignItems: "flex-start",
|
|
10016
|
+
paddingBottom: 4,
|
|
10017
|
+
paddingLeft: 10,
|
|
10018
|
+
paddingRight: 10,
|
|
10019
|
+
children: [
|
|
10020
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
10021
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
10022
|
+
]
|
|
9109
10023
|
}
|
|
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
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
})
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
10024
|
+
);
|
|
10025
|
+
};
|
|
10026
|
+
const ContentLayout = ({ children }) => {
|
|
10027
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
10028
|
+
};
|
|
10029
|
+
const GridColSize = {
|
|
10030
|
+
S: 180,
|
|
10031
|
+
M: 250
|
|
10032
|
+
};
|
|
10033
|
+
const StyledGrid = styledComponents.styled(designSystem.Box)`
|
|
10034
|
+
display: grid;
|
|
10035
|
+
grid-template-columns: repeat(
|
|
10036
|
+
auto-fit,
|
|
10037
|
+
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
10038
|
+
);
|
|
10039
|
+
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
10040
|
+
`;
|
|
10041
|
+
const GridLayout = ({ size, children }) => {
|
|
10042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { $size: size, children });
|
|
10043
|
+
};
|
|
10044
|
+
const BaseHeaderLayout = React__namespace.forwardRef(
|
|
10045
|
+
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
10046
|
+
const isSubtitleString = typeof subtitle === "string";
|
|
10047
|
+
if (sticky) {
|
|
10048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10049
|
+
designSystem.Box,
|
|
10050
|
+
{
|
|
10051
|
+
paddingLeft: 6,
|
|
10052
|
+
paddingRight: 6,
|
|
10053
|
+
paddingTop: 3,
|
|
10054
|
+
paddingBottom: 3,
|
|
10055
|
+
position: "fixed",
|
|
10056
|
+
top: 0,
|
|
10057
|
+
right: 0,
|
|
10058
|
+
background: "neutral0",
|
|
10059
|
+
shadow: "tableShadow",
|
|
10060
|
+
width: `${width}rem`,
|
|
10061
|
+
zIndex: 1,
|
|
10062
|
+
"data-strapi-header-sticky": true,
|
|
10063
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
10064
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
10065
|
+
navigationAction && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingRight: 3, children: navigationAction }),
|
|
10066
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
10067
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
10068
|
+
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
10069
|
+
] }),
|
|
10070
|
+
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10071
|
+
] }),
|
|
10072
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: primaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
10073
|
+
] })
|
|
10074
|
+
}
|
|
10075
|
+
);
|
|
10076
|
+
}
|
|
10077
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10078
|
+
designSystem.Box,
|
|
10079
|
+
{
|
|
10080
|
+
ref,
|
|
10081
|
+
paddingLeft: 10,
|
|
10082
|
+
paddingRight: 10,
|
|
10083
|
+
paddingBottom: 8,
|
|
10084
|
+
paddingTop: navigationAction ? 6 : 8,
|
|
10085
|
+
background: "neutral100",
|
|
10086
|
+
"data-strapi-header": true,
|
|
10087
|
+
children: [
|
|
10088
|
+
navigationAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
10089
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
10090
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { minWidth: 0, children: [
|
|
10091
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
10092
|
+
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10093
|
+
] }),
|
|
10094
|
+
primaryAction
|
|
10095
|
+
] }),
|
|
10096
|
+
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
10097
|
+
]
|
|
10098
|
+
}
|
|
10099
|
+
);
|
|
10100
|
+
}
|
|
10101
|
+
);
|
|
10102
|
+
const HeaderLayout = (props) => {
|
|
10103
|
+
const baseHeaderLayoutRef = React__namespace.useRef(null);
|
|
10104
|
+
const [headerSize, setHeaderSize] = React__namespace.useState(null);
|
|
10105
|
+
const [containerRef, isVisible] = useElementOnScreen({
|
|
10106
|
+
root: null,
|
|
10107
|
+
rootMargin: "0px",
|
|
10108
|
+
threshold: 0
|
|
10109
|
+
});
|
|
10110
|
+
useResizeObserver(containerRef, () => {
|
|
10111
|
+
if (containerRef.current) {
|
|
10112
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
10113
|
+
}
|
|
10114
|
+
});
|
|
10115
|
+
React__namespace.useEffect(() => {
|
|
10116
|
+
if (baseHeaderLayoutRef.current) {
|
|
10117
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
10118
|
+
}
|
|
10119
|
+
}, [baseHeaderLayoutRef]);
|
|
10120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10121
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
10122
|
+
!isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
10123
|
+
] });
|
|
10124
|
+
};
|
|
10125
|
+
HeaderLayout.displayName = "HeaderLayout";
|
|
10126
|
+
const useElementOnScreen = (options) => {
|
|
10127
|
+
const containerRef = React__namespace.useRef(null);
|
|
10128
|
+
const [isVisible, setIsVisible] = React__namespace.useState(true);
|
|
10129
|
+
const callback = ([entry]) => {
|
|
10130
|
+
setIsVisible(entry.isIntersecting);
|
|
10131
|
+
};
|
|
10132
|
+
React__namespace.useEffect(() => {
|
|
10133
|
+
const containerEl = containerRef.current;
|
|
10134
|
+
const observer = new IntersectionObserver(callback, options);
|
|
10135
|
+
if (containerEl) {
|
|
10136
|
+
observer.observe(containerRef.current);
|
|
10137
|
+
}
|
|
10138
|
+
return () => {
|
|
10139
|
+
if (containerEl) {
|
|
10140
|
+
observer.disconnect();
|
|
10141
|
+
}
|
|
10142
|
+
};
|
|
10143
|
+
}, [containerRef, options]);
|
|
10144
|
+
return [containerRef, isVisible];
|
|
10145
|
+
};
|
|
10146
|
+
const useResizeObserver = (sources, onResize) => {
|
|
10147
|
+
const handleResize = designSystem.useCallbackRef(onResize);
|
|
10148
|
+
React__namespace.useLayoutEffect(() => {
|
|
10149
|
+
const resizeObs = new ResizeObserver(handleResize);
|
|
10150
|
+
if (Array.isArray(sources)) {
|
|
10151
|
+
sources.forEach((source) => {
|
|
10152
|
+
if (source.current) {
|
|
10153
|
+
resizeObs.observe(source.current);
|
|
10154
|
+
}
|
|
10155
|
+
});
|
|
10156
|
+
} else if (sources.current) {
|
|
10157
|
+
resizeObs.observe(sources.current);
|
|
10158
|
+
}
|
|
10159
|
+
return () => {
|
|
10160
|
+
resizeObs.disconnect();
|
|
10161
|
+
};
|
|
10162
|
+
}, [sources, handleResize]);
|
|
10163
|
+
};
|
|
10164
|
+
const GridContainer = styledComponents.styled(designSystem.Box)`
|
|
10165
|
+
display: grid;
|
|
10166
|
+
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
10167
|
+
`;
|
|
10168
|
+
const OverflowingItem = styledComponents.styled(designSystem.Box)`
|
|
10169
|
+
overflow-x: hidden;
|
|
10170
|
+
`;
|
|
10171
|
+
const RootLayout = ({ sideNav, children }) => {
|
|
10172
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
10173
|
+
sideNav,
|
|
10174
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
10175
|
+
] });
|
|
10176
|
+
};
|
|
10177
|
+
const Layouts = {
|
|
10178
|
+
Root: RootLayout,
|
|
10179
|
+
Header: HeaderLayout,
|
|
10180
|
+
BaseHeader: BaseHeaderLayout,
|
|
10181
|
+
Grid: GridLayout,
|
|
10182
|
+
Action: ActionLayout,
|
|
10183
|
+
Content: ContentLayout
|
|
10184
|
+
};
|
|
10185
|
+
const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
|
|
10186
|
+
const [FormProvider, useForm] = createContext("Form", {
|
|
10187
|
+
disabled: false,
|
|
10188
|
+
errors: {},
|
|
10189
|
+
initialValues: {},
|
|
10190
|
+
isSubmitting: false,
|
|
10191
|
+
modified: false,
|
|
10192
|
+
addFieldRow: () => {
|
|
10193
|
+
throw new Error(ERR_MSG);
|
|
10194
|
+
},
|
|
10195
|
+
moveFieldRow: () => {
|
|
10196
|
+
throw new Error(ERR_MSG);
|
|
10197
|
+
},
|
|
10198
|
+
onChange: () => {
|
|
10199
|
+
throw new Error(ERR_MSG);
|
|
10200
|
+
},
|
|
10201
|
+
removeFieldRow: () => {
|
|
10202
|
+
throw new Error(ERR_MSG);
|
|
10203
|
+
},
|
|
10204
|
+
resetForm: () => {
|
|
10205
|
+
throw new Error(ERR_MSG);
|
|
10206
|
+
},
|
|
10207
|
+
setErrors: () => {
|
|
10208
|
+
throw new Error(ERR_MSG);
|
|
10209
|
+
},
|
|
10210
|
+
setValues: () => {
|
|
10211
|
+
throw new Error(ERR_MSG);
|
|
10212
|
+
},
|
|
10213
|
+
setSubmitting: () => {
|
|
10214
|
+
throw new Error(ERR_MSG);
|
|
10215
|
+
},
|
|
10216
|
+
validate: async () => {
|
|
10217
|
+
throw new Error(ERR_MSG);
|
|
10218
|
+
},
|
|
10219
|
+
values: {}
|
|
10220
|
+
});
|
|
10221
|
+
React__namespace.forwardRef(
|
|
10222
|
+
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
|
|
10223
|
+
const formRef = React__namespace.useRef(null);
|
|
10224
|
+
const initialValues = React__namespace.useRef(props.initialValues ?? {});
|
|
10225
|
+
const [state, dispatch] = React__namespace.useReducer(reducer, {
|
|
10226
|
+
errors: initialErrors ?? {},
|
|
10227
|
+
isSubmitting: false,
|
|
10228
|
+
values: props.initialValues ?? {}
|
|
10229
|
+
});
|
|
10230
|
+
React__namespace.useEffect(() => {
|
|
10231
|
+
if (!isEqual__default.default(initialValues.current, props.initialValues)) {
|
|
10232
|
+
initialValues.current = props.initialValues ?? {};
|
|
10233
|
+
dispatch({
|
|
10234
|
+
type: "SET_INITIAL_VALUES",
|
|
10235
|
+
payload: props.initialValues ?? {}
|
|
10236
|
+
});
|
|
10237
|
+
}
|
|
10238
|
+
}, [props.initialValues]);
|
|
10239
|
+
const setErrors = React__namespace.useCallback((errors) => {
|
|
10240
|
+
dispatch({
|
|
10241
|
+
type: "SET_ERRORS",
|
|
9181
10242
|
payload: errors
|
|
9182
10243
|
});
|
|
9183
10244
|
}, []);
|
|
@@ -9470,7 +10531,7 @@ const reducer = (state, action) => createNextState2.produce(state, (draft) => {
|
|
|
9470
10531
|
draft.values = setIn(
|
|
9471
10532
|
state.values,
|
|
9472
10533
|
action.payload.field,
|
|
9473
|
-
newValue.length > 0 ? newValue :
|
|
10534
|
+
newValue.length > 0 ? newValue : []
|
|
9474
10535
|
);
|
|
9475
10536
|
break;
|
|
9476
10537
|
}
|
|
@@ -9500,11 +10561,18 @@ const useField = (path) => {
|
|
|
9500
10561
|
(state) => getIn(state.values, path)
|
|
9501
10562
|
);
|
|
9502
10563
|
const handleChange = useForm("useField", (state) => state.onChange);
|
|
9503
|
-
const error = useForm("useField", (state) =>
|
|
10564
|
+
const error = useForm("useField", (state) => {
|
|
10565
|
+
const error2 = getIn(state.errors, path);
|
|
10566
|
+
if (isErrorMessageDescriptor(error2)) {
|
|
10567
|
+
const { values, ...message } = error2;
|
|
10568
|
+
return formatMessage(message, values);
|
|
10569
|
+
}
|
|
10570
|
+
return error2;
|
|
10571
|
+
});
|
|
9504
10572
|
return {
|
|
9505
10573
|
initialValue,
|
|
9506
10574
|
/**
|
|
9507
|
-
* Errors can be a string, or a
|
|
10575
|
+
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
|
|
9508
10576
|
* If it's anything else, we don't return it.
|
|
9509
10577
|
*/
|
|
9510
10578
|
error: isErrorMessageDescriptor(error) ? formatMessage(
|
|
@@ -9519,7 +10587,7 @@ const useField = (path) => {
|
|
|
9519
10587
|
};
|
|
9520
10588
|
};
|
|
9521
10589
|
const isErrorMessageDescriptor = (object) => {
|
|
9522
|
-
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
|
10590
|
+
return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
|
|
9523
10591
|
};
|
|
9524
10592
|
const useFocusInputField = (name) => {
|
|
9525
10593
|
const { search: searchString } = reactRouterDom.useLocation();
|
|
@@ -9567,7 +10635,7 @@ const BooleanInput = React.forwardRef(
|
|
|
9567
10635
|
);
|
|
9568
10636
|
const MemoizedBooleanInput = React.memo(BooleanInput);
|
|
9569
10637
|
const CheckboxInput = React.forwardRef(
|
|
9570
|
-
({ name, required, label, hint, ...props }, ref) => {
|
|
10638
|
+
({ name, required, label, hint, type: _type, ...props }, ref) => {
|
|
9571
10639
|
const field = useField(name);
|
|
9572
10640
|
const fieldRef = useFocusInputField(name);
|
|
9573
10641
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
|
@@ -9575,9 +10643,9 @@ const CheckboxInput = React.forwardRef(
|
|
|
9575
10643
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9576
10644
|
designSystem.Checkbox,
|
|
9577
10645
|
{
|
|
9578
|
-
|
|
10646
|
+
onCheckedChange: (checked) => field.onChange(name, !!checked),
|
|
9579
10647
|
ref: composedRefs,
|
|
9580
|
-
|
|
10648
|
+
checked: field.value,
|
|
9581
10649
|
...props,
|
|
9582
10650
|
children: label || props["aria-label"]
|
|
9583
10651
|
}
|
|
@@ -9603,10 +10671,10 @@ const DateInput = React.forwardRef(
|
|
|
9603
10671
|
ref: composedRefs,
|
|
9604
10672
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9605
10673
|
onChange: (date) => {
|
|
9606
|
-
field.onChange(name, date);
|
|
10674
|
+
field.onChange(name, date ? convertLocalDateToUTCDate(date) : null);
|
|
9607
10675
|
},
|
|
9608
|
-
onClear: () => field.onChange(name,
|
|
9609
|
-
value,
|
|
10676
|
+
onClear: () => field.onChange(name, null),
|
|
10677
|
+
value: value ? convertLocalDateToUTCDate(value) : value,
|
|
9610
10678
|
...props
|
|
9611
10679
|
}
|
|
9612
10680
|
),
|
|
@@ -9615,6 +10683,12 @@ const DateInput = React.forwardRef(
|
|
|
9615
10683
|
] });
|
|
9616
10684
|
}
|
|
9617
10685
|
);
|
|
10686
|
+
const convertLocalDateToUTCDate = (date) => {
|
|
10687
|
+
const utcDateString = date.toISOString();
|
|
10688
|
+
const timeZone = $14e0f24ef4ac5c92$export$aa8b41735afcabd2();
|
|
10689
|
+
const zonedDateTime = $fae977aafc393c5c$export$5adfdab05168c219(utcDateString, timeZone);
|
|
10690
|
+
return $11d87f3f76e88657$export$93522d1a439f3617(zonedDateTime).toDate("UTC");
|
|
10691
|
+
};
|
|
9618
10692
|
const MemoizedDateInput = React.memo(DateInput);
|
|
9619
10693
|
const DateTimeInput = React.forwardRef(
|
|
9620
10694
|
({ name, required, label, hint, labelAction, ...props }, ref) => {
|
|
@@ -9631,9 +10705,9 @@ const DateTimeInput = React.forwardRef(
|
|
|
9631
10705
|
ref: composedRefs,
|
|
9632
10706
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9633
10707
|
onChange: (date) => {
|
|
9634
|
-
field.onChange(name, date);
|
|
10708
|
+
field.onChange(name, date ? date : null);
|
|
9635
10709
|
},
|
|
9636
|
-
onClear: () => field.onChange(name,
|
|
10710
|
+
onClear: () => field.onChange(name, null),
|
|
9637
10711
|
value,
|
|
9638
10712
|
...props
|
|
9639
10713
|
}
|
|
@@ -9855,7 +10929,7 @@ const TimeInput = React.forwardRef(
|
|
|
9855
10929
|
ref: composedRefs,
|
|
9856
10930
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
9857
10931
|
onChange: (time) => {
|
|
9858
|
-
field.onChange(name, time);
|
|
10932
|
+
field.onChange(name, `${time}:00.000`);
|
|
9859
10933
|
},
|
|
9860
10934
|
onClear: () => field.onChange(name, void 0),
|
|
9861
10935
|
value: field.value ?? "",
|
|
@@ -9874,6 +10948,7 @@ const InputRenderer = React.memo(
|
|
|
9874
10948
|
case "biginteger":
|
|
9875
10949
|
case "timestamp":
|
|
9876
10950
|
case "string":
|
|
10951
|
+
case "uid":
|
|
9877
10952
|
return /* @__PURE__ */ jsxRuntime.jsx(MemoizedStringInput, { ref: forwardRef2, ...props });
|
|
9878
10953
|
case "boolean":
|
|
9879
10954
|
return /* @__PURE__ */ jsxRuntime.jsx(MemoizedBooleanInput, { ref: forwardRef2, ...props });
|
|
@@ -10151,184 +11226,18 @@ yup__namespace.object().shape({
|
|
|
10151
11226
|
defaultMessage: "Passwords must match"
|
|
10152
11227
|
})
|
|
10153
11228
|
});
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
paddingLeft: 10,
|
|
10165
|
-
paddingRight: 10,
|
|
10166
|
-
children: [
|
|
10167
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
10168
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
10169
|
-
]
|
|
10170
|
-
}
|
|
10171
|
-
);
|
|
10172
|
-
};
|
|
10173
|
-
const ContentLayout = ({ children }) => {
|
|
10174
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
10175
|
-
};
|
|
10176
|
-
const GridColSize = {
|
|
10177
|
-
S: 180,
|
|
10178
|
-
M: 250
|
|
10179
|
-
};
|
|
10180
|
-
const StyledGrid = styledComponents.styled(designSystem.Box)`
|
|
10181
|
-
display: grid;
|
|
10182
|
-
grid-template-columns: repeat(
|
|
10183
|
-
auto-fit,
|
|
10184
|
-
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
10185
|
-
);
|
|
10186
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
10187
|
-
`;
|
|
10188
|
-
const GridLayout = ({ size, children }) => {
|
|
10189
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { $size: size, children });
|
|
10190
|
-
};
|
|
10191
|
-
const BaseHeaderLayout = React__namespace.forwardRef(
|
|
10192
|
-
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
10193
|
-
const isSubtitleString = typeof subtitle === "string";
|
|
10194
|
-
if (sticky) {
|
|
10195
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10196
|
-
designSystem.Box,
|
|
10197
|
-
{
|
|
10198
|
-
paddingLeft: 6,
|
|
10199
|
-
paddingRight: 6,
|
|
10200
|
-
paddingTop: 3,
|
|
10201
|
-
paddingBottom: 3,
|
|
10202
|
-
position: "fixed",
|
|
10203
|
-
top: 0,
|
|
10204
|
-
right: 0,
|
|
10205
|
-
background: "neutral0",
|
|
10206
|
-
shadow: "tableShadow",
|
|
10207
|
-
width: `${width}rem`,
|
|
10208
|
-
zIndex: 1,
|
|
10209
|
-
"data-strapi-header-sticky": true,
|
|
10210
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
10211
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
10212
|
-
navigationAction && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingRight: 3, children: navigationAction }),
|
|
10213
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
10214
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
10215
|
-
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
10216
|
-
] }),
|
|
10217
|
-
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10218
|
-
] }),
|
|
10219
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: primaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
10220
|
-
] })
|
|
10221
|
-
}
|
|
10222
|
-
);
|
|
10223
|
-
}
|
|
10224
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10225
|
-
designSystem.Box,
|
|
10226
|
-
{
|
|
10227
|
-
ref,
|
|
10228
|
-
paddingLeft: 10,
|
|
10229
|
-
paddingRight: 10,
|
|
10230
|
-
paddingBottom: 8,
|
|
10231
|
-
paddingTop: navigationAction ? 6 : 8,
|
|
10232
|
-
background: "neutral100",
|
|
10233
|
-
"data-strapi-header": true,
|
|
10234
|
-
children: [
|
|
10235
|
-
navigationAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
10236
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
10237
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { minWidth: 0, children: [
|
|
10238
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
10239
|
-
secondaryAction ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
10240
|
-
] }),
|
|
10241
|
-
primaryAction
|
|
10242
|
-
] }),
|
|
10243
|
-
isSubtitleString ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
10244
|
-
]
|
|
10245
|
-
}
|
|
10246
|
-
);
|
|
11229
|
+
({
|
|
11230
|
+
[adminApi.reducerPath]: adminApi.reducer,
|
|
11231
|
+
admin_app: reducer$1
|
|
11232
|
+
});
|
|
11233
|
+
styledComponents.styled(icons.WarningCircle)`
|
|
11234
|
+
width: 24px;
|
|
11235
|
+
height: 24px;
|
|
11236
|
+
|
|
11237
|
+
path {
|
|
11238
|
+
fill: ${({ theme }) => theme.colors.danger600};
|
|
10247
11239
|
}
|
|
10248
|
-
);
|
|
10249
|
-
const HeaderLayout = (props) => {
|
|
10250
|
-
const baseHeaderLayoutRef = React__namespace.useRef(null);
|
|
10251
|
-
const [headerSize, setHeaderSize] = React__namespace.useState(null);
|
|
10252
|
-
const [containerRef, isVisible] = useElementOnScreen({
|
|
10253
|
-
root: null,
|
|
10254
|
-
rootMargin: "0px",
|
|
10255
|
-
threshold: 0
|
|
10256
|
-
});
|
|
10257
|
-
useResizeObserver(containerRef, () => {
|
|
10258
|
-
if (containerRef.current) {
|
|
10259
|
-
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
10260
|
-
}
|
|
10261
|
-
});
|
|
10262
|
-
React__namespace.useEffect(() => {
|
|
10263
|
-
if (baseHeaderLayoutRef.current) {
|
|
10264
|
-
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
10265
|
-
}
|
|
10266
|
-
}, [baseHeaderLayoutRef]);
|
|
10267
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10268
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
10269
|
-
!isVisible && /* @__PURE__ */ jsxRuntime.jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
10270
|
-
] });
|
|
10271
|
-
};
|
|
10272
|
-
HeaderLayout.displayName = "HeaderLayout";
|
|
10273
|
-
const useElementOnScreen = (options) => {
|
|
10274
|
-
const containerRef = React__namespace.useRef(null);
|
|
10275
|
-
const [isVisible, setIsVisible] = React__namespace.useState(true);
|
|
10276
|
-
const callback = ([entry]) => {
|
|
10277
|
-
setIsVisible(entry.isIntersecting);
|
|
10278
|
-
};
|
|
10279
|
-
React__namespace.useEffect(() => {
|
|
10280
|
-
const containerEl = containerRef.current;
|
|
10281
|
-
const observer = new IntersectionObserver(callback, options);
|
|
10282
|
-
if (containerEl) {
|
|
10283
|
-
observer.observe(containerRef.current);
|
|
10284
|
-
}
|
|
10285
|
-
return () => {
|
|
10286
|
-
if (containerEl) {
|
|
10287
|
-
observer.disconnect();
|
|
10288
|
-
}
|
|
10289
|
-
};
|
|
10290
|
-
}, [containerRef, options]);
|
|
10291
|
-
return [containerRef, isVisible];
|
|
10292
|
-
};
|
|
10293
|
-
const useResizeObserver = (sources, onResize) => {
|
|
10294
|
-
const handleResize = designSystem.useCallbackRef(onResize);
|
|
10295
|
-
React__namespace.useLayoutEffect(() => {
|
|
10296
|
-
const resizeObs = new ResizeObserver(handleResize);
|
|
10297
|
-
if (Array.isArray(sources)) {
|
|
10298
|
-
sources.forEach((source) => {
|
|
10299
|
-
if (source.current) {
|
|
10300
|
-
resizeObs.observe(source.current);
|
|
10301
|
-
}
|
|
10302
|
-
});
|
|
10303
|
-
} else if (sources.current) {
|
|
10304
|
-
resizeObs.observe(sources.current);
|
|
10305
|
-
}
|
|
10306
|
-
return () => {
|
|
10307
|
-
resizeObs.disconnect();
|
|
10308
|
-
};
|
|
10309
|
-
}, [sources, handleResize]);
|
|
10310
|
-
};
|
|
10311
|
-
const GridContainer = styledComponents.styled(designSystem.Box)`
|
|
10312
|
-
display: grid;
|
|
10313
|
-
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
10314
11240
|
`;
|
|
10315
|
-
const OverflowingItem = styledComponents.styled(designSystem.Box)`
|
|
10316
|
-
overflow-x: hidden;
|
|
10317
|
-
`;
|
|
10318
|
-
const RootLayout = ({ sideNav, children }) => {
|
|
10319
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
10320
|
-
sideNav,
|
|
10321
|
-
/* @__PURE__ */ jsxRuntime.jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
10322
|
-
] });
|
|
10323
|
-
};
|
|
10324
|
-
const Layouts = {
|
|
10325
|
-
Root: RootLayout,
|
|
10326
|
-
Header: HeaderLayout,
|
|
10327
|
-
BaseHeader: BaseHeaderLayout,
|
|
10328
|
-
Grid: GridLayout,
|
|
10329
|
-
Action: ActionLayout,
|
|
10330
|
-
Content: ContentLayout
|
|
10331
|
-
};
|
|
10332
11241
|
React__namespace.memo(
|
|
10333
11242
|
({ description, id, props, update }) => {
|
|
10334
11243
|
const comp = description(props);
|
|
@@ -10384,26 +11293,18 @@ const [FiltersProvider, useFilters] = createContext("Filters");
|
|
|
10384
11293
|
React__namespace.forwardRef(
|
|
10385
11294
|
({ label }, forwardedRef) => {
|
|
10386
11295
|
const { formatMessage } = reactIntl.useIntl();
|
|
10387
|
-
const { setTriggerNode, setOpen } = useFilters("Trigger", ({ setTriggerNode: setTriggerNode2, setOpen: setOpen2 }) => ({
|
|
10388
|
-
setTriggerNode: setTriggerNode2,
|
|
10389
|
-
setOpen: setOpen2
|
|
10390
|
-
}));
|
|
10391
11296
|
const disabled = useFilters("Trigger", ({ disabled: disabled2 }) => disabled2);
|
|
10392
|
-
|
|
10393
|
-
const composedRefs = designSystem.useComposedRefs(forwardedRef, setTriggerNode);
|
|
10394
|
-
const handleClick = () => setOpen(!open);
|
|
10395
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11297
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10396
11298
|
designSystem.Button,
|
|
10397
11299
|
{
|
|
10398
11300
|
variant: "tertiary",
|
|
10399
|
-
ref:
|
|
11301
|
+
ref: forwardedRef,
|
|
10400
11302
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Filter, {}),
|
|
10401
|
-
onClick: handleClick,
|
|
10402
11303
|
size: "S",
|
|
10403
11304
|
disabled,
|
|
10404
11305
|
children: label || formatMessage({ id: "app.utils.filters", defaultMessage: "Filters" })
|
|
10405
11306
|
}
|
|
10406
|
-
);
|
|
11307
|
+
) });
|
|
10407
11308
|
}
|
|
10408
11309
|
);
|
|
10409
11310
|
const [PaginationProvider, usePagination] = createContext("Pagination");
|
|
@@ -10421,18 +11322,28 @@ React__namespace.forwardRef(
|
|
|
10421
11322
|
onPageSizeChange(pageSize);
|
|
10422
11323
|
}
|
|
10423
11324
|
};
|
|
10424
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10425
|
-
|
|
11325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11326
|
+
designSystem.Flex,
|
|
10426
11327
|
{
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
11328
|
+
ref: forwardedRef,
|
|
11329
|
+
paddingTop: 4,
|
|
11330
|
+
paddingBottom: 4,
|
|
11331
|
+
alignItems: "flex-end",
|
|
11332
|
+
justifyContent: "space-between",
|
|
11333
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11334
|
+
PaginationProvider,
|
|
11335
|
+
{
|
|
11336
|
+
currentQuery: query,
|
|
11337
|
+
page: query.page,
|
|
11338
|
+
pageSize: query.pageSize,
|
|
11339
|
+
pageCount: pageCount.toString(),
|
|
11340
|
+
setPageSize,
|
|
11341
|
+
total,
|
|
11342
|
+
children
|
|
11343
|
+
}
|
|
11344
|
+
)
|
|
10434
11345
|
}
|
|
10435
|
-
)
|
|
11346
|
+
);
|
|
10436
11347
|
}
|
|
10437
11348
|
);
|
|
10438
11349
|
createContext("Table");
|
|
@@ -10599,4 +11510,4 @@ adminApi.enhanceEndpoints({
|
|
|
10599
11510
|
});
|
|
10600
11511
|
exports.Layouts = Layouts;
|
|
10601
11512
|
exports.useTracking = useTracking;
|
|
10602
|
-
//# sourceMappingURL=index-
|
|
11513
|
+
//# sourceMappingURL=index-8-k5RCnK-qR3QHvSP.js.map
|