analytica-frontend-lib 1.2.17 → 1.2.19
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 +66 -16
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +66 -16
- 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/DropdownMenu/index.d.mts +7 -1
- package/dist/DropdownMenu/index.d.ts +7 -1
- package/dist/DropdownMenu/index.js +51 -5
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +50 -5
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +49 -5
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +49 -5
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Search/index.js +49 -5
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +49 -5
- package/dist/Search/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +394 -361
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +164 -132
- 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 {
|
|
@@ -4506,10 +4493,13 @@ var ProfileMenuHeader = forwardRef10(({ className, name, email, photoUrl, store:
|
|
|
4506
4493
|
{
|
|
4507
4494
|
ref,
|
|
4508
4495
|
"data-component": "ProfileMenuHeader",
|
|
4509
|
-
className: cn(
|
|
4496
|
+
className: cn(
|
|
4497
|
+
"flex flex-row gap-4 items-center min-w-[280px]",
|
|
4498
|
+
className
|
|
4499
|
+
),
|
|
4510
4500
|
...props,
|
|
4511
4501
|
children: [
|
|
4512
|
-
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden", children: photoUrl ? /* @__PURE__ */ jsx30(
|
|
4502
|
+
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0", children: photoUrl ? /* @__PURE__ */ jsx30(
|
|
4513
4503
|
"img",
|
|
4514
4504
|
{
|
|
4515
4505
|
src: photoUrl,
|
|
@@ -4517,15 +4507,56 @@ var ProfileMenuHeader = forwardRef10(({ className, name, email, photoUrl, store:
|
|
|
4517
4507
|
className: "w-full h-full object-cover"
|
|
4518
4508
|
}
|
|
4519
4509
|
) : /* @__PURE__ */ jsx30(User2, { size: 34, className: "text-primary-800" }) }),
|
|
4520
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col ", children: [
|
|
4521
|
-
/* @__PURE__ */ jsx30(
|
|
4522
|
-
|
|
4510
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col min-w-0", children: [
|
|
4511
|
+
/* @__PURE__ */ jsx30(
|
|
4512
|
+
Text_default,
|
|
4513
|
+
{
|
|
4514
|
+
size: "xl",
|
|
4515
|
+
weight: "bold",
|
|
4516
|
+
color: "text-text-950",
|
|
4517
|
+
className: "truncate",
|
|
4518
|
+
children: name
|
|
4519
|
+
}
|
|
4520
|
+
),
|
|
4521
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
|
|
4523
4522
|
] })
|
|
4524
4523
|
]
|
|
4525
4524
|
}
|
|
4526
4525
|
);
|
|
4527
4526
|
});
|
|
4528
4527
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
4528
|
+
var ProfileMenuInfo = forwardRef10(
|
|
4529
|
+
({
|
|
4530
|
+
className,
|
|
4531
|
+
schoolName,
|
|
4532
|
+
classYearName,
|
|
4533
|
+
schoolYearName,
|
|
4534
|
+
store: _store,
|
|
4535
|
+
...props
|
|
4536
|
+
}, ref) => {
|
|
4537
|
+
return /* @__PURE__ */ jsxs23(
|
|
4538
|
+
"div",
|
|
4539
|
+
{
|
|
4540
|
+
ref,
|
|
4541
|
+
"data-component": "ProfileMenuInfo",
|
|
4542
|
+
className: cn("flex flex-row gap-4 items-center", className),
|
|
4543
|
+
...props,
|
|
4544
|
+
children: [
|
|
4545
|
+
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16" }),
|
|
4546
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col ", children: [
|
|
4547
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
|
|
4548
|
+
/* @__PURE__ */ jsxs23("span", { className: "flex flex-row items-center gap-2", children: [
|
|
4549
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
|
|
4550
|
+
/* @__PURE__ */ jsx30("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
|
|
4551
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
|
|
4552
|
+
] })
|
|
4553
|
+
] })
|
|
4554
|
+
]
|
|
4555
|
+
}
|
|
4556
|
+
);
|
|
4557
|
+
}
|
|
4558
|
+
);
|
|
4559
|
+
ProfileMenuInfo.displayName = "ProfileMenuInfo";
|
|
4529
4560
|
var ProfileToggleTheme = ({
|
|
4530
4561
|
store: externalStore,
|
|
4531
4562
|
...props
|
|
@@ -4696,7 +4727,7 @@ var Search = forwardRef11(
|
|
|
4696
4727
|
const dropdownStore = useRef6(createDropdownStore()).current;
|
|
4697
4728
|
const dropdownRef = useRef6(null);
|
|
4698
4729
|
const inputElRef = useRef6(null);
|
|
4699
|
-
const filteredOptions =
|
|
4730
|
+
const filteredOptions = useMemo7(() => {
|
|
4700
4731
|
if (!options.length) {
|
|
4701
4732
|
return [];
|
|
4702
4733
|
}
|
|
@@ -4709,7 +4740,7 @@ var Search = forwardRef11(
|
|
|
4709
4740
|
dropdownStore.setState({ open });
|
|
4710
4741
|
onDropdownChange?.(open);
|
|
4711
4742
|
};
|
|
4712
|
-
|
|
4743
|
+
useEffect12(() => {
|
|
4713
4744
|
if (justSelectedRef.current) {
|
|
4714
4745
|
justSelectedRef.current = false;
|
|
4715
4746
|
return;
|
|
@@ -4728,7 +4759,7 @@ var Search = forwardRef11(
|
|
|
4728
4759
|
setOpenAndNotify(false);
|
|
4729
4760
|
updateInputValue(option, ref, onChange);
|
|
4730
4761
|
};
|
|
4731
|
-
|
|
4762
|
+
useEffect12(() => {
|
|
4732
4763
|
const handleClickOutside = (event) => {
|
|
4733
4764
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
4734
4765
|
setOpenAndNotify(false);
|
|
@@ -5871,8 +5902,8 @@ var Stepper_default = Stepper;
|
|
|
5871
5902
|
// src/components/Calendar/Calendar.tsx
|
|
5872
5903
|
import {
|
|
5873
5904
|
useState as useState13,
|
|
5874
|
-
useMemo as
|
|
5875
|
-
useEffect as
|
|
5905
|
+
useMemo as useMemo8,
|
|
5906
|
+
useEffect as useEffect13,
|
|
5876
5907
|
useRef as useRef7
|
|
5877
5908
|
} from "react";
|
|
5878
5909
|
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -5978,7 +6009,7 @@ var Calendar = ({
|
|
|
5978
6009
|
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState13(false);
|
|
5979
6010
|
const monthPickerRef = useRef7(null);
|
|
5980
6011
|
const monthPickerContainerRef = useRef7(null);
|
|
5981
|
-
|
|
6012
|
+
useEffect13(() => {
|
|
5982
6013
|
const handleClickOutside = (event) => {
|
|
5983
6014
|
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
5984
6015
|
setIsMonthPickerOpen(false);
|
|
@@ -5992,7 +6023,7 @@ var Calendar = ({
|
|
|
5992
6023
|
};
|
|
5993
6024
|
}, [isMonthPickerOpen]);
|
|
5994
6025
|
const today = /* @__PURE__ */ new Date();
|
|
5995
|
-
const availableYears =
|
|
6026
|
+
const availableYears = useMemo8(() => {
|
|
5996
6027
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
5997
6028
|
const years = [];
|
|
5998
6029
|
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
@@ -6000,7 +6031,7 @@ var Calendar = ({
|
|
|
6000
6031
|
}
|
|
6001
6032
|
return years;
|
|
6002
6033
|
}, []);
|
|
6003
|
-
const calendarData =
|
|
6034
|
+
const calendarData = useMemo8(() => {
|
|
6004
6035
|
const year = currentDate.getFullYear();
|
|
6005
6036
|
const month = currentDate.getMonth();
|
|
6006
6037
|
const firstDay = new Date(year, month, 1);
|
|
@@ -6373,7 +6404,7 @@ var Calendar_default = Calendar;
|
|
|
6373
6404
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
6374
6405
|
import {
|
|
6375
6406
|
forwardRef as forwardRef12,
|
|
6376
|
-
useEffect as
|
|
6407
|
+
useEffect as useEffect14
|
|
6377
6408
|
} from "react";
|
|
6378
6409
|
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6379
6410
|
var SIZE_CLASSES11 = {
|
|
@@ -6401,7 +6432,7 @@ var AlertDialog = forwardRef12(
|
|
|
6401
6432
|
size = "medium",
|
|
6402
6433
|
...props
|
|
6403
6434
|
}, ref) => {
|
|
6404
|
-
|
|
6435
|
+
useEffect14(() => {
|
|
6405
6436
|
if (!isOpen || !closeOnEscape) return;
|
|
6406
6437
|
const handleEscape = (event) => {
|
|
6407
6438
|
if (event.key === "Escape") {
|
|
@@ -6411,7 +6442,7 @@ var AlertDialog = forwardRef12(
|
|
|
6411
6442
|
document.addEventListener("keydown", handleEscape);
|
|
6412
6443
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
6413
6444
|
}, [isOpen, closeOnEscape]);
|
|
6414
|
-
|
|
6445
|
+
useEffect14(() => {
|
|
6415
6446
|
if (isOpen) {
|
|
6416
6447
|
document.body.style.overflow = "hidden";
|
|
6417
6448
|
} else {
|
|
@@ -6553,7 +6584,7 @@ var loadingModal_default = LoadingModal;
|
|
|
6553
6584
|
|
|
6554
6585
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
6555
6586
|
import { DotsThreeVertical, Bell as Bell2 } from "phosphor-react";
|
|
6556
|
-
import { useState as useState15, useEffect as
|
|
6587
|
+
import { useState as useState15, useEffect as useEffect16 } from "react";
|
|
6557
6588
|
|
|
6558
6589
|
// src/components/Skeleton/Skeleton.tsx
|
|
6559
6590
|
import { forwardRef as forwardRef14 } from "react";
|
|
@@ -6708,7 +6739,7 @@ var SkeletonTable = forwardRef14(
|
|
|
6708
6739
|
);
|
|
6709
6740
|
|
|
6710
6741
|
// src/hooks/useMobile.ts
|
|
6711
|
-
import { useState as useState14, useEffect as
|
|
6742
|
+
import { useState as useState14, useEffect as useEffect15 } from "react";
|
|
6712
6743
|
var MOBILE_WIDTH = 500;
|
|
6713
6744
|
var TABLET_WIDTH = 931;
|
|
6714
6745
|
var SMALL_MOBILE_WIDTH = 425;
|
|
@@ -6733,7 +6764,7 @@ var useMobile = () => {
|
|
|
6733
6764
|
const [isExtraSmallMobile, setIsExtraSmallMobile] = useState14(false);
|
|
6734
6765
|
const [isUltraSmallMobile, setIsUltraSmallMobile] = useState14(false);
|
|
6735
6766
|
const [isTinyMobile, setIsTinyMobile] = useState14(false);
|
|
6736
|
-
|
|
6767
|
+
useEffect15(() => {
|
|
6737
6768
|
const checkScreenSize = () => {
|
|
6738
6769
|
const width = getWindowWidth();
|
|
6739
6770
|
setIsMobile(width < MOBILE_WIDTH);
|
|
@@ -7296,7 +7327,7 @@ var NotificationCenter = ({
|
|
|
7296
7327
|
onToggleActive?.();
|
|
7297
7328
|
}
|
|
7298
7329
|
};
|
|
7299
|
-
|
|
7330
|
+
useEffect16(() => {
|
|
7300
7331
|
if (isActive) {
|
|
7301
7332
|
onFetchNotifications?.();
|
|
7302
7333
|
}
|
|
@@ -8094,7 +8125,7 @@ var FilterModal = ({
|
|
|
8094
8125
|
};
|
|
8095
8126
|
|
|
8096
8127
|
// src/components/Filter/useTableFilter.ts
|
|
8097
|
-
import { useEffect as
|
|
8128
|
+
import { useEffect as useEffect17, useState as useState16, useCallback as useCallback3, useMemo as useMemo9 } from "react";
|
|
8098
8129
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
8099
8130
|
const { syncWithUrl = false } = options;
|
|
8100
8131
|
const getInitialState = useCallback3(() => {
|
|
@@ -8116,7 +8147,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8116
8147
|
return configsWithUrlState;
|
|
8117
8148
|
}, [initialConfigs, syncWithUrl]);
|
|
8118
8149
|
const [filterConfigs, setFilterConfigs] = useState16(getInitialState);
|
|
8119
|
-
const activeFilters =
|
|
8150
|
+
const activeFilters = useMemo9(() => {
|
|
8120
8151
|
const filters = {};
|
|
8121
8152
|
for (const config of filterConfigs) {
|
|
8122
8153
|
for (const category of config.categories) {
|
|
@@ -8169,7 +8200,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8169
8200
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
8170
8201
|
}
|
|
8171
8202
|
}, [filterConfigs, syncWithUrl]);
|
|
8172
|
-
|
|
8203
|
+
useEffect17(() => {
|
|
8173
8204
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8174
8205
|
return;
|
|
8175
8206
|
}
|
|
@@ -8192,7 +8223,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8192
8223
|
// src/components/Select/Select.tsx
|
|
8193
8224
|
import { create as create8, useStore as useStore4 } from "zustand";
|
|
8194
8225
|
import {
|
|
8195
|
-
useEffect as
|
|
8226
|
+
useEffect as useEffect18,
|
|
8196
8227
|
useRef as useRef8,
|
|
8197
8228
|
forwardRef as forwardRef15,
|
|
8198
8229
|
isValidElement as isValidElement5,
|
|
@@ -8323,13 +8354,13 @@ var Select = ({
|
|
|
8323
8354
|
search(children2);
|
|
8324
8355
|
return found;
|
|
8325
8356
|
};
|
|
8326
|
-
|
|
8357
|
+
useEffect18(() => {
|
|
8327
8358
|
if (!selectedLabel && defaultValue) {
|
|
8328
8359
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8329
8360
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8330
8361
|
}
|
|
8331
8362
|
}, [children, defaultValue, selectedLabel]);
|
|
8332
|
-
|
|
8363
|
+
useEffect18(() => {
|
|
8333
8364
|
const handleClickOutside = (event) => {
|
|
8334
8365
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8335
8366
|
setOpen(false);
|
|
@@ -8364,7 +8395,7 @@ var Select = ({
|
|
|
8364
8395
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8365
8396
|
};
|
|
8366
8397
|
}, [open]);
|
|
8367
|
-
|
|
8398
|
+
useEffect18(() => {
|
|
8368
8399
|
if (propValue) {
|
|
8369
8400
|
setValue(propValue);
|
|
8370
8401
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8545,7 +8576,7 @@ var Select_default = Select;
|
|
|
8545
8576
|
// src/components/Menu/Menu.tsx
|
|
8546
8577
|
import { create as create9, useStore as useStore5 } from "zustand";
|
|
8547
8578
|
import {
|
|
8548
|
-
useEffect as
|
|
8579
|
+
useEffect as useEffect19,
|
|
8549
8580
|
useRef as useRef9,
|
|
8550
8581
|
forwardRef as forwardRef16,
|
|
8551
8582
|
isValidElement as isValidElement6,
|
|
@@ -8587,7 +8618,7 @@ var Menu = forwardRef16(
|
|
|
8587
8618
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8588
8619
|
const store = storeRef.current;
|
|
8589
8620
|
const { setValue } = useStore5(store, (s) => s);
|
|
8590
|
-
|
|
8621
|
+
useEffect19(() => {
|
|
8591
8622
|
setValue(propValue ?? defaultValue);
|
|
8592
8623
|
}, [defaultValue, propValue, setValue]);
|
|
8593
8624
|
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 +8822,7 @@ var MenuOverflow = ({
|
|
|
8791
8822
|
const containerRef = useRef9(null);
|
|
8792
8823
|
const [showLeftArrow, setShowLeftArrow] = useState17(false);
|
|
8793
8824
|
const [showRightArrow, setShowRightArrow] = useState17(false);
|
|
8794
|
-
|
|
8825
|
+
useEffect19(() => {
|
|
8795
8826
|
const checkScroll = () => internalCheckScroll(
|
|
8796
8827
|
containerRef.current,
|
|
8797
8828
|
setShowLeftArrow,
|
|
@@ -8868,7 +8899,7 @@ import {
|
|
|
8868
8899
|
Fragment as Fragment8,
|
|
8869
8900
|
useState as useState18,
|
|
8870
8901
|
useRef as useRef10,
|
|
8871
|
-
useEffect as
|
|
8902
|
+
useEffect as useEffect20
|
|
8872
8903
|
} from "react";
|
|
8873
8904
|
import {
|
|
8874
8905
|
CaretRight as CaretRight6,
|
|
@@ -9720,7 +9751,7 @@ var CardAudio = forwardRef17(
|
|
|
9720
9751
|
}
|
|
9721
9752
|
return /* @__PURE__ */ jsx52(SpeakerHigh, { size: 24 });
|
|
9722
9753
|
};
|
|
9723
|
-
|
|
9754
|
+
useEffect20(() => {
|
|
9724
9755
|
const handleClickOutside = (event) => {
|
|
9725
9756
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9726
9757
|
setShowVolumeControl(false);
|
|
@@ -10447,7 +10478,7 @@ var NotFound_default = NotFound;
|
|
|
10447
10478
|
import {
|
|
10448
10479
|
useRef as useRef11,
|
|
10449
10480
|
useState as useState20,
|
|
10450
|
-
useEffect as
|
|
10481
|
+
useEffect as useEffect21,
|
|
10451
10482
|
useCallback as useCallback5
|
|
10452
10483
|
} from "react";
|
|
10453
10484
|
import { createPortal } from "react-dom";
|
|
@@ -10735,7 +10766,7 @@ var SpeedMenu = ({
|
|
|
10735
10766
|
};
|
|
10736
10767
|
};
|
|
10737
10768
|
const position = getMenuPosition();
|
|
10738
|
-
|
|
10769
|
+
useEffect21(() => {
|
|
10739
10770
|
const handleClickOutside = (event) => {
|
|
10740
10771
|
const target = event.target;
|
|
10741
10772
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10826,7 +10857,7 @@ var VideoPlayer = ({
|
|
|
10826
10857
|
const [hasCompleted, setHasCompleted] = useState20(false);
|
|
10827
10858
|
const [showCaptions, setShowCaptions] = useState20(false);
|
|
10828
10859
|
const [subtitlesValidation, setSubtitlesValidation] = useState20("idle");
|
|
10829
|
-
|
|
10860
|
+
useEffect21(() => {
|
|
10830
10861
|
setHasCompleted(false);
|
|
10831
10862
|
}, [src]);
|
|
10832
10863
|
const [playbackRate, setPlaybackRate] = useState20(1);
|
|
@@ -10898,13 +10929,13 @@ var VideoPlayer = ({
|
|
|
10898
10929
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10899
10930
|
}
|
|
10900
10931
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10901
|
-
|
|
10932
|
+
useEffect21(() => {
|
|
10902
10933
|
if (videoRef.current) {
|
|
10903
10934
|
videoRef.current.volume = volume;
|
|
10904
10935
|
videoRef.current.muted = isMuted;
|
|
10905
10936
|
}
|
|
10906
10937
|
}, [volume, isMuted]);
|
|
10907
|
-
|
|
10938
|
+
useEffect21(() => {
|
|
10908
10939
|
const video = videoRef.current;
|
|
10909
10940
|
if (!video) return;
|
|
10910
10941
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10919,13 +10950,13 @@ var VideoPlayer = ({
|
|
|
10919
10950
|
video.removeEventListener("ended", onEnded);
|
|
10920
10951
|
};
|
|
10921
10952
|
}, []);
|
|
10922
|
-
|
|
10953
|
+
useEffect21(() => {
|
|
10923
10954
|
const video = videoRef.current;
|
|
10924
10955
|
if (!video) return;
|
|
10925
10956
|
video.setAttribute("playsinline", "");
|
|
10926
10957
|
video.setAttribute("webkit-playsinline", "");
|
|
10927
10958
|
}, []);
|
|
10928
|
-
|
|
10959
|
+
useEffect21(() => {
|
|
10929
10960
|
if (isPlaying) {
|
|
10930
10961
|
showControlsWithTimer();
|
|
10931
10962
|
} else {
|
|
@@ -10937,7 +10968,7 @@ var VideoPlayer = ({
|
|
|
10937
10968
|
}
|
|
10938
10969
|
}
|
|
10939
10970
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10940
|
-
|
|
10971
|
+
useEffect21(() => {
|
|
10941
10972
|
const video = videoRef.current;
|
|
10942
10973
|
if (!video) return;
|
|
10943
10974
|
const handleFullscreenChange = () => {
|
|
@@ -10972,7 +11003,7 @@ var VideoPlayer = ({
|
|
|
10972
11003
|
);
|
|
10973
11004
|
};
|
|
10974
11005
|
}, [showControlsWithTimer]);
|
|
10975
|
-
|
|
11006
|
+
useEffect21(() => {
|
|
10976
11007
|
const init = () => {
|
|
10977
11008
|
if (!isFullscreen) {
|
|
10978
11009
|
showControlsWithTimer();
|
|
@@ -11007,7 +11038,7 @@ var VideoPlayer = ({
|
|
|
11007
11038
|
if (hasValidSaved) return saved;
|
|
11008
11039
|
return void 0;
|
|
11009
11040
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11010
|
-
|
|
11041
|
+
useEffect21(() => {
|
|
11011
11042
|
const start = getInitialTime();
|
|
11012
11043
|
if (start !== void 0 && videoRef.current) {
|
|
11013
11044
|
videoRef.current.currentTime = start;
|
|
@@ -11144,7 +11175,7 @@ var VideoPlayer = ({
|
|
|
11144
11175
|
setDuration(videoRef.current.duration);
|
|
11145
11176
|
}
|
|
11146
11177
|
}, []);
|
|
11147
|
-
|
|
11178
|
+
useEffect21(() => {
|
|
11148
11179
|
const controller = new AbortController();
|
|
11149
11180
|
const validateSubtitles = async () => {
|
|
11150
11181
|
if (!subtitles) {
|
|
@@ -11191,12 +11222,12 @@ var VideoPlayer = ({
|
|
|
11191
11222
|
controller.abort();
|
|
11192
11223
|
};
|
|
11193
11224
|
}, [subtitles]);
|
|
11194
|
-
|
|
11225
|
+
useEffect21(() => {
|
|
11195
11226
|
if (trackRef.current?.track) {
|
|
11196
11227
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11197
11228
|
}
|
|
11198
11229
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11199
|
-
|
|
11230
|
+
useEffect21(() => {
|
|
11200
11231
|
const handleVisibilityChange = () => {
|
|
11201
11232
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11202
11233
|
videoRef.current.pause();
|
|
@@ -11629,10 +11660,10 @@ var Whiteboard_default = Whiteboard;
|
|
|
11629
11660
|
import {
|
|
11630
11661
|
createContext,
|
|
11631
11662
|
useContext,
|
|
11632
|
-
useEffect as
|
|
11663
|
+
useEffect as useEffect22,
|
|
11633
11664
|
useState as useState22,
|
|
11634
11665
|
useCallback as useCallback7,
|
|
11635
|
-
useMemo as
|
|
11666
|
+
useMemo as useMemo10
|
|
11636
11667
|
} from "react";
|
|
11637
11668
|
import { useLocation, Navigate } from "react-router-dom";
|
|
11638
11669
|
import { Fragment as Fragment11, jsx as jsx58 } from "react/jsx-runtime";
|
|
@@ -11694,10 +11725,10 @@ var AuthProvider = ({
|
|
|
11694
11725
|
tokens: void 0
|
|
11695
11726
|
}));
|
|
11696
11727
|
}, [signOutFn]);
|
|
11697
|
-
|
|
11728
|
+
useEffect22(() => {
|
|
11698
11729
|
checkAuth();
|
|
11699
11730
|
}, [checkAuth]);
|
|
11700
|
-
const contextValue =
|
|
11731
|
+
const contextValue = useMemo10(
|
|
11701
11732
|
() => ({
|
|
11702
11733
|
...authState,
|
|
11703
11734
|
checkAuth,
|
|
@@ -11810,7 +11841,7 @@ import {
|
|
|
11810
11841
|
forwardRef as forwardRef18,
|
|
11811
11842
|
useId as useId9,
|
|
11812
11843
|
useState as useState23,
|
|
11813
|
-
useEffect as
|
|
11844
|
+
useEffect as useEffect23
|
|
11814
11845
|
} from "react";
|
|
11815
11846
|
import { CaretRight as CaretRight7 } from "phosphor-react";
|
|
11816
11847
|
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -11832,7 +11863,7 @@ var CardAccordation = forwardRef18(
|
|
|
11832
11863
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11833
11864
|
const isControlled = controlledExpanded !== void 0;
|
|
11834
11865
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11835
|
-
|
|
11866
|
+
useEffect23(() => {
|
|
11836
11867
|
if (isControlled) {
|
|
11837
11868
|
setInternalExpanded(controlledExpanded);
|
|
11838
11869
|
}
|
|
@@ -11923,7 +11954,7 @@ import {
|
|
|
11923
11954
|
cloneElement as cloneElement8,
|
|
11924
11955
|
forwardRef as forwardRef19,
|
|
11925
11956
|
isValidElement as isValidElement7,
|
|
11926
|
-
useEffect as
|
|
11957
|
+
useEffect as useEffect24,
|
|
11927
11958
|
useRef as useRef12,
|
|
11928
11959
|
useState as useState24
|
|
11929
11960
|
} from "react";
|
|
@@ -12019,10 +12050,10 @@ var AccordionGroup = forwardRef19(
|
|
|
12019
12050
|
);
|
|
12020
12051
|
}
|
|
12021
12052
|
const store = storeRef.current;
|
|
12022
|
-
|
|
12053
|
+
useEffect24(() => {
|
|
12023
12054
|
store.setState({ value: currentValue });
|
|
12024
12055
|
}, [currentValue, store]);
|
|
12025
|
-
|
|
12056
|
+
useEffect24(() => {
|
|
12026
12057
|
if (!isControlled) {
|
|
12027
12058
|
setInternalValue((prev) => {
|
|
12028
12059
|
if (type === "single") {
|
|
@@ -12376,7 +12407,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12376
12407
|
}
|
|
12377
12408
|
|
|
12378
12409
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12379
|
-
import { useEffect as
|
|
12410
|
+
import { useEffect as useEffect25, useRef as useRef13 } from "react";
|
|
12380
12411
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
12381
12412
|
var getAuthParams = (location, extractParams) => {
|
|
12382
12413
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12425,7 +12456,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12425
12456
|
function useUrlAuthentication(options) {
|
|
12426
12457
|
const location = useLocation2();
|
|
12427
12458
|
const processedRef = useRef13(false);
|
|
12428
|
-
|
|
12459
|
+
useEffect25(() => {
|
|
12429
12460
|
const handleAuthentication = async () => {
|
|
12430
12461
|
if (processedRef.current) {
|
|
12431
12462
|
return;
|
|
@@ -12496,9 +12527,9 @@ function useUrlAuthentication(options) {
|
|
|
12496
12527
|
}
|
|
12497
12528
|
|
|
12498
12529
|
// src/components/Auth/useApiConfig.ts
|
|
12499
|
-
import { useMemo as
|
|
12530
|
+
import { useMemo as useMemo11 } from "react";
|
|
12500
12531
|
function useApiConfig(api) {
|
|
12501
|
-
return
|
|
12532
|
+
return useMemo11(
|
|
12502
12533
|
() => ({
|
|
12503
12534
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12504
12535
|
}),
|
|
@@ -12516,7 +12547,7 @@ import {
|
|
|
12516
12547
|
} from "phosphor-react";
|
|
12517
12548
|
import {
|
|
12518
12549
|
forwardRef as forwardRef22,
|
|
12519
|
-
useEffect as
|
|
12550
|
+
useEffect as useEffect28,
|
|
12520
12551
|
useState as useState28
|
|
12521
12552
|
} from "react";
|
|
12522
12553
|
|
|
@@ -13131,15 +13162,15 @@ var useQuizStore = create11()(
|
|
|
13131
13162
|
import {
|
|
13132
13163
|
forwardRef as forwardRef21,
|
|
13133
13164
|
useCallback as useCallback8,
|
|
13134
|
-
useEffect as
|
|
13165
|
+
useEffect as useEffect27,
|
|
13135
13166
|
useId as useId11,
|
|
13136
|
-
useMemo as
|
|
13167
|
+
useMemo as useMemo12,
|
|
13137
13168
|
useRef as useRef14,
|
|
13138
13169
|
useState as useState27
|
|
13139
13170
|
} from "react";
|
|
13140
13171
|
|
|
13141
13172
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13142
|
-
import { useEffect as
|
|
13173
|
+
import { useEffect as useEffect26, useState as useState26 } from "react";
|
|
13143
13174
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
13144
13175
|
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13145
13176
|
var MultipleChoiceList = ({
|
|
@@ -13152,7 +13183,7 @@ var MultipleChoiceList = ({
|
|
|
13152
13183
|
mode = "interactive"
|
|
13153
13184
|
}) => {
|
|
13154
13185
|
const [actualValue, setActualValue] = useState26(selectedValues);
|
|
13155
|
-
|
|
13186
|
+
useEffect26(() => {
|
|
13156
13187
|
setActualValue(selectedValues);
|
|
13157
13188
|
}, [selectedValues]);
|
|
13158
13189
|
const getStatusBadge2 = (status) => {
|
|
@@ -13393,13 +13424,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13393
13424
|
);
|
|
13394
13425
|
const prevSelectedValuesRef = useRef14([]);
|
|
13395
13426
|
const prevQuestionIdRef = useRef14("");
|
|
13396
|
-
const allCurrentAnswerIds =
|
|
13427
|
+
const allCurrentAnswerIds = useMemo12(() => {
|
|
13397
13428
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13398
13429
|
}, [allCurrentAnswers]);
|
|
13399
|
-
const selectedValues =
|
|
13430
|
+
const selectedValues = useMemo12(() => {
|
|
13400
13431
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13401
13432
|
}, [allCurrentAnswerIds]);
|
|
13402
|
-
const stableSelectedValues =
|
|
13433
|
+
const stableSelectedValues = useMemo12(() => {
|
|
13403
13434
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13404
13435
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13405
13436
|
if (hasQuestionChanged) {
|
|
@@ -13431,7 +13462,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13431
13462
|
},
|
|
13432
13463
|
[currentQuestion, selectMultipleAnswer]
|
|
13433
13464
|
);
|
|
13434
|
-
const questionKey =
|
|
13465
|
+
const questionKey = useMemo12(
|
|
13435
13466
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13436
13467
|
[currentQuestion?.id]
|
|
13437
13468
|
);
|
|
@@ -13509,7 +13540,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13509
13540
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13510
13541
|
}
|
|
13511
13542
|
}, []);
|
|
13512
|
-
|
|
13543
|
+
useEffect27(() => {
|
|
13513
13544
|
adjustTextareaHeight();
|
|
13514
13545
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13515
13546
|
if (!currentQuestion) {
|
|
@@ -14077,7 +14108,7 @@ var getFinishConfirmationText = (type) => {
|
|
|
14077
14108
|
};
|
|
14078
14109
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
14079
14110
|
const { setVariant } = useQuizStore();
|
|
14080
|
-
|
|
14111
|
+
useEffect28(() => {
|
|
14081
14112
|
setVariant(variant);
|
|
14082
14113
|
}, [variant, setVariant]);
|
|
14083
14114
|
return /* @__PURE__ */ jsx64("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
@@ -14638,7 +14669,7 @@ var QuizFooter = forwardRef22(
|
|
|
14638
14669
|
);
|
|
14639
14670
|
|
|
14640
14671
|
// src/components/Quiz/QuizResult.tsx
|
|
14641
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
14672
|
+
import { forwardRef as forwardRef23, useEffect as useEffect29, useState as useState29 } from "react";
|
|
14642
14673
|
import { Clock as Clock3 } from "phosphor-react";
|
|
14643
14674
|
import { jsx as jsx65, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14644
14675
|
var QuizBadge = ({
|
|
@@ -14668,7 +14699,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14668
14699
|
questionsResult
|
|
14669
14700
|
} = useQuizStore();
|
|
14670
14701
|
const [status, setStatus] = useState29(void 0);
|
|
14671
|
-
|
|
14702
|
+
useEffect29(() => {
|
|
14672
14703
|
const cq = getCurrentQuestion();
|
|
14673
14704
|
if (!cq) {
|
|
14674
14705
|
setStatus(void 0);
|
|
@@ -15041,7 +15072,7 @@ var BreadcrumbMenu = ({
|
|
|
15041
15072
|
};
|
|
15042
15073
|
|
|
15043
15074
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15044
|
-
import { useEffect as
|
|
15075
|
+
import { useEffect as useEffect30 } from "react";
|
|
15045
15076
|
|
|
15046
15077
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15047
15078
|
import { create as create12 } from "zustand";
|
|
@@ -15170,7 +15201,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15170
15201
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15171
15202
|
);
|
|
15172
15203
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15173
|
-
|
|
15204
|
+
useEffect30(() => {
|
|
15174
15205
|
const newBreadcrumbs = [root];
|
|
15175
15206
|
const previousIds = [];
|
|
15176
15207
|
for (const level of levels) {
|
|
@@ -15202,11 +15233,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15202
15233
|
};
|
|
15203
15234
|
|
|
15204
15235
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15205
|
-
import { useMemo as
|
|
15236
|
+
import { useMemo as useMemo13 } from "react";
|
|
15206
15237
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
15207
15238
|
var useUrlParams = (config) => {
|
|
15208
15239
|
const location = useLocation3();
|
|
15209
|
-
return
|
|
15240
|
+
return useMemo13(() => {
|
|
15210
15241
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15211
15242
|
const params = {};
|
|
15212
15243
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15217,15 +15248,15 @@ var useUrlParams = (config) => {
|
|
|
15217
15248
|
};
|
|
15218
15249
|
|
|
15219
15250
|
// src/hooks/useAppInitialization.ts
|
|
15220
|
-
import { useMemo as
|
|
15251
|
+
import { useMemo as useMemo14 } from "react";
|
|
15221
15252
|
|
|
15222
15253
|
// src/hooks/useInstitution.ts
|
|
15223
|
-
import { useEffect as
|
|
15254
|
+
import { useEffect as useEffect31, useState as useState30 } from "react";
|
|
15224
15255
|
function useInstitutionId() {
|
|
15225
15256
|
const [institutionId, setInstitutionId] = useState30(() => {
|
|
15226
15257
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15227
15258
|
});
|
|
15228
|
-
|
|
15259
|
+
useEffect31(() => {
|
|
15229
15260
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15230
15261
|
if (!metaTag) return;
|
|
15231
15262
|
const observer = new MutationObserver(() => {
|
|
@@ -15392,7 +15423,7 @@ var useAuthStore = create14()(
|
|
|
15392
15423
|
function useAppInitialization() {
|
|
15393
15424
|
const getInstitutionId = useInstitutionId();
|
|
15394
15425
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15395
|
-
const authFunctions =
|
|
15426
|
+
const authFunctions = useMemo14(
|
|
15396
15427
|
() => ({
|
|
15397
15428
|
checkAuth: async () => {
|
|
15398
15429
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15429,7 +15460,7 @@ function useAppInitialization() {
|
|
|
15429
15460
|
}
|
|
15430
15461
|
|
|
15431
15462
|
// src/hooks/useAppContent.ts
|
|
15432
|
-
import { useCallback as useCallback9, useEffect as
|
|
15463
|
+
import { useCallback as useCallback9, useEffect as useEffect32, useMemo as useMemo15 } from "react";
|
|
15433
15464
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
15434
15465
|
function useAppContent(config) {
|
|
15435
15466
|
const navigate = useNavigate2();
|
|
@@ -15479,7 +15510,7 @@ function useAppContent(config) {
|
|
|
15479
15510
|
},
|
|
15480
15511
|
[navigate, onError]
|
|
15481
15512
|
);
|
|
15482
|
-
const urlAuthConfig =
|
|
15513
|
+
const urlAuthConfig = useMemo15(
|
|
15483
15514
|
() => ({
|
|
15484
15515
|
setTokens,
|
|
15485
15516
|
setSessionInfo,
|
|
@@ -15505,10 +15536,10 @@ function useAppContent(config) {
|
|
|
15505
15536
|
);
|
|
15506
15537
|
useUrlAuthentication(urlAuthConfig);
|
|
15507
15538
|
const { sessionInfo } = useAuth();
|
|
15508
|
-
const institutionIdToUse =
|
|
15539
|
+
const institutionIdToUse = useMemo15(() => {
|
|
15509
15540
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15510
15541
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15511
|
-
|
|
15542
|
+
useEffect32(() => {
|
|
15512
15543
|
if (institutionIdToUse && !initialized) {
|
|
15513
15544
|
initialize(institutionIdToUse);
|
|
15514
15545
|
}
|
|
@@ -15577,6 +15608,7 @@ export {
|
|
|
15577
15608
|
NotificationEntityType,
|
|
15578
15609
|
ProfileMenuFooter,
|
|
15579
15610
|
ProfileMenuHeader,
|
|
15611
|
+
ProfileMenuInfo,
|
|
15580
15612
|
ProfileMenuSection,
|
|
15581
15613
|
ProfileMenuTrigger,
|
|
15582
15614
|
ProfileToggleTheme,
|