codeforlife 2.8.3 → 2.9.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/dist/Countdown-DFI1RljW.js +28 -0
- package/dist/Countdown-DFI1RljW.js.map +1 -0
- package/dist/Countdown-zY3nMzmi.cjs +2 -0
- package/dist/Countdown-zY3nMzmi.cjs.map +1 -0
- package/dist/Image-D5jC9UoX.js +21 -0
- package/dist/Image-D5jC9UoX.js.map +1 -0
- package/dist/Image-mgT45r_B.cjs +2 -0
- package/dist/Image-mgT45r_B.cjs.map +1 -0
- package/dist/LinkButton-BYFkvL_O.cjs +2 -0
- package/dist/LinkButton-BYFkvL_O.cjs.map +1 -0
- package/dist/LinkButton-oK0RThqn.js +12 -0
- package/dist/LinkButton-oK0RThqn.js.map +1 -0
- package/dist/Navigate-Dq47aqC8.js +25 -0
- package/dist/Navigate-Dq47aqC8.js.map +1 -0
- package/dist/Navigate-dQocLhzN.cjs +2 -0
- package/dist/Navigate-dQocLhzN.cjs.map +1 -0
- package/dist/api/endpoints/index.cjs.js +2 -0
- package/dist/api/endpoints/index.cjs.js.map +1 -0
- package/dist/api/endpoints/index.d.ts +81 -0
- package/dist/api/endpoints/index.es.js +78 -0
- package/dist/api/endpoints/index.es.js.map +1 -0
- package/dist/api/index.cjs.js +4 -0
- package/dist/api/index.cjs.js.map +1 -0
- package/dist/api/index.d.ts +77 -0
- package/dist/api/index.es.js +541 -0
- package/dist/api/index.es.js.map +1 -0
- package/dist/api-Cbyt3rw0.js +92 -0
- package/dist/api-Cbyt3rw0.js.map +1 -0
- package/dist/api-CnMfjRk3.cjs +2 -0
- package/dist/api-CnMfjRk3.cjs.map +1 -0
- package/dist/api-Cs4Y-WeI.js +20 -0
- package/dist/api-Cs4Y-WeI.js.map +1 -0
- package/dist/api-DIgp_6Vr.cjs +2 -0
- package/dist/api-DIgp_6Vr.cjs.map +1 -0
- package/dist/api.d.ts +123 -0
- package/dist/auth-BPfUPjmM.js +237 -0
- package/dist/auth-BPfUPjmM.js.map +1 -0
- package/dist/auth-Vf1MgMci.cjs +2 -0
- package/dist/auth-Vf1MgMci.cjs.map +1 -0
- package/dist/auth.d.ts +40 -0
- package/dist/components/form/index.cjs.js +2 -0
- package/dist/components/form/index.cjs.js.map +1 -0
- package/dist/components/form/index.d.ts +86 -0
- package/dist/components/form/index.es.js +18 -0
- package/dist/components/form/index.es.js.map +1 -0
- package/dist/components/index.cjs.js +11 -0
- package/dist/components/index.cjs.js.map +1 -0
- package/dist/components/index.d.ts +90 -0
- package/dist/components/index.es.js +383 -0
- package/dist/components/index.es.js.map +1 -0
- package/dist/components/page/index.cjs.js +2 -0
- package/dist/components/page/index.cjs.js.map +1 -0
- package/dist/components/page/index.d.ts +77 -0
- package/dist/components/page/index.es.js +9 -0
- package/dist/components/page/index.es.js.map +1 -0
- package/dist/components/router/index.cjs.js +2 -0
- package/dist/components/router/index.cjs.js.map +1 -0
- package/dist/components/router/index.d.ts +78 -0
- package/dist/components/router/index.es.js +11 -0
- package/dist/components/router/index.es.js.map +1 -0
- package/dist/components/table/index.cjs.js +2 -0
- package/dist/components/table/index.cjs.js.map +1 -0
- package/dist/components/table/index.d.ts +75 -0
- package/dist/components/table/index.es.js +9 -0
- package/dist/components/table/index.es.js.map +1 -0
- package/dist/en-gb-B_rK7Jx1.js +20 -0
- package/dist/en-gb-B_rK7Jx1.js.map +1 -0
- package/dist/en-gb-CpyEkKq3.cjs +2 -0
- package/dist/en-gb-CpyEkKq3.cjs.map +1 -0
- package/dist/features/index.cjs.js +2 -0
- package/dist/features/index.cjs.js.map +1 -0
- package/dist/features/index.d.ts +76 -0
- package/dist/features/index.es.js +47 -0
- package/dist/features/index.es.js.map +1 -0
- package/dist/form.d.ts +40 -0
- package/dist/general-BPbbmkeX.cjs +2 -0
- package/dist/general-BPbbmkeX.cjs.map +1 -0
- package/dist/general-CtTJPCJn.js +58 -0
- package/dist/general-CtTJPCJn.js.map +1 -0
- package/dist/general.d.ts +53 -0
- package/dist/hooks/index.cjs.js +2 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.d.ts +77 -0
- package/dist/hooks/index.es.js +25 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index-2W--_sNE.js +30 -0
- package/dist/index-2W--_sNE.js.map +1 -0
- package/dist/index-BUMdUVBH.cjs +5 -0
- package/dist/index-BUMdUVBH.cjs.map +1 -0
- package/dist/index-B_Zy_zwA.cjs +2 -0
- package/dist/index-B_Zy_zwA.cjs.map +1 -0
- package/dist/index-BgsynEGX.cjs +2 -0
- package/dist/index-BgsynEGX.cjs.map +1 -0
- package/dist/index-CA-ugBSa.cjs +2 -0
- package/dist/index-CA-ugBSa.cjs.map +1 -0
- package/dist/index-CNtOlJ49.js +572 -0
- package/dist/index-CNtOlJ49.js.map +1 -0
- package/dist/index-DkM_cG3a.js +237 -0
- package/dist/index-DkM_cG3a.js.map +1 -0
- package/dist/index-Dqp7dpn3.js +1111 -0
- package/dist/index-Dqp7dpn3.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.es.js +7 -0
- package/dist/index.es.js.map +1 -0
- package/dist/jsx-runtime-CeSfJrVB.cjs +31 -0
- package/dist/jsx-runtime-CeSfJrVB.cjs.map +1 -0
- package/dist/jsx-runtime-Dpn_P65e.js +634 -0
- package/dist/jsx-runtime-Dpn_P65e.js.map +1 -0
- package/dist/middlewares/index.cjs.js +2 -0
- package/dist/middlewares/index.cjs.js.map +1 -0
- package/dist/middlewares/index.d.ts +73 -0
- package/dist/middlewares/index.es.js +10 -0
- package/dist/middlewares/index.es.js.map +1 -0
- package/dist/palette-CE2mKYse.cjs +2 -0
- package/dist/palette-CE2mKYse.cjs.map +1 -0
- package/dist/palette-C_L0akN_.js +43 -0
- package/dist/palette-C_L0akN_.js.map +1 -0
- package/dist/router.d.ts +48 -0
- package/dist/rtk-query.modern-CjetfYPg.js +3038 -0
- package/dist/rtk-query.modern-CjetfYPg.js.map +1 -0
- package/dist/rtk-query.modern-PBCErCqb.cjs +15 -0
- package/dist/rtk-query.modern-PBCErCqb.cjs.map +1 -0
- package/dist/schema.d.ts +89 -0
- package/dist/schemas-BZbJpkD5.cjs +2 -0
- package/dist/schemas-BZbJpkD5.cjs.map +1 -0
- package/dist/schemas-DlOtf2vf.js +162 -0
- package/dist/schemas-DlOtf2vf.js.map +1 -0
- package/dist/server.cjs.js +6 -0
- package/dist/server.cjs.js.map +1 -0
- package/dist/server.d.ts +129 -0
- package/dist/server.es.js +127 -0
- package/dist/server.es.js.map +1 -0
- package/dist/session-CE2U7oL1.cjs +2 -0
- package/dist/session-CE2U7oL1.cjs.map +1 -0
- package/dist/session-CacrgFSv.cjs +2 -0
- package/dist/session-CacrgFSv.cjs.map +1 -0
- package/dist/session-D312kYKk.js +32 -0
- package/dist/session-D312kYKk.js.map +1 -0
- package/dist/session-oI-Ht2C8.js +30 -0
- package/dist/session-oI-Ht2C8.js.map +1 -0
- package/dist/settings/index.cjs.js +2 -0
- package/dist/settings/index.cjs.js.map +1 -0
- package/dist/settings/index.d.ts +76 -0
- package/dist/settings/index.es.js +17 -0
- package/dist/settings/index.es.js.map +1 -0
- package/dist/slices/index.cjs.js +2 -0
- package/dist/slices/index.cjs.js.map +1 -0
- package/dist/slices/index.d.ts +74 -0
- package/dist/slices/index.es.js +6 -0
- package/dist/slices/index.es.js.map +1 -0
- package/dist/store.d.ts +17 -0
- package/dist/style.css +1 -0
- package/dist/test.d.ts +75 -0
- package/dist/theme/components/index.cjs.js +2 -0
- package/dist/theme/components/index.cjs.js.map +1 -0
- package/dist/theme/components/index.d.ts +75 -0
- package/dist/theme/components/index.es.js +6 -0
- package/dist/theme/components/index.es.js.map +1 -0
- package/dist/theme/index.cjs.js +2 -0
- package/dist/theme/index.cjs.js.map +1 -0
- package/dist/theme/index.d.ts +79 -0
- package/dist/theme/index.es.js +222 -0
- package/dist/theme/index.es.js.map +1 -0
- package/dist/theme.d.ts +19 -0
- package/dist/urls-DtHr1d3H.js +14 -0
- package/dist/urls-DtHr1d3H.js.map +1 -0
- package/dist/urls-MaVXL_C2.cjs +2 -0
- package/dist/urls-MaVXL_C2.cjs.map +1 -0
- package/dist/utils/api.cjs.js +2 -0
- package/dist/utils/api.cjs.js.map +1 -0
- package/dist/utils/api.d.ts +144 -0
- package/dist/utils/api.es.js +16 -0
- package/dist/utils/api.es.js.map +1 -0
- package/dist/utils/auth.cjs.js +2 -0
- package/dist/utils/auth.cjs.js.map +1 -0
- package/dist/utils/auth.d.ts +100 -0
- package/dist/utils/auth.es.js +117 -0
- package/dist/utils/auth.es.js.map +1 -0
- package/dist/utils/form.cjs.js +2 -0
- package/dist/utils/form.cjs.js.map +1 -0
- package/dist/utils/form.d.ts +97 -0
- package/dist/utils/form.es.js +76 -0
- package/dist/utils/form.es.js.map +1 -0
- package/dist/utils/general.cjs.js +2 -0
- package/dist/utils/general.cjs.js.map +1 -0
- package/dist/utils/general.d.ts +102 -0
- package/{src/utils/general.ts → dist/utils/general.es.js} +87 -165
- package/dist/utils/general.es.js.map +1 -0
- package/dist/utils/router.cjs.js +2 -0
- package/dist/utils/router.cjs.js.map +1 -0
- package/dist/utils/router.d.ts +91 -0
- package/dist/utils/router.es.js +33 -0
- package/dist/utils/router.es.js.map +1 -0
- package/dist/utils/schema.cjs.js +2 -0
- package/dist/utils/schema.cjs.js.map +1 -0
- package/dist/utils/schema.d.ts +115 -0
- package/dist/utils/schema.es.js +123 -0
- package/dist/utils/schema.es.js.map +1 -0
- package/dist/utils/store.cjs.js +2 -0
- package/dist/utils/store.cjs.js.map +1 -0
- package/dist/utils/store.d.ts +82 -0
- package/dist/utils/store.es.js +20 -0
- package/dist/utils/store.es.js.map +1 -0
- package/dist/utils/test.cjs.js +2 -0
- package/dist/utils/test.cjs.js.map +1 -0
- package/dist/utils/test.d.ts +125 -0
- package/dist/utils/test.es.js +60 -0
- package/dist/utils/test.es.js.map +1 -0
- package/dist/utils/theme.cjs.js +2 -0
- package/dist/utils/theme.cjs.js.map +1 -0
- package/dist/utils/theme.d.ts +83 -0
- package/dist/utils/theme.es.js +12 -0
- package/dist/utils/theme.es.js.map +1 -0
- package/dist/utils/window.cjs.js +2 -0
- package/dist/utils/window.cjs.js.map +1 -0
- package/dist/utils/window.d.ts +74 -0
- package/dist/utils/window.es.js +11 -0
- package/dist/utils/window.es.js.map +1 -0
- package/dist/window.d.ts +5 -0
- package/package.json +142 -37
- package/.github/workflows/main.yml +0 -55
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -2027
- package/CONTRIBUTING.md +0 -3
- package/eslint.config.js +0 -17
- package/src/api/createApi.ts +0 -91
- package/src/api/endpoints/authFactor.ts +0 -31
- package/src/api/endpoints/index.ts +0 -9
- package/src/api/endpoints/klass.ts +0 -87
- package/src/api/endpoints/school.ts +0 -34
- package/src/api/endpoints/session.ts +0 -47
- package/src/api/endpoints/user.ts +0 -70
- package/src/api/index.ts +0 -5
- package/src/api/models.ts +0 -145
- package/src/api/schemas.ts +0 -243
- package/src/api/tagTypes.ts +0 -12
- package/src/api/urls.ts +0 -13
- package/src/components/App.css +0 -38
- package/src/components/App.tsx +0 -152
- package/src/components/ClickableTooltip.tsx +0 -43
- package/src/components/CopyIconButton.test.tsx +0 -16
- package/src/components/CopyIconButton.tsx +0 -27
- package/src/components/Countdown.tsx +0 -42
- package/src/components/DownloadFileButton.tsx +0 -55
- package/src/components/ElevatedAppBar.tsx +0 -41
- package/src/components/Image.tsx +0 -41
- package/src/components/InputFileButton.tsx +0 -27
- package/src/components/ItemizedList.tsx +0 -63
- package/src/components/OrderedGrid.tsx +0 -92
- package/src/components/ScrollIntoViewLink.tsx +0 -22
- package/src/components/SyncError.tsx +0 -14
- package/src/components/TablePagination.tsx +0 -142
- package/src/components/YouTubeVideo.tsx +0 -26
- package/src/components/form/ApiAutocompleteField.tsx +0 -187
- package/src/components/form/AutocompleteField.tsx +0 -135
- package/src/components/form/CheckboxField.tsx +0 -86
- package/src/components/form/CountryField.tsx +0 -75
- package/src/components/form/DatePickerField.tsx +0 -126
- package/src/components/form/EmailField.tsx +0 -38
- package/src/components/form/FirstNameField.tsx +0 -40
- package/src/components/form/Form.tsx +0 -165
- package/src/components/form/OtpField.tsx +0 -28
- package/src/components/form/PasswordField.tsx +0 -71
- package/src/components/form/RepeatField.tsx +0 -123
- package/src/components/form/SubmitButton.tsx +0 -57
- package/src/components/form/TextField.tsx +0 -150
- package/src/components/form/UkCountyField.tsx +0 -68
- package/src/components/form/index.tsx +0 -35
- package/src/components/index.ts +0 -28
- package/src/components/page/Banner.tsx +0 -95
- package/src/components/page/Notification.tsx +0 -71
- package/src/components/page/Page.tsx +0 -73
- package/src/components/page/Section.tsx +0 -21
- package/src/components/page/TabBar.tsx +0 -131
- package/src/components/page/index.ts +0 -10
- package/src/components/router/Link.tsx +0 -23
- package/src/components/router/LinkButton.tsx +0 -22
- package/src/components/router/LinkIconButton.tsx +0 -22
- package/src/components/router/LinkListItem.tsx +0 -22
- package/src/components/router/LinkTab.tsx +0 -22
- package/src/components/router/Navigate.tsx +0 -33
- package/src/components/router/index.tsx +0 -9
- package/src/components/table/CellStack.tsx +0 -19
- package/src/components/table/Table.tsx +0 -55
- package/src/components/table/index.tsx +0 -8
- package/src/features/InactiveDialog.tsx +0 -40
- package/src/features/ScreenTimeDialog.tsx +0 -30
- package/src/features/index.ts +0 -4
- package/src/fonts/ttf/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/src/fonts/ttf/SpaceGrotesk-VariableFont_wght.ttf +0 -0
- package/src/hooks/api.tsx +0 -39
- package/src/hooks/auth.tsx +0 -397
- package/src/hooks/form.tsx +0 -11
- package/src/hooks/general.tsx +0 -110
- package/src/hooks/index.ts +0 -5
- package/src/hooks/router.tsx +0 -168
- package/src/images/svg/brain.svg +0 -1
- package/src/index.ts +0 -2
- package/src/middlewares/index.ts +0 -1
- package/src/middlewares/session.ts +0 -21
- package/src/scripts/freshDesk.js +0 -473
- package/src/scripts/index.ts +0 -1
- package/src/server.js +0 -187
- package/src/settings/custom.ts +0 -22
- package/src/settings/index.ts +0 -7
- package/src/settings/vite.ts +0 -26
- package/src/setupTests.ts +0 -2
- package/src/slices/createSlice.ts +0 -8
- package/src/slices/index.ts +0 -2
- package/src/slices/session.ts +0 -32
- package/src/theme/ThemedBox.tsx +0 -265
- package/src/theme/colors.ts +0 -57
- package/src/theme/components/MuiAccordion.tsx +0 -13
- package/src/theme/components/MuiAutocomplete.tsx +0 -11
- package/src/theme/components/MuiButton.ts +0 -70
- package/src/theme/components/MuiCardActions.tsx +0 -12
- package/src/theme/components/MuiCheckbox.ts +0 -12
- package/src/theme/components/MuiContainer.ts +0 -19
- package/src/theme/components/MuiDialog.tsx +0 -16
- package/src/theme/components/MuiFormControlLabel.ts +0 -18
- package/src/theme/components/MuiFormHelperText.ts +0 -12
- package/src/theme/components/MuiGrid2.ts +0 -16
- package/src/theme/components/MuiInputBase.ts +0 -14
- package/src/theme/components/MuiLink.ts +0 -41
- package/src/theme/components/MuiList.ts +0 -12
- package/src/theme/components/MuiListItemText.ts +0 -18
- package/src/theme/components/MuiMenu.ts +0 -14
- package/src/theme/components/MuiMenuItem.ts +0 -15
- package/src/theme/components/MuiSelect.ts +0 -16
- package/src/theme/components/MuiTab.ts +0 -29
- package/src/theme/components/MuiTable.ts +0 -29
- package/src/theme/components/MuiTableBody.ts +0 -15
- package/src/theme/components/MuiTableHead.ts +0 -26
- package/src/theme/components/MuiTabs.ts +0 -26
- package/src/theme/components/MuiTextField.ts +0 -86
- package/src/theme/components/MuiToolbar.ts +0 -11
- package/src/theme/components/MuiTypography.ts +0 -12
- package/src/theme/components/_components.ts +0 -95
- package/src/theme/components/index.ts +0 -57
- package/src/theme/index.ts +0 -25
- package/src/theme/palette.ts +0 -98
- package/src/theme/spacing.ts +0 -8
- package/src/theme/typography.ts +0 -101
- package/src/utils/api.test.ts +0 -19
- package/src/utils/api.tsx +0 -339
- package/src/utils/auth.ts +0 -78
- package/src/utils/form.test.ts +0 -50
- package/src/utils/form.ts +0 -193
- package/src/utils/general.test.ts +0 -55
- package/src/utils/router.test.ts +0 -156
- package/src/utils/router.ts +0 -67
- package/src/utils/schema.ts +0 -290
- package/src/utils/store.ts +0 -31
- package/src/utils/test.tsx +0 -82
- package/src/utils/theme.tsx +0 -83
- package/src/utils/window.ts +0 -11
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -4
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -4
- package/types/fixes.d.ts +0 -18
- package/vite.config.ts +0 -23
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export { default as createApi } from './createApi';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * as schemas from './schemas';
|
|
4
|
+
export { default as tagTypes } from './tagTypes';
|
|
5
|
+
export { default as urls } from './urls';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
declare module "@mui/material/styles" {
|
|
9
|
+
interface CustomPaletteColors {
|
|
10
|
+
tertiary: PaletteColor;
|
|
11
|
+
white: PaletteColor;
|
|
12
|
+
black: PaletteColor;
|
|
13
|
+
teacher: PaletteColor;
|
|
14
|
+
student: PaletteColor;
|
|
15
|
+
indy: PaletteColor;
|
|
16
|
+
}
|
|
17
|
+
interface Palette extends CustomPaletteColors {
|
|
18
|
+
}
|
|
19
|
+
interface PaletteOptions extends CustomPaletteColors {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
declare module "@mui/material" {
|
|
25
|
+
interface FabPropsColorOverrides extends PropsColorOverrides {
|
|
26
|
+
}
|
|
27
|
+
interface CardPropsColorOverrides extends PropsColorOverrides {
|
|
28
|
+
}
|
|
29
|
+
interface ChipPropsColorOverrides extends PropsColorOverrides {
|
|
30
|
+
}
|
|
31
|
+
interface IconPropsColorOverrides extends PropsColorOverrides {
|
|
32
|
+
}
|
|
33
|
+
interface AlertPropsColorOverrides extends PropsColorOverrides {
|
|
34
|
+
}
|
|
35
|
+
interface BadgePropsColorOverrides extends PropsColorOverrides {
|
|
36
|
+
}
|
|
37
|
+
interface RadioPropsColorOverrides extends PropsColorOverrides {
|
|
38
|
+
}
|
|
39
|
+
interface AppBarPropsColorOverrides extends PropsColorOverrides {
|
|
40
|
+
}
|
|
41
|
+
interface ButtonPropsColorOverrides extends PropsColorOverrides {
|
|
42
|
+
}
|
|
43
|
+
interface SliderPropsColorOverrides extends PropsColorOverrides {
|
|
44
|
+
}
|
|
45
|
+
interface SwitchPropsColorOverrides extends PropsColorOverrides {
|
|
46
|
+
}
|
|
47
|
+
interface SvgIconPropsColorOverrides extends PropsColorOverrides {
|
|
48
|
+
}
|
|
49
|
+
interface CheckboxPropsColorOverrides extends PropsColorOverrides {
|
|
50
|
+
}
|
|
51
|
+
interface FormLabelPropsColorOverrides extends PropsColorOverrides {
|
|
52
|
+
}
|
|
53
|
+
interface InputBasePropsColorOverrides extends PropsColorOverrides {
|
|
54
|
+
}
|
|
55
|
+
interface TextFieldPropsColorOverrides extends PropsColorOverrides {
|
|
56
|
+
}
|
|
57
|
+
interface IconButtonPropsColorOverrides extends PropsColorOverrides {
|
|
58
|
+
}
|
|
59
|
+
interface PaginationPropsColorOverrides extends PropsColorOverrides {
|
|
60
|
+
}
|
|
61
|
+
interface ButtonGroupPropsColorOverrides extends PropsColorOverrides {
|
|
62
|
+
}
|
|
63
|
+
interface FormControlPropsColorOverrides extends PropsColorOverrides {
|
|
64
|
+
}
|
|
65
|
+
interface ToggleButtonPropsColorOverrides extends PropsColorOverrides {
|
|
66
|
+
}
|
|
67
|
+
interface LinearProgressPropsColorOverrides extends PropsColorOverrides {
|
|
68
|
+
}
|
|
69
|
+
interface PaginationItemPropsColorOverrides extends PropsColorOverrides {
|
|
70
|
+
}
|
|
71
|
+
interface CircularProgressPropsColorOverrides extends PropsColorOverrides {
|
|
72
|
+
}
|
|
73
|
+
interface TabsPropsIndicatorColorOverrides extends PropsColorOverrides {
|
|
74
|
+
}
|
|
75
|
+
interface ToggleButtonGroupPropsColorOverrides extends PropsColorOverrides {
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { b as ae, c as fe, a as de, d as U, Q as pe, e as le, f as be } from "../rtk-query.modern-CjetfYPg.js";
|
|
2
|
+
import { formatProdErrorMessage as oe } from "@reduxjs/toolkit";
|
|
3
|
+
import { useStore as ye, useSelector as he, useDispatch as ge, batch as me, shallowEqual as $ } from "react-redux";
|
|
4
|
+
import { useCallback as N, useDebugValue as x, useMemo as k, useState as re, useEffect as A, useRef as q, useLayoutEffect as Se } from "react";
|
|
5
|
+
import { SERVICE_API_URL as ve } from "../settings/index.es.js";
|
|
6
|
+
import { b as Ee } from "../session-D312kYKk.js";
|
|
7
|
+
import { getCsrfCookie as J } from "../utils/auth.es.js";
|
|
8
|
+
import { i as Qe } from "../api-Cbyt3rw0.js";
|
|
9
|
+
import { s as Be } from "../schemas-DlOtf2vf.js";
|
|
10
|
+
import { u as Ze } from "../urls-DtHr1d3H.js";
|
|
11
|
+
function F(e) {
|
|
12
|
+
return e.replace(e[0], e[0].toUpperCase());
|
|
13
|
+
}
|
|
14
|
+
function ke(e) {
|
|
15
|
+
let f = 0;
|
|
16
|
+
for (const y in e)
|
|
17
|
+
f++;
|
|
18
|
+
return f;
|
|
19
|
+
}
|
|
20
|
+
function Pe(e) {
|
|
21
|
+
return e.type === "query";
|
|
22
|
+
}
|
|
23
|
+
function Oe(e) {
|
|
24
|
+
return e.type === "mutation";
|
|
25
|
+
}
|
|
26
|
+
function se(e) {
|
|
27
|
+
return e.type === "infinitequery";
|
|
28
|
+
}
|
|
29
|
+
function C(e, ...f) {
|
|
30
|
+
return Object.assign(e, ...f);
|
|
31
|
+
}
|
|
32
|
+
var X = Symbol();
|
|
33
|
+
function ee(e) {
|
|
34
|
+
const f = q(e), y = k(() => le(f.current, e), [e]);
|
|
35
|
+
return A(() => {
|
|
36
|
+
f.current !== y && (f.current = y);
|
|
37
|
+
}, [y]), y;
|
|
38
|
+
}
|
|
39
|
+
function G(e) {
|
|
40
|
+
const f = q(e);
|
|
41
|
+
return A(() => {
|
|
42
|
+
$(f.current, e) || (f.current = e);
|
|
43
|
+
}, [e]), $(f.current, e) ? f.current : e;
|
|
44
|
+
}
|
|
45
|
+
var Ie = () => typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", De = /* @__PURE__ */ Ie(), we = () => typeof navigator < "u" && navigator.product === "ReactNative", Le = /* @__PURE__ */ we(), Me = () => De || Le ? Se : A, Ue = /* @__PURE__ */ Me(), ie = (e) => e.isUninitialized ? {
|
|
46
|
+
...e,
|
|
47
|
+
isUninitialized: !1,
|
|
48
|
+
isFetching: !0,
|
|
49
|
+
isLoading: e.data === void 0,
|
|
50
|
+
status: pe.pending
|
|
51
|
+
} : e;
|
|
52
|
+
function te(e, ...f) {
|
|
53
|
+
const y = {};
|
|
54
|
+
return f.forEach((m) => {
|
|
55
|
+
y[m] = e[m];
|
|
56
|
+
}), y;
|
|
57
|
+
}
|
|
58
|
+
var ne = ["data", "status", "isLoading", "isSuccess", "isError", "error"];
|
|
59
|
+
function qe({
|
|
60
|
+
api: e,
|
|
61
|
+
moduleOptions: {
|
|
62
|
+
batch: f,
|
|
63
|
+
hooks: {
|
|
64
|
+
useDispatch: y,
|
|
65
|
+
useSelector: m,
|
|
66
|
+
useStore: I
|
|
67
|
+
},
|
|
68
|
+
unstable__sideEffectsInRender: h,
|
|
69
|
+
createSelector: S
|
|
70
|
+
},
|
|
71
|
+
serializeQueryArgs: g,
|
|
72
|
+
context: D
|
|
73
|
+
}) {
|
|
74
|
+
const V = h ? (t) => t() : A;
|
|
75
|
+
return {
|
|
76
|
+
buildQueryHooks: R,
|
|
77
|
+
buildInfiniteQueryHooks: Y,
|
|
78
|
+
buildMutationHook: Z,
|
|
79
|
+
usePrefetch: B
|
|
80
|
+
};
|
|
81
|
+
function K(t, r, d) {
|
|
82
|
+
if (r?.endpointName && t.isUninitialized) {
|
|
83
|
+
const {
|
|
84
|
+
endpointName: s
|
|
85
|
+
} = r, c = D.endpointDefinitions[s];
|
|
86
|
+
d !== U && g({
|
|
87
|
+
queryArgs: r.originalArgs,
|
|
88
|
+
endpointDefinition: c,
|
|
89
|
+
endpointName: s
|
|
90
|
+
}) === g({
|
|
91
|
+
queryArgs: d,
|
|
92
|
+
endpointDefinition: c,
|
|
93
|
+
endpointName: s
|
|
94
|
+
}) && (r = void 0);
|
|
95
|
+
}
|
|
96
|
+
let u = t.isSuccess ? t.data : r?.data;
|
|
97
|
+
u === void 0 && (u = t.data);
|
|
98
|
+
const i = u !== void 0, n = t.isLoading, o = (!r || r.isLoading || r.isUninitialized) && !i && n, a = t.isSuccess || i && (n && !r?.isError || t.isUninitialized);
|
|
99
|
+
return {
|
|
100
|
+
...t,
|
|
101
|
+
data: u,
|
|
102
|
+
currentData: t.data,
|
|
103
|
+
isFetching: n,
|
|
104
|
+
isLoading: o,
|
|
105
|
+
isSuccess: a
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function W(t, r, d) {
|
|
109
|
+
if (r?.endpointName && t.isUninitialized) {
|
|
110
|
+
const {
|
|
111
|
+
endpointName: s
|
|
112
|
+
} = r, c = D.endpointDefinitions[s];
|
|
113
|
+
d !== U && g({
|
|
114
|
+
queryArgs: r.originalArgs,
|
|
115
|
+
endpointDefinition: c,
|
|
116
|
+
endpointName: s
|
|
117
|
+
}) === g({
|
|
118
|
+
queryArgs: d,
|
|
119
|
+
endpointDefinition: c,
|
|
120
|
+
endpointName: s
|
|
121
|
+
}) && (r = void 0);
|
|
122
|
+
}
|
|
123
|
+
let u = t.isSuccess ? t.data : r?.data;
|
|
124
|
+
u === void 0 && (u = t.data);
|
|
125
|
+
const i = u !== void 0, n = t.isLoading, o = (!r || r.isLoading || r.isUninitialized) && !i && n, a = t.isSuccess || n && i;
|
|
126
|
+
return {
|
|
127
|
+
...t,
|
|
128
|
+
data: u,
|
|
129
|
+
currentData: t.data,
|
|
130
|
+
isFetching: n,
|
|
131
|
+
isLoading: o,
|
|
132
|
+
isSuccess: a
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function B(t, r) {
|
|
136
|
+
const d = y(), u = G(r);
|
|
137
|
+
return N((i, n) => d(e.util.prefetch(t, i, {
|
|
138
|
+
...u,
|
|
139
|
+
...n
|
|
140
|
+
})), [t, d, u]);
|
|
141
|
+
}
|
|
142
|
+
function P(t, r, {
|
|
143
|
+
refetchOnReconnect: d,
|
|
144
|
+
refetchOnFocus: u,
|
|
145
|
+
refetchOnMountOrArgChange: i,
|
|
146
|
+
skip: n = !1,
|
|
147
|
+
pollingInterval: o = 0,
|
|
148
|
+
skipPollingIfUnfocused: a = !1,
|
|
149
|
+
...s
|
|
150
|
+
} = {}) {
|
|
151
|
+
const {
|
|
152
|
+
initiate: c
|
|
153
|
+
} = e.endpoints[t], l = y(), O = q(void 0);
|
|
154
|
+
if (!O.current) {
|
|
155
|
+
const M = l(e.internalActions.internal_getRTKQSubscriptions());
|
|
156
|
+
if (process.env.NODE_ENV !== "production" && (typeof M != "object" || typeof M?.type == "string"))
|
|
157
|
+
throw new Error(process.env.NODE_ENV === "production" ? oe(37) : `Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
|
|
158
|
+
You must add the middleware for RTK-Query to function correctly!`);
|
|
159
|
+
O.current = M;
|
|
160
|
+
}
|
|
161
|
+
const p = ee(n ? U : r), b = G({
|
|
162
|
+
refetchOnReconnect: d,
|
|
163
|
+
refetchOnFocus: u,
|
|
164
|
+
pollingInterval: o,
|
|
165
|
+
skipPollingIfUnfocused: a
|
|
166
|
+
}), v = s.initialPageParam, E = G(v), Q = q(void 0);
|
|
167
|
+
let {
|
|
168
|
+
queryCacheKey: L,
|
|
169
|
+
requestId: H
|
|
170
|
+
} = Q.current || {}, z = !1;
|
|
171
|
+
L && H && (z = O.current.isRequestSubscribed(L, H));
|
|
172
|
+
const j = !z && Q.current !== void 0;
|
|
173
|
+
return V(() => {
|
|
174
|
+
j && (Q.current = void 0);
|
|
175
|
+
}, [j]), V(() => {
|
|
176
|
+
const M = Q.current;
|
|
177
|
+
if (typeof process < "u" && process.env.NODE_ENV === "removeMeOnCompilation" && console.log(j), p === U) {
|
|
178
|
+
M?.unsubscribe(), Q.current = void 0;
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const ue = Q.current?.subscriptionOptions;
|
|
182
|
+
if (!M || M.arg !== p) {
|
|
183
|
+
M?.unsubscribe();
|
|
184
|
+
const ce = l(c(p, {
|
|
185
|
+
subscriptionOptions: b,
|
|
186
|
+
forceRefetch: i,
|
|
187
|
+
...se(D.endpointDefinitions[t]) ? {
|
|
188
|
+
initialPageParam: E
|
|
189
|
+
} : {}
|
|
190
|
+
}));
|
|
191
|
+
Q.current = ce;
|
|
192
|
+
} else b !== ue && M.updateSubscriptionOptions(b);
|
|
193
|
+
}, [l, c, i, p, b, j, E, t]), [Q, l, c, b];
|
|
194
|
+
}
|
|
195
|
+
function T(t, r) {
|
|
196
|
+
return (u, {
|
|
197
|
+
skip: i = !1,
|
|
198
|
+
selectFromResult: n
|
|
199
|
+
} = {}) => {
|
|
200
|
+
const {
|
|
201
|
+
select: o
|
|
202
|
+
} = e.endpoints[t], a = ee(i ? U : u), s = q(void 0), c = k(() => (
|
|
203
|
+
// Normally ts-ignores are bad and should be avoided, but we're
|
|
204
|
+
// already casting this selector to be `Selector<any>` anyway,
|
|
205
|
+
// so the inconsistencies don't matter here
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
S([
|
|
208
|
+
// @ts-ignore
|
|
209
|
+
o(a),
|
|
210
|
+
(v, E) => E,
|
|
211
|
+
(v) => a
|
|
212
|
+
], r, {
|
|
213
|
+
memoizeOptions: {
|
|
214
|
+
resultEqualityCheck: $
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
), [o, a]), l = k(() => n ? S([c], n, {
|
|
218
|
+
devModeChecks: {
|
|
219
|
+
identityFunctionCheck: "never"
|
|
220
|
+
}
|
|
221
|
+
}) : c, [c, n]), O = m((v) => l(v, s.current), $), p = I(), b = c(p.getState(), s.current);
|
|
222
|
+
return Ue(() => {
|
|
223
|
+
s.current = b;
|
|
224
|
+
}, [b]), O;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function w(t) {
|
|
228
|
+
A(() => () => {
|
|
229
|
+
t.current?.unsubscribe?.(), t.current = void 0;
|
|
230
|
+
}, [t]);
|
|
231
|
+
}
|
|
232
|
+
function _(t) {
|
|
233
|
+
if (!t.current) throw new Error(process.env.NODE_ENV === "production" ? oe(38) : "Cannot refetch a query that has not been started yet.");
|
|
234
|
+
return t.current.refetch();
|
|
235
|
+
}
|
|
236
|
+
function R(t) {
|
|
237
|
+
const r = (i, n = {}) => {
|
|
238
|
+
const [o] = P(t, i, n);
|
|
239
|
+
return w(o), k(() => ({
|
|
240
|
+
/**
|
|
241
|
+
* A method to manually refetch data for the query
|
|
242
|
+
*/
|
|
243
|
+
refetch: () => _(o)
|
|
244
|
+
}), [o]);
|
|
245
|
+
}, d = ({
|
|
246
|
+
refetchOnReconnect: i,
|
|
247
|
+
refetchOnFocus: n,
|
|
248
|
+
pollingInterval: o = 0,
|
|
249
|
+
skipPollingIfUnfocused: a = !1
|
|
250
|
+
} = {}) => {
|
|
251
|
+
const {
|
|
252
|
+
initiate: s
|
|
253
|
+
} = e.endpoints[t], c = y(), [l, O] = re(X), p = q(void 0), b = G({
|
|
254
|
+
refetchOnReconnect: i,
|
|
255
|
+
refetchOnFocus: n,
|
|
256
|
+
pollingInterval: o,
|
|
257
|
+
skipPollingIfUnfocused: a
|
|
258
|
+
});
|
|
259
|
+
V(() => {
|
|
260
|
+
const L = p.current?.subscriptionOptions;
|
|
261
|
+
b !== L && p.current?.updateSubscriptionOptions(b);
|
|
262
|
+
}, [b]);
|
|
263
|
+
const v = q(b);
|
|
264
|
+
V(() => {
|
|
265
|
+
v.current = b;
|
|
266
|
+
}, [b]);
|
|
267
|
+
const E = N(function(L, H = !1) {
|
|
268
|
+
let z;
|
|
269
|
+
return f(() => {
|
|
270
|
+
p.current?.unsubscribe(), p.current = z = c(s(L, {
|
|
271
|
+
subscriptionOptions: v.current,
|
|
272
|
+
forceRefetch: !H
|
|
273
|
+
})), O(L);
|
|
274
|
+
}), z;
|
|
275
|
+
}, [c, s]), Q = N(() => {
|
|
276
|
+
p.current?.queryCacheKey && c(e.internalActions.removeQueryResult({
|
|
277
|
+
queryCacheKey: p.current?.queryCacheKey
|
|
278
|
+
}));
|
|
279
|
+
}, [c]);
|
|
280
|
+
return A(() => () => {
|
|
281
|
+
p?.current?.unsubscribe();
|
|
282
|
+
}, []), A(() => {
|
|
283
|
+
l !== X && !p.current && E(l, !0);
|
|
284
|
+
}, [l, E]), k(() => [E, l, {
|
|
285
|
+
reset: Q
|
|
286
|
+
}], [E, l, Q]);
|
|
287
|
+
}, u = T(t, K);
|
|
288
|
+
return {
|
|
289
|
+
useQueryState: u,
|
|
290
|
+
useQuerySubscription: r,
|
|
291
|
+
useLazyQuerySubscription: d,
|
|
292
|
+
useLazyQuery(i) {
|
|
293
|
+
const [n, o, {
|
|
294
|
+
reset: a
|
|
295
|
+
}] = d(i), s = u(o, {
|
|
296
|
+
...i,
|
|
297
|
+
skip: o === X
|
|
298
|
+
}), c = k(() => ({
|
|
299
|
+
lastArg: o
|
|
300
|
+
}), [o]);
|
|
301
|
+
return k(() => [n, {
|
|
302
|
+
...s,
|
|
303
|
+
reset: a
|
|
304
|
+
}, c], [n, s, a, c]);
|
|
305
|
+
},
|
|
306
|
+
useQuery(i, n) {
|
|
307
|
+
const o = r(i, n), a = u(i, {
|
|
308
|
+
selectFromResult: i === U || n?.skip ? void 0 : ie,
|
|
309
|
+
...n
|
|
310
|
+
}), s = te(a, ...ne);
|
|
311
|
+
return x(s), k(() => ({
|
|
312
|
+
...a,
|
|
313
|
+
...o
|
|
314
|
+
}), [a, o]);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function Y(t) {
|
|
319
|
+
const r = (u, i = {}) => {
|
|
320
|
+
const [n, o, a, s] = P(t, u, i), c = q(s);
|
|
321
|
+
V(() => {
|
|
322
|
+
c.current = s;
|
|
323
|
+
}, [s]);
|
|
324
|
+
const l = N(function(b, v) {
|
|
325
|
+
let E;
|
|
326
|
+
return f(() => {
|
|
327
|
+
n.current?.unsubscribe(), n.current = E = o(a(b, {
|
|
328
|
+
subscriptionOptions: c.current,
|
|
329
|
+
direction: v
|
|
330
|
+
}));
|
|
331
|
+
}), E;
|
|
332
|
+
}, [n, o, a]);
|
|
333
|
+
w(n);
|
|
334
|
+
const O = ee(i.skip ? U : u), p = N(() => _(n), [n]);
|
|
335
|
+
return k(() => ({
|
|
336
|
+
trigger: l,
|
|
337
|
+
/**
|
|
338
|
+
* A method to manually refetch data for the query
|
|
339
|
+
*/
|
|
340
|
+
refetch: p,
|
|
341
|
+
fetchNextPage: () => l(O, "forward"),
|
|
342
|
+
fetchPreviousPage: () => l(O, "backward")
|
|
343
|
+
}), [p, l, O]);
|
|
344
|
+
}, d = T(t, W);
|
|
345
|
+
return {
|
|
346
|
+
useInfiniteQueryState: d,
|
|
347
|
+
useInfiniteQuerySubscription: r,
|
|
348
|
+
useInfiniteQuery(u, i) {
|
|
349
|
+
const {
|
|
350
|
+
refetch: n,
|
|
351
|
+
fetchNextPage: o,
|
|
352
|
+
fetchPreviousPage: a
|
|
353
|
+
} = r(u, i), s = d(u, {
|
|
354
|
+
selectFromResult: u === U || i?.skip ? void 0 : ie,
|
|
355
|
+
...i
|
|
356
|
+
}), c = te(s, ...ne, "hasNextPage", "hasPreviousPage");
|
|
357
|
+
return x(c), k(() => ({
|
|
358
|
+
...s,
|
|
359
|
+
fetchNextPage: o,
|
|
360
|
+
fetchPreviousPage: a,
|
|
361
|
+
refetch: n
|
|
362
|
+
}), [s, o, a, n]);
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function Z(t) {
|
|
367
|
+
return ({
|
|
368
|
+
selectFromResult: r,
|
|
369
|
+
fixedCacheKey: d
|
|
370
|
+
} = {}) => {
|
|
371
|
+
const {
|
|
372
|
+
select: u,
|
|
373
|
+
initiate: i
|
|
374
|
+
} = e.endpoints[t], n = y(), [o, a] = re();
|
|
375
|
+
A(() => () => {
|
|
376
|
+
o?.arg.fixedCacheKey || o?.reset();
|
|
377
|
+
}, [o]);
|
|
378
|
+
const s = N(function(L) {
|
|
379
|
+
const H = n(i(L, {
|
|
380
|
+
fixedCacheKey: d
|
|
381
|
+
}));
|
|
382
|
+
return a(H), H;
|
|
383
|
+
}, [n, i, d]), {
|
|
384
|
+
requestId: c
|
|
385
|
+
} = o || {}, l = k(() => u({
|
|
386
|
+
fixedCacheKey: d,
|
|
387
|
+
requestId: o?.requestId
|
|
388
|
+
}), [d, o, u]), O = k(() => r ? S([l], r) : l, [r, l]), p = m(O, $), b = d == null ? o?.arg.originalArgs : void 0, v = N(() => {
|
|
389
|
+
f(() => {
|
|
390
|
+
o && a(void 0), d && n(e.internalActions.removeMutationResult({
|
|
391
|
+
requestId: c,
|
|
392
|
+
fixedCacheKey: d
|
|
393
|
+
}));
|
|
394
|
+
});
|
|
395
|
+
}, [n, d, o, c]), E = te(p, ...ne, "endpointName");
|
|
396
|
+
x(E);
|
|
397
|
+
const Q = k(() => ({
|
|
398
|
+
...p,
|
|
399
|
+
originalArgs: b,
|
|
400
|
+
reset: v
|
|
401
|
+
}), [p, b, v]);
|
|
402
|
+
return k(() => [s, Q], [s, Q]);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
var Ae = /* @__PURE__ */ Symbol(), Ve = ({
|
|
407
|
+
batch: e = me,
|
|
408
|
+
hooks: f = {
|
|
409
|
+
useDispatch: ge,
|
|
410
|
+
useSelector: he,
|
|
411
|
+
useStore: ye
|
|
412
|
+
},
|
|
413
|
+
createSelector: y = de,
|
|
414
|
+
unstable__sideEffectsInRender: m = !1,
|
|
415
|
+
...I
|
|
416
|
+
} = {}) => {
|
|
417
|
+
if (process.env.NODE_ENV !== "production") {
|
|
418
|
+
const h = ["useDispatch", "useSelector", "useStore"];
|
|
419
|
+
let S = !1;
|
|
420
|
+
for (const g of h)
|
|
421
|
+
if (ke(I) > 0 && (I[g] && (S || (console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"), S = !0)), f[g] = I[g]), typeof f[g] != "function")
|
|
422
|
+
throw new Error(process.env.NODE_ENV === "production" ? oe(36) : `When using custom hooks for context, all ${h.length} hooks need to be provided: ${h.join(", ")}.
|
|
423
|
+
Hook ${g} was either not provided or not a function.`);
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
name: Ae,
|
|
427
|
+
init(h, {
|
|
428
|
+
serializeQueryArgs: S
|
|
429
|
+
}, g) {
|
|
430
|
+
const D = h, {
|
|
431
|
+
buildQueryHooks: V,
|
|
432
|
+
buildInfiniteQueryHooks: K,
|
|
433
|
+
buildMutationHook: W,
|
|
434
|
+
usePrefetch: B
|
|
435
|
+
} = qe({
|
|
436
|
+
api: h,
|
|
437
|
+
moduleOptions: {
|
|
438
|
+
batch: e,
|
|
439
|
+
hooks: f,
|
|
440
|
+
unstable__sideEffectsInRender: m,
|
|
441
|
+
createSelector: y
|
|
442
|
+
},
|
|
443
|
+
serializeQueryArgs: S,
|
|
444
|
+
context: g
|
|
445
|
+
});
|
|
446
|
+
return C(D, {
|
|
447
|
+
usePrefetch: B
|
|
448
|
+
}), C(g, {
|
|
449
|
+
batch: e
|
|
450
|
+
}), {
|
|
451
|
+
injectEndpoint(P, T) {
|
|
452
|
+
if (Pe(T)) {
|
|
453
|
+
const {
|
|
454
|
+
useQuery: w,
|
|
455
|
+
useLazyQuery: _,
|
|
456
|
+
useLazyQuerySubscription: R,
|
|
457
|
+
useQueryState: Y,
|
|
458
|
+
useQuerySubscription: Z
|
|
459
|
+
} = V(P);
|
|
460
|
+
C(D.endpoints[P], {
|
|
461
|
+
useQuery: w,
|
|
462
|
+
useLazyQuery: _,
|
|
463
|
+
useLazyQuerySubscription: R,
|
|
464
|
+
useQueryState: Y,
|
|
465
|
+
useQuerySubscription: Z
|
|
466
|
+
}), h[`use${F(P)}Query`] = w, h[`useLazy${F(P)}Query`] = _;
|
|
467
|
+
}
|
|
468
|
+
if (Oe(T)) {
|
|
469
|
+
const w = W(P);
|
|
470
|
+
C(D.endpoints[P], {
|
|
471
|
+
useMutation: w
|
|
472
|
+
}), h[`use${F(P)}Mutation`] = w;
|
|
473
|
+
} else if (se(T)) {
|
|
474
|
+
const {
|
|
475
|
+
useInfiniteQuery: w,
|
|
476
|
+
useInfiniteQuerySubscription: _,
|
|
477
|
+
useInfiniteQueryState: R
|
|
478
|
+
} = K(P);
|
|
479
|
+
C(D.endpoints[P], {
|
|
480
|
+
useInfiniteQuery: w,
|
|
481
|
+
useInfiniteQuerySubscription: _,
|
|
482
|
+
useInfiniteQueryState: R
|
|
483
|
+
}), h[`use${F(P)}InfiniteQuery`] = w;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}, _e = /* @__PURE__ */ ae(fe(), Ve());
|
|
490
|
+
const He = [
|
|
491
|
+
// These are the tags for the common models used throughout our system.
|
|
492
|
+
// https://github.com/ocadotechnology/codeforlife-package-python/tree/main/codeforlife/user/models
|
|
493
|
+
// NOTE: Don't use the "Teacher" and "Student" tags. Use "User" instead.
|
|
494
|
+
"User",
|
|
495
|
+
"School",
|
|
496
|
+
"Class",
|
|
497
|
+
"AuthFactor"
|
|
498
|
+
];
|
|
499
|
+
function Ge({
|
|
500
|
+
tagTypes: e = []
|
|
501
|
+
} = {}) {
|
|
502
|
+
const f = be({
|
|
503
|
+
baseUrl: `${ve}/`,
|
|
504
|
+
credentials: "include",
|
|
505
|
+
prepareHeaders: (m, I) => {
|
|
506
|
+
const { type: h, arg: S } = I, g = typeof S == "string" ? "GET" : S.method || "GET";
|
|
507
|
+
if (h === "mutation" || !Qe(g)) {
|
|
508
|
+
const D = J();
|
|
509
|
+
D && m.set("x-csrftoken", D);
|
|
510
|
+
}
|
|
511
|
+
return m;
|
|
512
|
+
}
|
|
513
|
+
}), y = _e({
|
|
514
|
+
// https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#implementing-a-custom-basequery
|
|
515
|
+
baseQuery: async (m, I, h) => {
|
|
516
|
+
if (I.type === "mutation" && J() === void 0) {
|
|
517
|
+
const { error: S } = await f(
|
|
518
|
+
{ url: "/csrf/cookie/", method: "GET" },
|
|
519
|
+
I,
|
|
520
|
+
{}
|
|
521
|
+
);
|
|
522
|
+
S !== void 0 && console.error(S), J();
|
|
523
|
+
}
|
|
524
|
+
return await f(m, I, h);
|
|
525
|
+
},
|
|
526
|
+
tagTypes: [...He, ...e],
|
|
527
|
+
endpoints: () => ({})
|
|
528
|
+
});
|
|
529
|
+
return y.injectEndpoints({
|
|
530
|
+
endpoints: (m) => ({
|
|
531
|
+
logout: Ee(y, m)
|
|
532
|
+
})
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
export {
|
|
536
|
+
Ge as createApi,
|
|
537
|
+
Be as schemas,
|
|
538
|
+
He as tagTypes,
|
|
539
|
+
Ze as urls
|
|
540
|
+
};
|
|
541
|
+
//# sourceMappingURL=index.es.js.map
|