jett.admin.npmpackage 2.0.13 → 2.0.16
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.css +213 -0
- package/dist/index.js +508 -167
- package/dist/index.mjs +496 -155
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ var variantStyles = {
|
|
|
14
14
|
DANGER: "bg-[#ef4444] text-white dark:text-white"
|
|
15
15
|
};
|
|
16
16
|
var CustomButton = ({
|
|
17
|
+
id = "button",
|
|
17
18
|
variant = "DEFAULT",
|
|
18
19
|
children,
|
|
19
20
|
className,
|
|
@@ -29,9 +30,10 @@ var CustomButton = ({
|
|
|
29
30
|
variantStyles[variant],
|
|
30
31
|
className
|
|
31
32
|
),
|
|
32
|
-
onClick
|
|
33
|
+
onClick,
|
|
34
|
+
id: `${id}-div-1`
|
|
33
35
|
},
|
|
34
|
-
icon && /* @__PURE__ */ React.createElement("div",
|
|
36
|
+
icon && /* @__PURE__ */ React.createElement("div", { id: `${id}-div-2` }, icon),
|
|
35
37
|
children
|
|
36
38
|
);
|
|
37
39
|
};
|
|
@@ -40,6 +42,7 @@ var CustomButton = ({
|
|
|
40
42
|
import React2, { useState, useRef } from "react";
|
|
41
43
|
import { ChevronDown, Check, Search } from "lucide-react";
|
|
42
44
|
var CustomAutocomplete = ({
|
|
45
|
+
id = "autocomplete",
|
|
43
46
|
label,
|
|
44
47
|
value,
|
|
45
48
|
onChange,
|
|
@@ -76,17 +79,19 @@ var CustomAutocomplete = ({
|
|
|
76
79
|
className: "flex flex-col w-full relative dark:bg-[#18181b] dark:text-white",
|
|
77
80
|
ref: wrapperRef,
|
|
78
81
|
tabIndex: disabled ? -1 : 0,
|
|
79
|
-
onBlur: handleBlur
|
|
82
|
+
onBlur: handleBlur,
|
|
83
|
+
id: `${id}-div-1`
|
|
80
84
|
},
|
|
81
|
-
heading && /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1" }, heading),
|
|
85
|
+
heading && /* @__PURE__ */ React2.createElement("h3", { className: "text-lg font-semibold leading-6 mb-1", id: `${id}-h3-1` }, heading),
|
|
82
86
|
label && /* @__PURE__ */ React2.createElement(
|
|
83
87
|
"label",
|
|
84
88
|
{
|
|
85
|
-
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black dark:text-white"}
|
|
89
|
+
className: `font-[500] text-sm leading-5 mb-1 ${heading ? "text-[#737373]" : "text-black dark:text-white"}`,
|
|
90
|
+
id: `${id}-label-1`
|
|
86
91
|
},
|
|
87
92
|
label,
|
|
88
93
|
" ",
|
|
89
|
-
isRequired && /* @__PURE__ */ React2.createElement("span", { className: "text-red-500" }, "*")
|
|
94
|
+
isRequired && /* @__PURE__ */ React2.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
90
95
|
),
|
|
91
96
|
/* @__PURE__ */ React2.createElement(
|
|
92
97
|
"div",
|
|
@@ -97,13 +102,15 @@ var CustomAutocomplete = ({
|
|
|
97
102
|
className: `flex justify-between items-center flex-wrap gap-1 rounded-md px-3 py-2 text-sm transition border dark:border-[#303036] h-auto min-h-10 dark:bg-[#18181b] dark:text-white
|
|
98
103
|
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-400" : "cursor-text"}
|
|
99
104
|
${error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)] hover:border-gray-400 dark:bg-[#18181b] dark:text-white"}
|
|
100
|
-
|
|
105
|
+
`,
|
|
106
|
+
id: `${id}-div-2`
|
|
101
107
|
},
|
|
102
|
-
/* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-1 flex-1" }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ React2.createElement(
|
|
108
|
+
/* @__PURE__ */ React2.createElement("div", { className: "flex flex-wrap gap-1 flex-1", id: `${id}-div-3` }, selectedOptions.length > 0 ? selectedOptions.map((opt) => /* @__PURE__ */ React2.createElement(
|
|
103
109
|
"span",
|
|
104
110
|
{
|
|
105
111
|
key: opt.value,
|
|
106
|
-
className: "bg-[#F7FAFC] dark:bg-[#303036] border border-gray-300 px-2 dark:text-white py-0.5 rounded text-xs flex items-center gap-1"
|
|
112
|
+
className: "bg-[#F7FAFC] dark:bg-[#303036] border border-gray-300 px-2 dark:text-white py-0.5 rounded text-xs flex items-center gap-1",
|
|
113
|
+
id: `${id}-span-2`
|
|
107
114
|
},
|
|
108
115
|
opt.label,
|
|
109
116
|
/* @__PURE__ */ React2.createElement(
|
|
@@ -113,11 +120,12 @@ var CustomAutocomplete = ({
|
|
|
113
120
|
e.stopPropagation();
|
|
114
121
|
toggleValue(opt.value);
|
|
115
122
|
},
|
|
116
|
-
className: "text-gray-500 hover:text-gray-700 dark:text-white cursor-pointer dark:hover:text-white"
|
|
123
|
+
className: "text-gray-500 hover:text-gray-700 dark:text-white cursor-pointer dark:hover:text-white",
|
|
124
|
+
id: `${id}-button-1`
|
|
117
125
|
},
|
|
118
126
|
"\u2715"
|
|
119
127
|
)
|
|
120
|
-
)) : /* @__PURE__ */ React2.createElement("span", { className: "text-gray-400" }, placeholder)),
|
|
128
|
+
)) : /* @__PURE__ */ React2.createElement("span", { className: "text-gray-400", id: `${id}-span-3` }, placeholder)),
|
|
121
129
|
/* @__PURE__ */ React2.createElement(
|
|
122
130
|
ChevronDown,
|
|
123
131
|
{
|
|
@@ -125,55 +133,60 @@ var CustomAutocomplete = ({
|
|
|
125
133
|
}
|
|
126
134
|
)
|
|
127
135
|
),
|
|
128
|
-
!disabled && open && /* @__PURE__ */ React2.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ React2.createElement(Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React2.createElement(
|
|
136
|
+
!disabled && open && /* @__PURE__ */ React2.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React2.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200", id: `${id}-div-5` }, /* @__PURE__ */ React2.createElement(Search, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React2.createElement(
|
|
129
137
|
"input",
|
|
130
138
|
{
|
|
131
139
|
type: "text",
|
|
132
140
|
value: search,
|
|
133
141
|
onChange: (e) => setSearch(e.target.value),
|
|
134
142
|
placeholder: "Search...",
|
|
135
|
-
className: "flex-1 text-sm focus:outline-none"
|
|
143
|
+
className: "flex-1 text-sm focus:outline-none",
|
|
144
|
+
id: `${id}-input-1`
|
|
136
145
|
}
|
|
137
|
-
)), /* @__PURE__ */ React2.createElement("ul",
|
|
146
|
+
)), /* @__PURE__ */ React2.createElement("ul", { id: `${id}-ul-1` }, filteredOptions.length > 0 ? filteredOptions.map((opt) => {
|
|
138
147
|
const selected = value.includes(opt.value);
|
|
139
148
|
return /* @__PURE__ */ React2.createElement(
|
|
140
149
|
"li",
|
|
141
150
|
{
|
|
142
151
|
key: opt.value,
|
|
143
152
|
onClick: () => toggleValue(opt.value),
|
|
144
|
-
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-[#F7FAFC] dark:hover:bg-[#303036] ${selected ? "bg-[#F7FAFC] dark:bg-[#303036] font-medium" : ""}
|
|
153
|
+
className: `flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-[#F7FAFC] dark:hover:bg-[#303036] ${selected ? "bg-[#F7FAFC] dark:bg-[#303036] font-medium" : ""}`,
|
|
154
|
+
id: `${id}-li-1`
|
|
145
155
|
},
|
|
146
156
|
/* @__PURE__ */ React2.createElement(
|
|
147
157
|
"span",
|
|
148
158
|
{
|
|
149
|
-
className: `w-4 h-4 flex items-center justify-center border rounded-sm ${selected ? "bg-blue-600 border-blue-600 text-white" : "border-gray-300"}
|
|
159
|
+
className: `w-4 h-4 flex items-center justify-center border rounded-sm ${selected ? "bg-blue-600 border-blue-600 text-white" : "border-gray-300"}`,
|
|
160
|
+
id: `${id}-span-4`
|
|
150
161
|
},
|
|
151
162
|
selected && /* @__PURE__ */ React2.createElement(Check, { size: 14 })
|
|
152
163
|
),
|
|
153
164
|
opt.label
|
|
154
165
|
);
|
|
155
|
-
}) : /* @__PURE__ */ React2.createElement("li", { className: "px-3 py-2 text-sm text-gray-400" }, "No results found")))
|
|
166
|
+
}) : /* @__PURE__ */ React2.createElement("li", { className: "px-3 py-2 text-sm text-gray-400", id: `${id}-li-2` }, "No results found")))
|
|
156
167
|
);
|
|
157
168
|
};
|
|
158
169
|
|
|
159
170
|
// src/inputs/Checkbox.jsx
|
|
160
171
|
import React3 from "react";
|
|
161
|
-
var CustomCheckbox = ({ onChange, checked }) => {
|
|
172
|
+
var CustomCheckbox = ({ id = "checkbox", onChange, checked }) => {
|
|
162
173
|
const handleChange = (e) => {
|
|
163
174
|
onChange(e.target.checked);
|
|
164
175
|
};
|
|
165
|
-
return /* @__PURE__ */ React3.createElement("label", { className: "inline-flex items-center cursor-pointer select-none" }, /* @__PURE__ */ React3.createElement(
|
|
176
|
+
return /* @__PURE__ */ React3.createElement("label", { className: "inline-flex items-center cursor-pointer select-none", id: `${id}-label-1` }, /* @__PURE__ */ React3.createElement(
|
|
166
177
|
"input",
|
|
167
178
|
{
|
|
168
179
|
type: "checkbox",
|
|
169
180
|
checked,
|
|
170
181
|
onChange: handleChange,
|
|
171
|
-
className: "peer hidden"
|
|
182
|
+
className: "peer hidden",
|
|
183
|
+
id: `${id}-input-1`
|
|
172
184
|
}
|
|
173
185
|
), /* @__PURE__ */ React3.createElement(
|
|
174
186
|
"span",
|
|
175
187
|
{
|
|
176
|
-
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-primary peer-checked:border-primary\r\n transition-colors\r\n "
|
|
188
|
+
className: "\r\n w-4 h-4 flex items-center justify-center border-2 border-gray-400 rounded \r\n peer-checked:bg-primary peer-checked:border-primary\r\n transition-colors\r\n ",
|
|
189
|
+
id: `${id}-span-1`
|
|
177
190
|
},
|
|
178
191
|
checked && /* @__PURE__ */ React3.createElement(
|
|
179
192
|
"svg",
|
|
@@ -182,9 +195,10 @@ var CustomCheckbox = ({ onChange, checked }) => {
|
|
|
182
195
|
fill: "none",
|
|
183
196
|
stroke: "currentColor",
|
|
184
197
|
strokeWidth: "3",
|
|
185
|
-
viewBox: "0 0 24 24"
|
|
198
|
+
viewBox: "0 0 24 24",
|
|
199
|
+
id: `${id}-svg-1`
|
|
186
200
|
},
|
|
187
|
-
/* @__PURE__ */ React3.createElement("path", { d: "M5 13l4 4L19 7" })
|
|
201
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M5 13l4 4L19 7", id: `${id}-path-1` })
|
|
188
202
|
)
|
|
189
203
|
));
|
|
190
204
|
};
|
|
@@ -197,11 +211,12 @@ var VARIANTS = {
|
|
|
197
211
|
RED: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100",
|
|
198
212
|
YELLOW: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
|
|
199
213
|
};
|
|
200
|
-
var Chip = ({ label, variant }) => {
|
|
214
|
+
var Chip = ({ id = "chip", label, variant }) => {
|
|
201
215
|
return /* @__PURE__ */ React4.createElement(
|
|
202
216
|
"div",
|
|
203
217
|
{
|
|
204
|
-
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]
|
|
218
|
+
className: `inline-flex text-[12px] items-center px-3 py-1 rounded-full ${VARIANTS[variant] || VARIANTS.PRIMARY} text-sm font-[600]`,
|
|
219
|
+
id: `${id}-div-1`
|
|
205
220
|
},
|
|
206
221
|
label
|
|
207
222
|
);
|
|
@@ -209,28 +224,31 @@ var Chip = ({ label, variant }) => {
|
|
|
209
224
|
|
|
210
225
|
// src/inputs/CustomSwitch.jsx
|
|
211
226
|
import React5 from "react";
|
|
212
|
-
var CustomSwitch = ({ checked, onChange, label, description }) => {
|
|
213
|
-
return /* @__PURE__ */ React5.createElement("div",
|
|
227
|
+
var CustomSwitch = ({ id = "custom-switch", checked, onChange, label, description }) => {
|
|
228
|
+
return /* @__PURE__ */ React5.createElement("div", { id: `${id}-div-1` }, /* @__PURE__ */ React5.createElement(
|
|
214
229
|
"button",
|
|
215
230
|
{
|
|
216
231
|
type: "button",
|
|
217
232
|
role: "switch",
|
|
218
233
|
"aria-checked": checked,
|
|
219
234
|
onClick: () => onChange(!checked),
|
|
220
|
-
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}
|
|
235
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${checked ? "bg-black" : "bg-gray-300"}`,
|
|
236
|
+
id: `${id}-button-1`
|
|
221
237
|
},
|
|
222
238
|
/* @__PURE__ */ React5.createElement(
|
|
223
239
|
"span",
|
|
224
240
|
{
|
|
225
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}
|
|
241
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white shadow transition ${checked ? "translate-x-6" : "translate-x-1"}`,
|
|
242
|
+
id: `${id}-span-1`
|
|
226
243
|
}
|
|
227
244
|
)
|
|
228
|
-
), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col" }, label && /* @__PURE__ */ React5.createElement("h3", { className: "font-[500] text-sm text-black mb-2" }, label), description && /* @__PURE__ */ React5.createElement("p", { className: "font-[500] text-sm text-[#737373]" }, description)));
|
|
245
|
+
), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col", id: `${id}-div-2` }, label && /* @__PURE__ */ React5.createElement("h3", { className: "font-[500] text-sm text-black mb-2", id: `${id}-h3-1` }, label), description && /* @__PURE__ */ React5.createElement("p", { className: "font-[500] text-sm text-[#737373]", id: `${id}-p-1` }, description)));
|
|
229
246
|
};
|
|
230
247
|
|
|
231
248
|
// src/inputs/Input.jsx
|
|
232
249
|
import React6 from "react";
|
|
233
250
|
var CustomInput = ({
|
|
251
|
+
id = "input",
|
|
234
252
|
label,
|
|
235
253
|
isRequired,
|
|
236
254
|
value,
|
|
@@ -240,14 +258,15 @@ var CustomInput = ({
|
|
|
240
258
|
error,
|
|
241
259
|
heading
|
|
242
260
|
}) => {
|
|
243
|
-
return /* @__PURE__ */ React6.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ React6.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ React6.createElement(
|
|
261
|
+
return /* @__PURE__ */ React6.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React6.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React6.createElement(
|
|
244
262
|
"label",
|
|
245
263
|
{
|
|
246
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white
|
|
264
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
265
|
+
id: `${id}-label-1`
|
|
247
266
|
},
|
|
248
267
|
label,
|
|
249
268
|
" ",
|
|
250
|
-
isRequired && /* @__PURE__ */ React6.createElement("span", { className: "text-red-500" }, "*")
|
|
269
|
+
isRequired && /* @__PURE__ */ React6.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
251
270
|
), /* @__PURE__ */ React6.createElement(
|
|
252
271
|
"input",
|
|
253
272
|
{
|
|
@@ -260,20 +279,22 @@ var CustomInput = ({
|
|
|
260
279
|
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
261
280
|
placeholder,
|
|
262
281
|
disabled,
|
|
263
|
-
readOnly: disabled
|
|
282
|
+
readOnly: disabled,
|
|
283
|
+
id: `${id}-input-1`
|
|
264
284
|
}
|
|
265
285
|
));
|
|
266
286
|
};
|
|
267
287
|
|
|
268
288
|
// src/inputs/ProgressBar.jsx
|
|
269
289
|
import React7 from "react";
|
|
270
|
-
var ProgressBar = ({ step, totalSteps }) => {
|
|
290
|
+
var ProgressBar = ({ id = "progress-bar", step, totalSteps }) => {
|
|
271
291
|
const progress = step / totalSteps * 100;
|
|
272
|
-
return /* @__PURE__ */ React7.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React7.createElement("p", { className: "text-gray-600 text-sm mb-2" }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ React7.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React7.createElement(
|
|
292
|
+
return /* @__PURE__ */ React7.createElement("div", { className: "mb-6", id: `${id}-div-1` }, /* @__PURE__ */ React7.createElement("p", { className: "text-gray-600 text-sm mb-2", id: `${id}-p-1` }, "Step ", step, " of ", totalSteps), /* @__PURE__ */ React7.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2", id: `${id}-div-2` }, /* @__PURE__ */ React7.createElement(
|
|
273
293
|
"div",
|
|
274
294
|
{
|
|
275
295
|
className: "bg-black h-2 rounded-full transition-all duration-300",
|
|
276
|
-
style: { width: `${progress}%` }
|
|
296
|
+
style: { width: `${progress}%` },
|
|
297
|
+
id: `${id}-div-3`
|
|
277
298
|
}
|
|
278
299
|
)));
|
|
279
300
|
};
|
|
@@ -282,18 +303,20 @@ var ProgressBar = ({ step, totalSteps }) => {
|
|
|
282
303
|
import React8 from "react";
|
|
283
304
|
import { Search as Search2 } from "lucide-react";
|
|
284
305
|
var CustomSearch = ({
|
|
306
|
+
id = "search",
|
|
285
307
|
value,
|
|
286
308
|
onChange,
|
|
287
309
|
placeholder = "Search Markets..."
|
|
288
310
|
}) => {
|
|
289
|
-
return /* @__PURE__ */ React8.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] dark:border-[#303036] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2 dark:text-white" }, /* @__PURE__ */ React8.createElement(Search2, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ React8.createElement(
|
|
311
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "flex items-center border bg-transparent text-[14px] border-[hsl(0_0%_89.8%)] dark:border-[#303036] \r\n rounded-md h-10 px-2 w-full focus-within:outline-2 focus-within:outline-black focus-within:outline-offset-2 dark:text-white", id: `${id}-div-1` }, /* @__PURE__ */ React8.createElement(Search2, { width: 16, height: 16, color: "gray", className: "mr-2" }), /* @__PURE__ */ React8.createElement(
|
|
290
312
|
"input",
|
|
291
313
|
{
|
|
292
314
|
type: "text",
|
|
293
315
|
value,
|
|
294
316
|
onChange,
|
|
295
317
|
placeholder,
|
|
296
|
-
className: "bg-transparent w-full h-full focus:outline-none"
|
|
318
|
+
className: "bg-transparent w-full h-full focus:outline-none",
|
|
319
|
+
id: `${id}-input-1`
|
|
297
320
|
}
|
|
298
321
|
));
|
|
299
322
|
};
|
|
@@ -301,6 +324,7 @@ var CustomSearch = ({
|
|
|
301
324
|
// src/inputs/TextArea.jsx
|
|
302
325
|
import React9 from "react";
|
|
303
326
|
var CustomTextarea = ({
|
|
327
|
+
id = "text-area",
|
|
304
328
|
label,
|
|
305
329
|
isRequired,
|
|
306
330
|
value,
|
|
@@ -311,14 +335,15 @@ var CustomTextarea = ({
|
|
|
311
335
|
heading,
|
|
312
336
|
rows = 4
|
|
313
337
|
}) => {
|
|
314
|
-
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col gap-1 w-full" }, heading && /* @__PURE__ */ React9.createElement("h3", { className: "text-lg font-semibold" }, heading), /* @__PURE__ */ React9.createElement(
|
|
338
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "flex flex-col gap-1 w-full", id: `${id}-div-1` }, heading && /* @__PURE__ */ React9.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), /* @__PURE__ */ React9.createElement(
|
|
315
339
|
"label",
|
|
316
340
|
{
|
|
317
|
-
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}
|
|
341
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"}`,
|
|
342
|
+
id: `${id}-label-1`
|
|
318
343
|
},
|
|
319
344
|
label,
|
|
320
345
|
" ",
|
|
321
|
-
isRequired && /* @__PURE__ */ React9.createElement("span", { className: "text-red-500" }, "*")
|
|
346
|
+
isRequired && /* @__PURE__ */ React9.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
322
347
|
), /* @__PURE__ */ React9.createElement(
|
|
323
348
|
"textarea",
|
|
324
349
|
{
|
|
@@ -332,7 +357,8 @@ var CustomTextarea = ({
|
|
|
332
357
|
onChange: (e) => onChange == null ? void 0 : onChange(e.target.value),
|
|
333
358
|
placeholder,
|
|
334
359
|
disabled,
|
|
335
|
-
readOnly: disabled
|
|
360
|
+
readOnly: disabled,
|
|
361
|
+
id: `${id}-textarea-1`
|
|
336
362
|
}
|
|
337
363
|
));
|
|
338
364
|
};
|
|
@@ -341,6 +367,7 @@ var CustomTextarea = ({
|
|
|
341
367
|
import React10, { useRef as useRef2 } from "react";
|
|
342
368
|
import { Upload } from "lucide-react";
|
|
343
369
|
var CustomUpload = ({
|
|
370
|
+
id = "upload",
|
|
344
371
|
label = "Supporting documents",
|
|
345
372
|
description = "Drop items here or Browse Files",
|
|
346
373
|
accept = ".pdf,.jpg,.jpeg,.png",
|
|
@@ -359,7 +386,7 @@ var CustomUpload = ({
|
|
|
359
386
|
}
|
|
360
387
|
onChange == null ? void 0 : onChange(selectedFile);
|
|
361
388
|
};
|
|
362
|
-
return /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col gap-2 w-full" }, label && /* @__PURE__ */ React10.createElement("label", { className: "text-sm font-medium" }, label), /* @__PURE__ */ React10.createElement(
|
|
389
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "flex flex-col gap-2 w-full", id: `${id}-div-1` }, label && /* @__PURE__ */ React10.createElement("label", { className: "text-sm font-medium", id: `${id}-label-1` }, label), /* @__PURE__ */ React10.createElement(
|
|
363
390
|
"div",
|
|
364
391
|
{
|
|
365
392
|
className: `border-2 border-dashed rounded-lg p-6 flex flex-col items-center justify-center text-center cursor-pointer transition
|
|
@@ -372,11 +399,12 @@ var CustomUpload = ({
|
|
|
372
399
|
onDrop: (e) => {
|
|
373
400
|
e.preventDefault();
|
|
374
401
|
handleFileSelect(e.dataTransfer.files);
|
|
375
|
-
}
|
|
402
|
+
},
|
|
403
|
+
id: `${id}-div-2`
|
|
376
404
|
},
|
|
377
405
|
/* @__PURE__ */ React10.createElement(Upload, { className: "w-6 h-6 text-gray-500 mb-2" }),
|
|
378
|
-
/* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-700" }, description),
|
|
379
|
-
/* @__PURE__ */ React10.createElement("p", { className: "text-xs text-gray-500 mt-1" }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
406
|
+
/* @__PURE__ */ React10.createElement("p", { className: "text-sm text-gray-700", id: `${id}-p-1` }, description),
|
|
407
|
+
/* @__PURE__ */ React10.createElement("p", { className: "text-xs text-gray-500 mt-1", id: `${id}-p-2` }, "File Supported: PDF/JPG/PNG, up to ", maxSizeMB, " MB"),
|
|
380
408
|
/* @__PURE__ */ React10.createElement(
|
|
381
409
|
"input",
|
|
382
410
|
{
|
|
@@ -384,10 +412,11 @@ var CustomUpload = ({
|
|
|
384
412
|
type: "file",
|
|
385
413
|
accept,
|
|
386
414
|
className: "hidden",
|
|
387
|
-
onChange: (e) => handleFileSelect(e.target.files)
|
|
415
|
+
onChange: (e) => handleFileSelect(e.target.files),
|
|
416
|
+
id: `${id}-input-1`
|
|
388
417
|
}
|
|
389
418
|
)
|
|
390
|
-
), value && /* @__PURE__ */ React10.createElement("span", { className: "text-sm truncate text-gray-500" }, "Selected: ", value.name), error && /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-red-500" }, error));
|
|
419
|
+
), value && /* @__PURE__ */ React10.createElement("span", { className: "text-sm truncate text-gray-500", id: `${id}-span-1` }, "Selected: ", value.name), error && /* @__PURE__ */ React10.createElement("p", { className: "text-xs text-red-500", id: `${id}-p-3` }, error));
|
|
391
420
|
};
|
|
392
421
|
|
|
393
422
|
// src/sideBar/SideBar.jsx
|
|
@@ -395,11 +424,11 @@ import {
|
|
|
395
424
|
ChevronDown as ChevronDown3,
|
|
396
425
|
CircleSlash,
|
|
397
426
|
Globe,
|
|
398
|
-
LogOut,
|
|
427
|
+
LogOut as LogOut3,
|
|
399
428
|
Menu,
|
|
400
429
|
X
|
|
401
430
|
} from "lucide-react";
|
|
402
|
-
import
|
|
431
|
+
import React14, { useEffect, useState as useState4, useCallback, useRef as useRef4 } from "react";
|
|
403
432
|
|
|
404
433
|
// ConstantUI.js
|
|
405
434
|
import {
|
|
@@ -437,7 +466,7 @@ var navItemsConstant = [
|
|
|
437
466
|
{
|
|
438
467
|
label: "Trips",
|
|
439
468
|
onClick: () => {
|
|
440
|
-
window.location.href = "/
|
|
469
|
+
window.location.href = "/trips/";
|
|
441
470
|
}
|
|
442
471
|
},
|
|
443
472
|
{
|
|
@@ -601,6 +630,7 @@ import Cookies from "js-cookie";
|
|
|
601
630
|
import React11, { useState as useState2, useRef as useRef3 } from "react";
|
|
602
631
|
import { ChevronDown as ChevronDown2, Search as Search3 } from "lucide-react";
|
|
603
632
|
var CustomSelect = ({
|
|
633
|
+
id = "custom-select",
|
|
604
634
|
label,
|
|
605
635
|
value,
|
|
606
636
|
onChange,
|
|
@@ -634,17 +664,19 @@ var CustomSelect = ({
|
|
|
634
664
|
className: "flex flex-col w-full relative",
|
|
635
665
|
ref: wrapperRef,
|
|
636
666
|
tabIndex: disabled ? -1 : 0,
|
|
637
|
-
onBlur: handleBlur
|
|
667
|
+
onBlur: handleBlur,
|
|
668
|
+
id: `${id}-div-1`
|
|
638
669
|
},
|
|
639
|
-
heading && /* @__PURE__ */ React11.createElement("h3", { className: "text-lg font-semibold mb-1" }, heading),
|
|
670
|
+
heading && /* @__PURE__ */ React11.createElement("h3", { className: "text-lg font-semibold mb-1", id: `${id}-h3-1` }, heading),
|
|
640
671
|
label && /* @__PURE__ */ React11.createElement(
|
|
641
672
|
"label",
|
|
642
673
|
{
|
|
643
|
-
className: `font-medium text-sm mb-1 ${heading ? "text-[#737373] dark:text-white" : "text-black dark:text-white"}
|
|
674
|
+
className: `font-medium text-sm mb-1 ${heading ? "text-[#737373] dark:text-white" : "text-black dark:text-white"}`,
|
|
675
|
+
id: `${id}-label-1`
|
|
644
676
|
},
|
|
645
677
|
label,
|
|
646
678
|
" ",
|
|
647
|
-
isRequired && /* @__PURE__ */ React11.createElement("span", { className: "text-red-500" }, "*")
|
|
679
|
+
isRequired && /* @__PURE__ */ React11.createElement("span", { className: "text-red-500", id: `${id}-span-1` }, "*")
|
|
648
680
|
),
|
|
649
681
|
/* @__PURE__ */ React11.createElement(
|
|
650
682
|
"div",
|
|
@@ -653,9 +685,10 @@ var CustomSelect = ({
|
|
|
653
685
|
className: `flex justify-between items-center rounded-md px-3 py-2 text-sm border h-10 cursor-pointer dark:border-[#303036] dark:bg-[#18181b] dark:text-white
|
|
654
686
|
${disabled ? "bg-gray-100 text-gray-400" : "bg-white dark:bg-[#18181b] dark:text-white"}
|
|
655
687
|
${error ? "border-red-500" : "border-gray-300"}
|
|
656
|
-
|
|
688
|
+
`,
|
|
689
|
+
id: `${id}-div-2`
|
|
657
690
|
},
|
|
658
|
-
/* @__PURE__ */ React11.createElement("span", { className: `${selectedOption ? "text-black dark:text-white" : "text-gray-400 dark:text-white"}` }, selectedOption ? selectedOption.label : placeholder),
|
|
691
|
+
/* @__PURE__ */ React11.createElement("span", { className: `${selectedOption ? "text-black dark:text-white" : "text-gray-400 dark:text-white"}`, id: `${id}-span-2` }, selectedOption ? selectedOption.label : placeholder),
|
|
659
692
|
/* @__PURE__ */ React11.createElement(
|
|
660
693
|
ChevronDown2,
|
|
661
694
|
{
|
|
@@ -663,24 +696,26 @@ var CustomSelect = ({
|
|
|
663
696
|
}
|
|
664
697
|
)
|
|
665
698
|
),
|
|
666
|
-
open && !disabled && /* @__PURE__ */ React11.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white" }, /* @__PURE__ */ React11.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200" }, /* @__PURE__ */ React11.createElement(Search3, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React11.createElement(
|
|
699
|
+
open && !disabled && /* @__PURE__ */ React11.createElement("div", { className: "absolute top-full mt-1 w-full bg-white border border-gray-200 rounded-lg shadow-lg z-10 max-h-60 overflow-y-auto dark:bg-[#18181b] dark:text-white", id: `${id}-div-3` }, /* @__PURE__ */ React11.createElement("div", { className: "flex items-center gap-2 p-2 border-b border-gray-200", id: `${id}-div-4` }, /* @__PURE__ */ React11.createElement(Search3, { size: 16, className: "text-gray-400" }), /* @__PURE__ */ React11.createElement(
|
|
667
700
|
"input",
|
|
668
701
|
{
|
|
669
702
|
type: "text",
|
|
670
703
|
value: search,
|
|
671
704
|
onChange: (e) => setSearch(e.target.value),
|
|
672
705
|
placeholder: "Search...",
|
|
673
|
-
className: "flex-1 text-sm focus:outline-none"
|
|
706
|
+
className: "flex-1 text-sm focus:outline-none",
|
|
707
|
+
id: `${id}-input-1`
|
|
674
708
|
}
|
|
675
|
-
)), /* @__PURE__ */ React11.createElement("ul",
|
|
709
|
+
)), /* @__PURE__ */ React11.createElement("ul", { id: `${id}-ul-1` }, filteredOptions.length > 0 ? filteredOptions.map((opt) => /* @__PURE__ */ React11.createElement(
|
|
676
710
|
"li",
|
|
677
711
|
{
|
|
678
712
|
key: opt.value,
|
|
679
713
|
onClick: () => handleSelect(opt.value),
|
|
680
|
-
className: `px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-[#27272a] ${value === opt.value ? "bg-gray-100 font-medium dark:bg-[#27272a] dark:text-white" : ""}
|
|
714
|
+
className: `px-3 py-2 text-sm cursor-pointer hover:bg-gray-100 dark:hover:bg-[#27272a] ${value === opt.value ? "bg-gray-100 font-medium dark:bg-[#27272a] dark:text-white" : ""}`,
|
|
715
|
+
id: `${id}-li-1`
|
|
681
716
|
},
|
|
682
717
|
opt.label
|
|
683
|
-
)) : /* @__PURE__ */ React11.createElement("li", { className: "px-3 py-2 text-sm text-gray-400 dark:text-white" }, "No results found")))
|
|
718
|
+
)) : /* @__PURE__ */ React11.createElement("li", { className: "px-3 py-2 text-sm text-gray-400 dark:text-white", id: `${id}-li-2` }, "No results found")))
|
|
684
719
|
);
|
|
685
720
|
};
|
|
686
721
|
|
|
@@ -729,6 +764,15 @@ function getScopeFromJettIdCookie() {
|
|
|
729
764
|
const data = getJettIdCookieData();
|
|
730
765
|
return (data == null ? void 0 : data.Scope) ?? null;
|
|
731
766
|
}
|
|
767
|
+
function getProfilesFromJettIdCookie(all) {
|
|
768
|
+
const data = getJettIdCookieData();
|
|
769
|
+
if (!(data == null ? void 0 : data.Profiles)) return [];
|
|
770
|
+
if (all) return data.Profiles;
|
|
771
|
+
return data.Profiles.filter((profile) => {
|
|
772
|
+
var _a;
|
|
773
|
+
return (_a = profile.Scope) == null ? void 0 : _a.endsWith("_ENTITY");
|
|
774
|
+
});
|
|
775
|
+
}
|
|
732
776
|
function buildLogoUrl(CDNBasePath, logoPath) {
|
|
733
777
|
const base = (CDNBasePath || "").replace(/\/$/, "");
|
|
734
778
|
const path = (logoPath || "").replace(/^\//, "");
|
|
@@ -736,26 +780,258 @@ function buildLogoUrl(CDNBasePath, logoPath) {
|
|
|
736
780
|
return `${base}/${path}`;
|
|
737
781
|
}
|
|
738
782
|
|
|
783
|
+
// src/sideBar/SwitchProfileSection.jsx
|
|
784
|
+
import React13, { useLayoutEffect, useState as useState3 } from "react";
|
|
785
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
786
|
+
import { LogOut as LogOut2, Settings } from "lucide-react";
|
|
787
|
+
|
|
788
|
+
// src/sideBar/LogoutConfirmModal.jsx
|
|
789
|
+
import React12 from "react";
|
|
790
|
+
import { createPortal } from "react-dom";
|
|
791
|
+
import { LogOut } from "lucide-react";
|
|
792
|
+
var LogoutConfirmModal = ({
|
|
793
|
+
id = "logout-confirm",
|
|
794
|
+
open,
|
|
795
|
+
onConfirm,
|
|
796
|
+
onCancel,
|
|
797
|
+
loading = false
|
|
798
|
+
}) => {
|
|
799
|
+
if (!open || typeof document === "undefined") return null;
|
|
800
|
+
const handleOverlayClick = (e) => {
|
|
801
|
+
if (e.target === e.currentTarget && !loading) onCancel();
|
|
802
|
+
};
|
|
803
|
+
return createPortal(
|
|
804
|
+
/* @__PURE__ */ React12.createElement(
|
|
805
|
+
"div",
|
|
806
|
+
{
|
|
807
|
+
className: "fixed inset-0 z-[10000] flex items-center justify-center bg-black/50",
|
|
808
|
+
onClick: handleOverlayClick,
|
|
809
|
+
id: `${id}-overlay`
|
|
810
|
+
},
|
|
811
|
+
/* @__PURE__ */ React12.createElement("div", { className: "w-[360px] rounded-2xl bg-white dark:bg-[#18181b] p-6 text-center shadow-2xl", id: `${id}-dialog` }, /* @__PURE__ */ React12.createElement("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-50 dark:bg-blue-950/40", id: `${id}-icon` }, /* @__PURE__ */ React12.createElement(LogOut, { className: "text-blue-600", width: 28, height: 28 })), /* @__PURE__ */ React12.createElement("p", { className: "!text-[22px] !font-semibold text-gray-900 dark:text-white" }, "Are you sure you want to logout?"), /* @__PURE__ */ React12.createElement("div", { className: "mt-6 flex gap-3" }, /* @__PURE__ */ React12.createElement(
|
|
812
|
+
"button",
|
|
813
|
+
{
|
|
814
|
+
type: "button",
|
|
815
|
+
onClick: onCancel,
|
|
816
|
+
disabled: loading,
|
|
817
|
+
className: "flex-1 no-wrap rounded-lg border border-gray-300 dark:border-[#303036] px-4 py-2 text-[14px] font-medium text-gray-700 dark:text-[#f4f4f5cc] cursor-pointer hover:bg-gray-50 dark:hover:bg-[#27272a] disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",
|
|
818
|
+
id: `${id}-cancel-button`
|
|
819
|
+
},
|
|
820
|
+
"No, Keep me in"
|
|
821
|
+
), /* @__PURE__ */ React12.createElement(
|
|
822
|
+
"button",
|
|
823
|
+
{
|
|
824
|
+
type: "button",
|
|
825
|
+
onClick: onConfirm,
|
|
826
|
+
disabled: loading,
|
|
827
|
+
className: "flex-1 rounded-lg bg-red-600 px-4 py-2 text-[14px] font-medium text-white cursor-pointer hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",
|
|
828
|
+
id: `${id}-confirm-button`
|
|
829
|
+
},
|
|
830
|
+
loading ? "Logging out..." : "Yes, logout"
|
|
831
|
+
)))
|
|
832
|
+
),
|
|
833
|
+
document.body
|
|
834
|
+
);
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// src/utils/switchProfileEncryption.js
|
|
838
|
+
import forge from "node-forge";
|
|
839
|
+
var RSA_MODULUS_BASE64 = "zktSGmyKa5SR8HO540HKTdgDPVmXafgGFrf4OYtRNApRssnt0hGoMU7Jitc/SVWbPstFshIi5XblbDL2NXWYhZtj4PWL4SKc1/bM02xxabPw/eFr3XAAPCF62WxAVPsJBbEoAB0AcOCeIcGHb+tzLtXQJAvOuIBsKLQiiB7/c9ltt5AVVM4si1RC3JsxpqcGTkgwnh+FMg8CFvLdHjh/oi789wj8zoGWLAdYSBBa8IoQgTuzZt1tft2LF0y4Ck3yT8F9TX5GbAiVXb0G9cM/hUmDNz/6xOvHuOfH5147tKDUNCT/sr5tEaLm5ePUmRdpoc5PZa04q1KGJ0rxf6T55E5pQ8Qh2EFr1yPyLh12wiSTRsnHwXwVsosbNNBBN3HdBOMklTQx2VJNDHpi19G+z4d1evlS8yDqNZe9QyRFKEsTd+xPg3ob3j/ObpYDOtXoMaw8fXWbvyG4MJTz7nWG5YL2s5oWSAFZ4mifgwOmM/OuTO/uholelws25k/a3+O/s5Xd/HOugBvpeb5azGLfMHrGvu6J9DSIVI28hfbaFm2+smjyLdS+5PWV2+hM9EQLgaw/euGx4Qhzo2nagLwl9+hNOZ2gjtNHJxJtbQJTNrE90d3mX2/yfxHzh8FiiAiraxiZCgdUQeEZbZNlAwQLHIYWazSqgmRhf4D1LGMMrak=";
|
|
840
|
+
var RSA_EXPONENT_BASE64 = "AQAB";
|
|
841
|
+
var convertModulusExponentToPem = (modulus, exponent) => {
|
|
842
|
+
const decodedModulus = forge.util.decode64(modulus);
|
|
843
|
+
const decodedExponent = forge.util.decode64(exponent);
|
|
844
|
+
const publicKey = forge.pki.setRsaPublicKey(
|
|
845
|
+
new forge.jsbn.BigInteger(forge.util.bytesToHex(decodedModulus), 16),
|
|
846
|
+
new forge.jsbn.BigInteger(forge.util.bytesToHex(decodedExponent), 16)
|
|
847
|
+
);
|
|
848
|
+
return forge.pki.publicKeyToPem(publicKey);
|
|
849
|
+
};
|
|
850
|
+
var cachedPemKey = null;
|
|
851
|
+
var getPemKey = () => {
|
|
852
|
+
if (!cachedPemKey) {
|
|
853
|
+
cachedPemKey = convertModulusExponentToPem(RSA_MODULUS_BASE64, RSA_EXPONENT_BASE64);
|
|
854
|
+
}
|
|
855
|
+
return cachedPemKey;
|
|
856
|
+
};
|
|
857
|
+
var encryptForSwitchProfile = (plainText) => {
|
|
858
|
+
const publicKey = forge.pki.publicKeyFromPem(getPemKey());
|
|
859
|
+
const encrypted = publicKey.encrypt(plainText, "RSAES-PKCS1-V1_5");
|
|
860
|
+
return forge.util.encode64(encrypted).replace(/\r?\n|\r/g, "");
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// src/sideBar/SwitchProfileSection.jsx
|
|
864
|
+
var SwitchProfileSection = ({
|
|
865
|
+
id = "switch-profile",
|
|
866
|
+
open,
|
|
867
|
+
anchorRef,
|
|
868
|
+
onClose,
|
|
869
|
+
onManageProfile,
|
|
870
|
+
onProfileSwitch,
|
|
871
|
+
onTmcSettings,
|
|
872
|
+
onLogout
|
|
873
|
+
}) => {
|
|
874
|
+
const [position, setPosition] = useState3(null);
|
|
875
|
+
const [showLogoutConfirm, setShowLogoutConfirm] = useState3(false);
|
|
876
|
+
const [switchingProfileId, setSwitchingProfileId] = useState3(null);
|
|
877
|
+
useLayoutEffect(() => {
|
|
878
|
+
if (!open || !(anchorRef == null ? void 0 : anchorRef.current)) return;
|
|
879
|
+
const updatePosition = () => {
|
|
880
|
+
const rect = anchorRef.current.getBoundingClientRect();
|
|
881
|
+
setPosition({
|
|
882
|
+
left: rect.right + 12,
|
|
883
|
+
bottom: window.innerHeight - rect.bottom
|
|
884
|
+
});
|
|
885
|
+
};
|
|
886
|
+
updatePosition();
|
|
887
|
+
window.addEventListener("resize", updatePosition);
|
|
888
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
889
|
+
return () => {
|
|
890
|
+
window.removeEventListener("resize", updatePosition);
|
|
891
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
892
|
+
};
|
|
893
|
+
}, [open, anchorRef]);
|
|
894
|
+
if (!open && !showLogoutConfirm || typeof document === "undefined") return null;
|
|
895
|
+
const jettIdData = getJettIdCookieData();
|
|
896
|
+
const userName = (jettIdData == null ? void 0 : jettIdData.UserName) || "";
|
|
897
|
+
const userEmail = (jettIdData == null ? void 0 : jettIdData.UserEmail) || "";
|
|
898
|
+
const currentProfileId = jettIdData == null ? void 0 : jettIdData.ProfileId;
|
|
899
|
+
const allMarkets = getProfilesFromJettIdCookie(true);
|
|
900
|
+
const markets = allMarkets.length ? allMarkets : (jettIdData == null ? void 0 : jettIdData.EntityName) ? [{ ProfileId: currentProfileId, EntityName: jettIdData.EntityName }] : [];
|
|
901
|
+
const handleConfirmLogout = () => {
|
|
902
|
+
setShowLogoutConfirm(false);
|
|
903
|
+
onLogout == null ? void 0 : onLogout();
|
|
904
|
+
};
|
|
905
|
+
const buildRequestContext = () => ({
|
|
906
|
+
UserAgent: typeof navigator !== "undefined" ? navigator.userAgent : "Mozilla/5.0",
|
|
907
|
+
TrackingId: crypto.randomUUID(),
|
|
908
|
+
TransactionId: crypto.randomUUID(),
|
|
909
|
+
CountryCode: "IN",
|
|
910
|
+
IpAddress: "127.0.0.1"
|
|
911
|
+
// Client IP cannot be retrieved from browser
|
|
912
|
+
});
|
|
913
|
+
const handleProfileSwitch = async (profile) => {
|
|
914
|
+
var _a;
|
|
915
|
+
if (switchingProfileId) return;
|
|
916
|
+
setSwitchingProfileId(profile.ProfileId);
|
|
917
|
+
try {
|
|
918
|
+
const encryptedRequest = encryptForSwitchProfile(
|
|
919
|
+
JSON.stringify({
|
|
920
|
+
ProfileToken: profile.ProfileToken,
|
|
921
|
+
ProfileId: profile.ProfileId
|
|
922
|
+
})
|
|
923
|
+
);
|
|
924
|
+
const response = await fetch(`${window.location.origin}/auth/switch/profile`, {
|
|
925
|
+
method: "POST",
|
|
926
|
+
credentials: "include",
|
|
927
|
+
headers: { "Content-Type": "application/json" },
|
|
928
|
+
body: JSON.stringify({
|
|
929
|
+
Context: buildRequestContext(),
|
|
930
|
+
Request: encryptedRequest
|
|
931
|
+
})
|
|
932
|
+
}).then((res) => res.json());
|
|
933
|
+
if ((_a = response == null ? void 0 : response.Response) == null ? void 0 : _a.RedirectUrl) {
|
|
934
|
+
window.location.href = response.Response.RedirectUrl;
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
setSwitchingProfileId(null);
|
|
938
|
+
onProfileSwitch == null ? void 0 : onProfileSwitch(profile);
|
|
939
|
+
} catch (error) {
|
|
940
|
+
console.error("Switch profile request failed:", error);
|
|
941
|
+
setSwitchingProfileId(null);
|
|
942
|
+
onProfileSwitch == null ? void 0 : onProfileSwitch(profile);
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, open && createPortal2(
|
|
946
|
+
/* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement("div", { className: "fixed inset-0 z-[9999]", onClick: onClose, id: `${id}-backdrop` }), /* @__PURE__ */ React13.createElement(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
className: "fixed w-[370px] max-h-[75vh] flex flex-col overflow-hidden bg-white dark:bg-[#18181b] rounded-xl shadow-xl border border-gray-200 dark:border-[#303036] z-[9999]",
|
|
950
|
+
style: position ? { left: position.left, bottom: position.bottom } : { left: -9999, bottom: 0 },
|
|
951
|
+
id: `${id}-panel`
|
|
952
|
+
},
|
|
953
|
+
/* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between gap-3 p-4", id: `${id}-header` }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-3 min-w-0", id: `${id}-header-user` }, /* @__PURE__ */ React13.createElement("span", { className: "relative flex shrink-0 overflow-hidden rounded-full h-10 w-10", id: `${id}-avatar` }, /* @__PURE__ */ React13.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, userName ? userName.charAt(0) : "A")), /* @__PURE__ */ React13.createElement("div", { className: "min-w-0", id: `${id}-header-text` }, /* @__PURE__ */ React13.createElement("p", { className: "!font-semibold dark:text-white !text-[15px] truncate" }, userName || "Admin"), /* @__PURE__ */ React13.createElement("p", { className: "!text-[13px] !font-normal text-gray-500 dark:text-[#f4f4f5cc] truncate" }, userEmail))), /* @__PURE__ */ React13.createElement(
|
|
954
|
+
"button",
|
|
955
|
+
{
|
|
956
|
+
type: "button",
|
|
957
|
+
onClick: onManageProfile,
|
|
958
|
+
className: "shrink-0 whitespace-nowrap rounded-md border border-gray-300 dark:border-[#303036] px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-700 dark:text-[#f4f4f5cc] cursor-pointer hover:bg-gray-50 dark:hover:bg-[#27272a] transition-colors duration-200",
|
|
959
|
+
id: `${id}-manage-profile-button`
|
|
960
|
+
},
|
|
961
|
+
"Manage Profile"
|
|
962
|
+
)),
|
|
963
|
+
/* @__PURE__ */ React13.createElement("div", { className: "border-t border-gray-200 dark:border-[#303036]" }),
|
|
964
|
+
/* @__PURE__ */ React13.createElement("div", { className: "overflow-y-auto scrollbar-hide", id: `${id}-body` }, /* @__PURE__ */ React13.createElement("p", { className: "px-4 pt-3 pb-2 text-[11px] font-semibold tracking-wider text-gray-400 uppercase", id: `${id}-markets-label` }, "Your Markets"), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-1 px-2 pb-2", id: `${id}-markets-list` }, markets.length === 0 && /* @__PURE__ */ React13.createElement("p", { className: "px-2 py-2 text-[13px] text-gray-400", id: `${id}-markets-empty` }, "No markets available"), markets.map((profile) => {
|
|
965
|
+
const isCurrent = profile.ProfileId === currentProfileId;
|
|
966
|
+
const isSwitching = switchingProfileId === profile.ProfileId;
|
|
967
|
+
return /* @__PURE__ */ React13.createElement(
|
|
968
|
+
"div",
|
|
969
|
+
{
|
|
970
|
+
key: profile.ProfileId,
|
|
971
|
+
onClick: () => !isCurrent && handleProfileSwitch(profile),
|
|
972
|
+
"aria-disabled": isSwitching,
|
|
973
|
+
className: `flex items-center justify-between gap-2 rounded-lg p-3 cursor-pointer hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] transition-colors duration-200 ${isCurrent ? "border border-gray-800 dark:border-white" : "border border-transparent"} ${isSwitching ? "opacity-50 pointer-events-none" : ""}`,
|
|
974
|
+
id: `${id}-market-${profile.ProfileId}`
|
|
975
|
+
},
|
|
976
|
+
/* @__PURE__ */ React13.createElement("span", { className: "!font-medium !text-[14px] dark:text-[#f4f4f5cc] truncate" }, profile.EntityName),
|
|
977
|
+
isCurrent && /* @__PURE__ */ React13.createElement("span", { className: "shrink-0 rounded-full bg-blue-600 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-white" }, "Logged In"),
|
|
978
|
+
isSwitching && /* @__PURE__ */ React13.createElement("span", { className: "shrink-0 text-[11px] text-gray-400" }, "Switching...")
|
|
979
|
+
);
|
|
980
|
+
}))),
|
|
981
|
+
/* @__PURE__ */ React13.createElement("div", { className: "border-t border-gray-200 dark:border-[#303036]" }),
|
|
982
|
+
/* @__PURE__ */ React13.createElement("div", { className: "p-2", id: `${id}-footer` }, /* @__PURE__ */ React13.createElement(
|
|
983
|
+
"div",
|
|
984
|
+
{
|
|
985
|
+
onClick: () => {
|
|
986
|
+
onClose == null ? void 0 : onClose();
|
|
987
|
+
setShowLogoutConfirm(true);
|
|
988
|
+
},
|
|
989
|
+
className: "flex items-center gap-3 rounded-lg p-3 cursor-pointer text-red-600 hover:bg-red-50 dark:hover:bg-[#27272a] transition-colors duration-200",
|
|
990
|
+
id: `${id}-logout`
|
|
991
|
+
},
|
|
992
|
+
/* @__PURE__ */ React13.createElement(LogOut2, { width: 18, height: 18 }),
|
|
993
|
+
/* @__PURE__ */ React13.createElement("span", { className: "!font-medium !text-[14px]" }, "Logout")
|
|
994
|
+
))
|
|
995
|
+
)),
|
|
996
|
+
document.body
|
|
997
|
+
), /* @__PURE__ */ React13.createElement(
|
|
998
|
+
LogoutConfirmModal,
|
|
999
|
+
{
|
|
1000
|
+
id: `${id}-logout-confirm`,
|
|
1001
|
+
open: showLogoutConfirm,
|
|
1002
|
+
onCancel: () => setShowLogoutConfirm(false),
|
|
1003
|
+
onConfirm: handleConfirmLogout
|
|
1004
|
+
}
|
|
1005
|
+
));
|
|
1006
|
+
};
|
|
1007
|
+
|
|
739
1008
|
// src/sideBar/SideBar.jsx
|
|
740
1009
|
var SCOPE_LABELS = {
|
|
741
1010
|
TMC: "TMC Manager",
|
|
742
1011
|
TMC_ENTITY: "TMC Entity Manager"
|
|
743
1012
|
};
|
|
744
1013
|
var AppSideBar = ({
|
|
1014
|
+
id = "side-bar",
|
|
745
1015
|
username,
|
|
746
1016
|
navItems,
|
|
747
1017
|
additionalItems,
|
|
748
|
-
sideBarLogo
|
|
1018
|
+
sideBarLogo,
|
|
1019
|
+
onManageProfile,
|
|
1020
|
+
onProfileSwitch,
|
|
1021
|
+
onTmcSettings,
|
|
1022
|
+
onLogout
|
|
749
1023
|
}) => {
|
|
750
1024
|
var _a, _b;
|
|
751
|
-
const
|
|
752
|
-
const [
|
|
753
|
-
const [
|
|
754
|
-
const [
|
|
755
|
-
const [
|
|
756
|
-
const [
|
|
757
|
-
const [
|
|
758
|
-
const [
|
|
1025
|
+
const profileCardRef = useRef4(null);
|
|
1026
|
+
const [authData, setAuthData] = useState4(null);
|
|
1027
|
+
const [cookieUserName, setCookieUserName] = useState4(null);
|
|
1028
|
+
const [scope, setScope] = useState4(null);
|
|
1029
|
+
const [selectedCountry, setSelectedCountry] = useState4("dubai");
|
|
1030
|
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState4(false);
|
|
1031
|
+
const [isSwitchProfileOpen, setIsSwitchProfileOpen] = useState4(false);
|
|
1032
|
+
const [openMenus, setOpenMenus] = useState4(/* @__PURE__ */ new Set());
|
|
1033
|
+
const [activeMenuPath, setActiveMenuPath] = useState4(null);
|
|
1034
|
+
const [currAppearance, setCurrAppearance] = useState4("light");
|
|
759
1035
|
useEffect(() => {
|
|
760
1036
|
setCurrAppearance("light");
|
|
761
1037
|
}, []);
|
|
@@ -1025,7 +1301,7 @@ var AppSideBar = ({
|
|
|
1025
1301
|
setActiveMenuPath(foundActivePath);
|
|
1026
1302
|
}
|
|
1027
1303
|
}, [navItemsLocal]);
|
|
1028
|
-
const [currentUrl, setCurrentUrl] =
|
|
1304
|
+
const [currentUrl, setCurrentUrl] = useState4(
|
|
1029
1305
|
() => window.location.pathname + window.location.search
|
|
1030
1306
|
);
|
|
1031
1307
|
useEffect(() => {
|
|
@@ -1063,69 +1339,76 @@ var AppSideBar = ({
|
|
|
1063
1339
|
const closeMobileMenu = () => {
|
|
1064
1340
|
setIsMobileMenuOpen(false);
|
|
1065
1341
|
};
|
|
1066
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement("div", { className: "fixed top-0 left-0 w-full z-50 flex items-center justify-between px-4 py-3 bg-white dark:bg-[#18181b] border-b border-gray-200 dark:border-[#303036] shadow-lg md:hidden", id: `${id}-div-1` }, /* @__PURE__ */ React14.createElement(
|
|
1067
1343
|
"button",
|
|
1068
1344
|
{
|
|
1069
1345
|
onClick: toggleMobileMenu,
|
|
1070
1346
|
className: "p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-[#27272a] transition-colors",
|
|
1071
|
-
"aria-label": "Toggle menu"
|
|
1347
|
+
"aria-label": "Toggle menu",
|
|
1348
|
+
id: `${id}-button-1`
|
|
1072
1349
|
},
|
|
1073
|
-
isMobileMenuOpen ? /* @__PURE__ */
|
|
1074
|
-
), /* @__PURE__ */
|
|
1350
|
+
isMobileMenuOpen ? /* @__PURE__ */ React14.createElement(X, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" }) : /* @__PURE__ */ React14.createElement(Menu, { className: "w-6 h-6 text-gray-700 dark:text-[#f4f4f5cc]" })
|
|
1351
|
+
), /* @__PURE__ */ React14.createElement("div", { className: "flex-1 flex justify-center", id: `${id}-div-2` }, sideBarLogoLocal && /* @__PURE__ */ React14.createElement(
|
|
1075
1352
|
"img",
|
|
1076
1353
|
{
|
|
1077
1354
|
src: sideBarLogoLocal,
|
|
1078
1355
|
alt: "sidebarLogo",
|
|
1079
1356
|
width: 208,
|
|
1080
1357
|
height: 40,
|
|
1081
|
-
className: "object-contain"
|
|
1358
|
+
className: "object-contain",
|
|
1359
|
+
id: `${id}-img-1`
|
|
1082
1360
|
}
|
|
1083
|
-
)), /* @__PURE__ */
|
|
1361
|
+
)), /* @__PURE__ */ React14.createElement("div", { className: "w-10", id: `${id}-div-3` })), isMobileMenuOpen && /* @__PURE__ */ React14.createElement(
|
|
1084
1362
|
"div",
|
|
1085
1363
|
{
|
|
1086
1364
|
className: "fixed inset-0 bg-black/80 bg-opacity-50 z-40 md:hidden",
|
|
1087
|
-
onClick: closeMobileMenu
|
|
1365
|
+
onClick: closeMobileMenu,
|
|
1366
|
+
id: `${id}-div-4`
|
|
1088
1367
|
}
|
|
1089
|
-
), /* @__PURE__ */
|
|
1368
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1090
1369
|
"div",
|
|
1091
1370
|
{
|
|
1092
|
-
className: `fixed top-0 left-0 md:relative w-[320px] transition-all ease-in-out delay-100 bg-white dark:bg-[#18181b] border-r border-gray-200 dark:border-[#303036] flex flex-col p-4 pt-20 md:pt-4 h-full max-h-[100vh] xs:max-md:z-40 md:max-lg:w-[280px] ${isMobileMenuOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"}
|
|
1371
|
+
className: `fixed top-0 left-0 md:relative w-[320px] transition-all ease-in-out delay-100 bg-white dark:bg-[#18181b] border-r border-gray-200 dark:border-[#303036] flex flex-col p-4 pt-20 md:pt-4 h-full max-h-[100vh] xs:max-md:z-40 md:max-lg:w-[280px] ${isMobileMenuOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"}`,
|
|
1372
|
+
id: `${id}-div-5`
|
|
1093
1373
|
},
|
|
1094
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ React14.createElement("div", { className: "p-2 mb-2 hidden md:block", id: `${id}-div-6` }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-center w-full h-[60px] mb-2", id: `${id}-div-7` }, sideBarLogoLocal && /* @__PURE__ */ React14.createElement(
|
|
1095
1375
|
"img",
|
|
1096
1376
|
{
|
|
1097
1377
|
src: sideBarLogoLocal,
|
|
1098
1378
|
alt: "sidebarLogo",
|
|
1099
1379
|
width: 108,
|
|
1100
1380
|
height: 40,
|
|
1101
|
-
className: "object-contain"
|
|
1381
|
+
className: "object-contain",
|
|
1382
|
+
id: `${id}-img-2`
|
|
1102
1383
|
}
|
|
1103
1384
|
))),
|
|
1104
|
-
/* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ React14.createElement("div", { className: "mb-4", id: `${id}-div-8` }),
|
|
1386
|
+
/* @__PURE__ */ React14.createElement("div", { className: "overflow-y-auto scrollbar-hide", id: `${id}-div-9` }, /* @__PURE__ */ React14.createElement("div", { id: `${id}-div-10` }, navItemsLocal == null ? void 0 : navItemsLocal.map((item, index) => {
|
|
1106
1387
|
const menuKey = `menu-${index}`;
|
|
1107
1388
|
const isOpen = isMenuOpen(menuKey);
|
|
1108
1389
|
const isActive = activeMenuPath === menuKey;
|
|
1109
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React14.createElement("div", { key: index, className: "", id: `${id}-div-11` }, /* @__PURE__ */ React14.createElement(
|
|
1110
1391
|
"div",
|
|
1111
1392
|
{
|
|
1112
1393
|
className: `flex items-center gap-3 p-2.5 hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-700 dark:text-[#f4f4f5cc] cursor-pointer rounded-lg ml-2 mr-2 transition-colors duration-200 ${isActive ? "bg-[#f4f4f5] dark:bg-[#27272a]" : ""}`,
|
|
1113
|
-
onClick: (e) => handleMenuClick(item, index, e)
|
|
1394
|
+
onClick: (e) => handleMenuClick(item, index, e),
|
|
1395
|
+
id: `${id}-div-12`
|
|
1114
1396
|
},
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
item.isDropDown && /* @__PURE__ */
|
|
1118
|
-
), item.options && item.options.length > 0 && /* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ React14.createElement("div", { className: "text-primary", id: `${id}-div-13` }, /* @__PURE__ */ React14.createElement(item.Icon, { width: 20, height: 20, id: `${id}-icon-1` })),
|
|
1398
|
+
/* @__PURE__ */ React14.createElement("span", { className: "!font-medium !text-[16px] !text-[#000] dark:text-[#f4f4f5cc]", id: `${id}-span-1` }, item.label),
|
|
1399
|
+
item.isDropDown && /* @__PURE__ */ React14.createElement("div", { className: `ml-auto transition-all delay-75 ${isOpen ? "rotate-180" : ""}`, id: `${id}-div-14` }, /* @__PURE__ */ React14.createElement(ChevronDown3, { width: 20, height: 20, className: "text-gray-500 dark:text-gray-400" }))
|
|
1400
|
+
), item.options && item.options.length > 0 && /* @__PURE__ */ React14.createElement(
|
|
1119
1401
|
"div",
|
|
1120
1402
|
{
|
|
1121
|
-
className: `ml-[20px] overflow-hidden flex flex-col transition-all duration-200 ${isOpen ? "max-h-[1000px] min-h-[50px]" : "max-h-0"}
|
|
1403
|
+
className: `ml-[20px] overflow-hidden flex flex-col transition-all duration-200 ${isOpen ? "max-h-[1000px] min-h-[50px]" : "max-h-0"}`,
|
|
1404
|
+
id: `${id}-div-15`
|
|
1122
1405
|
},
|
|
1123
1406
|
item.options.map((options, optionsIndex) => {
|
|
1124
1407
|
const subMenuKey = `menu-${index}-option-${optionsIndex}`;
|
|
1125
1408
|
const isSubMenuOpen = isMenuOpen(subMenuKey);
|
|
1126
1409
|
const isSubActive = activeMenuPath === subMenuKey || (activeMenuPath == null ? void 0 : activeMenuPath.startsWith(`${subMenuKey}-`));
|
|
1127
1410
|
const isDisabled = options.isDisabled;
|
|
1128
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ React14.createElement("div", { key: optionsIndex, className: "", id: `${id}-div-16-${optionsIndex}` }, /* @__PURE__ */ React14.createElement(
|
|
1129
1412
|
"div",
|
|
1130
1413
|
{
|
|
1131
1414
|
className: `group flex items-center gap-3 py-2 px-3 ml-4 mr-2 rounded-md transition-colors duration-200 ${isDisabled ? "cursor-not-allowed opacity-70 text-gray-400 dark:text-gray-500" : `hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-600 dark:text-[#a1a1aa] cursor-pointer ${isSubActive ? "bg-[#f4f4f5] dark:bg-[#27272a]" : ""}`}`,
|
|
@@ -1135,30 +1418,34 @@ var AppSideBar = ({
|
|
|
1135
1418
|
return;
|
|
1136
1419
|
}
|
|
1137
1420
|
handleSubMenuClick(options, optionsIndex, index, e);
|
|
1138
|
-
}
|
|
1421
|
+
},
|
|
1422
|
+
id: `${id}-div-17-${optionsIndex}`
|
|
1139
1423
|
},
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
options.isDropDown && /* @__PURE__ */
|
|
1424
|
+
/* @__PURE__ */ React14.createElement("div", { id: `${id}-div-18-${optionsIndex}` }),
|
|
1425
|
+
/* @__PURE__ */ React14.createElement("span", { className: `!font-medium !text-[15px] ${isDisabled ? "!text-[#3f3f46cc] dark:!text-[#a1a1aa]" : "!text-[#3f3f46cc] dark:!text-[#a1a1aa]"}`, id: `${id}-span-2-${optionsIndex}` }, options.label),
|
|
1426
|
+
options.isDropDown && /* @__PURE__ */ React14.createElement(
|
|
1143
1427
|
"div",
|
|
1144
1428
|
{
|
|
1145
|
-
className: `ml-auto transition-all delay-75 ${isSubMenuOpen ? "rotate-180" : ""}
|
|
1429
|
+
className: `ml-auto transition-all delay-75 ${isSubMenuOpen ? "rotate-180" : ""}`,
|
|
1430
|
+
id: `${id}-div-19-${optionsIndex}`
|
|
1146
1431
|
},
|
|
1147
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ React14.createElement(ChevronDown3, { width: 18, height: 18, className: "text-gray-400 dark:text-gray-500" })
|
|
1148
1433
|
)
|
|
1149
|
-
), options.options && options.options.length > 0 && /* @__PURE__ */
|
|
1434
|
+
), options.options && options.options.length > 0 && /* @__PURE__ */ React14.createElement(
|
|
1150
1435
|
"div",
|
|
1151
1436
|
{
|
|
1152
|
-
className: `ml-[20px] overflow-hidden flex flex-col transition-all duration-200 ${isSubMenuOpen ? "max-h-[1000px] min-h-[50px]" : "max-h-0"}
|
|
1437
|
+
className: `ml-[20px] overflow-hidden flex flex-col transition-all duration-200 ${isSubMenuOpen ? "max-h-[1000px] min-h-[50px]" : "max-h-0"}`,
|
|
1438
|
+
id: `${id}-div-20-${optionsIndex}`
|
|
1153
1439
|
},
|
|
1154
1440
|
options.options.map((subOption, subIndex) => {
|
|
1155
1441
|
const isSubSubActive = activeMenuPath === `menu-${index}-option-${optionsIndex}-sub-${subOption.label}`;
|
|
1156
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1157
1443
|
"div",
|
|
1158
1444
|
{
|
|
1159
1445
|
key: subIndex,
|
|
1160
1446
|
className: `py-1.5 px-3 rounded-md hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] text-gray-500 dark:text-[#71717a] font-medium text-base cursor-pointer ml-8 mr-2 transition-colors duration-200 ${isSubSubActive ? "bg-[#f4f4f5] dark:bg-[#27272a]" : ""}`,
|
|
1161
|
-
onClick: (e) => handleSubSubMenuClick(subOption, index, optionsIndex, e)
|
|
1447
|
+
onClick: (e) => handleSubSubMenuClick(subOption, index, optionsIndex, e),
|
|
1448
|
+
id: `${id}-div-21-${subIndex}`
|
|
1162
1449
|
},
|
|
1163
1450
|
subOption.label
|
|
1164
1451
|
);
|
|
@@ -1167,22 +1454,58 @@ var AppSideBar = ({
|
|
|
1167
1454
|
})
|
|
1168
1455
|
));
|
|
1169
1456
|
}))),
|
|
1170
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ React14.createElement("div", { ref: profileCardRef, className: "relative mt-auto bg-[#fafafa] dark:bg-[#18181b] sticky bottom-0 mt-2", id: `${id}-div-22` }, /* @__PURE__ */ React14.createElement(
|
|
1171
1458
|
"div",
|
|
1172
1459
|
{
|
|
1173
|
-
className: "flex items-center justify-between p-2 rounded-lg hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] cursor-pointer transition-colors duration-200",
|
|
1174
|
-
onClick: () =>
|
|
1460
|
+
className: "group flex items-center justify-between p-2 rounded-lg hover:bg-[#f4f4f5] dark:hover:bg-[#27272a] cursor-pointer transition-colors duration-200",
|
|
1461
|
+
onClick: () => setIsSwitchProfileOpen((prev) => !prev),
|
|
1462
|
+
id: `${id}-div-23`
|
|
1463
|
+
},
|
|
1464
|
+
/* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-3", id: `${id}-div-24` }, /* @__PURE__ */ React14.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10", id: `${id}-span-3` }, /* @__PURE__ */ React14.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white", id: `${id}-span-4` }, cookieUserName ? cookieUserName.split("")[0] : "A")), /* @__PURE__ */ React14.createElement("div", { id: `${id}-div-25` }, /* @__PURE__ */ React14.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]", id: `${id}-p-1` }, cookieUserName ? cookieUserName : "Admin"), /* @__PURE__ */ React14.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]", id: `${id}-p-2` }, SCOPE_LABELS[scope] ?? scope))),
|
|
1465
|
+
/* @__PURE__ */ React14.createElement(
|
|
1466
|
+
"span",
|
|
1467
|
+
{
|
|
1468
|
+
className: "opacity-0 group-hover:opacity-100 transition-opacity duration-200 !text-[14px] !font-bold text-blue-600 dark:text-blue-400 hover:underline",
|
|
1469
|
+
id: `${id}-span-switch`
|
|
1470
|
+
},
|
|
1471
|
+
"Switch"
|
|
1472
|
+
)
|
|
1473
|
+
), /* @__PURE__ */ React14.createElement(
|
|
1474
|
+
SwitchProfileSection,
|
|
1475
|
+
{
|
|
1476
|
+
id: `${id}-switch-profile`,
|
|
1477
|
+
open: isSwitchProfileOpen,
|
|
1478
|
+
anchorRef: profileCardRef,
|
|
1479
|
+
onClose: () => setIsSwitchProfileOpen(false),
|
|
1480
|
+
onManageProfile: () => {
|
|
1481
|
+
setIsSwitchProfileOpen(false);
|
|
1175
1482
|
window.location.href = "/profile";
|
|
1483
|
+
},
|
|
1484
|
+
onProfileSwitch: (profile) => {
|
|
1485
|
+
setIsSwitchProfileOpen(false);
|
|
1486
|
+
onProfileSwitch == null ? void 0 : onProfileSwitch(profile);
|
|
1487
|
+
},
|
|
1488
|
+
onTmcSettings: () => {
|
|
1489
|
+
setIsSwitchProfileOpen(false);
|
|
1490
|
+
onTmcSettings == null ? void 0 : onTmcSettings();
|
|
1491
|
+
},
|
|
1492
|
+
onLogout: () => {
|
|
1493
|
+
setIsSwitchProfileOpen(false);
|
|
1494
|
+
if (onLogout) {
|
|
1495
|
+
onLogout();
|
|
1496
|
+
} else {
|
|
1497
|
+
window.dispatchEvent(new Event("logout"));
|
|
1498
|
+
}
|
|
1176
1499
|
}
|
|
1177
|
-
}
|
|
1178
|
-
/* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React12.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, cookieUserName ? cookieUserName.split("")[0] : "A")), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]" }, cookieUserName ? cookieUserName : "Admin"), /* @__PURE__ */ React12.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]" }, SCOPE_LABELS[scope] ?? scope)))
|
|
1500
|
+
}
|
|
1179
1501
|
))
|
|
1180
1502
|
));
|
|
1181
1503
|
};
|
|
1182
1504
|
|
|
1183
1505
|
// src/RightSheet/RightSheet.jsx
|
|
1184
|
-
import
|
|
1506
|
+
import React15, { useEffect as useEffect2, useState as useState5 } from "react";
|
|
1185
1507
|
var RightSheet = ({
|
|
1508
|
+
id = "right-sheet",
|
|
1186
1509
|
open,
|
|
1187
1510
|
setOpen,
|
|
1188
1511
|
children,
|
|
@@ -1191,7 +1514,7 @@ var RightSheet = ({
|
|
|
1191
1514
|
onAction = () => {
|
|
1192
1515
|
}
|
|
1193
1516
|
}) => {
|
|
1194
|
-
const [visible, setVisible] =
|
|
1517
|
+
const [visible, setVisible] = useState5(open);
|
|
1195
1518
|
useEffect2(() => {
|
|
1196
1519
|
if (open) {
|
|
1197
1520
|
document.body.style.overflow = "hidden";
|
|
@@ -1213,65 +1536,72 @@ var RightSheet = ({
|
|
|
1213
1536
|
handleClose();
|
|
1214
1537
|
};
|
|
1215
1538
|
if (!visible) return null;
|
|
1216
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1217
1540
|
"div",
|
|
1218
1541
|
{
|
|
1219
1542
|
className: "fixed inset-0 overflow-x-hidden bg-black/80 sheetPopIn h-full overflow-auto ",
|
|
1220
|
-
onClick: handleClose
|
|
1543
|
+
onClick: handleClose,
|
|
1544
|
+
id: `${id}-div-1`
|
|
1221
1545
|
},
|
|
1222
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ React15.createElement(
|
|
1223
1547
|
"div",
|
|
1224
1548
|
{
|
|
1225
1549
|
className: `absolute flex flex-col right-0 top-0 min-h-full min-w-[100%] md:min-w-[576px]
|
|
1226
1550
|
${visible ? "sheetRightSlide" : "transition-all duration-200 translate-x-[100%]"} justify-between bg-[#fff] dark:bg-[#18181b] dark:text-white`,
|
|
1227
|
-
onClick: (e) => e.stopPropagation()
|
|
1551
|
+
onClick: (e) => e.stopPropagation(),
|
|
1552
|
+
id: `${id}-div-2`
|
|
1228
1553
|
},
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ React15.createElement("div", { className: " min-h-full ", id: `${id}-div-3` }, children),
|
|
1555
|
+
/* @__PURE__ */ React15.createElement("div", { className: "h-[90px] flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 border-t sticky bottom-0 bg-white border-[#e6e6e6] dark:border-[#303036] dark:bg-[#18181b] dark:text-white", id: `${id}-div-4` }, /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: () => handleClose(), id: `${id}-custom-button-1` }, "Cancel"), /* @__PURE__ */ React15.createElement(CustomButton, { variant: "SECONDARY", onClick: handleAction, id: `${id}-custom-button-2` }, actionLabel))
|
|
1231
1556
|
)
|
|
1232
1557
|
);
|
|
1233
1558
|
};
|
|
1234
1559
|
|
|
1235
1560
|
// src/Table/CustomTable.jsx
|
|
1236
|
-
import
|
|
1561
|
+
import React16 from "react";
|
|
1237
1562
|
var CustomTable = ({
|
|
1563
|
+
id = "custom-table",
|
|
1238
1564
|
tableHeader,
|
|
1239
1565
|
setIsAllChecked,
|
|
1240
1566
|
isAllChecked,
|
|
1241
1567
|
children,
|
|
1242
1568
|
isHideCheckbox = "false"
|
|
1243
1569
|
}) => {
|
|
1244
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ React16.createElement("div", { className: "border border-[#e5e5e5] dark:border-[#303036] rounded-lg overflow-x-auto", id: `${id}-div-1` }, /* @__PURE__ */ React16.createElement("div", { className: "w-full relative overflow-x-auto", id: `${id}-div-2` }, /* @__PURE__ */ React16.createElement("table", { className: "w-full caption-bottom text-sm overflow-x-auto bg-white dark:bg-[#18181b] table-fixed border-collapse", id: `${id}-table-1` }, /* @__PURE__ */ React16.createElement("thead", { className: "border-b border-[#e5e5e5] dark:border-[#303036] dark:bg-[#18181b]", id: `${id}-thead-1` }, /* @__PURE__ */ React16.createElement(
|
|
1245
1571
|
"tr",
|
|
1246
1572
|
{
|
|
1247
|
-
className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted"
|
|
1573
|
+
className: "transition-colors text-[#737373] hover:bg-muted/50 \r\n data-[state=selected]:bg-muted",
|
|
1574
|
+
id: `${id}-tr-1`
|
|
1248
1575
|
},
|
|
1249
|
-
!isHideCheckbox && /* @__PURE__ */
|
|
1576
|
+
!isHideCheckbox && /* @__PURE__ */ React16.createElement("th", { className: "px-4 py-3 text-left w-[50px]", id: `${id}-th-1` }, /* @__PURE__ */ React16.createElement(
|
|
1250
1577
|
CustomCheckbox,
|
|
1251
1578
|
{
|
|
1252
1579
|
checked: isAllChecked,
|
|
1253
1580
|
onChange: () => {
|
|
1254
1581
|
setIsAllChecked(!isAllChecked);
|
|
1255
|
-
}
|
|
1582
|
+
},
|
|
1583
|
+
id: `${id}-custom-checkbox-1`
|
|
1256
1584
|
}
|
|
1257
1585
|
)),
|
|
1258
1586
|
tableHeader.map((header, index) => {
|
|
1259
|
-
return /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1260
1588
|
"th",
|
|
1261
1589
|
{
|
|
1262
1590
|
className: `text-[#737373] px-4 py-3 text-sm dark:bg-[#18181b] font-medium ${index == tableHeader.length - 1 ? "text-right" : "text-left"}`,
|
|
1263
|
-
key: header + index
|
|
1591
|
+
key: header + index,
|
|
1592
|
+
id: `${id}-th-2-${index}`
|
|
1264
1593
|
},
|
|
1265
1594
|
header
|
|
1266
1595
|
);
|
|
1267
1596
|
})
|
|
1268
|
-
)), /* @__PURE__ */
|
|
1597
|
+
)), /* @__PURE__ */ React16.createElement("tbody", { id: `${id}-tbody-1` }, children))));
|
|
1269
1598
|
};
|
|
1270
1599
|
|
|
1271
1600
|
// src/Pagination/Pagination.jsx
|
|
1272
|
-
import
|
|
1601
|
+
import React17, { useMemo, useState as useState6, useEffect as useEffect3 } from "react";
|
|
1273
1602
|
import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
1274
1603
|
var Pagination = ({
|
|
1604
|
+
id = "pagination",
|
|
1275
1605
|
data = [],
|
|
1276
1606
|
component: Component,
|
|
1277
1607
|
itemsPerPage = 6,
|
|
@@ -1293,8 +1623,8 @@ var Pagination = ({
|
|
|
1293
1623
|
componentProps = {},
|
|
1294
1624
|
...restProps
|
|
1295
1625
|
}) => {
|
|
1296
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
1297
|
-
const [internalItemsPerPage, setInternalItemsPerPage] =
|
|
1626
|
+
const [internalCurrentPage, setInternalCurrentPage] = useState6(1);
|
|
1627
|
+
const [internalItemsPerPage, setInternalItemsPerPage] = useState6(itemsPerPage);
|
|
1298
1628
|
const isControlled = controlledCurrentPage !== void 0;
|
|
1299
1629
|
const isItemsPerPageControlled = controlledOnItemsPerPageChange !== void 0;
|
|
1300
1630
|
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
@@ -1345,46 +1675,50 @@ var Pagination = ({
|
|
|
1345
1675
|
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
1346
1676
|
const renderContent = () => {
|
|
1347
1677
|
if (Component) {
|
|
1348
|
-
if (
|
|
1678
|
+
if (React17.isValidElement(Component)) {
|
|
1349
1679
|
const ComponentType = Component.type;
|
|
1350
1680
|
const elementProps = Component.props;
|
|
1351
1681
|
if (isTable) {
|
|
1352
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1353
1683
|
CustomTable,
|
|
1354
1684
|
{
|
|
1355
1685
|
tableHeader,
|
|
1356
|
-
isHideCheckbox
|
|
1686
|
+
isHideCheckbox,
|
|
1687
|
+
id: `${id}-custom-table-1`
|
|
1357
1688
|
},
|
|
1358
1689
|
data.map((item, index) => {
|
|
1359
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1360
1691
|
ComponentType,
|
|
1361
1692
|
{
|
|
1362
1693
|
key: item.id || item._id || index,
|
|
1363
1694
|
data: item,
|
|
1364
1695
|
...elementProps,
|
|
1365
1696
|
...componentProps,
|
|
1366
|
-
...restProps
|
|
1697
|
+
...restProps,
|
|
1698
|
+
id: `${id}-component-type-1-${index}`
|
|
1367
1699
|
}
|
|
1368
1700
|
);
|
|
1369
1701
|
})
|
|
1370
1702
|
);
|
|
1371
1703
|
} else {
|
|
1372
1704
|
if (isTable) {
|
|
1373
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1374
1706
|
CustomTable,
|
|
1375
1707
|
{
|
|
1376
1708
|
tableHeader,
|
|
1377
|
-
isHideCheckbox
|
|
1709
|
+
isHideCheckbox,
|
|
1710
|
+
id: `${id}-custom-table-2`
|
|
1378
1711
|
},
|
|
1379
1712
|
paginatedData.map((item, index) => {
|
|
1380
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1381
1714
|
ComponentType,
|
|
1382
1715
|
{
|
|
1383
1716
|
key: item.id || item._id || index,
|
|
1384
1717
|
data: item,
|
|
1385
1718
|
...elementProps,
|
|
1386
1719
|
...componentProps,
|
|
1387
|
-
...restProps
|
|
1720
|
+
...restProps,
|
|
1721
|
+
id: `${id}-component-type-2-${index}`
|
|
1388
1722
|
}
|
|
1389
1723
|
);
|
|
1390
1724
|
})
|
|
@@ -1392,20 +1726,22 @@ var Pagination = ({
|
|
|
1392
1726
|
}
|
|
1393
1727
|
}
|
|
1394
1728
|
} else {
|
|
1395
|
-
return /* @__PURE__ */
|
|
1729
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1396
1730
|
CustomTable,
|
|
1397
1731
|
{
|
|
1398
1732
|
tableHeader,
|
|
1399
|
-
isHideCheckbox
|
|
1733
|
+
isHideCheckbox,
|
|
1734
|
+
id: `${id}-custom-table-3`
|
|
1400
1735
|
},
|
|
1401
1736
|
paginatedData.map((item, index) => {
|
|
1402
|
-
return /* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1403
1738
|
Component,
|
|
1404
1739
|
{
|
|
1405
1740
|
key: item.id || item._id || index,
|
|
1406
1741
|
data: item,
|
|
1407
1742
|
...componentProps,
|
|
1408
|
-
...restProps
|
|
1743
|
+
...restProps,
|
|
1744
|
+
id: `${id}-component-1-${index}`
|
|
1409
1745
|
}
|
|
1410
1746
|
);
|
|
1411
1747
|
})
|
|
@@ -1414,50 +1750,55 @@ var Pagination = ({
|
|
|
1414
1750
|
}
|
|
1415
1751
|
return null;
|
|
1416
1752
|
};
|
|
1417
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(React17.Fragment, null, renderContent()), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ React17.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ React17.createElement(
|
|
1418
1754
|
"button",
|
|
1419
1755
|
{
|
|
1420
1756
|
onClick: () => handlePageChange(1),
|
|
1421
1757
|
disabled: currentPage === 1,
|
|
1422
1758
|
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === 1 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
1423
|
-
title: "First page"
|
|
1759
|
+
title: "First page",
|
|
1760
|
+
id: `${id}-button-1`
|
|
1424
1761
|
},
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
), /* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ React17.createElement(ChevronsLeft, { size: 16 })
|
|
1763
|
+
), /* @__PURE__ */ React17.createElement(
|
|
1427
1764
|
"button",
|
|
1428
1765
|
{
|
|
1429
1766
|
onClick: () => handlePageChange(currentPage - 1),
|
|
1430
1767
|
disabled: currentPage === 1,
|
|
1431
1768
|
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === 1 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
1432
|
-
title: "Previous page"
|
|
1769
|
+
title: "Previous page",
|
|
1770
|
+
id: `${id}-button-2`
|
|
1433
1771
|
},
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
), getPageNumbers().map((pageNum) => /* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ React17.createElement(ChevronLeft, { size: 16 })
|
|
1773
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ React17.createElement(
|
|
1436
1774
|
"button",
|
|
1437
1775
|
{
|
|
1438
1776
|
key: pageNum,
|
|
1439
1777
|
onClick: () => handlePageChange(pageNum),
|
|
1440
|
-
className: `flex items-center justify-center min-w-9 h-9 px-3 cursor-pointer rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}
|
|
1778
|
+
className: `flex items-center justify-center min-w-9 h-9 px-3 cursor-pointer rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
1779
|
+
id: `${id}-button-3`
|
|
1441
1780
|
},
|
|
1442
1781
|
pageNum
|
|
1443
|
-
)), /* @__PURE__ */
|
|
1782
|
+
)), /* @__PURE__ */ React17.createElement(
|
|
1444
1783
|
"button",
|
|
1445
1784
|
{
|
|
1446
1785
|
onClick: () => handlePageChange(currentPage + 1),
|
|
1447
1786
|
disabled: currentPage === calculatedTotalPages || calculatedTotalPages === 0,
|
|
1448
1787
|
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === calculatedTotalPages || calculatedTotalPages === 0 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
1449
|
-
title: "Next page"
|
|
1788
|
+
title: "Next page",
|
|
1789
|
+
id: `${id}-button-4`
|
|
1450
1790
|
},
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
), /* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ React17.createElement(ChevronRight, { size: 16 })
|
|
1792
|
+
), /* @__PURE__ */ React17.createElement(
|
|
1453
1793
|
"button",
|
|
1454
1794
|
{
|
|
1455
1795
|
onClick: () => handlePageChange(calculatedTotalPages),
|
|
1456
1796
|
disabled: currentPage === calculatedTotalPages || calculatedTotalPages === 0,
|
|
1457
1797
|
className: `flex items-center justify-center w-9 h-9 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === calculatedTotalPages || calculatedTotalPages === 0 ? "bg-gray-100 text-gray-400 cursor-not-allowed dark:bg-[#27272a] dark:text-gray-600" : "bg-white text-black hover:bg-gray-50 cursor-pointer dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`,
|
|
1458
|
-
title: "Last page"
|
|
1798
|
+
title: "Last page",
|
|
1799
|
+
id: `${id}-button-5`
|
|
1459
1800
|
},
|
|
1460
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ React17.createElement(ChevronsRight, { size: 16 })
|
|
1461
1802
|
))));
|
|
1462
1803
|
};
|
|
1463
1804
|
export {
|