@beweco/aurora-ui 0.1.5 → 0.1.7

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.
Files changed (78) hide show
  1. package/dist/assets/css/styles.css +1 -1
  2. package/dist/index.cjs.js +2054 -1486
  3. package/dist/index.esm.js +2051 -1490
  4. package/dist/types/components/analytics-card/AnalyticsCard.d.ts +10 -0
  5. package/dist/types/components/analytics-card/AnalyticsCard.d.ts.map +1 -0
  6. package/dist/types/components/analytics-card/AnalyticsCard.types.d.ts +65 -0
  7. package/dist/types/components/analytics-card/AnalyticsCard.types.d.ts.map +1 -0
  8. package/dist/types/components/analytics-card/index.d.ts +3 -0
  9. package/dist/types/components/analytics-card/index.d.ts.map +1 -0
  10. package/dist/types/components/autocomplete/index.d.ts +1 -1
  11. package/dist/types/components/autocomplete/index.d.ts.map +1 -1
  12. package/dist/types/components/button/index.d.ts +2 -2
  13. package/dist/types/components/button/index.d.ts.map +1 -1
  14. package/dist/types/components/copy-text/CopyText.d.ts +12 -0
  15. package/dist/types/components/copy-text/CopyText.d.ts.map +1 -0
  16. package/dist/types/components/copy-text/CopyText.types.d.ts +8 -0
  17. package/dist/types/components/copy-text/CopyText.types.d.ts.map +1 -0
  18. package/dist/types/components/copy-text/index.d.ts +3 -0
  19. package/dist/types/components/copy-text/index.d.ts.map +1 -0
  20. package/dist/types/components/datepicker/index.d.ts +2 -2
  21. package/dist/types/components/datepicker/index.d.ts.map +1 -1
  22. package/dist/types/components/daterangepicker/DateRangePicker.d.ts +0 -1
  23. package/dist/types/components/daterangepicker/DateRangePicker.d.ts.map +1 -1
  24. package/dist/types/components/daterangepicker/index.d.ts +2 -2
  25. package/dist/types/components/daterangepicker/index.d.ts.map +1 -1
  26. package/dist/types/components/h1/H1.d.ts +3 -0
  27. package/dist/types/components/h1/H1.d.ts.map +1 -0
  28. package/dist/types/components/h1/index.d.ts +2 -0
  29. package/dist/types/components/h1/index.d.ts.map +1 -0
  30. package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts +3 -0
  31. package/dist/types/components/multi-step-wizard/MultiStepWizard.d.ts.map +1 -0
  32. package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts +20 -0
  33. package/dist/types/components/multi-step-wizard/MultiStepWizard.types.d.ts.map +1 -0
  34. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.d.ts +4 -0
  35. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.d.ts.map +1 -0
  36. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts +13 -0
  37. package/dist/types/components/multi-step-wizard/_internal/MultiStepSidebar.types.d.ts.map +1 -0
  38. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.d.ts +4 -0
  39. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.d.ts.map +1 -0
  40. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.types.d.ts +8 -0
  41. package/dist/types/components/multi-step-wizard/_internal/MultistepNavigationButtons.types.d.ts.map +1 -0
  42. package/dist/types/components/multi-step-wizard/_internal/index.d.ts +3 -0
  43. package/dist/types/components/multi-step-wizard/_internal/index.d.ts.map +1 -0
  44. package/dist/types/components/multi-step-wizard/index.d.ts +3 -0
  45. package/dist/types/components/multi-step-wizard/index.d.ts.map +1 -0
  46. package/dist/types/components/phone/Phone.d.ts.map +1 -1
  47. package/dist/types/components/phone/Phone.types.d.ts +13 -2
  48. package/dist/types/components/phone/Phone.types.d.ts.map +1 -1
  49. package/dist/types/components/phone/phone.constants.d.ts +13 -0
  50. package/dist/types/components/phone/phone.constants.d.ts.map +1 -0
  51. package/dist/types/components/promotional-banner/PromotionalBanner.d.ts +7 -0
  52. package/dist/types/components/promotional-banner/PromotionalBanner.d.ts.map +1 -0
  53. package/dist/types/components/promotional-banner/PromotionalBanner.types.d.ts +69 -0
  54. package/dist/types/components/promotional-banner/PromotionalBanner.types.d.ts.map +1 -0
  55. package/dist/types/components/promotional-banner/index.d.ts +3 -0
  56. package/dist/types/components/promotional-banner/index.d.ts.map +1 -0
  57. package/dist/types/components/row-steps/RowSteps.d.ts +4 -0
  58. package/dist/types/components/row-steps/RowSteps.d.ts.map +1 -0
  59. package/dist/types/components/row-steps/RowSteps.types.d.ts +21 -0
  60. package/dist/types/components/row-steps/RowSteps.types.d.ts.map +1 -0
  61. package/dist/types/components/row-steps/index.d.ts +3 -0
  62. package/dist/types/components/row-steps/index.d.ts.map +1 -0
  63. package/dist/types/components/step-indicator/StepIndicator.d.ts +4 -0
  64. package/dist/types/components/step-indicator/StepIndicator.d.ts.map +1 -0
  65. package/dist/types/components/step-indicator/StepIndicator.types.d.ts +14 -0
  66. package/dist/types/components/step-indicator/StepIndicator.types.d.ts.map +1 -0
  67. package/dist/types/components/step-indicator/index.d.ts +3 -0
  68. package/dist/types/components/step-indicator/index.d.ts.map +1 -0
  69. package/dist/types/components/theme-picker/ThemePicker.d.ts.map +1 -1
  70. package/dist/types/components/vertical-steps/VerticalSteps.d.ts +4 -0
  71. package/dist/types/components/vertical-steps/VerticalSteps.d.ts.map +1 -0
  72. package/dist/types/components/vertical-steps/VerticalSteps.types.d.ts +57 -0
  73. package/dist/types/components/vertical-steps/VerticalSteps.types.d.ts.map +1 -0
  74. package/dist/types/components/vertical-steps/index.d.ts +3 -0
  75. package/dist/types/components/vertical-steps/index.d.ts.map +1 -0
  76. package/dist/types/index.d.ts +18 -11
  77. package/dist/types/index.d.ts.map +1 -1
  78. package/package.json +4 -2
package/dist/index.cjs.js CHANGED
@@ -4,6 +4,9 @@ var react = require('@heroui/react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
6
  var react$1 = require('@iconify/react');
7
+ var recharts = require('recharts');
8
+ var framerMotion = require('framer-motion');
9
+ var reactDom = require('react-dom');
7
10
  var useTheme = require('@heroui/use-theme');
8
11
 
9
12
  /******************************************************************************
@@ -61,25 +64,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
61
64
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
62
65
  };
63
66
 
64
- /**
65
- * AutoComplete genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
66
- *
67
- * Reglas aplicadas:
68
- * - Variant: Bordered (por defecto)
69
- * - Radius: md (por defecto)
70
- * - labelPlacement: Outside
71
- * - Size: sm, md, lg (configurable)
72
- */
73
- var AutoComplete = function (_a) {
74
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest(_a, ["label", "id", "size", "variant", "radius"]);
75
- var generatedId = React.useId();
76
- var autoId = id || generatedId;
77
- return (jsxRuntime.jsxs("div", { children: [label && (jsxRuntime.jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsxRuntime.jsx(react.Autocomplete, __assign({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
78
- base: "[&_[data-slot=input-wrapper][data-focus=true]]:!border-primary-500",
79
- popoverContent: "[&_li[data-hover=true]]:!bg-primary-50 [&_li[data-hover=true]]:!text-default-600 [&_li]:!text-default-500",
80
- } }))] }));
81
- };
82
-
83
67
  exports.HolidayType = void 0;
84
68
  (function (HolidayType) {
85
69
  HolidayType["SingleDay"] = "singleDay";
@@ -154,7 +138,7 @@ var Input = function (_a) {
154
138
  } })));
155
139
  };
156
140
 
157
- var defaultTranslations$3 = {
141
+ var defaultTranslations$6 = {
158
142
  addHolidayTitle: "Add holiday",
159
143
  dayOption: "Day",
160
144
  dateRangeOption: "Date range",
@@ -178,7 +162,7 @@ var INITIAL_HOLIDAY_STATE = {
178
162
  */
179
163
  var AddHolidayForm = function (_a) {
180
164
  var onAddHoliday = _a.onAddHoliday, translations = _a.translations, className = _a.className, radioGroupProps = _a.radioGroupProps, dateRangePickerProps = _a.dateRangePickerProps, buttonProps = _a.buttonProps;
181
- var t = __assign(__assign({}, defaultTranslations$3), translations);
165
+ var t = __assign(__assign({}, defaultTranslations$6), translations);
182
166
  var _b = React.useState(INITIAL_HOLIDAY_STATE), newHoliday = _b[0], setNewHoliday = _b[1];
183
167
  /**
184
168
  * A boolean flag that determines if a date has been set.
@@ -238,1243 +222,176 @@ var AddHolidayForm = function (_a) {
238
222
  }, "aria-label": t.optionalTitle }), jsxRuntime.jsx("div", { className: "w-full", children: jsxRuntime.jsx(Button, __assign({ size: "sm", fullWidth: true, variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), onPress: handleAddHoliday, isDisabled: !isDateSet }, buttonProps, { children: t.addButton })) })] }));
239
223
  };
240
224
 
241
- function normalizeClass(value) {
242
- if (typeof value === "string") {
243
- return value || undefined;
225
+ var H2 = function (_a) {
226
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
227
+ return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-medium", className) }, props, { children: children })));
228
+ };
229
+
230
+ var P = function (_a) {
231
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
232
+ return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500", className) }, props, { children: children })));
233
+ };
234
+
235
+ var defaultTranslations$5 = {
236
+ title: "Analytics",
237
+ description: "Monthly growth of your metrics during the selected period",
238
+ viewDetails: "View Details",
239
+ exportData: "Export Data",
240
+ setAlert: "Set Alert",
241
+ months6: "6 Months",
242
+ months3: "3 Months",
243
+ days30: "30 Days",
244
+ days7: "7 Days",
245
+ hours24: "24 Hours",
246
+ };
247
+ var formatValue = function (value, type) {
248
+ if (type === "number") {
249
+ if (value >= 1000000) {
250
+ return "".concat((value / 1000000).toFixed(1), "M");
251
+ }
252
+ if (value >= 1000) {
253
+ return "".concat((value / 1000).toFixed(0), "k");
254
+ }
255
+ return value.toLocaleString();
244
256
  }
245
- if (Array.isArray(value)) {
246
- return value.filter(Boolean).join(" ") || undefined;
257
+ if (type === "percentage") {
258
+ return "".concat(value, "%");
247
259
  }
248
- return undefined;
249
- }
250
- var getSectionClasses = function (isCollapsed, sectionClassesProp) {
251
- if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
252
- return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
253
- var k = _a[0], v = _a[1];
254
- return [k, normalizeClass(v)];
255
- }))), { base: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
256
- "p-0 max-w-[44px]": isCollapsed,
257
- })), group: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.group, {
258
- "flex flex-col gap-1": isCollapsed,
259
- })), heading: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.heading, {
260
- hidden: isCollapsed,
261
- })) }));
260
+ return value;
262
261
  };
263
- var getItemClasses = function (isCollapsed, itemClassesProp) {
264
- if (itemClassesProp === void 0) { itemClassesProp = {}; }
265
- return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
266
- var k = _a[0], v = _a[1];
267
- return [k, normalizeClass(v)];
268
- }))), { base: normalizeClass(react.cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
269
- "w-11 h-11 gap-0 p-0": isCollapsed,
270
- })) }));
262
+ var formatMonth = function (month) {
263
+ var _a;
264
+ var monthNumber = (_a = {
265
+ Jan: 0,
266
+ Feb: 1,
267
+ Mar: 2,
268
+ Apr: 3,
269
+ May: 4,
270
+ Jun: 5,
271
+ Jul: 6,
272
+ Aug: 7,
273
+ Sep: 8,
274
+ Oct: 9,
275
+ Nov: 10,
276
+ Dec: 11,
277
+ }[month]) !== null && _a !== void 0 ? _a : 0;
278
+ return new Intl.DateTimeFormat("en-US", { month: "long" }).format(new Date(2024, monthNumber, 1));
271
279
  };
272
-
273
- var EnumMenuNavListItem;
274
- (function (EnumMenuNavListItem) {
275
- EnumMenuNavListItem["Nest"] = "nest";
276
- })(EnumMenuNavListItem || (EnumMenuNavListItem = {}));
277
-
278
280
  /**
279
- * @component MenuNavList
280
- * @description A versatile navigation list component that can be displayed in an expanded or collapsed state.
281
- * It supports nested items, sections, and tooltips for items in the collapsed state.
282
- *
283
- * @param {MenuNavListProps} props - Props for configuring the component.
284
- * @param {MenuNavListItem[]} props.items - Array of items to display in the list.
285
- * @param {boolean} [props.isCollapsed] - If `true`, the menu is displayed in its collapsed state (icons only).
286
- * @param {React.Key} [props.defaultSelectedKey] - The key of the default selected item.
287
- * @param {(key: React.Key) => void} [props.onSelect] - Callback executed when an item is selected.
288
- * @param {boolean} [props.hideEndContent] - If `true`, hides the end content of the items.
289
- * @param {object} [props.sectionClasses] - CSS classes to customize the sections.
290
- * @param {object} [props.itemClasses] - CSS classes to customize the items.
291
- * @param {string} [props.iconClassName] - CSS class for the icons.
292
- * @param {object} [props.classNames] - CSS classes to customize the Listbox component.
293
- * @param {string} [props.className] - CSS class for the main container.
281
+ * AnalyticsCard genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
294
282
  *
295
- * @forwardRef
283
+ * 🚨 This component requires installing the `recharts` package:
284
+ * `npm install recharts`
296
285
  */
297
- var MenuNavList = React.forwardRef(function (_a, ref) {
298
- var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
299
- var _d = React.useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
300
- // Component styles
301
- var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
302
- var itemClasses = getItemClasses(isCollapsed, itemClassesProp);
303
- // Handles the click event on an item, updating the selection state.
304
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
305
- var handleItemPress = React.useCallback(function (item, parentKey) {
306
- var keySelected = typeof parentKey === "string" ? parentKey : item.key;
307
- setSelected(keySelected);
308
- // Force blur to remove hover state after click.
309
- if (document.activeElement instanceof HTMLElement) {
310
- document.activeElement.blur();
311
- }
312
- }, [setSelected]);
313
- // Renders the item displayed inside the Popover when the menu is collapsed.
314
- var renderCompactItem = React.useCallback(function (item, parentKey) {
315
- var _a, _b;
316
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
317
- }, [handleItemPress, iconClassName]);
318
- // Renders a nested item, i.e., an item that has sub-items.
319
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
320
- var renderNestItem = React.useCallback(function (item) {
321
- var _a, _b, _c, _d, _e, _f, _g;
322
- var isNestType = item.items &&
323
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
324
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
325
- if (isNestType) {
326
- item.href = undefined;
327
- }
328
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, classNames: {
329
- base: react.cn({
330
- "h-auto p-0": !isCollapsed && isNestType,
331
- }, {
332
- "inline-block w-11": isCollapsed && isNestType,
333
- }, {
334
- "data-[selected=true]:bg-primary-100 h-11 justify-center items-center flex": isCollapsed && isNestType,
335
- }, "rounded-large"),
336
- }, endContent: isCollapsed || isNestType || hideEndContent
337
- ? null
338
- : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
339
- isCollapsed && isNestType ? (jsxRuntime.jsxs(react.Popover, { placement: "right", offset: 10, children: [jsxRuntime.jsx(react.PopoverTrigger, { children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", classNames: {
340
- base: "text-default-500",
341
- }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsxRuntime.jsx(react.PopoverContent, { className: "p-0", children: jsxRuntime.jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsxRuntime.jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
342
- ? item.items.map(function (child) {
343
- return renderCompactItem(child, item.key);
344
- })
345
- : renderCompactItem(item) })] }) })] })) : null,
346
- !isCollapsed && isNestType ? (jsxRuntime.jsx(react.Accordion, { className: "p-0", children: jsxRuntime.jsx(react.AccordionItem, { "aria-label": item.title, classNames: {
347
- heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
348
- trigger: "p-0",
349
- content: "py-0 pl-4",
350
- }, title: item.icon ? (jsxRuntime.jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsxRuntime.jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", classNames: {
351
- list: react.cn("border-l border-default-200 pl-4"),
352
- }, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
353
- }, [isCollapsed, hideEndContent, iconClassName, items, selected]);
354
- // Renders a simple item (without children) in the navigation list.
355
- // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
356
- var renderItem = React.useCallback(function (item, parentKey) {
357
- var _a, _b, _c, _d;
358
- var isNestType = item.items &&
359
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
360
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
361
- if (isNestType) {
362
- return renderNestItem(item);
363
- }
364
- var isItemSelected = selected === item.key;
365
- return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
366
- base: "text-default-500",
367
- }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
368
- },
369
- // eslint-disable-next-line react-hooks/exhaustive-deps
370
- [isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
371
- return (jsxRuntime.jsx(react.Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: react.cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: react.cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: react.cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: react.cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
372
- var _a, _b;
373
- return item.items &&
374
- ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
375
- (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest ? (renderNestItem(item)) : item.items && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxRuntime.jsx(react.ListboxSection, { classNames: sectionClasses, showDivider: isCollapsed, title: item.title, children: item.items.map(renderItem) }, item.key)) : (renderItem(item));
376
- } }), isCollapsed ? "compact" : "default"));
377
- });
378
- MenuNavList.displayName = "MenuNavList";
286
+ var AnalyticsCard = function (_a) {
287
+ var _b, _c;
288
+ var data = _a.data, _d = _a.showTimePeriods, showTimePeriods = _d === void 0 ? true : _d, _e = _a.showDropdownMenu, showDropdownMenu = _e === void 0 ? true : _e, _f = _a.showMetricCards, showMetricCards = _f === void 0 ? true : _f, onChartChange = _a.onChartChange, onMenuAction = _a.onMenuAction, onTimePeriodChange = _a.onTimePeriodChange, _g = _a.translations, translations = _g === void 0 ? {} : _g, props = __rest(_a, ["data", "showTimePeriods", "showDropdownMenu", "showMetricCards", "onChartChange", "onMenuAction", "onTimePeriodChange", "translations"]);
289
+ var t = __assign(__assign({}, defaultTranslations$5), translations);
290
+ var _h = React.useState((_c = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : ""), activeChart = _h[0], setActiveChart = _h[1];
291
+ var activeChartData = React.useMemo(function () {
292
+ var _a;
293
+ var chart = data.find(function (d) { return d.key === activeChart; });
294
+ return {
295
+ chartData: (_a = chart === null || chart === void 0 ? void 0 : chart.chartData) !== null && _a !== void 0 ? _a : [],
296
+ color: (chart === null || chart === void 0 ? void 0 : chart.changeType) === "positive"
297
+ ? "success"
298
+ : (chart === null || chart === void 0 ? void 0 : chart.changeType) === "negative"
299
+ ? "danger"
300
+ : "default",
301
+ suffix: chart === null || chart === void 0 ? void 0 : chart.suffix,
302
+ type: chart === null || chart === void 0 ? void 0 : chart.type,
303
+ };
304
+ }, [activeChart, data]);
305
+ var chartData = activeChartData.chartData, color = activeChartData.color, suffix = activeChartData.suffix, type = activeChartData.type;
306
+ var handleChartChange = function (chartKey) {
307
+ setActiveChart(chartKey);
308
+ onChartChange === null || onChartChange === void 0 ? void 0 : onChartChange(chartKey);
309
+ };
310
+ var handleMenuAction = function (action) {
311
+ onMenuAction === null || onMenuAction === void 0 ? void 0 : onMenuAction(action);
312
+ };
313
+ var handleTimePeriodChange = function (period) {
314
+ onTimePeriodChange === null || onTimePeriodChange === void 0 ? void 0 : onTimePeriodChange(period);
315
+ };
316
+ return (jsxRuntime.jsx(react.Card, __assign({ as: "dl", className: "dark:border-default-100 border border-transparent" }, props, { children: jsxRuntime.jsxs("section", { className: "flex flex-col flex-nowrap", children: [jsxRuntime.jsx("div", { className: "flex flex-col justify-between gap-y-2 p-6", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-2", children: [jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-0", children: [jsxRuntime.jsx(H2, { children: t.title }), jsxRuntime.jsx(P, { children: t.description })] }), jsxRuntime.jsx(react.Spacer, { y: 2 }), showTimePeriods && (jsxRuntime.jsxs(react.Tabs, { size: "md", className: " self-end", onSelectionChange: function (key) { return handleTimePeriodChange(String(key)); }, children: [jsxRuntime.jsx(react.Tab, { title: t.months6 }, "6-months"), jsxRuntime.jsx(react.Tab, { title: t.months3 }, "3-months"), jsxRuntime.jsx(react.Tab, { title: t.days30 }, "30-days"), jsxRuntime.jsx(react.Tab, { title: t.days7 }, "7-days"), jsxRuntime.jsx(react.Tab, { title: t.hours24 }, "24-hours")] })), showMetricCards && (jsxRuntime.jsx("div", { className: "mt-2 flex w-full items-center", children: jsxRuntime.jsx("div", { className: "-my-3 flex w-full max-w-[800px] items-center gap-x-3 overflow-x-auto py-3", children: data.map(function (_a) {
317
+ var key = _a.key, change = _a.change, changeType = _a.changeType, type = _a.type, value = _a.value, title = _a.title;
318
+ return (jsxRuntime.jsxs("button", { type: "button", className: react.cn("rounded-medium flex w-full flex-col gap-2 p-3 transition-colors", {
319
+ "bg-default-100": activeChart === key,
320
+ }), onClick: function () { return handleChartChange(key); }, children: [jsxRuntime.jsx("span", { className: react.cn("text-small text-default-500 font-medium transition-colors", {
321
+ "text-primary": activeChart === key,
322
+ }), children: title }), jsxRuntime.jsxs("div", { className: "flex items-center gap-x-3", children: [jsxRuntime.jsx("span", { className: "text-foreground text-2xl font-bold", children: formatValue(value, type) }), jsxRuntime.jsx(react.Chip, { classNames: {
323
+ content: "font-medium",
324
+ }, color: changeType === "positive"
325
+ ? "success"
326
+ : changeType === "negative"
327
+ ? "danger"
328
+ : "default", radius: "md", size: "sm", startContent: changeType === "positive" ? (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-up-linear", size: "sm" })) : changeType === "negative" ? (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-down-linear", size: "sm" })) : (jsxRuntime.jsx(IconComponent, { icon: "solar:arrow-right-linear", size: "sm" })), variant: "bordered", children: jsxRuntime.jsx("span", { children: change }) })] })] }, key));
329
+ }) }) }))] }) }), jsxRuntime.jsx(recharts.ResponsiveContainer, { className: "min-h-[300px] [&_.recharts-surface]:outline-hidden", height: "100%", width: "100%", children: jsxRuntime.jsxs(recharts.AreaChart, { accessibilityLayer: true, data: chartData, height: 300, margin: {
330
+ left: 0,
331
+ right: 0,
332
+ }, width: 500, children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsxs("linearGradient", { id: "colorGradient", x1: "0", x2: "0", y1: "0", y2: "1", children: [jsxRuntime.jsx("stop", { offset: "10%", stopColor: "hsl(var(--heroui-".concat(color, "-500))"), stopOpacity: 0.3 }), jsxRuntime.jsx("stop", { offset: "100%", stopColor: "hsl(var(--heroui-".concat(color, "-100))"), stopOpacity: 0.1 })] }) }), jsxRuntime.jsx(recharts.CartesianGrid, { horizontalCoordinatesGenerator: function () { return [200, 150, 100, 50]; }, stroke: "hsl(var(--heroui-default-200))", strokeDasharray: "3 3", vertical: false }), jsxRuntime.jsx(recharts.XAxis, { axisLine: false, dataKey: "month", style: {
333
+ fontSize: "var(--heroui-font-size-tiny)",
334
+ transform: "translateX(-40px)",
335
+ }, tickLine: false }), jsxRuntime.jsx(recharts.Tooltip, { content: function (_a) {
336
+ var label = _a.label, payload = _a.payload;
337
+ return (jsxRuntime.jsx("div", { className: "rounded-medium bg-foreground text-tiny shadow-small flex h-auto min-w-[120px] items-center gap-x-2 p-2", children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col gap-y-0", children: [payload === null || payload === void 0 ? void 0 : payload.map(function (p, index) {
338
+ var name = p.name;
339
+ var value = p.value;
340
+ return (jsxRuntime.jsx("div", { className: "flex w-full items-center gap-x-2", children: jsxRuntime.jsxs("div", { className: "text-small text-background flex w-full items-center gap-x-1", children: [jsxRuntime.jsx("span", { children: formatValue(value, type) }), jsxRuntime.jsx("span", { children: suffix })] }) }, "".concat(index, "-").concat(name)));
341
+ }), jsxRuntime.jsxs("span", { className: "text-small text-foreground-400 font-medium", children: [formatMonth(String(label || "")), " 25, 2024"] })] }) }));
342
+ }, cursor: {
343
+ strokeWidth: 0,
344
+ } }), jsxRuntime.jsx(recharts.Area, { activeDot: {
345
+ stroke: "hsl(var(--heroui-".concat(color, "))"),
346
+ strokeWidth: 2,
347
+ fill: "hsl(var(--heroui-background))",
348
+ r: 5,
349
+ }, dot: {
350
+ stroke: "hsl(var(--heroui-".concat(color, "))"),
351
+ strokeWidth: 2,
352
+ fill: "hsl(var(--heroui-".concat(color, "))"),
353
+ r: 4,
354
+ }, animationDuration: 1000, animationEasing: "ease", dataKey: "value", fill: "url(#colorGradient)", stroke: "hsl(var(--heroui-".concat(color, "))"), strokeWidth: 2, type: "monotone" })] }) }), showDropdownMenu && (jsxRuntime.jsxs(react.Dropdown, { classNames: {
355
+ content: "min-w-[120px]",
356
+ }, placement: "bottom-end", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, className: "absolute top-2 right-2 w-auto rounded-full", size: "lg", variant: "bordered", children: jsxRuntime.jsx(IconComponent, { icon: "solar:menu-dots-bold", size: "sm" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { itemClasses: {
357
+ title: "text-tiny",
358
+ }, variant: "bordered", onAction: function (key) { return handleMenuAction(String(key)); }, children: [jsxRuntime.jsx(react.DropdownItem, { children: t.viewDetails }, "view-details"), jsxRuntime.jsx(react.DropdownItem, { children: t.exportData }, "export-data"), jsxRuntime.jsx(react.DropdownItem, { children: t.setAlert }, "set-alert")] })] }))] }) })));
359
+ };
379
360
 
