hazo_ui 6.12.5 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -182,8 +182,8 @@ var require_extends = __commonJS({
182
182
  function _extends11() {
183
183
  return module.exports = _extends11 = Object.assign ? Object.assign.bind() : function(n) {
184
184
  for (var e = 1; e < arguments.length; e++) {
185
- var t35 = arguments[e];
186
- for (var r in t35) ({}).hasOwnProperty.call(t35, r) && (n[r] = t35[r]);
185
+ var t = arguments[e];
186
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
187
187
  }
188
188
  return n;
189
189
  }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends11.apply(null, arguments);
@@ -197,12 +197,12 @@ var require_objectWithoutPropertiesLoose = __commonJS({
197
197
  "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
198
198
  function _objectWithoutPropertiesLoose10(r, e) {
199
199
  if (null == r) return {};
200
- var t35 = {};
200
+ var t = {};
201
201
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
202
202
  if (-1 !== e.indexOf(n)) continue;
203
- t35[n] = r[n];
203
+ t[n] = r[n];
204
204
  }
205
- return t35;
205
+ return t;
206
206
  }
207
207
  module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
208
208
  }
@@ -753,6 +753,11 @@ var en_default = {
753
753
  "rte.horizontal_rule": "Horizontal rule",
754
754
  "rte.insert_image": "Insert image",
755
755
  "rte.table": "Table",
756
+ "rte.tab_html": "HTML",
757
+ "rte.tab_plain_text": "Plain Text",
758
+ "rte.tab_raw_html": "Raw HTML",
759
+ "rte.empty_content": "(empty)",
760
+ "rte.link_placeholder": "https://example.com",
756
761
  "rte.insert_variable": "Insert variable",
757
762
  "rte.attach_file": "Attach file",
758
763
  "rte.block_type.paragraph": "Paragraph",
@@ -801,6 +806,9 @@ var en_default = {
801
806
  "canvas_toolbar.align_right": "Align right",
802
807
  "canvas_toolbar.text_color": "Text color",
803
808
  "canvas_toolbar.font_family": "Font family",
809
+ "canvas_toolbar.font_sans": "Sans",
810
+ "canvas_toolbar.font_serif": "Serif",
811
+ "canvas_toolbar.font_mono": "Mono",
804
812
  "canvas_toolbar.align_top": "Align top",
805
813
  "canvas_toolbar.align_middle": "Align middle",
806
814
  "canvas_toolbar.align_bottom": "Align bottom",
@@ -813,6 +821,8 @@ var en_default = {
813
821
  "notification.loading": "Loading notifications",
814
822
  "notification.mark_all_read": "Mark all as read",
815
823
  "notification.unread": "Unread",
824
+ "notification.unread_count": "{{count}} unread",
825
+ "browser_tab.close_aria": "Close {{label}}",
816
826
  "confirm.cancel": "Cancel",
817
827
  "icon_picker.search_placeholder": "Search icons...",
818
828
  "common.loading": "Loading...",
@@ -832,10 +842,12 @@ var en_default = {
832
842
  "kanban.select_placeholder": "Select {{label}}\u2026",
833
843
  "kanban.select_priority": "Select priority\u2026",
834
844
  "kanban.select_status": "Select status\u2026",
845
+ "kanban.clear": "Clear",
835
846
  "markdown.placeholder": "Write in Markdown\u2026",
836
847
  "markdown.upload_failed": "Upload failed.",
837
848
  "markdown.loading_editor": "Loading editor\u2026",
838
849
  "markdown.uploading_image": "Uploading image\u2026",
850
+ "markdown.upload_placeholder": "uploading\u2026",
839
851
  "cropper.title": "Crop photo",
840
852
  "cropper.save": "Save",
841
853
  "cropper.cancel": "Cancel",
@@ -924,7 +936,26 @@ var en_default = {
924
936
  "charts.dropoff": "Drop-off: \u2212{{value}}",
925
937
  "toast.missing_prefix": "Missing: {{items}}"
926
938
  };
927
- var t = i18n.createPackageT("hazo_ui", en_default);
939
+ var default_t = i18n.createPackageT("hazo_ui", en_default);
940
+ var defaultHazoUiT = default_t;
941
+ var HazoUiI18nContext = React27.createContext(default_t);
942
+ function HazoUiI18nProvider({ t, children }) {
943
+ const safe_t = React27.useMemo(
944
+ () => (key, values) => {
945
+ try {
946
+ return t(key, values);
947
+ } catch {
948
+ get_logger().warn("i18n_missing_key_fallback", { key });
949
+ return default_t(key, values);
950
+ }
951
+ },
952
+ [t]
953
+ );
954
+ return /* @__PURE__ */ jsxRuntime.jsx(HazoUiI18nContext.Provider, { value: safe_t, children });
955
+ }
956
+ function useHazoUiT() {
957
+ return React27.useContext(HazoUiI18nContext);
958
+ }
928
959
  function FilterFieldItem({
929
960
  filterConfig,
930
961
  fieldConfig,
@@ -932,6 +963,7 @@ function FilterFieldItem({
932
963
  onOperatorChange,
933
964
  onDelete
934
965
  }) {
966
+ const t = useHazoUiT();
935
967
  const [isCalendarOpen, setIsCalendarOpen] = React27.useState(false);
936
968
  const renderInput = () => {
937
969
  switch (fieldConfig.type) {
@@ -1113,12 +1145,13 @@ function FilterFieldItem({
1113
1145
  ] })
1114
1146
  ] });
1115
1147
  }
1148
+ var NO_INITIAL_FILTERS = [];
1116
1149
  function HazoUiMultiFilterDialog({
1117
1150
  availableFields,
1118
1151
  onFilterChange,
1119
- initialFilters = [],
1120
- title = t("filter.title"),
1121
- description = t("filter.description"),
1152
+ initialFilters = NO_INITIAL_FILTERS,
1153
+ title: titleProp,
1154
+ description: descriptionProp,
1122
1155
  headerBackgroundColor,
1123
1156
  headerTextColor,
1124
1157
  submitButtonBackgroundColor,
@@ -1130,6 +1163,9 @@ function HazoUiMultiFilterDialog({
1130
1163
  clearButtonTextColor,
1131
1164
  clearButtonBorderColor
1132
1165
  }) {
1166
+ const t = useHazoUiT();
1167
+ const description = descriptionProp ?? t("filter.description");
1168
+ const title = titleProp ?? t("filter.title");
1133
1169
  const config = get_hazo_ui_config();
1134
1170
  const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
1135
1171
  const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
@@ -1371,7 +1407,6 @@ function HazoUiMultiFilterDialog({
1371
1407
  ] })
1372
1408
  ] });
1373
1409
  }
1374
- var t2 = i18n.createPackageT("hazo_ui", en_default);
1375
1410
  function SortableSortFieldItem({
1376
1411
  sortConfig,
1377
1412
  fieldLabel,
@@ -1379,6 +1414,7 @@ function SortableSortFieldItem({
1379
1414
  onDirectionChange,
1380
1415
  onDelete
1381
1416
  }) {
1417
+ const t = useHazoUiT();
1382
1418
  const {
1383
1419
  attributes,
1384
1420
  listeners,
@@ -1410,7 +1446,7 @@ function SortableSortFieldItem({
1410
1446
  ...attributes,
1411
1447
  ...listeners,
1412
1448
  className: "cls_drag_handle flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground/60 hover:text-foreground active:cursor-grabbing",
1413
- "aria-label": t2("sort.reorder_aria", { field: fieldLabel }),
1449
+ "aria-label": t("sort.reorder_aria", { field: fieldLabel }),
1414
1450
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVertical, { className: "cls_drag_icon h-4 w-4" })
1415
1451
  }
1416
1452
  ),
@@ -1418,7 +1454,7 @@ function SortableSortFieldItem({
1418
1454
  "span",
1419
1455
  {
1420
1456
  className: "cls_priority_badge inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold tabular-nums text-muted-foreground",
1421
- "aria-label": t2("sort.priority_aria", { n: priority }),
1457
+ "aria-label": t("sort.priority_aria", { n: priority }),
1422
1458
  children: priority
1423
1459
  }
1424
1460
  ),
@@ -1427,7 +1463,7 @@ function SortableSortFieldItem({
1427
1463
  "div",
1428
1464
  {
1429
1465
  role: "radiogroup",
1430
- "aria-label": t2("sort.direction_aria", { field: fieldLabel }),
1466
+ "aria-label": t("sort.direction_aria", { field: fieldLabel }),
1431
1467
  className: "cls_direction_control inline-flex shrink-0 items-center rounded-md border border-border/70 bg-muted/40 p-0.5",
1432
1468
  children: [
1433
1469
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1441,7 +1477,7 @@ function SortableSortFieldItem({
1441
1477
  className: "cls_dir_asc inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-muted-foreground transition-colors data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm hover:text-foreground",
1442
1478
  children: [
1443
1479
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-3 w-3" }),
1444
- t2("sort.asc")
1480
+ t("sort.asc")
1445
1481
  ]
1446
1482
  }
1447
1483
  ),
@@ -1456,7 +1492,7 @@ function SortableSortFieldItem({
1456
1492
  className: "cls_dir_desc inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-muted-foreground transition-colors data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm hover:text-foreground",
1457
1493
  children: [
1458
1494
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-3 w-3" }),
1459
- t2("sort.desc")
1495
+ t("sort.desc")
1460
1496
  ]
1461
1497
  }
1462
1498
  )
@@ -1470,7 +1506,7 @@ function SortableSortFieldItem({
1470
1506
  size: "sm",
1471
1507
  onClick: onDelete,
1472
1508
  className: "cls_delete_btn h-7 w-7 shrink-0 p-0 text-muted-foreground/60 hover:bg-destructive/10 hover:text-destructive",
1473
- "aria-label": t2("sort.remove_aria", { field: fieldLabel }),
1509
+ "aria-label": t("sort.remove_aria", { field: fieldLabel }),
1474
1510
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "cls_delete_icon h-3.5 w-3.5" })
1475
1511
  }
1476
1512
  )
@@ -1478,12 +1514,13 @@ function SortableSortFieldItem({
1478
1514
  }
1479
1515
  );
1480
1516
  }
1517
+ var NO_INITIAL_SORT_FIELDS = [];
1481
1518
  function HazoUiMultiSortDialog({
1482
1519
  availableFields,
1483
1520
  onSortChange,
1484
- initialSortFields = [],
1485
- title = t2("sort.title"),
1486
- description = t2("sort.description"),
1521
+ initialSortFields = NO_INITIAL_SORT_FIELDS,
1522
+ title: titleProp,
1523
+ description: descriptionProp,
1487
1524
  headerBackgroundColor,
1488
1525
  headerTextColor,
1489
1526
  submitButtonBackgroundColor,
@@ -1495,6 +1532,9 @@ function HazoUiMultiSortDialog({
1495
1532
  clearButtonTextColor,
1496
1533
  clearButtonBorderColor
1497
1534
  }) {
1535
+ const t = useHazoUiT();
1536
+ const description = descriptionProp ?? t("sort.description");
1537
+ const title = titleProp ?? t("sort.title");
1498
1538
  const config = get_hazo_ui_config();
1499
1539
  const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
1500
1540
  const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
@@ -1583,16 +1623,16 @@ function HazoUiMultiSortDialog({
1583
1623
  };
1584
1624
  const hasActiveSorts = initialSortFields.length > 0;
1585
1625
  const tooltipContent = hasActiveSorts ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_sort_tooltip_content space-y-1", children: [
1586
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children: t2("sort.active_sorts") }),
1626
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children: t("sort.active_sorts") }),
1587
1627
  initialSortFields.map((sortConfig, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_tooltip_item text-xs", children: [
1588
1628
  index + 1,
1589
1629
  ". ",
1590
1630
  getFieldLabel(sortConfig.field),
1591
1631
  " (",
1592
- sortConfig.direction === "asc" ? t2("sort.asc") : t2("sort.desc"),
1632
+ sortConfig.direction === "asc" ? t("sort.asc") : t("sort.desc"),
1593
1633
  ")"
1594
1634
  ] }, sortConfig.field))
1595
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children: t2("sort.no_active_sorts") });
1635
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children: t("sort.no_active_sorts") });
1596
1636
  return /* @__PURE__ */ jsxRuntime.jsxs(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
1597
1637
  /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
1598
1638
  /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1601,7 +1641,7 @@ function HazoUiMultiSortDialog({
1601
1641
  variant: "outline",
1602
1642
  size: "sm",
1603
1643
  className: "cls_sort_button",
1604
- "aria-label": t2("sort.open_dialog_aria"),
1644
+ "aria-label": t("sort.open_dialog_aria"),
1605
1645
  children: [
1606
1646
  /* @__PURE__ */ jsxRuntime.jsx(
1607
1647
  lucideReact.ArrowUpDown,
@@ -1612,7 +1652,7 @@ function HazoUiMultiSortDialog({
1612
1652
  )
1613
1653
  }
1614
1654
  ),
1615
- t2("sort.button_label"),
1655
+ t("sort.button_label"),
1616
1656
  hasActiveSorts && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_sort_count ml-2 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-blue-600 px-1 text-[10px] font-semibold text-white", children: initialSortFields.length })
1617
1657
  ]
1618
1658
  }
@@ -1657,7 +1697,7 @@ function HazoUiMultiSortDialog({
1657
1697
  }
1658
1698
  )
1659
1699
  }
1660
- ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_empty_sort_fields rounded-lg border border-dashed border-border/70 bg-muted/20 px-4 py-6 text-center text-xs text-muted-foreground", children: t2("sort.empty_message") }),
1700
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_empty_sort_fields rounded-lg border border-dashed border-border/70 bg-muted/20 px-4 py-6 text-center text-xs text-muted-foreground", children: t("sort.empty_message") }),
1661
1701
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_add_field_section", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isComboboxOpen, onOpenChange: setIsComboboxOpen, children: [
1662
1702
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1663
1703
  Button,
@@ -1669,13 +1709,13 @@ function HazoUiMultiSortDialog({
1669
1709
  className: "cls_add_field_combobox w-full justify-start gap-2 border border-dashed border-border/70 text-sm font-medium text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground",
1670
1710
  children: [
1671
1711
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "cls_plus_icon h-4 w-4" }),
1672
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ? t2("sort.all_fields_added") : t2("sort.add_sort_field") })
1712
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ? t("sort.all_fields_added") : t("sort.add_sort_field") })
1673
1713
  ]
1674
1714
  }
