@biza-gov/layout 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2743 @@
1
+ 'use client';
2
+
3
+ // src/sidebar/StaffSidebar.tsx
4
+ import { useState as useState4, useEffect as useEffect3, useCallback } from "react";
5
+
6
+ // src/utils/useDarkMode.ts
7
+ import { useState, useEffect } from "react";
8
+ function useDarkMode() {
9
+ const [isDark, setIsDark] = useState(false);
10
+ useEffect(() => {
11
+ const root = document.documentElement;
12
+ const check = () => setIsDark(root.classList.contains("dark"));
13
+ check();
14
+ const observer = new MutationObserver(check);
15
+ observer.observe(root, { attributes: true, attributeFilter: ["class"] });
16
+ return () => observer.disconnect();
17
+ }, []);
18
+ return isDark;
19
+ }
20
+
21
+ // src/sidebar/SidebarHeader.tsx
22
+ import { jsx, jsxs } from "react/jsx-runtime";
23
+ function SidebarHeader({ orgLogo, orgName, orgSubtitle, collapsed }) {
24
+ const isDark = useDarkMode();
25
+ if (collapsed) {
26
+ return /* @__PURE__ */ jsx("div", { style: {
27
+ display: "flex",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ padding: "20px 8px"
31
+ }, children: orgLogo ? /* @__PURE__ */ jsx(
32
+ "img",
33
+ {
34
+ src: orgLogo,
35
+ alt: orgName,
36
+ style: {
37
+ width: "36px",
38
+ height: "36px",
39
+ borderRadius: "50%",
40
+ objectFit: "cover"
41
+ }
42
+ }
43
+ ) : /* @__PURE__ */ jsx("div", { style: {
44
+ width: "36px",
45
+ height: "36px",
46
+ borderRadius: "50%",
47
+ background: "var(--color-alias-color-brand-primary, #1e7d55)",
48
+ display: "flex",
49
+ alignItems: "center",
50
+ justifyContent: "center",
51
+ color: "#fff",
52
+ fontWeight: 700,
53
+ fontSize: "14px"
54
+ }, children: orgName.charAt(0) }) });
55
+ }
56
+ return /* @__PURE__ */ jsxs("div", { style: {
57
+ display: "flex",
58
+ alignItems: "center",
59
+ gap: "12px",
60
+ padding: "24px 20px"
61
+ }, children: [
62
+ orgLogo && /* @__PURE__ */ jsx(
63
+ "img",
64
+ {
65
+ src: orgLogo,
66
+ alt: orgName,
67
+ style: {
68
+ width: "48px",
69
+ height: "48px",
70
+ borderRadius: "50%",
71
+ objectFit: "cover",
72
+ flexShrink: 0
73
+ }
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsxs("div", { style: { minWidth: 0 }, children: [
77
+ /* @__PURE__ */ jsx("p", { style: {
78
+ fontWeight: 700,
79
+ fontSize: "16px",
80
+ lineHeight: "22px",
81
+ color: isDark ? "#ffffff" : "var(--color-alias-color-brand-text-dark, #05010e)",
82
+ margin: 0,
83
+ overflow: "hidden",
84
+ textOverflow: "ellipsis",
85
+ whiteSpace: "nowrap"
86
+ }, children: orgName }),
87
+ orgSubtitle && /* @__PURE__ */ jsx("p", { style: {
88
+ fontSize: "14px",
89
+ lineHeight: "20px",
90
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
91
+ margin: 0,
92
+ overflow: "hidden",
93
+ textOverflow: "ellipsis",
94
+ whiteSpace: "nowrap"
95
+ }, children: orgSubtitle })
96
+ ] })
97
+ ] });
98
+ }
99
+
100
+ // src/sidebar/SidebarMenu.tsx
101
+ import { useState as useState2, useId } from "react";
102
+
103
+ // src/icons/GovIcons.tsx
104
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
105
+ var defaultProps = (size = 20) => ({
106
+ width: size,
107
+ height: size,
108
+ viewBox: "0 0 24 24",
109
+ fill: "none",
110
+ stroke: "currentColor",
111
+ strokeWidth: 2,
112
+ strokeLinecap: "round",
113
+ strokeLinejoin: "round"
114
+ });
115
+ function HomeIcon({ size = 20, className, style } = {}) {
116
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
117
+ /* @__PURE__ */ jsx2("path", { d: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
118
+ /* @__PURE__ */ jsx2("polyline", { points: "9 22 9 12 15 12 15 22" })
119
+ ] });
120
+ }
121
+ function SearchIcon({ size = 20, className, style } = {}) {
122
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
123
+ /* @__PURE__ */ jsx2("circle", { cx: "11", cy: "11", r: "8" }),
124
+ /* @__PURE__ */ jsx2("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
125
+ ] });
126
+ }
127
+ function BellIcon({ size = 20, className, style } = {}) {
128
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), viewBox: "0 0 22 24", stroke: "none", fill: "none", className, style, children: /* @__PURE__ */ jsx2("path", { d: "M21.2321 13.4463L19.3618 6.71712C18.8136 4.74574 17.6222 3.01418 15.9769 1.79767C14.3316 0.581165 12.3269 -0.0504751 10.2814 0.00315377C8.23593 0.0567826 6.26708 0.792603 4.6878 2.09365C3.10852 3.3947 2.00945 5.18632 1.5653 7.18371L0.11728 13.6954C-0.0426654 14.4149 -0.0389674 15.1611 0.128101 15.879C0.29517 16.5969 0.621344 17.2681 1.08254 17.8431C1.54374 18.418 2.12818 18.8821 2.79272 19.2009C3.45727 19.5198 4.18494 19.6853 4.92202 19.6853H6.01861C6.24454 20.7979 6.84817 21.7982 7.72723 22.5167C8.60629 23.2352 9.70671 23.6277 10.842 23.6277C11.9774 23.6277 13.0778 23.2352 13.9569 22.5167C14.8359 21.7982 15.4396 20.7979 15.6655 19.6853H16.4904C17.2492 19.6853 17.9977 19.5099 18.6774 19.1728C19.3572 18.8357 19.9498 18.346 20.409 17.742C20.8682 17.1379 21.1815 16.4359 21.3245 15.6907C21.4674 14.9455 21.4352 14.1774 21.2321 13.4463ZM10.842 21.654C10.2334 21.6515 9.64049 21.461 9.1443 21.1086C8.6481 20.7562 8.27291 20.2591 8.07005 19.6853H13.614C13.4112 20.2591 13.036 20.7562 12.5398 21.1086C12.0436 21.461 11.4506 21.6515 10.842 21.654ZM18.8411 16.55C18.5668 16.9139 18.2114 17.2088 17.8032 17.4113C17.3949 17.6138 16.9451 17.7183 16.4894 17.7165H4.92202C4.47982 17.7164 4.04328 17.6171 3.64463 17.4257C3.24598 17.2344 2.89539 16.9559 2.61874 16.611C2.34208 16.266 2.14643 15.8633 2.04622 15.4326C1.94602 15.0019 1.94381 14.5542 2.03977 14.1226L3.4868 7.60994C3.83561 6.04105 4.69886 4.63379 5.93932 3.61186C7.17978 2.58992 8.72625 2.01197 10.3329 1.96988C11.9395 1.92779 13.5142 2.42398 14.8064 3.37956C16.0987 4.33515 17.0344 5.69528 17.4649 7.24376L19.3352 13.9729C19.4588 14.4114 19.4785 14.8725 19.3927 15.3199C19.3069 15.7672 19.1181 16.1884 18.8411 16.55Z", fill: "currentColor" }) });
129
+ }
130
+ function FolderIcon({ size = 20, className, style } = {}) {
131
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }) });
132
+ }
133
+ function ClipboardIcon({ size = 20, className, style } = {}) {
134
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
135
+ /* @__PURE__ */ jsx2("path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }),
136
+ /* @__PURE__ */ jsx2("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" })
137
+ ] });
138
+ }
139
+ function FileTextIcon({ size = 20, className, style } = {}) {
140
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
141
+ /* @__PURE__ */ jsx2("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
142
+ /* @__PURE__ */ jsx2("polyline", { points: "14 2 14 8 20 8" }),
143
+ /* @__PURE__ */ jsx2("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
144
+ /* @__PURE__ */ jsx2("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
145
+ /* @__PURE__ */ jsx2("polyline", { points: "10 9 9 9 8 9" })
146
+ ] });
147
+ }
148
+ function CalendarIcon({ size = 20, className, style } = {}) {
149
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
150
+ /* @__PURE__ */ jsx2("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
151
+ /* @__PURE__ */ jsx2("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
152
+ /* @__PURE__ */ jsx2("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
153
+ /* @__PURE__ */ jsx2("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
154
+ ] });
155
+ }
156
+ function UserIcon({ size = 20, className, style } = {}) {
157
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
158
+ /* @__PURE__ */ jsx2("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
159
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "7", r: "4" })
160
+ ] });
161
+ }
162
+ function UsersIcon({ size = 20, className, style } = {}) {
163
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
164
+ /* @__PURE__ */ jsx2("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
165
+ /* @__PURE__ */ jsx2("circle", { cx: "9", cy: "7", r: "4" }),
166
+ /* @__PURE__ */ jsx2("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
167
+ /* @__PURE__ */ jsx2("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
168
+ ] });
169
+ }
170
+ function GearIcon({ size = 20, className, style } = {}) {
171
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
172
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "3" }),
173
+ /* @__PURE__ */ jsx2("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
174
+ ] });
175
+ }
176
+ function WrenchIcon({ size = 20, className, style } = {}) {
177
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) });
178
+ }
179
+ function ShieldIcon({ size = 20, className, style } = {}) {
180
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) });
181
+ }
182
+ function HelpCircleIcon({ size = 20, className, style } = {}) {
183
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
184
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
185
+ /* @__PURE__ */ jsx2("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
186
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
187
+ ] });
188
+ }
189
+ function BarChartIcon({ size = 20, className, style } = {}) {
190
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
191
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "20", x2: "12", y2: "10" }),
192
+ /* @__PURE__ */ jsx2("line", { x1: "18", y1: "20", x2: "18", y2: "4" }),
193
+ /* @__PURE__ */ jsx2("line", { x1: "6", y1: "20", x2: "6", y2: "16" })
194
+ ] });
195
+ }
196
+ function HistoryIcon({ size = 20, className, style } = {}) {
197
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
198
+ /* @__PURE__ */ jsx2("polyline", { points: "1 4 1 10 7 10" }),
199
+ /* @__PURE__ */ jsx2("path", { d: "M3.51 15a9 9 0 1 0 2.13-9.36L1 10" })
200
+ ] });
201
+ }
202
+ function DatabaseIcon({ size = 20, className, style } = {}) {
203
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
204
+ /* @__PURE__ */ jsx2("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }),
205
+ /* @__PURE__ */ jsx2("path", { d: "M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" }),
206
+ /* @__PURE__ */ jsx2("path", { d: "M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" })
207
+ ] });
208
+ }
209
+ function BuildingIcon({ size = 20, className, style } = {}) {
210
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
211
+ /* @__PURE__ */ jsx2("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2", ry: "2" }),
212
+ /* @__PURE__ */ jsx2("line", { x1: "9", y1: "22", x2: "9", y2: "18" }),
213
+ /* @__PURE__ */ jsx2("line", { x1: "15", y1: "22", x2: "15", y2: "18" }),
214
+ /* @__PURE__ */ jsx2("line", { x1: "9", y1: "6", x2: "9.01", y2: "6" }),
215
+ /* @__PURE__ */ jsx2("line", { x1: "15", y1: "6", x2: "15.01", y2: "6" }),
216
+ /* @__PURE__ */ jsx2("line", { x1: "9", y1: "10", x2: "9.01", y2: "10" }),
217
+ /* @__PURE__ */ jsx2("line", { x1: "15", y1: "10", x2: "15.01", y2: "10" }),
218
+ /* @__PURE__ */ jsx2("line", { x1: "9", y1: "14", x2: "9.01", y2: "14" }),
219
+ /* @__PURE__ */ jsx2("line", { x1: "15", y1: "14", x2: "15.01", y2: "14" })
220
+ ] });
221
+ }
222
+ function MapPinIcon({ size = 20, className, style } = {}) {
223
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
224
+ /* @__PURE__ */ jsx2("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }),
225
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "10", r: "3" })
226
+ ] });
227
+ }
228
+ function PhoneIcon({ size = 20, className, style } = {}) {
229
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" }) });
230
+ }
231
+ function MailIcon({ size = 20, className, style } = {}) {
232
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
233
+ /* @__PURE__ */ jsx2("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
234
+ /* @__PURE__ */ jsx2("polyline", { points: "22,6 12,13 2,6" })
235
+ ] });
236
+ }
237
+ function CheckCircleIcon({ size = 20, className, style } = {}) {
238
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
239
+ /* @__PURE__ */ jsx2("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
240
+ /* @__PURE__ */ jsx2("polyline", { points: "22 4 12 14.01 9 11.01" })
241
+ ] });
242
+ }
243
+ function AlertTriangleIcon({ size = 20, className, style } = {}) {
244
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
245
+ /* @__PURE__ */ jsx2("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
246
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
247
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
248
+ ] });
249
+ }
250
+ function XCircleIcon({ size = 20, className, style } = {}) {
251
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
252
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
253
+ /* @__PURE__ */ jsx2("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
254
+ /* @__PURE__ */ jsx2("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
255
+ ] });
256
+ }
257
+ function PlusCircleIcon({ size = 20, className, style } = {}) {
258
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
259
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
260
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "8", x2: "12", y2: "16" }),
261
+ /* @__PURE__ */ jsx2("line", { x1: "8", y1: "12", x2: "16", y2: "12" })
262
+ ] });
263
+ }
264
+ function LogOutIcon({ size = 20, className, style } = {}) {
265
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
266
+ /* @__PURE__ */ jsx2("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
267
+ /* @__PURE__ */ jsx2("polyline", { points: "16 17 21 12 16 7" }),
268
+ /* @__PURE__ */ jsx2("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
269
+ ] });
270
+ }
271
+ function DownloadIcon({ size = 20, className, style } = {}) {
272
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
273
+ /* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
274
+ /* @__PURE__ */ jsx2("polyline", { points: "7 10 12 15 17 10" }),
275
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
276
+ ] });
277
+ }
278
+ function UploadIcon({ size = 20, className, style } = {}) {
279
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
280
+ /* @__PURE__ */ jsx2("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
281
+ /* @__PURE__ */ jsx2("polyline", { points: "17 8 12 3 7 8" }),
282
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
283
+ ] });
284
+ }
285
+ function PrinterIcon({ size = 20, className, style } = {}) {
286
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
287
+ /* @__PURE__ */ jsx2("polyline", { points: "6 9 6 2 18 2 18 9" }),
288
+ /* @__PURE__ */ jsx2("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
289
+ /* @__PURE__ */ jsx2("rect", { x: "6", y: "14", width: "12", height: "8" })
290
+ ] });
291
+ }
292
+ function StarIcon({ size = 20, className, style } = {}) {
293
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
294
+ }
295
+ function HeartIcon({ size = 20, className, style } = {}) {
296
+ return /* @__PURE__ */ jsx2("svg", { ...defaultProps(size), className, style, children: /* @__PURE__ */ jsx2("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" }) });
297
+ }
298
+ function EyeIcon({ size = 20, className, style } = {}) {
299
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
300
+ /* @__PURE__ */ jsx2("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
301
+ /* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "3" })
302
+ ] });
303
+ }
304
+ function EditIcon({ size = 20, className, style } = {}) {
305
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
306
+ /* @__PURE__ */ jsx2("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
307
+ /* @__PURE__ */ jsx2("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
308
+ ] });
309
+ }
310
+ function TrashIcon({ size = 20, className, style } = {}) {
311
+ return /* @__PURE__ */ jsxs2("svg", { ...defaultProps(size), className, style, children: [
312
+ /* @__PURE__ */ jsx2("polyline", { points: "3 6 5 6 21 6" }),
313
+ /* @__PURE__ */ jsx2("path", { 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" }),
314
+ /* @__PURE__ */ jsx2("line", { x1: "10", y1: "11", x2: "10", y2: "17" }),
315
+ /* @__PURE__ */ jsx2("line", { x1: "14", y1: "11", x2: "14", y2: "17" })
316
+ ] });
317
+ }
318
+
319
+ // src/sidebar/SidebarMenu.tsx
320
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
321
+ var safeCssEscape = (value) => {
322
+ if (typeof CSS !== "undefined" && CSS.escape) {
323
+ return CSS.escape(value);
324
+ }
325
+ return value.replace(/[^a-zA-Z0-9_-]/g, "_");
326
+ };
327
+ var ICON_MAP = {
328
+ home: HomeIcon,
329
+ dashboard: HomeIcon,
330
+ services: FolderIcon,
331
+ service: FolderIcon,
332
+ folder: FolderIcon,
333
+ category: FolderIcon,
334
+ users: UsersIcon,
335
+ members: UsersIcon,
336
+ user: UserIcon,
337
+ profile: UserIcon,
338
+ staff: UserIcon,
339
+ settings: GearIcon,
340
+ setting: GearIcon,
341
+ config: GearIcon,
342
+ help: HelpCircleIcon,
343
+ support: HelpCircleIcon,
344
+ faq: HelpCircleIcon,
345
+ reports: BarChartIcon,
346
+ report: BarChartIcon,
347
+ stats: BarChartIcon,
348
+ chart: BarChartIcon,
349
+ analytics: BarChartIcon,
350
+ roles: ShieldIcon,
351
+ permissions: ShieldIcon,
352
+ security: ShieldIcon,
353
+ logs: HistoryIcon,
354
+ history: HistoryIcon,
355
+ activity: HistoryIcon,
356
+ audit: HistoryIcon,
357
+ backup: DatabaseIcon,
358
+ database: DatabaseIcon,
359
+ data: DatabaseIcon,
360
+ documents: FileTextIcon,
361
+ document: FileTextIcon,
362
+ docs: FileTextIcon,
363
+ files: FileTextIcon,
364
+ file: FileTextIcon,
365
+ forms: ClipboardIcon,
366
+ form: ClipboardIcon,
367
+ request: ClipboardIcon,
368
+ requests: ClipboardIcon,
369
+ calendar: CalendarIcon,
370
+ schedule: CalendarIcon,
371
+ appointment: CalendarIcon,
372
+ notifications: BellIcon,
373
+ notification: BellIcon,
374
+ alerts: BellIcon,
375
+ search: SearchIcon,
376
+ organization: BuildingIcon,
377
+ org: BuildingIcon,
378
+ department: BuildingIcon,
379
+ agency: BuildingIcon,
380
+ location: MapPinIcon,
381
+ map: MapPinIcon,
382
+ address: MapPinIcon,
383
+ phone: PhoneIcon,
384
+ contact: PhoneIcon,
385
+ call: PhoneIcon,
386
+ email: MailIcon,
387
+ mail: MailIcon,
388
+ message: MailIcon,
389
+ messages: MailIcon,
390
+ tools: WrenchIcon,
391
+ maintenance: WrenchIcon,
392
+ favorites: StarIcon,
393
+ bookmark: StarIcon,
394
+ edit: EditIcon,
395
+ manage: EditIcon,
396
+ delete: TrashIcon,
397
+ trash: TrashIcon,
398
+ view: EyeIcon,
399
+ preview: EyeIcon,
400
+ detail: EyeIcon,
401
+ download: DownloadIcon,
402
+ export: DownloadIcon,
403
+ upload: UploadIcon,
404
+ import: UploadIcon,
405
+ print: PrinterIcon,
406
+ printer: PrinterIcon,
407
+ logout: LogOutIcon,
408
+ signout: LogOutIcon,
409
+ approve: CheckCircleIcon,
410
+ approved: CheckCircleIcon,
411
+ add: PlusCircleIcon,
412
+ create: PlusCircleIcon,
413
+ new: PlusCircleIcon
414
+ };
415
+ function DefaultIcon() {
416
+ return /* @__PURE__ */ jsx3("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "4" }) });
417
+ }
418
+ function getAutoIcon(id) {
419
+ const IconComp = ICON_MAP[id.toLowerCase()];
420
+ if (IconComp) return /* @__PURE__ */ jsx3(IconComp, {});
421
+ return /* @__PURE__ */ jsx3(DefaultIcon, {});
422
+ }
423
+ function ChevronDownIcon({ isOpen }) {
424
+ return /* @__PURE__ */ jsx3(
425
+ "svg",
426
+ {
427
+ width: "16",
428
+ height: "16",
429
+ viewBox: "0 0 20 20",
430
+ fill: "none",
431
+ stroke: "currentColor",
432
+ strokeWidth: "2",
433
+ strokeLinecap: "round",
434
+ strokeLinejoin: "round",
435
+ style: {
436
+ transition: "transform 0.2s ease",
437
+ transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
438
+ flexShrink: 0
439
+ },
440
+ children: /* @__PURE__ */ jsx3("path", { d: "M5 7.5L10 12.5L15 7.5" })
441
+ }
442
+ );
443
+ }
444
+ function MenuItemComponent({
445
+ item,
446
+ onItemClick,
447
+ currentPath,
448
+ depth = 0,
449
+ collapsed = false,
450
+ onExpandRequest
451
+ }) {
452
+ const isDark = useDarkMode();
453
+ const hasChildren = item.children && item.children.length > 0;
454
+ const isActive = item.path ? currentPath === item.path : false;
455
+ const resolvedIcon = item.icon || getAutoIcon(item.id);
456
+ const isChildActive = hasChildren ? item.children.some((child) => child.path === currentPath) : false;
457
+ const [userToggled, setUserToggled] = useState2(false);
458
+ const [isOpen, setIsOpen] = useState2(isChildActive);
459
+ const expanded = userToggled ? isOpen : isOpen || isChildActive;
460
+ const btnId = useId();
461
+ const handleClick = () => {
462
+ if (hasChildren) {
463
+ if (collapsed) {
464
+ setUserToggled(true);
465
+ setIsOpen(true);
466
+ onExpandRequest?.();
467
+ } else {
468
+ setUserToggled(true);
469
+ setIsOpen(!expanded);
470
+ }
471
+ } else if (item.path) {
472
+ onItemClick(item.path);
473
+ }
474
+ };
475
+ const activeColor = "var(--color-alias-color-brand-primary, #1e7d55)";
476
+ const hoverBg = isDark ? "#334155" : "var(--color-foundations-fuji-pallet-light, #ebedf5)";
477
+ if (collapsed && depth === 0) {
478
+ return /* @__PURE__ */ jsxs3("li", { children: [
479
+ /* @__PURE__ */ jsx3("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
480
+ /* @__PURE__ */ jsx3(
481
+ "button",
482
+ {
483
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
484
+ "data-active": isActive || isChildActive,
485
+ onClick: handleClick,
486
+ title: item.title,
487
+ style: {
488
+ width: "100%",
489
+ display: "flex",
490
+ alignItems: "center",
491
+ justifyContent: "center",
492
+ padding: "12px 0",
493
+ borderRadius: "8px",
494
+ border: "none",
495
+ background: isActive || isChildActive ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent",
496
+ color: isActive || isChildActive ? activeColor : isDark ? "#ffffff" : "var(--color-alias-text-colors-tertiary, #475272)",
497
+ cursor: "pointer",
498
+ transition: "background-color 0.15s ease",
499
+ WebkitTapHighlightColor: "transparent"
500
+ },
501
+ children: /* @__PURE__ */ jsx3("span", { style: {
502
+ width: "24px",
503
+ height: "24px",
504
+ display: "flex",
505
+ alignItems: "center",
506
+ justifyContent: "center"
507
+ }, children: resolvedIcon })
508
+ }
509
+ ),
510
+ item.dividerAfter && /* @__PURE__ */ jsx3("hr", { style: {
511
+ border: "none",
512
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
513
+ margin: "8px 4px"
514
+ } })
515
+ ] });
516
+ }
517
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
518
+ /* @__PURE__ */ jsxs3("li", { children: [
519
+ /* @__PURE__ */ jsx3("style", { children: `@media(hover:hover){.sidebar-btn-${safeCssEscape(btnId)}:not([data-active='true']):hover{background-color:${hoverBg}!important}}` }),
520
+ /* @__PURE__ */ jsxs3(
521
+ "button",
522
+ {
523
+ className: `sidebar-btn-${safeCssEscape(btnId)}`,
524
+ "data-active": isActive,
525
+ onClick: handleClick,
526
+ style: {
527
+ width: "100%",
528
+ display: "flex",
529
+ alignItems: "center",
530
+ gap: "12px",
531
+ padding: depth > 0 ? "10px 16px 10px 52px" : "12px 16px",
532
+ borderRadius: "8px",
533
+ border: "none",
534
+ background: isActive ? `color-mix(in srgb, ${activeColor} 10%, transparent)` : "transparent",
535
+ color: isActive ? activeColor : isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
536
+ cursor: "pointer",
537
+ transition: "background-color 0.15s ease",
538
+ textAlign: "left",
539
+ fontSize: "15px",
540
+ fontWeight: isActive ? 600 : 400,
541
+ lineHeight: "22px",
542
+ WebkitTapHighlightColor: "transparent"
543
+ },
544
+ children: [
545
+ /* @__PURE__ */ jsx3("span", { style: {
546
+ width: "24px",
547
+ height: "24px",
548
+ display: "flex",
549
+ alignItems: "center",
550
+ justifyContent: "center",
551
+ flexShrink: 0,
552
+ color: isActive ? activeColor : isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)"
553
+ }, children: resolvedIcon }),
554
+ /* @__PURE__ */ jsx3("span", { style: { flex: 1 }, children: item.title }),
555
+ hasChildren && /* @__PURE__ */ jsx3(ChevronDownIcon, { isOpen: expanded })
556
+ ]
557
+ }
558
+ )
559
+ ] }),
560
+ hasChildren && expanded && /* @__PURE__ */ jsx3("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: item.children.map((child) => /* @__PURE__ */ jsx3(
561
+ MenuItemComponent,
562
+ {
563
+ item: child,
564
+ onItemClick,
565
+ currentPath,
566
+ depth: depth + 1
567
+ },
568
+ child.id
569
+ )) }),
570
+ item.dividerAfter && /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3("hr", { style: {
571
+ border: "none",
572
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
573
+ margin: "8px 0"
574
+ } }) })
575
+ ] });
576
+ }
577
+ function SidebarMenu({ menuItems, onItemClick, currentPath, collapsed, onExpandRequest }) {
578
+ return /* @__PURE__ */ jsx3("nav", { style: {
579
+ padding: collapsed ? "8px 8px" : "8px 12px"
580
+ }, children: /* @__PURE__ */ jsx3("ul", { style: {
581
+ listStyle: "none",
582
+ margin: 0,
583
+ padding: 0,
584
+ display: "flex",
585
+ flexDirection: "column",
586
+ gap: "2px"
587
+ }, children: menuItems.map((item) => /* @__PURE__ */ jsx3(
588
+ MenuItemComponent,
589
+ {
590
+ item,
591
+ onItemClick,
592
+ currentPath,
593
+ collapsed,
594
+ onExpandRequest
595
+ },
596
+ item.id
597
+ )) }) });
598
+ }
599
+
600
+ // src/sidebar/SidebarUserProfile.tsx
601
+ import { useState as useState3, useEffect as useEffect2 } from "react";
602
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
603
+ function LogoutIcon() {
604
+ return /* @__PURE__ */ jsxs4(
605
+ "svg",
606
+ {
607
+ width: "20",
608
+ height: "20",
609
+ viewBox: "0 0 24 24",
610
+ fill: "none",
611
+ stroke: "currentColor",
612
+ strokeWidth: "2",
613
+ strokeLinecap: "round",
614
+ strokeLinejoin: "round",
615
+ children: [
616
+ /* @__PURE__ */ jsx4("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
617
+ /* @__PURE__ */ jsx4("polyline", { points: "16 17 21 12 16 7" }),
618
+ /* @__PURE__ */ jsx4("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
619
+ ]
620
+ }
621
+ );
622
+ }
623
+ function ProfileIcon() {
624
+ return /* @__PURE__ */ jsxs4(
625
+ "svg",
626
+ {
627
+ width: "24",
628
+ height: "24",
629
+ viewBox: "0 0 24 24",
630
+ fill: "none",
631
+ stroke: "currentColor",
632
+ strokeWidth: "2",
633
+ strokeLinecap: "round",
634
+ strokeLinejoin: "round",
635
+ children: [
636
+ /* @__PURE__ */ jsx4("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
637
+ /* @__PURE__ */ jsx4("circle", { cx: "12", cy: "7", r: "4" })
638
+ ]
639
+ }
640
+ );
641
+ }
642
+ function AvatarPlaceholder({ size = 40 }) {
643
+ return /* @__PURE__ */ jsx4(
644
+ "div",
645
+ {
646
+ style: {
647
+ width: `${size}px`,
648
+ height: `${size}px`,
649
+ borderRadius: "50%",
650
+ backgroundColor: "#f1f5f9",
651
+ display: "flex",
652
+ alignItems: "center",
653
+ justifyContent: "center",
654
+ flexShrink: 0,
655
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
656
+ },
657
+ children: /* @__PURE__ */ jsx4("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ jsx4("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
658
+ }
659
+ );
660
+ }
661
+ function SidebarUserProfile({
662
+ user,
663
+ roleLabel,
664
+ onLogout,
665
+ collapsed,
666
+ onProfile
667
+ }) {
668
+ const isDark = useDarkMode();
669
+ const [imgError, setImgError] = useState3(false);
670
+ useEffect2(() => {
671
+ setImgError(false);
672
+ }, [user?.pictureUrl]);
673
+ if (!user) return null;
674
+ const getFullName = () => {
675
+ if (user.firstName && user.lastName) {
676
+ return `${user.firstName} ${user.lastName}`;
677
+ }
678
+ return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
679
+ };
680
+ if (collapsed) {
681
+ return /* @__PURE__ */ jsxs4("div", { style: {
682
+ padding: "12px 8px",
683
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
684
+ display: "flex",
685
+ flexDirection: "column",
686
+ alignItems: "center",
687
+ gap: "12px"
688
+ }, children: [
689
+ /* @__PURE__ */ jsx4(
690
+ "div",
691
+ {
692
+ onClick: onProfile,
693
+ title: onProfile ? "\u0E14\u0E39\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C" : getFullName(),
694
+ style: { cursor: onProfile ? "pointer" : "default" },
695
+ children: user.pictureUrl && !imgError ? /* @__PURE__ */ jsx4(
696
+ "img",
697
+ {
698
+ src: user.pictureUrl,
699
+ alt: getFullName(),
700
+ onError: () => setImgError(true),
701
+ style: {
702
+ width: "36px",
703
+ height: "36px",
704
+ borderRadius: "50%",
705
+ objectFit: "cover",
706
+ flexShrink: 0
707
+ }
708
+ }
709
+ ) : /* @__PURE__ */ jsx4(AvatarPlaceholder, { size: 36 })
710
+ }
711
+ ),
712
+ onProfile && /* @__PURE__ */ jsx4(
713
+ "button",
714
+ {
715
+ onClick: onProfile,
716
+ title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",
717
+ onMouseEnter: (e) => {
718
+ e.currentTarget.style.backgroundColor = isDark ? "#334155" : "var(--color-alias-color-brand-surface, #faf9e5)";
719
+ },
720
+ onMouseLeave: (e) => {
721
+ e.currentTarget.style.backgroundColor = "transparent";
722
+ },
723
+ style: {
724
+ width: "36px",
725
+ height: "36px",
726
+ borderRadius: "8px",
727
+ border: "none",
728
+ background: "transparent",
729
+ color: isDark ? "#8be9a0" : "var(--color-alias-color-brand-primary, #1e7d55)",
730
+ cursor: "pointer",
731
+ display: "flex",
732
+ alignItems: "center",
733
+ justifyContent: "center",
734
+ transition: "background-color 0.15s ease"
735
+ },
736
+ children: /* @__PURE__ */ jsx4(ProfileIcon, {})
737
+ }
738
+ ),
739
+ /* @__PURE__ */ jsx4(
740
+ "button",
741
+ {
742
+ onClick: onLogout,
743
+ title: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A",
744
+ onMouseEnter: (e) => {
745
+ e.currentTarget.style.backgroundColor = "var(--color-foundations-fuan-pallet-light, #ffd2d2)";
746
+ },
747
+ onMouseLeave: (e) => {
748
+ e.currentTarget.style.backgroundColor = "transparent";
749
+ },
750
+ style: {
751
+ width: "36px",
752
+ height: "36px",
753
+ borderRadius: "8px",
754
+ border: "none",
755
+ background: "transparent",
756
+ color: "var(--color-alias-semantic-critical, #f21515)",
757
+ cursor: "pointer",
758
+ display: "flex",
759
+ alignItems: "center",
760
+ justifyContent: "center",
761
+ transition: "background-color 0.15s ease"
762
+ },
763
+ children: /* @__PURE__ */ jsx4(LogoutIcon, {})
764
+ }
765
+ )
766
+ ] });
767
+ }
768
+ return /* @__PURE__ */ jsxs4(
769
+ "div",
770
+ {
771
+ style: {
772
+ padding: "16px 20px",
773
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
774
+ display: "flex",
775
+ alignItems: "center",
776
+ gap: "12px"
777
+ },
778
+ children: [
779
+ /* @__PURE__ */ jsxs4(
780
+ "div",
781
+ {
782
+ onClick: onProfile,
783
+ onMouseEnter: (e) => {
784
+ if (onProfile) e.currentTarget.style.opacity = "0.8";
785
+ },
786
+ onMouseLeave: (e) => {
787
+ if (onProfile) e.currentTarget.style.opacity = "1";
788
+ },
789
+ style: {
790
+ display: "flex",
791
+ alignItems: "center",
792
+ gap: "12px",
793
+ flex: 1,
794
+ minWidth: 0,
795
+ cursor: onProfile ? "pointer" : "default",
796
+ transition: "opacity 0.15s ease"
797
+ },
798
+ children: [
799
+ user.pictureUrl && !imgError ? /* @__PURE__ */ jsx4(
800
+ "img",
801
+ {
802
+ src: user.pictureUrl,
803
+ alt: getFullName(),
804
+ onError: () => setImgError(true),
805
+ style: {
806
+ width: "40px",
807
+ height: "40px",
808
+ borderRadius: "50%",
809
+ objectFit: "cover",
810
+ flexShrink: 0
811
+ }
812
+ }
813
+ ) : /* @__PURE__ */ jsx4(AvatarPlaceholder, { size: 40 }),
814
+ /* @__PURE__ */ jsxs4("div", { style: { flex: 1, minWidth: 0 }, children: [
815
+ /* @__PURE__ */ jsx4("p", { style: {
816
+ fontWeight: 600,
817
+ fontSize: "14px",
818
+ lineHeight: "20px",
819
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
820
+ margin: 0,
821
+ overflow: "hidden",
822
+ textOverflow: "ellipsis",
823
+ whiteSpace: "nowrap"
824
+ }, children: getFullName() }),
825
+ /* @__PURE__ */ jsx4("p", { style: {
826
+ fontSize: "12px",
827
+ lineHeight: "16px",
828
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
829
+ margin: 0
830
+ }, children: roleLabel })
831
+ ] })
832
+ ]
833
+ }
834
+ ),
835
+ onProfile && /* @__PURE__ */ jsx4(
836
+ "button",
837
+ {
838
+ onClick: onProfile,
839
+ title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C\u0E02\u0E2D\u0E07\u0E09\u0E31\u0E19",
840
+ onMouseEnter: (e) => {
841
+ e.currentTarget.style.backgroundColor = isDark ? "#334155" : "var(--color-alias-color-brand-surface, #faf9e5)";
842
+ },
843
+ onMouseLeave: (e) => {
844
+ e.currentTarget.style.backgroundColor = "transparent";
845
+ },
846
+ style: {
847
+ width: "36px",
848
+ height: "36px",
849
+ borderRadius: "8px",
850
+ border: "none",
851
+ background: "transparent",
852
+ color: isDark ? "#8be9a0" : "var(--color-alias-color-brand-primary, #1e7d55)",
853
+ cursor: "pointer",
854
+ display: "flex",
855
+ alignItems: "center",
856
+ justifyContent: "center",
857
+ transition: "background-color 0.15s ease",
858
+ flexShrink: 0
859
+ },
860
+ children: /* @__PURE__ */ jsx4(ProfileIcon, {})
861
+ }
862
+ ),
863
+ /* @__PURE__ */ jsx4(
864
+ "button",
865
+ {
866
+ onClick: onLogout,
867
+ title: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A",
868
+ onMouseEnter: (e) => {
869
+ e.currentTarget.style.backgroundColor = "var(--color-foundations-fuan-pallet-light, #ffd2d2)";
870
+ e.currentTarget.style.color = "var(--color-alias-semantic-critical, #f21515)";
871
+ },
872
+ onMouseLeave: (e) => {
873
+ e.currentTarget.style.backgroundColor = "transparent";
874
+ e.currentTarget.style.color = "var(--color-alias-semantic-critical, #f21515)";
875
+ },
876
+ style: {
877
+ width: "36px",
878
+ height: "36px",
879
+ borderRadius: "8px",
880
+ border: "none",
881
+ background: "transparent",
882
+ color: "var(--color-alias-semantic-critical, #f21515)",
883
+ cursor: "pointer",
884
+ display: "flex",
885
+ alignItems: "center",
886
+ justifyContent: "center",
887
+ transition: "background-color 0.15s ease",
888
+ flexShrink: 0
889
+ },
890
+ children: /* @__PURE__ */ jsx4(LogoutIcon, {})
891
+ }
892
+ )
893
+ ]
894
+ }
895
+ );
896
+ }
897
+
898
+ // src/sidebar/StaffSidebar.tsx
899
+ import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
900
+ function useIsMobile(breakpoint = 768) {
901
+ const [isMobile, setIsMobile] = useState4(false);
902
+ useEffect3(() => {
903
+ if (typeof window === "undefined") return;
904
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
905
+ setIsMobile(mql.matches);
906
+ const handler = (e) => setIsMobile(e.matches);
907
+ mql.addEventListener("change", handler);
908
+ return () => mql.removeEventListener("change", handler);
909
+ }, [breakpoint]);
910
+ return isMobile;
911
+ }
912
+ function ToggleIcon({ isOpen }) {
913
+ return /* @__PURE__ */ jsx5(
914
+ "svg",
915
+ {
916
+ width: "18",
917
+ height: "18",
918
+ viewBox: "0 0 24 24",
919
+ fill: "none",
920
+ stroke: "currentColor",
921
+ strokeWidth: "2",
922
+ strokeLinecap: "round",
923
+ strokeLinejoin: "round",
924
+ style: {
925
+ transition: "transform 0.2s ease",
926
+ transform: isOpen ? "rotate(0deg)" : "rotate(180deg)"
927
+ },
928
+ children: /* @__PURE__ */ jsx5("path", { d: "M15 18l-6-6 6-6" })
929
+ }
930
+ );
931
+ }
932
+ function HamburgerIcon() {
933
+ return /* @__PURE__ */ jsx5("svg", { width: "24", height: "18", viewBox: "0 0 27 18", fill: "none", children: /* @__PURE__ */ jsx5(
934
+ "path",
935
+ {
936
+ d: "M1.1875 17.8426C0.851042 17.8426 0.569077 17.7287 0.341604 17.501C0.113868 17.2735 0 16.9914 0 16.6547C0 16.3182 0.113868 16.0363 0.341604 15.8088C0.569077 15.5816 0.851042 15.468 1.1875 15.468H25.7292C26.0656 15.468 26.3476 15.5817 26.5751 15.8092C26.8028 16.0369 26.9167 16.3192 26.9167 16.6559C26.9167 16.9923 26.8028 17.2743 26.5751 17.5018C26.3476 17.729 26.0656 17.8426 25.7292 17.8426H1.1875ZM1.1875 10.1088C0.851042 10.1088 0.569077 9.99492 0.341604 9.76719C0.113868 9.53945 0 9.25735 0 8.9209C0 8.58417 0.113868 8.30221 0.341604 8.075C0.569077 7.84753 0.851042 7.73379 1.1875 7.73379H25.7292C26.0656 7.73379 26.3476 7.84766 26.5751 8.0754C26.8028 8.30313 26.9167 8.58523 26.9167 8.92169C26.9167 9.25841 26.8028 9.54037 26.5751 9.76758C26.3476 9.99506 26.0656 10.1088 25.7292 10.1088H1.1875ZM1.1875 2.3746C0.851042 2.3746 0.569077 2.26087 0.341604 2.0334C0.113868 1.80566 0 1.52343 0 1.18671C0 0.850249 0.113868 0.568284 0.341604 0.340812C0.569077 0.113604 0.851042 0 1.1875 0H25.7292C26.0656 0 26.3476 0.113868 26.5751 0.341604C26.8028 0.569077 26.9167 0.851174 26.9167 1.1879C26.9167 1.52435 26.8028 1.80632 26.5751 2.03379C26.3476 2.261 26.0656 2.3746 25.7292 2.3746H1.1875Z",
937
+ fill: "currentColor"
938
+ }
939
+ ) });
940
+ }
941
+ function CloseIcon() {
942
+ return /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
943
+ /* @__PURE__ */ jsx5("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
944
+ /* @__PURE__ */ jsx5("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
945
+ ] });
946
+ }
947
+ function HelpCircleIcon2() {
948
+ return /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
949
+ /* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "10" }),
950
+ /* @__PURE__ */ jsx5("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
951
+ /* @__PURE__ */ jsx5("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
952
+ ] });
953
+ }
954
+ function GearIcon2() {
955
+ return /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
956
+ /* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "3" }),
957
+ /* @__PURE__ */ jsx5("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
958
+ ] });
959
+ }
960
+ var DEFAULT_BOTTOM_MENU = [
961
+ { id: "settings", title: "\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E23\u0E30\u0E1A\u0E1A", icon: /* @__PURE__ */ jsx5(GearIcon2, {}), path: "/settings" },
962
+ { id: "help", title: "\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D", icon: /* @__PURE__ */ jsx5(HelpCircleIcon2, {}), path: "/help" }
963
+ ];
964
+ function StaffSidebar({
965
+ orgLogo,
966
+ orgName,
967
+ orgSubtitle,
968
+ menuItems,
969
+ bottomMenuItems,
970
+ user,
971
+ roleLabel,
972
+ onNavigate,
973
+ onLogout,
974
+ onProfile,
975
+ currentPath,
976
+ width = "280px",
977
+ className,
978
+ collapsible = false,
979
+ isOpen: controlledIsOpen,
980
+ onToggle,
981
+ onExpandRequest,
982
+ topOffset = 0,
983
+ mobileBreakpoint = 768
984
+ }) {
985
+ const isDark = useDarkMode();
986
+ const isMobile = useIsMobile(mobileBreakpoint);
987
+ const [internalOpen, setInternalOpen] = useState4(true);
988
+ const [mobileDrawerOpen, setMobileDrawerOpen] = useState4(false);
989
+ const sidebarOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalOpen;
990
+ const collapsed = collapsible && !sidebarOpen;
991
+ const collapsedWidth = "64px";
992
+ const currentWidth = collapsed ? collapsedWidth : width;
993
+ const resolvedBottomMenu = bottomMenuItems !== void 0 ? bottomMenuItems : DEFAULT_BOTTOM_MENU;
994
+ const handleToggle = () => {
995
+ if (onToggle) {
996
+ onToggle();
997
+ } else {
998
+ setInternalOpen(!internalOpen);
999
+ }
1000
+ };
1001
+ const handleExpandRequest = () => {
1002
+ if (onExpandRequest) {
1003
+ onExpandRequest();
1004
+ } else {
1005
+ if (onToggle) {
1006
+ onToggle();
1007
+ } else {
1008
+ setInternalOpen(true);
1009
+ }
1010
+ }
1011
+ };
1012
+ const openDrawer = useCallback(() => setMobileDrawerOpen(true), []);
1013
+ const closeDrawer = useCallback(() => setMobileDrawerOpen(false), []);
1014
+ const handleMobileNavigate = useCallback((path) => {
1015
+ onNavigate(path);
1016
+ if (isMobile) closeDrawer();
1017
+ }, [onNavigate, isMobile, closeDrawer]);
1018
+ useEffect3(() => {
1019
+ if (isMobile && mobileDrawerOpen) {
1020
+ const originalOverflow = document.body.style.overflow;
1021
+ document.body.style.overflow = "hidden";
1022
+ return () => {
1023
+ document.body.style.overflow = originalOverflow;
1024
+ };
1025
+ }
1026
+ }, [isMobile, mobileDrawerOpen]);
1027
+ useEffect3(() => {
1028
+ if (!isMobile || !mobileDrawerOpen) return;
1029
+ const handler = (e) => {
1030
+ if (e.key === "Escape") closeDrawer();
1031
+ };
1032
+ window.addEventListener("keydown", handler);
1033
+ return () => window.removeEventListener("keydown", handler);
1034
+ }, [isMobile, mobileDrawerOpen, closeDrawer]);
1035
+ if (isMobile) {
1036
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
1037
+ /* @__PURE__ */ jsxs5(
1038
+ "header",
1039
+ {
1040
+ style: {
1041
+ position: "sticky",
1042
+ top: 0,
1043
+ left: 0,
1044
+ right: 0,
1045
+ height: "60px",
1046
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1047
+ display: "flex",
1048
+ alignItems: "center",
1049
+ justifyContent: "space-between",
1050
+ padding: "0 16px",
1051
+ zIndex: 49,
1052
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)"
1053
+ },
1054
+ children: [
1055
+ /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: 1, minWidth: 0 }, children: [
1056
+ orgLogo ? /* @__PURE__ */ jsx5(
1057
+ "img",
1058
+ {
1059
+ src: orgLogo,
1060
+ alt: orgName,
1061
+ style: {
1062
+ width: "40px",
1063
+ height: "40px",
1064
+ borderRadius: "50%",
1065
+ objectFit: "cover",
1066
+ flexShrink: 0,
1067
+ border: "2px solid rgba(255,255,255,0.3)"
1068
+ }
1069
+ }
1070
+ ) : /* @__PURE__ */ jsx5("div", { style: {
1071
+ width: "40px",
1072
+ height: "40px",
1073
+ borderRadius: "50%",
1074
+ background: "rgba(255,255,255,0.2)",
1075
+ display: "flex",
1076
+ alignItems: "center",
1077
+ justifyContent: "center",
1078
+ color: "#fff",
1079
+ fontWeight: 700,
1080
+ fontSize: "16px",
1081
+ flexShrink: 0
1082
+ }, children: orgName.slice(0, 2) }),
1083
+ /* @__PURE__ */ jsxs5("div", { style: { minWidth: 0 }, children: [
1084
+ /* @__PURE__ */ jsx5("p", { style: {
1085
+ color: "#fff",
1086
+ fontWeight: 700,
1087
+ fontSize: "15px",
1088
+ lineHeight: "20px",
1089
+ margin: 0,
1090
+ overflow: "hidden",
1091
+ textOverflow: "ellipsis",
1092
+ whiteSpace: "nowrap"
1093
+ }, children: orgName }),
1094
+ orgSubtitle && /* @__PURE__ */ jsx5("p", { style: {
1095
+ color: "rgba(255,255,255,0.75)",
1096
+ fontSize: "12px",
1097
+ lineHeight: "16px",
1098
+ margin: 0,
1099
+ overflow: "hidden",
1100
+ textOverflow: "ellipsis",
1101
+ whiteSpace: "nowrap"
1102
+ }, children: orgSubtitle })
1103
+ ] })
1104
+ ] }),
1105
+ /* @__PURE__ */ jsx5(
1106
+ "button",
1107
+ {
1108
+ onClick: openDrawer,
1109
+ "aria-label": "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
1110
+ style: {
1111
+ width: "44px",
1112
+ height: "44px",
1113
+ borderRadius: "10px",
1114
+ border: "none",
1115
+ background: "rgba(255,255,255,0.12)",
1116
+ cursor: "pointer",
1117
+ display: "flex",
1118
+ alignItems: "center",
1119
+ justifyContent: "center",
1120
+ color: "#ffffff",
1121
+ flexShrink: 0,
1122
+ transition: "background-color 0.15s ease",
1123
+ WebkitTapHighlightColor: "transparent"
1124
+ },
1125
+ children: /* @__PURE__ */ jsx5(HamburgerIcon, {})
1126
+ }
1127
+ )
1128
+ ]
1129
+ }
1130
+ ),
1131
+ /* @__PURE__ */ jsx5(
1132
+ "div",
1133
+ {
1134
+ onClick: closeDrawer,
1135
+ style: {
1136
+ position: "fixed",
1137
+ inset: 0,
1138
+ background: "rgba(0,0,0,0.45)",
1139
+ zIndex: 99,
1140
+ opacity: mobileDrawerOpen ? 1 : 0,
1141
+ pointerEvents: mobileDrawerOpen ? "auto" : "none",
1142
+ transition: "opacity 0.3s ease",
1143
+ WebkitTapHighlightColor: "transparent"
1144
+ }
1145
+ }
1146
+ ),
1147
+ /* @__PURE__ */ jsxs5(
1148
+ "aside",
1149
+ {
1150
+ className,
1151
+ style: {
1152
+ position: "fixed",
1153
+ top: 0,
1154
+ left: 0,
1155
+ bottom: 0,
1156
+ width: "min(85vw, 320px)",
1157
+ background: isDark ? "#1e293b" : "#fff",
1158
+ zIndex: 100,
1159
+ display: "flex",
1160
+ flexDirection: "column",
1161
+ overflow: "hidden",
1162
+ boxShadow: mobileDrawerOpen ? "4px 0 24px rgba(0,0,0,0.2)" : "none",
1163
+ transform: mobileDrawerOpen ? "translateX(0)" : "translateX(-100%)",
1164
+ transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
1165
+ color: isDark ? "#ffffff" : void 0
1166
+ },
1167
+ children: [
1168
+ /* @__PURE__ */ jsxs5("div", { style: {
1169
+ display: "flex",
1170
+ alignItems: "center",
1171
+ justifyContent: "space-between",
1172
+ padding: "16px 16px 16px 20px",
1173
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1174
+ flexShrink: 0
1175
+ }, children: [
1176
+ /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", gap: "12px", flex: 1, minWidth: 0 }, children: [
1177
+ orgLogo ? /* @__PURE__ */ jsx5(
1178
+ "img",
1179
+ {
1180
+ src: orgLogo,
1181
+ alt: orgName,
1182
+ style: {
1183
+ width: "44px",
1184
+ height: "44px",
1185
+ borderRadius: "50%",
1186
+ objectFit: "cover",
1187
+ flexShrink: 0,
1188
+ border: "2px solid rgba(255,255,255,0.3)"
1189
+ }
1190
+ }
1191
+ ) : /* @__PURE__ */ jsx5("div", { style: {
1192
+ width: "44px",
1193
+ height: "44px",
1194
+ borderRadius: "50%",
1195
+ background: "rgba(255,255,255,0.2)",
1196
+ display: "flex",
1197
+ alignItems: "center",
1198
+ justifyContent: "center",
1199
+ color: "#fff",
1200
+ fontWeight: 700,
1201
+ fontSize: "16px",
1202
+ flexShrink: 0
1203
+ }, children: orgName.slice(0, 2) }),
1204
+ /* @__PURE__ */ jsxs5("div", { style: { minWidth: 0 }, children: [
1205
+ /* @__PURE__ */ jsx5("p", { style: {
1206
+ color: "#fff",
1207
+ fontWeight: 700,
1208
+ fontSize: "15px",
1209
+ lineHeight: "20px",
1210
+ margin: 0,
1211
+ overflow: "hidden",
1212
+ textOverflow: "ellipsis",
1213
+ whiteSpace: "nowrap"
1214
+ }, children: orgName }),
1215
+ orgSubtitle && /* @__PURE__ */ jsx5("p", { style: {
1216
+ color: "rgba(255,255,255,0.75)",
1217
+ fontSize: "12px",
1218
+ lineHeight: "16px",
1219
+ margin: 0
1220
+ }, children: orgSubtitle })
1221
+ ] })
1222
+ ] }),
1223
+ /* @__PURE__ */ jsx5(
1224
+ "button",
1225
+ {
1226
+ onClick: closeDrawer,
1227
+ "aria-label": "\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
1228
+ style: {
1229
+ width: "40px",
1230
+ height: "40px",
1231
+ borderRadius: "10px",
1232
+ border: "none",
1233
+ background: "rgba(255,255,255,0.15)",
1234
+ cursor: "pointer",
1235
+ display: "flex",
1236
+ alignItems: "center",
1237
+ justifyContent: "center",
1238
+ color: "#ffffff",
1239
+ flexShrink: 0,
1240
+ transition: "background-color 0.15s ease",
1241
+ WebkitTapHighlightColor: "transparent"
1242
+ },
1243
+ children: /* @__PURE__ */ jsx5(CloseIcon, {})
1244
+ }
1245
+ )
1246
+ ] }),
1247
+ /* @__PURE__ */ jsx5("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: /* @__PURE__ */ jsx5(
1248
+ SidebarMenu,
1249
+ {
1250
+ menuItems,
1251
+ onItemClick: handleMobileNavigate,
1252
+ currentPath,
1253
+ collapsed: false
1254
+ }
1255
+ ) }),
1256
+ /* @__PURE__ */ jsxs5("div", { style: { flexShrink: 0 }, children: [
1257
+ resolvedBottomMenu && resolvedBottomMenu.length > 0 && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1258
+ /* @__PURE__ */ jsx5("hr", { style: {
1259
+ border: "none",
1260
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1261
+ margin: "4px 12px"
1262
+ } }),
1263
+ /* @__PURE__ */ jsx5(
1264
+ SidebarMenu,
1265
+ {
1266
+ menuItems: resolvedBottomMenu,
1267
+ onItemClick: handleMobileNavigate,
1268
+ currentPath,
1269
+ collapsed: false
1270
+ }
1271
+ )
1272
+ ] }),
1273
+ /* @__PURE__ */ jsx5(
1274
+ SidebarUserProfile,
1275
+ {
1276
+ user,
1277
+ roleLabel,
1278
+ onLogout,
1279
+ onProfile,
1280
+ collapsed: false
1281
+ }
1282
+ )
1283
+ ] })
1284
+ ]
1285
+ }
1286
+ )
1287
+ ] });
1288
+ }
1289
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
1290
+ /* @__PURE__ */ jsxs5(
1291
+ "aside",
1292
+ {
1293
+ className,
1294
+ style: {
1295
+ position: "fixed",
1296
+ top: topOffset,
1297
+ left: 0,
1298
+ height: `calc(100vh - ${typeof topOffset === "number" ? topOffset + "px" : topOffset})`,
1299
+ width: currentWidth,
1300
+ background: isDark ? "#1e293b" : "#fff",
1301
+ borderRight: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1302
+ display: "flex",
1303
+ flexDirection: "column",
1304
+ zIndex: 50,
1305
+ overflow: "hidden",
1306
+ transition: "width 0.3s ease",
1307
+ color: isDark ? "#ffffff" : void 0
1308
+ },
1309
+ children: [
1310
+ /* @__PURE__ */ jsx5(
1311
+ SidebarHeader,
1312
+ {
1313
+ orgLogo,
1314
+ orgName,
1315
+ orgSubtitle,
1316
+ collapsed
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ jsx5("div", { style: { flex: 1, overflowY: "auto", minHeight: 0 }, children: /* @__PURE__ */ jsx5(
1320
+ SidebarMenu,
1321
+ {
1322
+ menuItems,
1323
+ onItemClick: onNavigate,
1324
+ currentPath,
1325
+ collapsed,
1326
+ onExpandRequest: handleExpandRequest
1327
+ }
1328
+ ) }),
1329
+ /* @__PURE__ */ jsxs5("div", { style: { flexShrink: 0 }, children: [
1330
+ resolvedBottomMenu && resolvedBottomMenu.length > 0 && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1331
+ /* @__PURE__ */ jsx5("hr", { style: {
1332
+ border: "none",
1333
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1334
+ margin: "4px 12px"
1335
+ } }),
1336
+ /* @__PURE__ */ jsx5(
1337
+ SidebarMenu,
1338
+ {
1339
+ menuItems: resolvedBottomMenu,
1340
+ onItemClick: onNavigate,
1341
+ currentPath,
1342
+ collapsed,
1343
+ onExpandRequest: handleExpandRequest
1344
+ }
1345
+ )
1346
+ ] }),
1347
+ /* @__PURE__ */ jsx5(
1348
+ SidebarUserProfile,
1349
+ {
1350
+ user,
1351
+ roleLabel,
1352
+ onLogout,
1353
+ onProfile,
1354
+ collapsed
1355
+ }
1356
+ )
1357
+ ] })
1358
+ ]
1359
+ }
1360
+ ),
1361
+ collapsible && /* @__PURE__ */ jsxs5(Fragment2, { children: [
1362
+ /* @__PURE__ */ jsx5("style", { children: `@media(hover:hover){.sidebar-toggle-btn:hover{background-color:${isDark ? "#374151" : "#f3f4f6"}!important}}` }),
1363
+ /* @__PURE__ */ jsx5(
1364
+ "button",
1365
+ {
1366
+ className: "sidebar-toggle-btn",
1367
+ onClick: handleToggle,
1368
+ title: sidebarOpen ? "\u0E22\u0E48\u0E2D Sidebar" : "\u0E02\u0E22\u0E32\u0E22 Sidebar",
1369
+ style: {
1370
+ position: "fixed",
1371
+ top: `calc(${typeof topOffset === "number" ? topOffset + "px" : topOffset} + 10vh)`,
1372
+ left: currentWidth,
1373
+ zIndex: 51,
1374
+ width: "24px",
1375
+ height: "40px",
1376
+ borderRadius: "0 6px 6px 0",
1377
+ border: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
1378
+ borderLeft: "none",
1379
+ background: isDark ? "#1e293b" : "#fff",
1380
+ cursor: "pointer",
1381
+ display: "flex",
1382
+ alignItems: "center",
1383
+ justifyContent: "center",
1384
+ boxShadow: isDark ? "2px 0 8px rgba(0,0,0,0.3)" : "2px 0 8px rgba(0,0,0,0.06)",
1385
+ transition: "left 0.3s ease",
1386
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-tertiary, #475272)",
1387
+ WebkitTapHighlightColor: "transparent"
1388
+ },
1389
+ children: /* @__PURE__ */ jsx5(ToggleIcon, { isOpen: sidebarOpen })
1390
+ }
1391
+ )
1392
+ ] })
1393
+ ] });
1394
+ }
1395
+
1396
+ // src/header/UserHeader.tsx
1397
+ import { useState as useState5, useRef, useEffect as useEffect4 } from "react";
1398
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1399
+ function BellIcon2() {
1400
+ return /* @__PURE__ */ jsx6("svg", { width: "22", height: "24", viewBox: "0 0 22 24", fill: "none", children: /* @__PURE__ */ jsx6(
1401
+ "path",
1402
+ {
1403
+ d: "M21.2321 13.4463L19.3618 6.71712C18.8136 4.74574 17.6222 3.01418 15.9769 1.79767C14.3316 0.581165 12.3269 -0.0504751 10.2814 0.00315377C8.23593 0.0567826 6.26708 0.792603 4.6878 2.09365C3.10852 3.3947 2.00945 5.18632 1.5653 7.18371L0.11728 13.6954C-0.0426654 14.4149 -0.0389674 15.1611 0.128101 15.879C0.29517 16.5969 0.621344 17.2681 1.08254 17.8431C1.54374 18.418 2.12818 18.8821 2.79272 19.2009C3.45727 19.5198 4.18494 19.6853 4.92202 19.6853H6.01861C6.24454 20.7979 6.84817 21.7982 7.72723 22.5167C8.60629 23.2352 9.70671 23.6277 10.842 23.6277C11.9774 23.6277 13.0778 23.2352 13.9569 22.5167C14.8359 21.7982 15.4396 20.7979 15.6655 19.6853H16.4904C17.2492 19.6853 17.9977 19.5099 18.6774 19.1728C19.3572 18.8357 19.9498 18.346 20.409 17.742C20.8682 17.1379 21.1815 16.4359 21.3245 15.6907C21.4674 14.9455 21.4352 14.1774 21.2321 13.4463ZM10.842 21.654C10.2334 21.6515 9.64049 21.461 9.1443 21.1086C8.6481 20.7562 8.27291 20.2591 8.07005 19.6853H13.614C13.4112 20.2591 13.036 20.7562 12.5398 21.1086C12.0436 21.461 11.4506 21.6515 10.842 21.654ZM18.8411 16.55C18.5668 16.9139 18.2114 17.2088 17.8032 17.4113C17.3949 17.6138 16.9451 17.7183 16.4894 17.7165H4.92202C4.47982 17.7164 4.04328 17.6171 3.64463 17.4257C3.24598 17.2344 2.89539 16.9559 2.61874 16.611C2.34208 16.266 2.14643 15.8633 2.04622 15.4326C1.94602 15.0019 1.94381 14.5542 2.03977 14.1226L3.4868 7.60994C3.83561 6.04105 4.69886 4.63379 5.93932 3.61186C7.17978 2.58992 8.72625 2.01197 10.3329 1.96988C11.9395 1.92779 13.5142 2.42398 14.8064 3.37956C16.0987 4.33515 17.0344 5.69528 17.4649 7.24376L19.3352 13.9729C19.4588 14.4114 19.4785 14.8725 19.3927 15.3199C19.3069 15.7672 19.1181 16.1884 18.8411 16.55Z",
1404
+ fill: "currentColor"
1405
+ }
1406
+ ) });
1407
+ }
1408
+ function HamburgerIcon2() {
1409
+ return /* @__PURE__ */ jsx6("svg", { width: "24", height: "18", viewBox: "0 0 27 18", fill: "none", children: /* @__PURE__ */ jsx6(
1410
+ "path",
1411
+ {
1412
+ d: "M1.1875 17.8426C0.851042 17.8426 0.569077 17.7287 0.341604 17.501C0.113868 17.2735 0 16.9914 0 16.6547C0 16.3182 0.113868 16.0363 0.341604 15.8088C0.569077 15.5816 0.851042 15.468 1.1875 15.468H25.7292C26.0656 15.468 26.3476 15.5817 26.5751 15.8092C26.8028 16.0369 26.9167 16.3192 26.9167 16.6559C26.9167 16.9923 26.8028 17.2743 26.5751 17.5018C26.3476 17.729 26.0656 17.8426 25.7292 17.8426H1.1875ZM1.1875 10.1088C0.851042 10.1088 0.569077 9.99492 0.341604 9.76719C0.113868 9.53945 0 9.25735 0 8.9209C0 8.58417 0.113868 8.30221 0.341604 8.075C0.569077 7.84753 0.851042 7.73379 1.1875 7.73379H25.7292C26.0656 7.73379 26.3476 7.84766 26.5751 8.0754C26.8028 8.30313 26.9167 8.58523 26.9167 8.92169C26.9167 9.25841 26.8028 9.54037 26.5751 9.76758C26.3476 9.99506 26.0656 10.1088 25.7292 10.1088H1.1875ZM1.1875 2.3746C0.851042 2.3746 0.569077 2.26087 0.341604 2.0334C0.113868 1.80566 0 1.52343 0 1.18671C0 0.850249 0.113868 0.568284 0.341604 0.340812C0.569077 0.113604 0.851042 0 1.1875 0H25.7292C26.0656 0 26.3476 0.113868 26.5751 0.341604C26.8028 0.569077 26.9167 0.851174 26.9167 1.1879C26.9167 1.52435 26.8028 1.80632 26.5751 2.03379C26.3476 2.261 26.0656 2.3746 25.7292 2.3746H1.1875Z",
1413
+ fill: "currentColor"
1414
+ }
1415
+ ) });
1416
+ }
1417
+ function MessageOutlinedIcon(props) {
1418
+ return /* @__PURE__ */ jsx6("svg", { focusable: "false", "aria-hidden": "true", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: /* @__PURE__ */ jsx6("path", { d: "M4 4h16v12H5.17L4 17.17zm0-2c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm2 10h12v2H6zm0-3h12v2H6zm0-3h12v2H6z" }) });
1419
+ }
1420
+ function AvatarPlaceholder2({ size = 44 }) {
1421
+ return /* @__PURE__ */ jsx6(
1422
+ "div",
1423
+ {
1424
+ style: {
1425
+ width: `${size}px`,
1426
+ height: `${size}px`,
1427
+ borderRadius: "50%",
1428
+ backgroundColor: "#f1f5f9",
1429
+ display: "flex",
1430
+ alignItems: "center",
1431
+ justifyContent: "center",
1432
+ flexShrink: 0,
1433
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
1434
+ },
1435
+ children: /* @__PURE__ */ jsx6("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ jsx6("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
1436
+ }
1437
+ );
1438
+ }
1439
+ function getNotifBg(type) {
1440
+ const map = {
1441
+ success: "#dcfce7",
1442
+ warning: "#fef9c3",
1443
+ error: "#fee2e2",
1444
+ reminder: "#f3e8ff",
1445
+ info: "#dbeafe"
1446
+ };
1447
+ return map[type] || map.info;
1448
+ }
1449
+ function getNotifIcon(type) {
1450
+ const map = {
1451
+ success: "\u2713",
1452
+ warning: "!",
1453
+ error: "\u2715",
1454
+ reminder: "\u23F0",
1455
+ info: "i"
1456
+ };
1457
+ return map[type] || map.info;
1458
+ }
1459
+ function UserHeader({
1460
+ user,
1461
+ notifications = [],
1462
+ onToggleSidebar,
1463
+ notificationBell,
1464
+ onMarkAllRead,
1465
+ onNotificationClick,
1466
+ onProfile,
1467
+ className
1468
+ }) {
1469
+ const displayName = `${user?.firstName || ""} ${user?.lastName || ""}`.trim() || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1470
+ const [isNotifOpen, setIsNotifOpen] = useState5(false);
1471
+ const [activeFilter, setActiveFilter] = useState5("all");
1472
+ const notifRef = useRef(null);
1473
+ const isDark = useDarkMode();
1474
+ const [imgError, setImgError] = useState5(false);
1475
+ useEffect4(() => {
1476
+ setImgError(false);
1477
+ }, [user?.pictureUrl]);
1478
+ useEffect4(() => {
1479
+ const handleClickOutside = (e) => {
1480
+ if (notifRef.current && !notifRef.current.contains(e.target)) {
1481
+ setIsNotifOpen(false);
1482
+ }
1483
+ };
1484
+ document.addEventListener("mousedown", handleClickOutside);
1485
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1486
+ }, []);
1487
+ const unreadCount = notifications.filter((n) => !n.isRead).length;
1488
+ const actionCount = notifications.filter((n) => n.category === "action").length;
1489
+ const generalCount = notifications.filter((n) => !n.category || n.category === "general").length;
1490
+ const filteredNotifications = notifications.filter((n) => {
1491
+ if (activeFilter === "all") return true;
1492
+ if (activeFilter === "action") return n.category === "action";
1493
+ return !n.category || n.category === "general";
1494
+ });
1495
+ return /* @__PURE__ */ jsx6(
1496
+ "header",
1497
+ {
1498
+ className,
1499
+ style: {
1500
+ background: "linear-gradient(to bottom left, #3AAE7D, #346D55)",
1501
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
1502
+ position: "sticky",
1503
+ top: 0,
1504
+ zIndex: 40,
1505
+ color: "#ffffff"
1506
+ },
1507
+ children: /* @__PURE__ */ jsxs6(
1508
+ "div",
1509
+ {
1510
+ style: {
1511
+ display: "flex",
1512
+ alignItems: "center",
1513
+ justifyContent: "space-between",
1514
+ padding: "14px 20px"
1515
+ },
1516
+ children: [
1517
+ /* @__PURE__ */ jsxs6(
1518
+ "div",
1519
+ {
1520
+ onClick: onProfile,
1521
+ onMouseEnter: (e) => {
1522
+ if (onProfile) e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.12)";
1523
+ },
1524
+ onMouseLeave: (e) => {
1525
+ if (onProfile) e.currentTarget.style.backgroundColor = "transparent";
1526
+ },
1527
+ style: {
1528
+ display: "flex",
1529
+ alignItems: "center",
1530
+ gap: "12px",
1531
+ cursor: onProfile ? "pointer" : "default",
1532
+ padding: "4px 8px",
1533
+ borderRadius: "10px",
1534
+ transition: "background-color 0.15s ease",
1535
+ flex: 1,
1536
+ minWidth: 0,
1537
+ overflow: "hidden"
1538
+ },
1539
+ children: [
1540
+ user?.pictureUrl && !imgError ? /* @__PURE__ */ jsx6(
1541
+ "img",
1542
+ {
1543
+ src: user.pictureUrl,
1544
+ alt: displayName,
1545
+ onError: () => setImgError(true),
1546
+ style: {
1547
+ width: "44px",
1548
+ height: "44px",
1549
+ borderRadius: "50%",
1550
+ objectFit: "cover",
1551
+ border: "2px solid rgba(255,255,255,0.7)",
1552
+ flexShrink: 0
1553
+ }
1554
+ }
1555
+ ) : /* @__PURE__ */ jsx6(AvatarPlaceholder2, { size: 44 }),
1556
+ /* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0 }, children: [
1557
+ /* @__PURE__ */ jsxs6(
1558
+ "p",
1559
+ {
1560
+ style: {
1561
+ fontSize: "15px",
1562
+ fontWeight: 600,
1563
+ color: "#ffffff",
1564
+ margin: 0,
1565
+ overflow: "hidden",
1566
+ textOverflow: "ellipsis",
1567
+ whiteSpace: "nowrap"
1568
+ },
1569
+ children: [
1570
+ "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35,",
1571
+ " ",
1572
+ /* @__PURE__ */ jsx6(
1573
+ "span",
1574
+ {
1575
+ style: {
1576
+ color: "#ffffff"
1577
+ },
1578
+ children: displayName
1579
+ }
1580
+ )
1581
+ ]
1582
+ }
1583
+ ),
1584
+ user?.subtitle && /* @__PURE__ */ jsx6(
1585
+ "p",
1586
+ {
1587
+ style: {
1588
+ fontSize: "12px",
1589
+ color: "rgba(255,255,255,0.75)",
1590
+ margin: "2px 0 0",
1591
+ fontWeight: 400
1592
+ },
1593
+ children: user.subtitle
1594
+ }
1595
+ )
1596
+ ] })
1597
+ ]
1598
+ }
1599
+ ),
1600
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
1601
+ /* @__PURE__ */ jsxs6("div", { style: { position: "relative" }, ref: notifRef, children: [
1602
+ notificationBell || /* @__PURE__ */ jsxs6(
1603
+ "button",
1604
+ {
1605
+ onClick: () => setIsNotifOpen(!isNotifOpen),
1606
+ onMouseEnter: (e) => {
1607
+ e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.15)";
1608
+ },
1609
+ onMouseLeave: (e) => {
1610
+ e.currentTarget.style.backgroundColor = "transparent";
1611
+ },
1612
+ style: {
1613
+ padding: "10px",
1614
+ borderRadius: "8px",
1615
+ border: "none",
1616
+ background: "transparent",
1617
+ cursor: "pointer",
1618
+ position: "relative",
1619
+ display: "flex",
1620
+ alignItems: "center",
1621
+ justifyContent: "center",
1622
+ color: "#ffffff",
1623
+ transition: "background-color 0.15s ease"
1624
+ },
1625
+ children: [
1626
+ /* @__PURE__ */ jsx6(BellIcon2, {}),
1627
+ unreadCount > 0 && /* @__PURE__ */ jsx6(
1628
+ "span",
1629
+ {
1630
+ style: {
1631
+ position: "absolute",
1632
+ top: "2px",
1633
+ right: "2px",
1634
+ minWidth: "16px",
1635
+ height: "16px",
1636
+ background: "var(--color-alias-semantic-critical, #f21515)",
1637
+ borderRadius: "8px",
1638
+ display: "flex",
1639
+ alignItems: "center",
1640
+ justifyContent: "center",
1641
+ fontSize: unreadCount > 99 ? "7px" : "9px",
1642
+ fontWeight: 700,
1643
+ color: "#fff",
1644
+ padding: "0 3px",
1645
+ lineHeight: 1
1646
+ },
1647
+ children: unreadCount > 99 ? "99+" : unreadCount
1648
+ }
1649
+ )
1650
+ ]
1651
+ }
1652
+ ),
1653
+ isNotifOpen && /* @__PURE__ */ jsxs6(
1654
+ "div",
1655
+ {
1656
+ className: "absolute top-full mt-2 w-[calc(100vw-32px)] max-w-[360px] left-1/2 -translate-x-1/2 md:left-auto md:right-0 md:translate-x-0",
1657
+ style: {
1658
+ background: isDark ? "#1e293b" : "#fff",
1659
+ borderRadius: "12px",
1660
+ boxShadow: isDark ? "0 10px 40px rgba(0,0,0,0.4)" : "0 10px 40px rgba(0,0,0,0.12)",
1661
+ zIndex: 999,
1662
+ overflow: "hidden",
1663
+ border: `1px solid ${isDark ? "#374151" : "#e5e7eb"}`
1664
+ },
1665
+ children: [
1666
+ /* @__PURE__ */ jsxs6(
1667
+ "div",
1668
+ {
1669
+ style: {
1670
+ padding: "16px 16px 0",
1671
+ background: isDark ? "#1f2937" : "#fafafa"
1672
+ },
1673
+ children: [
1674
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "12px" }, children: [
1675
+ /* @__PURE__ */ jsx6("span", { style: { fontWeight: 600, fontSize: "14px", color: isDark ? "#ffffff" : "#111" }, children: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19" }),
1676
+ onMarkAllRead && /* @__PURE__ */ jsx6(
1677
+ "button",
1678
+ {
1679
+ onClick: onMarkAllRead,
1680
+ style: {
1681
+ fontSize: "12px",
1682
+ color: "var(--color-alias-color-brand-primary, #1e7d55)",
1683
+ background: "none",
1684
+ border: "none",
1685
+ cursor: "pointer",
1686
+ fontWeight: 500
1687
+ },
1688
+ children: "\u0E2D\u0E48\u0E32\u0E19\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14"
1689
+ }
1690
+ )
1691
+ ] }),
1692
+ /* @__PURE__ */ jsx6(
1693
+ "div",
1694
+ {
1695
+ style: {
1696
+ display: "flex",
1697
+ gap: "6px",
1698
+ paddingBottom: "12px",
1699
+ borderBottom: `1px solid ${isDark ? "#374151" : "#e5e7eb"}`
1700
+ },
1701
+ children: [
1702
+ { key: "all", label: "\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", count: notifications.length },
1703
+ { key: "action", label: "\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", count: actionCount },
1704
+ { key: "general", label: "\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", count: generalCount }
1705
+ ].map((tab) => {
1706
+ const isActive = activeFilter === tab.key;
1707
+ return /* @__PURE__ */ jsxs6(
1708
+ "button",
1709
+ {
1710
+ onClick: () => setActiveFilter(tab.key),
1711
+ style: {
1712
+ display: "inline-flex",
1713
+ alignItems: "center",
1714
+ gap: "5px",
1715
+ padding: "5px 10px",
1716
+ fontSize: "12px",
1717
+ fontWeight: isActive ? 600 : 400,
1718
+ color: isActive ? isDark ? "#ffffff" : "#1e7d55" : isDark ? "#9ca3af" : "#6b7280",
1719
+ background: isActive ? isDark ? "rgba(30,125,85,0.2)" : "rgba(30,125,85,0.08)" : "transparent",
1720
+ border: `1px solid ${isActive ? isDark ? "rgba(30,125,85,0.4)" : "rgba(30,125,85,0.25)" : isDark ? "#4b5563" : "#e5e7eb"}`,
1721
+ borderRadius: "16px",
1722
+ cursor: "pointer",
1723
+ transition: "all 0.15s ease",
1724
+ whiteSpace: "nowrap"
1725
+ },
1726
+ children: [
1727
+ tab.label,
1728
+ /* @__PURE__ */ jsx6(
1729
+ "span",
1730
+ {
1731
+ style: {
1732
+ minWidth: "18px",
1733
+ height: "18px",
1734
+ display: "inline-flex",
1735
+ alignItems: "center",
1736
+ justifyContent: "center",
1737
+ borderRadius: "9px",
1738
+ fontSize: "10px",
1739
+ fontWeight: 700,
1740
+ lineHeight: 1,
1741
+ padding: "0 4px",
1742
+ background: isActive ? isDark ? "#1e7d55" : "#1e7d55" : isDark ? "#4b5563" : "#e5e7eb",
1743
+ color: isActive ? "#ffffff" : isDark ? "#d1d5db" : "#6b7280"
1744
+ },
1745
+ children: tab.count
1746
+ }
1747
+ )
1748
+ ]
1749
+ },
1750
+ tab.key
1751
+ );
1752
+ })
1753
+ }
1754
+ )
1755
+ ]
1756
+ }
1757
+ ),
1758
+ /* @__PURE__ */ jsx6("div", { style: { maxHeight: "60vh", overflowY: "auto" }, children: filteredNotifications.length === 0 ? /* @__PURE__ */ jsx6(
1759
+ "div",
1760
+ {
1761
+ style: {
1762
+ padding: "48px 32px",
1763
+ textAlign: "center",
1764
+ color: isDark ? "#9ca3af" : "#6b7280",
1765
+ fontSize: "14px",
1766
+ display: "flex",
1767
+ flexDirection: "column",
1768
+ alignItems: "center",
1769
+ justifyContent: "center",
1770
+ gap: "12px"
1771
+ },
1772
+ children: activeFilter === "action" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
1773
+ /* @__PURE__ */ jsx6(MessageOutlinedIcon, { style: { width: "48px", height: "48px", opacity: 0.4 } }),
1774
+ /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500 }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23" })
1775
+ ] }) : activeFilter === "all" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
1776
+ /* @__PURE__ */ jsx6(BellIcon2, {}),
1777
+ /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, marginTop: "8px" }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E43\u0E2B\u0E21\u0E48" })
1778
+ ] }) : /* @__PURE__ */ jsxs6(Fragment3, { children: [
1779
+ /* @__PURE__ */ jsx6("div", { style: { fontSize: "40px", opacity: 0.6, marginBottom: "-8px" }, children: "\u{1F4CB}" }),
1780
+ /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500 }, children: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B" })
1781
+ ] })
1782
+ }
1783
+ ) : filteredNotifications.map((item) => /* @__PURE__ */ jsxs6(
1784
+ "div",
1785
+ {
1786
+ onClick: () => onNotificationClick?.(item),
1787
+ style: {
1788
+ padding: "12px 16px",
1789
+ borderBottom: `1px solid ${isDark ? "#2d3748" : "#f3f4f6"}`,
1790
+ cursor: "pointer",
1791
+ background: !item.isRead ? isDark ? "rgba(59,130,246,0.15)" : "rgba(219,234,254,0.3)" : "transparent",
1792
+ position: "relative",
1793
+ display: "flex",
1794
+ gap: "12px",
1795
+ alignItems: "flex-start",
1796
+ transition: "background-color 0.15s ease"
1797
+ },
1798
+ onMouseEnter: (e) => {
1799
+ e.currentTarget.style.backgroundColor = isDark ? "#1f2937" : "#f9fafb";
1800
+ },
1801
+ onMouseLeave: (e) => {
1802
+ e.currentTarget.style.backgroundColor = !item.isRead ? isDark ? "rgba(59,130,246,0.15)" : "rgba(219,234,254,0.3)" : "transparent";
1803
+ },
1804
+ children: [
1805
+ !item.isRead && /* @__PURE__ */ jsx6(
1806
+ "span",
1807
+ {
1808
+ style: {
1809
+ position: "absolute",
1810
+ top: "12px",
1811
+ right: "12px",
1812
+ width: "8px",
1813
+ height: "8px",
1814
+ background: "#ef4444",
1815
+ borderRadius: "50%"
1816
+ }
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ jsx6(
1820
+ "div",
1821
+ {
1822
+ style: {
1823
+ width: "32px",
1824
+ height: "32px",
1825
+ borderRadius: "50%",
1826
+ background: getNotifBg(item.type),
1827
+ display: "flex",
1828
+ alignItems: "center",
1829
+ justifyContent: "center",
1830
+ fontSize: "13px",
1831
+ flexShrink: 0,
1832
+ marginTop: "2px"
1833
+ },
1834
+ children: getNotifIcon(item.type)
1835
+ }
1836
+ ),
1837
+ /* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0 }, children: [
1838
+ item.category === "action" && /* @__PURE__ */ jsx6(
1839
+ "span",
1840
+ {
1841
+ style: {
1842
+ display: "inline-block",
1843
+ fontSize: "10px",
1844
+ fontWeight: 600,
1845
+ color: "#b45309",
1846
+ background: "#fef3c7",
1847
+ padding: "1px 6px",
1848
+ borderRadius: "4px",
1849
+ marginBottom: "4px"
1850
+ },
1851
+ children: "\u0E15\u0E49\u0E2D\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23"
1852
+ }
1853
+ ),
1854
+ /* @__PURE__ */ jsx6(
1855
+ "p",
1856
+ {
1857
+ style: {
1858
+ fontSize: "13px",
1859
+ fontWeight: !item.isRead ? 600 : 500,
1860
+ color: isDark ? "#ffffff" : "#111",
1861
+ margin: "0 0 2px"
1862
+ },
1863
+ children: item.title
1864
+ }
1865
+ ),
1866
+ /* @__PURE__ */ jsx6(
1867
+ "p",
1868
+ {
1869
+ style: {
1870
+ fontSize: "12px",
1871
+ color: isDark ? "#9ca3af" : "#6b7280",
1872
+ margin: "0 0 4px",
1873
+ lineHeight: "18px"
1874
+ },
1875
+ children: item.description
1876
+ }
1877
+ ),
1878
+ /* @__PURE__ */ jsx6(
1879
+ "p",
1880
+ {
1881
+ style: {
1882
+ fontSize: "10px",
1883
+ color: isDark ? "#6b7280" : "#9ca3af",
1884
+ margin: 0,
1885
+ fontWeight: 500
1886
+ },
1887
+ children: item.date
1888
+ }
1889
+ )
1890
+ ] })
1891
+ ]
1892
+ },
1893
+ item.id
1894
+ )) })
1895
+ ]
1896
+ }
1897
+ )
1898
+ ] }),
1899
+ onToggleSidebar && /* @__PURE__ */ jsx6(
1900
+ "button",
1901
+ {
1902
+ onClick: onToggleSidebar,
1903
+ style: {
1904
+ padding: "10px",
1905
+ borderRadius: "8px",
1906
+ border: "none",
1907
+ background: "transparent",
1908
+ cursor: "pointer",
1909
+ display: "flex",
1910
+ alignItems: "center",
1911
+ justifyContent: "center",
1912
+ color: "#ffffff",
1913
+ transition: "background-color 0.15s ease"
1914
+ },
1915
+ onMouseEnter: (e) => {
1916
+ e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.15)";
1917
+ },
1918
+ onMouseLeave: (e) => {
1919
+ e.currentTarget.style.backgroundColor = "transparent";
1920
+ },
1921
+ children: /* @__PURE__ */ jsx6(HamburgerIcon2, {})
1922
+ }
1923
+ )
1924
+ ] })
1925
+ ]
1926
+ }
1927
+ )
1928
+ }
1929
+ );
1930
+ }
1931
+
1932
+ // src/header/UserSidebar.tsx
1933
+ import { useState as useState6, useEffect as useEffect5 } from "react";
1934
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1935
+ function LogoutIcon2() {
1936
+ return /* @__PURE__ */ jsxs7("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1937
+ /* @__PURE__ */ jsx7("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
1938
+ /* @__PURE__ */ jsx7("polyline", { points: "16 17 21 12 16 7" }),
1939
+ /* @__PURE__ */ jsx7("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
1940
+ ] });
1941
+ }
1942
+ function ProfileIcon2() {
1943
+ return /* @__PURE__ */ jsxs7("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
1944
+ /* @__PURE__ */ jsx7("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
1945
+ /* @__PURE__ */ jsx7("circle", { cx: "12", cy: "7", r: "4" })
1946
+ ] });
1947
+ }
1948
+ function AvatarPlaceholder3({ size = 56 }) {
1949
+ return /* @__PURE__ */ jsx7(
1950
+ "div",
1951
+ {
1952
+ style: {
1953
+ width: `${size}px`,
1954
+ height: `${size}px`,
1955
+ borderRadius: "50%",
1956
+ backgroundColor: "#f1f5f9",
1957
+ display: "flex",
1958
+ alignItems: "center",
1959
+ justifyContent: "center",
1960
+ flexShrink: 0,
1961
+ boxShadow: "0 2px 8px rgba(0,0,0,0.05)"
1962
+ },
1963
+ children: /* @__PURE__ */ jsx7("svg", { width: size * 0.6, height: size * 0.6, viewBox: "0 0 24 24", fill: "#94a3b8", children: /* @__PURE__ */ jsx7("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) })
1964
+ }
1965
+ );
1966
+ }
1967
+ function UserSidebar({
1968
+ user,
1969
+ roleLabel,
1970
+ menuItems,
1971
+ onNavigate,
1972
+ onLogout,
1973
+ isOpen,
1974
+ onClose,
1975
+ roleColor = "var(--color-alias-semantic-warning, orange)",
1976
+ onProfile
1977
+ }) {
1978
+ const isDark = useDarkMode();
1979
+ const [imgError, setImgError] = useState6(false);
1980
+ useEffect5(() => {
1981
+ setImgError(false);
1982
+ }, [user?.pictureUrl]);
1983
+ useEffect5(() => {
1984
+ if (isOpen) {
1985
+ document.body.style.overflow = "hidden";
1986
+ } else {
1987
+ document.body.style.overflow = "";
1988
+ }
1989
+ return () => {
1990
+ document.body.style.overflow = "";
1991
+ };
1992
+ }, [isOpen]);
1993
+ const getFullName = () => {
1994
+ if (!user) return "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1995
+ if (user.firstName && user.lastName) return `${user.firstName} ${user.lastName}`;
1996
+ return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
1997
+ };
1998
+ const handleMenuClick = (path) => {
1999
+ onNavigate(path);
2000
+ onClose();
2001
+ };
2002
+ const handleLogout = () => {
2003
+ onClose();
2004
+ onLogout();
2005
+ };
2006
+ return /* @__PURE__ */ jsxs7(Fragment4, { children: [
2007
+ isOpen && /* @__PURE__ */ jsx7(
2008
+ "div",
2009
+ {
2010
+ onClick: onClose,
2011
+ style: {
2012
+ position: "fixed",
2013
+ inset: 0,
2014
+ background: "rgba(0,0,0,0.5)",
2015
+ zIndex: 45,
2016
+ transition: "opacity 0.3s ease"
2017
+ }
2018
+ }
2019
+ ),
2020
+ /* @__PURE__ */ jsxs7(
2021
+ "aside",
2022
+ {
2023
+ style: {
2024
+ position: "fixed",
2025
+ top: 0,
2026
+ right: 0,
2027
+ height: "100%",
2028
+ width: "80vw",
2029
+ maxWidth: "320px",
2030
+ background: isDark ? "#1e293b" : "#fff",
2031
+ boxShadow: isDark ? "-4px 0 24px rgba(0,0,0,0.4)" : "-4px 0 24px rgba(0,0,0,0.12)",
2032
+ zIndex: 50,
2033
+ transform: isOpen ? "translateX(0)" : "translateX(100%)",
2034
+ transition: "transform 0.3s ease",
2035
+ display: "flex",
2036
+ flexDirection: "column",
2037
+ color: isDark ? "#ffffff" : void 0
2038
+ },
2039
+ children: [
2040
+ user && /* @__PURE__ */ jsx7(
2041
+ "div",
2042
+ {
2043
+ style: {
2044
+ padding: "20px",
2045
+ borderBottom: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`
2046
+ },
2047
+ children: /* @__PURE__ */ jsxs7(
2048
+ "div",
2049
+ {
2050
+ style: {
2051
+ display: "flex",
2052
+ alignItems: "center",
2053
+ gap: "12px",
2054
+ padding: "8px"
2055
+ },
2056
+ children: [
2057
+ user.pictureUrl && !imgError ? /* @__PURE__ */ jsx7(
2058
+ "img",
2059
+ {
2060
+ src: user.pictureUrl,
2061
+ alt: getFullName(),
2062
+ onError: () => setImgError(true),
2063
+ style: {
2064
+ width: "56px",
2065
+ height: "56px",
2066
+ borderRadius: "50%",
2067
+ objectFit: "cover",
2068
+ flexShrink: 0,
2069
+ boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
2070
+ }
2071
+ }
2072
+ ) : /* @__PURE__ */ jsx7(AvatarPlaceholder3, { size: 56 }),
2073
+ /* @__PURE__ */ jsxs7("div", { style: { flex: 1, minWidth: 0 }, children: [
2074
+ /* @__PURE__ */ jsx7(
2075
+ "p",
2076
+ {
2077
+ style: {
2078
+ fontWeight: 700,
2079
+ fontSize: "16px",
2080
+ color: isDark ? "#ffffff" : "var(--color-alias-text-colors-primary, #060d26)",
2081
+ margin: 0,
2082
+ overflow: "hidden",
2083
+ textOverflow: "ellipsis",
2084
+ whiteSpace: "nowrap"
2085
+ },
2086
+ children: getFullName()
2087
+ }
2088
+ ),
2089
+ /* @__PURE__ */ jsxs7(
2090
+ "p",
2091
+ {
2092
+ style: {
2093
+ fontSize: "13px",
2094
+ color: isDark ? "#e2e8f0" : "var(--color-alias-text-colors-tertiary, #475272)",
2095
+ margin: "2px 0 0",
2096
+ display: "flex",
2097
+ alignItems: "center",
2098
+ gap: "6px"
2099
+ },
2100
+ children: [
2101
+ /* @__PURE__ */ jsx7(
2102
+ "span",
2103
+ {
2104
+ style: {
2105
+ width: "8px",
2106
+ height: "8px",
2107
+ borderRadius: "50%",
2108
+ background: roleColor,
2109
+ display: "inline-block"
2110
+ }
2111
+ }
2112
+ ),
2113
+ roleLabel
2114
+ ]
2115
+ }
2116
+ )
2117
+ ] })
2118
+ ]
2119
+ }
2120
+ )
2121
+ }
2122
+ ),
2123
+ /* @__PURE__ */ jsx7(
2124
+ SidebarMenu,
2125
+ {
2126
+ menuItems: onProfile ? [{ id: "__profile__", title: "\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C", icon: /* @__PURE__ */ jsx7(ProfileIcon2, {}), path: "__profile__" }, ...menuItems] : menuItems,
2127
+ onItemClick: (path) => {
2128
+ if (path === "__profile__" && onProfile) {
2129
+ onProfile();
2130
+ onClose();
2131
+ } else {
2132
+ handleMenuClick(path);
2133
+ }
2134
+ }
2135
+ }
2136
+ ),
2137
+ /* @__PURE__ */ jsx7(
2138
+ "div",
2139
+ {
2140
+ style: {
2141
+ padding: "20px",
2142
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`
2143
+ },
2144
+ children: /* @__PURE__ */ jsxs7(
2145
+ "button",
2146
+ {
2147
+ onClick: handleLogout,
2148
+ onMouseEnter: (e) => {
2149
+ e.currentTarget.style.backgroundColor = isDark ? "#3b1c1c" : "#fef2f2";
2150
+ },
2151
+ onMouseLeave: (e) => {
2152
+ e.currentTarget.style.backgroundColor = "transparent";
2153
+ },
2154
+ style: {
2155
+ width: "100%",
2156
+ display: "flex",
2157
+ alignItems: "center",
2158
+ gap: "16px",
2159
+ padding: "14px 16px",
2160
+ borderRadius: "8px",
2161
+ border: "none",
2162
+ background: "transparent",
2163
+ color: "var(--color-alias-semantic-critical, #f21515)",
2164
+ cursor: "pointer",
2165
+ transition: "background-color 0.15s ease",
2166
+ fontSize: "15px",
2167
+ fontWeight: 500
2168
+ },
2169
+ children: [
2170
+ /* @__PURE__ */ jsx7(LogoutIcon2, {}),
2171
+ /* @__PURE__ */ jsx7("span", { children: "\u0E2D\u0E2D\u0E01\u0E08\u0E32\u0E01\u0E23\u0E30\u0E1A\u0E1A" })
2172
+ ]
2173
+ }
2174
+ )
2175
+ }
2176
+ )
2177
+ ]
2178
+ }
2179
+ )
2180
+ ] });
2181
+ }
2182
+
2183
+ // src/bottombar/BottomBar.tsx
2184
+ import { jsx as jsx8 } from "react/jsx-runtime";
2185
+ function BottomBar({
2186
+ children,
2187
+ sidebarWidth = "280px",
2188
+ height = "73px",
2189
+ className,
2190
+ style
2191
+ }) {
2192
+ const isDark = useDarkMode();
2193
+ return /* @__PURE__ */ jsx8(
2194
+ "div",
2195
+ {
2196
+ className,
2197
+ style: {
2198
+ position: "fixed",
2199
+ bottom: 0,
2200
+ left: sidebarWidth,
2201
+ right: 0,
2202
+ height,
2203
+ background: isDark ? "#111827" : "#ffffff",
2204
+ borderTop: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
2205
+ display: "flex",
2206
+ alignItems: "center",
2207
+ justifyContent: "space-between",
2208
+ padding: "16px 24px",
2209
+ zIndex: 30,
2210
+ transition: "left 0.3s ease",
2211
+ ...style
2212
+ },
2213
+ children
2214
+ }
2215
+ );
2216
+ }
2217
+
2218
+ // src/settings/SettingsContext.tsx
2219
+ import { createContext, useContext, useState as useState7, useEffect as useEffect6, useCallback as useCallback2 } from "react";
2220
+ import { jsx as jsx9 } from "react/jsx-runtime";
2221
+ var FONT_SIZE_OPTIONS = [
2222
+ { key: "xsmall", label: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01", scale: 0.8 },
2223
+ { key: "small", label: "\u0E40\u0E25\u0E47\u0E01", scale: 0.9 },
2224
+ { key: "medium", label: "\u0E01\u0E25\u0E32\u0E07", scale: 1 },
2225
+ { key: "large", label: "\u0E43\u0E2B\u0E0D\u0E48", scale: 1.2 },
2226
+ { key: "xlarge", label: "\u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01", scale: 1.4 }
2227
+ ];
2228
+ var BASE_FONT_SIZES = {
2229
+ "--font-alias-mobile-body-fontsize": 16,
2230
+ "--font-alias-mobile-h1-fontsize": 28,
2231
+ "--font-alias-mobile-h2-fontsize": 24,
2232
+ "--font-alias-mobile-h3-fontsize": 20,
2233
+ "--font-alias-mobile-sub-fontsize": 14,
2234
+ "--font-alias-mobile-button-fontsize": 16
2235
+ };
2236
+ var SettingsContext = createContext(void 0);
2237
+ function SettingsProvider({
2238
+ children,
2239
+ defaultTheme = "light",
2240
+ defaultFontSize = "medium",
2241
+ themeStorageKey = "app-theme",
2242
+ fontSizeStorageKey = "app-font-size"
2243
+ }) {
2244
+ const [theme, setThemeState] = useState7(defaultTheme);
2245
+ const [fontSize, setFontSizeState] = useState7(defaultFontSize);
2246
+ useEffect6(() => {
2247
+ try {
2248
+ const savedTheme = localStorage.getItem(themeStorageKey);
2249
+ if (savedTheme === "light" || savedTheme === "dark") {
2250
+ setThemeState(savedTheme);
2251
+ }
2252
+ const savedFontSize = localStorage.getItem(fontSizeStorageKey);
2253
+ if (savedFontSize && FONT_SIZE_OPTIONS.some((o) => o.key === savedFontSize)) {
2254
+ setFontSizeState(savedFontSize);
2255
+ }
2256
+ } catch {
2257
+ }
2258
+ }, [themeStorageKey, fontSizeStorageKey]);
2259
+ useEffect6(() => {
2260
+ const root = document.documentElement;
2261
+ if (theme === "dark") {
2262
+ root.classList.add("dark");
2263
+ } else {
2264
+ root.classList.remove("dark");
2265
+ }
2266
+ try {
2267
+ localStorage.setItem(themeStorageKey, theme);
2268
+ } catch {
2269
+ }
2270
+ }, [theme, themeStorageKey]);
2271
+ useEffect6(() => {
2272
+ const option = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
2273
+ const root = document.documentElement;
2274
+ Object.entries(BASE_FONT_SIZES).forEach(([varName, baseValue]) => {
2275
+ root.style.setProperty(varName, `${baseValue * option.scale}px`);
2276
+ });
2277
+ root.style.fontSize = `${16 * option.scale}px`;
2278
+ root.style.setProperty("--global-font-scale", option.scale.toString());
2279
+ document.body.style.zoom = option.scale.toString();
2280
+ try {
2281
+ localStorage.setItem(fontSizeStorageKey, fontSize);
2282
+ } catch {
2283
+ }
2284
+ }, [fontSize, fontSizeStorageKey]);
2285
+ const setTheme = useCallback2((t) => {
2286
+ setThemeState(t);
2287
+ }, []);
2288
+ const toggleTheme = useCallback2(() => {
2289
+ setThemeState((prev) => prev === "light" ? "dark" : "light");
2290
+ }, []);
2291
+ const setFontSize = useCallback2((s) => {
2292
+ setFontSizeState(s);
2293
+ }, []);
2294
+ const fontSizeOption = FONT_SIZE_OPTIONS.find((o) => o.key === fontSize) || FONT_SIZE_OPTIONS[2];
2295
+ return /* @__PURE__ */ jsx9(
2296
+ SettingsContext.Provider,
2297
+ {
2298
+ value: { theme, setTheme, toggleTheme, fontSize, setFontSize, fontSizeOption },
2299
+ children
2300
+ }
2301
+ );
2302
+ }
2303
+ function useSettings() {
2304
+ const context = useContext(SettingsContext);
2305
+ if (!context) {
2306
+ throw new Error("useSettings must be used within <SettingsProvider>");
2307
+ }
2308
+ return context;
2309
+ }
2310
+
2311
+ // src/settings/SettingsPanel.tsx
2312
+ import { useState as useState8 } from "react";
2313
+
2314
+ // src/settings/ThemeSettings.tsx
2315
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2316
+ function SunIcon() {
2317
+ return /* @__PURE__ */ jsxs8("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2318
+ /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "5" }),
2319
+ /* @__PURE__ */ jsx10("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
2320
+ /* @__PURE__ */ jsx10("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
2321
+ /* @__PURE__ */ jsx10("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
2322
+ /* @__PURE__ */ jsx10("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
2323
+ /* @__PURE__ */ jsx10("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
2324
+ /* @__PURE__ */ jsx10("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
2325
+ /* @__PURE__ */ jsx10("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
2326
+ /* @__PURE__ */ jsx10("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
2327
+ ] });
2328
+ }
2329
+ function MoonIcon() {
2330
+ return /* @__PURE__ */ jsx10("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx10("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
2331
+ }
2332
+ function ThemeSettings({ onBack }) {
2333
+ const { theme, setTheme } = useSettings();
2334
+ const options = [
2335
+ { key: "light", label: "\u0E2A\u0E27\u0E48\u0E32\u0E07", icon: /* @__PURE__ */ jsx10(SunIcon, {}), bg: "#fff", text: "#111" },
2336
+ { key: "dark", label: "\u0E21\u0E37\u0E14", icon: /* @__PURE__ */ jsx10(MoonIcon, {}), bg: "#1f2937", text: "#f9fafb" }
2337
+ ];
2338
+ return /* @__PURE__ */ jsxs8("div", { children: [
2339
+ onBack && /* @__PURE__ */ jsxs8(
2340
+ "button",
2341
+ {
2342
+ onClick: onBack,
2343
+ style: {
2344
+ display: "flex",
2345
+ alignItems: "center",
2346
+ gap: 8,
2347
+ padding: "12px 16px",
2348
+ width: "100%",
2349
+ border: "none",
2350
+ background: "transparent",
2351
+ cursor: "pointer",
2352
+ fontSize: 15,
2353
+ fontWeight: 600,
2354
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2355
+ },
2356
+ children: [
2357
+ /* @__PURE__ */ jsx10("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx10("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
2358
+ "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14"
2359
+ ]
2360
+ }
2361
+ ),
2362
+ /* @__PURE__ */ jsx10("div", { style: { padding: "12px 16px", display: "flex", gap: 12 }, children: options.map((opt) => {
2363
+ const isSelected = theme === opt.key;
2364
+ return /* @__PURE__ */ jsxs8(
2365
+ "button",
2366
+ {
2367
+ onClick: () => setTheme(opt.key),
2368
+ style: {
2369
+ flex: 1,
2370
+ padding: "20px 12px",
2371
+ borderRadius: 12,
2372
+ border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "2px solid var(--color-border-colors-neutral, #c8cedd)",
2373
+ background: opt.bg,
2374
+ cursor: "pointer",
2375
+ display: "flex",
2376
+ flexDirection: "column",
2377
+ alignItems: "center",
2378
+ gap: 8,
2379
+ transition: "all 0.2s ease"
2380
+ },
2381
+ children: [
2382
+ /* @__PURE__ */ jsx10("span", { style: { color: opt.text }, children: opt.icon }),
2383
+ /* @__PURE__ */ jsx10("span", { style: {
2384
+ fontSize: 13,
2385
+ fontWeight: isSelected ? 700 : 500,
2386
+ color: opt.text
2387
+ }, children: opt.label }),
2388
+ isSelected && /* @__PURE__ */ jsx10("span", { style: {
2389
+ width: 20,
2390
+ height: 20,
2391
+ borderRadius: "50%",
2392
+ background: "var(--color-alias-color-brand-primary, #1e7d55)",
2393
+ display: "flex",
2394
+ alignItems: "center",
2395
+ justifyContent: "center"
2396
+ }, children: /* @__PURE__ */ jsx10("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "3", children: /* @__PURE__ */ jsx10("polyline", { points: "20 6 9 17 4 12" }) }) })
2397
+ ]
2398
+ },
2399
+ opt.key
2400
+ );
2401
+ }) })
2402
+ ] });
2403
+ }
2404
+
2405
+ // src/settings/FontSizeSettings.tsx
2406
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2407
+ function FontSizeSettings({ onBack }) {
2408
+ const { fontSize, setFontSize, fontSizeOption } = useSettings();
2409
+ return /* @__PURE__ */ jsxs9("div", { children: [
2410
+ onBack && /* @__PURE__ */ jsxs9(
2411
+ "button",
2412
+ {
2413
+ onClick: onBack,
2414
+ style: {
2415
+ display: "flex",
2416
+ alignItems: "center",
2417
+ gap: 8,
2418
+ padding: "12px 16px",
2419
+ width: "100%",
2420
+ border: "none",
2421
+ background: "transparent",
2422
+ cursor: "pointer",
2423
+ fontSize: 15,
2424
+ fontWeight: 600,
2425
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2426
+ },
2427
+ children: [
2428
+ /* @__PURE__ */ jsx11("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx11("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }),
2429
+ "\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23"
2430
+ ]
2431
+ }
2432
+ ),
2433
+ /* @__PURE__ */ jsxs9("div", { style: {
2434
+ margin: "8px 16px",
2435
+ padding: "16px",
2436
+ borderRadius: 10,
2437
+ background: "var(--color-foundations-fuji-pallet-light, #ebedf5)",
2438
+ textAlign: "center"
2439
+ }, children: [
2440
+ /* @__PURE__ */ jsx11("p", { style: {
2441
+ fontSize: `${16 * fontSizeOption.scale}px`,
2442
+ fontWeight: 500,
2443
+ color: "var(--color-alias-text-colors-primary, #060d26)",
2444
+ margin: 0
2445
+ }, children: "\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" }),
2446
+ /* @__PURE__ */ jsxs9("p", { style: {
2447
+ fontSize: `${12 * fontSizeOption.scale}px`,
2448
+ color: "var(--color-alias-text-colors-tertiary, #475272)",
2449
+ margin: "4px 0 0"
2450
+ }, children: [
2451
+ "\xD7",
2452
+ fontSizeOption.scale
2453
+ ] })
2454
+ ] }),
2455
+ /* @__PURE__ */ jsx11("div", { style: { padding: "8px 16px", display: "flex", flexDirection: "column", gap: 4 }, children: FONT_SIZE_OPTIONS.map((opt) => {
2456
+ const isSelected = fontSize === opt.key;
2457
+ return /* @__PURE__ */ jsxs9(
2458
+ "button",
2459
+ {
2460
+ onClick: () => setFontSize(opt.key),
2461
+ onMouseEnter: (e) => {
2462
+ if (!isSelected) e.currentTarget.style.backgroundColor = "#f9fafb";
2463
+ },
2464
+ onMouseLeave: (e) => {
2465
+ if (!isSelected) e.currentTarget.style.backgroundColor = "transparent";
2466
+ },
2467
+ style: {
2468
+ display: "flex",
2469
+ alignItems: "center",
2470
+ justifyContent: "space-between",
2471
+ padding: "12px 14px",
2472
+ borderRadius: 8,
2473
+ border: isSelected ? "2px solid var(--color-alias-color-brand-primary, #1e7d55)" : "1px solid transparent",
2474
+ background: isSelected ? "color-mix(in srgb, var(--color-alias-color-brand-primary, #1e7d55) 8%, transparent)" : "transparent",
2475
+ cursor: "pointer",
2476
+ transition: "all 0.15s ease"
2477
+ },
2478
+ children: [
2479
+ /* @__PURE__ */ jsx11("span", { style: {
2480
+ fontSize: `${14 * opt.scale}px`,
2481
+ fontWeight: isSelected ? 600 : 400,
2482
+ color: isSelected ? "var(--color-alias-color-brand-primary, #1e7d55)" : "var(--color-alias-text-colors-primary, #060d26)"
2483
+ }, children: opt.label }),
2484
+ /* @__PURE__ */ jsxs9("span", { style: {
2485
+ fontSize: 12,
2486
+ color: "var(--color-alias-text-colors-tertiary, #475272)"
2487
+ }, children: [
2488
+ "\xD7",
2489
+ opt.scale
2490
+ ] })
2491
+ ]
2492
+ },
2493
+ opt.key
2494
+ );
2495
+ }) })
2496
+ ] });
2497
+ }
2498
+
2499
+ // src/settings/SettingsPanel.tsx
2500
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2501
+ function FontSizeIcon() {
2502
+ return /* @__PURE__ */ jsxs10("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2503
+ /* @__PURE__ */ jsx12("polyline", { points: "4 7 4 4 20 4 20 7" }),
2504
+ /* @__PURE__ */ jsx12("line", { x1: "9", y1: "20", x2: "15", y2: "20" }),
2505
+ /* @__PURE__ */ jsx12("line", { x1: "12", y1: "4", x2: "12", y2: "20" })
2506
+ ] });
2507
+ }
2508
+ function PaletteIcon() {
2509
+ return /* @__PURE__ */ jsxs10("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2510
+ /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "10" }),
2511
+ /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "8", r: "1.5", fill: "currentColor" }),
2512
+ /* @__PURE__ */ jsx12("circle", { cx: "8", cy: "14", r: "1.5", fill: "currentColor" }),
2513
+ /* @__PURE__ */ jsx12("circle", { cx: "16", cy: "14", r: "1.5", fill: "currentColor" })
2514
+ ] });
2515
+ }
2516
+ function SettingsPanel({ className, showTheme = true }) {
2517
+ const [view, setView] = useState8("menu");
2518
+ if (view === "theme" && showTheme) {
2519
+ return /* @__PURE__ */ jsx12(ThemeSettings, { onBack: () => setView("menu") });
2520
+ }
2521
+ if (view === "fontSize") {
2522
+ return /* @__PURE__ */ jsx12(FontSizeSettings, { onBack: () => setView("menu") });
2523
+ }
2524
+ const allMenuItems = [
2525
+ {
2526
+ id: "fontSize",
2527
+ icon: /* @__PURE__ */ jsx12(FontSizeIcon, {}),
2528
+ label: "\u0E02\u0E19\u0E32\u0E14\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
2529
+ description: "\u0E40\u0E25\u0E47\u0E01\u0E21\u0E32\u0E01 / \u0E40\u0E25\u0E47\u0E01 / \u0E01\u0E25\u0E32\u0E07 / \u0E43\u0E2B\u0E0D\u0E48 / \u0E43\u0E2B\u0E0D\u0E48\u0E21\u0E32\u0E01",
2530
+ onClick: () => setView("fontSize")
2531
+ },
2532
+ ...showTheme ? [{
2533
+ id: "theme",
2534
+ icon: /* @__PURE__ */ jsx12(PaletteIcon, {}),
2535
+ label: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E27\u0E48\u0E32\u0E07/\u0E21\u0E37\u0E14",
2536
+ description: "\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E18\u0E35\u0E21\u0E41\u0E2D\u0E1B\u0E1E\u0E25\u0E34\u0E40\u0E04\u0E0A\u0E31\u0E19",
2537
+ onClick: () => setView("theme")
2538
+ }] : []
2539
+ ];
2540
+ return /* @__PURE__ */ jsxs10("div", { className, children: [
2541
+ /* @__PURE__ */ jsx12("div", { style: {
2542
+ padding: "16px",
2543
+ borderBottom: "1px solid var(--color-border-colors-neutral, #c8cedd)"
2544
+ }, children: /* @__PURE__ */ jsx12("h3", { style: {
2545
+ fontSize: 16,
2546
+ fontWeight: 700,
2547
+ margin: 0,
2548
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2549
+ }, children: "\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E23\u0E30\u0E1A\u0E1A" }) }),
2550
+ /* @__PURE__ */ jsx12("div", { style: { padding: "8px", display: "flex", flexDirection: "column", gap: 2 }, children: allMenuItems.map((item) => /* @__PURE__ */ jsxs10(
2551
+ "button",
2552
+ {
2553
+ onClick: item.onClick,
2554
+ onMouseEnter: (e) => {
2555
+ e.currentTarget.style.backgroundColor = "#f9fafb";
2556
+ },
2557
+ onMouseLeave: (e) => {
2558
+ e.currentTarget.style.backgroundColor = "transparent";
2559
+ },
2560
+ style: {
2561
+ display: "flex",
2562
+ alignItems: "center",
2563
+ gap: 14,
2564
+ padding: "14px 12px",
2565
+ borderRadius: 10,
2566
+ border: "none",
2567
+ background: "transparent",
2568
+ cursor: "pointer",
2569
+ width: "100%",
2570
+ textAlign: "left",
2571
+ transition: "background-color 0.15s ease"
2572
+ },
2573
+ children: [
2574
+ /* @__PURE__ */ jsx12("span", { style: {
2575
+ width: 40,
2576
+ height: 40,
2577
+ borderRadius: 10,
2578
+ background: "var(--color-foundations-fuji-pallet-light, #ebedf5)",
2579
+ display: "flex",
2580
+ alignItems: "center",
2581
+ justifyContent: "center",
2582
+ color: "var(--color-alias-color-brand-primary, #1e7d55)",
2583
+ flexShrink: 0
2584
+ }, children: item.icon }),
2585
+ /* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
2586
+ /* @__PURE__ */ jsx12("p", { style: {
2587
+ fontSize: 15,
2588
+ fontWeight: 600,
2589
+ margin: 0,
2590
+ color: "var(--color-alias-text-colors-primary, #060d26)"
2591
+ }, children: item.label }),
2592
+ /* @__PURE__ */ jsx12("p", { style: {
2593
+ fontSize: 12,
2594
+ margin: "2px 0 0",
2595
+ color: "var(--color-alias-text-colors-tertiary, #475272)"
2596
+ }, children: item.description })
2597
+ ] }),
2598
+ /* @__PURE__ */ jsx12("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx12("path", { d: "M9 18l6-6-6-6" }) })
2599
+ ]
2600
+ },
2601
+ item.id
2602
+ )) })
2603
+ ] });
2604
+ }
2605
+
2606
+ // src/icons/index.ts
2607
+ var Icons = {
2608
+ Home: HomeIcon,
2609
+ Search: SearchIcon,
2610
+ Bell: BellIcon,
2611
+ Folder: FolderIcon,
2612
+ Clipboard: ClipboardIcon,
2613
+ FileText: FileTextIcon,
2614
+ Calendar: CalendarIcon,
2615
+ User: UserIcon,
2616
+ Users: UsersIcon,
2617
+ Gear: GearIcon,
2618
+ Wrench: WrenchIcon,
2619
+ Shield: ShieldIcon,
2620
+ HelpCircle: HelpCircleIcon,
2621
+ BarChart: BarChartIcon,
2622
+ History: HistoryIcon,
2623
+ Database: DatabaseIcon,
2624
+ Building: BuildingIcon,
2625
+ MapPin: MapPinIcon,
2626
+ Phone: PhoneIcon,
2627
+ Mail: MailIcon,
2628
+ CheckCircle: CheckCircleIcon,
2629
+ AlertTriangle: AlertTriangleIcon,
2630
+ XCircle: XCircleIcon,
2631
+ PlusCircle: PlusCircleIcon,
2632
+ LogOut: LogOutIcon,
2633
+ Download: DownloadIcon,
2634
+ Upload: UploadIcon,
2635
+ Printer: PrinterIcon,
2636
+ Star: StarIcon,
2637
+ Heart: HeartIcon,
2638
+ Eye: EyeIcon,
2639
+ Edit: EditIcon,
2640
+ Trash: TrashIcon
2641
+ };
2642
+
2643
+ // src/hooks/useLineConnect.ts
2644
+ import { useEffect as useEffect7 } from "react";
2645
+ function useLineConnectCallback({ liffId, onLineConnected, onConnectError }) {
2646
+ useEffect7(() => {
2647
+ if (typeof window !== "undefined" && window.localStorage.getItem("is_linking_line") === "true") {
2648
+ window.localStorage.removeItem("is_linking_line");
2649
+ const checkLiffAndLink = async () => {
2650
+ const liff = window.liff;
2651
+ if (liff) {
2652
+ try {
2653
+ await liff.init({ liffId });
2654
+ if (liff.isLoggedIn()) {
2655
+ const profile = await liff.getProfile();
2656
+ if (profile?.userId && onLineConnected) {
2657
+ await onLineConnected(profile.userId);
2658
+ }
2659
+ }
2660
+ } catch (err) {
2661
+ console.error("LIFF linking error:", err);
2662
+ if (onConnectError) onConnectError(err);
2663
+ }
2664
+ }
2665
+ };
2666
+ const interval = setInterval(() => {
2667
+ if (window.liff) {
2668
+ clearInterval(interval);
2669
+ checkLiffAndLink();
2670
+ }
2671
+ }, 500);
2672
+ setTimeout(() => clearInterval(interval), 1e4);
2673
+ }
2674
+ }, [liffId, onLineConnected, onConnectError]);
2675
+ }
2676
+ var startLineConnection = (liffId, redirectUrl) => {
2677
+ if (typeof window === "undefined") return;
2678
+ const liff = window.liff;
2679
+ if (liff) {
2680
+ liff.init({ liffId }).then(() => {
2681
+ if (!liff.isLoggedIn()) {
2682
+ window.localStorage.setItem("is_linking_line", "true");
2683
+ liff.login({ redirectUri: redirectUrl || window.location.href });
2684
+ } else {
2685
+ window.localStorage.setItem("is_linking_line", "true");
2686
+ window.location.reload();
2687
+ }
2688
+ });
2689
+ }
2690
+ };
2691
+ export {
2692
+ AlertTriangleIcon,
2693
+ BarChartIcon,
2694
+ BellIcon,
2695
+ BottomBar,
2696
+ BuildingIcon,
2697
+ CalendarIcon,
2698
+ CheckCircleIcon,
2699
+ ClipboardIcon,
2700
+ DatabaseIcon,
2701
+ DownloadIcon,
2702
+ EditIcon,
2703
+ EyeIcon,
2704
+ FONT_SIZE_OPTIONS,
2705
+ FileTextIcon,
2706
+ FolderIcon,
2707
+ FontSizeSettings,
2708
+ GearIcon,
2709
+ HeartIcon,
2710
+ HelpCircleIcon,
2711
+ HistoryIcon,
2712
+ HomeIcon,
2713
+ Icons,
2714
+ LogOutIcon,
2715
+ MailIcon,
2716
+ MapPinIcon,
2717
+ PhoneIcon,
2718
+ PlusCircleIcon,
2719
+ PrinterIcon,
2720
+ SearchIcon,
2721
+ SettingsPanel,
2722
+ SettingsProvider,
2723
+ ShieldIcon,
2724
+ SidebarHeader,
2725
+ SidebarMenu,
2726
+ SidebarUserProfile,
2727
+ StaffSidebar,
2728
+ StarIcon,
2729
+ ThemeSettings,
2730
+ TrashIcon,
2731
+ UploadIcon,
2732
+ UserHeader,
2733
+ UserIcon,
2734
+ UserSidebar,
2735
+ UsersIcon,
2736
+ WrenchIcon,
2737
+ XCircleIcon,
2738
+ startLineConnection,
2739
+ useDarkMode,
2740
+ useLineConnectCallback,
2741
+ useSettings
2742
+ };
2743
+ //# sourceMappingURL=index.mjs.map