@biza-gov/layout 0.0.0-stage → 1.3.13

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