1675
1715
  ) }),
1676
1716
  /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "cls_combobox_popover w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
1677
- /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t2("sort.search_fields"), className: "cls_command_input" }),
1678
- /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t2("sort.no_fields_available") }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: availableFieldsToAdd.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
1717
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t("sort.search_fields"), className: "cls_command_input" }),
1718
+ /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t("sort.no_fields_available") }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: availableFieldsToAdd.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
1679
1719
  CommandItem,
1680
1720
  {
1681
1721
  value: field.label,
@@ -1697,7 +1737,7 @@ function HazoUiMultiSortDialog({
1697
1737
  onClick: handleClearAll,
1698
1738
  className: "cls_clear_all_btn text-muted-foreground hover:text-foreground",
1699
1739
  style: clearButtonStyles,
1700
- children: t2("sort.clear_all")
1740
+ children: t("sort.clear_all")
1701
1741
  }
1702
1742
  ) }),
1703
1743
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_footer_right flex items-center gap-2", children: [
@@ -1709,7 +1749,7 @@ function HazoUiMultiSortDialog({
1709
1749
  onClick: handleCancel,
1710
1750
  className: "cls_cancel_btn",
1711
1751
  style: cancelButtonStyles,
1712
- children: t2("sort.cancel")
1752
+ children: t("sort.cancel")
1713
1753
  }
1714
1754
  ),
1715
1755
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1719,7 +1759,7 @@ function HazoUiMultiSortDialog({
1719
1759
  onClick: handleApply,
1720
1760
  className: "cls_apply_btn",
1721
1761
  style: submitButtonStyles,
1722
- children: t2("sort.apply")
1762
+ children: t("sort.apply")
1723
1763
  }
1724
1764
  )
1725
1765
  ] })
@@ -2138,7 +2178,6 @@ var TabsContent = React27__namespace.forwardRef(({ className, ...props }, ref) =
2138
2178
  }
2139
2179
  ));
2140
2180
  TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
2141
- var t3 = i18n.createPackageT("hazo_ui", en_default);
2142
2181
  function isLucideValue(value) {
2143
2182
  return value.startsWith("lucide:");
2144
2183
  }
@@ -2357,6 +2396,7 @@ function HazoUiIconPicker({
2357
2396
  triggerClassName,
2358
2397
  align = "start"
2359
2398
  }) {
2399
+ const t = useHazoUiT();
2360
2400
  const [open, set_open] = React27__namespace.useState(false);
2361
2401
  const [search, set_search] = React27__namespace.useState("");
2362
2402
  const handle_select = React27__namespace.useCallback(
@@ -2404,7 +2444,7 @@ function HazoUiIconPicker({
2404
2444
  type: "text",
2405
2445
  value: search,
2406
2446
  onChange: (e) => set_search(e.target.value),
2407
- placeholder: t3("icon_picker.search_placeholder"),
2447
+ placeholder: t("icon_picker.search_placeholder"),
2408
2448
  className: cn(
2409
2449
  "cls_hazo_ui_icon_picker_search",
2410
2450
  "mb-2 flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm",
@@ -2428,11 +2468,11 @@ function HazoUiIconPicker({
2428
2468
  name
2429
2469
  );
2430
2470
  }),
2431
- filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children: t3("icon_picker.no_results") })
2471
+ filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children: t("icon_picker.no_results") })
2432
2472
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: "emoji", children: [
2433
2473
  /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "grid w-full grid-cols-6", children: [
2434
- /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children: t3("icon_picker.emoji_tab") }),
2435
- LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children: t3(group.label_key) }, group.key))
2474
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children: t("icon_picker.emoji_tab") }),
2475
+ LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children: t(group.label_key) }, group.key))
2436
2476
  ] }),
2437
2477
  /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "emoji", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid max-h-56 grid-cols-8 gap-1 overflow-y-auto", children: EMOJI_ITEMS.map((emoji, index) => /* @__PURE__ */ jsxRuntime.jsx(
2438
2478
  "button",
@@ -2464,8 +2504,7 @@ function HazoUiIconPicker({
2464
2504
  }
2465
2505
  ) });
2466
2506
  }