380
361
  /**
381
- * Sidebar menu component for navigation and user actions.
382
- * @param commerceInfo - Object with logo and name of the company.
383
- * @param userInfo - Object with user avatar, name, and email.
384
- * @param helpButton - Help button configuration.
385
- * @param upgradeCard - Optional upgrade card configuration.
386
- * @param isOpenSidebar - Controls sidebar visibility.
387
- * @param onOpenSidebarChange - Callback to open/close sidebar.
362
+ * AutoComplete genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
363
+ *
364
+ * Reglas aplicadas:
365
+ * - Variant: Bordered (por defecto)
366
+ * - Radius: md (por defecto)
367
+ * - labelPlacement: Outside
368
+ * - Size: sm, md, lg (configurable)
388
369
  */
389
- var MenuComponent = React.memo(function Menu(_a) {
390
- var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, upgradeCard = _a.upgradeCard, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems;
391
- // State to control menu collapse on desktop devices
392
- var _b = React.useState(false), isCollapsed = _b[0], setIsCollapsed = _b[1];
393
- // Memoized handlers for performance
394
- var handleSidebarClose = React.useCallback(function () {
395
- onOpenSidebarChange === null || onOpenSidebarChange === void 0 ? void 0 : onOpenSidebarChange(false);
396
- }, [onOpenSidebarChange]);
397
- var handleCollapseToggle = React.useCallback(function () {
398
- setIsCollapsed(function (prev) { return !prev; });
399
- }, []);
400
- var handleUpgradeClick = React.useCallback(function () {
401
- if (upgradeCard) {
402
- window.open(upgradeCard.buttonLink, "_blank");
403
- }
404
- }, [upgradeCard]);
405
- var handleHelpClick = React.useCallback(function () {
406
- window.open(helpButton.redirect, "_blank");
407
- }, [helpButton]);
408
- if (!isOpenSidebar) {
409
- return null;
410
- }
411
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsxRuntime.jsx("div", { className: "container__menu ".concat(isCollapsed
412
- ? "container__menu--collapsed"
413
- : "container__menu--expanded"), children: jsxRuntime.jsxs("div", { className: "content__menu", children: [jsxRuntime.jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsxRuntime.jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsxRuntime.jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx(IconComponent, { icon: isCollapsed
414
- ? "solar:alt-arrow-right-outline"
415
- : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxRuntime.jsxs("div", { className: "collapsible-item flex flex-col", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsxRuntime.jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsxRuntime.jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxRuntime.jsxs("div", { className: "collapsible-item relative", children: [jsxRuntime.jsxs(react.Card, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxRuntime.jsxs(react.CardBody, { className: "items-center py-5 text-center gap-1", children: [jsxRuntime.jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsxRuntime.jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsxRuntime.jsx(react.CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsxRuntime.jsx(react.Button, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsxRuntime.jsx(react.Spacer, { y: 9 })] })), jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
370
+ var AutoComplete = function (_a) {
371
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, props = __rest(_a, ["label", "id", "size", "variant", "radius"]);
372
+ var generatedId = React.useId();
373
+ var autoId = id || generatedId;
374
+ return (jsxRuntime.jsxs("div", { children: [label && (jsxRuntime.jsx("label", { htmlFor: autoId, className: "block mb-2 text-tiny text-default-600", children: label })), jsxRuntime.jsx(react.Autocomplete, __assign({}, props, { id: autoId, label: undefined, labelPlacement: "outside", variant: variant, size: size, radius: radius, classNames: {
375
+ base: "[&_[data-slot=input-wrapper][data-focus=true]]:!border-primary-500",
376
+ popoverContent: "[&_li[data-hover=true]]:!bg-primary-50 [&_li[data-hover=true]]:!text-default-600 [&_li]:!text-default-500",
377
+ } }))] }));
378
+ };
379
+
380
+ var ThemeContext = React.createContext({
381
+ mode: "light",
382
+ color: "blue",
383
+ // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
384
+ setMode: function () { },
385
+ // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
386
+ setColor: function () { },
416
387
  });
417
-
418
- // Lista simple de países con bandera emoji y código
419
- var countries = [
420
- { code: "+57", name: "Colombia", flag: "🇨🇴" },
421
- { code: "+54", name: "Argentina", flag: "🇦🇷" },
422
- { code: "+55", name: "Brazil", flag: "🇧🇷" },
423
- { code: "+52", name: "Mexico", flag: "🇲🇽" },
424
- { code: "+503", name: "El Salvador", flag: "🇸🇻" },
425
- { code: "+51", name: "Peru", flag: "🇵🇪" },
426
- { code: "+56", name: "Chile", flag: "🇨🇱" },
427
- { code: "+1", name: "United States", flag: "🇺🇸" },
428
- { code: "+7", name: "Russia", flag: "🇷🇺" },
429
- { code: "+20", name: "Egypt", flag: "🇪🇬" },
430
- { code: "+27", name: "South Africa", flag: "🇿🇦" },
431
- { code: "+33", name: "France", flag: "🇫🇷" },
432
- { code: "+34", name: "Spain", flag: "🇪🇸" },
433
- { code: "+39", name: "Italy", flag: "🇮🇹" },
434
- { code: "+44", name: "United Kingdom", flag: "🇬🇧" },
435
- { code: "+49", name: "Germany", flag: "🇩🇪" },
436
- { code: "+51", name: "Peru", flag: "🇵🇪" },
437
- { code: "+52", name: "Mexico", flag: "🇲🇽" },
438
- { code: "+54", name: "Argentina", flag: "🇦🇷" },
439
- { code: "+55", name: "Brazil", flag: "🇧🇷" },
440
- { code: "+56", name: "Chile", flag: "🇨🇱" },
441
- { code: "+57", name: "Colombia", flag: "🇨🇴" },
442
- { code: "+60", name: "Malaysia", flag: "🇲🇾" },
443
- { code: "+61", name: "Australia", flag: "🇦🇺" },
444
- { code: "+62", name: "Indonesia", flag: "🇮🇩" },
445
- { code: "+64", name: "New Zealand", flag: "🇳🇿" },
446
- { code: "+65", name: "Singapore", flag: "🇸🇬" },
447
- { code: "+66", name: "Thailand", flag: "🇹🇭" },
448
- { code: "+81", name: "Japan", flag: "🇯🇵" },
449
- { code: "+82", name: "South Korea", flag: "🇰🇷" },
450
- { code: "+84", name: "Vietnam", flag: "🇻🇳" },
451
- { code: "+86", name: "China", flag: "🇨🇳" },
452
- { code: "+91", name: "India", flag: "🇮🇳" },
453
- { code: "+351", name: "Portugal", flag: "🇵🇹" },
454
- { code: "+503", name: "El Salvador", flag: "🇸🇻" },
455
- { code: "+966", name: "Saudi Arabia", flag: "🇸🇦" },
456
- { code: "+971", name: "UAE", flag: "🇦🇪" },
457
- ];
458
- var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
459
- // Traducciones por defecto
460
- var defaultTranslations$2 = {
461
- label: "Teléfono",
462
- placeholder: "Número de teléfono",
463
- searchPlaceholder: "Buscar país...",
464
- selectCountryAriaLabel: "Seleccionar país",
465
- expandListAriaLabel: "Desplegar lista de países",
466
- noCountriesFound: "No se encontraron países",
467
- };
468
- var Phone = function (_a) {
469
- var label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, _e = _a.value, value = _e === void 0 ? "" : _e, onChange = _a.onChange, onBlur = _a.onBlur, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.name, name = _g === void 0 ? "phone" : _g, _h = _a.translations, translations = _h === void 0 ? {} : _h;
470
- var _j = React.useState(false), isDropdownOpen = _j[0], setIsDropdownOpen = _j[1];
471
- var _k = React.useState(uniqueCountries[0]), selectedCountry = _k[0], setSelectedCountry = _k[1];
472
- var _l = React.useState(""), inputValue = _l[0], setInputValue = _l[1];
473
- var dropdownRef = React.useRef(null);
474
- var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
475
- // Combinar traducciones por defecto con las proporcionadas
476
- var t = __assign(__assign({}, defaultTranslations$2), translations);
477
- // Usar la etiqueta de las traducciones si no se proporciona label explícitamente
478
- var finalLabel = label || t.label;
479
- // Sincroniza valor externo
480
- React.useEffect(function () {
481
- if (value) {
482
- // Si value incluye el código, lo separamos
483
- var found = uniqueCountries.find(function (c) { return value.startsWith(c.code); });
484
- if (found) {
485
- setSelectedCountry(found);
486
- setInputValue(value.replace(found.code, "").trim());
487
- }
488
- else {
489
- setInputValue(value);
490
- }
491
- }
492
- }, [value]);
493
- // Open dropdown: reset filteredCountries
494
- React.useEffect(function () {
495
- if (isDropdownOpen) {
496
- setFilteredCountries(uniqueCountries);
497
- }
498
- }, [isDropdownOpen]);
499
- // Cierra dropdown al hacer click fuera
500
- React.useEffect(function () {
501
- var handleClickOutside = function (event) {
502
- if (dropdownRef.current &&
503
- !dropdownRef.current.contains(event.target)) {
504
- setIsDropdownOpen(false);
505
- }
506
- };
507
- if (isDropdownOpen) {
508
- document.addEventListener("mousedown", handleClickOutside);
509
- }
510
- return function () {
511
- document.removeEventListener("mousedown", handleClickOutside);
512
- };
513
- }, [isDropdownOpen]);
514
- var handleCountrySelect = function (country) {
515
- setSelectedCountry(country);
516
- setIsDropdownOpen(false);
517
- if (onChange) {
518
- onChange(country.code + inputValue);
519
- }
520
- };
521
- var handleInputChange = function (e) {
522
- // Solo números
523
- var val = e.target.value.replace(/\D/g, "");
524
- setInputValue(val);
525
- if (onChange) {
526
- onChange(selectedCountry.code + val);
527
- }
528
- };
529
- return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-600 mb-1", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-pink-600", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] bg-white dark:bg-gray-900 transition-colors shadow-sm border border-[#E4E4E7] dark:border-gray-700 rounded-2xl focus-within:border-blue-500 dark:focus-within:border-blue-400 ".concat(error
530
- ? "border-pink-500 dark:border-pink-600"
531
- : "border-[#E4E4E7] dark:border-gray-700").concat(disabled ? " bg-gray-100 dark:bg-gray-800 opacity-60" : ""), children: [jsxRuntime.jsxs("div", { className: "relative ml-2", ref: dropdownRef, children: [jsxRuntime.jsxs("button", { type: "button",
532
- ///bg-gray-100
533
- className: "flex items-center gap-1 px-4 h-10 rounded-xl dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-gray-700 dark:text-gray-200", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-gray-400 dark:text-gray-300 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }), isDropdownOpen && (jsxRuntime.jsxs("div", { className: "absolute z-30 mt-2 w-60 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 text-gray-900 dark:text-gray-100 rounded-lg focus:outline-none focus:border-blue-500 dark:focus:border-blue-400", placeholder: t.searchPlaceholder, onChange: function (e) {
534
- var searchTerm = e.target.value.toLowerCase();
535
- var filtered = uniqueCountries.filter(function (country) {
536
- return country.name.toLowerCase().includes(searchTerm) ||
537
- country.code.toLowerCase().includes(searchTerm);
538
- });
539
- setFilteredCountries(filtered);
540
- } }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-gray-50 dark:hover:bg-gray-800 ".concat(country.code === selectedCountry.code
541
- ? "bg-blue-50 dark:bg-blue-900"
542
- : ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsxRuntime.jsx("span", { className: "flex-1 text-left dark:text-gray-100", children: country.name }), jsxRuntime.jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: country.code })] }, country.code)); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-gray-500 dark:text-gray-400", children: t.noCountriesFound })) })] }))] }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 h-10 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: "text-xs text-pink-600 dark:text-pink-400 mt-1", children: errorText }))] }));
543
- };
544
-
545
- /**
546
- * Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
547
- *
548
- * Reglas aplicadas:
549
- * - Variant: Bordered (por defecto)
550
- * - Radius: md (por defecto)
551
- * - labelPlacement: Outside
552
- * - Size: sm, md, lg (configurable)
553
- */
554
- var Select = function (_a) {
555
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
556
- var generatedId = React.useId();
557
- var selectId = id || generatedId;
558
- return (jsxRuntime.jsx("div", { className: "group", children: jsxRuntime.jsx(react.Select, __assign({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
559
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
560
- trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
561
- popoverContent: "[&_[data-focus-visible=true]]:!outline-none [&_[data-selectable=true]:focus]:!bg-primary-50 [&_li]:!text-default-500 [&_li[data-hover=true]]:!text-default-600",
562
- } })) }));
563
- };
564
-
565
- function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
566
- return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
567
- }
568
- function $14e0f24ef4ac5c92$var$timeToMs(a) {
569
- return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
570
- }
571
-
572
- function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
573
- let inverseDuration = {};
574
- for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
575
- return inverseDuration;
576
- }
577
- function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
578
- let mutableValue = value.copy();
579
- if (fields.hour != null) mutableValue.hour = fields.hour;
580
- if (fields.minute != null) mutableValue.minute = fields.minute;
581
- if (fields.second != null) mutableValue.second = fields.second;
582
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
583
- $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
584
- return mutableValue;
585
- }
586
- function $735220c2d4774dd3$var$balanceTime(time) {
587
- time.second += Math.floor(time.millisecond / 1000);
588
- time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
589
- time.minute += Math.floor(time.second / 60);
590
- time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
591
- time.hour += Math.floor(time.minute / 60);
592
- time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
593
- let days = Math.floor(time.hour / 24);
594
- time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
595
- return days;
596
- }
597
- function $735220c2d4774dd3$export$7555de1e070510cb(time) {
598
- time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
599
- time.second = Math.max(0, Math.min(time.second, 59));
600
- time.minute = Math.max(0, Math.min(time.minute, 59));
601
- time.hour = Math.max(0, Math.min(time.hour, 23));
602
- }
603
- function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
604
- let result = a % b;
605
- if (result < 0) result += b;
606
- return result;
607
- }
608
- function $735220c2d4774dd3$var$addTimeFields(time, duration) {
609
- time.hour += duration.hours || 0;
610
- time.minute += duration.minutes || 0;
611
- time.second += duration.seconds || 0;
612
- time.millisecond += duration.milliseconds || 0;
613
- return $735220c2d4774dd3$var$balanceTime(time);
614
- }
615
- function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
616
- let res = time.copy();
617
- $735220c2d4774dd3$var$addTimeFields(res, duration);
618
- return res;
619
- }
620
- function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
621
- return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
622
- }
623
- function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
624
- let mutable = value.copy();
625
- switch(field){
626
- case 'hour':
627
- {
628
- let hours = value.hour;
629
- let min = 0;
630
- let max = 23;
631
- if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
632
- let isPM = hours >= 12;
633
- min = isPM ? 12 : 0;
634
- max = isPM ? 23 : 11;
635
- }
636
- mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
637
- break;
638
- }
639
- case 'minute':
640
- mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
641
- break;
642
- case 'second':
643
- mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
644
- break;
645
- case 'millisecond':
646
- mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
647
- break;
648
- default:
649
- throw new Error('Unsupported field ' + field);
650
- }
651
- return mutable;
652
- }
653
- function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
654
- if (round) {
655
- value += Math.sign(amount);
656
- if (value < min) value = max;
657
- let div = Math.abs(amount);
658
- if (amount > 0) value = Math.ceil(value / div) * div;
659
- else value = Math.floor(value / div) * div;
660
- if (value > max) value = min;
661
- } else {
662
- value += amount;
663
- if (value < min) value = max - (min - value - 1);
664
- else if (value > max) value = min + (value - max - 1);
665
- }
666
- return value;
667
- }
668
-
669
- function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
670
- return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
671
- }
672
-
673
- function _check_private_redeclaration(obj, privateCollection) {
674
- if (privateCollection.has(obj)) {
675
- throw new TypeError("Cannot initialize the same private elements twice on an object");
676
- }
677
- }
678
-
679
- function _class_private_field_init(obj, privateMap, value) {
680
- _check_private_redeclaration(obj, privateMap);
681
- privateMap.set(obj, value);
682
- }
683
-
684
- var // This prevents TypeScript from allowing other types with the same fields to match.
685
- // @ts-ignore
686
- $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
687
- class $35ea8db9cb2ccb90$export$680ea196effce5f {
688
- /** Returns a copy of this time. */ copy() {
689
- return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
690
- }
691
- /** Returns a new `Time` with the given duration added to it. */ add(duration) {
692
- return ($735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
693
- }
694
- /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
695
- return ($735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
696
- }
697
- /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
698
- return ($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
699
- }
700
- /**
701
- * Returns a new `Time` with the given field adjusted by a specified amount.
702
- * When the resulting value reaches the limits of the field, it wraps around.
703
- */ cycle(field, amount, options) {
704
- return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
705
- }
706
- /** Converts the time to an ISO 8601 formatted string. */ toString() {
707
- return ($fae977aafc393c5c$export$f59dee82248f5ad4)(this);
708
- }
709
- /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
710
- return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
711
- }
712
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
713
- (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type1, {
714
- writable: true,
715
- value: void 0
716
- });
717
- this.hour = hour;
718
- this.minute = minute;
719
- this.second = second;
720
- this.millisecond = millisecond;
721
- ($735220c2d4774dd3$export$7555de1e070510cb)(this);
722
- }
723
- }
724
-
725
- var Switch = function (_a) {
726
- var id = _a.id, props = __rest(_a, ["id"]);
727
- var generatedId = React.useId();
728
- var autoId = id || generatedId;
729
- return jsxRuntime.jsx(react.Switch, __assign({}, props, { id: autoId }));
730
- };
731
-
732
- /**
733
- * TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
734
- */
735
- var TimeInput = function (_a) {
736
- var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest(_a, ["label", "id", "size", "radius", "variant"]);
737
- var generatedId = React.useId();
738
- var autoId = id || generatedId;
739
- return (jsxRuntime.jsx(react.TimeInput, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
740
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
741
- inputWrapper: "focus-within:!border-primary-500",
742
- } })));
743
- };
744
-
745
- /**
746
- * @component ScheduleRow
747
- * @description A React component for managing the schedule of a single day.
748
- * It allows users to open or close the schedule, add or remove time slots,
749
- * and modify the start and end times of each slot. The component is fully
750
- * controlled and reports changes to the parent via the `onChange` callback.
751
- *
752
- * @param {ScheduleRowProps} props - The props for the component.
753
- * @returns {React.ReactElement} The rendered ScheduleRow component.
754
- */
755
- var ScheduleRow = function (_a) {
756
- var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
757
- /**
758
- * @function validateTimeSlots
759
- * @description Validates all time slots to ensure the "from" time is not after the "to" time.
760
- * @param {TimeSlot[]} timeSlots - The array of time slots to validate.
761
- * @returns {TimeSlot[]} The updated array of time slots with error messages if any.
762
- */
763
- var validateTimeSlots = function (timeSlots) {
764
- return timeSlots.map(function (slot) {
765
- if (slot.from && slot.to) {
766
- var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
767
- var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
768
- if (fromTime.compare(toTime) > 0) {
769
- return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
770
- }
771
- }
772
- return __assign(__assign({}, slot), { error: null });
773
- });
774
- };
775
- /**
776
- * @function toTimeValue
777
- * @description Converts a time string (e.g., "09:00") to a `TimeValue` object
778
- * required by the `TimeInput` component.
779
- * @param {string} time - The time string to convert.
780
- * @returns {TimeValue | null} The corresponding `TimeValue` object, or `null` if the input is empty.
781
- */
782
- var toTimeValue = function (time) {
783
- if (!time) {
784
- return null;
785
- }
786
- var _a = time.split(":").map(Number), hour = _a[0], minute = _a[1];
787
- return new $35ea8db9cb2ccb90$export$680ea196effce5f(hour, minute);
788
- };
789
- /**
790
- * @function fromTimeValue
791
- * @description Converts a `TimeValue` object back to a formatted time string (e.g., "09:00").
792
- * @param {TimeValue | null} time - The `TimeValue` object to convert.
793
- * @returns {string} The formatted time string.
794
- */
795
- var fromTimeValue = function (time) {
796
- if (!time) {
797
- return "";
798
- }
799
- return "".concat(String(time.hour).padStart(2, "0"), ":").concat(String(time.minute).padStart(2, "0"));
800
- };
801
- /**
802
- * @function handleToggleDay
803
- * @description Toggles the `isOpen` status of the schedule for the day.
804
- */
805
- var handleToggleDay = function () {
806
- onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
807
- };
808
- /**
809
- * @function handleTimeChange
810
- * @description Updates the time for a specific time slot.
811
- * @param {number} index - The index of the time slot to modify.
812
- * @param {"from" | "to"} field - The field to update ("from" or "to").
813
- * @param {TimeValue | null} value - The new time value from the `TimeInput` component.
814
- */
815
- var handleTimeChange = function (index, field, value) {
816
- var _a;
817
- var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
818
- newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
819
- var validatedSlots = validateTimeSlots(newTimeSlots);
820
- onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
821
- };
822
- /**
823
- * @function handleAddTimeSlot
824
- * @description Adds a new, empty time slot to the schedule.
825
- */
826
- var handleAddTimeSlot = function () {
827
- var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
828
- onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
829
- };
830
- /**
831
- * @function handleRemoveTimeSlot
832
- * @description Removes a time slot from the schedule at the specified index.
833
- * @param {number} index - The index of the time slot to remove.
834
- */
835
- var handleRemoveTimeSlot = function (index) {
836
- var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
837
- onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
838
- };
839
- return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: translations.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsxRuntime.jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
840
- };
841
-
842
- function AuraTable(_a) {
843
- var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
844
- return (jsxRuntime.jsxs(react.Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsxRuntime.jsx(react.TableHeader, { columns: columns, children: function (column) { return jsxRuntime.jsx(react.TableColumn, { children: column.label }, column.key); } }), jsxRuntime.jsx(react.TableBody, { items: items, children: function (item) { return (jsxRuntime.jsx(react.TableRow, { children: function (columnKey) { return (jsxRuntime.jsx(react.TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
845
- }
846
-
847
- /**
848
- * Textarea component that wraps the HeroUI TextArea component.
849
- */
850
- var Textarea = function (_a) {
851
- var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
852
- var generatedId = React.useId();
853
- var autoId = id || generatedId;
854
- return (jsxRuntime.jsx(react.Textarea, __assign({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
855
- label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
856
- inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
857
- } })));
858
- };
859
-
860
- // Traducciones por defecto en español según las reglas de diseño
861
- var defaultTranslations$1 = {
862
- lightTheme: "Claro",
863
- darkTheme: "Oscuro",
864
- };
865
- /**
866
- * Selector de tema visual con preview interactivo siguiendo las reglas de diseño BeweOS.
867
- *
868
- * Reglas aplicadas:
869
- * - Soporte completo de traducciones mediante props
870
- * - Sin dependencias de sistemas i18n específicos
871
- * - Dark mode compatible
872
- * - Uso exclusivo de Tailwind CSS
873
- */
874
- var ThemePicker = function (_a) {
875
- var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
876
- // Combinar traducciones por defecto con las proporcionadas
877
- var t = __assign(__assign({}, defaultTranslations$1), translations);
878
- var themes = [
879
- {
880
- key: "light",
881
- label: t.lightTheme,
882
- cardClass: "bg-white border border-[#E4E4E7] text-zinc-900",
883
- previewClass: "bg-[#F4F4F5] border border-[#E4E4E7]",
884
- labelClass: "font-medium text-[14px] leading-[20px] text-zinc-900",
885
- radioColor: "primary",
886
- previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#E4E4E7] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#E4E4E7] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#E4E4E7]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#E4E4E7]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#F4F4F5] rounded-lg mt-2" })] })),
887
- },
888
- {
889
- key: "dark",
890
- label: t.darkTheme,
891
- cardClass: "bg-black border border-[#3F3F46] text-white",
892
- previewClass: "bg-[#27272A] border border-[#3F3F46]",
893
- labelClass: "font-medium text-[14px] leading-[20px] text-white",
894
- radioColor: "primary",
895
- previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#3F3F46] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#3F3F46] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#3F3F46]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#3F3F46]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#27272A] rounded-lg mt-2" })] })),
896
- },
897
- ];
898
- return (jsxRuntime.jsx(react.RadioGroup, { value: value, onChange: function (e) { return onChange(e.target.value); }, className: "flex gap-6 w-full ".concat(className || ""), style: { gap: 16 }, children: themes.map(function (theme) { return (jsxRuntime.jsxs("div", { className: "relative rounded-[14px] ".concat(theme.cardClass, " p-6 w-1/2 min-h-[180px] transition-all duration-200 flex flex-col justify-start"), children: [jsxRuntime.jsx("div", { className: "absolute top-6 right-6", children: jsxRuntime.jsx(react.Radio, { "aria-label": theme.label, color: theme.radioColor, size: "sm", value: theme.key }) }), jsxRuntime.jsx("span", { className: theme.labelClass, children: theme.label }), theme.previewContent] }, theme.key)); }) }));
899
- };
900
-
901
- var ConfigMenu = function (_a) {
902
- var _b;
903
- var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
904
- return (jsxRuntime.jsxs(react.Dropdown, { className: "min-w-40", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "default", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:settings-linear" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { "aria-label": "Configuration", children: [jsxRuntime.jsx(react.DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsxRuntime.jsx(react.DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
905
- base: "text-default-500",
906
- }, startContent: item.icon ? jsxRuntime.jsx(IconComponent, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsxRuntime.jsx(react.DropdownSection, { children: jsxRuntime.jsx(react.DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
907
- base: "text-default-500",
908
- }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
909
- };
910
- ConfigMenu.displayName = "ConfigMenu";
911
-
912
- var NotificationButton = function (_a) {
913
- var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
914
- return (jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsxRuntime.jsx("span", { className: "notification__alert", children: notificationCount })) }));
915
- };
916
- NotificationButton.displayName = "NotificationButton";
917
-
918
- var HeaderComponent = function (_a) {
919
- var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
920
- return (jsxRuntime.jsxs("header", { className: "header__container", children: [jsxRuntime.jsx(react.Button, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [jsxRuntime.jsx(NotificationButton, { notificationCount: notificationCount }), jsxRuntime.jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
921
- };
922
- HeaderComponent.displayName = "Header";
923
-
924
- var ToastContext = React.createContext(undefined);
925
- var useAuraToast = function () {
926
- var context = React.useContext(ToastContext);
927
- if (!context) {
928
- throw new Error("useAuraToast must be used within a AuraToastProvider");
929
- }
930
- return context;
931
- };
932
-
933
- function GlobalToast() {
934
- var _a = useAuraToast(), toast = _a.toast, hideToast = _a.hideToast;
935
- if (!toast.isVisible) {
936
- return null;
937
- }
938
- return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-50 w-full max-w-sm", children: jsxRuntime.jsx(react.Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
939
- }
940
-
941
- // Traducciones por defecto en español
942
- var defaultTranslations = {
943
- uploadText: "Da clic y selecciona tus archivos",
944
- subText: "",
945
- dragText: "Suelta el archivo aquí",
946
- multipleFilesError: "Solo puedes subir un archivo",
947
- maxFilesError: "Puedes subir máximo {maxFiles} archivos",
948
- invalidFileTypeError: "Solo se aceptan archivos de tipo: {acceptedTypes}",
949
- maxFileSizeError: "El archivo excede el tamaño máximo permitido de {maxSize}",
950
- removeFileAriaLabel: "Remover archivo",
951
- uploadAreaAriaLabel: "Área de carga de archivos",
952
- cropModalTitle: "Recortar imagen",
953
- cropSaveButton: "Guardar",
954
- cropCancelButton: "Cancelar",
955
- cropZoomLabel: "Zoom",
956
- cropInstructions: "Arrastra para mover la imagen y usa el zoom para ajustar el tamaño",
957
- cropBackgroundLabel: "Color de fondo",
958
- cropBackgroundWhite: "Blanco",
959
- cropBackgroundBlack: "Negro",
960
- cropBackgroundTransparent: "Transparente",
961
- };
962
- /**
963
- * Formatea el tipo de archivo para mostrar
964
- */
965
- var formatFileType = function (type) {
966
- var _a;
967
- if (type.startsWith(".")) {
968
- return type.toUpperCase();
969
- }
970
- if (type.includes("/")) {
971
- var parts = type.split("/");
972
- return ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || type;
973
- }
974
- return type.toUpperCase();
975
- };
976
- /**
977
- * Formatea el tamaño del archivo de forma legible
978
- */
979
- var formatFileSize = function (bytes) {
980
- if (bytes === 0) {
981
- return "0 Bytes";
982
- }
983
- var k = 1024;
984
- var sizes = ["Bytes", "KB", "MB", "GB"];
985
- var i = Math.floor(Math.log(bytes) / Math.log(k));
986
- return "".concat(Math.round(bytes / Math.pow(k, i)), " ").concat(sizes[i]);
987
- };
988
- /**
989
- * Componente de recorte de imagen usando Canvas API
990
- */
991
- var ImageCropModal = function (_a) {
992
- var isOpen = _a.isOpen, imageUrl = _a.imageUrl, targetWidth = _a.targetWidth, targetHeight = _a.targetHeight, onSave = _a.onSave, onCancel = _a.onCancel, translations = _a.translations;
993
- var canvasRef = React.useRef(null);
994
- var _b = React.useState(null), imageElement = _b[0], setImageElement = _b[1];
995
- var _c = React.useState(0), zoomValue = _c[0], setZoomValue = _c[1]; // Valor del slider de -1 a 1
996
- var _d = React.useState({ x: 0, y: 0 }), position = _d[0], setPosition = _d[1];
997
- var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
998
- var _f = React.useState({ x: 0, y: 0 }), dragStart = _f[0], setDragStart = _f[1];
999
- var _g = React.useState(1), baseScale = _g[0], setBaseScale = _g[1]; // Escala base inicial
1000
- var _h = React.useState({ width: 400, height: 300 }), canvasSize = _h[0], setCanvasSize = _h[1];
1001
- var _j = React.useState("white"), backgroundColor = _j[0], setBackgroundColor = _j[1];
1002
- // Función para convertir el valor del zoom slider a escala real
1003
- var getScaleFromZoom = function (zoomValue) {
1004
- if (zoomValue === 0) {
1005
- return baseScale;
1006
- }
1007
- if (zoomValue > 0) {
1008
- // Zoom in: de baseScale a baseScale * 3
1009
- return baseScale + baseScale * 2 * zoomValue;
1010
- }
1011
- // Zoom out: de baseScale * 0.3 a baseScale
1012
- return baseScale + baseScale * 0.7 * zoomValue;
1013
- };
1014
- var currentScale = getScaleFromZoom(zoomValue);
1015
- // Cargar imagen cuando se abre el modal
1016
- React.useEffect(function () {
1017
- if (isOpen && imageUrl) {
1018
- var img_1 = new Image();
1019
- img_1.onload = function () {
1020
- setImageElement(img_1);
1021
- // Calcular escala inicial para que la imagen quepa en el área de crop
1022
- var scaleX = targetWidth / img_1.width;
1023
- var scaleY = targetHeight / img_1.height;
1024
- var initialScale = Math.max(scaleX, scaleY);
1025
- setBaseScale(initialScale);
1026
- setZoomValue(0); // Empezar en el centro
1027
- setPosition({ x: 0, y: 0 });
1028
- setBackgroundColor("white"); // Reset color de fondo
1029
- };
1030
- img_1.src = imageUrl;
1031
- }
1032
- }, [isOpen, imageUrl, targetWidth, targetHeight]);
1033
- // Dibujar en el canvas
1034
- React.useEffect(function () {
1035
- if (!(imageElement && canvasRef.current)) {
1036
- return;
1037
- }
1038
- var canvas = canvasRef.current;
1039
- var ctx = canvas.getContext("2d");
1040
- if (!ctx) {
1041
- return;
1042
- }
1043
- // Limpiar canvas
1044
- ctx.clearRect(0, 0, canvas.width, canvas.height);
1045
- // Dibujar fondo gris del canvas
1046
- ctx.fillStyle = "#f3f4f6";
1047
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1048
- // Calcular posición y tamaño de la imagen
1049
- var imgWidth = imageElement.width * currentScale;
1050
- var imgHeight = imageElement.height * currentScale;
1051
- var imgX = (canvas.width - imgWidth) / 2 + position.x;
1052
- var imgY = (canvas.height - imgHeight) / 2 + position.y;
1053
- // Dibujar imagen
1054
- ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
1055
- // Dibujar overlay para mostrar área de recorte
1056
- ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
1057
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1058
- // Limpiar área de recorte (centro)
1059
- var cropX = (canvas.width - targetWidth) / 2;
1060
- var cropY = (canvas.height - targetHeight) / 2;
1061
- ctx.clearRect(cropX, cropY, targetWidth, targetHeight);
1062
- // Dibujar color de fondo del área de recorte
1063
- if (backgroundColor !== "transparent") {
1064
- ctx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
1065
- ctx.fillRect(cropX, cropY, targetWidth, targetHeight);
1066
- }
1067
- // Redibujar imagen solo en el área de recorte
1068
- ctx.save();
1069
- ctx.beginPath();
1070
- ctx.rect(cropX, cropY, targetWidth, targetHeight);
1071
- ctx.clip();
1072
- ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
1073
- ctx.restore();
1074
- // Dibujar borde del área de recorte
1075
- ctx.strokeStyle = "#3b82f6";
1076
- ctx.lineWidth = 2;
1077
- ctx.strokeRect(cropX, cropY, targetWidth, targetHeight);
1078
- }, [
1079
- imageElement,
1080
- currentScale,
1081
- position,
1082
- targetWidth,
1083
- targetHeight,
1084
- backgroundColor,
1085
- ]);
1086
- var handleMouseDown = function (e) {
1087
- var _a;
1088
- e.preventDefault();
1089
- setIsDragging(true);
1090
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1091
- if (rect) {
1092
- setDragStart({
1093
- x: e.clientX - rect.left - position.x,
1094
- y: e.clientY - rect.top - position.y,
1095
- });
1096
- }
1097
- };
1098
- var handleMouseMove = function (e) {
1099
- var _a;
1100
- if (!isDragging) {
1101
- return;
1102
- }
1103
- e.preventDefault();
1104
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1105
- if (rect) {
1106
- setPosition({
1107
- x: e.clientX - rect.left - dragStart.x,
1108
- y: e.clientY - rect.top - dragStart.y,
1109
- });
1110
- }
1111
- };
1112
- var handleMouseUp = function () {
1113
- setIsDragging(false);
1114
- };
1115
- // Eventos táctiles para dispositivos móviles
1116
- var handleTouchStart = function (e) {
1117
- var _a;
1118
- e.preventDefault();
1119
- if (e.touches.length === 1) {
1120
- setIsDragging(true);
1121
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1122
- if (rect) {
1123
- var touch = e.touches[0];
1124
- setDragStart({
1125
- x: touch.clientX - rect.left - position.x,
1126
- y: touch.clientY - rect.top - position.y,
1127
- });
1128
- }
1129
- }
1130
- };
1131
- var handleTouchMove = function (e) {
1132
- var _a;
1133
- if (!isDragging || e.touches.length !== 1) {
1134
- return;
1135
- }
1136
- e.preventDefault();
1137
- var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1138
- if (rect) {
1139
- var touch = e.touches[0];
1140
- setPosition({
1141
- x: touch.clientX - rect.left - dragStart.x,
1142
- y: touch.clientY - rect.top - dragStart.y,
1143
- });
1144
- }
1145
- };
1146
- var handleTouchEnd = function () {
1147
- setIsDragging(false);
1148
- };
1149
- var handleSave = function () {
1150
- if (!(imageElement && canvasRef.current)) {
1151
- return;
1152
- }
1153
- // Crear canvas temporal para el recorte
1154
- var tempCanvas = document.createElement("canvas");
1155
- tempCanvas.width = targetWidth;
1156
- tempCanvas.height = targetHeight;
1157
- var tempCtx = tempCanvas.getContext("2d");
1158
- if (!tempCtx) {
1159
- return;
1160
- }
1161
- // Dibujar color de fondo si no es transparente
1162
- if (backgroundColor !== "transparent") {
1163
- tempCtx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
1164
- tempCtx.fillRect(0, 0, targetWidth, targetHeight);
1165
- }
1166
- // Calcular parámetros de recorte
1167
- var canvas = canvasRef.current;
1168
- var imgWidth = imageElement.width * currentScale;
1169
- var imgHeight = imageElement.height * currentScale;
1170
- var imgX = (canvas.width - imgWidth) / 2 + position.x;
1171
- var imgY = (canvas.height - imgHeight) / 2 + position.y;
1172
- var cropX = (canvas.width - targetWidth) / 2;
1173
- var cropY = (canvas.height - targetHeight) / 2;
1174
- // Calcular área fuente en la imagen original
1175
- var sourceX = (cropX - imgX) / currentScale;
1176
- var sourceY = (cropY - imgY) / currentScale;
1177
- var sourceWidth = targetWidth / currentScale;
1178
- var sourceHeight = targetHeight / currentScale;
1179
- // Dibujar recorte sobre el fondo
1180
- tempCtx.drawImage(imageElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, targetWidth, targetHeight);
1181
- // Convertir a blob y crear archivo
1182
- var fileType = backgroundColor === "transparent" ? "image/png" : "image/png";
1183
- tempCanvas.toBlob(function (blob) {
1184
- if (blob) {
1185
- var timestamp = new Date().getTime();
1186
- var file = new File([blob], "cropped-image-".concat(timestamp, ".png"), {
1187
- type: fileType,
1188
- });
1189
- onSave(file, imageElement.src);
1190
- }
1191
- }, fileType);
1192
- };
1193
- // Calcular dimensiones responsive del canvas
1194
- var updateCanvasSize = React.useCallback(function () {
1195
- var minCanvasWidth = Math.min(350, window.innerWidth - 40);
1196
- var minCanvasHeight = Math.min(250, window.innerHeight - 300);
1197
- var newCanvasWidth = Math.max(minCanvasWidth, targetWidth + 60);
1198
- var newCanvasHeight = Math.max(minCanvasHeight, targetHeight + 60);
1199
- setCanvasSize({ width: newCanvasWidth, height: newCanvasHeight });
1200
- }, [targetWidth, targetHeight]);
1201
- // Actualizar tamaño del canvas al cambiar el tamaño de la ventana
1202
- React.useEffect(function () {
1203
- if (!isOpen) {
1204
- return;
1205
- }
1206
- updateCanvasSize();
1207
- var handleResize = function () {
1208
- updateCanvasSize();
1209
- };
1210
- window.addEventListener("resize", handleResize);
1211
- return function () {
1212
- window.removeEventListener("resize", handleResize);
1213
- };
1214
- }, [isOpen, updateCanvasSize]);
1215
- return (jsxRuntime.jsx(react.Modal, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
1216
- backdrop: "bg-black/80",
1217
- wrapper: "p-0 sm:p-4",
1218
- base: "m-0 sm:m-4 max-h-screen sm:max-h-[90vh] w-full sm:w-auto",
1219
- }, children: jsxRuntime.jsxs(react.ModalContent, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxRuntime.jsxs(react.ModalHeader, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsxRuntime.jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsxRuntime.jsx(react.ModalBody, { className: "px-4 sm:px-6 py-4", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [jsxRuntime.jsx("div", { className: "flex justify-center overflow-hidden", children: jsxRuntime.jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsxRuntime.jsx(react.Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
1220
- { value: -1, label: "Out" },
1221
- { value: 0, label: "0" },
1222
- { value: 1, label: "In" },
1223
- ] }), jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "+" })] })] }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "text-sm font-medium", children: translations.cropBackgroundLabel }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-3 sm:gap-4", children: [jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "white", checked: backgroundColor === "white", onChange: function (e) {
1224
- return setBackgroundColor(e.target.value);
1225
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-white border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundWhite })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "black", checked: backgroundColor === "black", onChange: function (e) {
1226
- return setBackgroundColor(e.target.value);
1227
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-black border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundBlack })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "transparent", checked: backgroundColor === "transparent", onChange: function (e) {
1228
- return setBackgroundColor(e.target.value);
1229
- }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-gray-200 border border-gray-300 rounded", style: {
1230
- backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
1231
- backgroundSize: "8px 8px",
1232
- backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
1233
- } }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxRuntime.jsxs(react.ModalFooter, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsxRuntime.jsx(react.Button, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsxRuntime.jsx(react.Button, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
1234
- };
1235
- /**
1236
- * Componente de previsualización de archivo
1237
- */
1238
- var FilePreview = function (_a) {
1239
- var file = _a.file, onRemove = _a.onRemove, removeAriaLabel = _a.removeAriaLabel;
1240
- var _b = React.useState(""), previewUrl = _b[0], setPreviewUrl = _b[1];
1241
- React.useEffect(function () {
1242
- if (file === null || file === void 0 ? void 0 : file.type.startsWith("image/")) {
1243
- var url_1 = URL.createObjectURL(file);
1244
- setPreviewUrl(url_1);
1245
- return function () { return URL.revokeObjectURL(url_1); };
1246
- }
1247
- }, [file]);
1248
- if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
1249
- return null;
1250
- }
1251
- return (jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsxRuntime.jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsxRuntime.jsx(react.Button, { isIconOnly: true, size: "sm", color: "danger", variant: "solid", className: "absolute top-2 right-2 sm:top-3 sm:right-3 z-20 bg-red-100 hover:bg-red-200 text-red-600 min-w-8 h-8 sm:min-w-10 sm:h-10", onPress: onRemove, "aria-label": removeAriaLabel, children: jsxRuntime.jsx(IconComponent, { icon: "heroicons:trash", size: "sm" }) })] }));
1252
- };
1253
- /**
1254
- * Componente UploadDocument basado en Hero UI con funcionalidad mejorada
1255
- *
1256
- * @example
1257
- * ```tsx
1258
- * <UploadDocument
1259
- * onUpload={(files) => console.log(files)}
1260
- * acceptedFiles="image/*,.pdf"
1261
- * multiple={false}
1262
- * translations={{
1263
- * uploadText: "Upload your files",
1264
- * dragText: "Drop files here"
1265
- * }}
1266
- * />
1267
- * ```
1268
- */
1269
- var UploadFile = function (_a) {
1270
- var text = _a.text, textColor = _a.textColor, subText = _a.subText,
1271
- // borderColor, // TODO: Implementar colores personalizados
1272
- iconColor = _a.iconColor,
1273
- // backgroundColor, // TODO: Implementar colores personalizados
1274
- _b = _a.width,
1275
- // backgroundColor, // TODO: Implementar colores personalizados
1276
- width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
1277
- var inputRef = React.useRef(null);
1278
- var uploadImageRef = React.useRef(image || null);
1279
- var _o = React.useState(false), isDragging = _o[0], setIsDragging = _o[1];
1280
- // Estados para el modal de crop
1281
- var _p = React.useState(false), showCropModal = _p[0], setShowCropModal = _p[1];
1282
- var _q = React.useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
1283
- var _r = React.useState(null); _r[0]; var setOriginalFile = _r[1];
1284
- // Combinar traducciones por defecto con las proporcionadas
1285
- var t = React.useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
1286
- // Actualizar texto si se pasa como prop (retrocompatibilidad)
1287
- var finalText = text || t.uploadText;
1288
- var finalSubText = subText || t.subText;
1289
- var handleClick = function () {
1290
- var _a;
1291
- if (!(disabled || uploadImageRef.current)) {
1292
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
1293
- }
1294
- };
1295
- var validateFiles = React.useCallback(function (files) {
1296
- var filesArray = Array.from(files);
1297
- if (!multiple && filesArray.length > 1) {
1298
- onError === null || onError === void 0 ? void 0 : onError(t.multipleFilesError);
1299
- return [];
1300
- }
1301
- if (filesArray.length > maxFiles) {
1302
- onError === null || onError === void 0 ? void 0 : onError(t.maxFilesError.replace("{maxFiles}", maxFiles.toString()));
1303
- return [];
1304
- }
1305
- // Validar tamaño de archivo
1306
- if (maxFileSize) {
1307
- var oversizedFiles = filesArray.filter(function (file) { return file.size > maxFileSize; });
1308
- if (oversizedFiles.length > 0) {
1309
- var maxSizeFormatted = formatFileSize(maxFileSize);
1310
- onError === null || onError === void 0 ? void 0 : onError(t.maxFileSizeError.replace("{maxSize}", maxSizeFormatted));
1311
- return [];
1312
- }
1313
- }
1314
- // Validar tipos de archivo
1315
- var acceptedExtensions = Array.isArray(acceptedFiles)
1316
- ? acceptedFiles.map(function (ext) { return ext.trim().toLowerCase(); })
1317
- : acceptedFiles.split(",").map(function (ext) { return ext.trim().toLowerCase(); });
1318
- var validFiles = filesArray.filter(function (file) {
1319
- var _a;
1320
- if (acceptedFiles.includes("image/*") &&
1321
- file.type.startsWith("image/")) {
1322
- return true;
1323
- }
1324
- if (acceptedExtensions.some(function (ext) { return ext.includes("/"); })) {
1325
- return acceptedExtensions.some(function (type) { return file.type === type; });
1326
- }
1327
- var fileExtension = ".".concat((_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
1328
- return acceptedExtensions.some(function (ext) { return ext === fileExtension || ext === "*"; });
1329
- });
1330
- if (validFiles.length === 0) {
1331
- var formattedTypes = acceptedExtensions
1332
- .map(formatFileType)
1333
- .join(", ");
1334
- onError === null || onError === void 0 ? void 0 : onError(t.invalidFileTypeError.replace("{acceptedTypes}", formattedTypes));
1335
- return [];
1336
- }
1337
- return validFiles;
1338
- }, [multiple, maxFiles, maxFileSize, acceptedFiles, t, onError]);
1339
- var handleFileUpload = React.useCallback(function (files) {
1340
- var validFiles = validateFiles(files);
1341
- if (validFiles.length > 0) {
1342
- var file_1 = validFiles[0];
1343
- // Si es imagen y hay configuración de crop, abrir modal
1344
- if (file_1.type.startsWith("image/") && cropConfig) {
1345
- var reader_1 = new FileReader();
1346
- reader_1.onload = function () {
1347
- setSelectedImageUrl(reader_1.result);
1348
- setOriginalFile(file_1);
1349
- setShowCropModal(true);
1350
- };
1351
- reader_1.readAsDataURL(file_1);
1352
- }
1353
- else {
1354
- // Procesar directamente si no necesita crop
1355
- uploadImageRef.current = file_1;
1356
- onUpload(validFiles);
1357
- }
1358
- }
1359
- }, [onUpload, validateFiles, cropConfig]);
1360
- // Manejar guardado de imagen recortada
1361
- var handleCropSave = React.useCallback(function (croppedFile) {
1362
- uploadImageRef.current = croppedFile;
1363
- setShowCropModal(false);
1364
- setSelectedImageUrl("");
1365
- setOriginalFile(null);
1366
- onUpload([croppedFile]);
1367
- }, [onUpload]);
1368
- // Manejar cancelación de crop
1369
- var handleCropCancel = React.useCallback(function () {
1370
- setShowCropModal(false);
1371
- setSelectedImageUrl("");
1372
- setOriginalFile(null);
1373
- }, []);
1374
- var handleChange = function (event) {
1375
- var files = event.target.files;
1376
- if (files && files.length > 0) {
1377
- handleFileUpload(files);
1378
- }
1379
- // Limpiar el input
1380
- if (inputRef.current) {
1381
- inputRef.current.value = "";
1382
- }
1383
- };
1384
- var handleDragEnter = React.useCallback(function (e) {
1385
- e.preventDefault();
1386
- e.stopPropagation();
1387
- if (!disabled) {
1388
- setIsDragging(true);
1389
- }
1390
- }, [disabled]);
1391
- var handleDragLeave = React.useCallback(function (e) {
1392
- e.preventDefault();
1393
- e.stopPropagation();
1394
- setIsDragging(false);
1395
- }, []);
1396
- var handleDragOver = React.useCallback(function (e) {
1397
- e.preventDefault();
1398
- e.stopPropagation();
1399
- }, []);
1400
- var handleDrop = React.useCallback(function (e) {
1401
- e.preventDefault();
1402
- e.stopPropagation();
1403
- setIsDragging(false);
1404
- if (disabled) {
1405
- return;
1406
- }
1407
- var droppedFiles = e.dataTransfer.files;
1408
- if (droppedFiles.length > 0) {
1409
- handleFileUpload(droppedFiles);
1410
- }
1411
- }, [disabled, handleFileUpload]);
1412
- var handleRemoveImage = function () {
1413
- uploadImageRef.current = null;
1414
- onUpload([]);
1415
- };
1416
- // Clases CSS dinámicas usando Tailwind
1417
- var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
1418
- ? "border-primary-500 bg-primary-50 dark:bg-primary-900"
1419
- : error
1420
- ? "border-danger-500 bg-danger-50 dark:bg-danger-950"
1421
- : success
1422
- ? "border-success-500 bg-success-50 dark:bg-success-950"
1423
- : disabled
1424
- ? "border-gray-300 bg-gray-100 dark:bg-gray-800"
1425
- : "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
1426
- .trim()
1427
- .replace(/\s+/g, " ");
1428
- var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
1429
- var subTextClasses = "\n\t\ttext-tiny text-center\n\t\t".concat(disabled ? "text-default-400" : "text-default-500 dark:text-default-400", "\n\t");
1430
- return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
1431
- ? "opacity-0"
1432
- : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxRuntime.jsxs("div", { className: "text-center px-2", children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
1433
- ? acceptedFiles.join(",")
1434
- : acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsxRuntime.jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsxRuntime.jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
1435
- };
1436
- UploadFile.displayName = "UploadFile";
1437
-
1438
- var Pagination = function (_a) {
1439
- _a.size; var props = __rest(_a, ["size"]);
1440
- return jsxRuntime.jsx(react.Pagination, __assign({ showControls: true, isCompact: true }, props));
1441
- };
1442
-
1443
- var H2 = function (_a) {
1444
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1445
- return (jsxRuntime.jsx("h2", __assign({ className: react.cn("text-lg font-medium", className) }, props, { children: children })));
1446
- };
1447
-
1448
- var H3 = function (_a) {
1449
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1450
- return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium mb-1", className) }, props, { children: children })));
1451
- };
1452
-
1453
- var H4 = function (_a) {
1454
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1455
- return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium mb-1", className) }, props, { children: children })));
1456
- };
1457
-
1458
- var P = function (_a) {
1459
- var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
1460
- return (jsxRuntime.jsx("p", __assign({ className: react.cn("text-sm text-default-500", className) }, props, { children: children })));
1461
- };
1462
-
1463
- var ThemeContext = React.createContext({
1464
- mode: "light",
1465
- color: "blue",
1466
- // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
1467
- setMode: function () { },
1468
- // biome-ignore lint/suspicious/noEmptyBlockStatements: <explanation>
1469
- setColor: function () { },
1470
- });
1471
- var useThemeContext = function () {
1472
- var context = React.useContext(ThemeContext);
1473
- if (!context) {
1474
- throw new Error("useThemeContext debe ser usado dentro de un ThemeProvider");
1475
- }
1476
- return context;
1477
- };
388
+ var useThemeContext = function () {
389
+ var context = React.useContext(ThemeContext);
390
+ if (!context) {
391
+ throw new Error("useThemeContext debe ser usado dentro de un ThemeProvider");
392
+ }
393
+ return context;
394
+ };
1478
395
 
1479
396
  var themeColors = {
1480
397
  "blue-light": {
@@ -1750,257 +667,1901 @@ var themeColors = {
1750
667
  "800": "#FFFACD",
1751
668
  "900": "#fffbe6",
1752
669
  foreground: "#000",
1753
- DEFAULT: "#FFD505",
670
+ DEFAULT: "#FFD505",
671
+ },
672
+ secondary: {
673
+ 50: "#e1efff",
674
+ 100: "#b2d0ff",
675
+ 200: "#83b1fc",
676
+ 300: "#5292f8",
677
+ 400: "#2473f5",
678
+ 500: "#0a5adb",
679
+ 600: "#0246ac",
680
+ 700: "#00327c",
681
+ 800: "#001e4d",
682
+ 900: "#000a1f",
683
+ foreground: "#fff",
684
+ DEFAULT: "#0a5adb",
685
+ },
686
+ focus: "#FFD505",
687
+ overlay: "#ffffff",
688
+ },
689
+ },
690
+ "coral-light": {
691
+ extend: "light",
692
+ colors: {
693
+ primary: {
694
+ "50": "#ffe9e9",
695
+ "100": "#ffcaca",
696
+ "200": "#ffabab",
697
+ "300": "#ff8d8d",
698
+ "400": "#ff6e6e",
699
+ "500": "#ff4f4f",
700
+ "600": "#d24141",
701
+ "700": "#a63333",
702
+ "800": "#792626",
703
+ "900": "#4d1818",
704
+ foreground: "#000",
705
+ DEFAULT: "#ff4f4f",
706
+ },
707
+ focus: "#ff4f4f",
708
+ },
709
+ },
710
+ "coral-dark": {
711
+ extend: "dark",
712
+ colors: {
713
+ primary: {
714
+ "50": "#4d1818",
715
+ "100": "#792626",
716
+ "200": "#a63333",
717
+ "300": "#d24141",
718
+ "400": "#ff4f4f",
719
+ "500": "#ff6e6e",
720
+ "600": "#ff8d8d",
721
+ "700": "#ffabab",
722
+ "800": "#ffcaca",
723
+ "900": "#ffe9e9",
724
+ foreground: "#000",
725
+ DEFAULT: "#ff4f4f",
726
+ },
727
+ focus: "#ff4f4f",
728
+ },
729
+ },
730
+ "green-light": {
731
+ extend: "light",
732
+ colors: {
733
+ primary: {
734
+ 50: "#EFFFEF",
735
+ 100: "#CFFCD1",
736
+ 200: "#A0F9AC",
737
+ 300: "#6FEE8D",
738
+ 400: "#49DE7B",
739
+ 500: "#16C964",
740
+ 600: "#10AC64",
741
+ 700: "#0B905F",
742
+ 800: "#077457",
743
+ 900: "#046051",
744
+ foreground: "#000",
745
+ DEFAULT: "#16C964",
746
+ },
747
+ secondary: {
748
+ "50": "#e3eaff",
749
+ "100": "#D7DFFE",
750
+ "200": "#AFBFFE",
751
+ "300": "#889DFD",
752
+ "400": "#6A82FB",
753
+ "500": "#3956F9",
754
+ "600": "#2941D6",
755
+ "700": "#1C2EB3",
756
+ "800": "#121F90",
757
+ "900": "#0A1477",
758
+ foreground: "#fff",
759
+ DEFAULT: "#3956F9",
760
+ },
761
+ success: {
762
+ "50": "#e7fde3",
763
+ "100": "#E8FCD3",
764
+ "200": "#CBFAA8",
765
+ "300": "#A4F17B",
766
+ "400": "#7EE358",
767
+ "500": "#49D127",
768
+ "600": "#2FB31C",
769
+ "700": "#1A9613",
770
+ "800": "#0C790E",
771
+ "900": "#076410",
772
+ foreground: "#000",
773
+ DEFAULT: "#49D127",
774
+ },
775
+ warning: {
776
+ "50": "#fff9da",
777
+ "100": "#FFF7CC",
778
+ "200": "#FFEE99",
779
+ "300": "#FFE266",
780
+ "400": "#FFD63F",
781
+ "500": "#FFC300",
782
+ "600": "#DBA200",
783
+ "700": "#B78300",
784
+ "800": "#936600",
785
+ "900": "#7A5100",
786
+ foreground: "#000",
787
+ DEFAULT: "#FFC300",
788
+ },
789
+ danger: {
790
+ "50": "#ffe2e5",
791
+ "100": "#FFE3D8",
792
+ "200": "#FFC1B2",
793
+ "300": "#FF988B",
794
+ "400": "#FF726F",
795
+ "500": "#FF3F4C",
796
+ "600": "#DB2E49",
797
+ "700": "#B71F45",
798
+ "800": "#93143F",
799
+ "900": "#7A0C3B",
800
+ foreground: "#000",
801
+ DEFAULT: "#FF3F4C",
802
+ },
803
+ focus: "#66cc8a",
804
+ overlay: "#000000",
805
+ },
806
+ },
807
+ "green-dark": {
808
+ extend: "dark",
809
+ colors: {
810
+ primary: {
811
+ 50: "#EFFFEF",
812
+ 100: "#CFFCD1",
813
+ 200: "#A0F9AC",
814
+ 300: "#6FEE8D",
815
+ 400: "#49DE7B",
816
+ 500: "#16C964",
817
+ 600: "#10AC64",
818
+ 700: "#0B905F",
819
+ 800: "#077457",
820
+ 900: "#046051",
821
+ foreground: "#000",
822
+ DEFAULT: "#16C964",
823
+ },
824
+ secondary: {
825
+ "50": "#e3eaff",
826
+ "100": "#D7DFFE",
827
+ "200": "#AFBFFE",
828
+ "300": "#889DFD",
829
+ "400": "#6A82FB",
830
+ "500": "#3956F9",
831
+ "600": "#2941D6",
832
+ "700": "#1C2EB3",
833
+ "800": "#121F90",
834
+ "900": "#0A1477",
835
+ foreground: "#fff",
836
+ DEFAULT: "#3956F9",
837
+ },
838
+ success: {
839
+ "50": "#e7fde3",
840
+ "100": "#E8FCD3",
841
+ "200": "#CBFAA8",
842
+ "300": "#A4F17B",
843
+ "400": "#7EE358",
844
+ "500": "#49D127",
845
+ "600": "#2FB31C",
846
+ "700": "#1A9613",
847
+ "800": "#0C790E",
848
+ "900": "#076410",
849
+ foreground: "#000",
850
+ DEFAULT: "#49D127",
851
+ },
852
+ warning: {
853
+ "50": "#fff9da",
854
+ "100": "#FFF7CC",
855
+ "200": "#FFEE99",
856
+ "300": "#FFE266",
857
+ "400": "#FFD63F",
858
+ "500": "#FFC300",
859
+ "600": "#DBA200",
860
+ "700": "#B78300",
861
+ "800": "#936600",
862
+ "900": "#7A5100",
863
+ foreground: "#000",
864
+ DEFAULT: "#FFC300",
1754
865
  },
1755
- secondary: {
1756
- 50: "#e1efff",
1757
- 100: "#b2d0ff",
1758
- 200: "#83b1fc",
1759
- 300: "#5292f8",
1760
- 400: "#2473f5",
1761
- 500: "#0a5adb",
1762
- 600: "#0246ac",
1763
- 700: "#00327c",
1764
- 800: "#001e4d",
1765
- 900: "#000a1f",
866
+ danger: {
867
+ "50": "#ffe2e5",
868
+ "100": "#FFE3D8",
869
+ "200": "#FFC1B2",
870
+ "300": "#FF988B",
871
+ "400": "#FF726F",
872
+ "500": "#FF3F4C",
873
+ "600": "#DB2E49",
874
+ "700": "#B71F45",
875
+ "800": "#93143F",
876
+ "900": "#7A0C3B",
1766
877
  foreground: "#fff",
1767
- DEFAULT: "#0a5adb",
878
+ DEFAULT: "#FF3F4C",
1768
879
  },
1769
- focus: "#FFD505",
880
+ focus: "#66cc8a",
1770
881
  overlay: "#ffffff",
1771
882
  },
1772
883
  },
1773
- "coral-light": {
1774
- extend: "light",
1775
- colors: {
1776
- primary: {
1777
- "50": "#ffe9e9",
1778
- "100": "#ffcaca",
1779
- "200": "#ffabab",
1780
- "300": "#ff8d8d",
1781
- "400": "#ff6e6e",
1782
- "500": "#ff4f4f",
1783
- "600": "#d24141",
1784
- "700": "#a63333",
1785
- "800": "#792626",
1786
- "900": "#4d1818",
1787
- foreground: "#000",
1788
- DEFAULT: "#ff4f4f",
1789
- },
1790
- focus: "#ff4f4f",
1791
- },
1792
- },
1793
- "coral-dark": {
1794
- extend: "dark",
1795
- colors: {
1796
- primary: {
1797
- "50": "#4d1818",
1798
- "100": "#792626",
1799
- "200": "#a63333",
1800
- "300": "#d24141",
1801
- "400": "#ff4f4f",
1802
- "500": "#ff6e6e",
1803
- "600": "#ff8d8d",
1804
- "700": "#ffabab",
1805
- "800": "#ffcaca",
1806
- "900": "#ffe9e9",
1807
- foreground: "#000",
1808
- DEFAULT: "#ff4f4f",
1809
- },
1810
- focus: "#ff4f4f",
1811
- },
884
+ };
885
+
886
+ var ColorSelector = function (_a) {
887
+ var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
888
+ var mode = useThemeContext().mode;
889
+ /**
890
+ * Filters and maps the available theme colors to the current theme mode (light/dark).
891
+ * Each color option contains:
892
+ * - value: the theme name (e.g., "blue-light")
893
+ * - label: the base color name (e.g., "blue")
894
+ * - color: the primary color hex value
895
+ */
896
+ var colorOptions = Object.entries(themeColors)
897
+ .filter(function (_a) {
898
+ var themeData = _a[1];
899
+ var themeMode = themeData.extend;
900
+ return mode === "light" ? themeMode === "light" : themeMode === "dark";
901
+ })
902
+ .map(function (_a) {
903
+ var themeName = _a[0], theme = _a[1];
904
+ return ({
905
+ value: themeName,
906
+ label: themeName.split("-")[0],
907
+ color: theme.colors.primary.DEFAULT,
908
+ });
909
+ });
910
+ return (jsxRuntime.jsx(react.RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
911
+ base: "flex flex-wrap !gap-2",
912
+ wrapper: "flex flex-wrap !gap-2",
913
+ }, children: colorOptions.map(function (color) { return (jsxRuntime.jsx(react.Radio, { value: color.label, className: "p-0 m-0", classNames: {
914
+ base: "p-0 m-0",
915
+ wrapper: "hidden",
916
+ labelWrapper: "p-0 m-0",
917
+ }, children: jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
918
+ ? "border-black border-opacity-20 scale-110"
919
+ : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
920
+ };
921
+
922
+ var H1 = function (_a) {
923
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
924
+ return (jsxRuntime.jsx("h1", __assign({ className: react.cn("text-xl font-bold", className) }, props, { children: children })));
925
+ };
926
+
927
+ var H3 = function (_a) {
928
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
929
+ return (jsxRuntime.jsx("h3", __assign({ className: react.cn("text-base font-medium mb-1", className) }, props, { children: children })));
930
+ };
931
+
932
+ var H4 = function (_a) {
933
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
934
+ return (jsxRuntime.jsx("h4", __assign({ className: react.cn("text-sm font-medium mb-1", className) }, props, { children: children })));
935
+ };
936
+
937
+ var ConfigMenu = function (_a) {
938
+ var _b;
939
+ var options = _a.options, onLogout = _a.onLogout, translations = _a.translations;
940
+ return (jsxRuntime.jsxs(react.Dropdown, { className: "min-w-40", children: [jsxRuntime.jsx(react.DropdownTrigger, { children: jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "default", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:settings-linear" }) }) }), jsxRuntime.jsxs(react.DropdownMenu, { "aria-label": "Configuration", children: [jsxRuntime.jsx(react.DropdownSection, { showDivider: true, className: "mb-0", children: options.map(function (item) { return (jsxRuntime.jsx(react.DropdownItem, { href: item.href, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
941
+ base: "text-default-500",
942
+ }, startContent: item.icon ? jsxRuntime.jsx(IconComponent, { icon: item.icon }) : undefined, children: item.label }, item.label)); }) }), jsxRuntime.jsx(react.DropdownSection, { children: jsxRuntime.jsx(react.DropdownItem, { onPress: onLogout, className: "data-[hover=true]:bg-primary-100 data-[hover=true]:text-default-700", classNames: {
943
+ base: "text-default-500",
944
+ }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:logout-2-linear" }), children: (_b = translations === null || translations === void 0 ? void 0 : translations.logout) !== null && _b !== void 0 ? _b : "Logout" }, "logout") })] })] }));
945
+ };
946
+ ConfigMenu.displayName = "ConfigMenu";
947
+
948
+ var NotificationButton = function (_a) {
949
+ var _b = _a.notificationCount, notificationCount = _b === void 0 ? 0 : _b;
950
+ return (jsxRuntime.jsx(react.Button, { isIconOnly: true, color: "secondary", variant: "flat", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:bell-bing-linear" }), children: notificationCount > 0 && (jsxRuntime.jsx("span", { className: "notification__alert", children: notificationCount })) }));
951
+ };
952
+ NotificationButton.displayName = "NotificationButton";
953
+
954
+ var HeaderComponent = function (_a) {
955
+ var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, translations = _a.translations;
956
+ return (jsxRuntime.jsxs("header", { className: "header__container", children: [jsxRuntime.jsx(react.Button, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick }), jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [jsxRuntime.jsx(NotificationButton, { notificationCount: notificationCount }), jsxRuntime.jsx(ConfigMenu, { options: options, onLogout: onLogout, translations: translations })] })] }));
957
+ };
958
+ HeaderComponent.displayName = "Header";
959
+
960
+ function normalizeClass(value) {
961
+ if (typeof value === "string") {
962
+ return value || undefined;
963
+ }
964
+ if (Array.isArray(value)) {
965
+ return value.filter(Boolean).join(" ") || undefined;
966
+ }
967
+ return undefined;
968
+ }
969
+ var getSectionClasses = function (isCollapsed, sectionClassesProp) {
970
+ if (sectionClassesProp === void 0) { sectionClassesProp = {}; }
971
+ return (__assign(__assign({}, Object.fromEntries(Object.entries(sectionClassesProp).map(function (_a) {
972
+ var k = _a[0], v = _a[1];
973
+ return [k, normalizeClass(v)];
974
+ }))), { base: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.base, "w-full", {
975
+ "p-0 max-w-[44px]": isCollapsed,
976
+ })), group: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.group, {
977
+ "flex flex-col gap-1": isCollapsed,
978
+ })), heading: normalizeClass(react.cn(sectionClassesProp === null || sectionClassesProp === void 0 ? void 0 : sectionClassesProp.heading, {
979
+ hidden: isCollapsed,
980
+ })) }));
981
+ };
982
+ var getItemClasses = function (isCollapsed, itemClassesProp) {
983
+ if (itemClassesProp === void 0) { itemClassesProp = {}; }
984
+ return (__assign(__assign({}, Object.fromEntries(Object.entries(itemClassesProp).map(function (_a) {
985
+ var k = _a[0], v = _a[1];
986
+ return [k, normalizeClass(v)];
987
+ }))), { base: normalizeClass(react.cn(itemClassesProp === null || itemClassesProp === void 0 ? void 0 : itemClassesProp.base, {
988
+ "w-11 h-11 gap-0 p-0": isCollapsed,
989
+ })) }));
990
+ };
991
+
992
+ var EnumMenuNavListItem;
993
+ (function (EnumMenuNavListItem) {
994
+ EnumMenuNavListItem["Nest"] = "nest";
995
+ })(EnumMenuNavListItem || (EnumMenuNavListItem = {}));
996
+
997
+ /**
998
+ * @component MenuNavList
999
+ * @description A versatile navigation list component that can be displayed in an expanded or collapsed state.
1000
+ * It supports nested items, sections, and tooltips for items in the collapsed state.
1001
+ *
1002
+ * @param {MenuNavListProps} props - Props for configuring the component.
1003
+ * @param {MenuNavListItem[]} props.items - Array of items to display in the list.
1004
+ * @param {boolean} [props.isCollapsed] - If `true`, the menu is displayed in its collapsed state (icons only).
1005
+ * @param {React.Key} [props.defaultSelectedKey] - The key of the default selected item.
1006
+ * @param {(key: React.Key) => void} [props.onSelect] - Callback executed when an item is selected.
1007
+ * @param {boolean} [props.hideEndContent] - If `true`, hides the end content of the items.
1008
+ * @param {object} [props.sectionClasses] - CSS classes to customize the sections.
1009
+ * @param {object} [props.itemClasses] - CSS classes to customize the items.
1010
+ * @param {string} [props.iconClassName] - CSS class for the icons.
1011
+ * @param {object} [props.classNames] - CSS classes to customize the Listbox component.
1012
+ * @param {string} [props.className] - CSS class for the main container.
1013
+ *
1014
+ * @forwardRef
1015
+ */
1016
+ var MenuNavList = React.forwardRef(function (_a, ref) {
1017
+ var items = _a.items, isCollapsed = _a.isCollapsed, defaultSelectedKey = _a.defaultSelectedKey; _a.onSelect; var hideEndContent = _a.hideEndContent, _b = _a.sectionClasses, sectionClassesProp = _b === void 0 ? {} : _b, _c = _a.itemClasses, itemClassesProp = _c === void 0 ? {} : _c, iconClassName = _a.iconClassName, classNames = _a.classNames, className = _a.className, props = __rest(_a, ["items", "isCollapsed", "defaultSelectedKey", "onSelect", "hideEndContent", "sectionClasses", "itemClasses", "iconClassName", "classNames", "className"]);
1018
+ var _d = React.useState(defaultSelectedKey), selected = _d[0], setSelected = _d[1];
1019
+ // Component styles
1020
+ var sectionClasses = getSectionClasses(isCollapsed, sectionClassesProp);
1021
+ var itemClasses = getItemClasses(isCollapsed, itemClassesProp);
1022
+ // Handles the click event on an item, updating the selection state.
1023
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1024
+ var handleItemPress = React.useCallback(function (item, parentKey) {
1025
+ var keySelected = typeof parentKey === "string" ? parentKey : item.key;
1026
+ setSelected(keySelected);
1027
+ // Force blur to remove hover state after click.
1028
+ if (document.activeElement instanceof HTMLElement) {
1029
+ document.activeElement.blur();
1030
+ }
1031
+ }, [setSelected]);
1032
+ // Renders the item displayed inside the Popover when the menu is collapsed.
1033
+ var renderCompactItem = React.useCallback(function (item, parentKey) {
1034
+ var _a, _b;
1035
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: (_a = item.endContent) !== null && _a !== void 0 ? _a : null, startContent: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_b = item.startContent) !== null && _b !== void 0 ? _b : null)), textValue: item.title, title: item.title, className: "data-[hover=true]:text-default-600", onPress: function () { return handleItemPress(item, parentKey); } })));
1036
+ }, [handleItemPress, iconClassName]);
1037
+ // Renders a nested item, i.e., an item that has sub-items.
1038
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1039
+ var renderNestItem = React.useCallback(function (item) {
1040
+ var _a, _b, _c, _d, _e, _f, _g;
1041
+ var isNestType = item.items &&
1042
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1043
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
1044
+ if (isNestType) {
1045
+ item.href = undefined;
1046
+ }
1047
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, classNames: {
1048
+ base: react.cn({
1049
+ "h-auto p-0": !isCollapsed && isNestType,
1050
+ }, {
1051
+ "inline-block w-11": isCollapsed && isNestType,
1052
+ }, {
1053
+ "data-[selected=true]:bg-primary-100 h-11 justify-center items-center flex": isCollapsed && isNestType,
1054
+ }, "rounded-large"),
1055
+ }, endContent: isCollapsed || isNestType || hideEndContent
1056
+ ? null
1057
+ : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed || isNestType ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-foreground", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), title: isCollapsed || isNestType ? null : item.title }),
1058
+ isCollapsed && isNestType ? (jsxRuntime.jsxs(react.Popover, { placement: "right", offset: 10, children: [jsxRuntime.jsx(react.PopoverTrigger, { children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", classNames: {
1059
+ base: "text-default-500",
1060
+ }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) }) }) }), jsxRuntime.jsx(react.PopoverContent, { className: "p-0", children: jsxRuntime.jsxs("div", { className: "min-w-[200px] rounded-large p-2", children: [jsxRuntime.jsx("div", { className: "p-2 text-small font-semibold text-default-500", children: item.title }), jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", "aria-label": "Nested menu items", items: item.items, variant: "flat", children: item.items && ((_e = item.items) === null || _e === void 0 ? void 0 : _e.length) > 0
1061
+ ? item.items.map(function (child) {
1062
+ return renderCompactItem(child, item.key);
1063
+ })
1064
+ : renderCompactItem(item) })] }) })] })) : null,
1065
+ !isCollapsed && isNestType ? (jsxRuntime.jsx(react.Accordion, { className: "p-0", children: jsxRuntime.jsx(react.AccordionItem, { "aria-label": item.title, classNames: {
1066
+ heading: "pr-3 group-data-[selected=true]:bg-primary-100 rounded-large",
1067
+ trigger: "p-0",
1068
+ content: "py-0 pl-4",
1069
+ }, title: item.icon ? (jsxRuntime.jsxs("div", { className: "flex h-11 items-center gap-2 px-3 py-1.5", children: [jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500 group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" }), jsxRuntime.jsx("span", { className: "text-small font-medium text-default-500 group-data-[selected=true]:text-default-600", children: item.title })] })) : (((_f = item.startContent) !== null && _f !== void 0 ? _f : null)), children: item.items && ((_g = item.items) === null || _g === void 0 ? void 0 : _g.length) > 0 ? (jsxRuntime.jsx(react.Listbox, { className: "mt-0.5 text-default-500", classNames: {
1070
+ list: react.cn("border-l border-default-200 pl-4"),
1071
+ }, items: item.items, variant: "flat", children: item.items.map(function (child) { return renderItem(child, item.key); }) })) : (renderItem(item)) }, item.key) })) : null));
1072
+ }, [isCollapsed, hideEndContent, iconClassName, items, selected]);
1073
+ // Renders a simple item (without children) in the navigation list.
1074
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
1075
+ var renderItem = React.useCallback(function (item, parentKey) {
1076
+ var _a, _b, _c, _d;
1077
+ var isNestType = item.items &&
1078
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1079
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest;
1080
+ if (isNestType) {
1081
+ return renderNestItem(item);
1082
+ }
1083
+ var isItemSelected = selected === item.key;
1084
+ return (React.createElement(react.ListboxItem, __assign({}, item, { key: item.key, endContent: isCollapsed || hideEndContent ? null : ((_b = item.endContent) !== null && _b !== void 0 ? _b : null), startContent: isCollapsed ? null : item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_c = item.startContent) !== null && _c !== void 0 ? _c : null)), textValue: item.title, title: isCollapsed ? null : item.title, onPress: function () { return handleItemPress(item, parentKey); }, "aria-selected": isItemSelected, "aria-label": item.title || "Menu item ".concat(item.key) }), isCollapsed ? (jsxRuntime.jsx(react.Tooltip, { content: item.title, placement: "right", closeDelay: 200, shouldCloseOnBlur: false, classNames: {
1085
+ base: "text-default-500",
1086
+ }, children: jsxRuntime.jsx("div", { className: "flex w-full items-center justify-center", "aria-hidden": "true", children: item.icon ? (jsxRuntime.jsx(IconComponent, { className: react.cn("text-default-500", "group-data-[selected=true]:text-default-600", iconClassName), icon: item.icon, size: "lg" })) : (((_d = item.startContent) !== null && _d !== void 0 ? _d : null)) }) })) : null));
1087
+ },
1088
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1089
+ [isCollapsed, hideEndContent, iconClassName, itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base]);
1090
+ return (jsxRuntime.jsx(react.Listbox, __assign({ ref: ref, hideSelectedIcon: true, as: "nav", className: react.cn("list-none", className), classNames: __assign(__assign({}, classNames), { list: react.cn("items-center", classNames === null || classNames === void 0 ? void 0 : classNames.list) }), color: "default", itemClasses: __assign(__assign({}, itemClasses), { base: react.cn("px-3 min-h-11 rounded-large h-[44px] data-[selected=true]:bg-primary-100", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.base), title: react.cn("text-small font-medium text-default-500 group-data-[selected=true]:text-default-600 ", itemClasses === null || itemClasses === void 0 ? void 0 : itemClasses.title) }), items: items, selectedKeys: [selected], selectionMode: "single", variant: "flat" }, props, { children: function (item) {
1091
+ var _a, _b;
1092
+ return item.items &&
1093
+ ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1094
+ (item === null || item === void 0 ? void 0 : item.type) === EnumMenuNavListItem.Nest ? (renderNestItem(item)) : item.items && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsxRuntime.jsx(react.ListboxSection, { classNames: sectionClasses, showDivider: isCollapsed, title: item.title, children: item.items.map(renderItem) }, item.key)) : (renderItem(item));
1095
+ } }), isCollapsed ? "compact" : "default"));
1096
+ });
1097
+ MenuNavList.displayName = "MenuNavList";
1098
+
1099
+ /**
1100
+ * Sidebar menu component for navigation and user actions.
1101
+ * @param commerceInfo - Object with logo and name of the company.
1102
+ * @param userInfo - Object with user avatar, name, and email.
1103
+ * @param helpButton - Help button configuration.
1104
+ * @param upgradeCard - Optional upgrade card configuration.
1105
+ * @param isOpenSidebar - Controls sidebar visibility.
1106
+ * @param onOpenSidebarChange - Callback to open/close sidebar.
1107
+ */
1108
+ var MenuComponent = React.memo(function Menu(_a) {
1109
+ var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, upgradeCard = _a.upgradeCard, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems;
1110
+ // State to control menu collapse on desktop devices
1111
+ var _b = React.useState(false), isCollapsed = _b[0], setIsCollapsed = _b[1];
1112
+ // Memoized handlers for performance
1113
+ var handleSidebarClose = React.useCallback(function () {
1114
+ onOpenSidebarChange === null || onOpenSidebarChange === void 0 ? void 0 : onOpenSidebarChange(false);
1115
+ }, [onOpenSidebarChange]);
1116
+ var handleCollapseToggle = React.useCallback(function () {
1117
+ setIsCollapsed(function (prev) { return !prev; });
1118
+ }, []);
1119
+ var handleUpgradeClick = React.useCallback(function () {
1120
+ if (upgradeCard) {
1121
+ window.open(upgradeCard.buttonLink, "_blank");
1122
+ }
1123
+ }, [upgradeCard]);
1124
+ var handleHelpClick = React.useCallback(function () {
1125
+ window.open(helpButton.redirect, "_blank");
1126
+ }, [helpButton]);
1127
+ if (!isOpenSidebar) {
1128
+ return null;
1129
+ }
1130
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { type: "button", "aria-label": "Close sidebar", className: "fixed inset-0 bg-black bg-opacity-40 z-40 xs:block sm:hidden", onClick: handleSidebarClose, style: { border: "none", padding: 0, margin: 0 } }), jsxRuntime.jsx("div", { className: "container__menu ".concat(isCollapsed
1131
+ ? "container__menu--collapsed"
1132
+ : "container__menu--expanded"), children: jsxRuntime.jsxs("div", { className: "content__menu", children: [jsxRuntime.jsxs("div", { className: "content__menu--header", style: { flexDirection: isCollapsed ? "column-reverse" : "row" }, children: [jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-center ".concat(isCollapsed ? "gap-0" : "gap-2"), children: [jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-foreground", children: jsxRuntime.jsx("img", { src: commerceInfo.logo, alt: "Logo of ".concat(commerceInfo.name) }) }), jsxRuntime.jsx("span", { className: "collapsible-item text-small font-bold ", children: commerceInfo.name })] }), jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx(IconComponent, { icon: "material-symbols-light:close", size: "lg", className: "cursor-pointer block sm:hidden", onClick: handleSidebarClose }), jsxRuntime.jsx(IconComponent, { icon: isCollapsed
1133
+ ? "solar:alt-arrow-right-outline"
1134
+ : "solar:alt-arrow-left-outline", size: "lg", className: "hidden sm:block cursor-pointer", onClick: handleCollapseToggle })] })] }), jsxRuntime.jsx(react.Spacer, { y: 6 }), jsxRuntime.jsxs("div", { className: "content__menu--user ".concat(isCollapsed ? "gap-0" : "gap-3"), children: [jsxRuntime.jsx(react.Avatar, { size: "md", src: userInfo.avatar, color: userInfo.avatar === "" ? "warning" : "default", name: userInfo.name }), jsxRuntime.jsxs("div", { className: "collapsible-item flex flex-col", children: [jsxRuntime.jsx("p", { className: "text-small font-medium text-default-900", children: userInfo.name }), jsxRuntime.jsx("p", { className: "text-tiny text-default-400", children: userInfo.role })] })] }), jsxRuntime.jsx("div", { className: "".concat(!isCollapsed ? "flex-1" : "h-full", " min-h-0 py-6"), children: jsxRuntime.jsx("div", { className: "h-full overflow-y-auto pr-6 -mr-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: jsxRuntime.jsx(MenuNavList, { defaultSelectedKey: menuItems.selectedKey, items: menuItems.items, isCollapsed: isCollapsed }) }) }), upgradeCard && (jsxRuntime.jsxs("div", { className: "collapsible-item relative", children: [jsxRuntime.jsxs(react.Card, { className: "border-none overflow-visible shadow-none", shadow: "sm", children: [jsxRuntime.jsxs(react.CardBody, { className: "items-center py-5 text-center gap-1", children: [jsxRuntime.jsx("h3", { className: "text-medium font-medium text-default-900", children: upgradeCard.title }), jsxRuntime.jsx("p", { className: "text-small text-default-500 pb-3 whitespace-normal", children: upgradeCard.description })] }), jsxRuntime.jsx(react.CardFooter, { className: "absolute justify-center", style: { bottom: "-30px" }, children: jsxRuntime.jsx(react.Button, { className: "px-10 shadow-md", color: "primary", radius: "full", variant: "shadow", onPress: handleUpgradeClick, children: upgradeCard.buttonText }) })] }), jsxRuntime.jsx(react.Spacer, { y: 9 })] })), jsxRuntime.jsx("div", { className: "mt-auto flex flex-col justify-center items-center", children: jsxRuntime.jsx(react.Button, { fullWidth: true, className: " text-default-500 data-[hover=true]:text-default-600", startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed && (jsxRuntime.jsx("span", { className: "collapsible-item", children: helpButton.title })) }) })] }) })] }));
1135
+ });
1136
+
1137
+ var StepIndicator = function (_a) {
1138
+ var currentStep = _a.currentStep, totalSteps = _a.totalSteps, _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.showStepText, showStepText = _c === void 0 ? true : _c, stepTextFormatter = _a.stepTextFormatter, className = _a.className, props = __rest(_a, ["currentStep", "totalSteps", "color", "showStepText", "stepTextFormatter", "className"]);
1139
+ var progressPercentage = Math.min((currentStep / totalSteps) * 100, 100);
1140
+ var colorClasses = {
1141
+ primary: "bg-primary",
1142
+ secondary: "bg-secondary",
1143
+ success: "bg-success",
1144
+ warning: "bg-warning",
1145
+ danger: "bg-danger",
1146
+ };
1147
+ var defaultStepText = function (current, total) {
1148
+ return "Step ".concat(current, " of ").concat(total);
1149
+ };
1150
+ var stepText = stepTextFormatter
1151
+ ? stepTextFormatter(currentStep, totalSteps)
1152
+ : defaultStepText(currentStep, totalSteps);
1153
+ return (jsxRuntime.jsxs("div", __assign({ className: react.cn("w-full", className) }, props, { children: [showStepText && (jsxRuntime.jsx("div", { className: "text-center text-sm font-medium text-default-400 mb-3", children: stepText })), jsxRuntime.jsx("div", { className: "w-full bg-content2 rounded-full h-2 overflow-hidden", children: jsxRuntime.jsx("div", { className: react.cn("h-full transition-all duration-300 ease-out rounded-full", colorClasses[color]), style: { width: "".concat(progressPercentage, "%") } }) })] })));
1154
+ };
1155
+
1156
+ /*
1157
+ * Copyright 2020 Adobe. All rights reserved.
1158
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1159
+ * you may not use this file except in compliance with the License. You may obtain a copy
1160
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1161
+ *
1162
+ * Unless required by applicable law or agreed to in writing, software distributed under
1163
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1164
+ * OF ANY KIND, either express or implied. See the License for the specific language
1165
+ * governing permissions and limitations under the License.
1166
+ */
1167
+ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
1168
+ let [stateValue, setStateValue] = (React.useState)(value || defaultValue);
1169
+ let isControlledRef = (React.useRef)(value !== undefined);
1170
+ let isControlled = value !== undefined;
1171
+ (React.useEffect)(()=>{
1172
+ let wasControlled = isControlledRef.current;
1173
+ if (wasControlled !== isControlled && process.env.NODE_ENV !== 'production') console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
1174
+ isControlledRef.current = isControlled;
1175
+ }, [
1176
+ isControlled
1177
+ ]);
1178
+ let currentValue = isControlled ? value : stateValue;
1179
+ let setValue = (React.useCallback)((value, ...args)=>{
1180
+ let onChangeCaller = (value, ...onChangeArgs)=>{
1181
+ if (onChange) {
1182
+ if (!Object.is(currentValue, value)) onChange(value, ...onChangeArgs);
1183
+ }
1184
+ if (!isControlled) // If uncontrolled, mutate the currentValue local variable so that
1185
+ // calling setState multiple times with the same value only emits onChange once.
1186
+ // We do not use a ref for this because we specifically _do_ want the value to
1187
+ // reset every render, and assigning to a ref in render breaks aborted suspended renders.
1188
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1189
+ currentValue = value;
1190
+ };
1191
+ if (typeof value === 'function') {
1192
+ if (process.env.NODE_ENV !== 'production') console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
1193
+ // this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
1194
+ // when someone using useControlledState calls setControlledState(myFunc)
1195
+ // this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
1196
+ // if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
1197
+ // otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
1198
+ let updateFunction = (oldValue, ...functionArgs)=>{
1199
+ let interceptedValue = value(isControlled ? currentValue : oldValue, ...functionArgs);
1200
+ onChangeCaller(interceptedValue, ...args);
1201
+ if (!isControlled) return interceptedValue;
1202
+ return oldValue;
1203
+ };
1204
+ setStateValue(updateFunction);
1205
+ } else {
1206
+ if (!isControlled) setStateValue(value);
1207
+ onChangeCaller(value, ...args);
1208
+ }
1209
+ }, [
1210
+ isControlled,
1211
+ currentValue,
1212
+ onChange
1213
+ ]);
1214
+ return [
1215
+ currentValue,
1216
+ setValue
1217
+ ];
1218
+ }
1219
+
1220
+ var defaultTranslations$4 = {
1221
+ checkIconTitle: "Check",
1222
+ };
1223
+ var VerticalSteps = React.forwardRef(function (_a, ref) {
1224
+ var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className, translations = _a.translations, props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
1225
+ var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
1226
+ var t = __assign(__assign({}, defaultTranslations$4), translations);
1227
+ var steps = React.useMemo(function () {
1228
+ if (typeof stepsProp === "number") {
1229
+ return Array.from({ length: stepsProp }, function () { return ({}); });
1230
+ }
1231
+ return stepsProp;
1232
+ }, [stepsProp]);
1233
+ var colors = React.useMemo(function () {
1234
+ var _a;
1235
+ var colorMappings = {
1236
+ primary: [
1237
+ "[--step-color:hsl(var(--heroui-primary))]",
1238
+ "[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
1239
+ ],
1240
+ secondary: [
1241
+ "[--step-color:hsl(var(--heroui-secondary))]",
1242
+ "[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
1243
+ ],
1244
+ success: [
1245
+ "[--step-color:hsl(var(--heroui-success))]",
1246
+ "[--step-fg-color:hsl(var(--heroui-success-foreground))]",
1247
+ ],
1248
+ warning: [
1249
+ "[--step-color:hsl(var(--heroui-warning))]",
1250
+ "[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
1251
+ ],
1252
+ danger: [
1253
+ "[--step-color:hsl(var(--heroui-danger))]",
1254
+ "[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
1255
+ ],
1256
+ default: [
1257
+ "[--step-color:hsl(var(--heroui-default))]",
1258
+ "[--step-fg-color:hsl(var(--heroui-default-foreground))]",
1259
+ ],
1260
+ };
1261
+ var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
1262
+ var colorsVars = [
1263
+ "[--active-fg-color:var(--step-fg-color)]",
1264
+ "[--active-border-color:var(--step-color)]",
1265
+ "[--active-color:var(--step-color)]",
1266
+ "[--complete-background-color:var(--step-color)]",
1267
+ "[--complete-border-color:var(--step-color)]",
1268
+ "[--inactive-border-color:hsl(var(--heroui-default-300))]",
1269
+ "[--inactive-color:hsl(var(--heroui-default-300))]",
1270
+ ];
1271
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
1272
+ colorsVars.unshift(fgColor);
1273
+ }
1274
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
1275
+ colorsVars.unshift(userColor);
1276
+ }
1277
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
1278
+ colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
1279
+ }
1280
+ return colorsVars;
1281
+ }, [color, className]);
1282
+ return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "max-w-fit", children: jsxRuntime.jsx("ol", { className: react.cn("flex flex-col gap-y-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
1283
+ var status = currentStep === stepIdx
1284
+ ? "active"
1285
+ : currentStep < stepIdx
1286
+ ? "inactive"
1287
+ : "complete";
1288
+ return (
1289
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
1290
+ jsxRuntime.jsxs("li", { className: "relative", children: [jsxRuntime.jsx("div", { className: "flex w-full max-w-full items-center", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer items-center justify-center gap-4 px-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "flex h-full items-center", children: jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx("div", { className: "relative", children: jsxRuntime.jsx(framerMotion.m.div, { animate: status, className: react.cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
1291
+ "shadow-lg": status === "complete",
1292
+ }), "data-status": status, initial: false, transition: { duration: 0.25 }, variants: {
1293
+ inactive: {
1294
+ backgroundColor: "transparent",
1295
+ borderColor: "var(--inactive-border-color)",
1296
+ color: "var(--inactive-color)",
1297
+ },
1298
+ active: {
1299
+ backgroundColor: "transparent",
1300
+ borderColor: "var(--active-border-color)",
1301
+ color: "var(--active-color)",
1302
+ },
1303
+ complete: {
1304
+ backgroundColor: "var(--complete-background-color)",
1305
+ borderColor: "var(--complete-border-color)",
1306
+ },
1307
+ }, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded", title: t.checkIconTitle })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), jsxRuntime.jsx("div", { className: "flex-1 text-left", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { className: react.cn("text-medium text-default-600 font-medium transition-[color,opacity] duration-300 group-active:opacity-70", {
1308
+ "text-default-300": status === "inactive",
1309
+ }), children: step.title }), jsxRuntime.jsx("div", { className: react.cn("text-tiny text-default-600 lg:text-small transition-[color,opacity] duration-300 group-active:opacity-70", {
1310
+ "text-default-300": status === "inactive",
1311
+ }), children: step.description })] }) })] }), stepIdx) }), stepIdx < steps.length - 1 && !hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: react.cn("pointer-events-none absolute top-[calc(64px*var(--idx)+1)] left-3 flex h-1/2 -translate-y-1/3 items-center px-4"), style: {
1312
+ // @ts-ignore
1313
+ "--idx": stepIdx,
1314
+ }, children: jsxRuntime.jsx("div", { className: react.cn("relative h-full w-0.5 bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-0 after:w-full after:bg-[var(--active-border-color)] after:transition-[height] after:duration-300 after:content-['']", {
1315
+ "after:h-full": stepIdx < currentStep,
1316
+ }) }) }))] }, stepIdx));
1317
+ }) }) }));
1318
+ });
1319
+ VerticalSteps.displayName = "VerticalSteps";
1320
+
1321
+ var stepperClasses = react.cn(
1322
+ // light
1323
+ "[--step-color:hsl(var(--heroui-primary-400))]", "[--active-color:hsl(var(--heroui-primary-400))]", "[--inactive-border-color:hsl(var(--heroui-primary-200))]", "[--inactive-bar-color:hsl(var(--heroui-primary-200))]", "[--inactive-color:hsl(var(--heroui-primary-300))]",
1324
+ // dark
1325
+ "dark:[--step-color:rgba(255,255,255,0.1)]", "dark:[--active-color:hsl(var(--heroui-foreground-600))]", "dark:[--active-border-color:rgba(255,255,255,0.5)]", "dark:[--inactive-border-color:rgba(255,255,255,0.1)]", "dark:[--inactive-bar-color:rgba(255,255,255,0.1)]", "dark:[--inactive-color:rgba(255,255,255,0.2)]");
1326
+ var MultiStepSidebar = React.forwardRef(function (_a, ref) {
1327
+ var children = _a.children, className = _a.className, currentPage = _a.currentPage; _a.onBack; var onChangePage = _a.onChangePage, steps = _a.steps; _a.goBackTranslation; var onClose = _a.onClose, props = __rest(_a, ["children", "className", "currentPage", "onBack", "onChangePage", "steps", "goBackTranslation", "onClose"]);
1328
+ var handleOverlayClick = function (e) {
1329
+ if (e.target === e.currentTarget) {
1330
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1331
+ }
1332
+ };
1333
+ return (jsxRuntime.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-content3/50 backdrop-blur-sm", onClick: handleOverlayClick, children: jsxRuntime.jsxs("div", __assign({ ref: ref, className: react.cn("flex h-full w-full max-w-4xl rounded-lg bg-background shadow-lg lg:h-auto", className) }, props, { children: [jsxRuntime.jsx("div", { className: "hidden w-1/3 flex-col items-center gap-y-8 p-8 lg:flex", children: jsxRuntime.jsx(VerticalSteps, { className: stepperClasses, color: "primary", currentStep: currentPage, steps: steps, onStepChange: onChangePage }) }), jsxRuntime.jsxs("div", { className: "relative flex h-auto w-full flex-col items-center gap-4 md:p-4 lg:w-2/3", children: [jsxRuntime.jsx(Button, { isIconOnly: true, className: "absolute right-4 top-4", size: "sm", variant: "light", color: "default", onPress: onClose, startContent: jsxRuntime.jsx(IconComponent, { className: "text-foreground", icon: "material-symbols:close-rounded", size: "lg" }) }), jsxRuntime.jsx("div", { className: "pt-9 w-10/12 lg:hidden", children: jsxRuntime.jsx("div", { className: "flex justify-center", children: jsxRuntime.jsx(StepIndicator, { className: react.cn(stepperClasses), currentStep: currentPage + 1, totalSteps: steps.length }) }) }), jsxRuntime.jsx("div", { className: "h-full w-full p-4 sm:max-w-md md:max-w-lg", children: children })] })] })) }));
1334
+ });
1335
+ MultiStepSidebar.displayName = "MultiStepSidebar";
1336
+
1337
+ var MultistepNavigationButtons = function (_a) {
1338
+ var nextButtonProps = _a.nextButtonProps, cancelButtonProps = _a.cancelButtonProps, className = _a.className;
1339
+ // const { children: backButtonChildren, ...restBackButtonProps } =
1340
+ // backButtonProps || {};
1341
+ var _b = nextButtonProps || {}, nextButtonChildren = _b.children, restNextButtonProps = __rest(_b, ["children"]);
1342
+ var _c = cancelButtonProps || {}, cancelButtonChildren = _c.children, restCancelButtonProps = __rest(_c, ["children"]);
1343
+ return (jsxRuntime.jsx("div", { className: react.cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row", children: [jsxRuntime.jsx(react.Button, __assign({ className: "w-full sm:w-auto", color: "primary", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsxRuntime.jsx(react.Button, __assign({ className: "w-full sm:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1344
+ };
1345
+
1346
+ var variants = {
1347
+ enter: function (direction) { return ({
1348
+ y: direction > 0 ? 30 : -30,
1349
+ opacity: 0,
1350
+ }); },
1351
+ center: {
1352
+ zIndex: 1,
1353
+ y: 0,
1354
+ opacity: 1,
1812
1355
  },
1813
- "green-light": {
1814
- extend: "light",
1815
- colors: {
1816
- primary: {
1817
- 50: "#EFFFEF",
1818
- 100: "#CFFCD1",
1819
- 200: "#A0F9AC",
1820
- 300: "#6FEE8D",
1821
- 400: "#49DE7B",
1822
- 500: "#16C964",
1823
- 600: "#10AC64",
1824
- 700: "#0B905F",
1825
- 800: "#077457",
1826
- 900: "#046051",
1827
- foreground: "#000",
1828
- DEFAULT: "#16C964",
1829
- },
1830
- secondary: {
1831
- "50": "#e3eaff",
1832
- "100": "#D7DFFE",
1833
- "200": "#AFBFFE",
1834
- "300": "#889DFD",
1835
- "400": "#6A82FB",
1836
- "500": "#3956F9",
1837
- "600": "#2941D6",
1838
- "700": "#1C2EB3",
1839
- "800": "#121F90",
1840
- "900": "#0A1477",
1841
- foreground: "#fff",
1842
- DEFAULT: "#3956F9",
1843
- },
1844
- success: {
1845
- "50": "#e7fde3",
1846
- "100": "#E8FCD3",
1847
- "200": "#CBFAA8",
1848
- "300": "#A4F17B",
1849
- "400": "#7EE358",
1850
- "500": "#49D127",
1851
- "600": "#2FB31C",
1852
- "700": "#1A9613",
1853
- "800": "#0C790E",
1854
- "900": "#076410",
1855
- foreground: "#000",
1856
- DEFAULT: "#49D127",
1857
- },
1858
- warning: {
1859
- "50": "#fff9da",
1860
- "100": "#FFF7CC",
1861
- "200": "#FFEE99",
1862
- "300": "#FFE266",
1863
- "400": "#FFD63F",
1864
- "500": "#FFC300",
1865
- "600": "#DBA200",
1866
- "700": "#B78300",
1867
- "800": "#936600",
1868
- "900": "#7A5100",
1869
- foreground: "#000",
1870
- DEFAULT: "#FFC300",
1871
- },
1872
- danger: {
1873
- "50": "#ffe2e5",
1874
- "100": "#FFE3D8",
1875
- "200": "#FFC1B2",
1876
- "300": "#FF988B",
1877
- "400": "#FF726F",
1878
- "500": "#FF3F4C",
1879
- "600": "#DB2E49",
1880
- "700": "#B71F45",
1881
- "800": "#93143F",
1882
- "900": "#7A0C3B",
1883
- foreground: "#000",
1884
- DEFAULT: "#FF3F4C",
1885
- },
1886
- focus: "#66cc8a",
1887
- overlay: "#000000",
1356
+ exit: function (direction) { return ({
1357
+ zIndex: 0,
1358
+ y: direction < 0 ? 30 : -30,
1359
+ opacity: 0,
1360
+ }); },
1361
+ };
1362
+ var MultiStepWizard = function (_a) {
1363
+ var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose;
1364
+ var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1365
+ React.useEffect(function () {
1366
+ if (isOpen) {
1367
+ setPage([0, 0]);
1368
+ }
1369
+ }, [isOpen]);
1370
+ var t = __assign({
1371
+ continue: "Continue",
1372
+ goBack: "Back",
1373
+ cancel: "Cancel",
1374
+ signUp: "Sign Up for Free",
1375
+ goToPayment: "Go to Payment",
1376
+ }, translations);
1377
+ var paginate = React.useCallback(function (newDirection) {
1378
+ setPage(function (prev) {
1379
+ var nextPage = prev[0] + newDirection;
1380
+ if (nextPage < 0 || nextPage > steps.length - 1) {
1381
+ return prev;
1382
+ }
1383
+ return [nextPage, newDirection];
1384
+ });
1385
+ }, [steps]);
1386
+ var onChangePage = React.useCallback(function (newPage) {
1387
+ setPage(function (prev) {
1388
+ if (newPage < 0 || newPage > steps.length - 1) {
1389
+ return prev;
1390
+ }
1391
+ var currentPage = prev[0];
1392
+ return [newPage, newPage > currentPage ? 1 : -1];
1393
+ });
1394
+ }, [steps]);
1395
+ var onBack = React.useCallback(function () {
1396
+ paginate(-1);
1397
+ }, [paginate]);
1398
+ var onNext = React.useCallback(function () {
1399
+ paginate(1);
1400
+ }, [paginate]);
1401
+ var content = React.useMemo(function () {
1402
+ return (jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1403
+ y: {
1404
+ ease: "backOut",
1405
+ duration: 0.35,
1406
+ },
1407
+ opacity: { duration: 0.4 },
1408
+ }, variants: variants, children: steps[page].content }, page) }));
1409
+ }, [page, steps, direction]);
1410
+ if (!isOpen) {
1411
+ return null;
1412
+ }
1413
+ return (jsxRuntime.jsxs(MultiStepSidebar, { currentPage: page, goBackTranslation: t.goBack, steps: steps, onBack: onBack, onChangePage: onChangePage, onClose: onClose, onNext: onNext, children: [jsxRuntime.jsx(Button, { className: "w-fit text-default-600 mb-6", color: "default", variant: "light", onPress: onBack, isDisabled: page === 0, startContent: jsxRuntime.jsx(IconComponent, { className: "text-default-500", icon: "material-symbols:arrow-back-rounded", size: "sm" }), children: t.goBack || "Back" }), jsxRuntime.jsxs("div", { className: "relative flex h-fit w-full flex-col pt-6 text-center lg:h-full lg:justify-center lg:pt-0", children: [content, jsxRuntime.jsx(MultistepNavigationButtons, { backButtonProps: {
1414
+ isDisabled: page === 0,
1415
+ onPress: onBack,
1416
+ children: t.goBack,
1417
+ }, cancelButtonProps: {
1418
+ onPress: onClose,
1419
+ children: t.cancel,
1420
+ }, nextButtonProps: {
1421
+ children: page === 0
1422
+ ? t.signUp
1423
+ : page === steps.length - 1
1424
+ ? t.goToPayment
1425
+ : t.continue,
1426
+ onPress: onNext,
1427
+ } })] })] }));
1428
+ };
1429
+
1430
+ var Pagination = function (_a) {
1431
+ _a.size; var props = __rest(_a, ["size"]);
1432
+ return jsxRuntime.jsx(react.Pagination, __assign({ showControls: true, isCompact: true }, props));
1433
+ };
1434
+
1435
+ // Lista simple de países con bandera emoji y código
1436
+ var countries = [
1437
+ { code: "+57", name: "Colombia", flag: "🇨🇴" },
1438
+ { code: "+54", name: "Argentina", flag: "🇦🇷" },
1439
+ { code: "+55", name: "Brazil", flag: "🇧🇷" },
1440
+ { code: "+52", name: "Mexico", flag: "🇲🇽" },
1441
+ { code: "+503", name: "El Salvador", flag: "🇸🇻" },
1442
+ { code: "+51", name: "Peru", flag: "🇵🇪" },
1443
+ { code: "+56", name: "Chile", flag: "🇨🇱" },
1444
+ { code: "+1", name: "United States", flag: "🇺🇸" },
1445
+ { code: "+7", name: "Russia", flag: "🇷🇺" },
1446
+ { code: "+20", name: "Egypt", flag: "🇪🇬" },
1447
+ { code: "+27", name: "South Africa", flag: "🇿🇦" },
1448
+ { code: "+33", name: "France", flag: "🇫🇷" },
1449
+ { code: "+34", name: "Spain", flag: "🇪🇸" },
1450
+ { code: "+39", name: "Italy", flag: "🇮🇹" },
1451
+ { code: "+44", name: "United Kingdom", flag: "🇬🇧" },
1452
+ { code: "+49", name: "Germany", flag: "🇩🇪" },
1453
+ { code: "+51", name: "Peru", flag: "🇵🇪" },
1454
+ { code: "+52", name: "Mexico", flag: "🇲🇽" },
1455
+ { code: "+54", name: "Argentina", flag: "🇦🇷" },
1456
+ { code: "+55", name: "Brazil", flag: "🇧🇷" },
1457
+ { code: "+56", name: "Chile", flag: "🇨🇱" },
1458
+ { code: "+57", name: "Colombia", flag: "🇨🇴" },
1459
+ { code: "+60", name: "Malaysia", flag: "🇲🇾" },
1460
+ { code: "+61", name: "Australia", flag: "🇦🇺" },
1461
+ { code: "+62", name: "Indonesia", flag: "🇮🇩" },
1462
+ { code: "+64", name: "New Zealand", flag: "🇳🇿" },
1463
+ { code: "+65", name: "Singapore", flag: "🇸🇬" },
1464
+ { code: "+66", name: "Thailand", flag: "🇹🇭" },
1465
+ { code: "+81", name: "Japan", flag: "🇯🇵" },
1466
+ { code: "+82", name: "South Korea", flag: "🇰🇷" },
1467
+ { code: "+84", name: "Vietnam", flag: "🇻🇳" },
1468
+ { code: "+86", name: "China", flag: "🇨🇳" },
1469
+ { code: "+91", name: "India", flag: "🇮🇳" },
1470
+ { code: "+351", name: "Portugal", flag: "🇵🇹" },
1471
+ { code: "+503", name: "El Salvador", flag: "🇸🇻" },
1472
+ { code: "+966", name: "Saudi Arabia", flag: "🇸🇦" },
1473
+ { code: "+971", name: "UAE", flag: "🇦🇪" },
1474
+ ];
1475
+ var uniqueCountries = Array.from(new Map(countries.map(function (item) { return [item.code + item.name, item]; })).values());
1476
+ // Traducciones por defecto
1477
+ var defaultTranslations$3 = {
1478
+ label: "Teléfono",
1479
+ placeholder: "Número de teléfono",
1480
+ searchPlaceholder: "Buscar país...",
1481
+ selectCountryAriaLabel: "Seleccionar país",
1482
+ expandListAriaLabel: "Desplegar lista de países",
1483
+ noCountriesFound: "No se encontraron países",
1484
+ };
1485
+
1486
+ var Phone = function (_a) {
1487
+ var id = _a.id, label = _a.label, _b = _a.required, required = _b === void 0 ? false : _b, _c = _a.error, error = _c === void 0 ? false : _c, _d = _a.errorText, errorText = _d === void 0 ? "" : _d, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.name, name = _f === void 0 ? "phone" : _f, _g = _a.translations, translations = _g === void 0 ? {} : _g;
1488
+ var _h = React.useState(false), isDropdownOpen = _h[0], setIsDropdownOpen = _h[1];
1489
+ var _j = React.useState(uniqueCountries[0]), selectedCountry = _j[0], setSelectedCountry = _j[1];
1490
+ var _k = React.useState(""), inputValue = _k[0], setInputValue = _k[1];
1491
+ var dropdownRef = React.useRef(null);
1492
+ var portalDropdownRef = React.useRef(null);
1493
+ var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
1494
+ var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
1495
+ var t = __assign(__assign({}, defaultTranslations$3), translations);
1496
+ var finalLabel = label || t.label;
1497
+ React.useEffect(function () {
1498
+ if (value) {
1499
+ var found = uniqueCountries.find(function (c) { return c.code === value.countryCode; });
1500
+ if (found) {
1501
+ setSelectedCountry(found);
1502
+ }
1503
+ setInputValue(value.phoneNumber);
1504
+ }
1505
+ }, [value]);
1506
+ React.useEffect(function () {
1507
+ if (isDropdownOpen) {
1508
+ setFilteredCountries(uniqueCountries);
1509
+ }
1510
+ }, [isDropdownOpen]);
1511
+ React.useLayoutEffect(function () {
1512
+ if (isDropdownOpen && dropdownRef.current) {
1513
+ var rect = dropdownRef.current.getBoundingClientRect();
1514
+ setDropdownPosition({
1515
+ position: "absolute",
1516
+ top: "".concat(rect.bottom + window.scrollY + 4, "px"),
1517
+ left: "".concat(rect.left + window.scrollX, "px"),
1518
+ width: "15rem",
1519
+ zIndex: 50,
1520
+ });
1521
+ }
1522
+ }, [isDropdownOpen]);
1523
+ React.useEffect(function () {
1524
+ var handleClickOutside = function (event) {
1525
+ if (dropdownRef.current &&
1526
+ !dropdownRef.current.contains(event.target) &&
1527
+ portalDropdownRef.current &&
1528
+ !portalDropdownRef.current.contains(event.target)) {
1529
+ setIsDropdownOpen(false);
1530
+ }
1531
+ };
1532
+ if (isDropdownOpen) {
1533
+ document.addEventListener("mousedown", handleClickOutside);
1534
+ }
1535
+ return function () {
1536
+ document.removeEventListener("mousedown", handleClickOutside);
1537
+ };
1538
+ }, [isDropdownOpen]);
1539
+ var handleCountrySelect = function (country) {
1540
+ setSelectedCountry(country);
1541
+ setIsDropdownOpen(false);
1542
+ if (onChange) {
1543
+ onChange({ countryCode: country.code, phoneNumber: inputValue });
1544
+ }
1545
+ };
1546
+ var handleInputChange = function (e) {
1547
+ var val = e.target.value.replace(/\D/g, "");
1548
+ setInputValue(val);
1549
+ if (onChange) {
1550
+ onChange({ countryCode: selectedCountry.code, phoneNumber: val });
1551
+ }
1552
+ };
1553
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 dark:focus-within:border-primary-500 ".concat(error ? "border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx("span", { className: "text-lg", children: selectedCountry.flag }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: "text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
1554
+ reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
1555
+ var searchTerm = e.target.value.toLowerCase();
1556
+ var filtered = uniqueCountries.filter(function (country) {
1557
+ return country.name.toLowerCase().includes(searchTerm) ||
1558
+ country.code.toLowerCase().includes(searchTerm);
1559
+ });
1560
+ setFilteredCountries(filtered);
1561
+ } }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.code === selectedCountry.code
1562
+ ? "bg-primary-50"
1563
+ : ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3 text-lg", children: country.flag }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: country.name }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, country.code)); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
1564
+ };
1565
+
1566
+ var defaultTranslations$2 = {
1567
+ message: "The Winter 2024 Release is here: new editor, analytics API, and so much more.",
1568
+ buttonText: "Explore",
1569
+ closeButtonLabel: "Close Banner",
1570
+ };
1571
+ /**
1572
+ * PromotionalBanner genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
1573
+ */
1574
+ var PromotionalBanner = function (_a) {
1575
+ var message = _a.message, buttonText = _a.buttonText, _b = _a.messageHref, messageHref = _b === void 0 ? "#" : _b, _c = _a.buttonHref, buttonHref = _c === void 0 ? "#" : _c, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, _e = _a.isVisible, isVisible = _e === void 0 ? true : _e, _f = _a.gradientColors, gradientColors = _f === void 0 ? ["default-100", "danger-100", "secondary-100"] : _f, _g = _a.buttonGradientColors, buttonGradientColors = _g === void 0 ? ["#F871A0", "#9353D3"] : _g, onClose = _a.onClose, onMessageClick = _a.onMessageClick, onButtonClick = _a.onButtonClick, _h = _a.messageLinkProps, messageLinkProps = _h === void 0 ? {} : _h, _j = _a.buttonProps, buttonProps = _j === void 0 ? {} : _j, _k = _a.translations, translations = _k === void 0 ? {} : _k;
1576
+ var t = __assign(__assign({}, defaultTranslations$2), translations);
1577
+ var finalMessage = message || t.message;
1578
+ var finalButtonText = buttonText || t.buttonText;
1579
+ var handleClose = function () {
1580
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1581
+ };
1582
+ var handleMessageClick = function () {
1583
+ onMessageClick === null || onMessageClick === void 0 ? void 0 : onMessageClick();
1584
+ };
1585
+ var handleButtonClick = function () {
1586
+ onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick();
1587
+ };
1588
+ if (!isVisible) {
1589
+ return null;
1590
+ }
1591
+ var fromColor = gradientColors[0], viaColor = gradientColors[1], toColor = gradientColors[2];
1592
+ var buttonGradient1 = buttonGradientColors[0], buttonGradient2 = buttonGradientColors[1];
1593
+ return (jsxRuntime.jsxs("div", { className: "border-divider flex w-full items-center gap-x-3 border-b-1 bg-gradient-to-r from-".concat(fromColor, " via-").concat(viaColor, " to-").concat(toColor, " px-6 py-2 sm:px-3.5 sm:before:flex-1"), children: [jsxRuntime.jsx("p", { className: "text-small text-foreground", children: jsxRuntime.jsxs(react.Link, __assign({ className: "text-inherit", href: messageHref, onClick: handleMessageClick }, messageLinkProps, { children: [finalMessage, "\u00A0"] })) }), jsxRuntime.jsx(react.Button, __assign({ as: react.Link, className: "group text-small relative h-9 overflow-hidden bg-transparent font-normal", color: "default", endContent: jsxRuntime.jsx(IconComponent, { className: "flex-none transition-transform outline-hidden group-data-[hover=true]:translate-x-0.5 [&>path]:stroke-2", icon: "solar:arrow-right-linear", size: "sm" }), href: buttonHref, style: {
1594
+ border: "solid 2px transparent",
1595
+ backgroundImage: "linear-gradient(hsl(var(--heroui-danger-50)), hsl(var(--heroui-danger-50))), linear-gradient(to right, ".concat(buttonGradient1, ", ").concat(buttonGradient2, ")"),
1596
+ backgroundOrigin: "border-box",
1597
+ backgroundClip: "padding-box, border-box",
1598
+ }, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: jsxRuntime.jsx(react.Button, { isIconOnly: true, "aria-label": t.closeButtonLabel, className: "-m-1", size: "lg", variant: "bordered", onClick: handleClose, children: jsxRuntime.jsx(IconComponent, { "aria-hidden": "true", className: "text-default-500", icon: "lucide:x", size: "md" }) }) }))] }));
1599
+ };
1600
+
1601
+ var RowSteps = React.forwardRef(function (_a, ref) {
1602
+ var _b = _a.color, color = _b === void 0 ? "primary" : _b, _c = _a.steps, stepsProp = _c === void 0 ? [] : _c, _d = _a.defaultStep, defaultStep = _d === void 0 ? 0 : _d, onStepChange = _a.onStepChange, currentStepProp = _a.currentStep, _e = _a.hideProgressBars, hideProgressBars = _e === void 0 ? false : _e, stepClassName = _a.stepClassName, className = _a.className; _a.translations; var props = __rest(_a, ["color", "steps", "defaultStep", "onStepChange", "currentStep", "hideProgressBars", "stepClassName", "className", "translations"]);
1603
+ var _f = $458b0a5536c1a7cf$export$40bfa8c7b0832715(currentStepProp, defaultStep, onStepChange), currentStep = _f[0], setCurrentStep = _f[1];
1604
+ var steps = React.useMemo(function () {
1605
+ if (typeof stepsProp === "number") {
1606
+ return Array.from({ length: stepsProp }, function () { return ({}); });
1607
+ }
1608
+ return stepsProp;
1609
+ }, [stepsProp]);
1610
+ var colors = React.useMemo(function () {
1611
+ var _a;
1612
+ var colorMappings = {
1613
+ primary: [
1614
+ "[--step-color:hsl(var(--heroui-primary))]",
1615
+ "[--step-fg-color:hsl(var(--heroui-primary-foreground))]",
1616
+ ],
1617
+ secondary: [
1618
+ "[--step-color:hsl(var(--heroui-secondary))]",
1619
+ "[--step-fg-color:hsl(var(--heroui-secondary-foreground))]",
1620
+ ],
1621
+ success: [
1622
+ "[--step-color:hsl(var(--heroui-success))]",
1623
+ "[--step-fg-color:hsl(var(--heroui-success-foreground))]",
1624
+ ],
1625
+ warning: [
1626
+ "[--step-color:hsl(var(--heroui-warning))]",
1627
+ "[--step-fg-color:hsl(var(--heroui-warning-foreground))]",
1628
+ ],
1629
+ danger: [
1630
+ "[--step-color:hsl(var(--heroui-danger))]",
1631
+ "[--step-fg-color:hsl(var(--heroui-danger-foreground))]",
1632
+ ],
1633
+ default: [
1634
+ "[--step-color:hsl(var(--heroui-default))]",
1635
+ "[--step-fg-color:hsl(var(--heroui-default-foreground))]",
1636
+ ],
1637
+ };
1638
+ var _b = (_a = colorMappings[color]) !== null && _a !== void 0 ? _a : colorMappings.primary, userColor = _b[0], fgColor = _b[1];
1639
+ var colorsVars = [
1640
+ "[--active-fg-color:var(--step-fg-color)]",
1641
+ "[--active-border-color:var(--step-color)]",
1642
+ "[--active-color:var(--step-color)]",
1643
+ "[--complete-background-color:var(--step-color)]",
1644
+ "[--complete-border-color:var(--step-color)]",
1645
+ "[--inactive-border-color:hsl(var(--heroui-default-300))]",
1646
+ "[--inactive-color:hsl(var(--heroui-default-300))]",
1647
+ ];
1648
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-fg-color"))) {
1649
+ colorsVars.unshift(fgColor);
1650
+ }
1651
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--step-color"))) {
1652
+ colorsVars.unshift(userColor);
1653
+ }
1654
+ if (!(className === null || className === void 0 ? void 0 : className.includes("--inactive-bar-color"))) {
1655
+ colorsVars.push("[--inactive-bar-color:hsl(var(--heroui-default-300))]");
1656
+ }
1657
+ return colorsVars;
1658
+ }, [color, className]);
1659
+ return (jsxRuntime.jsx("nav", { "aria-label": "Progress", className: "-my-4 max-w-fit overflow-x-auto py-4", children: jsxRuntime.jsx("ol", { className: react.cn("flex flex-row flex-nowrap gap-x-3", colors, className), children: steps === null || steps === void 0 ? void 0 : steps.map(function (step, stepIdx) {
1660
+ var status = currentStep === stepIdx
1661
+ ? "active"
1662
+ : currentStep < stepIdx
1663
+ ? "inactive"
1664
+ : "complete";
1665
+ return (jsxRuntime.jsx("li", { className: "relative flex w-full items-center pr-12 last:pr-0", children: jsxRuntime.jsxs("button", __assign({ type: "button", ref: ref, "aria-current": status === "active" ? "step" : undefined, className: react.cn("group rounded-large flex w-full cursor-pointer flex-row items-center justify-center gap-x-3 py-2.5", stepClassName), onClick: function () { return setCurrentStep(stepIdx); } }, props, { children: [jsxRuntime.jsx("div", { className: "h-ful relative flex items-center", children: jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: status, className: "relative", children: jsxRuntime.jsx(framerMotion.m.div, { className: react.cn("border-medium text-large text-default-600 relative flex h-[34px] w-[34px] items-center justify-center rounded-full font-semibold", {
1666
+ "shadow-lg": status === "complete",
1667
+ }), initial: false, transition: { duration: 0.25 }, variants: {
1668
+ inactive: {
1669
+ backgroundColor: "transparent",
1670
+ borderColor: "var(--inactive-border-color)",
1671
+ color: "var(--inactive-color)",
1672
+ },
1673
+ active: {
1674
+ backgroundColor: "transparent",
1675
+ borderColor: "var(--active-border-color)",
1676
+ color: "var(--active-color)",
1677
+ },
1678
+ complete: {
1679
+ backgroundColor: "var(--complete-background-color)",
1680
+ borderColor: "var(--complete-border-color)",
1681
+ },
1682
+ }, children: jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: status === "complete" ? (jsxRuntime.jsx(IconComponent, { className: " text-[var(--active-fg-color)] font-bold", icon: "material-symbols:check-rounded" })) : (jsxRuntime.jsx("span", { children: stepIdx + 1 })) }) }) }) }) }), step.title && (jsxRuntime.jsx("div", { className: "max-w-full flex-1 text-start", children: jsxRuntime.jsx("div", { className: react.cn("text-small text-default-600 lg:text-medium font-medium transition-[color,opacity] duration-300 group-active:opacity-80", {
1683
+ "text-default-300": status === "inactive",
1684
+ }), children: step.title }) })), stepIdx < steps.length - 1 && !hideProgressBars && (jsxRuntime.jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute right-0 w-10 flex-none items-center", style: {
1685
+ // @ts-ignore
1686
+ "--idx": stepIdx,
1687
+ }, children: jsxRuntime.jsx("div", { className: react.cn("relative h-0.5 w-full bg-[var(--inactive-bar-color)] transition-colors duration-300", "after:absolute after:block after:h-full after:w-0 after:bg-[var(--active-border-color)] after:transition-[width] after:duration-300 after:content-['']", {
1688
+ "after:w-full": stepIdx < currentStep,
1689
+ }) }) }))] }), stepIdx) }, stepIdx));
1690
+ }) }) }));
1691
+ });
1692
+ RowSteps.displayName = "RowSteps";
1693
+
1694
+ function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a, b) {
1695
+ return $14e0f24ef4ac5c92$var$timeToMs(a) - $14e0f24ef4ac5c92$var$timeToMs(b);
1696
+ }
1697
+ function $14e0f24ef4ac5c92$var$timeToMs(a) {
1698
+ return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;
1699
+ }
1700
+
1701
+ function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
1702
+ let inverseDuration = {};
1703
+ for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
1704
+ return inverseDuration;
1705
+ }
1706
+ function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
1707
+ let mutableValue = value.copy();
1708
+ if (fields.hour != null) mutableValue.hour = fields.hour;
1709
+ if (fields.minute != null) mutableValue.minute = fields.minute;
1710
+ if (fields.second != null) mutableValue.second = fields.second;
1711
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
1712
+ $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
1713
+ return mutableValue;
1714
+ }
1715
+ function $735220c2d4774dd3$var$balanceTime(time) {
1716
+ time.second += Math.floor(time.millisecond / 1000);
1717
+ time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
1718
+ time.minute += Math.floor(time.second / 60);
1719
+ time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
1720
+ time.hour += Math.floor(time.minute / 60);
1721
+ time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
1722
+ let days = Math.floor(time.hour / 24);
1723
+ time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
1724
+ return days;
1725
+ }
1726
+ function $735220c2d4774dd3$export$7555de1e070510cb(time) {
1727
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
1728
+ time.second = Math.max(0, Math.min(time.second, 59));
1729
+ time.minute = Math.max(0, Math.min(time.minute, 59));
1730
+ time.hour = Math.max(0, Math.min(time.hour, 23));
1731
+ }
1732
+ function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
1733
+ let result = a % b;
1734
+ if (result < 0) result += b;
1735
+ return result;
1736
+ }
1737
+ function $735220c2d4774dd3$var$addTimeFields(time, duration) {
1738
+ time.hour += duration.hours || 0;
1739
+ time.minute += duration.minutes || 0;
1740
+ time.second += duration.seconds || 0;
1741
+ time.millisecond += duration.milliseconds || 0;
1742
+ return $735220c2d4774dd3$var$balanceTime(time);
1743
+ }
1744
+ function $735220c2d4774dd3$export$7ed87b6bc2506470(time, duration) {
1745
+ let res = time.copy();
1746
+ $735220c2d4774dd3$var$addTimeFields(res, duration);
1747
+ return res;
1748
+ }
1749
+ function $735220c2d4774dd3$export$fe34d3a381cd7501(time, duration) {
1750
+ return $735220c2d4774dd3$export$7ed87b6bc2506470(time, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
1751
+ }
1752
+ function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
1753
+ let mutable = value.copy();
1754
+ switch(field){
1755
+ case 'hour':
1756
+ {
1757
+ let hours = value.hour;
1758
+ let min = 0;
1759
+ let max = 23;
1760
+ if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
1761
+ let isPM = hours >= 12;
1762
+ min = isPM ? 12 : 0;
1763
+ max = isPM ? 23 : 11;
1764
+ }
1765
+ mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
1766
+ break;
1767
+ }
1768
+ case 'minute':
1769
+ mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1770
+ break;
1771
+ case 'second':
1772
+ mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
1773
+ break;
1774
+ case 'millisecond':
1775
+ mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
1776
+ break;
1777
+ default:
1778
+ throw new Error('Unsupported field ' + field);
1779
+ }
1780
+ return mutable;
1781
+ }
1782
+ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
1783
+ if (round) {
1784
+ value += Math.sign(amount);
1785
+ if (value < min) value = max;
1786
+ let div = Math.abs(amount);
1787
+ if (amount > 0) value = Math.ceil(value / div) * div;
1788
+ else value = Math.floor(value / div) * div;
1789
+ if (value > max) value = min;
1790
+ } else {
1791
+ value += amount;
1792
+ if (value < min) value = max - (min - value - 1);
1793
+ else if (value > max) value = min + (value - max - 1);
1794
+ }
1795
+ return value;
1796
+ }
1797
+
1798
+ function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
1799
+ return `${String(time.hour).padStart(2, '0')}:${String(time.minute).padStart(2, '0')}:${String(time.second).padStart(2, '0')}${time.millisecond ? String(time.millisecond / 1000).slice(1) : ''}`;
1800
+ }
1801
+
1802
+ function _check_private_redeclaration(obj, privateCollection) {
1803
+ if (privateCollection.has(obj)) {
1804
+ throw new TypeError("Cannot initialize the same private elements twice on an object");
1805
+ }
1806
+ }
1807
+
1808
+ function _class_private_field_init(obj, privateMap, value) {
1809
+ _check_private_redeclaration(obj, privateMap);
1810
+ privateMap.set(obj, value);
1811
+ }
1812
+
1813
+ var // This prevents TypeScript from allowing other types with the same fields to match.
1814
+ // @ts-ignore
1815
+ $35ea8db9cb2ccb90$var$_type1 = /*#__PURE__*/ new WeakMap();
1816
+ class $35ea8db9cb2ccb90$export$680ea196effce5f {
1817
+ /** Returns a copy of this time. */ copy() {
1818
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
1819
+ }
1820
+ /** Returns a new `Time` with the given duration added to it. */ add(duration) {
1821
+ return ($735220c2d4774dd3$export$7ed87b6bc2506470)(this, duration);
1822
+ }
1823
+ /** Returns a new `Time` with the given duration subtracted from it. */ subtract(duration) {
1824
+ return ($735220c2d4774dd3$export$fe34d3a381cd7501)(this, duration);
1825
+ }
1826
+ /** Returns a new `Time` with the given fields set to the provided values. Other fields will be constrained accordingly. */ set(fields) {
1827
+ return ($735220c2d4774dd3$export$e5d5e1c1822b6e56)(this, fields);
1828
+ }
1829
+ /**
1830
+ * Returns a new `Time` with the given field adjusted by a specified amount.
1831
+ * When the resulting value reaches the limits of the field, it wraps around.
1832
+ */ cycle(field, amount, options) {
1833
+ return ($735220c2d4774dd3$export$dd02b3e0007dfe28)(this, field, amount, options);
1834
+ }
1835
+ /** Converts the time to an ISO 8601 formatted string. */ toString() {
1836
+ return ($fae977aafc393c5c$export$f59dee82248f5ad4)(this);
1837
+ }
1838
+ /** Compares this time with another. A negative result indicates that this time is before the given one, and a positive time indicates that it is after. */ compare(b) {
1839
+ return ($14e0f24ef4ac5c92$export$c19a80a9721b80f6)(this, b);
1840
+ }
1841
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0){
1842
+ (_class_private_field_init)(this, $35ea8db9cb2ccb90$var$_type1, {
1843
+ writable: true,
1844
+ value: void 0
1845
+ });
1846
+ this.hour = hour;
1847
+ this.minute = minute;
1848
+ this.second = second;
1849
+ this.millisecond = millisecond;
1850
+ ($735220c2d4774dd3$export$7555de1e070510cb)(this);
1851
+ }
1852
+ }
1853
+
1854
+ var Switch = function (_a) {
1855
+ var id = _a.id, props = __rest(_a, ["id"]);
1856
+ var generatedId = React.useId();
1857
+ var autoId = id || generatedId;
1858
+ return jsxRuntime.jsx(react.Switch, __assign({}, props, { id: autoId }));
1859
+ };
1860
+
1861
+ /**
1862
+ * TimeInput genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
1863
+ */
1864
+ var TimeInput = function (_a) {
1865
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "bordered" : _d, props = __rest(_a, ["label", "id", "size", "radius", "variant"]);
1866
+ var generatedId = React.useId();
1867
+ var autoId = id || generatedId;
1868
+ return (jsxRuntime.jsx(react.TimeInput, __assign({}, props, { id: autoId, size: size, radius: radius, variant: variant, label: label, labelPlacement: "outside-left", classNames: {
1869
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
1870
+ inputWrapper: "focus-within:!border-primary-500",
1871
+ } })));
1872
+ };
1873
+
1874
+ /**
1875
+ * @component ScheduleRow
1876
+ * @description A React component for managing the schedule of a single day.
1877
+ * It allows users to open or close the schedule, add or remove time slots,
1878
+ * and modify the start and end times of each slot. The component is fully
1879
+ * controlled and reports changes to the parent via the `onChange` callback.
1880
+ *
1881
+ * @param {ScheduleRowProps} props - The props for the component.
1882
+ * @returns {React.ReactElement} The rendered ScheduleRow component.
1883
+ */
1884
+ var ScheduleRow = function (_a) {
1885
+ var day = _a.day, daySchedule = _a.daySchedule, translations = _a.translations, onChange = _a.onChange, onCopyToAll = _a.onCopyToAll;
1886
+ /**
1887
+ * @function validateTimeSlots
1888
+ * @description Validates all time slots to ensure the "from" time is not after the "to" time.
1889
+ * @param {TimeSlot[]} timeSlots - The array of time slots to validate.
1890
+ * @returns {TimeSlot[]} The updated array of time slots with error messages if any.
1891
+ */
1892
+ var validateTimeSlots = function (timeSlots) {
1893
+ return timeSlots.map(function (slot) {
1894
+ if (slot.from && slot.to) {
1895
+ var fromTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.from.split(":").map(Number), false)))();
1896
+ var toTime = new ($35ea8db9cb2ccb90$export$680ea196effce5f.bind.apply($35ea8db9cb2ccb90$export$680ea196effce5f, __spreadArray([void 0], slot.to.split(":").map(Number), false)))();
1897
+ if (fromTime.compare(toTime) > 0) {
1898
+ return __assign(__assign({}, slot), { error: "From time cannot be after to time" });
1899
+ }
1900
+ }
1901
+ return __assign(__assign({}, slot), { error: null });
1902
+ });
1903
+ };
1904
+ /**
1905
+ * @function toTimeValue
1906
+ * @description Converts a time string (e.g., "09:00") to a `TimeValue` object
1907
+ * required by the `TimeInput` component.
1908
+ * @param {string} time - The time string to convert.
1909
+ * @returns {TimeValue | null} The corresponding `TimeValue` object, or `null` if the input is empty.
1910
+ */
1911
+ var toTimeValue = function (time) {
1912
+ if (!time) {
1913
+ return null;
1914
+ }
1915
+ var _a = time.split(":").map(Number), hour = _a[0], minute = _a[1];
1916
+ return new $35ea8db9cb2ccb90$export$680ea196effce5f(hour, minute);
1917
+ };
1918
+ /**
1919
+ * @function fromTimeValue
1920
+ * @description Converts a `TimeValue` object back to a formatted time string (e.g., "09:00").
1921
+ * @param {TimeValue | null} time - The `TimeValue` object to convert.
1922
+ * @returns {string} The formatted time string.
1923
+ */
1924
+ var fromTimeValue = function (time) {
1925
+ if (!time) {
1926
+ return "";
1927
+ }
1928
+ return "".concat(String(time.hour).padStart(2, "0"), ":").concat(String(time.minute).padStart(2, "0"));
1929
+ };
1930
+ /**
1931
+ * @function handleToggleDay
1932
+ * @description Toggles the `isOpen` status of the schedule for the day.
1933
+ */
1934
+ var handleToggleDay = function () {
1935
+ onChange(__assign(__assign({}, daySchedule), { isOpen: !daySchedule.isOpen }));
1936
+ };
1937
+ /**
1938
+ * @function handleTimeChange
1939
+ * @description Updates the time for a specific time slot.
1940
+ * @param {number} index - The index of the time slot to modify.
1941
+ * @param {"from" | "to"} field - The field to update ("from" or "to").
1942
+ * @param {TimeValue | null} value - The new time value from the `TimeInput` component.
1943
+ */
1944
+ var handleTimeChange = function (index, field, value) {
1945
+ var _a;
1946
+ var newTimeSlots = __spreadArray([], daySchedule.timeSlots, true);
1947
+ newTimeSlots[index] = __assign(__assign({}, newTimeSlots[index]), (_a = {}, _a[field] = fromTimeValue(value), _a));
1948
+ var validatedSlots = validateTimeSlots(newTimeSlots);
1949
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: validatedSlots }));
1950
+ };
1951
+ /**
1952
+ * @function handleAddTimeSlot
1953
+ * @description Adds a new, empty time slot to the schedule.
1954
+ */
1955
+ var handleAddTimeSlot = function () {
1956
+ var newTimeSlots = __spreadArray(__spreadArray([], daySchedule.timeSlots, true), [{ from: "", to: "" }], false);
1957
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
1958
+ };
1959
+ /**
1960
+ * @function handleRemoveTimeSlot
1961
+ * @description Removes a time slot from the schedule at the specified index.
1962
+ * @param {number} index - The index of the time slot to remove.
1963
+ */
1964
+ var handleRemoveTimeSlot = function (index) {
1965
+ var newTimeSlots = daySchedule.timeSlots.filter(function (_, i) { return i !== index; });
1966
+ onChange(__assign(__assign({}, daySchedule), { timeSlots: newTimeSlots }));
1967
+ };
1968
+ return (jsxRuntime.jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxRuntime.jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsxRuntime.jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsxRuntime.jsx(react.Chip, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? translations.open : translations.closed })] }), jsxRuntime.jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsxRuntime.jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), jsxRuntime.jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: translations.copyToAll })] })] }), daySchedule.isOpen && (jsxRuntime.jsxs("div", { className: "flex flex-col justify-around gap-y-3 ", children: [daySchedule.timeSlots.map(function (slot, index) { return (jsxRuntime.jsxs("div", { className: "flex items-center gap-1 w-full justify-between", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-1", children: [jsxRuntime.jsx(TimeInput, { label: translations.from, className: "w-full", value: toTimeValue(slot.from), onChange: function (value) { return handleTimeChange(index, "from", value); }, isInvalid: !!slot.error }), jsxRuntime.jsx("span", { className: "text-default-900 xs:hidden xl:block", children: "-" }), jsxRuntime.jsx(TimeInput, { label: translations.to, className: "w-full", value: toTimeValue(slot.to), onChange: function (value) { return handleTimeChange(index, "to", value); }, isInvalid: !!slot.error, errorMessage: slot.error })] }), jsxRuntime.jsx(Button, { isIconOnly: true, size: "sm", color: "danger", variant: "light", onPress: function () { return handleRemoveTimeSlot(index); }, isDisabled: daySchedule.timeSlots.length === 1, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:trash-bin-minimalistic-outline" }) })] }, "".concat(day, "-timeslot-").concat(slot.from, "-").concat(slot.to, "-").concat(index))); }), daySchedule.timeSlots.length < 2 && (jsxRuntime.jsx(Button, { size: "sm", variant: "flat", onPress: function () { return handleAddTimeSlot(); }, startContent: jsxRuntime.jsx(IconComponent, { icon: "solar:add-circle-outline" }), children: translations.addTimeSlot }))] }))] }, day));
1969
+ };
1970
+
1971
+ /**
1972
+ * Select genérico reutilizable basado en HeroUI siguiendo las reglas de diseño BeweOS.
1973
+ *
1974
+ * Reglas aplicadas:
1975
+ * - Variant: Bordered (por defecto)
1976
+ * - Radius: md (por defecto)
1977
+ * - labelPlacement: Outside
1978
+ * - Size: sm, md, lg (configurable)
1979
+ */
1980
+ var Select = function (_a) {
1981
+ var label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.variant, variant = _c === void 0 ? "bordered" : _c, _d = _a.radius, radius = _d === void 0 ? "md" : _d, placeholder = _a.placeholder, props = __rest(_a, ["label", "id", "size", "variant", "radius", "placeholder"]);
1982
+ var generatedId = React.useId();
1983
+ var selectId = id || generatedId;
1984
+ return (jsxRuntime.jsx("div", { className: "group", children: jsxRuntime.jsx(react.Select, __assign({}, props, { id: selectId, label: label, labelPlacement: "outside", placeholder: placeholder, variant: variant, size: size, radius: radius, classNames: {
1985
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
1986
+ trigger: "data-[open=true]:!border-primary-500 data-[focus=true]:!border-primary-500 data-[disabled=true]:bg-default-100",
1987
+ popoverContent: "[&_[data-focus-visible=true]]:!outline-none [&_[data-selectable=true]:focus]:!bg-primary-50 [&_li]:!text-default-500 [&_li[data-hover=true]]:!text-default-600",
1988
+ } })) }));
1989
+ };
1990
+
1991
+ function AuraTable(_a) {
1992
+ var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
1993
+ return (jsxRuntime.jsxs(react.Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsxRuntime.jsx(react.TableHeader, { columns: columns, children: function (column) { return jsxRuntime.jsx(react.TableColumn, { children: column.label }, column.key); } }), jsxRuntime.jsx(react.TableBody, { items: items, children: function (item) { return (jsxRuntime.jsx(react.TableRow, { children: function (columnKey) { return (jsxRuntime.jsx(react.TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
1994
+ }
1995
+
1996
+ /**
1997
+ * Textarea component that wraps the HeroUI TextArea component.
1998
+ */
1999
+ var Textarea = function (_a) {
2000
+ var id = _a.id, label = _a.label, placeholder = _a.placeholder, description = _a.description, errorMessage = _a.errorMessage, _b = _a.variant, variant = _b === void 0 ? "bordered" : _b, _c = _a.radius, radius = _c === void 0 ? "md" : _c, _d = _a.size, size = _d === void 0 ? "md" : _d; _a.labelPlacement; var props = __rest(_a, ["id", "label", "placeholder", "description", "errorMessage", "variant", "radius", "size", "labelPlacement"]);
2001
+ var generatedId = React.useId();
2002
+ var autoId = id || generatedId;
2003
+ return (jsxRuntime.jsx(react.Textarea, __assign({}, props, { id: autoId, label: label, variant: variant, radius: radius, size: size, labelPlacement: "outside", placeholder: placeholder, description: description, errorMessage: errorMessage, classNames: {
2004
+ label: "text-default-600 text-tiny group-data-[filled=true]:text-default-600",
2005
+ inputWrapper: "data-[focus=true]:!border-primary-500 data-[focus=true]:!border-primary-500",
2006
+ } })));
2007
+ };
2008
+
2009
+ // Traducciones por defecto en español según las reglas de diseño
2010
+ var defaultTranslations$1 = {
2011
+ lightTheme: "Claro",
2012
+ darkTheme: "Oscuro",
2013
+ };
2014
+ /**
2015
+ * Selector de tema visual con preview interactivo siguiendo las reglas de diseño BeweOS.
2016
+ *
2017
+ * Reglas aplicadas:
2018
+ * - Soporte completo de traducciones mediante props
2019
+ * - Sin dependencias de sistemas i18n específicos
2020
+ * - Dark mode compatible
2021
+ * - Uso exclusivo de Tailwind CSS
2022
+ */
2023
+ var ThemePicker = function (_a) {
2024
+ var value = _a.value, onChange = _a.onChange, className = _a.className, _b = _a.translations, translations = _b === void 0 ? {} : _b;
2025
+ // Combinar traducciones por defecto con las proporcionadas
2026
+ var t = __assign(__assign({}, defaultTranslations$1), translations);
2027
+ var themes = [
2028
+ {
2029
+ key: "light",
2030
+ label: t.lightTheme,
2031
+ cardClass: "bg-white border border-[#E4E4E7] text-zinc-900",
2032
+ previewClass: "bg-[#F4F4F5] border border-[#E4E4E7]",
2033
+ labelClass: "font-medium text-[14px] leading-[20px] text-zinc-900",
2034
+ radioColor: "primary",
2035
+ previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#E4E4E7] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#E4E4E7] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#E4E4E7]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#E4E4E7]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#E4E4E7]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#F4F4F5] rounded-lg mt-2" })] })),
1888
2036
  },
1889
- },
1890
- "green-dark": {
1891
- extend: "dark",
1892
- colors: {
1893
- primary: {
1894
- 50: "#EFFFEF",
1895
- 100: "#CFFCD1",
1896
- 200: "#A0F9AC",
1897
- 300: "#6FEE8D",
1898
- 400: "#49DE7B",
1899
- 500: "#16C964",
1900
- 600: "#10AC64",
1901
- 700: "#0B905F",
1902
- 800: "#077457",
1903
- 900: "#046051",
1904
- foreground: "#000",
1905
- DEFAULT: "#16C964",
1906
- },
1907
- secondary: {
1908
- "50": "#e3eaff",
1909
- "100": "#D7DFFE",
1910
- "200": "#AFBFFE",
1911
- "300": "#889DFD",
1912
- "400": "#6A82FB",
1913
- "500": "#3956F9",
1914
- "600": "#2941D6",
1915
- "700": "#1C2EB3",
1916
- "800": "#121F90",
1917
- "900": "#0A1477",
1918
- foreground: "#fff",
1919
- DEFAULT: "#3956F9",
1920
- },
1921
- success: {
1922
- "50": "#e7fde3",
1923
- "100": "#E8FCD3",
1924
- "200": "#CBFAA8",
1925
- "300": "#A4F17B",
1926
- "400": "#7EE358",
1927
- "500": "#49D127",
1928
- "600": "#2FB31C",
1929
- "700": "#1A9613",
1930
- "800": "#0C790E",
1931
- "900": "#076410",
1932
- foreground: "#000",
1933
- DEFAULT: "#49D127",
1934
- },
1935
- warning: {
1936
- "50": "#fff9da",
1937
- "100": "#FFF7CC",
1938
- "200": "#FFEE99",
1939
- "300": "#FFE266",
1940
- "400": "#FFD63F",
1941
- "500": "#FFC300",
1942
- "600": "#DBA200",
1943
- "700": "#B78300",
1944
- "800": "#936600",
1945
- "900": "#7A5100",
1946
- foreground: "#000",
1947
- DEFAULT: "#FFC300",
1948
- },
1949
- danger: {
1950
- "50": "#ffe2e5",
1951
- "100": "#FFE3D8",
1952
- "200": "#FFC1B2",
1953
- "300": "#FF988B",
1954
- "400": "#FF726F",
1955
- "500": "#FF3F4C",
1956
- "600": "#DB2E49",
1957
- "700": "#B71F45",
1958
- "800": "#93143F",
1959
- "900": "#7A0C3B",
1960
- foreground: "#fff",
1961
- DEFAULT: "#FF3F4C",
1962
- },
1963
- focus: "#66cc8a",
1964
- overlay: "#ffffff",
2037
+ {
2038
+ key: "dark",
2039
+ label: t.darkTheme,
2040
+ cardClass: "bg-black border border-[#3F3F46] text-white",
2041
+ previewClass: "bg-[#27272A] border border-[#3F3F46]",
2042
+ labelClass: "font-medium text-[14px] leading-[20px] text-white",
2043
+ radioColor: "primary",
2044
+ previewContent: (jsxRuntime.jsxs("div", { className: "rounded-lg border border-[#3F3F46] p-3 mt-4 flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-1/2 bg-[#3F3F46] rounded mb-2" }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/3 rounded bg-[#3F3F46]" })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [jsxRuntime.jsx("div", { className: "h-3 w-3 rounded-full bg-[#3F3F46]" }), jsxRuntime.jsx("div", { className: "h-3 w-1/4 rounded bg-[#3F3F46]" })] })] }), jsxRuntime.jsx("div", { className: "h-8 w-2/3 bg-[#27272A] rounded-lg mt-2" })] })),
1965
2045
  },
1966
- },
2046
+ ];
2047
+ return (jsxRuntime.jsx(react.RadioGroup, { value: value, onChange: function (e) { return onChange(e.target.value); }, className: "flex justify-center ".concat(className || ""), orientation: "horizontal", classNames: {
2048
+ wrapper: "gap-3",
2049
+ }, children: themes.map(function (theme) { return (jsxRuntime.jsxs("div", { className: "relative rounded-2xl ".concat(theme.cardClass, " p-4 flex-1 transition-all duration-200 flex flex-col justify-start"), children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [jsxRuntime.jsx("span", { className: theme.labelClass, children: theme.label }), jsxRuntime.jsx(react.Radio, { "aria-label": theme.label, color: theme.radioColor, size: "sm", value: theme.key })] }), theme.previewContent] }, theme.key)); }) }));
2050
+ };
2051
+
2052
+ var ToastContext = React.createContext(undefined);
2053
+ var useAuraToast = function () {
2054
+ var context = React.useContext(ToastContext);
2055
+ if (!context) {
2056
+ throw new Error("useAuraToast must be used within a AuraToastProvider");
2057
+ }
2058
+ return context;
2059
+ };
2060
+
2061
+ function GlobalToast() {
2062
+ var _a = useAuraToast(), toast = _a.toast, hideToast = _a.hideToast;
2063
+ if (!toast.isVisible) {
2064
+ return null;
2065
+ }
2066
+ return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-50 w-full max-w-sm", children: jsxRuntime.jsx(react.Alert, { hideIconWrapper: true, color: toast.color, variant: "flat", title: toast.title, description: toast.description, isClosable: true, onClose: hideToast }) }));
2067
+ }
2068
+
2069
+ // Traducciones por defecto en español
2070
+ var defaultTranslations = {
2071
+ uploadText: "Da clic y selecciona tus archivos",
2072
+ subText: "",
2073
+ dragText: "Suelta el archivo aquí",
2074
+ multipleFilesError: "Solo puedes subir un archivo",
2075
+ maxFilesError: "Puedes subir máximo {maxFiles} archivos",
2076
+ invalidFileTypeError: "Solo se aceptan archivos de tipo: {acceptedTypes}",
2077
+ maxFileSizeError: "El archivo excede el tamaño máximo permitido de {maxSize}",
2078
+ removeFileAriaLabel: "Remover archivo",
2079
+ uploadAreaAriaLabel: "Área de carga de archivos",
2080
+ cropModalTitle: "Recortar imagen",
2081
+ cropSaveButton: "Guardar",
2082
+ cropCancelButton: "Cancelar",
2083
+ cropZoomLabel: "Zoom",
2084
+ cropInstructions: "Arrastra para mover la imagen y usa el zoom para ajustar el tamaño",
2085
+ cropBackgroundLabel: "Color de fondo",
2086
+ cropBackgroundWhite: "Blanco",
2087
+ cropBackgroundBlack: "Negro",
2088
+ cropBackgroundTransparent: "Transparente",
2089
+ };
2090
+ /**
2091
+ * Formatea el tipo de archivo para mostrar
2092
+ */
2093
+ var formatFileType = function (type) {
2094
+ var _a;
2095
+ if (type.startsWith(".")) {
2096
+ return type.toUpperCase();
2097
+ }
2098
+ if (type.includes("/")) {
2099
+ var parts = type.split("/");
2100
+ return ((_a = parts[1]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || type;
2101
+ }
2102
+ return type.toUpperCase();
2103
+ };
2104
+ /**
2105
+ * Formatea el tamaño del archivo de forma legible
2106
+ */
2107
+ var formatFileSize = function (bytes) {
2108
+ if (bytes === 0) {
2109
+ return "0 Bytes";
2110
+ }
2111
+ var k = 1024;
2112
+ var sizes = ["Bytes", "KB", "MB", "GB"];
2113
+ var i = Math.floor(Math.log(bytes) / Math.log(k));
2114
+ return "".concat(Math.round(bytes / Math.pow(k, i)), " ").concat(sizes[i]);
2115
+ };
2116
+ /**
2117
+ * Componente de recorte de imagen usando Canvas API
2118
+ */
2119
+ var ImageCropModal = function (_a) {
2120
+ var isOpen = _a.isOpen, imageUrl = _a.imageUrl, targetWidth = _a.targetWidth, targetHeight = _a.targetHeight, onSave = _a.onSave, onCancel = _a.onCancel, translations = _a.translations;
2121
+ var canvasRef = React.useRef(null);
2122
+ var _b = React.useState(null), imageElement = _b[0], setImageElement = _b[1];
2123
+ var _c = React.useState(0), zoomValue = _c[0], setZoomValue = _c[1]; // Valor del slider de -1 a 1
2124
+ var _d = React.useState({ x: 0, y: 0 }), position = _d[0], setPosition = _d[1];
2125
+ var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
2126
+ var _f = React.useState({ x: 0, y: 0 }), dragStart = _f[0], setDragStart = _f[1];
2127
+ var _g = React.useState(1), baseScale = _g[0], setBaseScale = _g[1]; // Escala base inicial
2128
+ var _h = React.useState({ width: 400, height: 300 }), canvasSize = _h[0], setCanvasSize = _h[1];
2129
+ var _j = React.useState("white"), backgroundColor = _j[0], setBackgroundColor = _j[1];
2130
+ // Función para convertir el valor del zoom slider a escala real
2131
+ var getScaleFromZoom = function (zoomValue) {
2132
+ if (zoomValue === 0) {
2133
+ return baseScale;
2134
+ }
2135
+ if (zoomValue > 0) {
2136
+ // Zoom in: de baseScale a baseScale * 3
2137
+ return baseScale + baseScale * 2 * zoomValue;
2138
+ }
2139
+ // Zoom out: de baseScale * 0.3 a baseScale
2140
+ return baseScale + baseScale * 0.7 * zoomValue;
2141
+ };
2142
+ var currentScale = getScaleFromZoom(zoomValue);
2143
+ // Cargar imagen cuando se abre el modal
2144
+ React.useEffect(function () {
2145
+ if (isOpen && imageUrl) {
2146
+ var img_1 = new Image();
2147
+ img_1.onload = function () {
2148
+ setImageElement(img_1);
2149
+ // Calcular escala inicial para que la imagen quepa en el área de crop
2150
+ var scaleX = targetWidth / img_1.width;
2151
+ var scaleY = targetHeight / img_1.height;
2152
+ var initialScale = Math.max(scaleX, scaleY);
2153
+ setBaseScale(initialScale);
2154
+ setZoomValue(0); // Empezar en el centro
2155
+ setPosition({ x: 0, y: 0 });
2156
+ setBackgroundColor("white"); // Reset color de fondo
2157
+ };
2158
+ img_1.src = imageUrl;
2159
+ }
2160
+ }, [isOpen, imageUrl, targetWidth, targetHeight]);
2161
+ // Dibujar en el canvas
2162
+ React.useEffect(function () {
2163
+ if (!(imageElement && canvasRef.current)) {
2164
+ return;
2165
+ }
2166
+ var canvas = canvasRef.current;
2167
+ var ctx = canvas.getContext("2d");
2168
+ if (!ctx) {
2169
+ return;
2170
+ }
2171
+ // Limpiar canvas
2172
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
2173
+ // Dibujar fondo gris del canvas
2174
+ ctx.fillStyle = "#f3f4f6";
2175
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
2176
+ // Calcular posición y tamaño de la imagen
2177
+ var imgWidth = imageElement.width * currentScale;
2178
+ var imgHeight = imageElement.height * currentScale;
2179
+ var imgX = (canvas.width - imgWidth) / 2 + position.x;
2180
+ var imgY = (canvas.height - imgHeight) / 2 + position.y;
2181
+ // Dibujar imagen
2182
+ ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
2183
+ // Dibujar overlay para mostrar área de recorte
2184
+ ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
2185
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
2186
+ // Limpiar área de recorte (centro)
2187
+ var cropX = (canvas.width - targetWidth) / 2;
2188
+ var cropY = (canvas.height - targetHeight) / 2;
2189
+ ctx.clearRect(cropX, cropY, targetWidth, targetHeight);
2190
+ // Dibujar color de fondo del área de recorte
2191
+ if (backgroundColor !== "transparent") {
2192
+ ctx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
2193
+ ctx.fillRect(cropX, cropY, targetWidth, targetHeight);
2194
+ }
2195
+ // Redibujar imagen solo en el área de recorte
2196
+ ctx.save();
2197
+ ctx.beginPath();
2198
+ ctx.rect(cropX, cropY, targetWidth, targetHeight);
2199
+ ctx.clip();
2200
+ ctx.drawImage(imageElement, imgX, imgY, imgWidth, imgHeight);
2201
+ ctx.restore();
2202
+ // Dibujar borde del área de recorte
2203
+ ctx.strokeStyle = "#3b82f6";
2204
+ ctx.lineWidth = 2;
2205
+ ctx.strokeRect(cropX, cropY, targetWidth, targetHeight);
2206
+ }, [
2207
+ imageElement,
2208
+ currentScale,
2209
+ position,
2210
+ targetWidth,
2211
+ targetHeight,
2212
+ backgroundColor,
2213
+ ]);
2214
+ var handleMouseDown = function (e) {
2215
+ var _a;
2216
+ e.preventDefault();
2217
+ setIsDragging(true);
2218
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2219
+ if (rect) {
2220
+ setDragStart({
2221
+ x: e.clientX - rect.left - position.x,
2222
+ y: e.clientY - rect.top - position.y,
2223
+ });
2224
+ }
2225
+ };
2226
+ var handleMouseMove = function (e) {
2227
+ var _a;
2228
+ if (!isDragging) {
2229
+ return;
2230
+ }
2231
+ e.preventDefault();
2232
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2233
+ if (rect) {
2234
+ setPosition({
2235
+ x: e.clientX - rect.left - dragStart.x,
2236
+ y: e.clientY - rect.top - dragStart.y,
2237
+ });
2238
+ }
2239
+ };
2240
+ var handleMouseUp = function () {
2241
+ setIsDragging(false);
2242
+ };
2243
+ // Eventos táctiles para dispositivos móviles
2244
+ var handleTouchStart = function (e) {
2245
+ var _a;
2246
+ e.preventDefault();
2247
+ if (e.touches.length === 1) {
2248
+ setIsDragging(true);
2249
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2250
+ if (rect) {
2251
+ var touch = e.touches[0];
2252
+ setDragStart({
2253
+ x: touch.clientX - rect.left - position.x,
2254
+ y: touch.clientY - rect.top - position.y,
2255
+ });
2256
+ }
2257
+ }
2258
+ };
2259
+ var handleTouchMove = function (e) {
2260
+ var _a;
2261
+ if (!isDragging || e.touches.length !== 1) {
2262
+ return;
2263
+ }
2264
+ e.preventDefault();
2265
+ var rect = (_a = canvasRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2266
+ if (rect) {
2267
+ var touch = e.touches[0];
2268
+ setPosition({
2269
+ x: touch.clientX - rect.left - dragStart.x,
2270
+ y: touch.clientY - rect.top - dragStart.y,
2271
+ });
2272
+ }
2273
+ };
2274
+ var handleTouchEnd = function () {
2275
+ setIsDragging(false);
2276
+ };
2277
+ var handleSave = function () {
2278
+ if (!(imageElement && canvasRef.current)) {
2279
+ return;
2280
+ }
2281
+ // Crear canvas temporal para el recorte
2282
+ var tempCanvas = document.createElement("canvas");
2283
+ tempCanvas.width = targetWidth;
2284
+ tempCanvas.height = targetHeight;
2285
+ var tempCtx = tempCanvas.getContext("2d");
2286
+ if (!tempCtx) {
2287
+ return;
2288
+ }
2289
+ // Dibujar color de fondo si no es transparente
2290
+ if (backgroundColor !== "transparent") {
2291
+ tempCtx.fillStyle = backgroundColor === "white" ? "#ffffff" : "#000000";
2292
+ tempCtx.fillRect(0, 0, targetWidth, targetHeight);
2293
+ }
2294
+ // Calcular parámetros de recorte
2295
+ var canvas = canvasRef.current;
2296
+ var imgWidth = imageElement.width * currentScale;
2297
+ var imgHeight = imageElement.height * currentScale;
2298
+ var imgX = (canvas.width - imgWidth) / 2 + position.x;
2299
+ var imgY = (canvas.height - imgHeight) / 2 + position.y;
2300
+ var cropX = (canvas.width - targetWidth) / 2;
2301
+ var cropY = (canvas.height - targetHeight) / 2;
2302
+ // Calcular área fuente en la imagen original
2303
+ var sourceX = (cropX - imgX) / currentScale;
2304
+ var sourceY = (cropY - imgY) / currentScale;
2305
+ var sourceWidth = targetWidth / currentScale;
2306
+ var sourceHeight = targetHeight / currentScale;
2307
+ // Dibujar recorte sobre el fondo
2308
+ tempCtx.drawImage(imageElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, targetWidth, targetHeight);
2309
+ // Convertir a blob y crear archivo
2310
+ var fileType = backgroundColor === "transparent" ? "image/png" : "image/png";
2311
+ tempCanvas.toBlob(function (blob) {
2312
+ if (blob) {
2313
+ var timestamp = new Date().getTime();
2314
+ var file = new File([blob], "cropped-image-".concat(timestamp, ".png"), {
2315
+ type: fileType,
2316
+ });
2317
+ onSave(file, imageElement.src);
2318
+ }
2319
+ }, fileType);
2320
+ };
2321
+ // Calcular dimensiones responsive del canvas
2322
+ var updateCanvasSize = React.useCallback(function () {
2323
+ var minCanvasWidth = Math.min(350, window.innerWidth - 40);
2324
+ var minCanvasHeight = Math.min(250, window.innerHeight - 300);
2325
+ var newCanvasWidth = Math.max(minCanvasWidth, targetWidth + 60);
2326
+ var newCanvasHeight = Math.max(minCanvasHeight, targetHeight + 60);
2327
+ setCanvasSize({ width: newCanvasWidth, height: newCanvasHeight });
2328
+ }, [targetWidth, targetHeight]);
2329
+ // Actualizar tamaño del canvas al cambiar el tamaño de la ventana
2330
+ React.useEffect(function () {
2331
+ if (!isOpen) {
2332
+ return;
2333
+ }
2334
+ updateCanvasSize();
2335
+ var handleResize = function () {
2336
+ updateCanvasSize();
2337
+ };
2338
+ window.addEventListener("resize", handleResize);
2339
+ return function () {
2340
+ window.removeEventListener("resize", handleResize);
2341
+ };
2342
+ }, [isOpen, updateCanvasSize]);
2343
+ return (jsxRuntime.jsx(react.Modal, { isOpen: isOpen, onClose: onCancel, size: "5xl", className: "sm:max-w-4xl", scrollBehavior: "inside", backdrop: "blur", classNames: {
2344
+ backdrop: "bg-black/80",
2345
+ wrapper: "p-0 sm:p-4",
2346
+ base: "m-0 sm:m-4 max-h-screen sm:max-h-[90vh] w-full sm:w-auto",
2347
+ }, children: jsxRuntime.jsxs(react.ModalContent, { className: "m-0 sm:m-0 h-screen sm:h-auto sm:max-h-[90vh] sm:rounded-lg", children: [jsxRuntime.jsxs(react.ModalHeader, { className: "flex flex-col gap-1 px-4 sm:px-6", children: [translations.cropModalTitle, jsxRuntime.jsx("p", { className: "text-xs sm:text-sm text-gray-500 font-normal", children: translations.cropInstructions })] }), jsxRuntime.jsx(react.ModalBody, { className: "px-4 sm:px-6 py-4", children: jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [jsxRuntime.jsx("div", { className: "flex justify-center overflow-hidden", children: jsxRuntime.jsx("canvas", { ref: canvasRef, width: canvasSize.width, height: canvasSize.height, className: "border border-gray-300 cursor-move select-none max-w-full max-h-[50vh] sm:max-h-[60vh]", onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, style: { touchAction: "none" } }) }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("label", { htmlFor: "zoom-slider", className: "text-sm font-medium", children: translations.cropZoomLabel }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2 sm:gap-3 w-full", children: [jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "-" }), jsxRuntime.jsx(react.Slider, { id: "zoom-slider", size: "sm", step: 0.1, minValue: -1, maxValue: 1, value: zoomValue, onChange: function (value) { return setZoomValue(value); }, className: "flex-1", marks: [
2348
+ { value: -1, label: "Out" },
2349
+ { value: 0, label: "0" },
2350
+ { value: 1, label: "In" },
2351
+ ] }), jsxRuntime.jsx("span", { className: "text-xs text-gray-500 min-w-[15px] sm:min-w-[20px]", children: "+" })] })] }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("div", { className: "text-sm font-medium", children: translations.cropBackgroundLabel }), jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-3 sm:gap-4", children: [jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "white", checked: backgroundColor === "white", onChange: function (e) {
2352
+ return setBackgroundColor(e.target.value);
2353
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-white border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundWhite })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "black", checked: backgroundColor === "black", onChange: function (e) {
2354
+ return setBackgroundColor(e.target.value);
2355
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-black border border-gray-300 rounded" }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundBlack })] }), jsxRuntime.jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [jsxRuntime.jsx("input", { type: "radio", name: "background-color", value: "transparent", checked: backgroundColor === "transparent", onChange: function (e) {
2356
+ return setBackgroundColor(e.target.value);
2357
+ }, className: "text-blue-600 focus:ring-blue-500" }), jsxRuntime.jsx("div", { className: "w-4 h-4 bg-gray-200 border border-gray-300 rounded", style: {
2358
+ backgroundImage: "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)",
2359
+ backgroundSize: "8px 8px",
2360
+ backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0px",
2361
+ } }), jsxRuntime.jsx("span", { className: "text-sm", children: translations.cropBackgroundTransparent })] })] })] })] }) }), jsxRuntime.jsxs(react.ModalFooter, { className: "flex flex-col-reverse sm:flex-row gap-2 px-4 sm:px-6", children: [jsxRuntime.jsx(react.Button, { color: "danger", variant: "light", onPress: onCancel, className: "w-full sm:w-auto", children: translations.cropCancelButton }), jsxRuntime.jsx(react.Button, { color: "primary", onPress: handleSave, className: "w-full sm:w-auto", children: translations.cropSaveButton })] })] }) }));
1967
2362
  };
