analytica-frontend-lib 1.2.17 → 1.2.18
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/AlertManager/index.d.mts +6 -2
- package/dist/AlertManager/index.d.ts +6 -2
- package/dist/AlertManager/index.js +17 -11
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +17 -11
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.d.mts +8 -3
- package/dist/AlertManagerView/index.d.ts +8 -3
- package/dist/AlertManagerView/index.js +4 -24
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +4 -26
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +343 -356
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +114 -127
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DMycdI4U.d.mts → types-BXzeefgf.d.mts} +1 -1
- package/dist/{types-DMycdI4U.d.ts → types-BXzeefgf.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/notification-TD7ZFRLL.png +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1917,6 +1917,7 @@ var MessageStep = ({
|
|
|
1917
1917
|
const handleRemoveFile = () => {
|
|
1918
1918
|
setImage(null);
|
|
1919
1919
|
};
|
|
1920
|
+
const isImageFile = image instanceof File;
|
|
1920
1921
|
return /* @__PURE__ */ jsxs11("section", { className: "flex flex-col gap-4", children: [
|
|
1921
1922
|
/* @__PURE__ */ jsx15(
|
|
1922
1923
|
Input_default,
|
|
@@ -1942,7 +1943,7 @@ var MessageStep = ({
|
|
|
1942
1943
|
allowImageAttachment && /* @__PURE__ */ jsx15(
|
|
1943
1944
|
ImageUpload,
|
|
1944
1945
|
{
|
|
1945
|
-
selectedFile: image,
|
|
1946
|
+
selectedFile: isImageFile ? image : null,
|
|
1946
1947
|
onFileSelect: handleFileSelect,
|
|
1947
1948
|
onRemoveFile: handleRemoveFile
|
|
1948
1949
|
}
|
|
@@ -2145,13 +2146,8 @@ var DateStep = ({
|
|
|
2145
2146
|
|
|
2146
2147
|
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2147
2148
|
import { useMemo as useMemo4, useEffect as useEffect4 } from "react";
|
|
2148
|
-
|
|
2149
|
-
// src/assets/img/notification.png
|
|
2150
|
-
var notification_default = "./notification-TD7ZFRLL.png";
|
|
2151
|
-
|
|
2152
|
-
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2153
2149
|
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2154
|
-
var PreviewStep = () => {
|
|
2150
|
+
var PreviewStep = ({ imageLink, defaultImage }) => {
|
|
2155
2151
|
const title = useAlertFormStore((state) => state.title);
|
|
2156
2152
|
const message = useAlertFormStore((state) => state.message);
|
|
2157
2153
|
const image = useAlertFormStore((state) => state.image);
|
|
@@ -2162,17 +2158,21 @@ var PreviewStep = () => {
|
|
|
2162
2158
|
if (image instanceof File) {
|
|
2163
2159
|
return globalThis.window.URL.createObjectURL(image);
|
|
2164
2160
|
}
|
|
2161
|
+
if (typeof image === "string") {
|
|
2162
|
+
return image;
|
|
2163
|
+
}
|
|
2165
2164
|
return void 0;
|
|
2166
2165
|
}, [image]);
|
|
2167
2166
|
useEffect4(() => {
|
|
2168
2167
|
return () => {
|
|
2169
|
-
if (
|
|
2168
|
+
if (globalThis.window !== void 0 && imageUrl && image instanceof File) {
|
|
2170
2169
|
URL.revokeObjectURL(imageUrl);
|
|
2171
2170
|
}
|
|
2172
2171
|
};
|
|
2173
|
-
}, [imageUrl]);
|
|
2172
|
+
}, [imageUrl, image]);
|
|
2173
|
+
const finalImageUrl = imageLink || imageUrl || defaultImage || void 0;
|
|
2174
2174
|
return /* @__PURE__ */ jsx18("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs14("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl", children: [
|
|
2175
|
-
/* @__PURE__ */ jsx18("img", { src:
|
|
2175
|
+
finalImageUrl && /* @__PURE__ */ jsx18("img", { src: finalImageUrl, alt: title || "Imagem do alerta" }),
|
|
2176
2176
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center text-center gap-3", children: [
|
|
2177
2177
|
/* @__PURE__ */ jsx18(Text_default, { size: "lg", weight: "semibold", children: title || "Nenhum T\xEDtulo de Alerta" }),
|
|
2178
2178
|
/* @__PURE__ */ jsx18(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: message || "Aqui aparecer\xE1 a mensagem do alerta definido pelo usu\xE1rio" })
|
|
@@ -2266,7 +2266,9 @@ var StepWrapper = ({ children }) => /* @__PURE__ */ jsx19("div", { children });
|
|
|
2266
2266
|
var AlertsManager = ({
|
|
2267
2267
|
config,
|
|
2268
2268
|
isOpen = false,
|
|
2269
|
-
onClose
|
|
2269
|
+
onClose,
|
|
2270
|
+
imageLink,
|
|
2271
|
+
defaultImage
|
|
2270
2272
|
}) => {
|
|
2271
2273
|
const [isModalOpen, setIsModalOpen] = useState7(isOpen);
|
|
2272
2274
|
const [currentStep, setCurrentStep] = useState7(0);
|
|
@@ -2425,7 +2427,7 @@ var AlertsManager = ({
|
|
|
2425
2427
|
}
|
|
2426
2428
|
) });
|
|
2427
2429
|
case 3:
|
|
2428
|
-
return /* @__PURE__ */ jsx19(StepWrapper, { children: /* @__PURE__ */ jsx19(PreviewStep, {}) });
|
|
2430
|
+
return /* @__PURE__ */ jsx19(StepWrapper, { children: /* @__PURE__ */ jsx19(PreviewStep, { imageLink, defaultImage }) });
|
|
2429
2431
|
default:
|
|
2430
2432
|
return null;
|
|
2431
2433
|
}
|
|
@@ -2436,7 +2438,9 @@ var AlertsManager = ({
|
|
|
2436
2438
|
labels,
|
|
2437
2439
|
behavior,
|
|
2438
2440
|
handleNext2,
|
|
2439
|
-
handlePrevious
|
|
2441
|
+
handlePrevious,
|
|
2442
|
+
imageLink,
|
|
2443
|
+
defaultImage
|
|
2440
2444
|
]);
|
|
2441
2445
|
const isFirstStep = currentStep === 0;
|
|
2442
2446
|
const isLastStep = currentStep === steps.length - 1;
|
|
@@ -2499,9 +2503,6 @@ var AlertsManager = ({
|
|
|
2499
2503
|
);
|
|
2500
2504
|
};
|
|
2501
2505
|
|
|
2502
|
-
// src/components/AlertManagerView/AlertsManagerView.tsx
|
|
2503
|
-
import { useMemo as useMemo7, useEffect as useEffect8 } from "react";
|
|
2504
|
-
|
|
2505
2506
|
// src/components/Modal/Modal.tsx
|
|
2506
2507
|
import { useEffect as useEffect6, useId as useId5 } from "react";
|
|
2507
2508
|
import { X as X2 } from "phosphor-react";
|
|
@@ -3296,27 +3297,13 @@ var AlertsManagerView = ({
|
|
|
3296
3297
|
alertData,
|
|
3297
3298
|
isOpen = false,
|
|
3298
3299
|
onClose,
|
|
3300
|
+
imageLink,
|
|
3301
|
+
defaultImage,
|
|
3299
3302
|
currentPage = 1,
|
|
3300
3303
|
totalPages: externalTotalPages,
|
|
3301
3304
|
onPageChange,
|
|
3302
3305
|
itemsPerPage = 10
|
|
3303
3306
|
}) => {
|
|
3304
|
-
const imageUrl = useMemo7(() => {
|
|
3305
|
-
if (globalThis.window == void 0) {
|
|
3306
|
-
return void 0;
|
|
3307
|
-
}
|
|
3308
|
-
if (alertData.image instanceof File) {
|
|
3309
|
-
return globalThis.window.URL.createObjectURL(alertData.image);
|
|
3310
|
-
}
|
|
3311
|
-
return void 0;
|
|
3312
|
-
}, [alertData.image]);
|
|
3313
|
-
useEffect8(() => {
|
|
3314
|
-
return () => {
|
|
3315
|
-
if (imageUrl && globalThis.window !== void 0) {
|
|
3316
|
-
URL.revokeObjectURL(imageUrl);
|
|
3317
|
-
}
|
|
3318
|
-
};
|
|
3319
|
-
}, [imageUrl]);
|
|
3320
3307
|
const totalPages = externalTotalPages ?? Math.ceil(alertData.recipients.length / itemsPerPage);
|
|
3321
3308
|
const effectiveCurrentPage = Math.min(totalPages, Math.max(1, currentPage));
|
|
3322
3309
|
const startIndex = (effectiveCurrentPage - 1) * itemsPerPage;
|
|
@@ -3344,10 +3331,10 @@ var AlertsManagerView = ({
|
|
|
3344
3331
|
contentClassName: "p-0",
|
|
3345
3332
|
children: /* @__PURE__ */ jsx25("div", { className: "flex flex-col h-[calc(100vh-8rem)] max-h-[700px]", children: /* @__PURE__ */ jsxs20("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [
|
|
3346
3333
|
/* @__PURE__ */ jsxs20("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl mb-4", children: [
|
|
3347
|
-
/* @__PURE__ */ jsx25(
|
|
3334
|
+
(imageLink || alertData.image || defaultImage) && /* @__PURE__ */ jsx25(
|
|
3348
3335
|
"img",
|
|
3349
3336
|
{
|
|
3350
|
-
src:
|
|
3337
|
+
src: imageLink || alertData.image || defaultImage || void 0,
|
|
3351
3338
|
alt: alertData.title || "Imagem do alerta"
|
|
3352
3339
|
}
|
|
3353
3340
|
),
|
|
@@ -3440,7 +3427,7 @@ import {
|
|
|
3440
3427
|
forwardRef as forwardRef9,
|
|
3441
3428
|
useState as useState9,
|
|
3442
3429
|
useId as useId6,
|
|
3443
|
-
useEffect as
|
|
3430
|
+
useEffect as useEffect8,
|
|
3444
3431
|
useRef as useRef4,
|
|
3445
3432
|
Children as Children3,
|
|
3446
3433
|
cloneElement as cloneElement3,
|
|
@@ -3750,18 +3737,18 @@ var RadioGroup = forwardRef9(
|
|
|
3750
3737
|
);
|
|
3751
3738
|
const store = storeRef.current;
|
|
3752
3739
|
const { setValue } = useStore2(store, (s) => s);
|
|
3753
|
-
|
|
3740
|
+
useEffect8(() => {
|
|
3754
3741
|
const currentValue = store.getState().value;
|
|
3755
3742
|
if (currentValue && onValueChange) {
|
|
3756
3743
|
onValueChange(currentValue);
|
|
3757
3744
|
}
|
|
3758
3745
|
}, []);
|
|
3759
|
-
|
|
3746
|
+
useEffect8(() => {
|
|
3760
3747
|
if (propValue !== void 0) {
|
|
3761
3748
|
setValue(propValue);
|
|
3762
3749
|
}
|
|
3763
3750
|
}, [propValue, setValue]);
|
|
3764
|
-
|
|
3751
|
+
useEffect8(() => {
|
|
3765
3752
|
store.setState({ disabled });
|
|
3766
3753
|
}, [disabled, store]);
|
|
3767
3754
|
return /* @__PURE__ */ jsx26(
|
|
@@ -3948,8 +3935,8 @@ import {
|
|
|
3948
3935
|
forwardRef as forwardRef11,
|
|
3949
3936
|
useState as useState12,
|
|
3950
3937
|
useId as useId7,
|
|
3951
|
-
useMemo as
|
|
3952
|
-
useEffect as
|
|
3938
|
+
useMemo as useMemo7,
|
|
3939
|
+
useEffect as useEffect12,
|
|
3953
3940
|
useRef as useRef6
|
|
3954
3941
|
} from "react";
|
|
3955
3942
|
|
|
@@ -3957,7 +3944,7 @@ import {
|
|
|
3957
3944
|
import { CaretRight as CaretRight4, SignOut, User as User2 } from "phosphor-react";
|
|
3958
3945
|
import {
|
|
3959
3946
|
forwardRef as forwardRef10,
|
|
3960
|
-
useEffect as
|
|
3947
|
+
useEffect as useEffect11,
|
|
3961
3948
|
useRef as useRef5,
|
|
3962
3949
|
isValidElement as isValidElement4,
|
|
3963
3950
|
Children as Children4,
|
|
@@ -3968,10 +3955,10 @@ import { create as create6, useStore as useStore3 } from "zustand";
|
|
|
3968
3955
|
|
|
3969
3956
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
3970
3957
|
import { Moon, Sun } from "phosphor-react";
|
|
3971
|
-
import { useState as useState10, useEffect as
|
|
3958
|
+
import { useState as useState10, useEffect as useEffect10 } from "react";
|
|
3972
3959
|
|
|
3973
3960
|
// src/hooks/useTheme.ts
|
|
3974
|
-
import { useEffect as
|
|
3961
|
+
import { useEffect as useEffect9 } from "react";
|
|
3975
3962
|
|
|
3976
3963
|
// src/store/themeStore.ts
|
|
3977
3964
|
import { create as create5 } from "zustand";
|
|
@@ -4075,7 +4062,7 @@ var useTheme = () => {
|
|
|
4075
4062
|
initializeTheme,
|
|
4076
4063
|
handleSystemThemeChange
|
|
4077
4064
|
} = useThemeStore();
|
|
4078
|
-
|
|
4065
|
+
useEffect9(() => {
|
|
4079
4066
|
initializeTheme();
|
|
4080
4067
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4081
4068
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
@@ -4099,7 +4086,7 @@ var ThemeToggle = ({
|
|
|
4099
4086
|
}) => {
|
|
4100
4087
|
const { themeMode, setTheme } = useTheme();
|
|
4101
4088
|
const [tempTheme, setTempTheme] = useState10(themeMode);
|
|
4102
|
-
|
|
4089
|
+
useEffect10(() => {
|
|
4103
4090
|
setTempTheme(themeMode);
|
|
4104
4091
|
}, [themeMode]);
|
|
4105
4092
|
const problemTypes = [
|
|
@@ -4250,7 +4237,7 @@ var DropdownMenu = ({
|
|
|
4250
4237
|
setOpen(false);
|
|
4251
4238
|
}
|
|
4252
4239
|
};
|
|
4253
|
-
|
|
4240
|
+
useEffect11(() => {
|
|
4254
4241
|
if (open) {
|
|
4255
4242
|
document.addEventListener("pointerdown", handleClickOutside);
|
|
4256
4243
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -4260,10 +4247,10 @@ var DropdownMenu = ({
|
|
|
4260
4247
|
document.removeEventListener("keydown", handleDownkey);
|
|
4261
4248
|
};
|
|
4262
4249
|
}, [open]);
|
|
4263
|
-
|
|
4250
|
+
useEffect11(() => {
|
|
4264
4251
|
onOpenChange?.(open);
|
|
4265
4252
|
}, [open, onOpenChange]);
|
|
4266
|
-
|
|
4253
|
+
useEffect11(() => {
|
|
4267
4254
|
if (propOpen !== void 0) {
|
|
4268
4255
|
setOpen(propOpen);
|
|
4269
4256
|
}
|
|
@@ -4349,7 +4336,7 @@ var DropdownMenuContent = forwardRef10(
|
|
|
4349
4336
|
const store = useDropdownStore(externalStore);
|
|
4350
4337
|
const open = useStore3(store, (s) => s.open);
|
|
4351
4338
|
const [isVisible, setIsVisible] = useState11(open);
|
|
4352
|
-
|
|
4339
|
+
useEffect11(() => {
|
|
4353
4340
|
if (open) {
|
|
4354
4341
|
setIsVisible(true);
|
|
4355
4342
|
} else {
|
|
@@ -4696,7 +4683,7 @@ var Search = forwardRef11(
|
|
|
4696
4683
|
const dropdownStore = useRef6(createDropdownStore()).current;
|
|
4697
4684
|
const dropdownRef = useRef6(null);
|
|
4698
4685
|
const inputElRef = useRef6(null);
|
|
4699
|
-
const filteredOptions =
|
|
4686
|
+
const filteredOptions = useMemo7(() => {
|
|
4700
4687
|
if (!options.length) {
|
|
4701
4688
|
return [];
|
|
4702
4689
|
}
|
|
@@ -4709,7 +4696,7 @@ var Search = forwardRef11(
|
|
|
4709
4696
|
dropdownStore.setState({ open });
|
|
4710
4697
|
onDropdownChange?.(open);
|
|
4711
4698
|
};
|
|
4712
|
-
|
|
4699
|
+
useEffect12(() => {
|
|
4713
4700
|
if (justSelectedRef.current) {
|
|
4714
4701
|
justSelectedRef.current = false;
|
|
4715
4702
|
return;
|
|
@@ -4728,7 +4715,7 @@ var Search = forwardRef11(
|
|
|
4728
4715
|
setOpenAndNotify(false);
|
|
4729
4716
|
updateInputValue(option, ref, onChange);
|
|
4730
4717
|
};
|
|
4731
|
-
|
|
4718
|
+
useEffect12(() => {
|
|
4732
4719
|
const handleClickOutside = (event) => {
|
|
4733
4720
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
4734
4721
|
setOpenAndNotify(false);
|
|
@@ -5871,8 +5858,8 @@ var Stepper_default = Stepper;
|
|
|
5871
5858
|
// src/components/Calendar/Calendar.tsx
|
|
5872
5859
|
import {
|
|
5873
5860
|
useState as useState13,
|
|
5874
|
-
useMemo as
|
|
5875
|
-
useEffect as
|
|
5861
|
+
useMemo as useMemo8,
|
|
5862
|
+
useEffect as useEffect13,
|
|
5876
5863
|
useRef as useRef7
|
|
5877
5864
|
} from "react";
|
|
5878
5865
|
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -5978,7 +5965,7 @@ var Calendar = ({
|
|
|
5978
5965
|
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState13(false);
|
|
5979
5966
|
const monthPickerRef = useRef7(null);
|
|
5980
5967
|
const monthPickerContainerRef = useRef7(null);
|
|
5981
|
-
|
|
5968
|
+
useEffect13(() => {
|
|
5982
5969
|
const handleClickOutside = (event) => {
|
|
5983
5970
|
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
5984
5971
|
setIsMonthPickerOpen(false);
|
|
@@ -5992,7 +5979,7 @@ var Calendar = ({
|
|
|
5992
5979
|
};
|
|
5993
5980
|
}, [isMonthPickerOpen]);
|
|
5994
5981
|
const today = /* @__PURE__ */ new Date();
|
|
5995
|
-
const availableYears =
|
|
5982
|
+
const availableYears = useMemo8(() => {
|
|
5996
5983
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
5997
5984
|
const years = [];
|
|
5998
5985
|
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
@@ -6000,7 +5987,7 @@ var Calendar = ({
|
|
|
6000
5987
|
}
|
|
6001
5988
|
return years;
|
|
6002
5989
|
}, []);
|
|
6003
|
-
const calendarData =
|
|
5990
|
+
const calendarData = useMemo8(() => {
|
|
6004
5991
|
const year = currentDate.getFullYear();
|
|
6005
5992
|
const month = currentDate.getMonth();
|
|
6006
5993
|
const firstDay = new Date(year, month, 1);
|
|
@@ -6373,7 +6360,7 @@ var Calendar_default = Calendar;
|
|
|
6373
6360
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
6374
6361
|
import {
|
|
6375
6362
|
forwardRef as forwardRef12,
|
|
6376
|
-
useEffect as
|
|
6363
|
+
useEffect as useEffect14
|
|
6377
6364
|
} from "react";
|
|
6378
6365
|
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6379
6366
|
var SIZE_CLASSES11 = {
|
|
@@ -6401,7 +6388,7 @@ var AlertDialog = forwardRef12(
|
|
|
6401
6388
|
size = "medium",
|
|
6402
6389
|
...props
|
|
6403
6390
|
}, ref) => {
|
|
6404
|
-
|
|
6391
|
+
useEffect14(() => {
|
|
6405
6392
|
if (!isOpen || !closeOnEscape) return;
|
|
6406
6393
|
const handleEscape = (event) => {
|
|
6407
6394
|
if (event.key === "Escape") {
|
|
@@ -6411,7 +6398,7 @@ var AlertDialog = forwardRef12(
|
|
|
6411
6398
|
document.addEventListener("keydown", handleEscape);
|
|
6412
6399
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
6413
6400
|
}, [isOpen, closeOnEscape]);
|
|
6414
|
-
|
|
6401
|
+
useEffect14(() => {
|
|
6415
6402
|
if (isOpen) {
|
|
6416
6403
|
document.body.style.overflow = "hidden";
|
|
6417
6404
|
} else {
|
|
@@ -6553,7 +6540,7 @@ var loadingModal_default = LoadingModal;
|
|
|
6553
6540
|
|
|
6554
6541
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
6555
6542
|
import { DotsThreeVertical, Bell as Bell2 } from "phosphor-react";
|
|
6556
|
-
import { useState as useState15, useEffect as
|
|
6543
|
+
import { useState as useState15, useEffect as useEffect16 } from "react";
|
|
6557
6544
|
|
|
6558
6545
|
// src/components/Skeleton/Skeleton.tsx
|
|
6559
6546
|
import { forwardRef as forwardRef14 } from "react";
|
|
@@ -6708,7 +6695,7 @@ var SkeletonTable = forwardRef14(
|
|
|
6708
6695
|
);
|
|
6709
6696
|
|
|
6710
6697
|
// src/hooks/useMobile.ts
|
|
6711
|
-
import { useState as useState14, useEffect as
|
|
6698
|
+
import { useState as useState14, useEffect as useEffect15 } from "react";
|
|
6712
6699
|
var MOBILE_WIDTH = 500;
|
|
6713
6700
|
var TABLET_WIDTH = 931;
|
|
6714
6701
|
var SMALL_MOBILE_WIDTH = 425;
|
|
@@ -6733,7 +6720,7 @@ var useMobile = () => {
|
|
|
6733
6720
|
const [isExtraSmallMobile, setIsExtraSmallMobile] = useState14(false);
|
|
6734
6721
|
const [isUltraSmallMobile, setIsUltraSmallMobile] = useState14(false);
|
|
6735
6722
|
const [isTinyMobile, setIsTinyMobile] = useState14(false);
|
|
6736
|
-
|
|
6723
|
+
useEffect15(() => {
|
|
6737
6724
|
const checkScreenSize = () => {
|
|
6738
6725
|
const width = getWindowWidth();
|
|
6739
6726
|
setIsMobile(width < MOBILE_WIDTH);
|
|
@@ -7296,7 +7283,7 @@ var NotificationCenter = ({
|
|
|
7296
7283
|
onToggleActive?.();
|
|
7297
7284
|
}
|
|
7298
7285
|
};
|
|
7299
|
-
|
|
7286
|
+
useEffect16(() => {
|
|
7300
7287
|
if (isActive) {
|
|
7301
7288
|
onFetchNotifications?.();
|
|
7302
7289
|
}
|
|
@@ -8094,7 +8081,7 @@ var FilterModal = ({
|
|
|
8094
8081
|
};
|
|
8095
8082
|
|
|
8096
8083
|
// src/components/Filter/useTableFilter.ts
|
|
8097
|
-
import { useEffect as
|
|
8084
|
+
import { useEffect as useEffect17, useState as useState16, useCallback as useCallback3, useMemo as useMemo9 } from "react";
|
|
8098
8085
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
8099
8086
|
const { syncWithUrl = false } = options;
|
|
8100
8087
|
const getInitialState = useCallback3(() => {
|
|
@@ -8116,7 +8103,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8116
8103
|
return configsWithUrlState;
|
|
8117
8104
|
}, [initialConfigs, syncWithUrl]);
|
|
8118
8105
|
const [filterConfigs, setFilterConfigs] = useState16(getInitialState);
|
|
8119
|
-
const activeFilters =
|
|
8106
|
+
const activeFilters = useMemo9(() => {
|
|
8120
8107
|
const filters = {};
|
|
8121
8108
|
for (const config of filterConfigs) {
|
|
8122
8109
|
for (const category of config.categories) {
|
|
@@ -8169,7 +8156,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8169
8156
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
8170
8157
|
}
|
|
8171
8158
|
}, [filterConfigs, syncWithUrl]);
|
|
8172
|
-
|
|
8159
|
+
useEffect17(() => {
|
|
8173
8160
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8174
8161
|
return;
|
|
8175
8162
|
}
|
|
@@ -8192,7 +8179,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8192
8179
|
// src/components/Select/Select.tsx
|
|
8193
8180
|
import { create as create8, useStore as useStore4 } from "zustand";
|
|
8194
8181
|
import {
|
|
8195
|
-
useEffect as
|
|
8182
|
+
useEffect as useEffect18,
|
|
8196
8183
|
useRef as useRef8,
|
|
8197
8184
|
forwardRef as forwardRef15,
|
|
8198
8185
|
isValidElement as isValidElement5,
|
|
@@ -8323,13 +8310,13 @@ var Select = ({
|
|
|
8323
8310
|
search(children2);
|
|
8324
8311
|
return found;
|
|
8325
8312
|
};
|
|
8326
|
-
|
|
8313
|
+
useEffect18(() => {
|
|
8327
8314
|
if (!selectedLabel && defaultValue) {
|
|
8328
8315
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8329
8316
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8330
8317
|
}
|
|
8331
8318
|
}, [children, defaultValue, selectedLabel]);
|
|
8332
|
-
|
|
8319
|
+
useEffect18(() => {
|
|
8333
8320
|
const handleClickOutside = (event) => {
|
|
8334
8321
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8335
8322
|
setOpen(false);
|
|
@@ -8364,7 +8351,7 @@ var Select = ({
|
|
|
8364
8351
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8365
8352
|
};
|
|
8366
8353
|
}, [open]);
|
|
8367
|
-
|
|
8354
|
+
useEffect18(() => {
|
|
8368
8355
|
if (propValue) {
|
|
8369
8356
|
setValue(propValue);
|
|
8370
8357
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8545,7 +8532,7 @@ var Select_default = Select;
|
|
|
8545
8532
|
// src/components/Menu/Menu.tsx
|
|
8546
8533
|
import { create as create9, useStore as useStore5 } from "zustand";
|
|
8547
8534
|
import {
|
|
8548
|
-
useEffect as
|
|
8535
|
+
useEffect as useEffect19,
|
|
8549
8536
|
useRef as useRef9,
|
|
8550
8537
|
forwardRef as forwardRef16,
|
|
8551
8538
|
isValidElement as isValidElement6,
|
|
@@ -8587,7 +8574,7 @@ var Menu = forwardRef16(
|
|
|
8587
8574
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8588
8575
|
const store = storeRef.current;
|
|
8589
8576
|
const { setValue } = useStore5(store, (s) => s);
|
|
8590
|
-
|
|
8577
|
+
useEffect19(() => {
|
|
8591
8578
|
setValue(propValue ?? defaultValue);
|
|
8592
8579
|
}, [defaultValue, propValue, setValue]);
|
|
8593
8580
|
const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
|
|
@@ -8791,7 +8778,7 @@ var MenuOverflow = ({
|
|
|
8791
8778
|
const containerRef = useRef9(null);
|
|
8792
8779
|
const [showLeftArrow, setShowLeftArrow] = useState17(false);
|
|
8793
8780
|
const [showRightArrow, setShowRightArrow] = useState17(false);
|
|
8794
|
-
|
|
8781
|
+
useEffect19(() => {
|
|
8795
8782
|
const checkScroll = () => internalCheckScroll(
|
|
8796
8783
|
containerRef.current,
|
|
8797
8784
|
setShowLeftArrow,
|
|
@@ -8868,7 +8855,7 @@ import {
|
|
|
8868
8855
|
Fragment as Fragment8,
|
|
8869
8856
|
useState as useState18,
|
|
8870
8857
|
useRef as useRef10,
|
|
8871
|
-
useEffect as
|
|
8858
|
+
useEffect as useEffect20
|
|
8872
8859
|
} from "react";
|
|
8873
8860
|
import {
|
|
8874
8861
|
CaretRight as CaretRight6,
|
|
@@ -9720,7 +9707,7 @@ var CardAudio = forwardRef17(
|
|
|
9720
9707
|
}
|
|
9721
9708
|
return /* @__PURE__ */ jsx52(SpeakerHigh, { size: 24 });
|
|
9722
9709
|
};
|
|
9723
|
-
|
|
9710
|
+
useEffect20(() => {
|
|
9724
9711
|
const handleClickOutside = (event) => {
|
|
9725
9712
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9726
9713
|
setShowVolumeControl(false);
|
|
@@ -10447,7 +10434,7 @@ var NotFound_default = NotFound;
|
|
|
10447
10434
|
import {
|
|
10448
10435
|
useRef as useRef11,
|
|
10449
10436
|
useState as useState20,
|
|
10450
|
-
useEffect as
|
|
10437
|
+
useEffect as useEffect21,
|
|
10451
10438
|
useCallback as useCallback5
|
|
10452
10439
|
} from "react";
|
|
10453
10440
|
import { createPortal } from "react-dom";
|
|
@@ -10735,7 +10722,7 @@ var SpeedMenu = ({
|
|
|
10735
10722
|
};
|
|
10736
10723
|
};
|
|
10737
10724
|
const position = getMenuPosition();
|
|
10738
|
-
|
|
10725
|
+
useEffect21(() => {
|
|
10739
10726
|
const handleClickOutside = (event) => {
|
|
10740
10727
|
const target = event.target;
|
|
10741
10728
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10826,7 +10813,7 @@ var VideoPlayer = ({
|
|
|
10826
10813
|
const [hasCompleted, setHasCompleted] = useState20(false);
|
|
10827
10814
|
const [showCaptions, setShowCaptions] = useState20(false);
|
|
10828
10815
|
const [subtitlesValidation, setSubtitlesValidation] = useState20("idle");
|
|
10829
|
-
|
|
10816
|
+
useEffect21(() => {
|
|
10830
10817
|
setHasCompleted(false);
|
|
10831
10818
|
}, [src]);
|
|
10832
10819
|
const [playbackRate, setPlaybackRate] = useState20(1);
|
|
@@ -10898,13 +10885,13 @@ var VideoPlayer = ({
|
|
|
10898
10885
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10899
10886
|
}
|
|
10900
10887
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10901
|
-
|
|
10888
|
+
useEffect21(() => {
|
|
10902
10889
|
if (videoRef.current) {
|
|
10903
10890
|
videoRef.current.volume = volume;
|
|
10904
10891
|
videoRef.current.muted = isMuted;
|
|
10905
10892
|
}
|
|
10906
10893
|
}, [volume, isMuted]);
|
|
10907
|
-
|
|
10894
|
+
useEffect21(() => {
|
|
10908
10895
|
const video = videoRef.current;
|
|
10909
10896
|
if (!video) return;
|
|
10910
10897
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10919,13 +10906,13 @@ var VideoPlayer = ({
|
|
|
10919
10906
|
video.removeEventListener("ended", onEnded);
|
|
10920
10907
|
};
|
|
10921
10908
|
}, []);
|
|
10922
|
-
|
|
10909
|
+
useEffect21(() => {
|
|
10923
10910
|
const video = videoRef.current;
|
|
10924
10911
|
if (!video) return;
|
|
10925
10912
|
video.setAttribute("playsinline", "");
|
|
10926
10913
|
video.setAttribute("webkit-playsinline", "");
|
|
10927
10914
|
}, []);
|
|
10928
|
-
|
|
10915
|
+
useEffect21(() => {
|
|
10929
10916
|
if (isPlaying) {
|
|
10930
10917
|
showControlsWithTimer();
|
|
10931
10918
|
} else {
|
|
@@ -10937,7 +10924,7 @@ var VideoPlayer = ({
|
|
|
10937
10924
|
}
|
|
10938
10925
|
}
|
|
10939
10926
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10940
|
-
|
|
10927
|
+
useEffect21(() => {
|
|
10941
10928
|
const video = videoRef.current;
|
|
10942
10929
|
if (!video) return;
|
|
10943
10930
|
const handleFullscreenChange = () => {
|
|
@@ -10972,7 +10959,7 @@ var VideoPlayer = ({
|
|
|
10972
10959
|
);
|
|
10973
10960
|
};
|
|
10974
10961
|
}, [showControlsWithTimer]);
|
|
10975
|
-
|
|
10962
|
+
useEffect21(() => {
|
|
10976
10963
|
const init = () => {
|
|
10977
10964
|
if (!isFullscreen) {
|
|
10978
10965
|
showControlsWithTimer();
|
|
@@ -11007,7 +10994,7 @@ var VideoPlayer = ({
|
|
|
11007
10994
|
if (hasValidSaved) return saved;
|
|
11008
10995
|
return void 0;
|
|
11009
10996
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11010
|
-
|
|
10997
|
+
useEffect21(() => {
|
|
11011
10998
|
const start = getInitialTime();
|
|
11012
10999
|
if (start !== void 0 && videoRef.current) {
|
|
11013
11000
|
videoRef.current.currentTime = start;
|
|
@@ -11144,7 +11131,7 @@ var VideoPlayer = ({
|
|
|
11144
11131
|
setDuration(videoRef.current.duration);
|
|
11145
11132
|
}
|
|
11146
11133
|
}, []);
|
|
11147
|
-
|
|
11134
|
+
useEffect21(() => {
|
|
11148
11135
|
const controller = new AbortController();
|
|
11149
11136
|
const validateSubtitles = async () => {
|
|
11150
11137
|
if (!subtitles) {
|
|
@@ -11191,12 +11178,12 @@ var VideoPlayer = ({
|
|
|
11191
11178
|
controller.abort();
|
|
11192
11179
|
};
|
|
11193
11180
|
}, [subtitles]);
|
|
11194
|
-
|
|
11181
|
+
useEffect21(() => {
|
|
11195
11182
|
if (trackRef.current?.track) {
|
|
11196
11183
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11197
11184
|
}
|
|
11198
11185
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11199
|
-
|
|
11186
|
+
useEffect21(() => {
|
|
11200
11187
|
const handleVisibilityChange = () => {
|
|
11201
11188
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11202
11189
|
videoRef.current.pause();
|
|
@@ -11629,10 +11616,10 @@ var Whiteboard_default = Whiteboard;
|
|
|
11629
11616
|
import {
|
|
11630
11617
|
createContext,
|
|
11631
11618
|
useContext,
|
|
11632
|
-
useEffect as
|
|
11619
|
+
useEffect as useEffect22,
|
|
11633
11620
|
useState as useState22,
|
|
11634
11621
|
useCallback as useCallback7,
|
|
11635
|
-
useMemo as
|
|
11622
|
+
useMemo as useMemo10
|
|
11636
11623
|
} from "react";
|
|
11637
11624
|
import { useLocation, Navigate } from "react-router-dom";
|
|
11638
11625
|
import { Fragment as Fragment11, jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -11694,10 +11681,10 @@ var AuthProvider = ({
|
|
|
11694
11681
|
tokens: void 0
|
|
11695
11682
|
}));
|
|
11696
11683
|
}, [signOutFn]);
|
|
11697
|
-
|
|
11684
|
+
useEffect22(() => {
|
|
11698
11685
|
checkAuth();
|
|
11699
11686
|
}, [checkAuth]);
|
|
11700
|
-
const contextValue =
|
|
11687
|
+
const contextValue = useMemo10(
|
|
11701
11688
|
() => ({
|
|
11702
11689
|
...authState,
|
|
11703
11690
|
checkAuth,
|
|
@@ -11810,7 +11797,7 @@ import {
|
|
|
11810
11797
|
forwardRef as forwardRef18,
|
|
11811
11798
|
useId as useId9,
|
|
11812
11799
|
useState as useState23,
|
|
11813
|
-
useEffect as
|
|
11800
|
+
useEffect as useEffect23
|
|
11814
11801
|
} from "react";
|
|
11815
11802
|
import { CaretRight as CaretRight7 } from "phosphor-react";
|
|
11816
11803
|
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -11832,7 +11819,7 @@ var CardAccordation = forwardRef18(
|
|
|
11832
11819
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11833
11820
|
const isControlled = controlledExpanded !== void 0;
|
|
11834
11821
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11835
|
-
|
|
11822
|
+
useEffect23(() => {
|
|
11836
11823
|
if (isControlled) {
|
|
11837
11824
|
setInternalExpanded(controlledExpanded);
|
|
11838
11825
|
}
|
|
@@ -11923,7 +11910,7 @@ import {
|
|
|
11923
11910
|
cloneElement as cloneElement8,
|
|
11924
11911
|
forwardRef as forwardRef19,
|
|
11925
11912
|
isValidElement as isValidElement7,
|
|
11926
|
-
useEffect as
|
|
11913
|
+
useEffect as useEffect24,
|
|
11927
11914
|
useRef as useRef12,
|
|
11928
11915
|
useState as useState24
|
|
11929
11916
|
} from "react";
|
|
@@ -12019,10 +12006,10 @@ var AccordionGroup = forwardRef19(
|
|
|
12019
12006
|
);
|
|
12020
12007
|
}
|
|
12021
12008
|
const store = storeRef.current;
|
|
12022
|
-
|
|
12009
|
+
useEffect24(() => {
|
|
12023
12010
|
store.setState({ value: currentValue });
|
|
12024
12011
|
}, [currentValue, store]);
|
|
12025
|
-
|
|
12012
|
+
useEffect24(() => {
|
|
12026
12013
|
if (!isControlled) {
|
|
12027
12014
|
setInternalValue((prev) => {
|
|
12028
12015
|
if (type === "single") {
|
|
@@ -12376,7 +12363,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12376
12363
|
}
|
|
12377
12364
|
|
|
12378
12365
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12379
|
-
import { useEffect as
|
|
12366
|
+
import { useEffect as useEffect25, useRef as useRef13 } from "react";
|
|
12380
12367
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
12381
12368
|
var getAuthParams = (location, extractParams) => {
|
|
12382
12369
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12425,7 +12412,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12425
12412
|
function useUrlAuthentication(options) {
|
|
12426
12413
|
const location = useLocation2();
|
|
12427
12414
|
const processedRef = useRef13(false);
|
|
12428
|
-
|
|
12415
|
+
useEffect25(() => {
|
|
12429
12416
|
const handleAuthentication = async () => {
|
|
12430
12417
|
if (processedRef.current) {
|
|
12431
12418
|
return;
|
|
@@ -12496,9 +12483,9 @@ function useUrlAuthentication(options) {
|
|
|
12496
12483
|
}
|
|
12497
12484
|
|
|
12498
12485
|
// src/components/Auth/useApiConfig.ts
|
|
12499
|
-
import { useMemo as
|
|
12486
|
+
import { useMemo as useMemo11 } from "react";
|
|
12500
12487
|
function useApiConfig(api) {
|
|
12501
|
-
return
|
|
12488
|
+
return useMemo11(
|
|
12502
12489
|
() => ({
|
|
12503
12490
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12504
12491
|
}),
|
|
@@ -12516,7 +12503,7 @@ import {
|
|
|
12516
12503
|
} from "phosphor-react";
|
|
12517
12504
|
import {
|
|
12518
12505
|
forwardRef as forwardRef22,
|
|
12519
|
-
useEffect as
|
|
12506
|
+
useEffect as useEffect28,
|
|
12520
12507
|
useState as useState28
|
|
12521
12508
|
} from "react";
|
|
12522
12509
|
|
|
@@ -13131,15 +13118,15 @@ var useQuizStore = create11()(
|
|
|
13131
13118
|
import {
|
|
13132
13119
|
forwardRef as forwardRef21,
|
|
13133
13120
|
useCallback as useCallback8,
|
|
13134
|
-
useEffect as
|
|
13121
|
+
useEffect as useEffect27,
|
|
13135
13122
|
useId as useId11,
|
|
13136
|
-
useMemo as
|
|
13123
|
+
useMemo as useMemo12,
|
|
13137
13124
|
useRef as useRef14,
|
|
13138
13125
|
useState as useState27
|
|
13139
13126
|
} from "react";
|
|
13140
13127
|
|
|
13141
13128
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13142
|
-
import { useEffect as
|
|
13129
|
+
import { useEffect as useEffect26, useState as useState26 } from "react";
|
|
13143
13130
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
13144
13131
|
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13145
13132
|
var MultipleChoiceList = ({
|
|
@@ -13152,7 +13139,7 @@ var MultipleChoiceList = ({
|
|
|
13152
13139
|
mode = "interactive"
|
|
13153
13140
|
}) => {
|
|
13154
13141
|
const [actualValue, setActualValue] = useState26(selectedValues);
|
|
13155
|
-
|
|
13142
|
+
useEffect26(() => {
|
|
13156
13143
|
setActualValue(selectedValues);
|
|
13157
13144
|
}, [selectedValues]);
|
|
13158
13145
|
const getStatusBadge2 = (status) => {
|
|
@@ -13393,13 +13380,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13393
13380
|
);
|
|
13394
13381
|
const prevSelectedValuesRef = useRef14([]);
|
|
13395
13382
|
const prevQuestionIdRef = useRef14("");
|
|
13396
|
-
const allCurrentAnswerIds =
|
|
13383
|
+
const allCurrentAnswerIds = useMemo12(() => {
|
|
13397
13384
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13398
13385
|
}, [allCurrentAnswers]);
|
|
13399
|
-
const selectedValues =
|
|
13386
|
+
const selectedValues = useMemo12(() => {
|
|
13400
13387
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13401
13388
|
}, [allCurrentAnswerIds]);
|
|
13402
|
-
const stableSelectedValues =
|
|
13389
|
+
const stableSelectedValues = useMemo12(() => {
|
|
13403
13390
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13404
13391
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13405
13392
|
if (hasQuestionChanged) {
|
|
@@ -13431,7 +13418,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13431
13418
|
},
|
|
13432
13419
|
[currentQuestion, selectMultipleAnswer]
|
|
13433
13420
|
);
|
|
13434
|
-
const questionKey =
|
|
13421
|
+
const questionKey = useMemo12(
|
|
13435
13422
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13436
13423
|
[currentQuestion?.id]
|
|
13437
13424
|
);
|
|
@@ -13509,7 +13496,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13509
13496
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13510
13497
|
}
|
|
13511
13498
|
}, []);
|
|
13512
|
-
|
|
13499
|
+
useEffect27(() => {
|
|
13513
13500
|
adjustTextareaHeight();
|
|
13514
13501
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13515
13502
|
if (!currentQuestion) {
|
|
@@ -14077,7 +14064,7 @@ var getFinishConfirmationText = (type) => {
|
|
|
14077
14064
|
};
|
|
14078
14065
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
14079
14066
|
const { setVariant } = useQuizStore();
|
|
14080
|
-
|
|
14067
|
+
useEffect28(() => {
|
|
14081
14068
|
setVariant(variant);
|
|
14082
14069
|
}, [variant, setVariant]);
|
|
14083
14070
|
return /* @__PURE__ */ jsx64("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
@@ -14638,7 +14625,7 @@ var QuizFooter = forwardRef22(
|
|
|
14638
14625
|
);
|
|
14639
14626
|
|
|
14640
14627
|
// src/components/Quiz/QuizResult.tsx
|
|
14641
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
14628
|
+
import { forwardRef as forwardRef23, useEffect as useEffect29, useState as useState29 } from "react";
|
|
14642
14629
|
import { Clock as Clock3 } from "phosphor-react";
|
|
14643
14630
|
import { jsx as jsx65, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14644
14631
|
var QuizBadge = ({
|
|
@@ -14668,7 +14655,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14668
14655
|
questionsResult
|
|
14669
14656
|
} = useQuizStore();
|
|
14670
14657
|
const [status, setStatus] = useState29(void 0);
|
|
14671
|
-
|
|
14658
|
+
useEffect29(() => {
|
|
14672
14659
|
const cq = getCurrentQuestion();
|
|
14673
14660
|
if (!cq) {
|
|
14674
14661
|
setStatus(void 0);
|
|
@@ -15041,7 +15028,7 @@ var BreadcrumbMenu = ({
|
|
|
15041
15028
|
};
|
|
15042
15029
|
|
|
15043
15030
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15044
|
-
import { useEffect as
|
|
15031
|
+
import { useEffect as useEffect30 } from "react";
|
|
15045
15032
|
|
|
15046
15033
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15047
15034
|
import { create as create12 } from "zustand";
|
|
@@ -15170,7 +15157,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15170
15157
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15171
15158
|
);
|
|
15172
15159
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15173
|
-
|
|
15160
|
+
useEffect30(() => {
|
|
15174
15161
|
const newBreadcrumbs = [root];
|
|
15175
15162
|
const previousIds = [];
|
|
15176
15163
|
for (const level of levels) {
|
|
@@ -15202,11 +15189,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15202
15189
|
};
|
|
15203
15190
|
|
|
15204
15191
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15205
|
-
import { useMemo as
|
|
15192
|
+
import { useMemo as useMemo13 } from "react";
|
|
15206
15193
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
15207
15194
|
var useUrlParams = (config) => {
|
|
15208
15195
|
const location = useLocation3();
|
|
15209
|
-
return
|
|
15196
|
+
return useMemo13(() => {
|
|
15210
15197
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15211
15198
|
const params = {};
|
|
15212
15199
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15217,15 +15204,15 @@ var useUrlParams = (config) => {
|
|
|
15217
15204
|
};
|
|
15218
15205
|
|
|
15219
15206
|
// src/hooks/useAppInitialization.ts
|
|
15220
|
-
import { useMemo as
|
|
15207
|
+
import { useMemo as useMemo14 } from "react";
|
|
15221
15208
|
|
|
15222
15209
|
// src/hooks/useInstitution.ts
|
|
15223
|
-
import { useEffect as
|
|
15210
|
+
import { useEffect as useEffect31, useState as useState30 } from "react";
|
|
15224
15211
|
function useInstitutionId() {
|
|
15225
15212
|
const [institutionId, setInstitutionId] = useState30(() => {
|
|
15226
15213
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15227
15214
|
});
|
|
15228
|
-
|
|
15215
|
+
useEffect31(() => {
|
|
15229
15216
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15230
15217
|
if (!metaTag) return;
|
|
15231
15218
|
const observer = new MutationObserver(() => {
|
|
@@ -15392,7 +15379,7 @@ var useAuthStore = create14()(
|
|
|
15392
15379
|
function useAppInitialization() {
|
|
15393
15380
|
const getInstitutionId = useInstitutionId();
|
|
15394
15381
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15395
|
-
const authFunctions =
|
|
15382
|
+
const authFunctions = useMemo14(
|
|
15396
15383
|
() => ({
|
|
15397
15384
|
checkAuth: async () => {
|
|
15398
15385
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15429,7 +15416,7 @@ function useAppInitialization() {
|
|
|
15429
15416
|
}
|
|
15430
15417
|
|
|
15431
15418
|
// src/hooks/useAppContent.ts
|
|
15432
|
-
import { useCallback as useCallback9, useEffect as
|
|
15419
|
+
import { useCallback as useCallback9, useEffect as useEffect32, useMemo as useMemo15 } from "react";
|
|
15433
15420
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
15434
15421
|
function useAppContent(config) {
|
|
15435
15422
|
const navigate = useNavigate2();
|
|
@@ -15479,7 +15466,7 @@ function useAppContent(config) {
|
|
|
15479
15466
|
},
|
|
15480
15467
|
[navigate, onError]
|
|
15481
15468
|
);
|
|
15482
|
-
const urlAuthConfig =
|
|
15469
|
+
const urlAuthConfig = useMemo15(
|
|
15483
15470
|
() => ({
|
|
15484
15471
|
setTokens,
|
|
15485
15472
|
setSessionInfo,
|
|
@@ -15505,10 +15492,10 @@ function useAppContent(config) {
|
|
|
15505
15492
|
);
|
|
15506
15493
|
useUrlAuthentication(urlAuthConfig);
|
|
15507
15494
|
const { sessionInfo } = useAuth();
|
|
15508
|
-
const institutionIdToUse =
|
|
15495
|
+
const institutionIdToUse = useMemo15(() => {
|
|
15509
15496
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15510
15497
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15511
|
-
|
|
15498
|
+
useEffect32(() => {
|
|
15512
15499
|
if (institutionIdToUse && !initialized) {
|
|
15513
15500
|
initialize(institutionIdToUse);
|
|
15514
15501
|
}
|