2467
- var t4 = i18n.createPackageT("hazo_ui", en_default);
2468
- function validateInput(value, input_type, text_len_min, text_len_max, num_min, num_max, regex, num_decimals) {
2507
+ function validateInput(value, input_type, text_len_min, text_len_max, num_min, num_max, regex, num_decimals, t) {
2469
2508
  if (value === "") {
2470
2509
  return { isValid: true };
2471
2510
  }
@@ -2473,36 +2512,36 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
2473
2512
  case "numeric": {
2474
2513
  const numValue = parseFloat(value);
2475
2514
  if (isNaN(numValue)) {
2476
- return { isValid: false, errorMessage: t4("flex_input.must_be_valid_number") };
2515
+ return { isValid: false, errorMessage: t("flex_input.must_be_valid_number") };
2477
2516
  }
2478
2517
  if (num_decimals !== void 0) {
2479
2518
  const decimalPlaces = value.split(".")[1]?.length || 0;
2480
2519
  if (decimalPlaces > num_decimals) {
2481
2520
  return {
2482
2521
  isValid: false,
2483
- errorMessage: t4("flex_input.max_decimals", { count: num_decimals })
2522
+ errorMessage: t("flex_input.max_decimals", { count: num_decimals })
2484
2523
  };
2485
2524
  }
2486
2525
  }
2487
2526
  if (num_min !== void 0 && numValue < num_min) {
2488
- return { isValid: false, errorMessage: t4("flex_input.min_value", { min: num_min }) };
2527
+ return { isValid: false, errorMessage: t("flex_input.min_value", { min: num_min }) };
2489
2528
  }
2490
2529
  if (num_max !== void 0 && numValue > num_max) {
2491
- return { isValid: false, errorMessage: t4("flex_input.max_value", { max: num_max }) };
2530
+ return { isValid: false, errorMessage: t("flex_input.max_value", { max: num_max }) };
2492
2531
  }
2493
2532
  break;
2494
2533
  }
2495
2534
  case "alpha": {
2496
2535
  const alphaRegex = /^[A-Za-z0-9\s]*$/;
2497
2536
  if (!alphaRegex.test(value)) {
2498
- return { isValid: false, errorMessage: t4("flex_input.alpha_only") };
2537
+ return { isValid: false, errorMessage: t("flex_input.alpha_only") };
2499
2538
  }
2500
2539
  break;
2501
2540
  }
2502
2541
  case "email": {
2503
2542
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
2504
2543
  if (!emailRegex.test(value)) {
2505
- return { isValid: false, errorMessage: t4("flex_input.must_be_valid_email") };
2544
+ return { isValid: false, errorMessage: t("flex_input.must_be_valid_email") };
2506
2545
  }
2507
2546
  break;
2508
2547
  }
@@ -2510,13 +2549,13 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
2510
2549
  if (text_len_min !== void 0 && value.length < text_len_min) {
2511
2550
  return {
2512
2551
  isValid: false,
2513
- errorMessage: t4("flex_input.min_characters", { min: text_len_min })
2552
+ errorMessage: t("flex_input.min_characters", { min: text_len_min })
2514
2553
  };
2515
2554
  }
2516
2555
  if (text_len_max !== void 0 && value.length > text_len_max) {
2517
2556
  return {
2518
2557
  isValid: false,
2519
- errorMessage: t4("flex_input.max_characters", { max: text_len_max })
2558
+ errorMessage: t("flex_input.max_characters", { max: text_len_max })
2520
2559
  };
2521
2560
  }
2522
2561
  break;
@@ -2525,7 +2564,7 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
2525
2564
  if (regex) {
2526
2565
  const regexPattern = typeof regex === "string" ? new RegExp(regex) : regex;
2527
2566
  if (!regexPattern.test(value)) {
2528
- return { isValid: false, errorMessage: t4("flex_input.invalid_format") };
2567
+ return { isValid: false, errorMessage: t("flex_input.invalid_format") };
2529
2568
  }
2530
2569
  }
2531
2570
  return { isValid: true };
@@ -2576,6 +2615,7 @@ var HazoUiFlexInput = React27__namespace.forwardRef(
2576
2615
  onBlur,
2577
2616
  ...props
2578
2617
  }, ref) => {
2618
+ const t = useHazoUiT();
2579
2619
  const [internalValue, setInternalValue] = React27__namespace.useState(
2580
2620
  typeof controlledValue === "string" ? controlledValue : typeof controlledValue === "number" ? String(controlledValue) : ""
2581
2621
  );
@@ -2618,10 +2658,11 @@ var HazoUiFlexInput = React27__namespace.forwardRef(
2618
2658
  num_min,
2619
2659
  num_max,
2620
2660
  regex,
2621
- num_decimals
2661
+ num_decimals,
2662
+ t
2622
2663
  );
2623
2664
  if (!validation.isValid) {
2624
- setErrorMessage(validation.errorMessage || format_guide || t4("flex_input.invalid_input"));
2665
+ setErrorMessage(validation.errorMessage || format_guide || t("flex_input.invalid_input"));
2625
2666
  } else {
2626
2667
  setErrorMessage(void 0);
2627
2668
  }
@@ -3851,10 +3892,10 @@ var BLOCK_TYPE_LABEL_KEYS = {
3851
3892
  "code-block": "rte.block_type.code_block",
3852
3893
  blockquote: "rte.block_type.blockquote"
3853
3894
  };
3854
- function get_translated_block_types(t35) {
3895
+ function get_translated_block_types(t) {
3855
3896
  return BLOCK_TYPES.map((type) => ({
3856
3897
  ...type,
3857
- label: t35(BLOCK_TYPE_LABEL_KEYS[type.value])
3898
+ label: t(BLOCK_TYPE_LABEL_KEYS[type.value])
3858
3899
  }));
3859
3900
  }
3860
3901
 
@@ -3901,7 +3942,6 @@ function get_file_extension(filename) {
3901
3942
  function is_image_file(mime_type) {
3902
3943
  return mime_type.startsWith("image/");
3903
3944
  }
3904
- var t5 = i18n.createPackageT("hazo_ui", en_default);
3905
3945
  var ALL_ON = {
3906
3946
  undo_redo: true,
3907
3947
  block_type: true,
@@ -3938,6 +3978,7 @@ var Toolbar = ({
3938
3978
  toolbar,
3939
3979
  font_families
3940
3980
  }) => {
3981
+ const t = useHazoUiT();
3941
3982
  const [link_url, set_link_url] = React27__namespace.useState("https://");
3942
3983
  const [link_popover_open, set_link_popover_open] = React27__namespace.useState(false);
3943
3984
  const [text_color_open, set_text_color_open] = React27__namespace.useState(false);
@@ -3956,7 +3997,7 @@ var Toolbar = ({
3956
3997
  }
3957
3998
  const tb = { ...ALL_ON, ...toolbar };
3958
3999
  const font_family_options = font_families && font_families.length > 0 ? font_families : FONT_FAMILIES;
3959
- const block_type_options = get_translated_block_types(t5);
4000
+ const block_type_options = get_translated_block_types(t);
3960
4001
  const get_current_font_size = () => {
3961
4002
  const attrs = editor.getAttributes("textStyle");
3962
4003
  return attrs.fontSize || FONT_SIZE_CONFIG.default;
@@ -4100,7 +4141,7 @@ var Toolbar = ({
4100
4141
  {
4101
4142
  onClick: () => editor.chain().focus().undo().run(),
4102
4143
  disabled: !editor.can().undo(),
4103
- tooltip: t5("rte.undo"),
4144
+ tooltip: t("rte.undo"),
4104
4145
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUndo2, { className: "h-4 w-4" })
4105
4146
  },
4106
4147
  "undo"
@@ -4110,7 +4151,7 @@ var Toolbar = ({
4110
4151
  {
4111
4152
  onClick: () => editor.chain().focus().redo().run(),
4112
4153
  disabled: !editor.can().redo(),
4113
- tooltip: t5("rte.redo"),
4154
+ tooltip: t("rte.redo"),
4114
4155
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRedo2, { className: "h-4 w-4" })
4115
4156
  },
4116
4157
  "redo"
@@ -4151,7 +4192,7 @@ var Toolbar = ({
4151
4192
  ToolbarButton,
4152
4193
  {
4153
4194
  onClick: () => handle_font_size_change(-2),
4154
- tooltip: t5("rte.decrease_font_size"),
4195
+ tooltip: t("rte.decrease_font_size"),
4155
4196
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuMinus, { className: "h-3 w-3" })
4156
4197
  }
4157
4198
  ),
@@ -4160,7 +4201,7 @@ var Toolbar = ({
4160
4201
  ToolbarButton,
4161
4202
  {
4162
4203
  onClick: () => handle_font_size_change(FONT_SIZE_CONFIG.step),
4163
- tooltip: t5("rte.increase_font_size"),
4204
+ tooltip: t("rte.increase_font_size"),
4164
4205
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPlus, { className: "h-3 w-3" })
4165
4206
  }
4166
4207
  )
@@ -4178,7 +4219,7 @@ var Toolbar = ({
4178
4219
  {
4179
4220
  onClick: () => editor.chain().focus().toggleBold().run(),
4180
4221
  is_active: editor.isActive("bold"),
4181
- tooltip: t5("rte.bold"),
4222
+ tooltip: t("rte.bold"),
4182
4223
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" })
4183
4224
  },
4184
4225
  "bold"
@@ -4192,7 +4233,7 @@ var Toolbar = ({
4192
4233
  {
4193
4234
  onClick: () => editor.chain().focus().toggleItalic().run(),
4194
4235
  is_active: editor.isActive("italic"),
4195
- tooltip: t5("rte.italic"),
4236
+ tooltip: t("rte.italic"),
4196
4237
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" })
4197
4238
  },
4198
4239
  "italic"
@@ -4206,7 +4247,7 @@ var Toolbar = ({
4206
4247
  {
4207
4248
  onClick: () => editor.chain().focus().toggleUnderline().run(),
4208
4249
  is_active: editor.isActive("underline"),
4209
- tooltip: t5("rte.underline"),
4250
+ tooltip: t("rte.underline"),
4210
4251
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
4211
4252
  },
4212
4253
  "underline"
@@ -4220,7 +4261,7 @@ var Toolbar = ({
4220
4261
  {
4221
4262
  onClick: () => editor.chain().focus().toggleStrike().run(),
4222
4263
  is_active: editor.isActive("strike"),
4223
- tooltip: t5("rte.strikethrough"),
4264
+ tooltip: t("rte.strikethrough"),
4224
4265
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuStrikethrough, { className: "h-4 w-4" })
4225
4266
  },
4226
4267
  "strike"
@@ -4234,7 +4275,7 @@ var Toolbar = ({
4234
4275
  {
4235
4276
  onClick: () => editor.chain().focus().toggleSubscript().run(),
4236
4277
  is_active: editor.isActive("subscript"),
4237
- tooltip: t5("rte.subscript"),
4278
+ tooltip: t("rte.subscript"),
4238
4279
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSubscript, { className: "h-4 w-4" })
4239
4280
  },
4240
4281
  "sub"
@@ -4248,7 +4289,7 @@ var Toolbar = ({
4248
4289
  {
4249
4290
  onClick: () => editor.chain().focus().toggleSuperscript().run(),
4250
4291
  is_active: editor.isActive("superscript"),
4251
- tooltip: t5("rte.superscript"),
4292
+ tooltip: t("rte.superscript"),
4252
4293
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSuperscript, { className: "h-4 w-4" })
4253
4294
  },
4254
4295
  "super"
@@ -4262,26 +4303,26 @@ var Toolbar = ({
4262
4303
  if (tb.link) {
4263
4304
  items.push(
4264
4305
  /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: link_popover_open, onOpenChange: set_link_popover_open, children: [
4265
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip: t5("rte.link"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuLink, { className: "h-4 w-4" }) }) }),
4306
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip: t("rte.link"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuLink, { className: "h-4 w-4" }) }) }),
4266
4307
  /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
4267
4308
  /* @__PURE__ */ jsxRuntime.jsx(
4268
4309
  Input,
4269
4310
  {
4270
4311
  value: link_url,
4271
4312
  onChange: (e) => set_link_url(e.target.value),
4272
- placeholder: "https://example.com",
4313
+ placeholder: t("rte.link_placeholder"),
4273
4314
  className: "h-8 text-sm"
4274
4315
  }
4275
4316
  ),
4276
4317
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
4277
- /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: handle_set_link, className: "flex-1", children: editor.isActive("link") ? t5("rte.update_link") : t5("rte.add_link") }),
4318
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: handle_set_link, className: "flex-1", children: editor.isActive("link") ? t("rte.update_link") : t("rte.add_link") }),
4278
4319
  editor.isActive("link") && /* @__PURE__ */ jsxRuntime.jsx(
4279
4320
  Button,
4280
4321
  {
4281
4322
  size: "sm",
4282
4323
  variant: "destructive",
4283
4324
  onClick: handle_remove_link,
4284
- children: t5("rte.remove_link")
4325
+ children: t("rte.remove_link")
4285
4326
  }
4286
4327
  )
4287
4328
  ] })
@@ -4295,7 +4336,7 @@ var Toolbar = ({
4295
4336
  ToolbarButton,
4296
4337
  {
4297
4338
  onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
4298
- tooltip: t5("rte.clear_formatting"),
4339
+ tooltip: t("rte.clear_formatting"),
4299
4340
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRemoveFormatting, { className: "h-4 w-4" })
4300
4341
  },
4301
4342
  "clear"
@@ -4309,7 +4350,7 @@ var Toolbar = ({
4309
4350
  if (tb.text_color) {
4310
4351
  items.push(
4311
4352
  /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: text_color_open, onOpenChange: set_text_color_open, children: [
4312
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.text_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
4353
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.text_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
4313
4354
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuPalette, { className: "h-4 w-4" }),
4314
4355
  /* @__PURE__ */ jsxRuntime.jsx(
4315
4356
  "div",
@@ -4352,7 +4393,7 @@ var Toolbar = ({
4352
4393
  if (tb.highlight_color) {
4353
4394
  items.push(
4354
4395
  /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: highlight_color_open, onOpenChange: set_highlight_color_open, children: [
4355
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.highlight_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
4396
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.highlight_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
4356
4397
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuHighlighter, { className: "h-4 w-4" }),
4357
4398
  /* @__PURE__ */ jsxRuntime.jsx(
4358
4399
  "div",
@@ -4395,7 +4436,7 @@ var Toolbar = ({
4395
4436
  {
4396
4437
  onClick: () => editor.chain().focus().setTextAlign("left").run(),
4397
4438
  is_active: editor.isActive({ textAlign: "left" }),
4398
- tooltip: t5("rte.align_left"),
4439
+ tooltip: t("rte.align_left"),
4399
4440
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
4400
4441
  },
4401
4442
  "align-left"
@@ -4405,7 +4446,7 @@ var Toolbar = ({
4405
4446
  {
4406
4447
  onClick: () => editor.chain().focus().setTextAlign("center").run(),
4407
4448
  is_active: editor.isActive({ textAlign: "center" }),
4408
- tooltip: t5("rte.align_center"),
4449
+ tooltip: t("rte.align_center"),
4409
4450
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
4410
4451
  },
4411
4452
  "align-center"
@@ -4415,7 +4456,7 @@ var Toolbar = ({
4415
4456
  {
4416
4457
  onClick: () => editor.chain().focus().setTextAlign("right").run(),
4417
4458
  is_active: editor.isActive({ textAlign: "right" }),
4418
- tooltip: t5("rte.align_right"),
4459
+ tooltip: t("rte.align_right"),
4419
4460
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
4420
4461
  },
4421
4462
  "align-right"
@@ -4425,7 +4466,7 @@ var Toolbar = ({
4425
4466
  {
4426
4467
  onClick: () => editor.chain().focus().setTextAlign("justify").run(),
4427
4468
  is_active: editor.isActive({ textAlign: "justify" }),
4428
- tooltip: t5("rte.justify"),
4469
+ tooltip: t("rte.justify"),
4429
4470
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignJustify, { className: "h-4 w-4" })
4430
4471
  },
4431
4472
  "align-justify"
@@ -4441,7 +4482,7 @@ var Toolbar = ({
4441
4482
  {
4442
4483
  onClick: () => editor.chain().focus().toggleBulletList().run(),
4443
4484
  is_active: editor.isActive("bulletList"),
4444
- tooltip: t5("rte.bullet_list"),
4485
+ tooltip: t("rte.bullet_list"),
4445
4486
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" })
4446
4487
  },
4447
4488
  "bullet"
@@ -4455,7 +4496,7 @@ var Toolbar = ({
4455
4496
  {
4456
4497
  onClick: () => editor.chain().focus().toggleOrderedList().run(),
4457
4498
  is_active: editor.isActive("orderedList"),
4458
- tooltip: t5("rte.ordered_list"),
4499
+ tooltip: t("rte.ordered_list"),
4459
4500
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListOrdered, { className: "h-4 w-4" })
4460
4501
  },
4461
4502
  "ordered"
@@ -4469,7 +4510,7 @@ var Toolbar = ({
4469
4510
  {
4470
4511
  onClick: () => editor.chain().focus().toggleTaskList().run(),
4471
4512
  is_active: editor.isActive("taskList"),
4472
- tooltip: t5("rte.checklist"),
4513
+ tooltip: t("rte.checklist"),
4473
4514
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListChecks, { className: "h-4 w-4" })
4474
4515
  },
4475
4516
  "task"
@@ -4491,7 +4532,7 @@ var Toolbar = ({
4491
4532
  }
4492
4533
  },
4493
4534
  disabled: !editor.can().liftListItem("listItem") && !editor.can().liftListItem("taskItem"),
4494
- tooltip: t5("rte.decrease_indent"),
4535
+ tooltip: t("rte.decrease_indent"),
4495
4536
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentDecrease, { className: "h-4 w-4" })
4496
4537
  },
4497
4538
  "indent-dec"
@@ -4507,7 +4548,7 @@ var Toolbar = ({
4507
4548
  }
4508
4549
  },
4509
4550
  disabled: !editor.can().sinkListItem("listItem") && !editor.can().sinkListItem("taskItem"),
4510
- tooltip: t5("rte.increase_indent"),
4551
+ tooltip: t("rte.increase_indent"),
4511
4552
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentIncrease, { className: "h-4 w-4" })
4512
4553
  },
4513
4554
  "indent-inc"
@@ -4518,7 +4559,7 @@ var Toolbar = ({
4518
4559
  const items = [];
4519
4560
  if (tb.horizontal_rule) {
4520
4561
  items.push(
4521
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip: t5("rte.horizontal_rule"), children: /* @__PURE__ */ jsxRuntime.jsx(rx.RxDividerHorizontal, { className: "h-4 w-4" }) }, "hr")
4562
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip: t("rte.horizontal_rule"), children: /* @__PURE__ */ jsxRuntime.jsx(rx.RxDividerHorizontal, { className: "h-4 w-4" }) }, "hr")
4522
4563
  );
4523
4564
  }
4524
4565
  if (tb.image) {
@@ -4527,7 +4568,7 @@ var Toolbar = ({
4527
4568
  ToolbarButton,
4528
4569
  {
4529
4570
  onClick: () => image_input_ref.current?.click(),
4530
- tooltip: t5("rte.insert_image"),
4571
+ tooltip: t("rte.insert_image"),
4531
4572
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuImage, { className: "h-4 w-4" })
4532
4573
  },
4533
4574
  "image"
@@ -4541,14 +4582,14 @@ var Toolbar = ({
4541
4582
  ToolbarButton,
4542
4583
  {
4543
4584
  is_active: editor.isActive("table"),
4544
- tooltip: t5("rte.table"),
4585
+ tooltip: t("rte.table"),
4545
4586
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuTable, { className: "h-4 w-4" })
4546
4587
  }
4547
4588
  ) }),
4548
4589
  /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-3", align: "start", children: editor.isActive("table") ? (
4549
4590
  // Table editing controls when inside a table
4550
4591
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
4551
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t5("rte.table_operations") }),
4592
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t("rte.table_operations") }),
4552
4593
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-1", children: [
4553
4594
  /* @__PURE__ */ jsxRuntime.jsxs(
4554
4595
  Button,
@@ -4559,7 +4600,7 @@ var Toolbar = ({
4559
4600
  onClick: handle_add_row_before,
4560
4601
  children: [
4561
4602
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
4562
- t5("rte.add_row_above")
4603
+ t("rte.add_row_above")
4563
4604
  ]
4564
4605
  }
4565
4606
  ),
@@ -4572,7 +4613,7 @@ var Toolbar = ({
4572
4613
  onClick: handle_add_row_after,
4573
4614
  children: [
4574
4615
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
4575
- t5("rte.add_row_below")
4616
+ t("rte.add_row_below")
4576
4617
  ]
4577
4618
  }
4578
4619
  ),
@@ -4585,7 +4626,7 @@ var Toolbar = ({
4585
4626
  onClick: handle_add_col_before,
4586
4627
  children: [
4587
4628
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
4588
- t5("rte.add_col_left")
4629
+ t("rte.add_col_left")
4589
4630
  ]
4590
4631
  }
4591
4632
  ),
@@ -4598,7 +4639,7 @@ var Toolbar = ({
4598
4639
  onClick: handle_add_col_after,
4599
4640
  children: [
4600
4641
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
4601
- t5("rte.add_col_right")
4642
+ t("rte.add_col_right")
4602
4643
  ]
4603
4644
  }
4604
4645
  ),
@@ -4611,7 +4652,7 @@ var Toolbar = ({
4611
4652
  onClick: handle_delete_row,
4612
4653
  children: [
4613
4654
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
4614
- t5("rte.delete_row")
4655
+ t("rte.delete_row")
4615
4656
  ]
4616
4657
  }
4617
4658
  ),
@@ -4624,7 +4665,7 @@ var Toolbar = ({
4624
4665
  onClick: handle_delete_col,
4625
4666
  children: [
4626
4667
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
4627
- t5("rte.delete_col")
4668
+ t("rte.delete_col")
4628
4669
  ]
4629
4670
  }
4630
4671
  )
@@ -4638,7 +4679,7 @@ var Toolbar = ({
4638
4679
  onClick: handle_delete_table,
4639
4680
  children: [
4640
4681
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
4641
- t5("rte.delete_table")
4682
+ t("rte.delete_table")
4642
4683
  ]
4643
4684
  }
4644
4685
  )
@@ -4646,7 +4687,7 @@ var Toolbar = ({
4646
4687
  ) : (
4647
4688
  // Table size picker when not in a table
4648
4689
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
4649
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t5("rte.insert_table_heading") }),
4690
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t("rte.insert_table_heading") }),
4650
4691
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-0.5", children: Array.from({ length: 6 }).map((_, row_idx) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-0.5", children: Array.from({ length: 6 }).map((_2, col_idx) => /* @__PURE__ */ jsxRuntime.jsx(
4651
4692
  "div",
4652
4693
  {
@@ -4660,9 +4701,9 @@ var Toolbar = ({
4660
4701
  },
4661
4702
  col_idx
4662
4703
  )) }, row_idx)) }),
4663
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` : t5("rte.select_size") }),
4704
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` : t("rte.select_size") }),
4664
4705
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t pt-2 mt-1", children: [
4665
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children: t5("rte.custom_size") }),
4706
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children: t("rte.custom_size") }),
4666
4707
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4667
4708
  /* @__PURE__ */ jsxRuntime.jsx(
4668
4709
  Input,
@@ -4695,7 +4736,7 @@ var Toolbar = ({
4695
4736
  onClick: () => handle_table_insert(table_rows, table_cols),
4696
4737
  children: [
4697
4738
  /* @__PURE__ */ jsxRuntime.jsx(lu.LuGrid3X3, { className: "h-3 w-3 mr-1" }),
4698
- t5("rte.insert_table")
4739
+ t("rte.insert_table")
4699
4740
  ]
4700
4741
  }
4701
4742
  )
@@ -4713,11 +4754,11 @@ var Toolbar = ({
4713
4754
  if (tb.variables && variables.length > 0) {
4714
4755
  items.push(
4715
4756
  /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: variables_menu_open, onOpenChange: set_variables_menu_open, children: [
4716
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.insert_variable"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuVariable, { className: "h-4 w-4" }) }) }),
4757
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.insert_variable"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuVariable, { className: "h-4 w-4" }) }) }),
4717
4758
  /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
4718
- /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t5("rte.search_variables"), className: "h-8 text-xs" }),
4759
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t("rte.search_variables"), className: "h-8 text-xs" }),
4719
4760
  /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
4720
- /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t5("rte.no_variables") }),
4761
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t("rte.no_variables") }),
4721
4762
  /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: variables.map((variable) => /* @__PURE__ */ jsxRuntime.jsx(
4722
4763
  CommandItem,
4723
4764
  {
@@ -4742,7 +4783,7 @@ var Toolbar = ({
4742
4783
  ToolbarButton,
4743
4784
  {
4744
4785
  onClick: () => file_input_ref.current?.click(),
4745
- tooltip: t5("rte.attach_file"),
4786
+ tooltip: t("rte.attach_file"),
4746
4787
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPaperclip, { className: "h-4 w-4" })
4747
4788
  },
4748
4789
  "attach"
@@ -5014,7 +5055,6 @@ var VariableExtension = core.Node.create({
5014
5055
  };
5015
5056
  }
5016
5057
  });
5017
- var t6 = i18n.createPackageT("hazo_ui", en_default);
5018
5058
  function debounce_fn(func, wait) {
5019
5059
  let timeout_id = null;
5020
5060
  return (output) => {
@@ -5040,7 +5080,8 @@ var HazoUiRte = ({
5040
5080
  toolbar,
5041
5081
  font_families
5042
5082
  }) => {
5043
- const resolved_placeholder = placeholder ?? t6("rte.placeholder");
5083
+ const t = useHazoUiT();
5084
+ const resolved_placeholder = placeholder ?? t("rte.placeholder");
5044
5085
  const [attachments, set_attachments] = React27__namespace.useState(
5045
5086
  initial_attachments
5046
5087
  );
@@ -5234,9 +5275,9 @@ var HazoUiRte = ({
5234
5275
  }
5235
5276
  ),
5236
5277
  show_output_viewer && editor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_rte_tabs border-b border-border px-2 pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(Tabs, { value: active_tab, onValueChange: (v) => set_active_tab(v), children: /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "h-9", children: [
5237
- /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "html", className: "text-sm", children: "HTML" }),
5238
- /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "plain_text", className: "text-sm", children: "Plain Text" }),
5239
- /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "raw_html", className: "text-sm", children: "Raw HTML" })
5278
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "html", className: "text-sm", children: t("rte.tab_html") }),
5279
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "plain_text", className: "text-sm", children: t("rte.tab_plain_text") }),
5280
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "raw_html", className: "text-sm", children: t("rte.tab_raw_html") })
5240
5281
  ] }) }) }),