1968
-
1969
- var ColorSelector = function (_a) {
1970
- var selectedColor = _a.selectedColor, onColorChange = _a.onColorChange;
1971
- var mode = useThemeContext().mode;
1972
- /**
1973
- * Filters and maps the available theme colors to the current theme mode (light/dark).
1974
- * Each color option contains:
1975
- * - value: the theme name (e.g., "blue-light")
1976
- * - label: the base color name (e.g., "blue")
1977
- * - color: the primary color hex value
1978
- */
1979
- var colorOptions = Object.entries(themeColors)
1980
- .filter(function (_a) {
1981
- var themeData = _a[1];
1982
- var themeMode = themeData.extend;
1983
- return mode === "light" ? themeMode === "light" : themeMode === "dark";
1984
- })
1985
- .map(function (_a) {
1986
- var themeName = _a[0], theme = _a[1];
1987
- return ({
1988
- value: themeName,
1989
- label: themeName.split("-")[0],
1990
- color: theme.colors.primary.DEFAULT,
2363
+ /**
2364
+ * Componente de previsualización de archivo
2365
+ */
2366
+ var FilePreview = function (_a) {
2367
+ var file = _a.file, onRemove = _a.onRemove, removeAriaLabel = _a.removeAriaLabel;
2368
+ var _b = React.useState(""), previewUrl = _b[0], setPreviewUrl = _b[1];
2369
+ React.useEffect(function () {
2370
+ if (file === null || file === void 0 ? void 0 : file.type.startsWith("image/")) {
2371
+ var url_1 = URL.createObjectURL(file);
2372
+ setPreviewUrl(url_1);
2373
+ return function () { return URL.revokeObjectURL(url_1); };
2374
+ }
2375
+ }, [file]);
2376
+ if (!(file === null || file === void 0 ? void 0 : file.type.startsWith("image/"))) {
2377
+ return null;
2378
+ }
2379
+ return (jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden z-10", children: [jsxRuntime.jsx("img", { src: previewUrl, alt: file.name, className: "w-full h-full object-cover" }), jsxRuntime.jsx(react.Button, { isIconOnly: true, size: "sm", color: "danger", variant: "solid", className: "absolute top-2 right-2 sm:top-3 sm:right-3 z-20 bg-red-100 hover:bg-red-200 text-red-600 min-w-8 h-8 sm:min-w-10 sm:h-10", onPress: onRemove, "aria-label": removeAriaLabel, children: jsxRuntime.jsx(IconComponent, { icon: "heroicons:trash", size: "sm" }) })] }));
2380
+ };
2381
+ /**
2382
+ * Componente UploadDocument basado en Hero UI con funcionalidad mejorada
2383
+ *
2384
+ * @example
2385
+ * ```tsx
2386
+ * <UploadDocument
2387
+ * onUpload={(files) => console.log(files)}
2388
+ * acceptedFiles="image/*,.pdf"
2389
+ * multiple={false}
2390
+ * translations={{
2391
+ * uploadText: "Upload your files",
2392
+ * dragText: "Drop files here"
2393
+ * }}
2394
+ * />
2395
+ * ```
2396
+ */
2397
+ var UploadFile = function (_a) {
2398
+ var text = _a.text, textColor = _a.textColor, subText = _a.subText,
2399
+ // borderColor, // TODO: Implementar colores personalizados
2400
+ iconColor = _a.iconColor,
2401
+ // backgroundColor, // TODO: Implementar colores personalizados
2402
+ _b = _a.width,
2403
+ // backgroundColor, // TODO: Implementar colores personalizados
2404
+ width = _b === void 0 ? "100%" : _b, _c = _a.height, height = _c === void 0 ? "auto" : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.maxFiles, maxFiles = _e === void 0 ? 1 : _e, maxFileSize = _a.maxFileSize, _f = _a.acceptedFiles, acceptedFiles = _f === void 0 ? ".pdf" : _f, _g = _a.icon, icon = _g === void 0 ? "heroicons:arrow-up-on-square" : _g, onUpload = _a.onUpload, onError = _a.onError, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.success, success = _j === void 0 ? false : _j, _k = _a.disabled, disabled = _k === void 0 ? false : _k, errorText = _a.errorText, cropConfig = _a.cropConfig, image = _a.image, _l = _a.className, className = _l === void 0 ? "" : _l, _m = _a.translations, translations = _m === void 0 ? {} : _m;
2405
+ var inputRef = React.useRef(null);
2406
+ var uploadImageRef = React.useRef(image || null);
2407
+ var _o = React.useState(false), isDragging = _o[0], setIsDragging = _o[1];
2408
+ // Estados para el modal de crop
2409
+ var _p = React.useState(false), showCropModal = _p[0], setShowCropModal = _p[1];
2410
+ var _q = React.useState(""), selectedImageUrl = _q[0], setSelectedImageUrl = _q[1];
2411
+ var _r = React.useState(null); _r[0]; var setOriginalFile = _r[1];
2412
+ // Combinar traducciones por defecto con las proporcionadas
2413
+ var t = React.useMemo(function () { return (__assign(__assign({}, defaultTranslations), translations)); }, [translations]);
2414
+ // Actualizar texto si se pasa como prop (retrocompatibilidad)
2415
+ var finalText = text || t.uploadText;
2416
+ var finalSubText = subText || t.subText;
2417
+ var handleClick = function () {
2418
+ var _a;
2419
+ if (!(disabled || uploadImageRef.current)) {
2420
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
2421
+ }
2422
+ };
2423
+ var validateFiles = React.useCallback(function (files) {
2424
+ var filesArray = Array.from(files);
2425
+ if (!multiple && filesArray.length > 1) {
2426
+ onError === null || onError === void 0 ? void 0 : onError(t.multipleFilesError);
2427
+ return [];
2428
+ }
2429
+ if (filesArray.length > maxFiles) {
2430
+ onError === null || onError === void 0 ? void 0 : onError(t.maxFilesError.replace("{maxFiles}", maxFiles.toString()));
2431
+ return [];
2432
+ }
2433
+ // Validar tamaño de archivo
2434
+ if (maxFileSize) {
2435
+ var oversizedFiles = filesArray.filter(function (file) { return file.size > maxFileSize; });
2436
+ if (oversizedFiles.length > 0) {
2437
+ var maxSizeFormatted = formatFileSize(maxFileSize);
2438
+ onError === null || onError === void 0 ? void 0 : onError(t.maxFileSizeError.replace("{maxSize}", maxSizeFormatted));
2439
+ return [];
2440
+ }
2441
+ }
2442
+ // Validar tipos de archivo
2443
+ var acceptedExtensions = Array.isArray(acceptedFiles)
2444
+ ? acceptedFiles.map(function (ext) { return ext.trim().toLowerCase(); })
2445
+ : acceptedFiles.split(",").map(function (ext) { return ext.trim().toLowerCase(); });
2446
+ var validFiles = filesArray.filter(function (file) {
2447
+ var _a;
2448
+ if (acceptedFiles.includes("image/*") &&
2449
+ file.type.startsWith("image/")) {
2450
+ return true;
2451
+ }
2452
+ if (acceptedExtensions.some(function (ext) { return ext.includes("/"); })) {
2453
+ return acceptedExtensions.some(function (type) { return file.type === type; });
2454
+ }
2455
+ var fileExtension = ".".concat((_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
2456
+ return acceptedExtensions.some(function (ext) { return ext === fileExtension || ext === "*"; });
1991
2457
  });
1992
- });
1993
- return (jsxRuntime.jsx(react.RadioGroup, { value: selectedColor, onValueChange: onColorChange, orientation: "horizontal", className: "flex flex-wrap !gap-2", classNames: {
1994
- base: "flex flex-wrap !gap-2",
1995
- wrapper: "flex flex-wrap !gap-2",
1996
- }, children: colorOptions.map(function (color) { return (jsxRuntime.jsx(react.Radio, { value: color.label, className: "p-0 m-0", classNames: {
1997
- base: "p-0 m-0",
1998
- wrapper: "hidden",
1999
- labelWrapper: "p-0 m-0",
2000
- }, children: jsxRuntime.jsx("div", { className: "w-8 h-8 rounded-full border-2 cursor-pointer transition-all ".concat(selectedColor === color.label
2001
- ? "border-black border-opacity-20 scale-110"
2002
- : "border-gray-200 hover:scale-105"), style: { backgroundColor: color.color }, title: color.label }) }, color.value)); }) }));
2458
+ if (validFiles.length === 0) {
2459
+ var formattedTypes = acceptedExtensions
2460
+ .map(formatFileType)
2461
+ .join(", ");
2462
+ onError === null || onError === void 0 ? void 0 : onError(t.invalidFileTypeError.replace("{acceptedTypes}", formattedTypes));
2463
+ return [];
2464
+ }
2465
+ return validFiles;
2466
+ }, [multiple, maxFiles, maxFileSize, acceptedFiles, t, onError]);
2467
+ var handleFileUpload = React.useCallback(function (files) {
2468
+ var validFiles = validateFiles(files);
2469
+ if (validFiles.length > 0) {
2470
+ var file_1 = validFiles[0];
2471
+ // Si es imagen y hay configuración de crop, abrir modal
2472
+ if (file_1.type.startsWith("image/") && cropConfig) {
2473
+ var reader_1 = new FileReader();
2474
+ reader_1.onload = function () {
2475
+ setSelectedImageUrl(reader_1.result);
2476
+ setOriginalFile(file_1);
2477
+ setShowCropModal(true);
2478
+ };
2479
+ reader_1.readAsDataURL(file_1);
2480
+ }
2481
+ else {
2482
+ // Procesar directamente si no necesita crop
2483
+ uploadImageRef.current = file_1;
2484
+ onUpload(validFiles);
2485
+ }
2486
+ }
2487
+ }, [onUpload, validateFiles, cropConfig]);
2488
+ // Manejar guardado de imagen recortada
2489
+ var handleCropSave = React.useCallback(function (croppedFile) {
2490
+ uploadImageRef.current = croppedFile;
2491
+ setShowCropModal(false);
2492
+ setSelectedImageUrl("");
2493
+ setOriginalFile(null);
2494
+ onUpload([croppedFile]);
2495
+ }, [onUpload]);
2496
+ // Manejar cancelación de crop
2497
+ var handleCropCancel = React.useCallback(function () {
2498
+ setShowCropModal(false);
2499
+ setSelectedImageUrl("");
2500
+ setOriginalFile(null);
2501
+ }, []);
2502
+ var handleChange = function (event) {
2503
+ var files = event.target.files;
2504
+ if (files && files.length > 0) {
2505
+ handleFileUpload(files);
2506
+ }
2507
+ // Limpiar el input
2508
+ if (inputRef.current) {
2509
+ inputRef.current.value = "";
2510
+ }
2511
+ };
2512
+ var handleDragEnter = React.useCallback(function (e) {
2513
+ e.preventDefault();
2514
+ e.stopPropagation();
2515
+ if (!disabled) {
2516
+ setIsDragging(true);
2517
+ }
2518
+ }, [disabled]);
2519
+ var handleDragLeave = React.useCallback(function (e) {
2520
+ e.preventDefault();
2521
+ e.stopPropagation();
2522
+ setIsDragging(false);
2523
+ }, []);
2524
+ var handleDragOver = React.useCallback(function (e) {
2525
+ e.preventDefault();
2526
+ e.stopPropagation();
2527
+ }, []);
2528
+ var handleDrop = React.useCallback(function (e) {
2529
+ e.preventDefault();
2530
+ e.stopPropagation();
2531
+ setIsDragging(false);
2532
+ if (disabled) {
2533
+ return;
2534
+ }
2535
+ var droppedFiles = e.dataTransfer.files;
2536
+ if (droppedFiles.length > 0) {
2537
+ handleFileUpload(droppedFiles);
2538
+ }
2539
+ }, [disabled, handleFileUpload]);
2540
+ var handleRemoveImage = function () {
2541
+ uploadImageRef.current = null;
2542
+ onUpload([]);
2543
+ };
2544
+ // Clases CSS dinámicas usando Tailwind
2545
+ var containerClasses = "\n\t\trelative w-full border-2 border-dashed rounded-2xl p-3 transition-all duration-300 bg-red-500\n\t\t".concat(width !== "100%" ? "w-[".concat(width, "]") : "w-full", "\n\t\t").concat(height !== "auto" ? "h-[".concat(height, "]") : "min-h-28", "\n\t\t").concat(isDragging
2546
+ ? "border-primary-500 bg-primary-50 dark:bg-primary-900"
2547
+ : error
2548
+ ? "border-danger-500 bg-danger-50 dark:bg-danger-950"
2549
+ : success
2550
+ ? "border-success-500 bg-success-50 dark:bg-success-950"
2551
+ : disabled
2552
+ ? "border-gray-300 bg-gray-100 dark:bg-gray-800"
2553
+ : "border-gray-300 hover:border-gray-400 bg-primary-50 dark:bg-gray-900", "\n\t\t").concat(!(disabled || uploadImageRef.current) ? "cursor-pointer" : "cursor-default", "\n\t\t").concat(className, "\n\t")
2554
+ .trim()
2555
+ .replace(/\s+/g, " ");
2556
+ var textClasses = "\n\t\ttext-centertext-base ont-medium\n\t\t".concat(disabled ? "text-default-400" : textColor || "text-default-700 dark:text-default-200", "\n\t");
2557
+ var subTextClasses = "\n\t\ttext-tiny text-center\n\t\t".concat(disabled ? "text-default-400" : "text-default-500 dark:text-default-400", "\n\t");
2558
+ return (jsxRuntime.jsxs("div", { className: "relative", children: [jsxRuntime.jsx(react.Card, { className: containerClasses, isPressable: !(disabled || uploadImageRef.current), onPress: handleClick, children: jsxRuntime.jsxs(react.CardBody, { className: "flex flex-col items-center justify-center gap-3 sm:gap-4 relative overflow-hidden", onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [uploadImageRef.current && (jsxRuntime.jsx(FilePreview, { file: uploadImageRef.current, onRemove: handleRemoveImage, removeAriaLabel: t.removeFileAriaLabel })), jsxRuntime.jsx("div", { className: uploadImageRef.current
2559
+ ? "opacity-0"
2560
+ : "opacity-100 transition-opacity", children: jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 sm:gap-4", children: [jsxRuntime.jsx(IconComponent, { icon: icon, size: "xl", className: "sm:text-4xl lg:text-5xl ".concat(disabled ? "text-gray-400" : iconColor || "text-primary") }), jsxRuntime.jsxs("div", { className: "text-center px-2", children: [jsxRuntime.jsx("p", { className: textClasses, children: isDragging ? t.dragText : finalText }), finalSubText && !isDragging && (jsxRuntime.jsx("p", { className: subTextClasses, children: finalSubText }))] })] }) }), jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "hidden", multiple: multiple, accept: Array.isArray(acceptedFiles)
2561
+ ? acceptedFiles.join(",")
2562
+ : acceptedFiles, onChange: handleChange, disabled: disabled, "aria-label": t.uploadAreaAriaLabel })] }) }), error && errorText && (jsxRuntime.jsx("p", { className: "text-red-500 text-sm mt-2", role: "alert", children: errorText })), showCropModal && selectedImageUrl && cropConfig && (jsxRuntime.jsx(ImageCropModal, { isOpen: showCropModal, imageUrl: selectedImageUrl, targetWidth: cropConfig.targetWidth, targetHeight: cropConfig.targetHeight, onSave: handleCropSave, onCancel: handleCropCancel, translations: t }))] }));
2003
2563
  };
2564
+ UploadFile.displayName = "UploadFile";
2004
2565
 
2005
2566
  var Modal = function (props) {
2006
2567
  return (jsxRuntime.jsx(react.Modal, __assign({ shouldBlockScroll: true, radius: "lg", className: "py-9 px-6" }, props)));
@@ -2148,6 +2709,7 @@ var AuraToastProvider = function (_a) {
2148
2709
  };
2149
2710
 
2150
2711
  exports.AddHolidayForm = AddHolidayForm;
2712
+ exports.AnalyticsCard = AnalyticsCard;
2151
2713
  exports.AuraTable = AuraTable;
2152
2714
  exports.AuraToastProvider = AuraToastProvider;
2153
2715
  exports.AutoComplete = AutoComplete;
@@ -2157,6 +2719,7 @@ exports.ColorSelector = ColorSelector;
2157
2719
  exports.DatePicker = DatePicker;
2158
2720
  exports.DateRangePicker = DateRangePicker;
2159
2721
  exports.GlobalToast = GlobalToast;
2722
+ exports.H1 = H1;
2160
2723
  exports.H2 = H2;
2161
2724
  exports.H3 = H3;
2162
2725
  exports.H4 = H4;
@@ -2169,11 +2732,15 @@ exports.ModalBody = ModalBody;
2169
2732
  exports.ModalContent = ModalContent;
2170
2733
  exports.ModalFooter = ModalFooter;
2171
2734
  exports.ModalHeader = ModalHeader;
2735
+ exports.MultiStepWizard = MultiStepWizard;
2172
2736
  exports.P = P;
2173
2737
  exports.Pagination = Pagination;
2174
2738
  exports.Phone = Phone;
2739
+ exports.PromotionalBanner = PromotionalBanner;
2740
+ exports.RowSteps = RowSteps;
2175
2741
  exports.ScheduleRow = ScheduleRow;
2176
2742
  exports.Select = Select;
2743
+ exports.StepIndicator = StepIndicator;
2177
2744
  exports.SwitchComponent = Switch;
2178
2745
  exports.Textarea = Textarea;
2179
2746
  exports.ThemeContext = ThemeContext;
@@ -2182,6 +2749,7 @@ exports.ThemeProvider = ThemeProvider;
2182
2749
  exports.TimeInputComponent = TimeInput;
2183
2750
  exports.ToastContext = ToastContext;
2184
2751
  exports.UploadFile = UploadFile;
2752
+ exports.VerticalSteps = VerticalSteps;
2185
2753
  exports.sizeMap = sizeMap;
2186
2754
  exports.themeColors = themeColors;
2187
2755
  exports.useAuraToast = useAuraToast;