@strapi/admin 4.10.5 → 4.10.6
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/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -2
- package/admin/src/content-manager/components/DynamicZone/index.js +1 -1
- package/admin/src/content-manager/components/FieldComponent/index.js +1 -1
- package/admin/src/content-manager/components/Inputs/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +67 -71
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +3 -5
- package/admin/src/content-manager/pages/App/useContentManagerInitData.js +2 -3
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +2 -5
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +1 -2
- package/admin/src/hooks/marketplace/constants.js +1 -0
- package/admin/src/hooks/{useFetchMarketplacePlugins → marketplace/useFetchMarketplacePlugins}/index.js +21 -1
- package/admin/src/hooks/{useFetchMarketplaceProviders → marketplace/useFetchMarketplaceProviders}/index.js +21 -1
- package/admin/src/hooks/useReleaseNotification/utils/api.js +6 -5
- package/admin/src/pages/Admin/Onboarding/index.js +89 -91
- package/admin/src/pages/App/index.js +1 -5
- package/admin/src/pages/AuthPage/components/Register/index.js +3 -4
- package/admin/src/pages/AuthPage/index.js +11 -26
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +39 -41
- package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
- package/admin/src/pages/SettingsPage/components/Tokens/TokenDescription/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +3 -2
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +12 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +120 -205
- package/admin/src/pages/UseCasePage/index.js +13 -15
- package/admin/src/translations/en.json +11 -9
- package/build/1387.a86ac314.chunk.js +1 -0
- package/build/{1657.85034334.chunk.js → 1657.ca8562dd.chunk.js} +46 -46
- package/build/{3816.1a828046.chunk.js → 3816.60f858cf.chunk.js} +12 -12
- package/build/{5563.44e0ef15.chunk.js → 5563.2c8334ef.chunk.js} +1 -1
- package/build/{617.2c8c7183.chunk.js → 617.87b2fe96.chunk.js} +1 -1
- package/build/{6970.e8422af3.chunk.js → 6970.36d3ffff.chunk.js} +1 -1
- package/build/7259.116a9960.chunk.js +1 -0
- package/build/Admin-authenticatedApp.0318dfb3.chunk.js +79 -0
- package/build/{Admin_marketplace.87f51b29.chunk.js → Admin_marketplace.f446ba2b.chunk.js} +10 -10
- package/build/Admin_settingsPage.f8c46a9a.chunk.js +79 -0
- package/build/admin-app.6d48536c.chunk.js +63 -0
- package/build/{admin-edit-roles-page.6fe9de49.chunk.js → admin-edit-roles-page.02c3b136.chunk.js} +3 -3
- package/build/{admin-users.16bb6e77.chunk.js → admin-users.69f4900a.chunk.js} +11 -11
- package/build/{audit-logs-settings-page.7ec976e1.chunk.js → audit-logs-settings-page.482909d7.chunk.js} +1 -1
- package/build/{content-manager.a97db8a1.chunk.js → content-manager.cd71cb6e.chunk.js} +95 -95
- package/build/content-type-builder-translation-en-json.af293c9e.chunk.js +1 -0
- package/build/content-type-builder.b10576e7.chunk.js +126 -0
- package/build/en-json.d965e364.chunk.js +1 -0
- package/build/{i18n-settings-page.e34ec940.chunk.js → i18n-settings-page.55628f74.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/main.adab8b96.js +2630 -0
- package/build/{runtime~main.df78e1c7.js → runtime~main.0201a49b.js} +2 -2
- package/build/{upload.bf183c0c.chunk.js → upload.c50d8c7a.chunk.js} +1 -1
- package/build/{users-email-settings-page.756aa7ab.chunk.js → users-email-settings-page.d2429d0a.chunk.js} +1 -1
- package/build/{users-providers-settings-page.ff9e4c0a.chunk.js → users-providers-settings-page.50c5ba27.chunk.js} +1 -1
- package/build/{users-roles-settings-page.eeb3a339.chunk.js → users-roles-settings-page.2549794b.chunk.js} +2 -2
- package/build/webhook-edit-page.cb2cf1a5.chunk.js +128 -0
- package/build/webhook-list-page.e2fca9f8.chunk.js +71 -0
- package/ee/LICENSE +1 -21
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/roleSettingsForm.js +1 -1
- package/package.json +13 -15
- package/webpack.alias.js +0 -1
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +0 -18
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +0 -18
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/utils/formatValue.js +0 -13
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/reducer.js +0 -72
- package/build/1387.437eb420.chunk.js +0 -1
- package/build/7259.3ed2b60e.chunk.js +0 -1
- package/build/Admin-authenticatedApp.6b74c5fd.chunk.js +0 -79
- package/build/Admin_settingsPage.20884a40.chunk.js +0 -79
- package/build/admin-app.d4fd9379.chunk.js +0 -63
- package/build/content-type-builder-translation-en-json.5e5f8607.chunk.js +0 -1
- package/build/content-type-builder.51c64fe5.chunk.js +0 -126
- package/build/en-json.1f6af924.chunk.js +0 -1
- package/build/main.57970a57.js +0 -2674
- package/build/webhook-edit-page.550be445.chunk.js +0 -128
- package/build/webhook-list-page.0983d83f.chunk.js +0 -71
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-nested-ternary */
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* ListView
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useEffect, useReducer, useRef, useState } from 'react';
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
9
3
|
import { useHistory, useLocation } from 'react-router-dom';
|
|
10
4
|
import { useIntl } from 'react-intl';
|
|
5
|
+
import { useQuery, useMutation } from 'react-query';
|
|
6
|
+
|
|
11
7
|
import {
|
|
12
8
|
useFetchClient,
|
|
13
9
|
useRBAC,
|
|
@@ -19,6 +15,7 @@ import {
|
|
|
19
15
|
onRowClick,
|
|
20
16
|
stopPropagation,
|
|
21
17
|
LinkButton,
|
|
18
|
+
useAPIErrorHandler,
|
|
22
19
|
} from '@strapi/helper-plugin';
|
|
23
20
|
import {
|
|
24
21
|
HeaderLayout,
|
|
@@ -45,212 +42,124 @@ import {
|
|
|
45
42
|
VisuallyHidden,
|
|
46
43
|
} from '@strapi/design-system';
|
|
47
44
|
import { Plus, Pencil, Trash, EmptyDocuments } from '@strapi/icons';
|
|
48
|
-
import reducer, { initialState } from './reducer';
|
|
49
45
|
import adminPermissions from '../../../../../permissions';
|
|
50
46
|
|
|
51
47
|
const ListView = () => {
|
|
52
|
-
const {
|
|
53
|
-
isLoading,
|
|
54
|
-
allowedActions: { canCreate, canRead, canUpdate, canDelete },
|
|
55
|
-
} = useRBAC(adminPermissions.settings.webhooks);
|
|
56
|
-
const toggleNotification = useNotification();
|
|
57
|
-
const isMounted = useRef(true);
|
|
58
|
-
const { formatMessage } = useIntl();
|
|
59
48
|
const [showModal, setShowModal] = useState(false);
|
|
60
|
-
const [
|
|
61
|
-
reducer,
|
|
62
|
-
initialState
|
|
63
|
-
);
|
|
64
|
-
const { notifyStatus } = useNotifyAT();
|
|
65
|
-
|
|
66
|
-
const { get, del, post, put } = useFetchClient();
|
|
49
|
+
const [webhooksToDelete, setWebhooksToDelete] = useState([]);
|
|
67
50
|
|
|
51
|
+
const { formatMessage } = useIntl();
|
|
52
|
+
const { formatAPIError } = useAPIErrorHandler();
|
|
53
|
+
const toggleNotification = useNotification();
|
|
68
54
|
useFocusWhenNavigate();
|
|
69
55
|
const { push } = useHistory();
|
|
70
56
|
const { pathname } = useLocation();
|
|
71
|
-
const rowsCount = webhooks.length;
|
|
72
|
-
const webhooksToDeleteLength = webhooksToDelete.length;
|
|
73
|
-
const getWebhookIndex = (id) => webhooks.findIndex((webhook) => webhook.id === id);
|
|
74
57
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, []);
|
|
58
|
+
const {
|
|
59
|
+
isLoading: isRBACLoading,
|
|
60
|
+
allowedActions: { canCreate, canUpdate, canDelete },
|
|
61
|
+
} = useRBAC(adminPermissions.settings.webhooks);
|
|
62
|
+
const { get, post, put } = useFetchClient();
|
|
63
|
+
const { notifyStatus } = useNotifyAT();
|
|
82
64
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
65
|
+
const QUERY_KEY = 'webhooks';
|
|
66
|
+
const {
|
|
67
|
+
isLoading: isWebhooksLoading,
|
|
68
|
+
data: webhooks,
|
|
69
|
+
error: webhooksError,
|
|
70
|
+
refetch: refetchWebhooks,
|
|
71
|
+
} = useQuery(QUERY_KEY, async () => {
|
|
72
|
+
const {
|
|
73
|
+
data: { data },
|
|
74
|
+
} = await get('/admin/webhooks');
|
|
93
75
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
type: 'GET_DATA_SUCCEEDED',
|
|
97
|
-
data,
|
|
98
|
-
});
|
|
99
|
-
notifyStatus('webhooks have been loaded');
|
|
100
|
-
}
|
|
101
|
-
} catch (err) {
|
|
102
|
-
console.log(err);
|
|
76
|
+
return data;
|
|
77
|
+
});
|
|
103
78
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
dispatch({
|
|
112
|
-
type: 'TOGGLE_LOADING',
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (webhooksError) {
|
|
81
|
+
toggleNotification({
|
|
82
|
+
type: 'warning',
|
|
83
|
+
message: formatAPIError(webhooksError),
|
|
84
|
+
});
|
|
117
85
|
|
|
118
|
-
|
|
119
|
-
fetchWebHooks();
|
|
86
|
+
return;
|
|
120
87
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (webhookToDelete) {
|
|
129
|
-
handleConfirmDeleteOne();
|
|
130
|
-
} else {
|
|
131
|
-
handleConfirmDeleteAll();
|
|
88
|
+
if (webhooks) {
|
|
89
|
+
notifyStatus(
|
|
90
|
+
formatMessage({
|
|
91
|
+
id: 'Settings.webhooks.list.loading.success',
|
|
92
|
+
defaultMessage: 'Webhooks have been loaded',
|
|
93
|
+
})
|
|
94
|
+
);
|
|
132
95
|
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const handleConfirmDeleteOne = async () => {
|
|
136
|
-
try {
|
|
137
|
-
await del(`/admin/webhooks/${webhookToDelete}`);
|
|
96
|
+
}, [webhooks, webhooksError, toggleNotification, formatMessage, notifyStatus, formatAPIError]);
|
|
138
97
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
98
|
+
const deleteMutation = useMutation(
|
|
99
|
+
async () => {
|
|
100
|
+
await post('/admin/webhooks/batch-delete', {
|
|
101
|
+
ids: webhooksToDelete,
|
|
142
102
|
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*/
|
|
147
|
-
if (err.code !== 20) {
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
onError(error) {
|
|
148
106
|
toggleNotification({
|
|
149
107
|
type: 'warning',
|
|
150
|
-
message:
|
|
108
|
+
message: formatAPIError(error),
|
|
151
109
|
});
|
|
152
|
-
|
|
110
|
+
setShowModal(false);
|
|
111
|
+
},
|
|
112
|
+
onSuccess() {
|
|
113
|
+
setWebhooksToDelete([]);
|
|
114
|
+
setShowModal(false);
|
|
115
|
+
refetchWebhooks();
|
|
116
|
+
},
|
|
153
117
|
}
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const handleConfirmDeleteAll = async () => {
|
|
158
|
-
const body = {
|
|
159
|
-
ids: webhooksToDelete,
|
|
160
|
-
};
|
|
118
|
+
);
|
|
161
119
|
|
|
162
|
-
|
|
163
|
-
|
|
120
|
+
const enabledMutation = useMutation(
|
|
121
|
+
async ({ isEnabled, id }) => {
|
|
122
|
+
const { id: _, ...webhook } = webhooks.find((webhook) => webhook.id === id) ?? {};
|
|
123
|
+
const body = {
|
|
124
|
+
...webhook,
|
|
125
|
+
isEnabled,
|
|
126
|
+
};
|
|
164
127
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
128
|
+
await put(`/admin/webhooks/${id}`, body);
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
onError(error) {
|
|
132
|
+
toggleNotification({
|
|
133
|
+
type: 'warning',
|
|
134
|
+
message: formatAPIError(error),
|
|
168
135
|
});
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
toggleNotification({
|
|
174
|
-
type: 'warning',
|
|
175
|
-
message: { id: 'notification.error' },
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
setShowModal(false);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const handleDeleteClick = (id) => {
|
|
184
|
-
setShowModal(true);
|
|
185
|
-
|
|
186
|
-
if (id !== 'all') {
|
|
187
|
-
dispatch({
|
|
188
|
-
type: 'SET_WEBHOOK_TO_DELETE',
|
|
189
|
-
id,
|
|
190
|
-
});
|
|
136
|
+
},
|
|
137
|
+
onSuccess() {
|
|
138
|
+
refetchWebhooks();
|
|
139
|
+
},
|
|
191
140
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const handleEnabledChange = async (value, id) => {
|
|
195
|
-
const webhookIndex = getWebhookIndex(id);
|
|
196
|
-
const initialWebhookProps = webhooks[webhookIndex];
|
|
197
|
-
const keys = [webhookIndex, 'isEnabled'];
|
|
198
|
-
|
|
199
|
-
const body = {
|
|
200
|
-
...initialWebhookProps,
|
|
201
|
-
isEnabled: value,
|
|
202
|
-
};
|
|
141
|
+
);
|
|
203
142
|
|
|
204
|
-
|
|
143
|
+
const confirmDelete = () => deleteMutation.mutate();
|
|
205
144
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
type: 'SET_WEBHOOK_ENABLED',
|
|
209
|
-
keys,
|
|
210
|
-
value,
|
|
211
|
-
});
|
|
145
|
+
const selectAllCheckbox = (selected) =>
|
|
146
|
+
selected ? setWebhooksToDelete(webhooks.map((webhook) => webhook.id)) : setWebhooksToDelete([]);
|
|
212
147
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
type: 'SET_WEBHOOK_ENABLED',
|
|
218
|
-
keys,
|
|
219
|
-
value: !value,
|
|
220
|
-
});
|
|
148
|
+
const selectOneCheckbox = (selected, id) =>
|
|
149
|
+
selected
|
|
150
|
+
? setWebhooksToDelete((prev) => [...prev, id])
|
|
151
|
+
: setWebhooksToDelete((prev) => prev.filter((webhookId) => webhookId !== id));
|
|
221
152
|
|
|
222
|
-
|
|
223
|
-
toggleNotification({
|
|
224
|
-
type: 'warning',
|
|
225
|
-
message: { id: 'notification.error' },
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
153
|
+
const goTo = (to) => push(`${pathname}/${to}`);
|
|
231
154
|
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
});
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const handleSelectOneCheckbox = (value, id) => {
|
|
239
|
-
dispatch({
|
|
240
|
-
type: 'SET_WEBHOOKS_TO_DELETE',
|
|
241
|
-
value,
|
|
242
|
-
id,
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const handleGoTo = (to) => {
|
|
247
|
-
push(`${pathname}/${to}`);
|
|
248
|
-
};
|
|
155
|
+
const isLoading = isRBACLoading || isWebhooksLoading;
|
|
156
|
+
const numberOfWebhooks = webhooks?.length ?? 0;
|
|
157
|
+
const webhooksToDeleteLength = webhooksToDelete.length;
|
|
249
158
|
|
|
250
159
|
return (
|
|
251
160
|
<Layout>
|
|
252
161
|
<SettingsPageTitle name="Webhooks" />
|
|
253
|
-
<Main aria-busy={isLoading
|
|
162
|
+
<Main aria-busy={isLoading}>
|
|
254
163
|
<HeaderLayout
|
|
255
164
|
title={formatMessage({ id: 'Settings.webhooks.title', defaultMessage: 'Webhooks' })}
|
|
256
165
|
subtitle={formatMessage({
|
|
@@ -259,7 +168,7 @@ const ListView = () => {
|
|
|
259
168
|
})}
|
|
260
169
|
primaryAction={
|
|
261
170
|
canCreate &&
|
|
262
|
-
!
|
|
171
|
+
!isLoading && (
|
|
263
172
|
<LinkButton startIcon={<Plus />} variant="default" to={`${pathname}/create`} size="S">
|
|
264
173
|
{formatMessage({
|
|
265
174
|
id: 'Settings.webhooks.list.button.add',
|
|
@@ -278,13 +187,13 @@ const ListView = () => {
|
|
|
278
187
|
{
|
|
279
188
|
id: 'Settings.webhooks.to.delete',
|
|
280
189
|
defaultMessage:
|
|
281
|
-
'{webhooksToDeleteLength, plural, one {#
|
|
190
|
+
'{webhooksToDeleteLength, plural, one {# webhook} other {# webhooks}} selected',
|
|
282
191
|
},
|
|
283
192
|
{ webhooksToDeleteLength }
|
|
284
193
|
)}
|
|
285
194
|
</Typography>
|
|
286
195
|
<Button
|
|
287
|
-
onClick={() =>
|
|
196
|
+
onClick={() => setShowModal(true)}
|
|
288
197
|
startIcon={<Trash />}
|
|
289
198
|
size="L"
|
|
290
199
|
variant="danger-light"
|
|
@@ -299,16 +208,16 @@ const ListView = () => {
|
|
|
299
208
|
/>
|
|
300
209
|
)}
|
|
301
210
|
<ContentLayout>
|
|
302
|
-
{isLoading
|
|
211
|
+
{isLoading ? (
|
|
303
212
|
<Box background="neutral0" padding={6} shadow="filterShadow" hasRadius>
|
|
304
213
|
<LoadingIndicatorPage />
|
|
305
214
|
</Box>
|
|
306
|
-
) :
|
|
215
|
+
) : numberOfWebhooks > 0 ? (
|
|
307
216
|
<Table
|
|
308
217
|
colCount={5}
|
|
309
|
-
rowCount={
|
|
218
|
+
rowCount={numberOfWebhooks + 1}
|
|
310
219
|
footer={
|
|
311
|
-
<TFooter onClick={() => (canCreate ?
|
|
220
|
+
<TFooter onClick={() => (canCreate ? goTo('create') : {})} icon={<Plus />}>
|
|
312
221
|
{formatMessage({
|
|
313
222
|
id: 'Settings.webhooks.list.button.add',
|
|
314
223
|
defaultMessage: 'Create new webhook',
|
|
@@ -325,10 +234,10 @@ const ListView = () => {
|
|
|
325
234
|
defaultMessage: 'Select all entries',
|
|
326
235
|
})}
|
|
327
236
|
indeterminate={
|
|
328
|
-
webhooksToDeleteLength > 0 && webhooksToDeleteLength <
|
|
237
|
+
webhooksToDeleteLength > 0 && webhooksToDeleteLength < numberOfWebhooks
|
|
329
238
|
}
|
|
330
|
-
value={webhooksToDeleteLength ===
|
|
331
|
-
onValueChange={
|
|
239
|
+
value={webhooksToDeleteLength === numberOfWebhooks}
|
|
240
|
+
onValueChange={selectAllCheckbox}
|
|
332
241
|
/>
|
|
333
242
|
</Th>
|
|
334
243
|
<Th width="20%">
|
|
@@ -370,7 +279,7 @@ const ListView = () => {
|
|
|
370
279
|
<Tr
|
|
371
280
|
key={webhook.id}
|
|
372
281
|
{...onRowClick({
|
|
373
|
-
fn: () =>
|
|
282
|
+
fn: () => goTo(webhook.id),
|
|
374
283
|
condition: canUpdate,
|
|
375
284
|
})}
|
|
376
285
|
>
|
|
@@ -381,8 +290,7 @@ const ListView = () => {
|
|
|
381
290
|
defaultMessage: 'Select',
|
|
382
291
|
})} ${webhook.name}`}
|
|
383
292
|
value={webhooksToDelete?.includes(webhook.id)}
|
|
384
|
-
onValueChange={(
|
|
385
|
-
id="select"
|
|
293
|
+
onValueChange={(selected) => selectOneCheckbox(selected, webhook.id)}
|
|
386
294
|
name="select"
|
|
387
295
|
/>
|
|
388
296
|
</Td>
|
|
@@ -395,7 +303,7 @@ const ListView = () => {
|
|
|
395
303
|
<Typography textColor="neutral800">{webhook.url}</Typography>
|
|
396
304
|
</Td>
|
|
397
305
|
<Td>
|
|
398
|
-
<Flex
|
|
306
|
+
<Flex>
|
|
399
307
|
<Switch
|
|
400
308
|
onLabel={formatMessage({
|
|
401
309
|
id: 'global.enabled',
|
|
@@ -410,18 +318,21 @@ const ListView = () => {
|
|
|
410
318
|
defaultMessage: 'Status',
|
|
411
319
|
})}`}
|
|
412
320
|
selected={webhook.isEnabled}
|
|
413
|
-
onChange={() =>
|
|
321
|
+
onChange={(e) => {
|
|
322
|
+
e.stopPropagation();
|
|
323
|
+
enabledMutation.mutate({
|
|
324
|
+
isEnabled: !webhook.isEnabled,
|
|
325
|
+
id: webhook.id,
|
|
326
|
+
});
|
|
327
|
+
}}
|
|
414
328
|
visibleLabels
|
|
415
329
|
/>
|
|
416
330
|
</Flex>
|
|
417
331
|
</Td>
|
|
418
332
|
<Td>
|
|
419
|
-
<Flex gap={1}
|
|
333
|
+
<Flex gap={1}>
|
|
420
334
|
{canUpdate && (
|
|
421
335
|
<IconButton
|
|
422
|
-
onClick={() => {
|
|
423
|
-
handleGoTo(webhook.id);
|
|
424
|
-
}}
|
|
425
336
|
label={formatMessage({
|
|
426
337
|
id: 'Settings.webhooks.events.update',
|
|
427
338
|
defaultMessage: 'Update',
|
|
@@ -432,14 +343,17 @@ const ListView = () => {
|
|
|
432
343
|
)}
|
|
433
344
|
{canDelete && (
|
|
434
345
|
<IconButton
|
|
435
|
-
onClick={() =>
|
|
346
|
+
onClick={(e) => {
|
|
347
|
+
e.stopPropagation();
|
|
348
|
+
setWebhooksToDelete([webhook.id]);
|
|
349
|
+
setShowModal(true);
|
|
350
|
+
}}
|
|
436
351
|
label={formatMessage({
|
|
437
|
-
id: '
|
|
438
|
-
defaultMessage: 'Delete',
|
|
352
|
+
id: 'Settings.webhooks.events.delete',
|
|
353
|
+
defaultMessage: 'Delete webhook',
|
|
439
354
|
})}
|
|
440
355
|
icon={<Trash />}
|
|
441
356
|
noBorder
|
|
442
|
-
id={`delete-${webhook.id}`}
|
|
443
357
|
/>
|
|
444
358
|
)}
|
|
445
359
|
</Flex>
|
|
@@ -459,7 +373,7 @@ const ListView = () => {
|
|
|
459
373
|
<Button
|
|
460
374
|
variant="secondary"
|
|
461
375
|
startIcon={<Plus />}
|
|
462
|
-
onClick={() => (canCreate ?
|
|
376
|
+
onClick={() => (canCreate ? goTo('create') : {})}
|
|
463
377
|
>
|
|
464
378
|
{formatMessage({
|
|
465
379
|
id: 'Settings.webhooks.list.button.add',
|
|
@@ -473,8 +387,9 @@ const ListView = () => {
|
|
|
473
387
|
</Main>
|
|
474
388
|
<ConfirmDialog
|
|
475
389
|
isOpen={showModal}
|
|
476
|
-
onToggleDialog={
|
|
477
|
-
onConfirm={
|
|
390
|
+
onToggleDialog={() => setShowModal((prev) => !prev)}
|
|
391
|
+
onConfirm={confirmDelete}
|
|
392
|
+
isConfirmButtonLoading={deleteMutation.isLoading}
|
|
478
393
|
/>
|
|
479
394
|
</Layout>
|
|
480
395
|
);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import axios from 'axios';
|
|
3
2
|
import { useIntl } from 'react-intl';
|
|
4
3
|
import { useHistory } from 'react-router-dom';
|
|
5
4
|
import styled from 'styled-components';
|
|
6
5
|
import { parse } from 'qs';
|
|
7
|
-
import { pxToRem, useNotification, auth } from '@strapi/helper-plugin';
|
|
6
|
+
import { pxToRem, useFetchClient, useNotification, auth } from '@strapi/helper-plugin';
|
|
8
7
|
import {
|
|
9
8
|
Main,
|
|
10
9
|
Flex,
|
|
@@ -74,23 +73,22 @@ const UseCasePage = () => {
|
|
|
74
73
|
const { formatMessage } = useIntl();
|
|
75
74
|
const [role, setRole] = useState();
|
|
76
75
|
const [otherRole, setOtherRole] = useState('');
|
|
76
|
+
const { post } = useFetchClient();
|
|
77
|
+
|
|
77
78
|
const { firstname, email } = auth.getUserInfo();
|
|
78
79
|
const { hasAdmin } = parse(location?.search, { ignoreQueryPrefix: true });
|
|
79
80
|
const isOther = role === 'other';
|
|
80
81
|
|
|
81
|
-
const handleSubmit = (skipPersona) => {
|
|
82
|
+
const handleSubmit = async (event, skipPersona) => {
|
|
83
|
+
event.preventDefault();
|
|
82
84
|
try {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
persona: {
|
|
91
|
-
role: skipPersona ? undefined : role,
|
|
92
|
-
otherRole: skipPersona ? undefined : otherRole,
|
|
93
|
-
},
|
|
85
|
+
await post('https://analytics.strapi.io/register', {
|
|
86
|
+
email,
|
|
87
|
+
username: firstname,
|
|
88
|
+
firstAdmin: Boolean(!hasAdmin),
|
|
89
|
+
persona: {
|
|
90
|
+
role: skipPersona ? undefined : role,
|
|
91
|
+
otherRole: skipPersona ? undefined : otherRole,
|
|
94
92
|
},
|
|
95
93
|
});
|
|
96
94
|
|
|
@@ -111,7 +109,7 @@ const UseCasePage = () => {
|
|
|
111
109
|
<UnauthenticatedLayout>
|
|
112
110
|
<Main labelledBy="usecase-title">
|
|
113
111
|
<LayoutContent>
|
|
114
|
-
<form onSubmit={() => handleSubmit(false)}>
|
|
112
|
+
<form onSubmit={(e) => handleSubmit(e, false)}>
|
|
115
113
|
<Flex direction="column" paddingBottom={7}>
|
|
116
114
|
<Logo />
|
|
117
115
|
<Box paddingTop={6} paddingBottom={1} width={pxToRem(250)}>
|
|
@@ -287,6 +287,7 @@
|
|
|
287
287
|
"Settings.webhooks.event.publish-tooltip": "This event only exists for contents with Draft/Publish system enabled",
|
|
288
288
|
"Settings.webhooks.events.create": "Create",
|
|
289
289
|
"Settings.webhooks.events.update": "Update",
|
|
290
|
+
"Settings.webhooks.events.delete": "Delete webhook",
|
|
290
291
|
"Settings.webhooks.form.events": "Events",
|
|
291
292
|
"Settings.webhooks.form.headers": "Headers",
|
|
292
293
|
"Settings.webhooks.form.url": "URL",
|
|
@@ -299,9 +300,10 @@
|
|
|
299
300
|
"Settings.webhooks.list.empty.title": "There are no webhooks yet",
|
|
300
301
|
"Settings.webhooks.list.th.actions": "actions",
|
|
301
302
|
"Settings.webhooks.list.th.status": "status",
|
|
303
|
+
"Settings.webhooks.list.loading.success": "Webhooks have been loaded",
|
|
302
304
|
"Settings.webhooks.singular": "webhook",
|
|
303
305
|
"Settings.webhooks.title": "Webhooks",
|
|
304
|
-
"Settings.webhooks.to.delete": "{webhooksToDeleteLength, plural, one {#
|
|
306
|
+
"Settings.webhooks.to.delete": "{webhooksToDeleteLength, plural, one {# webhook} other {# webhooks}} selected",
|
|
305
307
|
"Settings.webhooks.trigger": "Trigger",
|
|
306
308
|
"Settings.webhooks.trigger.cancel": "Cancel trigger",
|
|
307
309
|
"Settings.webhooks.trigger.pending": "Pending…",
|
|
@@ -560,10 +562,10 @@
|
|
|
560
562
|
"components.Input.error.validation.email": "This is an invalid email",
|
|
561
563
|
"components.Input.error.validation.json": "This doesn't match the JSON format",
|
|
562
564
|
"components.Input.error.validation.lowercase": "The value must be a lowercase string",
|
|
563
|
-
"components.Input.error.validation.max": "The value is too high.",
|
|
564
|
-
"components.Input.error.validation.maxLength": "The value is too long.",
|
|
565
|
-
"components.Input.error.validation.min": "The value is too low.",
|
|
566
|
-
"components.Input.error.validation.minLength": "The value is too short.",
|
|
565
|
+
"components.Input.error.validation.max": "The value is too high (max: {max}).",
|
|
566
|
+
"components.Input.error.validation.maxLength": "The value is too long (max: {max}).",
|
|
567
|
+
"components.Input.error.validation.min": "The value is too low (min: {min}).",
|
|
568
|
+
"components.Input.error.validation.minLength": "The value is too short (min: {min}).",
|
|
567
569
|
"components.Input.error.validation.minSupMax": "Can't be superior",
|
|
568
570
|
"components.Input.error.validation.regex": "The value does not match the regex.",
|
|
569
571
|
"components.Input.error.validation.required": "This value is required.",
|
|
@@ -745,10 +747,10 @@
|
|
|
745
747
|
"content-manager.error.records.fetch": "An error occurred during records fetch.",
|
|
746
748
|
"content-manager.error.schema.generation": "An error occurred during schema generation.",
|
|
747
749
|
"content-manager.error.validation.json": "This is not a JSON",
|
|
748
|
-
"content-manager.error.validation.max": "The value is too high.",
|
|
749
|
-
"content-manager.error.validation.maxLength": "The value is too long.",
|
|
750
|
-
"content-manager.error.validation.min": "The value is too low.",
|
|
751
|
-
"content-manager.error.validation.minLength": "The value is too short.",
|
|
750
|
+
"content-manager.error.validation.max": "The value is too high (max: {max}).",
|
|
751
|
+
"content-manager.error.validation.maxLength": "The value is too long (max: {max}).",
|
|
752
|
+
"content-manager.error.validation.min": "The value is too low (min: {min}).",
|
|
753
|
+
"content-manager.error.validation.minLength": "The value is too short (min: {min}).",
|
|
752
754
|
"content-manager.error.validation.minSupMax": "Can't be superior",
|
|
753
755
|
"content-manager.error.validation.regex": "The value does not match the regex.",
|
|
754
756
|
"content-manager.error.validation.required": "This value input is required.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[1387],{49776:function(p,g,s){s.d(g,{j:function(){return d}});var c={};function d(){return c}function h(o){c=o}},46784:function(p,g,s){s.d(g,{Z:function(){return m}});var c=s(907),d=s(96256),h=s(10420),o=s(49776);function m(l,f){var b,T,O,w,C,y,_,W;(0,d.Z)(1,arguments);var S=(0,o.j)(),P=(0,h.Z)((b=(T=(O=(w=f?.weekStartsOn)!==null&&w!==void 0?w:f==null||(C=f.locale)===null||C===void 0||(y=C.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&O!==void 0?O:S.weekStartsOn)!==null&&T!==void 0?T:(_=S.locale)===null||_===void 0||(W=_.options)===null||W===void 0?void 0:W.weekStartsOn)!==null&&b!==void 0?b:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var L=(0,c.Z)(l),X=L.getUTCDay(),V=(X<P?7:0)+X-P;return L.setUTCDate(L.getUTCDate()-V),L.setUTCHours(0,0,0,0),L}},14723:function(p,g,s){s.d(g,{Z:function(){return pe}});var c=s(73151),d=s(96256);function h(n){return(0,d.Z)(1,arguments),n instanceof Date||(0,c.Z)(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}var o=s(907);function m(n){if((0,d.Z)(1,arguments),!h(n)&&typeof n!="number")return!1;var t=(0,o.Z)(n);return!isNaN(Number(t))}var l=s(10420);function f(n,t){(0,d.Z)(2,arguments);var e=(0,o.Z)(n).getTime(),a=(0,l.Z)(t);return new Date(e+a)}function b(n,t){(0,d.Z)(2,arguments);var e=(0,l.Z)(t);return f(n,-e)}var T=864e5;function O(n){(0,d.Z)(1,arguments);var t=(0,o.Z)(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),r=e-a;return Math.floor(r/T)+1}function w(n){(0,d.Z)(1,arguments);var t=1,e=(0,o.Z)(n),a=e.getUTCDay(),r=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function C(n){(0,d.Z)(1,arguments);var t=(0,o.Z)(n),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var r=w(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var u=w(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=u.getTime()?e:e-1}function y(n){(0,d.Z)(1,arguments);var t=C(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=w(e);return a}var _=6048e5;function W(n){(0,d.Z)(1,arguments);var t=(0,o.Z)(n),e=w(t).getTime()-y(t).getTime();return Math.round(e/_)+1}var S=s(46784),P=s(49776);function L(n,t){var e,a,r,i,u,M,x,k;(0,d.Z)(1,arguments);var U=(0,o.Z)(n),E=U.getUTCFullYear(),N=(0,P.j)(),Z=(0,l.Z)((e=(a=(r=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(u=t.locale)===null||u===void 0||(M=u.options)===null||M===void 0?void 0:M.firstWeekContainsDate)!==null&&r!==void 0?r:N.firstWeekContainsDate)!==null&&a!==void 0?a:(x=N.locale)===null||x===void 0||(k=x.options)===null||k===void 0?void 0:k.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(Z>=1&&Z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Y=new Date(0);Y.setUTCFullYear(E+1,0,Z),Y.setUTCHours(0,0,0,0);var I=(0,S.Z)(Y,t),j=new Date(0);j.setUTCFullYear(E,0,Z),j.setUTCHours(0,0,0,0);var A=(0,S.Z)(j,t);return U.getTime()>=I.getTime()?E+1:U.getTime()>=A.getTime()?E:E-1}function X(n,t){var e,a,r,i,u,M,x,k;(0,d.Z)(1,arguments);var U=(0,P.j)(),E=(0,l.Z)((e=(a=(r=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(u=t.locale)===null||u===void 0||(M=u.options)===null||M===void 0?void 0:M.firstWeekContainsDate)!==null&&r!==void 0?r:U.firstWeekContainsDate)!==null&&a!==void 0?a:(x=U.locale)===null||x===void 0||(k=x.options)===null||k===void 0?void 0:k.firstWeekContainsDate)!==null&&e!==void 0?e:1),N=L(n,t),Z=new Date(0);Z.setUTCFullYear(N,0,E),Z.setUTCHours(0,0,0,0);var Y=(0,S.Z)(Z,t);return Y}var V=6048e5;function ue(n,t){(0,d.Z)(1,arguments);var e=(0,o.Z)(n),a=(0,S.Z)(e,t).getTime()-X(e,t).getTime();return Math.round(a/V)+1}var v=s(24319),de={y:function(t,e){var a=t.getUTCFullYear(),r=a>0?a:1-a;return(0,v.Z)(e==="yy"?r%100:r,e.length)},M:function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):(0,v.Z)(a+1,2)},d:function(t,e){return(0,v.Z)(t.getUTCDate(),e.length)},a:function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(t,e){return(0,v.Z)(t.getUTCHours()%12||12,e.length)},H:function(t,e){return(0,v.Z)(t.getUTCHours(),e.length)},m:function(t,e){return(0,v.Z)(t.getUTCMinutes(),e.length)},s:function(t,e){return(0,v.Z)(t.getUTCSeconds(),e.length)},S:function(t,e){var a=e.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,a-3));return(0,v.Z)(i,e.length)}},F=de,H={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},se={G:function(t,e,a){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})}},y:function(t,e,a){if(e==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return a.ordinalNumber(i,{unit:"year"})}return F.y(t,e)},Y:function(t,e,a,r){var i=L(t,r),u=i>0?i:1-i;if(e==="YY"){var M=u%100;return(0,v.Z)(M,2)}return e==="Yo"?a.ordinalNumber(u,{unit:"year"}):(0,v.Z)(u,e.length)},R:function(t,e){var a=C(t);return(0,v.Z)(a,e.length)},u:function(t,e){var a=t.getUTCFullYear();return(0,v.Z)(a,e.length)},Q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return(0,v.Z)(r,2);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return(0,v.Z)(r,2);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,a){var r=t.getUTCMonth();switch(e){case"M":case"MM":return F.M(t,e);case"Mo":return a.ordinalNumber(r+1,{unit:"month"});case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,a){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return(0,v.Z)(r+1,2);case"Lo":return a.ordinalNumber(r+1,{unit:"month"});case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,a,r){var i=ue(t,r);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):(0,v.Z)(i,e.length)},I:function(t,e,a){var r=W(t);return e==="Io"?a.ordinalNumber(r,{unit:"week"}):(0,v.Z)(r,e.length)},d:function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):F.d(t,e)},D:function(t,e,a){var r=O(t);return e==="Do"?a.ordinalNumber(r,{unit:"dayOfYear"}):(0,v.Z)(r,e.length)},E:function(t,e,a){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,a,r){var i=t.getUTCDay(),u=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(u);case"ee":return(0,v.Z)(u,2);case"eo":return a.ordinalNumber(u,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,a,r){var i=t.getUTCDay(),u=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(u);case"cc":return(0,v.Z)(u,e.length);case"co":return a.ordinalNumber(u,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,a){var r=t.getUTCDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return(0,v.Z)(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(r,{width:"short",context:"formatting"});case"iiii":default:return a.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,a){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,a){var r=t.getUTCHours(),i;switch(r===12?i=H.noon:r===0?i=H.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,a){var r=t.getUTCHours(),i;switch(r>=17?i=H.evening:r>=12?i=H.afternoon:r>=4?i=H.morning:i=H.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,a){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),a.ordinalNumber(r,{unit:"hour"})}return F.h(t,e)},H:function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):F.H(t,e)},K:function(t,e,a){var r=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(r,{unit:"hour"}):(0,v.Z)(r,e.length)},k:function(t,e,a){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?a.ordinalNumber(r,{unit:"hour"}):(0,v.Z)(r,e.length)},m:function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):F.m(t,e)},s:function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):F.s(t,e)},S:function(t,e){return F.S(t,e)},X:function(t,e,a,r){var i=r._originalDate||t,u=i.getTimezoneOffset();if(u===0)return"Z";switch(e){case"X":return re(u);case"XXXX":case"XX":return $(u);case"XXXXX":case"XXX":default:return $(u,":")}},x:function(t,e,a,r){var i=r._originalDate||t,u=i.getTimezoneOffset();switch(e){case"x":return re(u);case"xxxx":case"xx":return $(u);case"xxxxx":case"xxx":default:return $(u,":")}},O:function(t,e,a,r){var i=r._originalDate||t,u=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ae(u,":");case"OOOO":default:return"GMT"+$(u,":")}},z:function(t,e,a,r){var i=r._originalDate||t,u=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ae(u,":");case"zzzz":default:return"GMT"+$(u,":")}},t:function(t,e,a,r){var i=r._originalDate||t,u=Math.floor(i.getTime()/1e3);return(0,v.Z)(u,e.length)},T:function(t,e,a,r){var i=r._originalDate||t,u=i.getTime();return(0,v.Z)(u,e.length)}};function ae(n,t){var e=n>0?"-":"+",a=Math.abs(n),r=Math.floor(a/60),i=a%60;if(i===0)return e+String(r);var u=t||"";return e+String(r)+u+(0,v.Z)(i,2)}function re(n,t){if(n%60===0){var e=n>0?"-":"+";return e+(0,v.Z)(Math.abs(n)/60,2)}return $(n,t)}function $(n,t){var e=t||"",a=n>0?"-":"+",r=Math.abs(n),i=(0,v.Z)(Math.floor(r/60),2),u=(0,v.Z)(r%60,2);return a+i+e+u}var le=se,ne=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ie=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ce=function(t,e){var a=t.match(/(P+)(p+)?/)||[],r=a[1],i=a[2];if(!i)return ne(t,e);var u;switch(r){case"P":u=e.dateTime({width:"short"});break;case"PP":u=e.dateTime({width:"medium"});break;case"PPP":u=e.dateTime({width:"long"});break;case"PPPP":default:u=e.dateTime({width:"full"});break}return u.replace("{{date}}",ne(r,e)).replace("{{time}}",ie(i,e))},fe={p:ie,P:ce},me=fe,ve=s(22774),he=["D","DD"],ge=["YY","YYYY"];function we(n){return he.indexOf(n)!==-1}function be(n){return ge.indexOf(n)!==-1}function oe(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ye=s(54828),Te=ye.Z,Oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ce=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_e=/^'([^]*?)'?$/,Me=/''/g,De=/[a-zA-Z]/;function pe(n,t,e){var a,r,i,u,M,x,k,U,E,N,Z,Y,I,j,A,K,J,z;(0,d.Z)(2,arguments);var Ze=String(t),B=(0,P.j)(),Q=(a=(r=e?.locale)!==null&&r!==void 0?r:B.locale)!==null&&a!==void 0?a:Te,ee=(0,l.Z)((i=(u=(M=(x=e?.firstWeekContainsDate)!==null&&x!==void 0?x:e==null||(k=e.locale)===null||k===void 0||(U=k.options)===null||U===void 0?void 0:U.firstWeekContainsDate)!==null&&M!==void 0?M:B.firstWeekContainsDate)!==null&&u!==void 0?u:(E=B.locale)===null||E===void 0||(N=E.options)===null||N===void 0?void 0:N.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(ee>=1&&ee<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var te=(0,l.Z)((Z=(Y=(I=(j=e?.weekStartsOn)!==null&&j!==void 0?j:e==null||(A=e.locale)===null||A===void 0||(K=A.options)===null||K===void 0?void 0:K.weekStartsOn)!==null&&I!==void 0?I:B.weekStartsOn)!==null&&Y!==void 0?Y:(J=B.locale)===null||J===void 0||(z=J.options)===null||z===void 0?void 0:z.weekStartsOn)!==null&&Z!==void 0?Z:0);if(!(te>=0&&te<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Q.localize)throw new RangeError("locale must contain localize property");if(!Q.formatLong)throw new RangeError("locale must contain formatLong property");var G=(0,o.Z)(n);if(!m(G))throw new RangeError("Invalid time value");var We=(0,ve.Z)(G),xe=b(G,We),ke={firstWeekContainsDate:ee,weekStartsOn:te,locale:Q,_originalDate:G},Ee=Ze.match(Ce).map(function(D){var R=D[0];if(R==="p"||R==="P"){var q=me[R];return q(D,Q.formatLong)}return D}).join("").match(Oe).map(function(D){if(D==="''")return"'";var R=D[0];if(R==="'")return Pe(D);var q=le[R];if(q)return!(e!=null&&e.useAdditionalWeekYearTokens)&&be(D)&&oe(D,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&we(D)&&oe(D,t,String(n)),q(xe,D,Q.localize,ke);if(R.match(De))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return D}).join("");return Ee}function Pe(n){var t=n.match(_e);return t?t[1].replace(Me,"'"):n}},39446:function(p,g,s){s.d(g,{Z:function(){return c}});function c(d){return function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=h.width?String(h.width):d.defaultWidth,m=d.formats[o]||d.formats[d.defaultWidth];return m}}},56565:function(p,g,s){s.d(g,{Z:function(){return c}});function c(d){return function(h,o){var m=o!=null&&o.context?String(o.context):"standalone",l;if(m==="formatting"&&d.formattingValues){var f=d.defaultFormattingWidth||d.defaultWidth,b=o!=null&&o.width?String(o.width):f;l=d.formattingValues[b]||d.formattingValues[f]}else{var T=d.defaultWidth,O=o!=null&&o.width?String(o.width):d.defaultWidth;l=d.values[O]||d.values[T]}var w=d.argumentCallback?d.argumentCallback(h):h;return l[w]}}},29450:function(p,g,s){s.d(g,{Z:function(){return c}});function c(o){return function(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=l.width,b=f&&o.matchPatterns[f]||o.matchPatterns[o.defaultMatchWidth],T=m.match(b);if(!T)return null;var O=T[0],w=f&&o.parsePatterns[f]||o.parsePatterns[o.defaultParseWidth],C=Array.isArray(w)?h(w,function(W){return W.test(O)}):d(w,function(W){return W.test(O)}),y;y=o.valueCallback?o.valueCallback(C):C,y=l.valueCallback?l.valueCallback(y):y;var _=m.slice(O.length);return{value:y,rest:_}}}function d(o,m){for(var l in o)if(o.hasOwnProperty(l)&&m(o[l]))return l}function h(o,m){for(var l=0;l<o.length;l++)if(m(o[l]))return l}},60965:function(p,g,s){s.d(g,{Z:function(){return c}});function c(d){return function(h){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=h.match(d.matchPattern);if(!m)return null;var l=m[0],f=h.match(d.parsePattern);if(!f)return null;var b=d.valueCallback?d.valueCallback(f[0]):f[0];b=o.valueCallback?o.valueCallback(b):b;var T=h.slice(l.length);return{value:b,rest:T}}}},10661:function(p,g){var s={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},c=function(h,o,m){var l,f=s[h];return typeof f=="string"?l=f:o===1?l=f.one:l=f.other.replace("{{count}}",o.toString()),m!=null&&m.addSuffix?m.comparison&&m.comparison>0?"in "+l:l+" ago":l};g.Z=c},57459:function(p,g){var s={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},c=function(h,o,m,l){return s[h]};g.Z=c},52855:function(p,g,s){var c=s(56565),d={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},h={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},o={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},m={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},f={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},b=function(w,C){var y=Number(w),_=y%100;if(_>20||_<10)switch(_%10){case 1:return y+"st";case 2:return y+"nd";case 3:return y+"rd"}return y+"th"},T={ordinalNumber:b,era:(0,c.Z)({values:d,defaultWidth:"wide"}),quarter:(0,c.Z)({values:h,defaultWidth:"wide",argumentCallback:function(w){return w-1}}),month:(0,c.Z)({values:o,defaultWidth:"wide"}),day:(0,c.Z)({values:m,defaultWidth:"wide"}),dayPeriod:(0,c.Z)({values:l,defaultWidth:"wide",formattingValues:f,defaultFormattingWidth:"wide"})};g.Z=T},63614:function(p,g,s){var c=s(29450),d=s(60965),h=/^(\d+)(th|st|nd|rd)?/i,o=/\d+/i,m={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},l={any:[/^b/i,/^(a|c)/i]},f={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},b={any:[/1/i,/2/i,/3/i,/4/i]},T={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},O={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},w={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},C={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},y={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},W={ordinalNumber:(0,d.Z)({matchPattern:h,parsePattern:o,valueCallback:function(P){return parseInt(P,10)}}),era:(0,c.Z)({matchPatterns:m,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,c.Z)({matchPatterns:f,defaultMatchWidth:"wide",parsePatterns:b,defaultParseWidth:"any",valueCallback:function(P){return P+1}}),month:(0,c.Z)({matchPatterns:T,defaultMatchWidth:"wide",parsePatterns:O,defaultParseWidth:"any"}),day:(0,c.Z)({matchPatterns:w,defaultMatchWidth:"wide",parsePatterns:C,defaultParseWidth:"any"}),dayPeriod:(0,c.Z)({matchPatterns:y,defaultMatchWidth:"any",parsePatterns:_,defaultParseWidth:"any"})};g.Z=W},54828:function(p,g,s){s.d(g,{Z:function(){return C}});var c=s(10661),d=s(39446),h={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},o={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},l={date:(0,d.Z)({formats:h,defaultWidth:"full"}),time:(0,d.Z)({formats:o,defaultWidth:"full"}),dateTime:(0,d.Z)({formats:m,defaultWidth:"full"})},f=l,b=s(57459),T=s(52855),O=s(63614),w={code:"en-US",formatDistance:c.Z,formatLong:f,formatRelative:b.Z,localize:T.Z,match:O.Z,options:{weekStartsOn:0,firstWeekContainsDate:1}},C=w},29439:function(p,g,s){s.d(g,{Z:function(){return h}});var c=s(74512);const d=o=>(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"none",viewBox:"0 0 24 24",...o,children:(0,c.jsx)("path",{fill:"#212134",d:"M24 13.3a.2.2 0 0 1-.2.2H5.74l8.239 8.239a.2.2 0 0 1 0 .282L12.14 23.86a.2.2 0 0 1-.282 0L.14 12.14a.2.2 0 0 1 0-.282L11.86.14a.2.2 0 0 1 .282 0L13.98 1.98a.2.2 0 0 1 0 .282L5.74 10.5H23.8c.11 0 .2.09.2.2v2.6Z"})}),h=d}}]);
|