5241
5282
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minHeight: min_height, maxHeight: max_height }, className: "overflow-auto", children: [
5242
5283
  active_tab === "html" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -5249,8 +5290,8 @@ var HazoUiRte = ({
5249
5290
  )
5250
5291
  }
5251
5292
  ),
5252
- active_tab === "plain_text" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_plain_text p-4 text-sm whitespace-pre-wrap font-mono h-full", children: editor?.getText() || "(empty)" }),
5253
- active_tab === "raw_html" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_raw_html p-4 text-xs whitespace-pre-wrap font-mono text-muted-foreground h-full", children: format_html(editor?.getHTML() || "") || "(empty)" })
5293
+ active_tab === "plain_text" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_plain_text p-4 text-sm whitespace-pre-wrap font-mono h-full", children: editor?.getText() || t("rte.empty_content") }),
5294
+ active_tab === "raw_html" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_raw_html p-4 text-xs whitespace-pre-wrap font-mono text-muted-foreground h-full", children: format_html(editor?.getHTML() || "") || t("rte.empty_content") })
5254
5295
  ] }),
5255
5296
  /* @__PURE__ */ jsxRuntime.jsx(
5256
5297
  AttachmentsList,
@@ -5265,7 +5306,6 @@ var HazoUiRte = ({
5265
5306
  );
5266
5307
  };
5267
5308
  HazoUiRte.displayName = "HazoUiRte";
5268
- var t7 = i18n.createPackageT("hazo_ui", en_default);
5269
5309
  function CanvasTextToolbar({
5270
5310
  bold,
5271
5311
  italic,
@@ -5286,6 +5326,7 @@ function CanvasTextToolbar({
5286
5326
  className,
5287
5327
  style
5288
5328
  }) {
5329
+ const t = useHazoUiT();
5289
5330
  return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs(
5290
5331
  "div",
5291
5332
  {
@@ -5296,14 +5337,14 @@ function CanvasTextToolbar({
5296
5337
  ),
5297
5338
  style,
5298
5339
  children: [
5299
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: t7("canvas_toolbar.bold"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" }) }),
5300
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: t7("canvas_toolbar.italic"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" }) }),
5340
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: t("canvas_toolbar.bold"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" }) }),
5341
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: t("canvas_toolbar.italic"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" }) }),
5301
5342
  /* @__PURE__ */ jsxRuntime.jsx(
5302
5343
  ToolbarButton,
5303
5344
  {
5304
5345
  is_active: underline,
5305
5346
  onClick: onUnderline,
5306
- tooltip: t7("canvas_toolbar.underline"),
5347
+ tooltip: t("canvas_toolbar.underline"),
5307
5348
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
5308
5349
  }
5309
5350
  ),
@@ -5313,7 +5354,7 @@ function CanvasTextToolbar({
5313
5354
  {
5314
5355
  is_active: align === "left",
5315
5356
  onClick: () => onAlign?.("left"),
5316
- tooltip: t7("canvas_toolbar.align_left"),
5357
+ tooltip: t("canvas_toolbar.align_left"),
5317
5358
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
5318
5359
  }
5319
5360
  ),
@@ -5322,7 +5363,7 @@ function CanvasTextToolbar({
5322
5363
  {
5323
5364
  is_active: align === "center",
5324
5365
  onClick: () => onAlign?.("center"),
5325
- tooltip: t7("canvas_toolbar.align_center"),
5366
+ tooltip: t("canvas_toolbar.align_center"),
5326
5367
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
5327
5368
  }
5328
5369
  ),
@@ -5331,7 +5372,7 @@ function CanvasTextToolbar({
5331
5372
  {
5332
5373
  is_active: align === "right",
5333
5374
  onClick: () => onAlign?.("right"),
5334
- tooltip: t7("canvas_toolbar.align_right"),
5375
+ tooltip: t("canvas_toolbar.align_right"),
5335
5376
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
5336
5377
  }
5337
5378
  ),
@@ -5340,7 +5381,7 @@ function CanvasTextToolbar({
5340
5381
  "label",
5341
5382
  {
5342
5383
  className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md hover:bg-accent",
5343
- title: t7("canvas_toolbar.text_color"),
5384
+ title: t("canvas_toolbar.text_color"),
5344
5385
  children: [
5345
5386
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
5346
5387
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground", children: "A" }),
@@ -5370,7 +5411,7 @@ function CanvasTextToolbar({
5370
5411
  {
5371
5412
  is_active: verticalAlign === "top",
5372
5413
  onClick: () => onVerticalAlign?.("top"),
5373
- tooltip: t7("canvas_toolbar.align_top"),
5414
+ tooltip: t("canvas_toolbar.align_top"),
5374
5415
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyStart, { className: "h-4 w-4" })
5375
5416
  }
5376
5417
  ),
@@ -5379,7 +5420,7 @@ function CanvasTextToolbar({
5379
5420
  {
5380
5421
  is_active: verticalAlign === "middle",
5381
5422
  onClick: () => onVerticalAlign?.("middle"),
5382
- tooltip: t7("canvas_toolbar.align_middle"),
5423
+ tooltip: t("canvas_toolbar.align_middle"),
5383
5424
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyCenter, { className: "h-4 w-4" })
5384
5425
  }
5385
5426
  ),
@@ -5388,7 +5429,7 @@ function CanvasTextToolbar({
5388
5429
  {
5389
5430
  is_active: verticalAlign === "bottom",
5390
5431
  onClick: () => onVerticalAlign?.("bottom"),
5391
- tooltip: t7("canvas_toolbar.align_bottom"),
5432
+ tooltip: t("canvas_toolbar.align_bottom"),
5392
5433
  children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyEnd, { className: "h-4 w-4" })
5393
5434
  }
5394
5435
  ),
@@ -5399,11 +5440,11 @@ function CanvasTextToolbar({
5399
5440
  value: font,
5400
5441
  onChange: (e) => onFont?.(e.target.value),
5401
5442
  className: "h-8 text-xs rounded-md border border-border bg-background px-1 text-foreground focus:outline-none",
5402
- title: t7("canvas_toolbar.font_family"),
5443
+ title: t("canvas_toolbar.font_family"),
5403
5444
  children: [
5404
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: "Sans" }),
5405
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: "Serif" }),
5406
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "monospace", children: "Mono" }),
5445
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: t("canvas_toolbar.font_sans") }),
5446
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: t("canvas_toolbar.font_serif") }),
5447
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "monospace", children: t("canvas_toolbar.font_mono") }),
5407
5448
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Arial", children: "Arial" }),
5408
5449
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Georgia", children: "Georgia" }),
5409
5450
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Courier New", children: "Courier" })
@@ -5411,12 +5452,11 @@ function CanvasTextToolbar({
5411
5452
  }
5412
5453
  ),
5413
5454
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-1 h-6 w-px bg-border" }),
5414
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: t7("canvas_toolbar.bullet_list"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" }) })
5455
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: t("canvas_toolbar.bullet_list"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" }) })
5415
5456
  ]
5416
5457
  }
5417
5458
  ) });
5418
5459
  }
5419
- var t8 = i18n.createPackageT("hazo_ui", en_default);
5420
5460
  var MdEditorLazy = React27.lazy(() => import('@uiw/react-md-editor'));
5421
5461
  var EDITOR_TEXTAREA_SELECTOR = ".w-md-editor-text-input";
5422
5462
  function MarkdownEditor({
@@ -5433,6 +5473,7 @@ function MarkdownEditor({
5433
5473
  renderPreview,
5434
5474
  showPreview = true
5435
5475
  }) {
5476
+ const t = useHazoUiT();
5436
5477
  const [mounted, setMounted] = React27.useState(false);
5437
5478
  React27.useEffect(() => setMounted(true), []);
5438
5479
  const valueRef = React27.useRef(value);
@@ -5500,19 +5541,19 @@ function MarkdownEditor({
5500
5541
  const current = valueRef.current;
5501
5542
  const before = current.slice(0, start);
5502
5543
  const after = current.slice(end);
5503
- onChange(before + "![uploading\u2026]()" + after);
5544
+ onChange(before + "![" + t("markdown.upload_placeholder") + "]()" + after);
5504
5545
  setUploading(true);
5505
5546
  setError("");
5506
5547
  try {
5507
5548
  const url = await onImageUpload(file);
5508
5549
  if (!url) {
5509
- setError(t8("markdown.upload_failed"));
5550
+ setError(t("markdown.upload_failed"));
5510
5551
  onChange(before + after);
5511
5552
  return;
5512
5553
  }
5513
5554
  onChange(before + `![](${url})` + after);
5514
5555
  } catch {
5515
- setError(t8("markdown.upload_failed"));
5556
+ setError(t("markdown.upload_failed"));
5516
5557
  onChange(before + after);
5517
5558
  } finally {
5518
5559
  setUploading(false);
@@ -5536,7 +5577,7 @@ function MarkdownEditor({
5536
5577
  {
5537
5578
  className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
5538
5579
  style: { height },
5539
- children: t8("markdown.loading_editor")
5580
+ children: t("markdown.loading_editor")
5540
5581
  }
5541
5582
  ),
5542
5583
  children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5548,7 +5589,7 @@ function MarkdownEditor({
5548
5589
  preview: effectivePreview,
5549
5590
  visibleDragbar: false,
5550
5591
  commands: editorCommands,
5551
- textareaProps: { placeholder: placeholder ?? t8("markdown.placeholder"), onPaste: handlePaste }
5592
+ textareaProps: { placeholder: placeholder ?? t("markdown.placeholder"), onPaste: handlePaste }
5552
5593
  }
5553
5594
  )
5554
5595
  }
@@ -5557,7 +5598,7 @@ function MarkdownEditor({
5557
5598
  {
5558
5599
  className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
5559
5600
  style: { height },
5560
- children: t8("markdown.loading_editor")
5601
+ children: t("markdown.loading_editor")
5561
5602
  }
5562
5603
  ) }),
5563
5604
  useCustomPreview && showPreview && /* @__PURE__ */ jsxRuntime.jsx(
@@ -5571,7 +5612,7 @@ function MarkdownEditor({
5571
5612
  ]
5572
5613
  }
5573
5614
  ),
5574
- uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: t8("markdown.uploading_image") }),
5615
+ uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: t("markdown.uploading_image") }),
5575
5616
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-destructive", children: error })
5576
5617
  ] });
5577
5618
  }
@@ -6270,7 +6311,6 @@ var Text = core.Node.create({
6270
6311
  renderMarkdown: (node) => node.text || ""
6271
6312
  });
6272
6313
  var index_default3 = Text;
6273
- var t9 = i18n.createPackageT("hazo_ui", en_default);
6274
6314
  var SingleLineDocument = index_default.extend({
6275
6315
  content: "paragraph"
6276
6316
  });
@@ -6319,7 +6359,8 @@ var HazoUiTextbox = ({
6319
6359
  on_command_change,
6320
6360
  on_command_remove
6321
6361
  }) => {
6322
- const resolved_placeholder = placeholder ?? t9("textbox.placeholder");
6362
+ const t = useHazoUiT();
6363
+ const resolved_placeholder = placeholder ?? t("textbox.placeholder");
6323
6364
  const generated_instance_id = React27__namespace.useId();
6324
6365
  const instance_id = provided_instance_id || generated_instance_id;
6325
6366
  const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
@@ -6731,7 +6772,7 @@ var HazoUiTextbox = ({
6731
6772
  edit_selected_index === edit_commands.length && "bg-destructive/10"
6732
6773
  ),
6733
6774
  onClick: handle_command_remove,
6734
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t9("common.remove") })
6775
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("common.remove") })
6735
6776
  }
