@lax-wp/design-system 0.4.8 → 0.4.10
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/components/forms/multi-file-upload/MultiFileUpload.d.ts +43 -57
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +142 -145
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,78 +1,64 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
1
2
|
/**
|
|
2
|
-
* File upload
|
|
3
|
+
* File upload service interface
|
|
3
4
|
*/
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export interface FileUploadService {
|
|
6
|
+
uploadFileToFileServer: (formData: FormData, queryParams: string) => Promise<{
|
|
7
|
+
fileUrl: string;
|
|
8
|
+
fileName: string;
|
|
9
|
+
}>;
|
|
10
|
+
deleteFileFromFileServer: (fileName: string, queryParams: string) => Promise<void>;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* System messages interface
|
|
12
14
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/** Callback function called when files are selected/uploaded */
|
|
21
|
-
onFileChange: (files: FileChangeValue, fileName?: string) => void;
|
|
22
|
-
/** Description text to display in the upload area */
|
|
15
|
+
export interface SystemMessages {
|
|
16
|
+
fileSizeLimit: (size: string, unit: string) => string;
|
|
17
|
+
}
|
|
18
|
+
export type MultiFileUploadProps = {
|
|
19
|
+
/** Callback to receive the uploaded file */
|
|
20
|
+
getFile: (file: any, fileName?: string) => any;
|
|
21
|
+
/** Description text to display */
|
|
23
22
|
description?: string;
|
|
24
23
|
/** Error message to display */
|
|
25
24
|
errorMessage?: string;
|
|
26
25
|
/** Whether the upload is disabled */
|
|
27
26
|
disabled?: boolean;
|
|
28
27
|
/** Default file to display */
|
|
29
|
-
defaultFile?:
|
|
30
|
-
/** Accepted file types
|
|
28
|
+
defaultFile?: any;
|
|
29
|
+
/** Accepted file types */
|
|
31
30
|
acceptedFiles?: string;
|
|
32
|
-
/** Whether
|
|
31
|
+
/** Whether loading state is active */
|
|
33
32
|
isLoading?: boolean;
|
|
34
|
-
/**
|
|
33
|
+
/** Convert file to base64 */
|
|
35
34
|
asBase64?: boolean;
|
|
36
|
-
/**
|
|
35
|
+
/** Upload to file server */
|
|
37
36
|
toFileServer?: boolean;
|
|
38
|
-
/** Whether
|
|
37
|
+
/** Whether file is currently uploading */
|
|
39
38
|
fileUploading?: boolean;
|
|
40
39
|
/** Callback to set file uploading state */
|
|
41
|
-
setFileUploading?: (fileUploading: boolean
|
|
42
|
-
/**
|
|
40
|
+
setFileUploading?: (fileUploading: boolean) => void;
|
|
41
|
+
/** Upload to document server path */
|
|
43
42
|
uploadToDocServer?: boolean;
|
|
44
|
-
/**
|
|
43
|
+
/** Unique identifier for the upload */
|
|
44
|
+
id?: string;
|
|
45
|
+
/** Allow multiple file uploads */
|
|
45
46
|
multiple?: boolean;
|
|
46
|
-
/**
|
|
47
|
+
/** Get original file name */
|
|
47
48
|
getRealFileName?: boolean;
|
|
48
|
-
/**
|
|
49
|
+
/** Callback when file is deleted */
|
|
50
|
+
onDelete?: () => void;
|
|
51
|
+
/** Maximum file size in bytes */
|
|
49
52
|
maxSize?: number;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A highly customizable multi-file upload component with drag-and-drop support.
|
|
65
|
-
* Features file validation, base64 conversion, server upload, and comprehensive styling options.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```tsx
|
|
69
|
-
* <MultiFileUpload
|
|
70
|
-
* id="file-upload"
|
|
71
|
-
* description="Upload your documents"
|
|
72
|
-
* onFileChange={(files) => console.log(files)}
|
|
73
|
-
* multiple
|
|
74
|
-
* maxSize={10 * 1024 * 1024} // 10MB
|
|
75
|
-
* />
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare const MultiFileUpload: import("react").ForwardRefExoticComponent<MultiFileUploadProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
|
+
/** File upload service */
|
|
54
|
+
fileUploadService?: FileUploadService;
|
|
55
|
+
/** System messages for error handling */
|
|
56
|
+
systemMessages?: SystemMessages;
|
|
57
|
+
/** Toast function for displaying errors */
|
|
58
|
+
toast?: {
|
|
59
|
+
error: (message: string, options?: {
|
|
60
|
+
toastId?: string;
|
|
61
|
+
}) => void;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export declare const MultiFileUpload: FC<MultiFileUploadProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type { TToggleDirection } from "./constants/toggle";
|
|
|
45
45
|
export { MdInput } from "./components/forms/md-input/MdInput";
|
|
46
46
|
export type { MdInputProps } from "./components/forms/md-input/MdInput";
|
|
47
47
|
export { MultiFileUpload } from "./components/forms/multi-file-upload/MultiFileUpload";
|
|
48
|
-
export type { MultiFileUploadProps,
|
|
48
|
+
export type { MultiFileUploadProps, FileUploadService as MultiFileUploadService, SystemMessages as MultiFileUploadSystemMessages, } from "./components/forms/multi-file-upload/MultiFileUpload";
|
|
49
49
|
export { IconPicker, IconRenderer } from "./components/forms/icon-picker/IconPicker";
|
|
50
50
|
export type { IconPickerContentProps } from "./components/forms/icon-picker/IconPicker";
|
|
51
51
|
export { StatusColorMapping } from "./components/data-display/status-color-mapping/StatusColorMapping";
|
package/dist/index.es.js
CHANGED
|
@@ -37918,155 +37918,152 @@ function FiDownload(e) {
|
|
|
37918
37918
|
function FiTrash2(e) {
|
|
37919
37919
|
return GenIcon({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "polyline", attr: { points: "3 6 5 6 21 6" }, child: [] }, { tag: "path", attr: { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }, child: [] }, { tag: "line", attr: { x1: "10", y1: "11", x2: "10", y2: "17" }, child: [] }, { tag: "line", attr: { x1: "14", y1: "11", x2: "14", y2: "17" }, child: [] }] })(e);
|
|
37920
37920
|
}
|
|
37921
|
-
const { Dragger: Dragger$1 } = Upload,
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
|
|
37927
|
-
|
|
37928
|
-
|
|
37929
|
-
|
|
37930
|
-
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
|
|
37934
|
-
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37942
|
-
|
|
37943
|
-
|
|
37944
|
-
|
|
37945
|
-
|
|
37946
|
-
|
|
37947
|
-
|
|
37948
|
-
|
|
37949
|
-
|
|
37950
|
-
|
|
37951
|
-
|
|
37952
|
-
|
|
37953
|
-
|
|
37954
|
-
|
|
37955
|
-
|
|
37956
|
-
|
|
37957
|
-
|
|
37958
|
-
|
|
37959
|
-
|
|
37960
|
-
|
|
37961
|
-
|
|
37962
|
-
|
|
37963
|
-
|
|
37964
|
-
|
|
37965
|
-
|
|
37966
|
-
|
|
37967
|
-
|
|
37968
|
-
|
|
37969
|
-
|
|
37970
|
-
|
|
37971
|
-
|
|
37972
|
-
|
|
37973
|
-
|
|
37974
|
-
|
|
37975
|
-
|
|
37976
|
-
|
|
37977
|
-
|
|
37978
|
-
|
|
37979
|
-
|
|
37980
|
-
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
|
|
37984
|
-
|
|
37985
|
-
|
|
37986
|
-
|
|
37987
|
-
|
|
37988
|
-
|
|
37989
|
-
|
|
37990
|
-
|
|
37991
|
-
|
|
37992
|
-
|
|
37993
|
-
|
|
37994
|
-
|
|
37995
|
-
|
|
37996
|
-
|
|
37997
|
-
|
|
37998
|
-
|
|
37999
|
-
|
|
38000
|
-
|
|
38001
|
-
|
|
38002
|
-
|
|
38003
|
-
|
|
38004
|
-
|
|
37921
|
+
const { Dragger: Dragger$1 } = Upload, DEFAULT_MAX_SIZE$1 = 50 * 1024 * 1024, MultiFileUpload = ({
|
|
37922
|
+
getFile: e,
|
|
37923
|
+
id: t,
|
|
37924
|
+
description: n,
|
|
37925
|
+
errorMessage: a = null,
|
|
37926
|
+
disabled: s = !1,
|
|
37927
|
+
defaultFile: o = null,
|
|
37928
|
+
acceptedFiles: c = null,
|
|
37929
|
+
isLoading: Le = !1,
|
|
37930
|
+
asBase64: $e = !1,
|
|
37931
|
+
toFileServer: ze = !1,
|
|
37932
|
+
setFileUploading: et,
|
|
37933
|
+
fileUploading: tt = !1,
|
|
37934
|
+
uploadToDocServer: dt = !1,
|
|
37935
|
+
multiple: pt = !1,
|
|
37936
|
+
getRealFileName: xt = !1,
|
|
37937
|
+
onDelete: mt,
|
|
37938
|
+
maxSize: bt = DEFAULT_MAX_SIZE$1,
|
|
37939
|
+
fileUploadService: gt,
|
|
37940
|
+
systemMessages: yt,
|
|
37941
|
+
toast: Et
|
|
37942
|
+
}) => {
|
|
37943
|
+
const [_t, Ct] = useState(null), [Rt, jt] = useState([]), [It, Lt] = useState("#d9d9d9"), [zt, Ot] = useState(!1), [St, Bt] = useState(null), Nt = async () => {
|
|
37944
|
+
if (!gt) {
|
|
37945
|
+
console.warn("MultiFileUpload: File server upload requires fileUploadService");
|
|
37946
|
+
return;
|
|
37947
|
+
}
|
|
37948
|
+
Promise.all(
|
|
37949
|
+
Rt.map((kt) => {
|
|
37950
|
+
const Tt = new FormData();
|
|
37951
|
+
Tt.append("file", kt);
|
|
37952
|
+
const Pt = buildQueryParams({
|
|
37953
|
+
file_upload_path: dt ? "document-server" : null,
|
|
37954
|
+
token: localStorage.getItem("token")
|
|
37955
|
+
});
|
|
37956
|
+
return gt.uploadFileToFileServer(Tt, Pt);
|
|
37957
|
+
})
|
|
37958
|
+
).then((kt) => {
|
|
37959
|
+
e(
|
|
37960
|
+
pt ? kt?.map((Tt) => Tt?.fileUrl) : kt?.[0]?.fileUrl,
|
|
37961
|
+
xt ? _t?.name : kt?.[0]?.fileName
|
|
37962
|
+
), et?.(null), Bt(kt?.[0]);
|
|
37963
|
+
});
|
|
37964
|
+
}, Mt = {
|
|
37965
|
+
accept: c || "*",
|
|
37966
|
+
multiple: pt,
|
|
37967
|
+
showUploadList: !1,
|
|
37968
|
+
disabled: s,
|
|
37969
|
+
onRemove: () => {
|
|
37970
|
+
jt([]);
|
|
37971
|
+
},
|
|
37972
|
+
beforeUpload: (kt, Tt) => {
|
|
37973
|
+
if (kt.size > bt) {
|
|
37974
|
+
const Pt = Math.round(bt / 1048576), Ht = yt?.fileSizeLimit(String(Pt), "MB") || `File size must be less than ${Pt}MB`;
|
|
37975
|
+
return Et ? Et.error(Ht, { toastId: Ht }) : console.error(Ht), !1;
|
|
37976
|
+
}
|
|
37977
|
+
return Ct(kt), ze ? (et?.(t || "field-file-upload"), jt(Tt)) : ($e ? Promise.all(
|
|
37978
|
+
(pt ? Tt : [kt]).map((Pt) => new Promise((Ht) => {
|
|
37979
|
+
const Zt = new FileReader();
|
|
37980
|
+
Zt.onload = (Vt) => {
|
|
37981
|
+
Ht({
|
|
37982
|
+
filename: Pt.name,
|
|
37983
|
+
content: Vt?.target?.result?.split(",")[1]
|
|
37984
|
+
});
|
|
37985
|
+
}, Zt.readAsDataURL(Pt);
|
|
37986
|
+
}))
|
|
37987
|
+
).then((Pt) => {
|
|
37988
|
+
e(pt ? Pt : Pt[0]);
|
|
37989
|
+
}) : e(kt), Ct(kt)), !1;
|
|
37990
|
+
}
|
|
37991
|
+
}, At = async () => {
|
|
37992
|
+
if (ze && St && gt) {
|
|
37993
|
+
const kt = buildQueryParams({
|
|
37994
|
+
token: localStorage.getItem("token")
|
|
37995
|
+
});
|
|
37996
|
+
gt.deleteFileFromFileServer(St?.fileName, kt).then(() => {
|
|
37997
|
+
Bt(null);
|
|
37998
|
+
});
|
|
37999
|
+
}
|
|
38000
|
+
Ct(null), jt([]), e(""), mt?.();
|
|
38001
|
+
};
|
|
38002
|
+
useEffect(() => {
|
|
38003
|
+
o?.name && Ct(o);
|
|
38004
|
+
}, [o]), useEffect(() => {
|
|
38005
|
+
Lt(a ? "#EF4444" : "#d9d9d9");
|
|
38006
|
+
}, [a]), useEffect(() => {
|
|
38007
|
+
Rt.length && Nt();
|
|
38008
|
+
}, [Rt]);
|
|
38009
|
+
const $t = (kt) => kt ? kt.length <= 20 ? kt : kt.slice(0, 14) + "...." + kt.slice(-7) : "";
|
|
38010
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38011
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-32", onMouseEnter: () => Ot(!0), onMouseLeave: () => Ot(!1), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38012
|
+
Dragger$1,
|
|
38013
|
+
{
|
|
38014
|
+
...Mt,
|
|
38015
|
+
style: {
|
|
38016
|
+
borderColor: zt && !a ? "#1890ff" : It
|
|
38017
|
+
},
|
|
38018
|
+
disabled: s || tt,
|
|
38019
|
+
children: _t ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mx-5", title: _t?.name || o?.name, children: [
|
|
38020
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-4", children: [
|
|
38021
|
+
_t?.type === "application/pdf" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 bg-[#E6F1FC] rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(BsFiletypePdf, { size: 20, fill: "#006CCF" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 bg-[#E6F1FC] rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38022
|
+
DescriptionRounded,
|
|
38023
|
+
{
|
|
38024
|
+
sx: {
|
|
38025
|
+
height: "20px",
|
|
38026
|
+
width: "20px",
|
|
38027
|
+
color: "#006CCF"
|
|
38028
|
+
}
|
|
38029
|
+
}
|
|
38030
|
+
) }),
|
|
38031
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-left", children: [
|
|
38032
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "font-inter text-md font-medium text-base", children: $t(_t?.name || o?.name) }),
|
|
38033
|
+
tt ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: "Uploading..." }) : _t?.size > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: [
|
|
38034
|
+
(_t.size / 1e3).toFixed(2),
|
|
38035
|
+
" ",
|
|
38036
|
+
"KB"
|
|
38037
|
+
] }) : null
|
|
38038
|
+
] })
|
|
38039
|
+
] }),
|
|
38040
|
+
Le ? /* @__PURE__ */ jsxRuntimeExports.jsx(CgSpinner, { size: 40, className: "spinner text-primary-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38041
|
+
"button",
|
|
38005
38042
|
{
|
|
38006
|
-
|
|
38007
|
-
className:
|
|
38008
|
-
|
|
38009
|
-
|
|
38043
|
+
id: "btn-file-upload",
|
|
38044
|
+
className: "ml-4",
|
|
38045
|
+
onClick: (kt) => {
|
|
38046
|
+
kt.stopPropagation(), At();
|
|
38010
38047
|
},
|
|
38011
|
-
disabled: s
|
|
38012
|
-
children:
|
|
38013
|
-
"div",
|
|
38014
|
-
{
|
|
38015
|
-
className: "flex items-center justify-between mx-5",
|
|
38016
|
-
title: Rt?.name || o?.name || "",
|
|
38017
|
-
children: [
|
|
38018
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-4", children: [
|
|
38019
|
-
Rt?.type === "application/pdf" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 bg-[#E6F1FC] rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(BsFiletypePdf, { size: 20, fill: "#006CCF" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 bg-[#E6F1FC] rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38020
|
-
DescriptionRounded,
|
|
38021
|
-
{
|
|
38022
|
-
sx: {
|
|
38023
|
-
height: "20px",
|
|
38024
|
-
width: "20px",
|
|
38025
|
-
color: "#006CCF"
|
|
38026
|
-
}
|
|
38027
|
-
}
|
|
38028
|
-
) }),
|
|
38029
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-left", children: [
|
|
38030
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "font-inter text-md font-medium text-base", children: shortenFileName(Rt?.name || o?.name || "") }),
|
|
38031
|
-
tt ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: "Uploading..." }) : Et && Rt?.size > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: _t(Rt.size) }) : null
|
|
38032
|
-
] })
|
|
38033
|
-
] }),
|
|
38034
|
-
Le ? /* @__PURE__ */ jsxRuntimeExports.jsx(CgSpinner, { size: 40, className: "spinner text-primary-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38035
|
-
"button",
|
|
38036
|
-
{
|
|
38037
|
-
id: `btn-file-upload-${e}`,
|
|
38038
|
-
className: "ml-4",
|
|
38039
|
-
onClick: (Tt) => {
|
|
38040
|
-
Tt.stopPropagation(), kt();
|
|
38041
|
-
},
|
|
38042
|
-
disabled: s,
|
|
38043
|
-
type: "button",
|
|
38044
|
-
"aria-label": "Delete file",
|
|
38045
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(FiTrash2, { size: 20, className: "text-gray-400" })
|
|
38046
|
-
}
|
|
38047
|
-
)
|
|
38048
|
-
]
|
|
38049
|
-
}
|
|
38050
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-col", children: [
|
|
38051
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FiDownload, { size: 24, className: "text-gray-400" }) }),
|
|
38052
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38053
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center", children: [
|
|
38054
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "text-primary-600 dark:text-primary-300", appearance: "custom", children: "Click to upload" }),
|
|
38055
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "ml-1", appearance: "subtitle", children: "or drag and drop" })
|
|
38056
|
-
] }),
|
|
38057
|
-
n ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: n }) : null
|
|
38058
|
-
] })
|
|
38059
|
-
] }) })
|
|
38048
|
+
disabled: s,
|
|
38049
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(FiTrash2, { size: 20, fill: "#98A2B3" })
|
|
38060
38050
|
}
|
|
38061
38051
|
)
|
|
38062
|
-
}
|
|
38063
|
-
|
|
38064
|
-
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
)
|
|
38068
|
-
|
|
38069
|
-
|
|
38052
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-col", children: [
|
|
38053
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FiDownload, { size: 24, fill: "#98A2B3" }) }),
|
|
38054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
38055
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center", children: [
|
|
38056
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "text-primary-600 dark:text-primary-300", appearance: "custom", children: "Click to upload" }),
|
|
38057
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", className: "ml-1", appearance: "subtitle", children: "or drag and drop" })
|
|
38058
|
+
] }),
|
|
38059
|
+
n ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { size: "small", variant: "medium", appearance: "subtitle", children: n }) : null
|
|
38060
|
+
] })
|
|
38061
|
+
] }) })
|
|
38062
|
+
}
|
|
38063
|
+
) }),
|
|
38064
|
+
a && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { className: "text-error-500 mt-1", appearance: "custom", size: "extra-small", variant: "medium", children: a })
|
|
38065
|
+
] });
|
|
38066
|
+
}, roundedIconNames = Object.keys(AllIcons).filter(
|
|
38070
38067
|
(e) => e?.endsWith("Rounded")
|
|
38071
38068
|
), mergedIconNames = [
|
|
38072
38069
|
...roundedIconNames || [],
|
package/dist/index.umd.js
CHANGED
|
@@ -191,7 +191,7 @@ object-assign
|
|
|
191
191
|
(c) Sindre Sorhus
|
|
192
192
|
@license MIT
|
|
193
193
|
*/var objectAssign,hasRequiredObjectAssign;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function a(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function s(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var c={},Le=0;Le<10;Le++)c["_"+String.fromCharCode(Le)]=Le;var $e=Object.getOwnPropertyNames(c).map(function(et){return c[et]});if($e.join("")!=="0123456789")return!1;var ze={};return"abcdefghijklmnopqrst".split("").forEach(function(et){ze[et]=et}),Object.keys(Object.assign({},ze)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return objectAssign=s()?Object.assign:function(o,c){for(var Le,$e=a(o),ze,et=1;et<arguments.length;et++){Le=Object(arguments[et]);for(var tt in Le)t.call(Le,tt)&&($e[tt]=Le[tt]);if(e){ze=e(Le);for(var dt=0;dt<ze.length;dt++)n.call(Le,ze[dt])&&($e[ze[dt]]=Le[ze[dt]])}}return $e},objectAssign}var ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=e,ReactPropTypesSecret_1}var has,hasRequiredHas;function requireHas(){return hasRequiredHas||(hasRequiredHas=1,has=Function.call.bind(Object.prototype.hasOwnProperty)),has}var checkPropTypes_1,hasRequiredCheckPropTypes;function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=requireReactPropTypesSecret(),n={},a=requireHas();e=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function s(o,c,Le,$e,ze){if(process.env.NODE_ENV!=="production"){for(var et in o)if(a(o,et)){var tt;try{if(typeof o[et]!="function"){var dt=Error(($e||"React class")+": "+Le+" type `"+et+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[et]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw dt.name="Invariant Violation",dt}tt=o[et](c,et,$e,Le,null,t)}catch(xt){tt=xt}if(tt&&!(tt instanceof Error)&&e(($e||"React class")+": type specification of "+Le+" `"+et+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof tt+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),tt instanceof Error&&!(tt.message in n)){n[tt.message]=!0;var pt=ze?ze():"";e("Failed "+Le+" type: "+tt.message+(pt??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},checkPropTypes_1=s,checkPropTypes_1}var factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers;function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var e=requireReactIs$1(),t=requireObjectAssign(),n=requireReactPropTypesSecret(),a=requireHas(),s=requireCheckPropTypes(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(Le){var $e="Warning: "+Le;typeof console<"u"&&console.error($e);try{throw new Error($e)}catch{}});function c(){return null}return factoryWithTypeCheckers=function(Le,$e){var ze=typeof Symbol=="function"&&Symbol.iterator,et="@@iterator";function tt(Pt){var Ht=Pt&&(ze&&Pt[ze]||Pt[et]);if(typeof Ht=="function")return Ht}var dt="<<anonymous>>",pt={array:gt("array"),bigint:gt("bigint"),bool:gt("boolean"),func:gt("function"),number:gt("number"),object:gt("object"),string:gt("string"),symbol:gt("symbol"),any:yt(),arrayOf:Et,element:Ct(),elementType:Rt(),instanceOf:St,node:zt(),objectOf:It,oneOf:At,oneOfType:Lt,shape:kt,exact:Bt};function xt(Pt,Ht){return Pt===Ht?Pt!==0||1/Pt===1/Ht:Pt!==Pt&&Ht!==Ht}function mt(Pt,Ht){this.message=Pt,this.data=Ht&&typeof Ht=="object"?Ht:{},this.stack=""}mt.prototype=Error.prototype;function bt(Pt){if(process.env.NODE_ENV!=="production")var Ht={},Zt=0;function Vt(Jt,Kt,qt,ir,tr,rr,cr){if(ir=ir||dt,rr=rr||qt,cr!==n){if($e){var Qt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Qt.name="Invariant Violation",Qt}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var hr=ir+":"+qt;!Ht[hr]&&Zt<3&&(o("You are manually calling a React.PropTypes validation function for the `"+rr+"` prop on `"+ir+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Ht[hr]=!0,Zt++)}}return Kt[qt]==null?Jt?Kt[qt]===null?new mt("The "+tr+" `"+rr+"` is marked as required "+("in `"+ir+"`, but its value is `null`.")):new mt("The "+tr+" `"+rr+"` is marked as required in "+("`"+ir+"`, but its value is `undefined`.")):null:Pt(Kt,qt,ir,tr,rr)}var Yt=Vt.bind(null,!1);return Yt.isRequired=Vt.bind(null,!0),Yt}function gt(Pt){function Ht(Zt,Vt,Yt,Jt,Kt,qt){var ir=Zt[Vt],tr=jt(ir);if(tr!==Pt){var rr=$t(ir);return new mt("Invalid "+Jt+" `"+Kt+"` of type "+("`"+rr+"` supplied to `"+Yt+"`, expected ")+("`"+Pt+"`."),{expectedType:Pt})}return null}return bt(Ht)}function yt(){return bt(c)}function Et(Pt){function Ht(Zt,Vt,Yt,Jt,Kt){if(typeof Pt!="function")return new mt("Property `"+Kt+"` of component `"+Yt+"` has invalid PropType notation inside arrayOf.");var qt=Zt[Vt];if(!Array.isArray(qt)){var ir=jt(qt);return new mt("Invalid "+Jt+" `"+Kt+"` of type "+("`"+ir+"` supplied to `"+Yt+"`, expected an array."))}for(var tr=0;tr<qt.length;tr++){var rr=Pt(qt,tr,Yt,Jt,Kt+"["+tr+"]",n);if(rr instanceof Error)return rr}return null}return bt(Ht)}function Ct(){function Pt(Ht,Zt,Vt,Yt,Jt){var Kt=Ht[Zt];if(!Le(Kt)){var qt=jt(Kt);return new mt("Invalid "+Yt+" `"+Jt+"` of type "+("`"+qt+"` supplied to `"+Vt+"`, expected a single ReactElement."))}return null}return bt(Pt)}function Rt(){function Pt(Ht,Zt,Vt,Yt,Jt){var Kt=Ht[Zt];if(!e.isValidElementType(Kt)){var qt=jt(Kt);return new mt("Invalid "+Yt+" `"+Jt+"` of type "+("`"+qt+"` supplied to `"+Vt+"`, expected a single ReactElement type."))}return null}return bt(Pt)}function St(Pt){function Ht(Zt,Vt,Yt,Jt,Kt){if(!(Zt[Vt]instanceof Pt)){var qt=Pt.name||dt,ir=Tt(Zt[Vt]);return new mt("Invalid "+Jt+" `"+Kt+"` of type "+("`"+ir+"` supplied to `"+Yt+"`, expected ")+("instance of `"+qt+"`."))}return null}return bt(Ht)}function At(Pt){if(!Array.isArray(Pt))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),c;function Ht(Zt,Vt,Yt,Jt,Kt){for(var qt=Zt[Vt],ir=0;ir<Pt.length;ir++)if(xt(qt,Pt[ir]))return null;var tr=JSON.stringify(Pt,function(cr,Qt){var hr=$t(Qt);return hr==="symbol"?String(Qt):Qt});return new mt("Invalid "+Jt+" `"+Kt+"` of value `"+String(qt)+"` "+("supplied to `"+Yt+"`, expected one of "+tr+"."))}return bt(Ht)}function It(Pt){function Ht(Zt,Vt,Yt,Jt,Kt){if(typeof Pt!="function")return new mt("Property `"+Kt+"` of component `"+Yt+"` has invalid PropType notation inside objectOf.");var qt=Zt[Vt],ir=jt(qt);if(ir!=="object")return new mt("Invalid "+Jt+" `"+Kt+"` of type "+("`"+ir+"` supplied to `"+Yt+"`, expected an object."));for(var tr in qt)if(a(qt,tr)){var rr=Pt(qt,tr,Yt,Jt,Kt+"."+tr,n);if(rr instanceof Error)return rr}return null}return bt(Ht)}function Lt(Pt){if(!Array.isArray(Pt))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var Ht=0;Ht<Pt.length;Ht++){var Zt=Pt[Ht];if(typeof Zt!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_t(Zt)+" at index "+Ht+"."),c}function Vt(Yt,Jt,Kt,qt,ir){for(var tr=[],rr=0;rr<Pt.length;rr++){var cr=Pt[rr],Qt=cr(Yt,Jt,Kt,qt,ir,n);if(Qt==null)return null;Qt.data&&a(Qt.data,"expectedType")&&tr.push(Qt.data.expectedType)}var hr=tr.length>0?", expected one of type ["+tr.join(", ")+"]":"";return new mt("Invalid "+qt+" `"+ir+"` supplied to "+("`"+Kt+"`"+hr+"."))}return bt(Vt)}function zt(){function Pt(Ht,Zt,Vt,Yt,Jt){return Nt(Ht[Zt])?null:new mt("Invalid "+Yt+" `"+Jt+"` supplied to "+("`"+Vt+"`, expected a ReactNode."))}return bt(Pt)}function Ot(Pt,Ht,Zt,Vt,Yt){return new mt((Pt||"React class")+": "+Ht+" type `"+Zt+"."+Vt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Yt+"`.")}function kt(Pt){function Ht(Zt,Vt,Yt,Jt,Kt){var qt=Zt[Vt],ir=jt(qt);if(ir!=="object")return new mt("Invalid "+Jt+" `"+Kt+"` of type `"+ir+"` "+("supplied to `"+Yt+"`, expected `object`."));for(var tr in Pt){var rr=Pt[tr];if(typeof rr!="function")return Ot(Yt,Jt,Kt,tr,$t(rr));var cr=rr(qt,tr,Yt,Jt,Kt+"."+tr,n);if(cr)return cr}return null}return bt(Ht)}function Bt(Pt){function Ht(Zt,Vt,Yt,Jt,Kt){var qt=Zt[Vt],ir=jt(qt);if(ir!=="object")return new mt("Invalid "+Jt+" `"+Kt+"` of type `"+ir+"` "+("supplied to `"+Yt+"`, expected `object`."));var tr=t({},Zt[Vt],Pt);for(var rr in tr){var cr=Pt[rr];if(a(Pt,rr)&&typeof cr!="function")return Ot(Yt,Jt,Kt,rr,$t(cr));if(!cr)return new mt("Invalid "+Jt+" `"+Kt+"` key `"+rr+"` supplied to `"+Yt+"`.\nBad object: "+JSON.stringify(Zt[Vt],null," ")+`
|
|
194
|
-
Valid keys: `+JSON.stringify(Object.keys(Pt),null," "));var Qt=cr(qt,rr,Yt,Jt,Kt+"."+rr,n);if(Qt)return Qt}return null}return bt(Ht)}function Nt(Pt){switch(typeof Pt){case"number":case"string":case"undefined":return!0;case"boolean":return!Pt;case"object":if(Array.isArray(Pt))return Pt.every(Nt);if(Pt===null||Le(Pt))return!0;var Ht=tt(Pt);if(Ht){var Zt=Ht.call(Pt),Vt;if(Ht!==Pt.entries){for(;!(Vt=Zt.next()).done;)if(!Nt(Vt.value))return!1}else for(;!(Vt=Zt.next()).done;){var Yt=Vt.value;if(Yt&&!Nt(Yt[1]))return!1}}else return!1;return!0;default:return!1}}function Mt(Pt,Ht){return Pt==="symbol"?!0:Ht?Ht["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Ht instanceof Symbol:!1}function jt(Pt){var Ht=typeof Pt;return Array.isArray(Pt)?"array":Pt instanceof RegExp?"object":Mt(Ht,Pt)?"symbol":Ht}function $t(Pt){if(typeof Pt>"u"||Pt===null)return""+Pt;var Ht=jt(Pt);if(Ht==="object"){if(Pt instanceof Date)return"date";if(Pt instanceof RegExp)return"regexp"}return Ht}function _t(Pt){var Ht=$t(Pt);switch(Ht){case"array":case"object":return"an "+Ht;case"boolean":case"date":case"regexp":return"a "+Ht;default:return Ht}}function Tt(Pt){return!Pt.constructor||!Pt.constructor.name?dt:Pt.constructor.name}return pt.checkPropTypes=s,pt.resetWarningCache=s.resetWarningCache,pt.PropTypes=pt,pt},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function n(){}return n.resetWarningCache=t,factoryWithThrowingShims=function(){function a(c,Le,$e,ze,et,tt){if(tt!==e){var dt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw dt.name="Invariant Violation",dt}}a.isRequired=a;function s(){return a}var o={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:s,element:a,elementType:a,instanceOf:s,node:a,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){if(hasRequiredPropTypes)return propTypes.exports;if(hasRequiredPropTypes=1,process.env.NODE_ENV!=="production"){var e=requireReactIs$1(),t=!0;propTypes.exports=requireFactoryWithTypeCheckers()(e.isElement,t)}else propTypes.exports=requireFactoryWithThrowingShims()();return propTypes.exports}var isString={},hasRequiredIsString;function requireIsString(){return hasRequiredIsString||(hasRequiredIsString=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){return typeof n=="string"}}(isString)),isString}var getScrollbarWidth={},hasRequiredGetScrollbarWidth;function requireGetScrollbarWidth(){return hasRequiredGetScrollbarWidth||(hasRequiredGetScrollbarWidth=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=requireDomCss(),n=a(t);function a(c){return c&&c.__esModule?c:{default:c}}var s=!1;function o(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(c&&s!==!1)return s;if(typeof document<"u"){var Le=document.createElement("div");(0,n.default)(Le,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(Le),s=Le.offsetWidth-Le.clientWidth,document.body.removeChild(Le)}else s=0;return s||0}}(getScrollbarWidth)),getScrollbarWidth}var returnFalse={},hasRequiredReturnFalse;function requireReturnFalse(){return hasRequiredReturnFalse||(hasRequiredReturnFalse=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(){return!1}}(returnFalse)),returnFalse}var getInnerWidth={},hasRequiredGetInnerWidth;function requireGetInnerWidth(){return hasRequiredGetInnerWidth||(hasRequiredGetInnerWidth=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){var a=n.clientWidth,s=getComputedStyle(n),o=s.paddingLeft,c=s.paddingRight;return a-parseFloat(o)-parseFloat(c)}}(getInnerWidth)),getInnerWidth}var getInnerHeight={},hasRequiredGetInnerHeight;function requireGetInnerHeight(){return hasRequiredGetInnerHeight||(hasRequiredGetInnerHeight=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){var a=n.clientHeight,s=getComputedStyle(n),o=s.paddingTop,c=s.paddingBottom;return a-parseFloat(o)-parseFloat(c)}}(getInnerHeight)),getInnerHeight}var styles$1={},hasRequiredStyles;function requireStyles(){return hasRequiredStyles||(hasRequiredStyles=1,Object.defineProperty(styles$1,"__esModule",{value:!0}),styles$1.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},styles$1.containerStyleAutoHeight={height:"auto"},styles$1.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},styles$1.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},styles$1.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},styles$1.trackHorizontalStyleDefault={position:"absolute",height:6},styles$1.trackVerticalStyleDefault={position:"absolute",width:6},styles$1.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},styles$1.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},styles$1.disableSelectStyle={userSelect:"none"},styles$1.disableSelectStyleReset={userSelect:""}),styles$1}var defaultRenderElements={},hasRequiredDefaultRenderElements;function requireDefaultRenderElements(){if(hasRequiredDefaultRenderElements)return defaultRenderElements;hasRequiredDefaultRenderElements=1,Object.defineProperty(defaultRenderElements,"__esModule",{value:!0});var e=Object.assign||function(et){for(var tt=1;tt<arguments.length;tt++){var dt=arguments[tt];for(var pt in dt)Object.prototype.hasOwnProperty.call(dt,pt)&&(et[pt]=dt[pt])}return et};defaultRenderElements.renderViewDefault=o,defaultRenderElements.renderTrackHorizontalDefault=c,defaultRenderElements.renderTrackVerticalDefault=Le,defaultRenderElements.renderThumbHorizontalDefault=$e,defaultRenderElements.renderThumbVerticalDefault=ze;var t=React,n=a(t);function a(et){return et&&et.__esModule?et:{default:et}}function s(et,tt){var dt={};for(var pt in et)tt.indexOf(pt)>=0||Object.prototype.hasOwnProperty.call(et,pt)&&(dt[pt]=et[pt]);return dt}function o(et){return n.default.createElement("div",et)}function c(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{right:2,bottom:2,left:2,borderRadius:3});return n.default.createElement("div",e({style:pt},dt))}function Le(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{right:2,bottom:2,top:2,borderRadius:3});return n.default.createElement("div",e({style:pt},dt))}function $e(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return n.default.createElement("div",e({style:pt},dt))}function ze(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return n.default.createElement("div",e({style:pt},dt))}return defaultRenderElements}var hasRequiredScrollbars;function requireScrollbars(){return hasRequiredScrollbars||(hasRequiredScrollbars=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(kt){for(var Bt=1;Bt<arguments.length;Bt++){var Nt=arguments[Bt];for(var Mt in Nt)Object.prototype.hasOwnProperty.call(Nt,Mt)&&(kt[Mt]=Nt[Mt])}return kt},n=function(){function kt(Bt,Nt){for(var Mt=0;Mt<Nt.length;Mt++){var jt=Nt[Mt];jt.enumerable=jt.enumerable||!1,jt.configurable=!0,"value"in jt&&(jt.writable=!0),Object.defineProperty(Bt,jt.key,jt)}}return function(Bt,Nt,Mt){return Nt&&kt(Bt.prototype,Nt),Mt&&kt(Bt,Mt),Bt}}(),a=requireRaf(),s=St(a),o=requireDomCss(),c=St(o),Le=React,$e=requirePropTypes(),ze=St($e),et=requireIsString(),tt=St(et),dt=requireGetScrollbarWidth(),pt=St(dt),xt=requireReturnFalse(),mt=St(xt),bt=requireGetInnerWidth(),gt=St(bt),yt=requireGetInnerHeight(),Et=St(yt),Ct=requireStyles(),Rt=requireDefaultRenderElements();function St(kt){return kt&&kt.__esModule?kt:{default:kt}}function At(kt,Bt){var Nt={};for(var Mt in kt)Bt.indexOf(Mt)>=0||Object.prototype.hasOwnProperty.call(kt,Mt)&&(Nt[Mt]=kt[Mt]);return Nt}function It(kt,Bt){if(!(kt instanceof Bt))throw new TypeError("Cannot call a class as a function")}function Lt(kt,Bt){if(!kt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt&&(typeof Bt=="object"||typeof Bt=="function")?Bt:kt}function zt(kt,Bt){if(typeof Bt!="function"&&Bt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Bt);kt.prototype=Object.create(Bt&&Bt.prototype,{constructor:{value:kt,enumerable:!1,writable:!0,configurable:!0}}),Bt&&(Object.setPrototypeOf?Object.setPrototypeOf(kt,Bt):kt.__proto__=Bt)}var Ot=function(kt){zt(Bt,kt);function Bt(Nt){var Mt;It(this,Bt);for(var jt=arguments.length,$t=Array(jt>1?jt-1:0),_t=1;_t<jt;_t++)$t[_t-1]=arguments[_t];var Tt=Lt(this,(Mt=Bt.__proto__||Object.getPrototypeOf(Bt)).call.apply(Mt,[this,Nt].concat($t)));return Tt.getScrollLeft=Tt.getScrollLeft.bind(Tt),Tt.getScrollTop=Tt.getScrollTop.bind(Tt),Tt.getScrollWidth=Tt.getScrollWidth.bind(Tt),Tt.getScrollHeight=Tt.getScrollHeight.bind(Tt),Tt.getClientWidth=Tt.getClientWidth.bind(Tt),Tt.getClientHeight=Tt.getClientHeight.bind(Tt),Tt.getValues=Tt.getValues.bind(Tt),Tt.getThumbHorizontalWidth=Tt.getThumbHorizontalWidth.bind(Tt),Tt.getThumbVerticalHeight=Tt.getThumbVerticalHeight.bind(Tt),Tt.getScrollLeftForOffset=Tt.getScrollLeftForOffset.bind(Tt),Tt.getScrollTopForOffset=Tt.getScrollTopForOffset.bind(Tt),Tt.scrollLeft=Tt.scrollLeft.bind(Tt),Tt.scrollTop=Tt.scrollTop.bind(Tt),Tt.scrollToLeft=Tt.scrollToLeft.bind(Tt),Tt.scrollToTop=Tt.scrollToTop.bind(Tt),Tt.scrollToRight=Tt.scrollToRight.bind(Tt),Tt.scrollToBottom=Tt.scrollToBottom.bind(Tt),Tt.handleTrackMouseEnter=Tt.handleTrackMouseEnter.bind(Tt),Tt.handleTrackMouseLeave=Tt.handleTrackMouseLeave.bind(Tt),Tt.handleHorizontalTrackMouseDown=Tt.handleHorizontalTrackMouseDown.bind(Tt),Tt.handleVerticalTrackMouseDown=Tt.handleVerticalTrackMouseDown.bind(Tt),Tt.handleHorizontalThumbMouseDown=Tt.handleHorizontalThumbMouseDown.bind(Tt),Tt.handleVerticalThumbMouseDown=Tt.handleVerticalThumbMouseDown.bind(Tt),Tt.handleWindowResize=Tt.handleWindowResize.bind(Tt),Tt.handleScroll=Tt.handleScroll.bind(Tt),Tt.handleDrag=Tt.handleDrag.bind(Tt),Tt.handleDragEnd=Tt.handleDragEnd.bind(Tt),Tt.state={didMountUniversal:!1},Tt}return n(Bt,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){var Mt=this.props.universal;Mt&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,a.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){return this.view?this.view.scrollLeft:0}},{key:"getScrollTop",value:function(){return this.view?this.view.scrollTop:0}},{key:"getScrollWidth",value:function(){return this.view?this.view.scrollWidth:0}},{key:"getScrollHeight",value:function(){return this.view?this.view.scrollHeight:0}},{key:"getClientWidth",value:function(){return this.view?this.view.clientWidth:0}},{key:"getClientHeight",value:function(){return this.view?this.view.clientHeight:0}},{key:"getValues",value:function(){var Mt=this.view||{},jt=Mt.scrollLeft,$t=jt===void 0?0:jt,_t=Mt.scrollTop,Tt=_t===void 0?0:_t,Pt=Mt.scrollWidth,Ht=Pt===void 0?0:Pt,Zt=Mt.scrollHeight,Vt=Zt===void 0?0:Zt,Yt=Mt.clientWidth,Jt=Yt===void 0?0:Yt,Kt=Mt.clientHeight,qt=Kt===void 0?0:Kt;return{left:$t/(Ht-Jt)||0,top:Tt/(Vt-qt)||0,scrollLeft:$t,scrollTop:Tt,scrollWidth:Ht,scrollHeight:Vt,clientWidth:Jt,clientHeight:qt}}},{key:"getThumbHorizontalWidth",value:function(){var Mt=this.props,jt=Mt.thumbSize,$t=Mt.thumbMinSize,_t=this.view,Tt=_t.scrollWidth,Pt=_t.clientWidth,Ht=(0,gt.default)(this.trackHorizontal),Zt=Math.ceil(Pt/Tt*Ht);return Ht<=Zt?0:jt||Math.max(Zt,$t)}},{key:"getThumbVerticalHeight",value:function(){var Mt=this.props,jt=Mt.thumbSize,$t=Mt.thumbMinSize,_t=this.view,Tt=_t.scrollHeight,Pt=_t.clientHeight,Ht=(0,Et.default)(this.trackVertical),Zt=Math.ceil(Pt/Tt*Ht);return Ht<=Zt?0:jt||Math.max(Zt,$t)}},{key:"getScrollLeftForOffset",value:function(Mt){var jt=this.view,$t=jt.scrollWidth,_t=jt.clientWidth,Tt=(0,gt.default)(this.trackHorizontal),Pt=this.getThumbHorizontalWidth();return Mt/(Tt-Pt)*($t-_t)}},{key:"getScrollTopForOffset",value:function(Mt){var jt=this.view,$t=jt.scrollHeight,_t=jt.clientHeight,Tt=(0,Et.default)(this.trackVertical),Pt=this.getThumbVerticalHeight();return Mt/(Tt-Pt)*($t-_t)}},{key:"scrollLeft",value:function(){var Mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollLeft=Mt)}},{key:"scrollTop",value:function(){var Mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollTop=Mt)}},{key:"scrollToLeft",value:function(){this.view&&(this.view.scrollLeft=0)}},{key:"scrollToTop",value:function(){this.view&&(this.view.scrollTop=0)}},{key:"scrollToRight",value:function(){this.view&&(this.view.scrollLeft=this.view.scrollWidth)}},{key:"scrollToBottom",value:function(){this.view&&(this.view.scrollTop=this.view.scrollHeight)}},{key:"addListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Mt=this.view,jt=this.trackHorizontal,$t=this.trackVertical,_t=this.thumbHorizontal,Tt=this.thumbVertical;Mt.addEventListener("scroll",this.handleScroll),(0,pt.default)()&&(jt.addEventListener("mouseenter",this.handleTrackMouseEnter),jt.addEventListener("mouseleave",this.handleTrackMouseLeave),jt.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),$t.addEventListener("mouseenter",this.handleTrackMouseEnter),$t.addEventListener("mouseleave",this.handleTrackMouseLeave),$t.addEventListener("mousedown",this.handleVerticalTrackMouseDown),_t.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),Tt.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Mt=this.view,jt=this.trackHorizontal,$t=this.trackVertical,_t=this.thumbHorizontal,Tt=this.thumbVertical;Mt.removeEventListener("scroll",this.handleScroll),(0,pt.default)()&&(jt.removeEventListener("mouseenter",this.handleTrackMouseEnter),jt.removeEventListener("mouseleave",this.handleTrackMouseLeave),jt.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),$t.removeEventListener("mouseenter",this.handleTrackMouseEnter),$t.removeEventListener("mouseleave",this.handleTrackMouseLeave),$t.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),_t.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),Tt.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(Mt){var jt=this,$t=this.props,_t=$t.onScroll,Tt=$t.onScrollFrame;_t&&_t(Mt),this.update(function(Pt){var Ht=Pt.scrollLeft,Zt=Pt.scrollTop;jt.viewScrollLeft=Ht,jt.viewScrollTop=Zt,Tt&&Tt(Pt)}),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var Mt=this.props.onScrollStart;Mt&&Mt(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.showTracks()}},{key:"handleScrollStop",value:function(){var Mt=this.props.onScrollStop;Mt&&Mt(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"handleWindowResize",value:function(){(0,pt.default)(!1),this.forceUpdate()}},{key:"handleHorizontalTrackMouseDown",value:function(Mt){Mt.preventDefault();var jt=Mt.target,$t=Mt.clientX,_t=jt.getBoundingClientRect(),Tt=_t.left,Pt=this.getThumbHorizontalWidth(),Ht=Math.abs(Tt-$t)-Pt/2;this.view.scrollLeft=this.getScrollLeftForOffset(Ht)}},{key:"handleVerticalTrackMouseDown",value:function(Mt){Mt.preventDefault();var jt=Mt.target,$t=Mt.clientY,_t=jt.getBoundingClientRect(),Tt=_t.top,Pt=this.getThumbVerticalHeight(),Ht=Math.abs(Tt-$t)-Pt/2;this.view.scrollTop=this.getScrollTopForOffset(Ht)}},{key:"handleHorizontalThumbMouseDown",value:function(Mt){Mt.preventDefault(),this.handleDragStart(Mt);var jt=Mt.target,$t=Mt.clientX,_t=jt.offsetWidth,Tt=jt.getBoundingClientRect(),Pt=Tt.left;this.prevPageX=_t-($t-Pt)}},{key:"handleVerticalThumbMouseDown",value:function(Mt){Mt.preventDefault(),this.handleDragStart(Mt);var jt=Mt.target,$t=Mt.clientY,_t=jt.offsetHeight,Tt=jt.getBoundingClientRect(),Pt=Tt.top;this.prevPageY=_t-($t-Pt)}},{key:"setupDragging",value:function(){(0,c.default)(document.body,Ct.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=mt.default}},{key:"teardownDragging",value:function(){(0,c.default)(document.body,Ct.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(Mt){this.dragging=!0,Mt.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(Mt){if(this.prevPageX){var jt=Mt.clientX,$t=this.trackHorizontal.getBoundingClientRect(),_t=$t.left,Tt=this.getThumbHorizontalWidth(),Pt=Tt-this.prevPageX,Ht=-_t+jt-Pt;this.view.scrollLeft=this.getScrollLeftForOffset(Ht)}if(this.prevPageY){var Zt=Mt.clientY,Vt=this.trackVertical.getBoundingClientRect(),Yt=Vt.top,Jt=this.getThumbVerticalHeight(),Kt=Jt-this.prevPageY,qt=-Yt+Zt-Kt;this.view.scrollTop=this.getScrollTopForOffset(qt)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,c.default)(this.trackHorizontal,{opacity:1}),(0,c.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var Mt=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var jt=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout(function(){(0,c.default)(Mt.trackHorizontal,{opacity:0}),(0,c.default)(Mt.trackVertical,{opacity:0})},jt)}}},{key:"detectScrolling",value:function(){var Mt=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval(function(){Mt.lastViewScrollLeft===Mt.viewScrollLeft&&Mt.lastViewScrollTop===Mt.viewScrollTop&&(clearInterval(Mt.detectScrollingInterval),Mt.scrolling=!1,Mt.handleScrollStop()),Mt.lastViewScrollLeft=Mt.viewScrollLeft,Mt.lastViewScrollTop=Mt.viewScrollTop},100))}},{key:"raf",value:function(Mt){var jt=this;this.requestFrame&&s.default.cancel(this.requestFrame),this.requestFrame=(0,s.default)(function(){jt.requestFrame=void 0,Mt()})}},{key:"update",value:function(Mt){var jt=this;this.raf(function(){return jt._update(Mt)})}},{key:"_update",value:function(Mt){var jt=this.props,$t=jt.onUpdate,_t=jt.hideTracksWhenNotNeeded,Tt=this.getValues();if((0,pt.default)()){var Pt=Tt.scrollLeft,Ht=Tt.clientWidth,Zt=Tt.scrollWidth,Vt=(0,gt.default)(this.trackHorizontal),Yt=this.getThumbHorizontalWidth(),Jt=Pt/(Zt-Ht)*(Vt-Yt),Kt={width:Yt,transform:"translateX("+Jt+"px)"},qt=Tt.scrollTop,ir=Tt.clientHeight,tr=Tt.scrollHeight,rr=(0,Et.default)(this.trackVertical),cr=this.getThumbVerticalHeight(),Qt=qt/(tr-ir)*(rr-cr),hr={height:cr,transform:"translateY("+Qt+"px)"};if(_t){var dr={visibility:Zt>Ht?"visible":"hidden"},ur={visibility:tr>ir?"visible":"hidden"};(0,c.default)(this.trackHorizontal,dr),(0,c.default)(this.trackVertical,ur)}(0,c.default)(this.thumbHorizontal,Kt),(0,c.default)(this.thumbVertical,hr)}$t&&$t(Tt),typeof Mt=="function"&&Mt(Tt)}},{key:"render",value:function(){var Mt=this,jt=(0,pt.default)(),$t=this.props;$t.onScroll,$t.onScrollFrame,$t.onScrollStart,$t.onScrollStop,$t.onUpdate;var _t=$t.renderView,Tt=$t.renderTrackHorizontal,Pt=$t.renderTrackVertical,Ht=$t.renderThumbHorizontal,Zt=$t.renderThumbVertical,Vt=$t.tagName;$t.hideTracksWhenNotNeeded;var Yt=$t.autoHide;$t.autoHideTimeout;var Jt=$t.autoHideDuration;$t.thumbSize,$t.thumbMinSize;var Kt=$t.universal,qt=$t.autoHeight,ir=$t.autoHeightMin,tr=$t.autoHeightMax,rr=$t.style,cr=$t.children,Qt=At($t,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),hr=this.state.didMountUniversal,dr=t({},Ct.containerStyleDefault,qt&&t({},Ct.containerStyleAutoHeight,{minHeight:ir,maxHeight:tr}),rr),ur=t({},Ct.viewStyleDefault,{marginRight:jt?-jt:0,marginBottom:jt?-jt:0},qt&&t({},Ct.viewStyleAutoHeight,{minHeight:(0,tt.default)(ir)?"calc("+ir+" + "+jt+"px)":ir+jt,maxHeight:(0,tt.default)(tr)?"calc("+tr+" + "+jt+"px)":tr+jt}),qt&&Kt&&!hr&&{minHeight:ir,maxHeight:tr},Kt&&!hr&&Ct.viewStyleUniversalInitial),xr={transition:"opacity "+Jt+"ms",opacity:0},Cr=t({},Ct.trackHorizontalStyleDefault,Yt&&xr,(!jt||Kt&&!hr)&&{display:"none"}),Or=t({},Ct.trackVerticalStyleDefault,Yt&&xr,(!jt||Kt&&!hr)&&{display:"none"});return(0,Le.createElement)(Vt,t({},Qt,{style:dr,ref:function(Sr){Mt.container=Sr}}),[(0,Le.cloneElement)(_t({style:ur}),{key:"view",ref:function(Sr){Mt.view=Sr}},cr),(0,Le.cloneElement)(Tt({style:Cr}),{key:"trackHorizontal",ref:function(Sr){Mt.trackHorizontal=Sr}},(0,Le.cloneElement)(Ht({style:Ct.thumbHorizontalStyleDefault}),{ref:function(Sr){Mt.thumbHorizontal=Sr}})),(0,Le.cloneElement)(Pt({style:Or}),{key:"trackVertical",ref:function(Sr){Mt.trackVertical=Sr}},(0,Le.cloneElement)(Zt({style:Ct.thumbVerticalStyleDefault}),{ref:function(Sr){Mt.thumbVertical=Sr}}))])}}]),Bt}(Le.Component);e.default=Ot,Ot.propTypes={onScroll:ze.default.func,onScrollFrame:ze.default.func,onScrollStart:ze.default.func,onScrollStop:ze.default.func,onUpdate:ze.default.func,renderView:ze.default.func,renderTrackHorizontal:ze.default.func,renderTrackVertical:ze.default.func,renderThumbHorizontal:ze.default.func,renderThumbVertical:ze.default.func,tagName:ze.default.string,thumbSize:ze.default.number,thumbMinSize:ze.default.number,hideTracksWhenNotNeeded:ze.default.bool,autoHide:ze.default.bool,autoHideTimeout:ze.default.number,autoHideDuration:ze.default.number,autoHeight:ze.default.bool,autoHeightMin:ze.default.oneOfType([ze.default.number,ze.default.string]),autoHeightMax:ze.default.oneOfType([ze.default.number,ze.default.string]),universal:ze.default.bool,style:ze.default.object,children:ze.default.node},Ot.defaultProps={renderView:Rt.renderViewDefault,renderTrackHorizontal:Rt.renderTrackHorizontalDefault,renderTrackVertical:Rt.renderTrackVerticalDefault,renderThumbHorizontal:Rt.renderThumbHorizontalDefault,renderThumbVertical:Rt.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}}(Scrollbars)),Scrollbars}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scrollbars=void 0;var t=requireScrollbars(),n=a(t);function a(s){return s&&s.__esModule?s:{default:s}}e.default=n.default,e.Scrollbars=n.default}(lib)),lib}var libExports=requireLib();const CustomScrollbar=React.memo(React.forwardRef(({adjustWithScreen:e,children:t,renderViewClassName:n,fullHeight:a,...s},o)=>{const[c,Le]=React.useState(window.innerHeight),$e=React.useRef(null);return useEventListener("resize",()=>{e&&Le(window.innerHeight)}),React.useImperativeHandle(o,()=>({get getInstance(){return $e.current},scrollToTop:()=>{$e.current&&$e.current.scrollToTop()},scrollToRight:()=>{$e.current&&$e.current.scrollToRight()}}),[]),jsxRuntimeExports.jsx(libExports.Scrollbars,{ref:$e,autoHide:!0,renderTrackVertical:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"h-full top-0 right-0 rounded-md z-[1001] !w-scrollbar-size",...tt}),renderThumbVertical:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"rounded-md bg-[#00000033] dark:bg-black-500 absolute right-0.5 !w-2",...tt}),renderTrackHorizontal:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"w-full bottom-0 left-0 rounded-md z-[1001] !h-scrollbar-size ",...tt}),renderThumbHorizontal:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"rounded-md bg-[#00000033] dark:bg-black-500 absolute bottom-0.5 !h-2",...tt}),renderView:et=>jsxRuntimeExports.jsx("div",{className:cn$1("!-mr-scrollbar-size h-full !-mb-scrollbar-size",n,a?"!h-[calc(100%+var(--scroll-bar-size))]":""),...et}),...s,style:{...s.style||{},zIndex:0,...!s.autoHeight&&!s.style?.height?{height:a?"100%":c,overflowX:"hidden"}:{}},children:t})}));CustomScrollbar.displayName="CustomScrollbar";const MdInput=({id:e,value:t="",onChange:n,placeholder:a="Enter markdown content...",rows:s=1,disabled:o=!1,className:c,textareaClassName:Le,previewClassName:$e,defaultMode:ze="markdown",mode:et,label:tt,required:dt=!1})=>{const[pt,xt]=React.useState(ze),[mt,bt]=React.useState(!1),gt=e||`md-input-${Math.random().toString(36).slice(2,11)}`,yt=React.useMemo(()=>{if(!t)return s;const Rt=(t.match(/\n/g)||[]).length+1;return Math.min(18,Rt)},[t,s]),Et=et??pt,Ct=et!==void 0;return jsxRuntimeExports.jsxs("div",{className:cn$1("flex flex-col gap-2",c),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[!Ct&&jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:jsxRuntimeExports.jsxs("div",{className:"inline-flex grow-0 p-1 rounded-lg bg-neutral-100 dark:bg-black-700 w-auto",children:[jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",Et==="markdown"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>xt("markdown"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(Et==="markdown"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Markdown"})}),jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",Et==="preview"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>xt("preview"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(Et==="preview"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Preview"})})]})}),tt&&jsxRuntimeExports.jsxs("label",{htmlFor:gt,className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:[tt,dt&&jsxRuntimeExports.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),jsxRuntimeExports.jsx("div",{className:"relative",children:Et==="markdown"?jsxRuntimeExports.jsx("textarea",{id:gt,value:t,onChange:Rt=>n(Rt.target.value),placeholder:a,rows:yt,disabled:o,required:dt,className:cn$1("w-full border rounded-lg bg-white dark:bg-black-600","py-2.5 px-3 font-inter font-medium text-sm","text-gray-900 dark:text-gray-100","placeholder:text-gray-400 dark:placeholder:text-gray-500","transition-colors duration-200","focus:ring-2 focus:outline-none resize-vertical","border-gray-300 dark:border-gray-600","focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20",{"bg-gray-50 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed":o},Le),onClick:Rt=>Rt.stopPropagation()}):jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("div",{className:cn$1("w-full rounded-lg","py-2.5 px-3 min-h-[calc(2.5rem*var(--rows,8))]","text-sm",$e),style:{"--rows":yt>3?yt-3:yt},children:jsxRuntimeExports.jsx(CustomScrollbar,{autoHeight:!0,autoHeightMax:`calc(1rem * ${yt>3?yt-3:yt})`,children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})}),jsxRuntimeExports.jsx("button",{onClick:()=>bt(!0),className:"absolute bottom-2 right-2 p-1 rounded-md bg-neutral-100 dark:bg-black-600 hover:bg-gray-200 dark:hover:bg-black-500 transition-colors shadow-sm flex items-center justify-center",title:"Expand preview",type:"button",children:jsxRuntimeExports.jsx(AllIcons.OpenInFull,{sx:{fontSize:"16px"},className:"text-neutral-600 dark:text-neutral-400"})})]})}),jsxRuntimeExports.jsx(Modal,{open:mt,onCancel:()=>bt(!1),title:"Markdown Preview",width:800,footer:null,children:jsxRuntimeExports.jsx(CustomScrollbar,{autoHeight:!0,autoHeightMax:"70vh",children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})})]})};function FiDownload(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function FiTrash2(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}const{Dragger:Dragger$1}=antd.Upload,defaultFormatFileSize=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,shortenFileName=(e,t=20)=>e?e.length<=t?e:e.slice(0,t-7)+"...."+e.slice(-7):"",MultiFileUpload=React.forwardRef(({id:e,onFileChange:t,description:n,errorMessage:a,disabled:s=!1,defaultFile:o=null,acceptedFiles:c="*",isLoading:Le=!1,asBase64:$e=!1,toFileServer:ze=!1,setFileUploading:et,fileUploading:tt=!1,multiple:dt=!1,getRealFileName:pt=!1,maxSize:xt=50*1024*1024,onUpload:mt,onDelete:bt,wrapperClassName:gt,uploadClassName:yt,showFileSize:Et=!0,formatFileSize:Ct=defaultFormatFileSize},Rt)=>{const[St,At]=React.useState(null),[It,Lt]=React.useState([]),[zt,Ot]=React.useState("#d9d9d9"),[kt,Bt]=React.useState(!1),[Nt,Mt]=React.useState(null),jt=React.useCallback(async()=>{if(mt)try{const Tt=await mt(It),Pt=dt?Tt?.map(Zt=>Zt?.fileUrl):Tt?.[0]?.fileUrl,Ht=pt?St?.name:Tt?.[0]?.fileName;t(Pt,Ht),et?.(null)}catch(Tt){console.error("Upload failed:",Tt),et?.(null)}},[mt,It,dt,St,pt,t,et]),$t={accept:c,multiple:dt,showUploadList:!1,disabled:s,onRemove:()=>{Lt([])},beforeUpload:(Tt,Pt)=>{if(Tt.size>xt){const Ht=(xt/1048576).toFixed(0);return console.error(`File size exceeds ${Ht}MB limit`),!1}return At(Tt),ze?(et?.(e||"field-file-upload"),Lt(Pt)):($e?Promise.all((dt?Pt:[Tt]).map(Ht=>new Promise(Zt=>{const Vt=new FileReader;Vt.onload=Yt=>{Zt({filename:Ht.name,content:Yt?.target?.result?.split(",")[1]})},Vt.readAsDataURL(Ht)}))).then(Ht=>{t(dt?Ht:Ht[0])}):t(Tt),At(Tt)),!1}},_t=async()=>{if(ze&&Nt&&bt)try{await bt(Nt),Mt(null)}catch(Tt){console.error("Delete failed:",Tt)}At(null),Lt([]),t(null)};return React.useEffect(()=>{Ot(a?"#EF4444":"#d9d9d9")},[a]),React.useEffect(()=>{It.length&&ze&&jt()},[It,ze,jt]),React.useEffect(()=>{o?.name&&At(o)},[o]),jsxRuntimeExports.jsxs("div",{ref:Rt,className:cn$1("w-full",gt),children:[jsxRuntimeExports.jsx("div",{className:"h-32",onMouseEnter:()=>Bt(!0),onMouseLeave:()=>Bt(!1),children:jsxRuntimeExports.jsx(Dragger$1,{...$t,className:yt,style:{borderColor:kt&&!a?"#1890ff":zt},disabled:s||tt,children:St?jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mx-5",title:St?.name||o?.name||"",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-4",children:[St?.type==="application/pdf"?jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(BsFiletypePdf,{size:20,fill:"#006CCF"})}):jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(AllIcons.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#006CCF"}})}),jsxRuntimeExports.jsxs("div",{className:"text-left",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"font-inter text-md font-medium text-base",children:shortenFileName(St?.name||o?.name||"")}),tt?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Uploading..."}):Et&&St?.size>0?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:Ct(St.size)}):null]})]}),Le?jsxRuntimeExports.jsx(CgSpinner,{size:40,className:"spinner text-primary-600"}):jsxRuntimeExports.jsx("button",{id:`btn-file-upload-${e}`,className:"ml-4",onClick:Tt=>{Tt.stopPropagation(),_t()},disabled:s,type:"button","aria-label":"Delete file",children:jsxRuntimeExports.jsx(FiTrash2,{size:20,className:"text-gray-400"})})]}):jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center",children:jsxRuntimeExports.jsxs("div",{className:"flex-col",children:[jsxRuntimeExports.jsx("div",{className:"mb-4 flex justify-center",children:jsxRuntimeExports.jsx(FiDownload,{size:24,className:"text-gray-400"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:"Click to upload"}),jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"ml-1",appearance:"subtitle",children:"or drag and drop"})]}),n?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:n}):null]})]})})})}),a&&jsxRuntimeExports.jsx(Typography,{className:"text-red-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]})});MultiFileUpload.displayName="MultiFileUpload";const roundedIconNames=Object.keys(AllIcons__namespace).filter(e=>e?.endsWith("Rounded")),mergedIconNames=[...roundedIconNames||[],...(COUNTRY_CODES||[]).map(e=>`flag-${e}`)],formatIconName=e=>{if(e?.startsWith("flag-")){const t=e?.replace("flag-","");return countryNameFromCode(t||"")||t}return e.replaceAll(/([A-Z])/g," $1").trim()},IconPickerContent=({onChange:e,selectedIcon:t,setOpen:n})=>{const[a,s]=React.useState(""),o=(mergedIconNames||[]).filter(Le=>{if(Le?.startsWith("flag-")){const $e=Le?.replace("flag-","");return $e?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")||countryNameFromCode($e||"")?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}return Le?.trim()?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}),c=(Le,$e)=>{if($e.stopPropagation(),t===Le){e?.(null);return}e?.(Le),n?.(!1)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntimeExports.jsx(InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:Le=>s(Le||""),fieldSuffix:jsxRuntimeExports.jsx(AllIcons__namespace.Search,{sx:{width:16,height:16,color:"rgb(152 162 179)"}})}),jsxRuntimeExports.jsx(reactWindow.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((o?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:Le,rowIndex:$e,style:ze})=>{const et=$e*5+Le,tt=o?.[et];return tt?jsxRuntimeExports.jsx("div",{style:{...ze,padding:"4px"},children:jsxRuntimeExports.jsx(antd.Tooltip,{title:formatIconName(tt),children:jsxRuntimeExports.jsx(material.IconButton,{className:cn$1("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":t===tt}),onClick:dt=>c(tt,dt),children:jsxRuntimeExports.jsx(IconRenderer,{iconName:tt,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"})})})}):null}})]})},IconRenderer=({iconName:e,sx:t,className:n,isHovering:a})=>{if(e?.startsWith?.("flag-")){const o=e?.replace("flag-","");return getFlagComponent?.(o||"",a||!1)||jsxRuntimeExports.jsx("div",{children:"-"})}const s=AllIcons__namespace?.[e];return s?jsxRuntimeExports.jsx(s,{sx:t,className:n,isHovering:a}):jsxRuntimeExports.jsx("div",{children:"-"})},IconPickerBase=({selectedIcon:e,onChange:t,label:n,required:a=!1,allowClear:s=!0,disabled:o=!1,errorMessage:c})=>{const[Le,$e]=React.useState(!1),ze=et=>{et.stopPropagation(),t?.("")};return jsxRuntimeExports.jsx(antd.Popover,{arrow:!1,placement:"bottom",trigger:"click",getPopupContainer:et=>et?.parentElement||document.body,open:Le,onOpenChange:$e,content:jsxRuntimeExports.jsx(IconPickerContent,{onChange:t,selectedIcon:e,setOpen:$e}),children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[n?jsxRuntimeExports.jsxs(Typography,{size:"extra-small",variant:"medium",appearance:"body",children:[n,a&&jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"*"})]}):null,jsxRuntimeExports.jsxs("button",{id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`min-w-[83px] py-1.5 px-3 rounded-md border ${o?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${c?"border-red-500":"focus:border-primary-200 "} flex items-center justify-between gap-2`,disabled:o,onClick:et=>{o&&(et.preventDefault(),et.stopPropagation())},children:[e?jsxRuntimeExports.jsx(IconRenderer,{iconName:e,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"}):jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Select Icon"}),e&&s&&!o?jsxRuntimeExports.jsx(AllIcons__namespace.CloseRounded,{sx:{width:20,height:20},className:"hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:ze}):null]}),c&&jsxRuntimeExports.jsx(Typography,{size:"extra-small",className:"text-red-500 font-medium",children:c})]})})},IconPicker=React.lazy(()=>Promise.resolve({default:e=>jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntimeExports.jsx("div",{className:"min-w-[83px] h-[30px] animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:jsxRuntimeExports.jsx(IconPickerBase,{...e})})})),StatusColorMapping=React.forwardRef(({status:e,children:t,className:n,size:a="medium","aria-label":s},o)=>{const c=()=>{switch(a){case"small":return"text-xs px-1.5 py-0.5";case"large":return"text-base px-3 py-1.5";default:return"text-md px-1.5 py-1"}},Le=()=>{switch(e?.toLowerCase()){case"purple":return"bg-purple-50 text-purple-500 border border-purple-100 dark:bg-purple-950 dark:text-purple-400 dark:border-purple-800";case"blue":return"bg-blue-50 text-blue-500 border border-blue-100 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800";case"teal":return"bg-teal-50 text-teal-500 border border-teal-100 dark:bg-teal-950 dark:text-teal-400 dark:border-teal-800";case"green":return"bg-green-50 text-green-500 border border-green-100 dark:bg-green-950 dark:text-green-400 dark:border-green-800";case"yellow":return"bg-yellow-50 text-yellow-600 border border-yellow-100 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800";case"orange":return"bg-orange-50 text-orange-500 border border-orange-100 dark:bg-orange-950 dark:text-orange-400 dark:border-orange-800";case"peach":return"bg-orange-50 text-orange-400 border border-orange-100 dark:bg-orange-950 dark:text-orange-300 dark:border-orange-800";case"red":return"bg-red-50 text-red-500 border border-red-100 dark:bg-red-950 dark:text-red-400 dark:border-red-800";case"navy":return"bg-slate-50 text-slate-700 border border-slate-100 dark:bg-slate-950 dark:text-slate-400 dark:border-slate-800";case"grey":return"bg-neutral-50 text-neutral-500 border border-neutral-100 dark:bg-neutral-950 dark:text-neutral-400 dark:border-neutral-800";default:return"bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800"}};return jsxRuntimeExports.jsx("span",{ref:o,className:cn$1("inline-flex items-center justify-center font-medium rounded-md transition-colors",c(),Le(),n),"aria-label":s||`Status: ${e||"default"}`,role:"status",children:t})});StatusColorMapping.displayName="StatusColorMapping";const Badge=React.forwardRef(({status:e="default",children:t,appearance:n="outline",size:a="md",className:s,isRounded:o=!1,capitalize:c=!0,"aria-label":Le},$e)=>{const ze=xt=>!xt||!c?xt:xt.replace(/\w\S*/g,mt=>mt.charAt(0).toUpperCase()+mt.substr(1).toLowerCase()),et=()=>{switch(a){case"sm":return"text-xs px-1.5 py-0.5";case"lg":return"text-sm px-3 py-1.5";default:return"text-xs px-2 py-1"}},tt=()=>{switch(e){case"primary":case"default":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";case"warning":return"bg-yellow-50 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-300 border border-yellow-300 dark:border-yellow-700";case"error":return"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-300 border border-red-300 dark:border-red-700";case"neutral":return"bg-neutral-50 dark:bg-neutral-950 text-neutral-600 dark:text-neutral-300 border border-neutral-300 dark:border-neutral-700";case"success":return"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-300 border border-green-300 dark:border-green-700";case"info":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";default:return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700"}},dt=()=>{switch(e){case"primary":case"default":return"bg-blue-600 dark:bg-blue-700 text-white";case"warning":return"bg-yellow-600 dark:bg-yellow-700 text-white";case"success":return"bg-green-600 dark:bg-green-700 text-white";case"error":return"bg-red-600 dark:bg-red-700 text-white";case"neutral":return"bg-neutral-600 dark:bg-neutral-700 text-white";case"info":return"bg-blue-600 dark:bg-blue-700 text-white";default:return"bg-blue-600 dark:bg-blue-700 text-white"}},pt=()=>n==="filled"?dt():tt();return jsxRuntimeExports.jsx("span",{ref:$e,className:cn$1("inline-flex items-center justify-center font-medium transition-colors",o?"rounded-full":"rounded",et(),pt(),s),"aria-label":Le||`Badge: ${e}`,role:"status",children:ze(t)})});Badge.displayName="Badge";const HelmetTitle=({title:e,children:t})=>e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t}):null;HelmetTitle.displayName="HelmetTitle";const Card=({children:e,className:t="",title:n,style:a,id:s})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HelmetTitle,{title:n}),jsxRuntimeExports.jsx("div",{className:`bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 rounded-lg shadow-100 w-full flex flex-col ${t}`,style:a,id:s,children:e})]});Card.displayName="Card";const Drawer=({id:e,children:t,onClose:n,open:a,title:s,parentContainer:o="full-screen-container",resizable:c,width:Le=400,placement:$e="right",closable:ze=!1,mask:et,classNames:tt,styles:dt,getContainer:pt,zIndex:xt,footer:mt,...bt})=>{const gt=React.useRef(!1),[yt,Et]=React.useState(Le);React.useEffect(()=>{Et(Le)},[a,Le]);const Ct=React.useCallback(At=>{if(gt.current)if($e==="right"){const It=document.body.offsetWidth-(At.clientX-document.body.offsetLeft);It>256&&Et(It)}else At.clientX>256&&Et(At.clientX)},[$e,Et]),Rt=React.useCallback(()=>{gt.current&&(gt.current=!1)},[]);React.useEffect(()=>(document.addEventListener("mousemove",Ct),document.addEventListener("mouseup",Rt),()=>{document.removeEventListener("mousemove",Ct),document.removeEventListener("mouseup",Rt)}),[Ct,Rt]);const St=typeof window<"u"?document.getElementById(o)||document.body:null;return St?ReactDOM.createPortal(jsxRuntimeExports.jsxs(antd.Drawer,{id:e||"",closable:ze,title:s,onClose:n,open:a,width:yt,getContainer:pt!==void 0?pt:!1,placement:$e,mask:et,classNames:tt,styles:dt,zIndex:xt,footer:mt,...bt,children:[c&&jsxRuntimeExports.jsx("div",{className:"cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",onMouseDown:()=>{gt.current=!0},style:$e==="right"?{left:0}:{right:0}}),t]}),St):null};Drawer.displayName="Drawer";const FloatingElementWrapper=({children:e,showAsModal:t,...n})=>t?jsxRuntimeExports.jsx(Modal,{onCancel:n.onClose,...n,children:e}):jsxRuntimeExports.jsx(Drawer,{...n,children:e}),formatBooleanValue=e=>e===1||e==="1"||typeof e=="string"&&e.toLowerCase()==="yes"||typeof e=="string"&&e.toLowerCase()==="true"?"Yes":e===0||e==="0"||typeof e=="string"&&e.toLowerCase()==="no"||typeof e=="string"&&e.toLowerCase()==="false"?"No":e?.toString()||"-",formatCurrency=(e,t="USD")=>{try{if(e==null)return"";const n=Number(e);if(isNaN(n))return e?.toString()||"";const a=n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$",CHF:"CHF",CNY:"¥",SEK:"kr",NOK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft",RUB:"₽",BRL:"R$",INR:"₹",KRW:"₩",SGD:"S$",HKD:"HK$",NZD:"NZ$",MXN:"$",ZAR:"R",TRY:"₺",ILS:"₪",AED:"د.إ",SAR:"﷼",QAR:"﷼",KWD:"د.ك",BHD:"د.ب",OMR:"﷼",JOD:"د.ا",LBP:"ل.ل",EGP:"£",MAD:"د.م.",TND:"د.ت",DZD:"د.ج",LYD:"ل.د",SDG:"ج.س.",ETB:"Br",KES:"KSh",UGX:"USh",TZS:"TSh",ZMW:"ZK",BWP:"P",ZWL:"Z$",AOA:"Kz",MZN:"MT",GHS:"₵",NGN:"₦",XAF:"FCFA",XOF:"CFA",CDF:"FC",RWF:"RF",BIF:"FBu",KMF:"CF",DJF:"Fdj",SOS:"S",ERN:"Nfk"}[t]||"$"}${a}`}catch{return"-"}},formatDate=(e,t={})=>{const{format:n,relative:a=!1,withTime:s=!0,fallback:o="-",skipTimezone:c=!1,onlyTime:Le=!1}=t||{};if(!e)return o;try{const $e=new Date(e);if(isNaN($e.getTime()))return o;if(a){const pt=Math.floor((new Date().getTime()-$e.getTime())/1e3);return pt<60?"just now":pt<3600?`${Math.floor(pt/60)} minutes ago`:pt<86400?`${Math.floor(pt/3600)} hours ago`:pt<2592e3?`${Math.floor(pt/86400)} days ago`:pt<31536e3?`${Math.floor(pt/2592e3)} months ago`:`${Math.floor(pt/31536e3)} years ago`}const ze="MM/dd/yyyy",et="hh:mm a",tt=s&&!Le;return $e.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:s?"2-digit":void 0,minute:s?"2-digit":void 0,hour12:!0})}catch{return o}},isISODateString=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e),LabelValue=React.forwardRef(({id:e,label:t,value:n,className:a,type:s="string",tags:o,tooltip:c,items:Le,isModified:$e=!1,isChanged:ze=!1,size:et="medium",isHighlighted:tt=!1,deletedValue:dt,highlightColor:pt="warning",isSearchActive:xt=!1,originalValue:mt=!1,showDiff:bt=!1,isLiveField:gt=!1,deltaChange:yt,theme:Et="light",onUpload:Ct,acceptsUpload:Rt=!1,MasterDataModal:St,riskDetails:At,isRiskAnalysisOpen:It=!1,RiskDetailsCard:Lt,"aria-label":zt},Ot)=>{const[kt,Bt]=React.useState(!0),[Nt,Mt]=React.useState(!1),[jt,$t]=React.useState(null),[_t,Tt]=React.useState(!1),Pt=()=>{Bt(!kt)},Ht=qt=>{Mt(!0),$t({...qt,value:n})},Zt=()=>{Mt(!1),$t(null)},Vt=qt=>{const ir=qt.target.files?.[0];ir&&Ct&&Ct(ir),qt.target.value=""},Yt=()=>{const qt=typeof n=="string"&&isISODateString(n);if(xt&&typeof n=="object")return n;if(n||s==="boolean"&&n===0||s==="currency"&&Number(n)>=0){if((n===!0||n==="True")&&!mt)return"Yes";if((n===!1||n==="False")&&!mt)return"No";if(s==="url")return jsxRuntimeExports.jsx("a",{href:n,className:"text-primary-600 truncate",children:n});if(s==="boolean")return formatBooleanValue(n);if(s==="currency")return formatCurrency(n,Le?.currency_code)||"-";if(s==="datetime"){const ir=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(ir,{skipTimezone:!1,withTime:!0})}else if(s==="date"||qt){const ir=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(ir,{skipTimezone:!0,withTime:!1})}else return s==="percentage"?`${n}%`:typeof n=="string"&&n.length>100?jsxRuntimeExports.jsxs("p",{children:[n.slice(0,kt?100:n.length),kt?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${kt?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Pt,onKeyDown:ir=>{(ir.key==="Enter"||ir.key===" ")&&(ir.preventDefault(),Pt())},"aria-label":kt?"Show more content":"Show less content",type:"button",children:kt?"Show more":"Show less"})]}):n}return"-"},Jt=()=>{switch(et){case"small":return"extra-small";case"large":return"large";default:return"small"}},Kt=()=>{switch(pt){case"success":return"bg-success-100";case"warning":return"bg-warning-100";case"error":return"bg-error-100";case"info":return"bg-info-100";default:return"bg-warning-100"}};return jsxRuntimeExports.jsxs("div",{id:e||"",ref:Ot,className:cn$1("font-medium relative",a),onMouseEnter:()=>Tt(!0),onMouseLeave:()=>Tt(!1),"aria-label":zt||`Label: ${t}, Value: ${n}`,children:[jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:Jt(),className:"flex gap-1 flex-wrap",appearance:"subtitle",children:[t," ",jsxRuntimeExports.jsx(Label,{labels:o?.map(qt=>({...qt,color:qt.color||"primary"}))}),gt&&jsxRuntimeExports.jsx(AllIcons.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),o&&o.length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o.map(qt=>jsxRuntimeExports.jsx(Tag,{label:qt.label,color:qt.color,size:"xs"},`${qt.label}-${qt.value||qt.color}`))}),c&&jsxRuntimeExports.jsx(antd.Tooltip,{placement:"top",title:c,children:jsxRuntimeExports.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:qt=>{(qt.key==="Enter"||qt.key===" ")&&qt.preventDefault()},children:jsxRuntimeExports.jsx(HelpIcon,{size:14})})})]}),jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:Jt(),className:cn$1("text-- whitespace-normal break-all flex gap-1 pt-0.5",$e&&"bg-neutral-50 dark:bg-black-700 p-1 rounded",It&&At?.color&&`bg-${At.color}-50 border-${At.color}-300 px-0.5 rounded-lg`),appearance:"body",children:[bt&&dt&&n?jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[jsxRuntimeExports.jsx("span",{className:"line-through",children:dt}),jsxRuntimeExports.jsx("span",{children:Yt()})]}):ze||tt?jsxRuntimeExports.jsx("mark",{className:cn$1("rounded-md py-0.5 px-1",Kt()),children:Yt()}):Yt(),s==="currency"&&yt!==0&&yt!==void 0&&yt!==null&&jsxRuntimeExports.jsxs(framerMotion.motion.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.25},className:cn$1("inline-flex items-center gap-1 ml-1.5 text-xs font-medium",yt>0?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:[jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:yt>0?jsxRuntimeExports.jsx(AllIcons.ArrowUpwardRounded,{sx:{fontSize:16},className:"text-emerald-600 dark:text-emerald-400"}):jsxRuntimeExports.jsx(AllIcons.ArrowDownwardRounded,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})}),jsxRuntimeExports.jsx("span",{children:formatCurrency(Math.abs(yt),Le?.currency_code||"USD")})]}),Le?.is_master_data&&Le?.reference&&n&&jsxRuntimeExports.jsx("button",{onClick:()=>Ht(Le),onKeyDown:qt=>{(qt.key==="Enter"||qt.key===" ")&&(qt.preventDefault(),Ht(Le))},"aria-label":`Search master data for ${t}`,type:"button",className:"cursor-pointer",children:jsxRuntimeExports.jsx(SearchIcon$1,{width:20,height:20})}),Rt&&jsxRuntimeExports.jsx("input",{type:"file",onChange:Vt,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`})]}),dt&&!bt&&jsxRuntimeExports.jsx(Typography,{variant:"medium",size:"extra-small",className:"pt-0.5",appearance:"body",children:jsxRuntimeExports.jsx("mark",{className:"rounded-md py-0.5 px-1 bg-error-100",children:jsxRuntimeExports.jsx("del",{children:dt||s==="boolean"&&dt==="0"?dt==="True"?"Yes":dt==="False"?"No":s==="boolean"?formatBooleanValue(dt):s==="currency"?formatCurrency(dt,Le?.currency_code):s==="date"?formatDate(dt,{skipTimezone:!0,withTime:!1}):s==="datetime"?formatDate(dt,{skipTimezone:!0,withTime:!0}):s==="percentage"?`${dt}%`:dt.length>100?jsxRuntimeExports.jsxs("p",{children:[dt.slice(0,kt?100:dt.length),kt?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${kt?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Pt,children:kt?"Show more":"Show less"})]}):dt:"-"})})}),St&&jsxRuntimeExports.jsx(St,{isVisible:Nt,onClose:Zt,masterdataInfo:jt}),_t&&At&&It&&jsxRuntimeExports.jsx("div",{className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:qt=>qt.stopPropagation(),onMouseDown:qt=>qt.preventDefault(),onKeyDown:qt=>{qt.key==="Escape"&&Tt(!1)},role:"tooltip","aria-label":"Risk analysis details",tabIndex:0,children:Lt?jsxRuntimeExports.jsx(Lt,{riskDetails:At}):jsxRuntimeExports.jsx("div",{className:"shadow-lg p-4",children:jsxRuntimeExports.jsxs("div",{className:"text-sm",children:[jsxRuntimeExports.jsx("h4",{className:"font-semibold mb-2",children:"Risk Details"}),jsxRuntimeExports.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:At.description||"Risk analysis information"})]})})})]})});LabelValue.displayName="LabelValue";const defaultGenerator=e=>e,createClassNameGenerator=()=>{let e=defaultGenerator;return{configure(t){e=t},generate(t){return e(t)},reset(){e=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function formatMuiErrorMessage(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}function capitalize(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":formatMuiErrorMessage(7));return e.charAt(0).toUpperCase()+e.slice(1)}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs(propTypesExports);function r(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function clsx(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}function composeClasses(e,t,n=void 0){const a={};for(const s in e){const o=e[s];let c="",Le=!0;for(let $e=0;$e<o.length;$e+=1){const ze=o[$e];ze&&(c+=(Le===!0?"":" ")+t(ze),Le=!1,n&&n[ze]&&(c+=" "+n[ze]))}a[s]=c}return a}var reactIs={exports:{}},reactIs_production={};/**
|
|
194
|
+
Valid keys: `+JSON.stringify(Object.keys(Pt),null," "));var Qt=cr(qt,rr,Yt,Jt,Kt+"."+rr,n);if(Qt)return Qt}return null}return bt(Ht)}function Nt(Pt){switch(typeof Pt){case"number":case"string":case"undefined":return!0;case"boolean":return!Pt;case"object":if(Array.isArray(Pt))return Pt.every(Nt);if(Pt===null||Le(Pt))return!0;var Ht=tt(Pt);if(Ht){var Zt=Ht.call(Pt),Vt;if(Ht!==Pt.entries){for(;!(Vt=Zt.next()).done;)if(!Nt(Vt.value))return!1}else for(;!(Vt=Zt.next()).done;){var Yt=Vt.value;if(Yt&&!Nt(Yt[1]))return!1}}else return!1;return!0;default:return!1}}function Mt(Pt,Ht){return Pt==="symbol"?!0:Ht?Ht["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Ht instanceof Symbol:!1}function jt(Pt){var Ht=typeof Pt;return Array.isArray(Pt)?"array":Pt instanceof RegExp?"object":Mt(Ht,Pt)?"symbol":Ht}function $t(Pt){if(typeof Pt>"u"||Pt===null)return""+Pt;var Ht=jt(Pt);if(Ht==="object"){if(Pt instanceof Date)return"date";if(Pt instanceof RegExp)return"regexp"}return Ht}function _t(Pt){var Ht=$t(Pt);switch(Ht){case"array":case"object":return"an "+Ht;case"boolean":case"date":case"regexp":return"a "+Ht;default:return Ht}}function Tt(Pt){return!Pt.constructor||!Pt.constructor.name?dt:Pt.constructor.name}return pt.checkPropTypes=s,pt.resetWarningCache=s.resetWarningCache,pt.PropTypes=pt,pt},factoryWithTypeCheckers}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function n(){}return n.resetWarningCache=t,factoryWithThrowingShims=function(){function a(c,Le,$e,ze,et,tt){if(tt!==e){var dt=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw dt.name="Invariant Violation",dt}}a.isRequired=a;function s(){return a}var o={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:s,element:a,elementType:a,instanceOf:s,node:a,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){if(hasRequiredPropTypes)return propTypes.exports;if(hasRequiredPropTypes=1,process.env.NODE_ENV!=="production"){var e=requireReactIs$1(),t=!0;propTypes.exports=requireFactoryWithTypeCheckers()(e.isElement,t)}else propTypes.exports=requireFactoryWithThrowingShims()();return propTypes.exports}var isString={},hasRequiredIsString;function requireIsString(){return hasRequiredIsString||(hasRequiredIsString=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){return typeof n=="string"}}(isString)),isString}var getScrollbarWidth={},hasRequiredGetScrollbarWidth;function requireGetScrollbarWidth(){return hasRequiredGetScrollbarWidth||(hasRequiredGetScrollbarWidth=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=requireDomCss(),n=a(t);function a(c){return c&&c.__esModule?c:{default:c}}var s=!1;function o(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(c&&s!==!1)return s;if(typeof document<"u"){var Le=document.createElement("div");(0,n.default)(Le,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(Le),s=Le.offsetWidth-Le.clientWidth,document.body.removeChild(Le)}else s=0;return s||0}}(getScrollbarWidth)),getScrollbarWidth}var returnFalse={},hasRequiredReturnFalse;function requireReturnFalse(){return hasRequiredReturnFalse||(hasRequiredReturnFalse=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(){return!1}}(returnFalse)),returnFalse}var getInnerWidth={},hasRequiredGetInnerWidth;function requireGetInnerWidth(){return hasRequiredGetInnerWidth||(hasRequiredGetInnerWidth=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){var a=n.clientWidth,s=getComputedStyle(n),o=s.paddingLeft,c=s.paddingRight;return a-parseFloat(o)-parseFloat(c)}}(getInnerWidth)),getInnerWidth}var getInnerHeight={},hasRequiredGetInnerHeight;function requireGetInnerHeight(){return hasRequiredGetInnerHeight||(hasRequiredGetInnerHeight=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(n){var a=n.clientHeight,s=getComputedStyle(n),o=s.paddingTop,c=s.paddingBottom;return a-parseFloat(o)-parseFloat(c)}}(getInnerHeight)),getInnerHeight}var styles$1={},hasRequiredStyles;function requireStyles(){return hasRequiredStyles||(hasRequiredStyles=1,Object.defineProperty(styles$1,"__esModule",{value:!0}),styles$1.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},styles$1.containerStyleAutoHeight={height:"auto"},styles$1.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},styles$1.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},styles$1.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},styles$1.trackHorizontalStyleDefault={position:"absolute",height:6},styles$1.trackVerticalStyleDefault={position:"absolute",width:6},styles$1.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},styles$1.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},styles$1.disableSelectStyle={userSelect:"none"},styles$1.disableSelectStyleReset={userSelect:""}),styles$1}var defaultRenderElements={},hasRequiredDefaultRenderElements;function requireDefaultRenderElements(){if(hasRequiredDefaultRenderElements)return defaultRenderElements;hasRequiredDefaultRenderElements=1,Object.defineProperty(defaultRenderElements,"__esModule",{value:!0});var e=Object.assign||function(et){for(var tt=1;tt<arguments.length;tt++){var dt=arguments[tt];for(var pt in dt)Object.prototype.hasOwnProperty.call(dt,pt)&&(et[pt]=dt[pt])}return et};defaultRenderElements.renderViewDefault=o,defaultRenderElements.renderTrackHorizontalDefault=c,defaultRenderElements.renderTrackVerticalDefault=Le,defaultRenderElements.renderThumbHorizontalDefault=$e,defaultRenderElements.renderThumbVerticalDefault=ze;var t=React,n=a(t);function a(et){return et&&et.__esModule?et:{default:et}}function s(et,tt){var dt={};for(var pt in et)tt.indexOf(pt)>=0||Object.prototype.hasOwnProperty.call(et,pt)&&(dt[pt]=et[pt]);return dt}function o(et){return n.default.createElement("div",et)}function c(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{right:2,bottom:2,left:2,borderRadius:3});return n.default.createElement("div",e({style:pt},dt))}function Le(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{right:2,bottom:2,top:2,borderRadius:3});return n.default.createElement("div",e({style:pt},dt))}function $e(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return n.default.createElement("div",e({style:pt},dt))}function ze(et){var tt=et.style,dt=s(et,["style"]),pt=e({},tt,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return n.default.createElement("div",e({style:pt},dt))}return defaultRenderElements}var hasRequiredScrollbars;function requireScrollbars(){return hasRequiredScrollbars||(hasRequiredScrollbars=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(kt){for(var Bt=1;Bt<arguments.length;Bt++){var Nt=arguments[Bt];for(var Mt in Nt)Object.prototype.hasOwnProperty.call(Nt,Mt)&&(kt[Mt]=Nt[Mt])}return kt},n=function(){function kt(Bt,Nt){for(var Mt=0;Mt<Nt.length;Mt++){var jt=Nt[Mt];jt.enumerable=jt.enumerable||!1,jt.configurable=!0,"value"in jt&&(jt.writable=!0),Object.defineProperty(Bt,jt.key,jt)}}return function(Bt,Nt,Mt){return Nt&&kt(Bt.prototype,Nt),Mt&&kt(Bt,Mt),Bt}}(),a=requireRaf(),s=St(a),o=requireDomCss(),c=St(o),Le=React,$e=requirePropTypes(),ze=St($e),et=requireIsString(),tt=St(et),dt=requireGetScrollbarWidth(),pt=St(dt),xt=requireReturnFalse(),mt=St(xt),bt=requireGetInnerWidth(),gt=St(bt),yt=requireGetInnerHeight(),Et=St(yt),Ct=requireStyles(),Rt=requireDefaultRenderElements();function St(kt){return kt&&kt.__esModule?kt:{default:kt}}function At(kt,Bt){var Nt={};for(var Mt in kt)Bt.indexOf(Mt)>=0||Object.prototype.hasOwnProperty.call(kt,Mt)&&(Nt[Mt]=kt[Mt]);return Nt}function It(kt,Bt){if(!(kt instanceof Bt))throw new TypeError("Cannot call a class as a function")}function Lt(kt,Bt){if(!kt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt&&(typeof Bt=="object"||typeof Bt=="function")?Bt:kt}function zt(kt,Bt){if(typeof Bt!="function"&&Bt!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Bt);kt.prototype=Object.create(Bt&&Bt.prototype,{constructor:{value:kt,enumerable:!1,writable:!0,configurable:!0}}),Bt&&(Object.setPrototypeOf?Object.setPrototypeOf(kt,Bt):kt.__proto__=Bt)}var Ot=function(kt){zt(Bt,kt);function Bt(Nt){var Mt;It(this,Bt);for(var jt=arguments.length,$t=Array(jt>1?jt-1:0),_t=1;_t<jt;_t++)$t[_t-1]=arguments[_t];var Tt=Lt(this,(Mt=Bt.__proto__||Object.getPrototypeOf(Bt)).call.apply(Mt,[this,Nt].concat($t)));return Tt.getScrollLeft=Tt.getScrollLeft.bind(Tt),Tt.getScrollTop=Tt.getScrollTop.bind(Tt),Tt.getScrollWidth=Tt.getScrollWidth.bind(Tt),Tt.getScrollHeight=Tt.getScrollHeight.bind(Tt),Tt.getClientWidth=Tt.getClientWidth.bind(Tt),Tt.getClientHeight=Tt.getClientHeight.bind(Tt),Tt.getValues=Tt.getValues.bind(Tt),Tt.getThumbHorizontalWidth=Tt.getThumbHorizontalWidth.bind(Tt),Tt.getThumbVerticalHeight=Tt.getThumbVerticalHeight.bind(Tt),Tt.getScrollLeftForOffset=Tt.getScrollLeftForOffset.bind(Tt),Tt.getScrollTopForOffset=Tt.getScrollTopForOffset.bind(Tt),Tt.scrollLeft=Tt.scrollLeft.bind(Tt),Tt.scrollTop=Tt.scrollTop.bind(Tt),Tt.scrollToLeft=Tt.scrollToLeft.bind(Tt),Tt.scrollToTop=Tt.scrollToTop.bind(Tt),Tt.scrollToRight=Tt.scrollToRight.bind(Tt),Tt.scrollToBottom=Tt.scrollToBottom.bind(Tt),Tt.handleTrackMouseEnter=Tt.handleTrackMouseEnter.bind(Tt),Tt.handleTrackMouseLeave=Tt.handleTrackMouseLeave.bind(Tt),Tt.handleHorizontalTrackMouseDown=Tt.handleHorizontalTrackMouseDown.bind(Tt),Tt.handleVerticalTrackMouseDown=Tt.handleVerticalTrackMouseDown.bind(Tt),Tt.handleHorizontalThumbMouseDown=Tt.handleHorizontalThumbMouseDown.bind(Tt),Tt.handleVerticalThumbMouseDown=Tt.handleVerticalThumbMouseDown.bind(Tt),Tt.handleWindowResize=Tt.handleWindowResize.bind(Tt),Tt.handleScroll=Tt.handleScroll.bind(Tt),Tt.handleDrag=Tt.handleDrag.bind(Tt),Tt.handleDragEnd=Tt.handleDragEnd.bind(Tt),Tt.state={didMountUniversal:!1},Tt}return n(Bt,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){var Mt=this.props.universal;Mt&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,a.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){return this.view?this.view.scrollLeft:0}},{key:"getScrollTop",value:function(){return this.view?this.view.scrollTop:0}},{key:"getScrollWidth",value:function(){return this.view?this.view.scrollWidth:0}},{key:"getScrollHeight",value:function(){return this.view?this.view.scrollHeight:0}},{key:"getClientWidth",value:function(){return this.view?this.view.clientWidth:0}},{key:"getClientHeight",value:function(){return this.view?this.view.clientHeight:0}},{key:"getValues",value:function(){var Mt=this.view||{},jt=Mt.scrollLeft,$t=jt===void 0?0:jt,_t=Mt.scrollTop,Tt=_t===void 0?0:_t,Pt=Mt.scrollWidth,Ht=Pt===void 0?0:Pt,Zt=Mt.scrollHeight,Vt=Zt===void 0?0:Zt,Yt=Mt.clientWidth,Jt=Yt===void 0?0:Yt,Kt=Mt.clientHeight,qt=Kt===void 0?0:Kt;return{left:$t/(Ht-Jt)||0,top:Tt/(Vt-qt)||0,scrollLeft:$t,scrollTop:Tt,scrollWidth:Ht,scrollHeight:Vt,clientWidth:Jt,clientHeight:qt}}},{key:"getThumbHorizontalWidth",value:function(){var Mt=this.props,jt=Mt.thumbSize,$t=Mt.thumbMinSize,_t=this.view,Tt=_t.scrollWidth,Pt=_t.clientWidth,Ht=(0,gt.default)(this.trackHorizontal),Zt=Math.ceil(Pt/Tt*Ht);return Ht<=Zt?0:jt||Math.max(Zt,$t)}},{key:"getThumbVerticalHeight",value:function(){var Mt=this.props,jt=Mt.thumbSize,$t=Mt.thumbMinSize,_t=this.view,Tt=_t.scrollHeight,Pt=_t.clientHeight,Ht=(0,Et.default)(this.trackVertical),Zt=Math.ceil(Pt/Tt*Ht);return Ht<=Zt?0:jt||Math.max(Zt,$t)}},{key:"getScrollLeftForOffset",value:function(Mt){var jt=this.view,$t=jt.scrollWidth,_t=jt.clientWidth,Tt=(0,gt.default)(this.trackHorizontal),Pt=this.getThumbHorizontalWidth();return Mt/(Tt-Pt)*($t-_t)}},{key:"getScrollTopForOffset",value:function(Mt){var jt=this.view,$t=jt.scrollHeight,_t=jt.clientHeight,Tt=(0,Et.default)(this.trackVertical),Pt=this.getThumbVerticalHeight();return Mt/(Tt-Pt)*($t-_t)}},{key:"scrollLeft",value:function(){var Mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollLeft=Mt)}},{key:"scrollTop",value:function(){var Mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollTop=Mt)}},{key:"scrollToLeft",value:function(){this.view&&(this.view.scrollLeft=0)}},{key:"scrollToTop",value:function(){this.view&&(this.view.scrollTop=0)}},{key:"scrollToRight",value:function(){this.view&&(this.view.scrollLeft=this.view.scrollWidth)}},{key:"scrollToBottom",value:function(){this.view&&(this.view.scrollTop=this.view.scrollHeight)}},{key:"addListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Mt=this.view,jt=this.trackHorizontal,$t=this.trackVertical,_t=this.thumbHorizontal,Tt=this.thumbVertical;Mt.addEventListener("scroll",this.handleScroll),(0,pt.default)()&&(jt.addEventListener("mouseenter",this.handleTrackMouseEnter),jt.addEventListener("mouseleave",this.handleTrackMouseLeave),jt.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),$t.addEventListener("mouseenter",this.handleTrackMouseEnter),$t.addEventListener("mouseleave",this.handleTrackMouseLeave),$t.addEventListener("mousedown",this.handleVerticalTrackMouseDown),_t.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),Tt.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Mt=this.view,jt=this.trackHorizontal,$t=this.trackVertical,_t=this.thumbHorizontal,Tt=this.thumbVertical;Mt.removeEventListener("scroll",this.handleScroll),(0,pt.default)()&&(jt.removeEventListener("mouseenter",this.handleTrackMouseEnter),jt.removeEventListener("mouseleave",this.handleTrackMouseLeave),jt.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),$t.removeEventListener("mouseenter",this.handleTrackMouseEnter),$t.removeEventListener("mouseleave",this.handleTrackMouseLeave),$t.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),_t.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),Tt.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(Mt){var jt=this,$t=this.props,_t=$t.onScroll,Tt=$t.onScrollFrame;_t&&_t(Mt),this.update(function(Pt){var Ht=Pt.scrollLeft,Zt=Pt.scrollTop;jt.viewScrollLeft=Ht,jt.viewScrollTop=Zt,Tt&&Tt(Pt)}),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var Mt=this.props.onScrollStart;Mt&&Mt(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.showTracks()}},{key:"handleScrollStop",value:function(){var Mt=this.props.onScrollStop;Mt&&Mt(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"handleWindowResize",value:function(){(0,pt.default)(!1),this.forceUpdate()}},{key:"handleHorizontalTrackMouseDown",value:function(Mt){Mt.preventDefault();var jt=Mt.target,$t=Mt.clientX,_t=jt.getBoundingClientRect(),Tt=_t.left,Pt=this.getThumbHorizontalWidth(),Ht=Math.abs(Tt-$t)-Pt/2;this.view.scrollLeft=this.getScrollLeftForOffset(Ht)}},{key:"handleVerticalTrackMouseDown",value:function(Mt){Mt.preventDefault();var jt=Mt.target,$t=Mt.clientY,_t=jt.getBoundingClientRect(),Tt=_t.top,Pt=this.getThumbVerticalHeight(),Ht=Math.abs(Tt-$t)-Pt/2;this.view.scrollTop=this.getScrollTopForOffset(Ht)}},{key:"handleHorizontalThumbMouseDown",value:function(Mt){Mt.preventDefault(),this.handleDragStart(Mt);var jt=Mt.target,$t=Mt.clientX,_t=jt.offsetWidth,Tt=jt.getBoundingClientRect(),Pt=Tt.left;this.prevPageX=_t-($t-Pt)}},{key:"handleVerticalThumbMouseDown",value:function(Mt){Mt.preventDefault(),this.handleDragStart(Mt);var jt=Mt.target,$t=Mt.clientY,_t=jt.offsetHeight,Tt=jt.getBoundingClientRect(),Pt=Tt.top;this.prevPageY=_t-($t-Pt)}},{key:"setupDragging",value:function(){(0,c.default)(document.body,Ct.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=mt.default}},{key:"teardownDragging",value:function(){(0,c.default)(document.body,Ct.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(Mt){this.dragging=!0,Mt.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(Mt){if(this.prevPageX){var jt=Mt.clientX,$t=this.trackHorizontal.getBoundingClientRect(),_t=$t.left,Tt=this.getThumbHorizontalWidth(),Pt=Tt-this.prevPageX,Ht=-_t+jt-Pt;this.view.scrollLeft=this.getScrollLeftForOffset(Ht)}if(this.prevPageY){var Zt=Mt.clientY,Vt=this.trackVertical.getBoundingClientRect(),Yt=Vt.top,Jt=this.getThumbVerticalHeight(),Kt=Jt-this.prevPageY,qt=-Yt+Zt-Kt;this.view.scrollTop=this.getScrollTopForOffset(qt)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){var Mt=this.props.autoHide;Mt&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,c.default)(this.trackHorizontal,{opacity:1}),(0,c.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var Mt=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var jt=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout(function(){(0,c.default)(Mt.trackHorizontal,{opacity:0}),(0,c.default)(Mt.trackVertical,{opacity:0})},jt)}}},{key:"detectScrolling",value:function(){var Mt=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval(function(){Mt.lastViewScrollLeft===Mt.viewScrollLeft&&Mt.lastViewScrollTop===Mt.viewScrollTop&&(clearInterval(Mt.detectScrollingInterval),Mt.scrolling=!1,Mt.handleScrollStop()),Mt.lastViewScrollLeft=Mt.viewScrollLeft,Mt.lastViewScrollTop=Mt.viewScrollTop},100))}},{key:"raf",value:function(Mt){var jt=this;this.requestFrame&&s.default.cancel(this.requestFrame),this.requestFrame=(0,s.default)(function(){jt.requestFrame=void 0,Mt()})}},{key:"update",value:function(Mt){var jt=this;this.raf(function(){return jt._update(Mt)})}},{key:"_update",value:function(Mt){var jt=this.props,$t=jt.onUpdate,_t=jt.hideTracksWhenNotNeeded,Tt=this.getValues();if((0,pt.default)()){var Pt=Tt.scrollLeft,Ht=Tt.clientWidth,Zt=Tt.scrollWidth,Vt=(0,gt.default)(this.trackHorizontal),Yt=this.getThumbHorizontalWidth(),Jt=Pt/(Zt-Ht)*(Vt-Yt),Kt={width:Yt,transform:"translateX("+Jt+"px)"},qt=Tt.scrollTop,ir=Tt.clientHeight,tr=Tt.scrollHeight,rr=(0,Et.default)(this.trackVertical),cr=this.getThumbVerticalHeight(),Qt=qt/(tr-ir)*(rr-cr),hr={height:cr,transform:"translateY("+Qt+"px)"};if(_t){var dr={visibility:Zt>Ht?"visible":"hidden"},ur={visibility:tr>ir?"visible":"hidden"};(0,c.default)(this.trackHorizontal,dr),(0,c.default)(this.trackVertical,ur)}(0,c.default)(this.thumbHorizontal,Kt),(0,c.default)(this.thumbVertical,hr)}$t&&$t(Tt),typeof Mt=="function"&&Mt(Tt)}},{key:"render",value:function(){var Mt=this,jt=(0,pt.default)(),$t=this.props;$t.onScroll,$t.onScrollFrame,$t.onScrollStart,$t.onScrollStop,$t.onUpdate;var _t=$t.renderView,Tt=$t.renderTrackHorizontal,Pt=$t.renderTrackVertical,Ht=$t.renderThumbHorizontal,Zt=$t.renderThumbVertical,Vt=$t.tagName;$t.hideTracksWhenNotNeeded;var Yt=$t.autoHide;$t.autoHideTimeout;var Jt=$t.autoHideDuration;$t.thumbSize,$t.thumbMinSize;var Kt=$t.universal,qt=$t.autoHeight,ir=$t.autoHeightMin,tr=$t.autoHeightMax,rr=$t.style,cr=$t.children,Qt=At($t,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),hr=this.state.didMountUniversal,dr=t({},Ct.containerStyleDefault,qt&&t({},Ct.containerStyleAutoHeight,{minHeight:ir,maxHeight:tr}),rr),ur=t({},Ct.viewStyleDefault,{marginRight:jt?-jt:0,marginBottom:jt?-jt:0},qt&&t({},Ct.viewStyleAutoHeight,{minHeight:(0,tt.default)(ir)?"calc("+ir+" + "+jt+"px)":ir+jt,maxHeight:(0,tt.default)(tr)?"calc("+tr+" + "+jt+"px)":tr+jt}),qt&&Kt&&!hr&&{minHeight:ir,maxHeight:tr},Kt&&!hr&&Ct.viewStyleUniversalInitial),xr={transition:"opacity "+Jt+"ms",opacity:0},Cr=t({},Ct.trackHorizontalStyleDefault,Yt&&xr,(!jt||Kt&&!hr)&&{display:"none"}),Or=t({},Ct.trackVerticalStyleDefault,Yt&&xr,(!jt||Kt&&!hr)&&{display:"none"});return(0,Le.createElement)(Vt,t({},Qt,{style:dr,ref:function(Sr){Mt.container=Sr}}),[(0,Le.cloneElement)(_t({style:ur}),{key:"view",ref:function(Sr){Mt.view=Sr}},cr),(0,Le.cloneElement)(Tt({style:Cr}),{key:"trackHorizontal",ref:function(Sr){Mt.trackHorizontal=Sr}},(0,Le.cloneElement)(Ht({style:Ct.thumbHorizontalStyleDefault}),{ref:function(Sr){Mt.thumbHorizontal=Sr}})),(0,Le.cloneElement)(Pt({style:Or}),{key:"trackVertical",ref:function(Sr){Mt.trackVertical=Sr}},(0,Le.cloneElement)(Zt({style:Ct.thumbVerticalStyleDefault}),{ref:function(Sr){Mt.thumbVertical=Sr}}))])}}]),Bt}(Le.Component);e.default=Ot,Ot.propTypes={onScroll:ze.default.func,onScrollFrame:ze.default.func,onScrollStart:ze.default.func,onScrollStop:ze.default.func,onUpdate:ze.default.func,renderView:ze.default.func,renderTrackHorizontal:ze.default.func,renderTrackVertical:ze.default.func,renderThumbHorizontal:ze.default.func,renderThumbVertical:ze.default.func,tagName:ze.default.string,thumbSize:ze.default.number,thumbMinSize:ze.default.number,hideTracksWhenNotNeeded:ze.default.bool,autoHide:ze.default.bool,autoHideTimeout:ze.default.number,autoHideDuration:ze.default.number,autoHeight:ze.default.bool,autoHeightMin:ze.default.oneOfType([ze.default.number,ze.default.string]),autoHeightMax:ze.default.oneOfType([ze.default.number,ze.default.string]),universal:ze.default.bool,style:ze.default.object,children:ze.default.node},Ot.defaultProps={renderView:Rt.renderViewDefault,renderTrackHorizontal:Rt.renderTrackHorizontalDefault,renderTrackVertical:Rt.renderTrackVerticalDefault,renderThumbHorizontal:Rt.renderThumbHorizontalDefault,renderThumbVertical:Rt.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}}(Scrollbars)),Scrollbars}var hasRequiredLib;function requireLib(){return hasRequiredLib||(hasRequiredLib=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Scrollbars=void 0;var t=requireScrollbars(),n=a(t);function a(s){return s&&s.__esModule?s:{default:s}}e.default=n.default,e.Scrollbars=n.default}(lib)),lib}var libExports=requireLib();const CustomScrollbar=React.memo(React.forwardRef(({adjustWithScreen:e,children:t,renderViewClassName:n,fullHeight:a,...s},o)=>{const[c,Le]=React.useState(window.innerHeight),$e=React.useRef(null);return useEventListener("resize",()=>{e&&Le(window.innerHeight)}),React.useImperativeHandle(o,()=>({get getInstance(){return $e.current},scrollToTop:()=>{$e.current&&$e.current.scrollToTop()},scrollToRight:()=>{$e.current&&$e.current.scrollToRight()}}),[]),jsxRuntimeExports.jsx(libExports.Scrollbars,{ref:$e,autoHide:!0,renderTrackVertical:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"h-full top-0 right-0 rounded-md z-[1001] !w-scrollbar-size",...tt}),renderThumbVertical:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"rounded-md bg-[#00000033] dark:bg-black-500 absolute right-0.5 !w-2",...tt}),renderTrackHorizontal:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"w-full bottom-0 left-0 rounded-md z-[1001] !h-scrollbar-size ",...tt}),renderThumbHorizontal:({style:et,...tt})=>jsxRuntimeExports.jsx("div",{style:et,className:"rounded-md bg-[#00000033] dark:bg-black-500 absolute bottom-0.5 !h-2",...tt}),renderView:et=>jsxRuntimeExports.jsx("div",{className:cn$1("!-mr-scrollbar-size h-full !-mb-scrollbar-size",n,a?"!h-[calc(100%+var(--scroll-bar-size))]":""),...et}),...s,style:{...s.style||{},zIndex:0,...!s.autoHeight&&!s.style?.height?{height:a?"100%":c,overflowX:"hidden"}:{}},children:t})}));CustomScrollbar.displayName="CustomScrollbar";const MdInput=({id:e,value:t="",onChange:n,placeholder:a="Enter markdown content...",rows:s=1,disabled:o=!1,className:c,textareaClassName:Le,previewClassName:$e,defaultMode:ze="markdown",mode:et,label:tt,required:dt=!1})=>{const[pt,xt]=React.useState(ze),[mt,bt]=React.useState(!1),gt=e||`md-input-${Math.random().toString(36).slice(2,11)}`,yt=React.useMemo(()=>{if(!t)return s;const Rt=(t.match(/\n/g)||[]).length+1;return Math.min(18,Rt)},[t,s]),Et=et??pt,Ct=et!==void 0;return jsxRuntimeExports.jsxs("div",{className:cn$1("flex flex-col gap-2",c),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[!Ct&&jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:jsxRuntimeExports.jsxs("div",{className:"inline-flex grow-0 p-1 rounded-lg bg-neutral-100 dark:bg-black-700 w-auto",children:[jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",Et==="markdown"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>xt("markdown"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(Et==="markdown"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Markdown"})}),jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",Et==="preview"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>xt("preview"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(Et==="preview"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Preview"})})]})}),tt&&jsxRuntimeExports.jsxs("label",{htmlFor:gt,className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:[tt,dt&&jsxRuntimeExports.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),jsxRuntimeExports.jsx("div",{className:"relative",children:Et==="markdown"?jsxRuntimeExports.jsx("textarea",{id:gt,value:t,onChange:Rt=>n(Rt.target.value),placeholder:a,rows:yt,disabled:o,required:dt,className:cn$1("w-full border rounded-lg bg-white dark:bg-black-600","py-2.5 px-3 font-inter font-medium text-sm","text-gray-900 dark:text-gray-100","placeholder:text-gray-400 dark:placeholder:text-gray-500","transition-colors duration-200","focus:ring-2 focus:outline-none resize-vertical","border-gray-300 dark:border-gray-600","focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20",{"bg-gray-50 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed":o},Le),onClick:Rt=>Rt.stopPropagation()}):jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("div",{className:cn$1("w-full rounded-lg","py-2.5 px-3 min-h-[calc(2.5rem*var(--rows,8))]","text-sm",$e),style:{"--rows":yt>3?yt-3:yt},children:jsxRuntimeExports.jsx(CustomScrollbar,{autoHeight:!0,autoHeightMax:`calc(1rem * ${yt>3?yt-3:yt})`,children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})}),jsxRuntimeExports.jsx("button",{onClick:()=>bt(!0),className:"absolute bottom-2 right-2 p-1 rounded-md bg-neutral-100 dark:bg-black-600 hover:bg-gray-200 dark:hover:bg-black-500 transition-colors shadow-sm flex items-center justify-center",title:"Expand preview",type:"button",children:jsxRuntimeExports.jsx(AllIcons.OpenInFull,{sx:{fontSize:"16px"},className:"text-neutral-600 dark:text-neutral-400"})})]})}),jsxRuntimeExports.jsx(Modal,{open:mt,onCancel:()=>bt(!1),title:"Markdown Preview",width:800,footer:null,children:jsxRuntimeExports.jsx(CustomScrollbar,{autoHeight:!0,autoHeightMax:"70vh",children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})})]})};function FiDownload(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function FiTrash2(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}const{Dragger:Dragger$1}=antd.Upload,DEFAULT_MAX_SIZE$1=50*1024*1024,MultiFileUpload=({getFile:e,id:t,description:n,errorMessage:a=null,disabled:s=!1,defaultFile:o=null,acceptedFiles:c=null,isLoading:Le=!1,asBase64:$e=!1,toFileServer:ze=!1,setFileUploading:et,fileUploading:tt=!1,uploadToDocServer:dt=!1,multiple:pt=!1,getRealFileName:xt=!1,onDelete:mt,maxSize:bt=DEFAULT_MAX_SIZE$1,fileUploadService:gt,systemMessages:yt,toast:Et})=>{const[Ct,Rt]=React.useState(null),[St,At]=React.useState([]),[It,Lt]=React.useState("#d9d9d9"),[zt,Ot]=React.useState(!1),[kt,Bt]=React.useState(null),Nt=async()=>{if(!gt){console.warn("MultiFileUpload: File server upload requires fileUploadService");return}Promise.all(St.map(_t=>{const Tt=new FormData;Tt.append("file",_t);const Pt=buildQueryParams({file_upload_path:dt?"document-server":null,token:localStorage.getItem("token")});return gt.uploadFileToFileServer(Tt,Pt)})).then(_t=>{e(pt?_t?.map(Tt=>Tt?.fileUrl):_t?.[0]?.fileUrl,xt?Ct?.name:_t?.[0]?.fileName),et?.(null),Bt(_t?.[0])})},Mt={accept:c||"*",multiple:pt,showUploadList:!1,disabled:s,onRemove:()=>{At([])},beforeUpload:(_t,Tt)=>{if(_t.size>bt){const Pt=Math.round(bt/1048576),Ht=yt?.fileSizeLimit(String(Pt),"MB")||`File size must be less than ${Pt}MB`;return Et?Et.error(Ht,{toastId:Ht}):console.error(Ht),!1}return Rt(_t),ze?(et?.(t||"field-file-upload"),At(Tt)):($e?Promise.all((pt?Tt:[_t]).map(Pt=>new Promise(Ht=>{const Zt=new FileReader;Zt.onload=Vt=>{Ht({filename:Pt.name,content:Vt?.target?.result?.split(",")[1]})},Zt.readAsDataURL(Pt)}))).then(Pt=>{e(pt?Pt:Pt[0])}):e(_t),Rt(_t)),!1}},jt=async()=>{if(ze&&kt&>){const _t=buildQueryParams({token:localStorage.getItem("token")});gt.deleteFileFromFileServer(kt?.fileName,_t).then(()=>{Bt(null)})}Rt(null),At([]),e(""),mt?.()};React.useEffect(()=>{o?.name&&Rt(o)},[o]),React.useEffect(()=>{Lt(a?"#EF4444":"#d9d9d9")},[a]),React.useEffect(()=>{St.length&&Nt()},[St]);const $t=_t=>_t?_t.length<=20?_t:_t.slice(0,14)+"...."+_t.slice(-7):"";return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"h-32",onMouseEnter:()=>Ot(!0),onMouseLeave:()=>Ot(!1),children:jsxRuntimeExports.jsx(Dragger$1,{...Mt,style:{borderColor:zt&&!a?"#1890ff":It},disabled:s||tt,children:Ct?jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mx-5",title:Ct?.name||o?.name,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-4",children:[Ct?.type==="application/pdf"?jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(BsFiletypePdf,{size:20,fill:"#006CCF"})}):jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(AllIcons.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#006CCF"}})}),jsxRuntimeExports.jsxs("div",{className:"text-left",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"font-inter text-md font-medium text-base",children:$t(Ct?.name||o?.name)}),tt?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Uploading..."}):Ct?.size>0?jsxRuntimeExports.jsxs(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:[(Ct.size/1e3).toFixed(2)," ","KB"]}):null]})]}),Le?jsxRuntimeExports.jsx(CgSpinner,{size:40,className:"spinner text-primary-600"}):jsxRuntimeExports.jsx("button",{id:"btn-file-upload",className:"ml-4",onClick:_t=>{_t.stopPropagation(),jt()},disabled:s,children:jsxRuntimeExports.jsx(FiTrash2,{size:20,fill:"#98A2B3"})})]}):jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center",children:jsxRuntimeExports.jsxs("div",{className:"flex-col",children:[jsxRuntimeExports.jsx("div",{className:"mb-4 flex justify-center",children:jsxRuntimeExports.jsx(FiDownload,{size:24,fill:"#98A2B3"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:"Click to upload"}),jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"ml-1",appearance:"subtitle",children:"or drag and drop"})]}),n?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:n}):null]})]})})})}),a&&jsxRuntimeExports.jsx(Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]})},roundedIconNames=Object.keys(AllIcons__namespace).filter(e=>e?.endsWith("Rounded")),mergedIconNames=[...roundedIconNames||[],...(COUNTRY_CODES||[]).map(e=>`flag-${e}`)],formatIconName=e=>{if(e?.startsWith("flag-")){const t=e?.replace("flag-","");return countryNameFromCode(t||"")||t}return e.replaceAll(/([A-Z])/g," $1").trim()},IconPickerContent=({onChange:e,selectedIcon:t,setOpen:n})=>{const[a,s]=React.useState(""),o=(mergedIconNames||[]).filter(Le=>{if(Le?.startsWith("flag-")){const $e=Le?.replace("flag-","");return $e?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")||countryNameFromCode($e||"")?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}return Le?.trim()?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}),c=(Le,$e)=>{if($e.stopPropagation(),t===Le){e?.(null);return}e?.(Le),n?.(!1)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntimeExports.jsx(InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:Le=>s(Le||""),fieldSuffix:jsxRuntimeExports.jsx(AllIcons__namespace.Search,{sx:{width:16,height:16,color:"rgb(152 162 179)"}})}),jsxRuntimeExports.jsx(reactWindow.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((o?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:Le,rowIndex:$e,style:ze})=>{const et=$e*5+Le,tt=o?.[et];return tt?jsxRuntimeExports.jsx("div",{style:{...ze,padding:"4px"},children:jsxRuntimeExports.jsx(antd.Tooltip,{title:formatIconName(tt),children:jsxRuntimeExports.jsx(material.IconButton,{className:cn$1("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":t===tt}),onClick:dt=>c(tt,dt),children:jsxRuntimeExports.jsx(IconRenderer,{iconName:tt,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"})})})}):null}})]})},IconRenderer=({iconName:e,sx:t,className:n,isHovering:a})=>{if(e?.startsWith?.("flag-")){const o=e?.replace("flag-","");return getFlagComponent?.(o||"",a||!1)||jsxRuntimeExports.jsx("div",{children:"-"})}const s=AllIcons__namespace?.[e];return s?jsxRuntimeExports.jsx(s,{sx:t,className:n,isHovering:a}):jsxRuntimeExports.jsx("div",{children:"-"})},IconPickerBase=({selectedIcon:e,onChange:t,label:n,required:a=!1,allowClear:s=!0,disabled:o=!1,errorMessage:c})=>{const[Le,$e]=React.useState(!1),ze=et=>{et.stopPropagation(),t?.("")};return jsxRuntimeExports.jsx(antd.Popover,{arrow:!1,placement:"bottom",trigger:"click",getPopupContainer:et=>et?.parentElement||document.body,open:Le,onOpenChange:$e,content:jsxRuntimeExports.jsx(IconPickerContent,{onChange:t,selectedIcon:e,setOpen:$e}),children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[n?jsxRuntimeExports.jsxs(Typography,{size:"extra-small",variant:"medium",appearance:"body",children:[n,a&&jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"*"})]}):null,jsxRuntimeExports.jsxs("button",{id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`min-w-[83px] py-1.5 px-3 rounded-md border ${o?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${c?"border-red-500":"focus:border-primary-200 "} flex items-center justify-between gap-2`,disabled:o,onClick:et=>{o&&(et.preventDefault(),et.stopPropagation())},children:[e?jsxRuntimeExports.jsx(IconRenderer,{iconName:e,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"}):jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Select Icon"}),e&&s&&!o?jsxRuntimeExports.jsx(AllIcons__namespace.CloseRounded,{sx:{width:20,height:20},className:"hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:ze}):null]}),c&&jsxRuntimeExports.jsx(Typography,{size:"extra-small",className:"text-red-500 font-medium",children:c})]})})},IconPicker=React.lazy(()=>Promise.resolve({default:e=>jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntimeExports.jsx("div",{className:"min-w-[83px] h-[30px] animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:jsxRuntimeExports.jsx(IconPickerBase,{...e})})})),StatusColorMapping=React.forwardRef(({status:e,children:t,className:n,size:a="medium","aria-label":s},o)=>{const c=()=>{switch(a){case"small":return"text-xs px-1.5 py-0.5";case"large":return"text-base px-3 py-1.5";default:return"text-md px-1.5 py-1"}},Le=()=>{switch(e?.toLowerCase()){case"purple":return"bg-purple-50 text-purple-500 border border-purple-100 dark:bg-purple-950 dark:text-purple-400 dark:border-purple-800";case"blue":return"bg-blue-50 text-blue-500 border border-blue-100 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800";case"teal":return"bg-teal-50 text-teal-500 border border-teal-100 dark:bg-teal-950 dark:text-teal-400 dark:border-teal-800";case"green":return"bg-green-50 text-green-500 border border-green-100 dark:bg-green-950 dark:text-green-400 dark:border-green-800";case"yellow":return"bg-yellow-50 text-yellow-600 border border-yellow-100 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800";case"orange":return"bg-orange-50 text-orange-500 border border-orange-100 dark:bg-orange-950 dark:text-orange-400 dark:border-orange-800";case"peach":return"bg-orange-50 text-orange-400 border border-orange-100 dark:bg-orange-950 dark:text-orange-300 dark:border-orange-800";case"red":return"bg-red-50 text-red-500 border border-red-100 dark:bg-red-950 dark:text-red-400 dark:border-red-800";case"navy":return"bg-slate-50 text-slate-700 border border-slate-100 dark:bg-slate-950 dark:text-slate-400 dark:border-slate-800";case"grey":return"bg-neutral-50 text-neutral-500 border border-neutral-100 dark:bg-neutral-950 dark:text-neutral-400 dark:border-neutral-800";default:return"bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800"}};return jsxRuntimeExports.jsx("span",{ref:o,className:cn$1("inline-flex items-center justify-center font-medium rounded-md transition-colors",c(),Le(),n),"aria-label":s||`Status: ${e||"default"}`,role:"status",children:t})});StatusColorMapping.displayName="StatusColorMapping";const Badge=React.forwardRef(({status:e="default",children:t,appearance:n="outline",size:a="md",className:s,isRounded:o=!1,capitalize:c=!0,"aria-label":Le},$e)=>{const ze=xt=>!xt||!c?xt:xt.replace(/\w\S*/g,mt=>mt.charAt(0).toUpperCase()+mt.substr(1).toLowerCase()),et=()=>{switch(a){case"sm":return"text-xs px-1.5 py-0.5";case"lg":return"text-sm px-3 py-1.5";default:return"text-xs px-2 py-1"}},tt=()=>{switch(e){case"primary":case"default":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";case"warning":return"bg-yellow-50 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-300 border border-yellow-300 dark:border-yellow-700";case"error":return"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-300 border border-red-300 dark:border-red-700";case"neutral":return"bg-neutral-50 dark:bg-neutral-950 text-neutral-600 dark:text-neutral-300 border border-neutral-300 dark:border-neutral-700";case"success":return"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-300 border border-green-300 dark:border-green-700";case"info":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";default:return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700"}},dt=()=>{switch(e){case"primary":case"default":return"bg-blue-600 dark:bg-blue-700 text-white";case"warning":return"bg-yellow-600 dark:bg-yellow-700 text-white";case"success":return"bg-green-600 dark:bg-green-700 text-white";case"error":return"bg-red-600 dark:bg-red-700 text-white";case"neutral":return"bg-neutral-600 dark:bg-neutral-700 text-white";case"info":return"bg-blue-600 dark:bg-blue-700 text-white";default:return"bg-blue-600 dark:bg-blue-700 text-white"}},pt=()=>n==="filled"?dt():tt();return jsxRuntimeExports.jsx("span",{ref:$e,className:cn$1("inline-flex items-center justify-center font-medium transition-colors",o?"rounded-full":"rounded",et(),pt(),s),"aria-label":Le||`Badge: ${e}`,role:"status",children:ze(t)})});Badge.displayName="Badge";const HelmetTitle=({title:e,children:t})=>e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t}):null;HelmetTitle.displayName="HelmetTitle";const Card=({children:e,className:t="",title:n,style:a,id:s})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HelmetTitle,{title:n}),jsxRuntimeExports.jsx("div",{className:`bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 rounded-lg shadow-100 w-full flex flex-col ${t}`,style:a,id:s,children:e})]});Card.displayName="Card";const Drawer=({id:e,children:t,onClose:n,open:a,title:s,parentContainer:o="full-screen-container",resizable:c,width:Le=400,placement:$e="right",closable:ze=!1,mask:et,classNames:tt,styles:dt,getContainer:pt,zIndex:xt,footer:mt,...bt})=>{const gt=React.useRef(!1),[yt,Et]=React.useState(Le);React.useEffect(()=>{Et(Le)},[a,Le]);const Ct=React.useCallback(At=>{if(gt.current)if($e==="right"){const It=document.body.offsetWidth-(At.clientX-document.body.offsetLeft);It>256&&Et(It)}else At.clientX>256&&Et(At.clientX)},[$e,Et]),Rt=React.useCallback(()=>{gt.current&&(gt.current=!1)},[]);React.useEffect(()=>(document.addEventListener("mousemove",Ct),document.addEventListener("mouseup",Rt),()=>{document.removeEventListener("mousemove",Ct),document.removeEventListener("mouseup",Rt)}),[Ct,Rt]);const St=typeof window<"u"?document.getElementById(o)||document.body:null;return St?ReactDOM.createPortal(jsxRuntimeExports.jsxs(antd.Drawer,{id:e||"",closable:ze,title:s,onClose:n,open:a,width:yt,getContainer:pt!==void 0?pt:!1,placement:$e,mask:et,classNames:tt,styles:dt,zIndex:xt,footer:mt,...bt,children:[c&&jsxRuntimeExports.jsx("div",{className:"cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",onMouseDown:()=>{gt.current=!0},style:$e==="right"?{left:0}:{right:0}}),t]}),St):null};Drawer.displayName="Drawer";const FloatingElementWrapper=({children:e,showAsModal:t,...n})=>t?jsxRuntimeExports.jsx(Modal,{onCancel:n.onClose,...n,children:e}):jsxRuntimeExports.jsx(Drawer,{...n,children:e}),formatBooleanValue=e=>e===1||e==="1"||typeof e=="string"&&e.toLowerCase()==="yes"||typeof e=="string"&&e.toLowerCase()==="true"?"Yes":e===0||e==="0"||typeof e=="string"&&e.toLowerCase()==="no"||typeof e=="string"&&e.toLowerCase()==="false"?"No":e?.toString()||"-",formatCurrency=(e,t="USD")=>{try{if(e==null)return"";const n=Number(e);if(isNaN(n))return e?.toString()||"";const a=n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$",CHF:"CHF",CNY:"¥",SEK:"kr",NOK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft",RUB:"₽",BRL:"R$",INR:"₹",KRW:"₩",SGD:"S$",HKD:"HK$",NZD:"NZ$",MXN:"$",ZAR:"R",TRY:"₺",ILS:"₪",AED:"د.إ",SAR:"﷼",QAR:"﷼",KWD:"د.ك",BHD:"د.ب",OMR:"﷼",JOD:"د.ا",LBP:"ل.ل",EGP:"£",MAD:"د.م.",TND:"د.ت",DZD:"د.ج",LYD:"ل.د",SDG:"ج.س.",ETB:"Br",KES:"KSh",UGX:"USh",TZS:"TSh",ZMW:"ZK",BWP:"P",ZWL:"Z$",AOA:"Kz",MZN:"MT",GHS:"₵",NGN:"₦",XAF:"FCFA",XOF:"CFA",CDF:"FC",RWF:"RF",BIF:"FBu",KMF:"CF",DJF:"Fdj",SOS:"S",ERN:"Nfk"}[t]||"$"}${a}`}catch{return"-"}},formatDate=(e,t={})=>{const{format:n,relative:a=!1,withTime:s=!0,fallback:o="-",skipTimezone:c=!1,onlyTime:Le=!1}=t||{};if(!e)return o;try{const $e=new Date(e);if(isNaN($e.getTime()))return o;if(a){const pt=Math.floor((new Date().getTime()-$e.getTime())/1e3);return pt<60?"just now":pt<3600?`${Math.floor(pt/60)} minutes ago`:pt<86400?`${Math.floor(pt/3600)} hours ago`:pt<2592e3?`${Math.floor(pt/86400)} days ago`:pt<31536e3?`${Math.floor(pt/2592e3)} months ago`:`${Math.floor(pt/31536e3)} years ago`}const ze="MM/dd/yyyy",et="hh:mm a",tt=s&&!Le;return $e.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:s?"2-digit":void 0,minute:s?"2-digit":void 0,hour12:!0})}catch{return o}},isISODateString=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e),LabelValue=React.forwardRef(({id:e,label:t,value:n,className:a,type:s="string",tags:o,tooltip:c,items:Le,isModified:$e=!1,isChanged:ze=!1,size:et="medium",isHighlighted:tt=!1,deletedValue:dt,highlightColor:pt="warning",isSearchActive:xt=!1,originalValue:mt=!1,showDiff:bt=!1,isLiveField:gt=!1,deltaChange:yt,theme:Et="light",onUpload:Ct,acceptsUpload:Rt=!1,MasterDataModal:St,riskDetails:At,isRiskAnalysisOpen:It=!1,RiskDetailsCard:Lt,"aria-label":zt},Ot)=>{const[kt,Bt]=React.useState(!0),[Nt,Mt]=React.useState(!1),[jt,$t]=React.useState(null),[_t,Tt]=React.useState(!1),Pt=()=>{Bt(!kt)},Ht=qt=>{Mt(!0),$t({...qt,value:n})},Zt=()=>{Mt(!1),$t(null)},Vt=qt=>{const ir=qt.target.files?.[0];ir&&Ct&&Ct(ir),qt.target.value=""},Yt=()=>{const qt=typeof n=="string"&&isISODateString(n);if(xt&&typeof n=="object")return n;if(n||s==="boolean"&&n===0||s==="currency"&&Number(n)>=0){if((n===!0||n==="True")&&!mt)return"Yes";if((n===!1||n==="False")&&!mt)return"No";if(s==="url")return jsxRuntimeExports.jsx("a",{href:n,className:"text-primary-600 truncate",children:n});if(s==="boolean")return formatBooleanValue(n);if(s==="currency")return formatCurrency(n,Le?.currency_code)||"-";if(s==="datetime"){const ir=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(ir,{skipTimezone:!1,withTime:!0})}else if(s==="date"||qt){const ir=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(ir,{skipTimezone:!0,withTime:!1})}else return s==="percentage"?`${n}%`:typeof n=="string"&&n.length>100?jsxRuntimeExports.jsxs("p",{children:[n.slice(0,kt?100:n.length),kt?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${kt?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Pt,onKeyDown:ir=>{(ir.key==="Enter"||ir.key===" ")&&(ir.preventDefault(),Pt())},"aria-label":kt?"Show more content":"Show less content",type:"button",children:kt?"Show more":"Show less"})]}):n}return"-"},Jt=()=>{switch(et){case"small":return"extra-small";case"large":return"large";default:return"small"}},Kt=()=>{switch(pt){case"success":return"bg-success-100";case"warning":return"bg-warning-100";case"error":return"bg-error-100";case"info":return"bg-info-100";default:return"bg-warning-100"}};return jsxRuntimeExports.jsxs("div",{id:e||"",ref:Ot,className:cn$1("font-medium relative",a),onMouseEnter:()=>Tt(!0),onMouseLeave:()=>Tt(!1),"aria-label":zt||`Label: ${t}, Value: ${n}`,children:[jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:Jt(),className:"flex gap-1 flex-wrap",appearance:"subtitle",children:[t," ",jsxRuntimeExports.jsx(Label,{labels:o?.map(qt=>({...qt,color:qt.color||"primary"}))}),gt&&jsxRuntimeExports.jsx(AllIcons.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),o&&o.length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o.map(qt=>jsxRuntimeExports.jsx(Tag,{label:qt.label,color:qt.color,size:"xs"},`${qt.label}-${qt.value||qt.color}`))}),c&&jsxRuntimeExports.jsx(antd.Tooltip,{placement:"top",title:c,children:jsxRuntimeExports.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:qt=>{(qt.key==="Enter"||qt.key===" ")&&qt.preventDefault()},children:jsxRuntimeExports.jsx(HelpIcon,{size:14})})})]}),jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:Jt(),className:cn$1("text-- whitespace-normal break-all flex gap-1 pt-0.5",$e&&"bg-neutral-50 dark:bg-black-700 p-1 rounded",It&&At?.color&&`bg-${At.color}-50 border-${At.color}-300 px-0.5 rounded-lg`),appearance:"body",children:[bt&&dt&&n?jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[jsxRuntimeExports.jsx("span",{className:"line-through",children:dt}),jsxRuntimeExports.jsx("span",{children:Yt()})]}):ze||tt?jsxRuntimeExports.jsx("mark",{className:cn$1("rounded-md py-0.5 px-1",Kt()),children:Yt()}):Yt(),s==="currency"&&yt!==0&&yt!==void 0&&yt!==null&&jsxRuntimeExports.jsxs(framerMotion.motion.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.25},className:cn$1("inline-flex items-center gap-1 ml-1.5 text-xs font-medium",yt>0?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:[jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:yt>0?jsxRuntimeExports.jsx(AllIcons.ArrowUpwardRounded,{sx:{fontSize:16},className:"text-emerald-600 dark:text-emerald-400"}):jsxRuntimeExports.jsx(AllIcons.ArrowDownwardRounded,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})}),jsxRuntimeExports.jsx("span",{children:formatCurrency(Math.abs(yt),Le?.currency_code||"USD")})]}),Le?.is_master_data&&Le?.reference&&n&&jsxRuntimeExports.jsx("button",{onClick:()=>Ht(Le),onKeyDown:qt=>{(qt.key==="Enter"||qt.key===" ")&&(qt.preventDefault(),Ht(Le))},"aria-label":`Search master data for ${t}`,type:"button",className:"cursor-pointer",children:jsxRuntimeExports.jsx(SearchIcon$1,{width:20,height:20})}),Rt&&jsxRuntimeExports.jsx("input",{type:"file",onChange:Vt,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`})]}),dt&&!bt&&jsxRuntimeExports.jsx(Typography,{variant:"medium",size:"extra-small",className:"pt-0.5",appearance:"body",children:jsxRuntimeExports.jsx("mark",{className:"rounded-md py-0.5 px-1 bg-error-100",children:jsxRuntimeExports.jsx("del",{children:dt||s==="boolean"&&dt==="0"?dt==="True"?"Yes":dt==="False"?"No":s==="boolean"?formatBooleanValue(dt):s==="currency"?formatCurrency(dt,Le?.currency_code):s==="date"?formatDate(dt,{skipTimezone:!0,withTime:!1}):s==="datetime"?formatDate(dt,{skipTimezone:!0,withTime:!0}):s==="percentage"?`${dt}%`:dt.length>100?jsxRuntimeExports.jsxs("p",{children:[dt.slice(0,kt?100:dt.length),kt?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${kt?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Pt,children:kt?"Show more":"Show less"})]}):dt:"-"})})}),St&&jsxRuntimeExports.jsx(St,{isVisible:Nt,onClose:Zt,masterdataInfo:jt}),_t&&At&&It&&jsxRuntimeExports.jsx("div",{className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:qt=>qt.stopPropagation(),onMouseDown:qt=>qt.preventDefault(),onKeyDown:qt=>{qt.key==="Escape"&&Tt(!1)},role:"tooltip","aria-label":"Risk analysis details",tabIndex:0,children:Lt?jsxRuntimeExports.jsx(Lt,{riskDetails:At}):jsxRuntimeExports.jsx("div",{className:"shadow-lg p-4",children:jsxRuntimeExports.jsxs("div",{className:"text-sm",children:[jsxRuntimeExports.jsx("h4",{className:"font-semibold mb-2",children:"Risk Details"}),jsxRuntimeExports.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:At.description||"Risk analysis information"})]})})})]})});LabelValue.displayName="LabelValue";const defaultGenerator=e=>e,createClassNameGenerator=()=>{let e=defaultGenerator;return{configure(t){e=t},generate(t){return e(t)},reset(){e=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function formatMuiErrorMessage(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}function capitalize(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":formatMuiErrorMessage(7));return e.charAt(0).toUpperCase()+e.slice(1)}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs(propTypesExports);function r(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=r(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function clsx(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=r(e))&&(a&&(a+=" "),a+=t);return a}function composeClasses(e,t,n=void 0){const a={};for(const s in e){const o=e[s];let c="",Le=!0;for(let $e=0;$e<o.length;$e+=1){const ze=o[$e];ze&&(c+=(Le===!0?"":" ")+t(ze),Le=!1,n&&n[ze]&&(c+=" "+n[ze]))}a[s]=c}return a}var reactIs={exports:{}},reactIs_production={};/**
|
|
195
195
|
* @license React
|
|
196
196
|
* react-is.production.js
|
|
197
197
|
*
|