6736
6777
  )
6737
6778
  ] })
@@ -6809,7 +6850,6 @@ var HardBreak = core.Node.create({
6809
6850
  }
6810
6851
  });
6811
6852
  var index_default4 = HardBreak;
6812
- var t10 = i18n.createPackageT("hazo_ui", en_default);
6813
6853
  var get_editor_output2 = (editor) => {
6814
6854
  if (!editor) {
6815
6855
  return { plain_text: "", display_text: "", commands: [] };
@@ -6878,7 +6918,8 @@ var HazoUiTextarea = ({
6878
6918
  on_command_change,
6879
6919
  on_command_remove
6880
6920
  }) => {
6881
- const resolved_placeholder = placeholder ?? t10("textarea.placeholder");
6921
+ const t = useHazoUiT();
6922
+ const resolved_placeholder = placeholder ?? t("textarea.placeholder");
6882
6923
  const generated_instance_id = React27__namespace.useId();
6883
6924
  const instance_id = provided_instance_id || generated_instance_id;
6884
6925
  const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
@@ -7303,7 +7344,7 @@ var HazoUiTextarea = ({
7303
7344
  backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
7304
7345
  },
7305
7346
  onClick: handle_command_remove,
7306
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t10("common.remove") })
7347
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("common.remove") })
7307
7348
  }
7308
7349
  )
7309
7350
  ] })
@@ -7363,7 +7404,6 @@ function resolve_animation_classes(open_anim = "zoom", close_anim = "zoom") {
7363
7404
  const close_classes = close_anim in ANIMATION_PRESETS ? ANIMATION_PRESETS[close_anim].close : close_anim;
7364
7405
  return `${open_classes} ${close_classes}`;
7365
7406
  }
7366
- var t11 = i18n.createPackageT("hazo_ui", en_default);
7367
7407
  var VARIANT_PRESETS = {
7368
7408
  info: {
7369
7409
  header_background_color: "var(--dialog-info-bg)",
@@ -7450,6 +7490,7 @@ function HazoUiDialog({
7450
7490
  showCloseButton = true,
7451
7491
  kind
7452
7492
  }) {
7493
+ const t = useHazoUiT();
7453
7494
  const config = get_hazo_ui_config();
7454
7495
  const is_confirm_kind = kind === "confirm";
7455
7496
  const is_status_kind = kind === "status";
@@ -7457,11 +7498,11 @@ function HazoUiDialog({
7457
7498
  const cancel_ref = React27__namespace.useRef(null);
7458
7499
  const variant_preset = variant !== "default" ? VARIANT_PRESETS[variant] : is_status_kind || is_confirm_kind ? NEUTRAL_VARIANT_PRESET : void 0;
7459
7500
  const resolved_action_button_variant = actionButtonVariant ?? variant_preset?.action_button_variant ?? "default";
7460
- const resolved_title = title ?? t11("dialog.default_title");
7461
- const resolved_cancel_text = cancelButtonText ?? t11("dialog.cancel");
7501
+ const resolved_title = title ?? t("dialog.default_title");
7502
+ const resolved_cancel_text = cancelButtonText ?? t("dialog.cancel");
7462
7503
  const showCancelButton = showCancelButtonProp ?? (is_status_kind ? false : true);
7463
7504
  const closeOnConfirm = closeOnConfirmProp ?? (is_status_kind || is_confirm_kind ? true : false);
7464
- const actionButtonText = actionButtonTextProp ?? (is_status_kind ? t11("dialog.ok") : is_confirm_kind ? showCancelButton ? t11("dialog.confirm") : t11("dialog.ok") : t11("dialog.confirm"));
7505
+ const actionButtonText = actionButtonTextProp ?? (is_status_kind ? t("dialog.ok") : is_confirm_kind ? showCancelButton ? t("dialog.confirm") : t("dialog.ok") : t("dialog.confirm"));
7465
7506
  const actionButtonLoading = actionButtonLoadingProp ?? (is_confirm_kind ? internal_confirm_loading : false);
7466
7507
  const handleConfirm = () => {
7467
7508
  if (is_confirm_kind) {
@@ -7788,7 +7829,7 @@ function HazoUiDialog({
7788
7829
  style: headerBar ? { color: "var(--dialog-header-bar-fg)" } : finalHeaderTextColor ? { color: finalHeaderTextColor } : void 0,
7789
7830
  children: [
7790
7831
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
7791
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t11("dialog.close") })
7832
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t("dialog.close") })
7792
7833
  ]
7793
7834
  }
7794
7835
  )
@@ -7797,7 +7838,6 @@ function HazoUiDialog({
7797
7838
  )
7798
7839
  ] }) });
7799
7840
  }
7800
- var t12 = i18n.createPackageT("hazo_ui", en_default);
7801
7841
  function HazoUiConfirmDialog({
7802
7842
  open,
7803
7843
  onOpenChange,
@@ -7806,7 +7846,7 @@ function HazoUiConfirmDialog({
7806
7846
  children,
7807
7847
  variant = "default",
7808
7848
  confirmLabel,
7809
- cancelLabel = t12("confirm.cancel"),
7849
+ cancelLabel: cancelLabelProp,
7810
7850
  showCancelButton = true,
7811
7851
  onConfirm,
7812
7852
  onCancel,
@@ -7817,6 +7857,8 @@ function HazoUiConfirmDialog({
7817
7857
  openAnimation = "zoom",
7818
7858
  closeAnimation = "zoom"
7819
7859
  }) {
7860
+ const t = useHazoUiT();
7861
+ const cancelLabel = cancelLabelProp ?? t("confirm.cancel");
7820
7862
  const resolved_accent_color = confirmButtonColor ?? accentColor;
7821
7863
  return /* @__PURE__ */ jsxRuntime.jsx(
7822
7864
  HazoUiDialog,
@@ -7855,7 +7897,6 @@ var Slider = React27__namespace.forwardRef(({ className, ...props }, ref) => /*
7855
7897
  }
7856
7898
  ));
7857
7899
  Slider.displayName = SliderPrimitive__namespace.Root.displayName;
7858
- var t13 = i18n.createPackageT("hazo_ui", en_default);
7859
7900
  async function getCroppedImg(imageSrc, areaPixels, outputSize, quality) {
7860
7901
  const img = await new Promise((resolve, reject) => {
7861
7902
  const image = new Image();
@@ -7904,12 +7945,13 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
7904
7945
  zoomLabel,
7905
7946
  className
7906
7947
  }, ref) {
7948
+ const t = useHazoUiT();
7907
7949
  const [crop, set_crop] = React27__namespace.useState({
7908
7950
  x: 0,
7909
7951
  y: 0
7910
7952
  });
7911
7953
  const [zoom, set_zoom] = React27__namespace.useState(1);
7912
- const resolved_zoom_label = zoomLabel ?? t13("cropper.zoom");
7954
+ const resolved_zoom_label = zoomLabel ?? t("cropper.zoom");
7913
7955
  const cropped_area_pixels_ref = React27__namespace.useRef(null);
7914
7956
  const handle_crop_complete = React27__namespace.useCallback(
7915
7957
  (_croppedArea, croppedAreaPixels) => {
@@ -7984,7 +8026,6 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
7984
8026
  ] });
7985
8027
  });
7986
8028
  HazoUiImageCropper.displayName = "HazoUiImageCropper";
7987
- var t14 = i18n.createPackageT("hazo_ui", en_default);
7988
8029
  function HazoUiImageCropperDialog({
7989
8030
  open,
7990
8031
  onOpenChange,
@@ -7998,10 +8039,11 @@ function HazoUiImageCropperDialog({
7998
8039
  outputSize = 512,
7999
8040
  quality = 0.9
8000
8041
  }) {
8001
- const resolved_title = title ?? t14("cropper.title");
8002
- const resolved_confirm_label = confirmLabel ?? t14("cropper.save");
8003
- const resolved_cancel_label = cancelLabel ?? t14("cropper.cancel");
8004
- const resolved_zoom_label = zoomLabel ?? t14("cropper.zoom");
8042
+ const t = useHazoUiT();
8043
+ const resolved_title = title ?? t("cropper.title");
8044
+ const resolved_confirm_label = confirmLabel ?? t("cropper.save");
8045
+ const resolved_cancel_label = cancelLabel ?? t("cropper.cancel");
8046
+ const resolved_zoom_label = zoomLabel ?? t("cropper.zoom");
8005
8047
  const cropper_ref = React27__namespace.useRef(null);
8006
8048
  const [image_src, set_image_src] = React27__namespace.useState(null);
8007
8049
  const [is_confirming, set_is_confirming] = React27__namespace.useState(false);
@@ -8487,16 +8529,16 @@ var CardFooter = React27__namespace.forwardRef(
8487
8529
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
8488
8530
  );
8489
8531
  CardFooter.displayName = "CardFooter";
8490
- var t15 = i18n.createPackageT("hazo_ui", en_default);
8491
8532
  function Spinner({ className, size = "md" }) {
8533
+ const t = useHazoUiT();
8492
8534
  const sizeClasses = { sm: "h-4 w-4", md: "h-8 w-8", lg: "h-12 w-12" };
8493
8535
  return /* @__PURE__ */ jsxRuntime.jsx(
8494
8536
  "div",
8495
8537
  {
8496
8538
  className: cn("animate-spin rounded-full border-2 border-current border-t-transparent text-primary", sizeClasses[size], className),
8497
8539
  role: "status",
8498
- "aria-label": t15("spinner.loading"),
8499
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t15("spinner.loading_text") })
8540
+ "aria-label": t("spinner.loading"),
8541
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t("spinner.loading_text") })
8500
8542
  }
8501
8543
  );
8502
8544
  }
@@ -8632,7 +8674,6 @@ var InputAffix = React27__namespace.forwardRef(
8632
8674
  }
8633
8675
  );
8634
8676
  InputAffix.displayName = "InputAffix";
8635
- var t16 = i18n.createPackageT("hazo_ui", en_default);
8636
8677
  var SkeletonBase = React27__namespace.forwardRef(
8637
8678
  ({ className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
8638
8679
  "div",
@@ -8675,7 +8716,8 @@ function SkeletonRect({ width = "100%", height = 96, radius = 6, className }) {
8675
8716
  );
8676
8717
  }
8677
8718
  function SkeletonGroup({ label, children, className, ...rest }) {
8678
- const resolved_label = label ?? t16("skeleton.loading_content");
8719
+ const t = useHazoUiT();
8720
+ const resolved_label = label ?? t("skeleton.loading_content");
8679
8721
  return /* @__PURE__ */ jsxRuntime.jsxs(
8680
8722
  "div",
8681
8723
  {
@@ -8721,7 +8763,6 @@ function EmptyState({
8721
8763
  }
8722
8764
  );
8723
8765
  }
8724
- var t17 = i18n.createPackageT("hazo_ui", en_default);
8725
8766
  function ErrorBanner({
8726
8767
  severity = "error",
8727
8768
  title,
@@ -8731,6 +8772,7 @@ function ErrorBanner({
8731
8772
  onDismiss,
8732
8773
  className
8733
8774
  }) {
8775
+ const t = useHazoUiT();
8734
8776
  const palette = severity === "warning" ? "border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-100" : "border-destructive/40 bg-destructive/10 text-destructive-foreground";
8735
8777
  const iconColor = severity === "warning" ? "text-amber-600" : "text-destructive";
8736
8778
  const resolvedIcon = icon ?? (severity === "warning" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: cn("h-5 w-5", iconColor), "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonAlert, { className: cn("h-5 w-5", iconColor), "aria-hidden": "true" }));
@@ -8756,7 +8798,7 @@ function ErrorBanner({
8756
8798
  {
8757
8799
  type: "button",
8758
8800
  onClick: onDismiss,
8759
- "aria-label": t17("error.dismiss"),
8801
+ "aria-label": t("error.dismiss"),
8760
8802
  className: "flex-shrink-0 rounded p-1 hover:bg-black/5 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:hover:bg-white/5",
8761
8803
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4", "aria-hidden": "true" })
8762
8804
  }
@@ -8765,7 +8807,6 @@ function ErrorBanner({
8765
8807
  }
8766
8808
  );
8767
8809
  }
8768
- var t18 = i18n.createPackageT("hazo_ui", en_default);
8769
8810
  function ErrorPage({
8770
8811
  title,
8771
8812
  description,
@@ -8775,7 +8816,8 @@ function ErrorPage({
8775
8816
  illustration,
8776
8817
  className
8777
8818
  }) {
8778
- const resolved_title = title ?? t18("error.something_went_wrong");
8819
+ const t = useHazoUiT();
8820
+ const resolved_title = title ?? t("error.something_went_wrong");
8779
8821
  return /* @__PURE__ */ jsxRuntime.jsxs(
8780
8822
  "div",
8781
8823
  {
@@ -8791,7 +8833,7 @@ function ErrorPage({
8791
8833
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold text-foreground", children: resolved_title }),
8792
8834
  description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: description }) : null,
8793
8835
  correlationId ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full rounded-md border bg-muted/40 px-3 py-2 text-left", children: [
8794
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children: t18("error.correlation_id") }),
8836
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children: t("error.correlation_id") }),
8795
8837
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "break-all text-xs", children: correlationId })
8796
8838
  ] }) : null,
8797
8839
  actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-2", children: actions }) : null
@@ -8799,7 +8841,6 @@ function ErrorPage({
8799
8841
  }
8800
8842
  );
8801
8843
  }
8802
- var t19 = i18n.createPackageT("hazo_ui", en_default);
8803
8844
  function LoadingTimeout({
8804
8845
  active,
8805
8846
  children,
@@ -8809,7 +8850,8 @@ function LoadingTimeout({
8809
8850
  label,
8810
8851
  className
8811
8852
  }) {
8812
- const resolved_label = label ?? t19("loading.default_label");
8853
+ const t = useHazoUiT();
8854
+ const resolved_label = label ?? t("loading.default_label");
8813
8855
  const timeouts = {
8814
8856
  gentle: thresholds?.gentle ?? 5e3,
8815
8857
  firm: thresholds?.firm ?? 15e3,
@@ -8839,15 +8881,15 @@ function LoadingTimeout({
8839
8881
  ErrorBanner,
8840
8882
  {
8841
8883
  severity: "error",
8842
- title: t19("loading.taking_longer"),
8843
- message: t19("loading.still_loading", { label: resolved_label }),
8884
+ title: t("loading.taking_longer"),
8885
+ message: t("loading.still_loading", { label: resolved_label }),
8844
8886
  action: onRetry ? /* @__PURE__ */ jsxRuntime.jsx(
8845
8887
  "button",
8846
8888
  {
8847
8889
  type: "button",
8848
8890
  onClick: onRetry,
8849
8891
  className: "rounded bg-foreground/10 px-3 py-1.5 text-sm font-medium hover:bg-foreground/15",
8850
- children: t19("loading.try_again")
8892
+ children: t("loading.try_again")
8851
8893
  }
8852
8894
  ) : null
8853
8895
  }
@@ -8855,8 +8897,8 @@ function LoadingTimeout({
8855
8897
  }
8856
8898
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, role: "status", "aria-busy": "true", "aria-live": "polite", children: [
8857
8899
  skeleton,
8858
- phase === "gentle" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t19("loading.gentle_message", { label: resolved_label }) }) : null,
8859
- phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t19("loading.firm_message") }) : null
8900
+ phase === "gentle" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t("loading.gentle_message", { label: resolved_label }) }) : null,
8901
+ phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t("loading.firm_message") }) : null
8860
8902
  ] });
8861
8903
  }
8862
8904
  function ProgressiveImage({
@@ -8917,13 +8959,14 @@ function NotificationCountBadge({
8917
8959
  max = 9,
8918
8960
  className
8919
8961
  }) {
8962
+ const t = useHazoUiT();
8920
8963
  if (count <= 0) return null;
8921
8964
  const isOverflow = count > max;
8922
8965
  const label = isOverflow ? `${max}+` : String(count);
8923
8966
  return /* @__PURE__ */ jsxRuntime.jsx(
8924
8967
  "span",
8925
8968
  {
8926
- "aria-label": `${count} unread`,
8969
+ "aria-label": t("notification.unread_count", { count }),
8927
8970
  className: cn(
8928
8971
  "cls_notification_count_badge",
8929
8972
  "inline-flex items-center justify-center",
@@ -8937,7 +8980,6 @@ function NotificationCountBadge({
8937
8980
  }
8938
8981
  );
8939
8982
  }
8940
- var t20 = i18n.createPackageT("hazo_ui", en_default);
8941
8983
  function NotificationItem({
8942
8984
  isRead,
8943
8985
  timestamp,
@@ -8948,6 +8990,7 @@ function NotificationItem({
8948
8990
  onMarkRead,
8949
8991
  markReadLabel
8950
8992
  }) {
8993
+ const t = useHazoUiT();
8951
8994
  const handleMarkRead = (e) => {
8952
8995
  e.stopPropagation();
8953
8996
  onMarkRead?.();
@@ -8968,7 +9011,7 @@ function NotificationItem({
8968
9011
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_notification_item_dot_col flex-shrink-0 pt-1.5", children: !isRead ? /* @__PURE__ */ jsxRuntime.jsx(
8969
9012
  "span",
8970
9013
  {
8971
- "aria-label": t20("notification.unread"),
9014
+ "aria-label": t("notification.unread"),
8972
9015
  className: "cls_notification_item_dot block w-2 h-2 rounded-full bg-primary"
8973
9016
  }
8974
9017
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block w-2 h-2", "aria-hidden": "true" }) }),
@@ -8992,13 +9035,13 @@ function NotificationItem({
8992
9035
  }
8993
9036
  );
8994
9037
  }
8995
- var t21 = i18n.createPackageT("hazo_ui", en_default);
8996
9038
  function LoadingSkeletons() {
9039
+ const t = useHazoUiT();
8997
9040
  return /* @__PURE__ */ jsxRuntime.jsx(
8998
9041
  "div",
8999
9042
  {
9000
9043
  "aria-busy": "true",
9001
- "aria-label": t21("notification.loading"),
9044
+ "aria-label": t("notification.loading"),
9002
9045
  className: "cls_notification_panel_loading space-y-0",
9003
9046
  children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
9004
9047
  "div",
@@ -9057,7 +9100,6 @@ function NotificationPanel({
9057
9100
  }
9058
9101
  );
9059
9102
  }
9060
- var t22 = i18n.createPackageT("hazo_ui", en_default);
9061
9103
  function HazoUiToaster({
9062
9104
  position = "bottom-right",
9063
9105
  closeButton = true,
@@ -9101,16 +9143,17 @@ function permissionToast({
9101
9143
  missingPermissions,
9102
9144
  descriptions,
9103
9145
  action,
9104
- duration = 5e3
9146
+ duration = 5e3,
9147
+ t = defaultHazoUiT
9105
9148
  }) {
9106
- const description = missingPermissions.length === 0 ? t22("toast.permission_denied_message") : t22("toast.missing_prefix", {
9149
+ const description = missingPermissions.length === 0 ? t("toast.permission_denied_message") : t("toast.missing_prefix", {
9107
9150
  items: missingPermissions.map((key) => {
9108
9151
  const label = descriptions?.[key];
9109
9152
  return label ? `\`${key}\` \u2014 ${label}` : `\`${key}\``;
9110
9153
  }).join("; ")
9111
9154
  });
9112
9155
  return errorToast({
9113
- title: t22("toast.permission_required"),
9156
+ title: t("toast.permission_required"),
9114
9157
  description,
9115
9158
  action,
9116
9159
  duration
@@ -9368,7 +9411,6 @@ function use_fullscreen() {
9368
9411
  const { isFullscreen, toggle } = useFullscreen(ref);
9369
9412
  return { is_fullscreen: isFullscreen, toggle, ref };
9370
9413
  }
9371
- var t23 = i18n.createPackageT("hazo_ui", en_default);
9372
9414
  function KanbanCard({
9373
9415
  item,
9374
9416
  renderCard,
@@ -9377,6 +9419,7 @@ function KanbanCard({
9377
9419
  showEdit = false,
9378
9420
  onEditRequest
9379
9421
  }) {
9422
+ const t = useHazoUiT();
9380
9423
  const {
9381
9424
  attributes,
9382
9425
  listeners,
@@ -9430,7 +9473,7 @@ function KanbanCard({
9430
9473
  ...listeners,
9431
9474
  role: "button",
9432
9475
  tabIndex: 0,
9433
- "aria-roledescription": t23("kanban.draggable_card"),
9476
+ "aria-roledescription": t("kanban.draggable_card"),
9434
9477
  "aria-grabbed": isDragging,
9435
9478
  onDoubleClick: () => {
9436
9479
  if (showEdit && onEditRequest && !dragging) onEditRequest(item);
@@ -9447,7 +9490,7 @@ function KanbanCard({
9447
9490
  e.stopPropagation();
9448
9491
  onEditRequest(item);
9449
9492
  },
9450
- "aria-label": `Edit ${item.id}`,
9493
+ "aria-label": t("kanban.edit_fallback", { id: item.id }),
9451
9494
  className: cn(
9452
9495
  "cls_hazo_kanban_card_edit absolute top-1.5 right-1.5",
9453
9496
  "p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent",
@@ -9755,12 +9798,11 @@ function KanbanLaneStrip({
9755
9798
  }
9756
9799
  );
9757
9800
  }
9758
- var t24 = i18n.createPackageT("hazo_ui", en_default);
9759
9801
  var DEFAULT_PRIORITIES = ["P0", "P1", "P2", "P3"];
9760
9802
  function humanize(key) {
9761
9803
  return key.replace(/[_\-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().split(" ").map((w) => w ? w[0].toUpperCase() + w.slice(1) : w).join(" ");
9762
9804
  }
9763
- function auto_detect_fields(item, columns) {
9805
+ function auto_detect_fields(item, columns, t) {
9764
9806
  const skip = /* @__PURE__ */ new Set(["id", "columnKey", "priority"]);
9765
9807
  const out = [];
9766
9808
  for (const [key, value] of Object.entries(item)) {
@@ -9770,7 +9812,7 @@ function auto_detect_fields(item, columns) {
9770
9812
  }
9771
9813
  }
9772
9814
  if (columns.length > 0) {
9773
- out.push({ key: "columnKey", type: "status", label: t24("kanban.status_label") });
9815
+ out.push({ key: "columnKey", type: "status", label: t("kanban.status_label") });
9774
9816
  }
9775
9817
  return out;
9776
9818
  }
@@ -9785,6 +9827,7 @@ function KanbanEditor({
9785
9827
  onSave,
9786
9828
  onClose
9787
9829
  }) {
9830
+ const t = useHazoUiT();
9788
9831
  const [draft, set_draft] = React27__namespace.useState(item);
9789
9832
  const [saving, set_saving] = React27__namespace.useState(false);
9790
9833
  const [error, set_error] = React27__namespace.useState(null);
@@ -9799,7 +9842,7 @@ function KanbanEditor({
9799
9842
  const resolved_fields = React27__namespace.useMemo(() => {
9800
9843
  if (fields) return fields;
9801
9844
  if (!item) return [];
9802
- return auto_detect_fields(item, resolved_columns);
9845
+ return auto_detect_fields(item, resolved_columns, t);
9803
9846
  }, [fields, item, resolved_columns]);
9804
9847
  const required_keys = React27__namespace.useMemo(
9805
9848
  () => resolved_fields.filter(
@@ -9867,7 +9910,7 @@ function KanbanEditor({
9867
9910
  isDirty: is_dirty
9868
9911
  };
9869
9912
  const open = item !== null;
9870
- const title = item && titleFn ? titleFn(item) : item ? t24("kanban.edit_fallback", { id: item.id }) : "";
9913
+ const title = item && titleFn ? titleFn(item) : item ? t("kanban.edit_fallback", { id: item.id }) : "";
9871
9914
  const priority_var = item?.priority ? `--hazo-kanban-priority-${String(item.priority).toLowerCase()}` : null;
9872
9915
  const header_bar_color = priority_var ? `hsl(var(${priority_var}))` : void 0;
9873
9916
  const use_default_footer = !(renderBody && hideFooter);
@@ -9879,18 +9922,18 @@ function KanbanEditor({
9879
9922
  if (!o && !saving) onClose();
9880
9923
  },
9881
9924
  title,
9882
- description: t24("kanban.update_description"),
9925
+ description: t("kanban.update_description"),
9883
9926
  sizeWidth: "min(90vw, 480px)",
9884
9927
  openAnimation: "none",
9885
9928
  closeAnimation: "none",
9886
9929
  headerBar: !!priority_var,
9887
9930
  headerBarColor: header_bar_color,
9888
9931
  contentClassName: cn("cls_hazo_kanban_editor", priority_var && "pt-0"),
9889
- actionButtonText: saving ? t24("kanban.saving") : t24("kanban.save"),
9932
+ actionButtonText: saving ? t("kanban.saving") : t("kanban.save"),
9890
9933
  actionButtonIcon: saving ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4 mr-2" }),
9891
9934
  actionButtonLoading: saving,
9892
9935
  actionButtonDisabled: !is_dirty || !all_required_filled || saving,
9893
- cancelButtonText: t24("kanban.cancel"),
9936
+ cancelButtonText: t("kanban.cancel"),
9894
9937
  showCancelButton: true,
9895
9938
  onConfirm: handle_save,
9896
9939
  onCancel: onClose,
@@ -9928,6 +9971,7 @@ function KanbanEditorFieldRow({
9928
9971
  priorities,
9929
9972
  columns
9930
9973
  }) {
9974
+ const t = useHazoUiT();
9931
9975
  const id = `kanban-editor-${field.key}`;
9932
9976
  const label = field.label ?? humanize(field.key);
9933
9977
  const value = draft[field.key];
@@ -9995,7 +10039,7 @@ function KanbanEditorFieldRow({
9995
10039
  /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
9996
10040
  SelectValue,
9997
10041
  {
9998
- placeholder: field.placeholder ?? t24("kanban.select_placeholder", { label })
10042
+ placeholder: field.placeholder ?? t("kanban.select_placeholder", { label })
9999
10043
  }
10000
10044
  ) }),
10001
10045
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: (field.options ?? []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: opt, children: opt }, opt)) })
@@ -10011,7 +10055,7 @@ function KanbanEditorFieldRow({
10011
10055
  /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
10012
10056
  SelectValue,
10013
10057
  {
10014
- placeholder: field.placeholder ?? t24("kanban.select_priority")
10058
+ placeholder: field.placeholder ?? t("kanban.select_priority")
10015
10059
  }
10016
10060
  ) }),
10017
10061
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: priorities.map((p) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: p, children: p }, p)) })
@@ -10027,7 +10071,7 @@ function KanbanEditorFieldRow({
10027
10071
  /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
10028
10072
  SelectValue,
10029
10073
  {
10030
- placeholder: field.placeholder ?? t24("kanban.select_status")
10074
+ placeholder: field.placeholder ?? t("kanban.select_status")
10031
10075
  }
10032
10076
  ) }),
10033
10077
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: col.key, children: col.title }, col.key)) })
@@ -10036,7 +10080,6 @@ function KanbanEditorFieldRow({
10036
10080
  )
10037
10081
  ] });
10038
10082
  }
10039
- var t25 = i18n.createPackageT("hazo_ui", en_default);
10040
10083
  var EMPTY_FILTER = {
10041
10084
  search: "",
10042
10085
  categories: [],
@@ -10052,7 +10095,8 @@ function HazoUiKanbanFilter({
10052
10095
  onChange,
10053
10096
  className
10054
10097
  }) {
10055
- const resolved_search_placeholder = searchPlaceholder ?? t25("common.search");
10098
+ const t = useHazoUiT();
10099
+ const resolved_search_placeholder = searchPlaceholder ?? t("common.search");
10056
10100
  const is_controlled = value !== void 0;
10057
10101
  const [internal, set_internal] = React27__namespace.useState(
10058
10102
  defaultValue ?? EMPTY_FILTER
@@ -10133,7 +10177,7 @@ function HazoUiKanbanFilter({
10133
10177
  className: "cls_hazo_kanban_filter_clear",
10134
10178
  children: [
10135
10179
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 mr-1" }),
10136
- "Clear"
10180
+ t("kanban.clear")
10137
10181
  ]
10138
10182
  }
10139
10183
  )
@@ -10164,25 +10208,24 @@ function applyKanbanFilter(items, filter) {
10164
10208
  return true;
10165
10209
  });
10166
10210
  }
10167
- var t26 = i18n.createPackageT("hazo_ui", en_default);
10168
10211
  var UNMATCHED_LANE_KEY = "__hazo_lane_unmatched__";
10169
10212
  function bucket_key(lane_key, column_key) {
10170
10213
  return lane_key == null ? column_key : `${lane_key}\0${column_key}`;
10171
10214
  }
10172
- function default_announcements(itemLabel) {
10215
+ function default_announcements(itemLabel, t) {
10173
10216
  return {
10174
- onDragStart: ({ item, fromColumn }) => t26("kanban.dnd_pickup", { item: itemLabel(item), column: fromColumn }),
10175
- onDragOver: ({ item, overColumn }) => overColumn ? t26("kanban.dnd_over", { item: itemLabel(item), column: overColumn }) : "",
10176
- onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ? t26("kanban.dnd_reorder", {
10217
+ onDragStart: ({ item, fromColumn }) => t("kanban.dnd_pickup", { item: itemLabel(item), column: fromColumn }),
10218
+ onDragOver: ({ item, overColumn }) => overColumn ? t("kanban.dnd_over", { item: itemLabel(item), column: overColumn }) : "",
10219
+ onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ? t("kanban.dnd_reorder", {
10177
10220
  item: itemLabel(item),
10178
10221
  pos: newIndex + 1,
10179
10222
  column: toColumn
10180
- }) : t26("kanban.dnd_drop", {
10223
+ }) : t("kanban.dnd_drop", {
10181
10224
  item: itemLabel(item),
10182
10225
  column: toColumn,
10183
10226
  pos: newIndex + 1
10184
10227
  }),
10185
- onDragCancel: ({ item, fromColumn }) => t26("kanban.dnd_cancel", { item: itemLabel(item), column: fromColumn })
10228
+ onDragCancel: ({ item, fromColumn }) => t("kanban.dnd_cancel", { item: itemLabel(item), column: fromColumn })
10186
10229
  };
10187
10230
  }
10188
10231
  function group_items_by_column(items, overlay, columns, lanes) {
@@ -10249,6 +10292,7 @@ function HazoUiKanban({
10249
10292
  onCardSave,
10250
10293
  disableEdit = false
10251
10294
  }) {
10295
+ const t = useHazoUiT();
10252
10296
  const label_fn = React27__namespace.useCallback(
10253
10297
  (item) => itemLabel ? itemLabel(item) : item.id,
10254
10298
  [itemLabel]
@@ -10306,7 +10350,7 @@ function HazoUiKanban({
10306
10350
  return core$1.closestCorners(args);
10307
10351
  }, []);
10308
10352
  const merged_announcements = React27__namespace.useMemo(() => {
10309
- const defaults = default_announcements(label_fn);
10353
+ const defaults = default_announcements(label_fn, t);
10310
10354
  return {
10311
10355
  onDragStart: announcements?.onDragStart ?? defaults.onDragStart,
10312
10356
  onDragOver: announcements?.onDragOver ?? defaults.onDragOver,
@@ -10986,8 +11030,8 @@ function serializeFilter(filter) {
10986
11030
  const fields = (filter.fields ?? []).map((f) => `${f.field}:${f.operator ?? ""}:${String(f.value)}`).join(",");
10987
11031
  return `${filter.search ?? ""}|${fields}`;
10988
11032
  }
10989
- var t27 = i18n.createPackageT("hazo_ui", en_default);
10990
11033
  function HazoUiTable(props) {
11034
+ const t = useHazoUiT();
10991
11035
  const state = useTableState(props);
10992
11036
  const { columns, rows, getRowKey, className, caption } = props;
10993
11037
  const mobileBreakpoint = props.mobileBreakpoint ?? 768;
@@ -11018,15 +11062,15 @@ function HazoUiTable(props) {
11018
11062
  /* @__PURE__ */ jsxRuntime.jsx(SkeletonBar, { className: "w-1/2" })
11019
11063
  ] })
11020
11064
  ] }, `mloader-${i}`)
11021
- ) }) : state.serverError != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_error py-6", children: renderErrorState(props.error, state.serverError) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_empty py-6", children: noActiveFilters(state.filter) && rows.length === 0 ? typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11065
+ ) }) : state.serverError != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_error py-6", children: renderErrorState(props.error, state.serverError, t) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_empty py-6", children: noActiveFilters(state.filter) && rows.length === 0 ? typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11022
11066
  EmptyState,
11023
11067
  {
11024
- title: typeof props.empty === "string" && props.empty || t27("table.empty")
11068
+ title: typeof props.empty === "string" && props.empty || t("table.empty")
11025
11069
  }
11026
11070
  ) : props.empty : typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11027
11071
  EmptyState,
11028
11072
  {
11029
- title: typeof props.noResults === "string" && props.noResults || t27("table.no_results")
11073
+ title: typeof props.noResults === "string" && props.noResults || t("table.no_results")
11030
11074
  }
11031
11075
  ) : props.noResults }) : /* @__PURE__ */ jsxRuntime.jsx(
11032
11076
  TableMobileCards,
@@ -11049,7 +11093,7 @@ function HazoUiTable(props) {
11049
11093
  {
11050
11094
  type: "button",
11051
11095
  onClick: (e) => state.cycleHeaderSort(c.key, e.shiftKey),
11052
- title: t27("table.sort_tooltip"),
11096
+ title: t("table.sort_tooltip"),
11053
11097
  className: "cls_hazo_ui_table_sort_btn inline-flex items-center gap-1 hover:text-foreground",
11054
11098
  children: [
11055
11099
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: c.label }),
@@ -11071,7 +11115,7 @@ function HazoUiTable(props) {
11071
11115
  {
11072
11116
  colSpan: columns.length,
11073
11117
  className: "cls_hazo_ui_table_error_cell p-0",
11074
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_error_wrap py-6", children: renderErrorState(props.error, state.serverError) })
11118
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_error_wrap py-6", children: renderErrorState(props.error, state.serverError, t) })
11075
11119
  }
11076
11120
  ) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
11077
11121
  TableCell2,
@@ -11081,12 +11125,12 @@ function HazoUiTable(props) {
11081
11125
  children: noActiveFilters(state.filter) && rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_empty_wrap py-6", children: typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11082
11126
  EmptyState,
11083
11127
  {
11084
- title: typeof props.empty === "string" && props.empty || t27("table.empty")
11128
+ title: typeof props.empty === "string" && props.empty || t("table.empty")
11085
11129
  }
11086
11130
  ) : props.empty }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_no_results_wrap py-6", children: typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
11087
11131
  EmptyState,
11088
11132
  {
11089
- title: typeof props.noResults === "string" && props.noResults || t27("table.no_results")
11133
+ title: typeof props.noResults === "string" && props.noResults || t("table.no_results")
11090
11134
  }
11091
11135
  ) : props.noResults })
11092
11136
  }
@@ -11196,11 +11240,12 @@ function PaginationFooter({
11196
11240
  total,
11197
11241
  onPageChange
11198
11242
  }) {
11243
+ const t = useHazoUiT();
11199
11244
  const start = total === 0 ? 0 : page * pageSize + 1;
11200
11245
  const end = Math.min((page + 1) * pageSize, total);
11201
11246
  const lastPage = Math.max(0, Math.ceil(total / pageSize) - 1);
11202
11247
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_hazo_ui_table_pagination flex items-center justify-between gap-3 pt-2 text-sm", children: [
11203
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children: t27("table.showing", {
11248
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children: t("table.showing", {
11204
11249
  start: String(start),
11205
11250
  end: String(end),
11206
11251
  total: String(total)
@@ -11213,8 +11258,8 @@ function PaginationFooter({
11213
11258
  size: "sm",
11214
11259
  onClick: () => onPageChange(Math.max(0, page - 1)),
11215
11260
  disabled: page === 0,
11216
- "aria-label": t27("table.prev_aria"),
11217
- children: t27("table.prev")
11261
+ "aria-label": t("table.prev_aria"),
11262
+ children: t("table.prev")
11218
11263
  }
11219
11264
  ),
11220
11265
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11224,14 +11269,15 @@ function PaginationFooter({
11224
11269
  size: "sm",
11225
11270
  onClick: () => onPageChange(Math.min(lastPage, page + 1)),
11226
11271
  disabled: page >= lastPage,
11227
- "aria-label": t27("table.next_aria"),
11228
- children: t27("table.next")
11272
+ "aria-label": t("table.next_aria"),
11273
+ children: t("table.next")
11229
11274
  }
11230
11275
  )
11231
11276
  ] })
11232
11277
  ] });
11233
11278
  }
11234
11279
  function Toolbar2(props) {
11280
+ const t = useHazoUiT();
11235
11281
  const {
11236
11282
  columns,
11237
11283
  sort,
@@ -11269,7 +11315,7 @@ function Toolbar2(props) {
11269
11315
  setSearchValue(v);
11270
11316
  onSearchChange(v);
11271
11317
  },
11272
- placeholder: searchPlaceholder ?? t27("table.search_placeholder"),
11318
+ placeholder: searchPlaceholder ?? t("table.search_placeholder"),
11273
11319
  className: "cls_hazo_ui_table_search w-full sm:max-w-xs"
11274
11320
  }
11275
11321
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
@@ -11310,15 +11356,15 @@ function LoadingRows({
11310
11356
  function noActiveFilters(filter) {
11311
11357
  return !filter.search && (!filter.fields || filter.fields.length === 0);
11312
11358
  }
11313
- function renderErrorState(error, serverError) {
11359
+ function renderErrorState(error, serverError, t) {
11314
11360
  if (typeof error === "function") return error(serverError);
11315
11361
  if (error !== void 0 && error !== null) return error;
11316
11362
  const msg = serverError instanceof Error ? serverError.message : String(serverError);
11317
11363
  return /* @__PURE__ */ jsxRuntime.jsx(
11318
11364
  EmptyState,
11319
11365
  {
11320
- title: t27("table.error_title"),
11321
- description: msg || t27("table.error_description")
11366
+ title: t("table.error_title"),
11367
+ description: msg || t("table.error_description")
11322
11368
  }
11323
11369
  );
11324
11370
  }
@@ -11554,7 +11600,6 @@ function StackedBars({
11554
11600
  }
11555
11601
  );
11556
11602
  }
11557
- var t28 = i18n.createPackageT("hazo_ui", en_default);
11558
11603
  function DateRangeSelector({
11559
11604
  value,
11560
11605
  onChange,
@@ -11562,7 +11607,8 @@ function DateRangeSelector({
11562
11607
  className,
11563
11608
  ariaLabel
11564
11609
  }) {
11565
- const resolved_aria = ariaLabel ?? t28("charts.date_range");
11610
+ const t = useHazoUiT();
11611
+ const resolved_aria = ariaLabel ?? t("charts.date_range");
11566
11612
  return /* @__PURE__ */ jsxRuntime.jsx(
11567
11613
  "div",
11568
11614
  {
@@ -11594,7 +11640,6 @@ function DateRangeSelector({
11594
11640
  }
11595
11641
  );
11596
11642
  }
11597
- var t29 = i18n.createPackageT("hazo_ui", en_default);
11598
11643
  var PAD_LEFT2 = 80;
11599
11644
  var PAD_RIGHT2 = 72;
11600
11645
  var PAD_TOP2 = 12;
@@ -11619,6 +11664,7 @@ function FunnelChart({
11619
11664
  showTooltip = true,
11620
11665
  className
11621
11666
  }) {
11667
+ const t = useHazoUiT();
11622
11668
  const [hover_idx, set_hover_idx] = React27__namespace.useState(null);
11623
11669
  const fmt = valueFormat ?? format_num;
11624
11670
  const totals = steps.map(step_total);
@@ -11745,12 +11791,12 @@ function FunnelChart({
11745
11791
  const bubble_anchor_y = bar_y + BAR_H / 2;
11746
11792
  const lines = [
11747
11793
  { text: step.label, accent: true },
11748
- { text: t29("charts.total", { value: fmt(total) }), accent: false },
11749
- { text: t29("charts.pct_of_first", { pct: pct_first }), accent: false }
11794
+ { text: t("charts.total", { value: fmt(total) }), accent: false },
11795
+ { text: t("charts.pct_of_first", { pct: pct_first }), accent: false }
11750
11796
  ];
11751
11797
  if (i > 0) {
11752
- lines.push({ text: t29("charts.pct_of_prev", { pct: pct_prev }), accent: false });
11753
- lines.push({ text: t29("charts.dropoff", { value: fmt(dropoff) }), accent: false });
11798
+ lines.push({ text: t("charts.pct_of_prev", { pct: pct_prev }), accent: false });
11799
+ lines.push({ text: t("charts.dropoff", { value: fmt(dropoff) }), accent: false });
11754
11800
  }
11755
11801
  if (step.segments) {
11756
11802
  step.segments.forEach((seg) => {
@@ -11811,7 +11857,6 @@ function FunnelChart({
11811
11857
 
11812
11858
  // src/assets/celebration-chime.mp3
11813
11859
  var celebration_chime_default = "data:text/plain;charset=utf-8,";
11814
- var t30 = i18n.createPackageT("hazo_ui", en_default);
11815
11860
  var CELEBRATION_GRADIENT = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
11816
11861
  var CARD_SIZE = 1080;
11817
11862
  var PREVIEW_SIZE = 400;
@@ -11863,6 +11908,7 @@ function CelebrationModalInner({
11863
11908
  payload,
11864
11909
  onClose
11865
11910
  }) {
11911
+ const t = useHazoUiT();
11866
11912
  const {
11867
11913
  id,
11868
11914
  title,
@@ -12009,7 +12055,7 @@ function CelebrationModalInner({
12009
12055
  {
12010
12056
  className: "cls_celebration_close_btn absolute top-3 right-3 z-10 p-1.5 rounded-full hover:bg-black/10 transition-colors",
12011
12057
  onClick: close_modal,
12012
- "aria-label": t30("celebration.close"),
12058
+ "aria-label": t("celebration.close"),
12013
12059
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-gray-600" })
12014
12060
  }
12015
12061
  ),
@@ -12072,21 +12118,21 @@ function CelebrationModalInner({
12072
12118
  disabled: is_downloading,
12073
12119
  children: [
12074
12120
  is_downloading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 mr-1.5 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-3.5 w-3.5 mr-1.5" }),
12075
- t30("celebration.download_png")
12121
+ t("celebration.download_png")
12076
12122
  ]
12077
12123
  }
12078
12124
  ),
12079
12125
  can_share && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_share, children: [
12080
12126
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Share2, { className: "h-3.5 w-3.5 mr-1.5" }),
12081
- t30("celebration.share")
12127
+ t("celebration.share")
12082
12128
  ] }),
12083
12129
  /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_copy, children: [
12084
12130
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "h-3.5 w-3.5 mr-1.5" }),
12085
- t30("celebration.copy_image")
12131
+ t("celebration.copy_image")
12086
12132
  ] })
12087
12133
  ] })
12088
12134
  ] }),
12089
- !shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children: t30("celebration.dismiss") }) })
12135
+ !shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children: t("celebration.dismiss") }) })
12090
12136
  ]
12091
12137
  }
12092
12138
  )
@@ -12108,8 +12154,8 @@ function computeEta(durationWindow, unitCount, concurrency = 1, fallbackUnitMs =
12108
12154
  }
12109
12155
  function easeToward(elapsed, eta, maxCap = 0.95) {
12110
12156
  if (eta <= 0 || elapsed <= 0) return 0;
12111
- const t35 = elapsed / eta;
12112
- return maxCap * (1 - Math.exp(-1.5 * t35));
12157
+ const t = elapsed / eta;
12158
+ return maxCap * (1 - Math.exp(-1.5 * t));
12113
12159
  }
12114
12160
  function HazoUiProgressBar({
12115
12161
  value,
@@ -12285,7 +12331,6 @@ function upsertEntry(entries, entry) {
12285
12331
  function removeEntry(entries, id) {
12286
12332
  return entries.filter((e) => e.id !== id);
12287
12333
  }
12288
- var t31 = i18n.createPackageT("hazo_ui", en_default);
12289
12334
  function HazoUiMemoryDropdown({
12290
12335
  history_key,
12291
12336
  placeholder,
@@ -12293,8 +12338,9 @@ function HazoUiMemoryDropdown({
12293
12338
  add_entry,
12294
12339
  empty_label
12295
12340
  }) {
12296
- const resolved_placeholder = placeholder ?? t31("memory.search_placeholder");
12297
- const resolved_empty_label = empty_label ?? t31("memory.no_history");
12341
+ const t = useHazoUiT();
12342
+ const resolved_placeholder = placeholder ?? t("memory.search_placeholder");
12343
+ const resolved_empty_label = empty_label ?? t("memory.no_history");
12298
12344
  const { value: stored, setValue } = client$2.useHazoState(history_key, {
12299
12345
  level: "scope",
12300
12346
  fallback: []
@@ -12380,6 +12426,7 @@ function HazoUiMemoryDropdown({
12380
12426
  );
12381
12427
  }
12382
12428
  function EntryRow({ entry, on_select, onDelete }) {
12429
+ const t = useHazoUiT();
12383
12430
  const [deleteHovered, setDeleteHovered] = React27__namespace.useState(false);
12384
12431
  const [rowHovered, setRowHovered] = React27__namespace.useState(false);
12385
12432
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -12419,7 +12466,7 @@ function EntryRow({ entry, on_select, onDelete }) {
12419
12466
  onClick: (e) => onDelete(entry.id, e),
12420
12467
  onMouseEnter: () => setDeleteHovered(true),
12421
12468
  onMouseLeave: () => setDeleteHovered(false),
12422
- "aria-label": t31("memory.remove_aria", { label: entry.label }),
12469
+ "aria-label": t("memory.remove_aria", { label: entry.label }),
12423
12470
  style: {
12424
12471
  flexShrink: 0,
12425
12472
  background: "none",
@@ -12438,7 +12485,6 @@ function EntryRow({ entry, on_select, onDelete }) {
12438
12485
  }
12439
12486
  );
12440
12487
  }
12441
- var t32 = i18n.createPackageT("hazo_ui", en_default);
12442
12488
  function Logo({
12443
12489
  logoUrl,
12444
12490
  logoUrlDark,
@@ -12448,7 +12494,8 @@ function Logo({
12448
12494
  className,
12449
12495
  imgClassName
12450
12496
  }) {
12451
- const alt = appTitle ?? t32("app_logo.alt_fallback");
12497
+ const t = useHazoUiT();
12498
+ const alt = appTitle ?? t("app_logo.alt_fallback");
12452
12499
  let content = null;
12453
12500
  if (logoUrl) {
12454
12501
  content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -12483,12 +12530,12 @@ function Logo({
12483
12530
  }
12484
12531
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center gap-2", className), children: content });
12485
12532
  }
12486
- var t33 = i18n.createPackageT("hazo_ui", en_default);
12487
12533
  function AppHeader({ identity, homeHref, navItems, actions, className }) {
12534
+ const t = useHazoUiT();
12488
12535
  return /* @__PURE__ */ jsxRuntime.jsxs(
12489
12536
  "header",
12490
12537
  {
12491
- "aria-label": t33("app_header.aria_label"),
12538
+ "aria-label": t("app_header.aria_label"),
12492
12539
  className: cn(
12493
12540
  "flex w-full items-center justify-between gap-4 border-b bg-navbar text-navbar-fg border-navbar-border px-4 py-2.5",
12494
12541
  className
@@ -12941,6 +12988,7 @@ function HazoBrowserTab({
12941
12988
  add_menu,
12942
12989
  className
12943
12990
  }) {
12991
+ const t = useHazoUiT();
12944
12992
  const handle_close = (e, id) => {
12945
12993
  e.stopPropagation();
12946
12994
  on_close?.(id);
@@ -12980,7 +13028,7 @@ function HazoBrowserTab({
12980
13028
  "button",
12981
13029
  {
12982
13030
  type: "button",
12983
- "aria-label": `Close ${tab.label}`,
13031
+ "aria-label": t("browser_tab.close_aria", { label: tab.label }),
12984
13032
  onClick: (e) => handle_close(e, tab.id),
12985
13033
  className: "cls_hazo_browser_tab_close flex-shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-muted hover:text-foreground focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
12986
13034
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
@@ -12996,7 +13044,6 @@ function HazoBrowserTab({
12996
13044
  }
12997
13045
  );
12998
13046
  }
12999
- var t34 = i18n.createPackageT("hazo_ui", en_default);
13000
13047
  var native_name_cache = /* @__PURE__ */ new Map();
13001
13048
  function get_native_name(code) {
13002
13049
  const cached = native_name_cache.get(code);
@@ -13071,7 +13118,8 @@ function LocalePicker({
13071
13118
  triggerLabel,
13072
13119
  className
13073
13120
  }) {
13074
- const resolved_trigger_label = triggerLabel ?? t34("locale_picker.change_language");
13121
+ const t = useHazoUiT();
13122
+ const resolved_trigger_label = triggerLabel ?? t("locale_picker.change_language");
13075
13123
  const options = React27__namespace.useMemo(() => {
13076
13124
  return Object.entries(alternates ?? {}).map(([code, url]) => {
13077
13125
  const href = safeHref(url);
@@ -13254,6 +13302,7 @@ exports.HazoUiDialogTrigger = DialogTrigger;
13254
13302
  exports.HazoUiEtaProgress = HazoUiEtaProgress;
13255
13303
  exports.HazoUiFlexInput = HazoUiFlexInput;
13256
13304
  exports.HazoUiFlexRadio = HazoUiFlexRadio;
13305
+ exports.HazoUiI18nProvider = HazoUiI18nProvider;
13257
13306
  exports.HazoUiIcon = HazoUiIcon;
13258
13307
  exports.HazoUiIconPicker = HazoUiIconPicker;
13259
13308
  exports.HazoUiImageCropper = HazoUiImageCropper;
@@ -13348,6 +13397,7 @@ exports.celebrate = celebrate;
13348
13397
  exports.cn = cn;
13349
13398
  exports.computeEta = computeEta;
13350
13399
  exports.create_command_suggestion_extension = create_command_suggestion_extension;
13400
+ exports.defaultHazoUiT = defaultHazoUiT;
13351
13401
  exports.easeToward = easeToward;
13352
13402
  exports.errorToast = errorToast;
13353
13403
  exports.format_num = format_num;
@@ -13377,6 +13427,7 @@ exports.useDebounce = useDebounce;
13377
13427
  exports.useErrorDisplay = useErrorDisplay;
13378
13428
  exports.useEtaProgress = useEtaProgress;
13379
13429
  exports.useFullscreen = useFullscreen;
13430
+ exports.useHazoUiT = useHazoUiT;
13380
13431
  exports.useIsMobile = useIsMobile;
13381
13432
  exports.useLoadingState = useLoadingState;
13382
13433
  exports.useLocalStorage = useLocalStorage;