@underverse-ui/underverse 0.2.110 → 0.2.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8040,8 +8040,10 @@ var DateTimePicker = ({
8040
8040
  const locale = useLocale();
8041
8041
  const [open, setOpen] = React26.useState(false);
8042
8042
  const [tempDate, setTempDate] = React26.useState(value);
8043
+ const [calendarMonth, setCalendarMonth] = React26.useState(() => value ?? /* @__PURE__ */ new Date());
8043
8044
  React26.useEffect(() => {
8044
8045
  setTempDate(value);
8046
+ setCalendarMonth(value ?? /* @__PURE__ */ new Date());
8045
8047
  }, [value, open]);
8046
8048
  const getTimeString = (date) => {
8047
8049
  if (!date) return "";
@@ -8067,6 +8069,7 @@ var DateTimePicker = ({
8067
8069
  }
8068
8070
  return newDate;
8069
8071
  });
8072
+ setCalendarMonth(date);
8070
8073
  }
8071
8074
  };
8072
8075
  const handleTimeChange = (timeStr) => {
@@ -8190,9 +8193,8 @@ var DateTimePicker = ({
8190
8193
  value: tempDate,
8191
8194
  onSelect: handleDateSelect,
8192
8195
  selectMode: "single",
8193
- month: tempDate,
8194
- onMonthChange: (m) => {
8195
- },
8196
+ month: calendarMonth,
8197
+ onMonthChange: setCalendarMonth,
8196
8198
  minDate,
8197
8199
  maxDate,
8198
8200
  className: "border-0 shadow-none w-auto",
@@ -8231,7 +8233,7 @@ var DateTimePicker = ({
8231
8233
  };
8232
8234
 
8233
8235
  // ../../components/ui/CalendarTimeline/CalendarTimeline.tsx
8234
- import * as React31 from "react";
8236
+ import * as React32 from "react";
8235
8237
  import { Plus as Plus2 } from "lucide-react";
8236
8238
 
8237
8239
  // ../../components/ui/CalendarTimeline/date.ts
@@ -8693,6 +8695,7 @@ function resourcesById(resources) {
8693
8695
  }
8694
8696
 
8695
8697
  // ../../components/ui/CalendarTimeline/CalendarTimelineHeader.tsx
8698
+ import * as React28 from "react";
8696
8699
  import { Calendar as Calendar3, CalendarDays, CalendarRange, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight5, GripVertical, Plus } from "lucide-react";
8697
8700
  import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
8698
8701
  var VIEW_ICONS = {
@@ -8711,7 +8714,8 @@ function CalendarTimelineHeader(props) {
8711
8714
  activeView,
8712
8715
  sizeConfig,
8713
8716
  navigate,
8714
- goToday,
8717
+ now,
8718
+ onApplyDateTime,
8715
8719
  setView,
8716
8720
  effectiveResourceColumnWidth,
8717
8721
  canResizeColumn,
@@ -8719,10 +8723,68 @@ function CalendarTimelineHeader(props) {
8719
8723
  headerRef,
8720
8724
  slotHeaderNodes
8721
8725
  } = props;
8726
+ const dt = useTranslations("DateTimePicker");
8727
+ const locale = useLocale();
8728
+ const [todayOpen, setTodayOpen] = React28.useState(false);
8729
+ const [tempDate, setTempDate] = React28.useState(() => now);
8730
+ const [calendarMonth, setCalendarMonth] = React28.useState(() => now);
8731
+ React28.useEffect(() => {
8732
+ if (!todayOpen) return;
8733
+ setTempDate(now);
8734
+ setCalendarMonth(now);
8735
+ }, [now, todayOpen]);
8736
+ const monthLabel = React28.useCallback(
8737
+ (date) => date.toLocaleDateString(locale === "vi" ? "vi-VN" : "en-US", {
8738
+ month: "long",
8739
+ year: "numeric"
8740
+ }),
8741
+ [locale]
8742
+ );
8743
+ const weekdays = React28.useMemo(() => {
8744
+ switch (locale) {
8745
+ case "vi":
8746
+ return ["CN", "T2", "T3", "T4", "T5", "T6", "T7"];
8747
+ case "ko":
8748
+ return ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
8749
+ case "ja":
8750
+ return ["\u65E5", "\u6708", "\u706B", "\u6C34", "\u6728", "\u91D1", "\u571F"];
8751
+ default:
8752
+ return ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
8753
+ }
8754
+ }, [locale]);
8755
+ const getTimeString = React28.useCallback((date) => {
8756
+ const h = date.getHours();
8757
+ const m = date.getMinutes();
8758
+ return `${h.toString().padStart(2, "0")}:${m.toString().padStart(2, "0")}`;
8759
+ }, []);
8760
+ const handleDateSelect = React28.useCallback((date) => {
8761
+ if (!(date instanceof Date)) return;
8762
+ setTempDate((prev) => {
8763
+ const next = new Date(date);
8764
+ next.setHours(prev.getHours(), prev.getMinutes(), prev.getSeconds());
8765
+ return next;
8766
+ });
8767
+ }, []);
8768
+ const handleTimeChange = React28.useCallback((timeStr) => {
8769
+ if (!timeStr) return;
8770
+ const [hStr, mStr] = timeStr.split(":");
8771
+ const h = parseInt(hStr, 10);
8772
+ const m = parseInt(mStr, 10);
8773
+ if (!Number.isFinite(h) || !Number.isFinite(m)) return;
8774
+ setTempDate((prev) => {
8775
+ const next = new Date(prev);
8776
+ next.setHours(h, m, prev.getSeconds());
8777
+ return next;
8778
+ });
8779
+ }, []);
8780
+ const applyDateTime = React28.useCallback(() => {
8781
+ onApplyDateTime(tempDate);
8782
+ setTodayOpen(false);
8783
+ }, [onApplyDateTime, tempDate]);
8722
8784
  return /* @__PURE__ */ jsxs29("div", { className: "sticky top-0 z-30 bg-linear-to-b from-background via-background to-background/95 border-b border-border/40 backdrop-blur-xl", children: [
8723
8785
  /* @__PURE__ */ jsxs29("div", { className: cn("flex items-center justify-between gap-4", sizeConfig.headerPaddingClass), children: [
8724
8786
  /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1.5 min-w-0", children: [
8725
- /* @__PURE__ */ jsxs29("div", { className: "flex items-center bg-muted/40 rounded-xl p-1 gap-0.5", children: [
8787
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center bg-muted/40 rounded-full p-1 gap-0.5", children: [
8726
8788
  /* @__PURE__ */ jsx34(
8727
8789
  Button_default,
8728
8790
  {
@@ -8730,18 +8792,92 @@ function CalendarTimelineHeader(props) {
8730
8792
  size: "icon",
8731
8793
  onClick: () => navigate(-1),
8732
8794
  "aria-label": labels.prev,
8733
- className: cn(sizeConfig.controlButtonIconClass, "rounded-lg hover:bg-background/80 transition-all duration-200"),
8795
+ className: cn(sizeConfig.controlButtonIconClass, "rounded-full hover:bg-background/80 transition-all duration-200"),
8734
8796
  children: /* @__PURE__ */ jsx34(ChevronLeft4, { className: "h-4 w-4" })
8735
8797
  }
8736
8798
  ),
8737
8799
  /* @__PURE__ */ jsx34(
8738
- Button_default,
8800
+ Popover,
8739
8801
  {
8740
- variant: "ghost",
8741
- size: "sm",
8742
- onClick: goToday,
8743
- className: cn(sizeConfig.controlButtonTextClass, "rounded-lg hover:bg-background/80 font-medium transition-all duration-200"),
8744
- children: labels.today
8802
+ open: todayOpen,
8803
+ onOpenChange: setTodayOpen,
8804
+ placement: "bottom-start",
8805
+ trigger: /* @__PURE__ */ jsx34(
8806
+ Button_default,
8807
+ {
8808
+ variant: "ghost",
8809
+ size: "sm",
8810
+ className: cn(sizeConfig.controlButtonTextClass, "rounded-full hover:bg-background/80 font-medium transition-all duration-200"),
8811
+ children: labels.today
8812
+ }
8813
+ ),
8814
+ contentClassName: cn(
8815
+ "w-auto p-0 rounded-2xl md:rounded-3xl overflow-hidden"
8816
+ ),
8817
+ children: /* @__PURE__ */ jsxs29("div", { className: "max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto", children: [
8818
+ /* @__PURE__ */ jsxs29("div", { className: "flex flex-col lg:flex-row divide-y lg:divide-y-0 lg:divide-x divide-border", children: [
8819
+ /* @__PURE__ */ jsx34("div", { className: "p-2", children: /* @__PURE__ */ jsx34(
8820
+ Calendar2,
8821
+ {
8822
+ value: tempDate,
8823
+ onSelect: handleDateSelect,
8824
+ selectMode: "single",
8825
+ month: calendarMonth,
8826
+ onMonthChange: setCalendarMonth,
8827
+ className: "border-0 shadow-none w-auto",
8828
+ size: "sm",
8829
+ labels: {
8830
+ month: monthLabel,
8831
+ weekdays
8832
+ }
8833
+ }
8834
+ ) }),
8835
+ /* @__PURE__ */ jsxs29("div", { className: "p-2 flex flex-col gap-3", children: [
8836
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between gap-2", children: [
8837
+ /* @__PURE__ */ jsx34("div", { className: "text-sm font-semibold text-muted-foreground", children: dt?.("time") || "Time" }),
8838
+ /* @__PURE__ */ jsx34(
8839
+ Button_default,
8840
+ {
8841
+ variant: "ghost",
8842
+ size: "sm",
8843
+ className: "rounded-full text-muted-foreground hover:text-foreground",
8844
+ onClick: () => setTempDate(now),
8845
+ children: labels.today
8846
+ }
8847
+ )
8848
+ ] }),
8849
+ /* @__PURE__ */ jsx34(
8850
+ TimePicker,
8851
+ {
8852
+ variant: "inline",
8853
+ value: getTimeString(tempDate),
8854
+ onChange: handleTimeChange,
8855
+ format: "24",
8856
+ includeSeconds: false,
8857
+ clearable: false,
8858
+ className: "border-0 shadow-none p-0 bg-transparent rounded-none",
8859
+ size: "sm"
8860
+ }
8861
+ )
8862
+ ] })
8863
+ ] }),
8864
+ /* @__PURE__ */ jsxs29("div", { className: "p-3 border-t border-border flex justify-between items-center bg-muted/20", children: [
8865
+ /* @__PURE__ */ jsx34(
8866
+ Button_default,
8867
+ {
8868
+ variant: "ghost",
8869
+ size: "sm",
8870
+ className: "rounded-full text-muted-foreground hover:text-foreground",
8871
+ onClick: () => {
8872
+ setTempDate(now);
8873
+ setCalendarMonth(now);
8874
+ },
8875
+ children: labels.today
8876
+ }
8877
+ ),
8878
+ /* @__PURE__ */ jsx34(Button_default, { size: "sm", onClick: applyDateTime, className: "rounded-full", children: dt?.("done") || "Done" })
8879
+ ] })
8880
+ ] })
8745
8881
  }
8746
8882
  ),
8747
8883
  /* @__PURE__ */ jsx34(
@@ -8751,7 +8887,7 @@ function CalendarTimelineHeader(props) {
8751
8887
  size: "icon",
8752
8888
  onClick: () => navigate(1),
8753
8889
  "aria-label": labels.next,
8754
- className: cn(sizeConfig.controlButtonIconClass, "rounded-lg hover:bg-background/80 transition-all duration-200"),
8890
+ className: cn(sizeConfig.controlButtonIconClass, "rounded-full hover:bg-background/80 transition-all duration-200"),
8755
8891
  children: /* @__PURE__ */ jsx34(ChevronRight5, { className: "h-4 w-4" })
8756
8892
  }
8757
8893
  )
@@ -8767,11 +8903,11 @@ function CalendarTimelineHeader(props) {
8767
8903
  icon: Plus,
8768
8904
  disabled: newEventDisabled,
8769
8905
  onClick: onNewEventClick,
8770
- className: cn(sizeConfig.controlButtonTextClass, "rounded-lg font-medium transition-all duration-200 gap-1.5"),
8906
+ className: cn(sizeConfig.controlButtonTextClass, "rounded-full font-medium transition-all duration-200 gap-1.5"),
8771
8907
  children: /* @__PURE__ */ jsx34("span", { className: "hidden sm:inline", children: newEventLabel })
8772
8908
  }
8773
8909
  ) : null,
8774
- /* @__PURE__ */ jsx34("div", { className: "flex items-center bg-muted/40 rounded-xl p-1 gap-0.5", children: ["month", "week", "day"].map((v) => /* @__PURE__ */ jsxs29(
8910
+ /* @__PURE__ */ jsx34("div", { className: "flex items-center bg-muted/40 rounded-full p-1 gap-0.5", children: ["month", "week", "day"].map((v) => /* @__PURE__ */ jsxs29(
8775
8911
  Button_default,
8776
8912
  {
8777
8913
  variant: activeView === v ? "default" : "ghost",
@@ -8779,7 +8915,7 @@ function CalendarTimelineHeader(props) {
8779
8915
  onClick: () => setView(v),
8780
8916
  className: cn(
8781
8917
  sizeConfig.controlButtonTextClass,
8782
- "rounded-lg font-medium transition-all duration-200 gap-1.5",
8918
+ "rounded-full font-medium transition-all duration-200 gap-1.5",
8783
8919
  activeView === v ? "bg-primary text-primary-foreground shadow-sm shadow-primary/25" : "hover:bg-background/80 text-muted-foreground hover:text-foreground"
8784
8920
  ),
8785
8921
  children: [
@@ -8904,9 +9040,9 @@ function ResourceRowCell(props) {
8904
9040
  }
8905
9041
 
8906
9042
  // ../../components/ui/CalendarTimeline/CalendarTimelineGridOverlay.tsx
8907
- import * as React28 from "react";
9043
+ import * as React29 from "react";
8908
9044
  import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
8909
- var CalendarTimelineGridOverlay = React28.memo(function CalendarTimelineGridOverlay2(props) {
9045
+ var CalendarTimelineGridOverlay = React29.memo(function CalendarTimelineGridOverlay2(props) {
8910
9046
  const { gridWidth, height, slotLefts, slotWidths, activeView, todaySlotIdx, dayAnchor, weekendSlotIdxs, visibleStartIdx, visibleEndIdx, className } = props;
8911
9047
  const startIdx = Math.max(0, visibleStartIdx ?? 0);
8912
9048
  const endIdx = Math.min(slotWidths.length, visibleEndIdx ?? slotWidths.length);
@@ -8935,19 +9071,19 @@ var CalendarTimelineGridOverlay = React28.memo(function CalendarTimelineGridOver
8935
9071
  slotLefts.slice(startIdx, endIdx).map((left, j) => {
8936
9072
  const i = startIdx + j;
8937
9073
  const isAnchor = dayAnchor ? Boolean(dayAnchor[i]) : true;
8938
- const opacityClass = activeView === "day" && dayAnchor ? isAnchor ? "bg-border/25" : "bg-border/10" : "bg-border/20";
9074
+ const opacityClass = activeView === "day" && dayAnchor ? isAnchor ? "bg-border/35" : "bg-border/15" : "bg-border/30";
8939
9075
  return /* @__PURE__ */ jsx36("div", { className: cn("absolute top-0 h-full w-px", opacityClass), style: { left }, "aria-hidden": true }, i);
8940
9076
  })
8941
9077
  ] });
8942
9078
  });
8943
9079
 
8944
9080
  // ../../components/ui/CalendarTimeline/CalendarTimelineSlotHeaderCell.tsx
8945
- import * as React29 from "react";
9081
+ import * as React30 from "react";
8946
9082
  import { Dot } from "lucide-react";
8947
9083
  import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
8948
- var CalendarTimelineSlotHeaderCell = React29.memo(function CalendarTimelineSlotHeaderCell2(props) {
9084
+ var CalendarTimelineSlotHeaderCell = React30.memo(function CalendarTimelineSlotHeaderCell2(props) {
8949
9085
  const { width, activeView, isToday: isToday2, label, ariaLabel, borderClassName, dayHeaderMarks, idx, className } = props;
8950
- const content = React29.useMemo(() => {
9086
+ const content = React30.useMemo(() => {
8951
9087
  if (activeView === "day" && dayHeaderMarks) {
8952
9088
  if (dayHeaderMarks.showEllipsis[idx]) return /* @__PURE__ */ jsx37("span", { className: "text-xs text-muted-foreground/70 select-none", children: "\u2026" });
8953
9089
  if (!dayHeaderMarks.showTime[idx]) return null;
@@ -8970,7 +9106,7 @@ var CalendarTimelineSlotHeaderCell = React29.memo(function CalendarTimelineSlotH
8970
9106
  });
8971
9107
 
8972
9108
  // ../../components/ui/CalendarTimeline/internal-hooks.ts
8973
- import * as React30 from "react";
9109
+ import * as React31 from "react";
8974
9110
  function useTimelineSlots(args) {
8975
9111
  const {
8976
9112
  activeView,
@@ -8984,7 +9120,7 @@ function useTimelineSlots(args) {
8984
9120
  resolvedNow,
8985
9121
  formatters
8986
9122
  } = args;
8987
- const { slots, range } = React30.useMemo(() => {
9123
+ const { slots, range } = React31.useMemo(() => {
8988
9124
  const { start, end, slotStarts: slotStarts2 } = computeSlotStarts({
8989
9125
  view: activeView,
8990
9126
  date: activeDate,
@@ -9006,9 +9142,9 @@ function useTimelineSlots(args) {
9006
9142
  }));
9007
9143
  return { slots: slotItems, range: { start, end } };
9008
9144
  }, [activeView, activeDate, dayRangeMode, dayTimeStepMinutes, formatters, resolvedLocale, resolvedNow, resolvedTimeZone, weekStartsOn, workHours]);
9009
- const slotStarts = React30.useMemo(() => slots.map((s) => s.start), [slots]);
9010
- const todaySlotIdx = React30.useMemo(() => slots.findIndex((s) => s.isToday), [slots]);
9011
- const weekendSlotIdxs = React30.useMemo(() => {
9145
+ const slotStarts = React31.useMemo(() => slots.map((s) => s.start), [slots]);
9146
+ const todaySlotIdx = React31.useMemo(() => slots.findIndex((s) => s.isToday), [slots]);
9147
+ const weekendSlotIdxs = React31.useMemo(() => {
9012
9148
  const out = [];
9013
9149
  for (let i = 0; i < slots.length; i++) if (slots[i]?.isWeekend) out.push(i);
9014
9150
  return out;
@@ -9017,16 +9153,16 @@ function useTimelineSlots(args) {
9017
9153
  }
9018
9154
  function useNormalizedEvents(args) {
9019
9155
  const { events, range, activeView, resolvedTimeZone, resources } = args;
9020
- const normalizedEvents = React30.useMemo(() => {
9156
+ const normalizedEvents = React31.useMemo(() => {
9021
9157
  return normalizeEvents({ events, range, view: activeView, timeZone: resolvedTimeZone });
9022
9158
  }, [activeView, events, range, resolvedTimeZone]);
9023
- const eventsByResource = React30.useMemo(() => eventsByResourceId(normalizedEvents), [normalizedEvents]);
9024
- const resourceById = React30.useMemo(() => resourcesById(resources), [resources]);
9159
+ const eventsByResource = React31.useMemo(() => eventsByResourceId(normalizedEvents), [normalizedEvents]);
9160
+ const resourceById = React31.useMemo(() => resourcesById(resources), [resources]);
9025
9161
  return { normalizedEvents, eventsByResource, resourceById };
9026
9162
  }
9027
9163
  function useDayHeaderMarks(args) {
9028
9164
  const { enabled, activeView, normalizedEvents, slotStarts, slotCount } = args;
9029
- return React30.useMemo(() => {
9165
+ return React31.useMemo(() => {
9030
9166
  if (!enabled) return null;
9031
9167
  if (activeView !== "day") return null;
9032
9168
  const n = slotCount;
@@ -9061,14 +9197,14 @@ function useSlotMetrics(args) {
9061
9197
  dayHeaderSmart,
9062
9198
  daySlotCompression
9063
9199
  } = args;
9064
- const fixedSlotWidth = React30.useMemo(() => {
9200
+ const fixedSlotWidth = React31.useMemo(() => {
9065
9201
  const baseSlotWidth = activeView === "month" || activeView === "day" ? effectiveSlotMinWidth * 3 : effectiveSlotMinWidth;
9066
9202
  if (activeView !== "week") return baseSlotWidth;
9067
9203
  if (bodyClientWidth <= 0) return baseSlotWidth;
9068
9204
  if (slotsLength <= 0) return baseSlotWidth;
9069
9205
  return Math.max(baseSlotWidth, bodyClientWidth / slotsLength);
9070
9206
  }, [activeView, bodyClientWidth, effectiveSlotMinWidth, slotsLength]);
9071
- const slotMetrics = React30.useMemo(() => {
9207
+ const slotMetrics = React31.useMemo(() => {
9072
9208
  const n = slotsLength;
9073
9209
  const widths = new Array(n).fill(fixedSlotWidth);
9074
9210
  const isAdaptiveView = activeView === "month" || activeView === "day";
@@ -9198,7 +9334,7 @@ function useSlotMetrics(args) {
9198
9334
  }
9199
9335
  function useLayoutsByResource(args) {
9200
9336
  const { eventsByResource, preview, slotStarts, slotsLength, slotLefts, getResourceRowHeight, laneGap, lanePaddingY, effectiveMaxLanesPerRow, eventHeight } = args;
9201
- return React30.useMemo(() => {
9337
+ return React31.useMemo(() => {
9202
9338
  const map = /* @__PURE__ */ new Map();
9203
9339
  for (const [resourceId, list] of eventsByResource.entries()) {
9204
9340
  const mapped = list.map((ev) => {
@@ -9245,9 +9381,9 @@ function lowerBound2(arr, target) {
9245
9381
  }
9246
9382
  function useVisibleSlotRange(args) {
9247
9383
  const { enabled, overscan, scrollRef, slotLefts, slotCount } = args;
9248
- const [scrollLeft, setScrollLeft] = React30.useState(0);
9249
- const [viewportWidth, setViewportWidth] = React30.useState(0);
9250
- React30.useEffect(() => {
9384
+ const [scrollLeft, setScrollLeft] = React31.useState(0);
9385
+ const [viewportWidth, setViewportWidth] = React31.useState(0);
9386
+ React31.useEffect(() => {
9251
9387
  if (!enabled) return;
9252
9388
  const el = scrollRef.current;
9253
9389
  if (!el) return;
@@ -9262,7 +9398,7 @@ function useVisibleSlotRange(args) {
9262
9398
  el.removeEventListener("scroll", onScroll);
9263
9399
  };
9264
9400
  }, [enabled, scrollRef]);
9265
- return React30.useMemo(() => {
9401
+ return React31.useMemo(() => {
9266
9402
  if (!enabled) return { startIdx: 0, endIdx: slotCount };
9267
9403
  if (slotCount <= 0) return { startIdx: 0, endIdx: 0 };
9268
9404
  if (viewportWidth <= 0) return { startIdx: 0, endIdx: slotCount };
@@ -9354,14 +9490,14 @@ function CalendarTimeline({
9354
9490
  }) {
9355
9491
  const t = useTranslations("CalendarTimeline");
9356
9492
  const detectedLocale = useLocale();
9357
- const resolvedLocale = React31.useMemo(() => localeToBCP47(locale ?? detectedLocale), [locale, detectedLocale]);
9358
- const resolvedTimeZone = React31.useMemo(() => timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC", [timeZone]);
9493
+ const resolvedLocale = React32.useMemo(() => localeToBCP47(locale ?? detectedLocale), [locale, detectedLocale]);
9494
+ const resolvedTimeZone = React32.useMemo(() => timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC", [timeZone]);
9359
9495
  const effectiveEnableEventSheet = enableEventSheet ?? Boolean(renderEventSheet);
9360
9496
  const isViewOnly = interactions?.mode === "view";
9361
9497
  const isControlledSelectedEventId = selectedEventId !== void 0;
9362
- const [internalSelectedEventId, setInternalSelectedEventId] = React31.useState(defaultSelectedEventId ?? null);
9498
+ const [internalSelectedEventId, setInternalSelectedEventId] = React32.useState(defaultSelectedEventId ?? null);
9363
9499
  const activeSelectedEventId = isControlledSelectedEventId ? selectedEventId : internalSelectedEventId;
9364
- const setSelectedEventId = React31.useCallback(
9500
+ const setSelectedEventId = React32.useCallback(
9365
9501
  (next) => {
9366
9502
  if (!isControlledSelectedEventId) setInternalSelectedEventId(next);
9367
9503
  onSelectedEventIdChange?.(next);
@@ -9369,9 +9505,9 @@ function CalendarTimeline({
9369
9505
  [isControlledSelectedEventId, onSelectedEventIdChange]
9370
9506
  );
9371
9507
  const isControlledEventSheetOpen = eventSheetOpen !== void 0;
9372
- const [internalEventSheetOpen, setInternalEventSheetOpen] = React31.useState(defaultEventSheetOpen ?? false);
9508
+ const [internalEventSheetOpen, setInternalEventSheetOpen] = React32.useState(defaultEventSheetOpen ?? false);
9373
9509
  const activeEventSheetOpen = isControlledEventSheetOpen ? Boolean(eventSheetOpen) : internalEventSheetOpen;
9374
- const setEventSheetOpen = React31.useCallback(
9510
+ const setEventSheetOpen = React32.useCallback(
9375
9511
  (next) => {
9376
9512
  if (!isControlledEventSheetOpen) setInternalEventSheetOpen(next);
9377
9513
  onEventSheetOpenChange?.(next);
@@ -9379,19 +9515,19 @@ function CalendarTimeline({
9379
9515
  },
9380
9516
  [isControlledEventSheetOpen, onEventSheetOpenChange, setSelectedEventId]
9381
9517
  );
9382
- const sizeConfig = React31.useMemo(() => getSizeConfig(size), [size]);
9518
+ const sizeConfig = React32.useMemo(() => getSizeConfig(size), [size]);
9383
9519
  const densityClass = sizeConfig.densityClass;
9384
9520
  const eventHeight = sizeConfig.eventHeight;
9385
9521
  const laneGap = sizeConfig.laneGap;
9386
9522
  const lanePaddingY = sizeConfig.lanePaddingY;
9387
- const canResizeColumn = React31.useMemo(() => {
9523
+ const canResizeColumn = React32.useMemo(() => {
9388
9524
  const cfg = enableLayoutResize;
9389
9525
  if (!cfg) return false;
9390
9526
  if (isViewOnly) return false;
9391
9527
  if (cfg === true) return true;
9392
9528
  return cfg.column !== false;
9393
9529
  }, [enableLayoutResize, isViewOnly]);
9394
- const canResizeRow = React31.useMemo(() => {
9530
+ const canResizeRow = React32.useMemo(() => {
9395
9531
  const cfg = enableLayoutResize;
9396
9532
  if (!cfg) return false;
9397
9533
  if (isViewOnly) return false;
@@ -9399,19 +9535,19 @@ function CalendarTimeline({
9399
9535
  return cfg.row !== false;
9400
9536
  }, [enableLayoutResize, isViewOnly]);
9401
9537
  const isControlledResourceColumnWidth = resourceColumnWidth !== void 0;
9402
- const [internalResourceColumnWidth, setInternalResourceColumnWidth] = React31.useState(() => {
9538
+ const [internalResourceColumnWidth, setInternalResourceColumnWidth] = React32.useState(() => {
9403
9539
  const init = defaultResourceColumnWidth ?? sizeConfig.resourceColumnWidth;
9404
9540
  return typeof init === "number" ? init : sizeConfig.resourceColumnWidth;
9405
9541
  });
9406
- React31.useEffect(() => {
9542
+ React32.useEffect(() => {
9407
9543
  if (isControlledResourceColumnWidth) return;
9408
9544
  if (defaultResourceColumnWidth == null) return;
9409
9545
  setInternalResourceColumnWidth(defaultResourceColumnWidth);
9410
9546
  }, [defaultResourceColumnWidth, isControlledResourceColumnWidth]);
9411
9547
  const effectiveResourceColumnWidth = isControlledResourceColumnWidth ? resourceColumnWidth : internalResourceColumnWidth;
9412
9548
  const isControlledRowHeight = rowHeight !== void 0;
9413
- const [internalRowHeight, setInternalRowHeight] = React31.useState(() => defaultRowHeight ?? sizeConfig.rowHeight);
9414
- React31.useEffect(() => {
9549
+ const [internalRowHeight, setInternalRowHeight] = React32.useState(() => defaultRowHeight ?? sizeConfig.rowHeight);
9550
+ React32.useEffect(() => {
9415
9551
  if (isControlledRowHeight) return;
9416
9552
  if (defaultRowHeight == null) return;
9417
9553
  setInternalRowHeight(defaultRowHeight);
@@ -9423,13 +9559,13 @@ function CalendarTimeline({
9423
9559
  const rowMin = minRowHeight ?? 36;
9424
9560
  const rowMax = maxRowHeight ?? 120;
9425
9561
  const isControlledView = view !== void 0;
9426
- const [internalView, setInternalView] = React31.useState(defaultView);
9562
+ const [internalView, setInternalView] = React32.useState(defaultView);
9427
9563
  const activeView = isControlledView ? view : internalView;
9428
9564
  const isControlledDate = date !== void 0;
9429
- const [internalDate, setInternalDate] = React31.useState(() => defaultDate ?? /* @__PURE__ */ new Date());
9565
+ const [internalDate, setInternalDate] = React32.useState(() => defaultDate ?? /* @__PURE__ */ new Date());
9430
9566
  const activeDate = isControlledDate ? date : internalDate;
9431
- const resolvedNow = now ?? /* @__PURE__ */ new Date();
9432
- const l = React31.useMemo(
9567
+ const resolvedNow = React32.useMemo(() => now ?? /* @__PURE__ */ new Date(), [now]);
9568
+ const l = React32.useMemo(
9433
9569
  () => ({
9434
9570
  today: labels?.today ?? t("today"),
9435
9571
  prev: labels?.prev ?? t("prev"),
@@ -9451,21 +9587,21 @@ function CalendarTimeline({
9451
9587
  }),
9452
9588
  [labels, t]
9453
9589
  );
9454
- const setView = React31.useCallback(
9590
+ const setView = React32.useCallback(
9455
9591
  (next) => {
9456
9592
  if (!isControlledView) setInternalView(next);
9457
9593
  onViewChange?.(next);
9458
9594
  },
9459
9595
  [isControlledView, onViewChange]
9460
9596
  );
9461
- const setDate = React31.useCallback(
9597
+ const setDate = React32.useCallback(
9462
9598
  (next) => {
9463
9599
  if (!isControlledDate) setInternalDate(next);
9464
9600
  onDateChange?.(next);
9465
9601
  },
9466
9602
  [isControlledDate, onDateChange]
9467
9603
  );
9468
- const navigate = React31.useCallback(
9604
+ const navigate = React32.useCallback(
9469
9605
  (dir) => {
9470
9606
  const base = activeDate;
9471
9607
  if (activeView === "month") {
@@ -9480,18 +9616,17 @@ function CalendarTimeline({
9480
9616
  },
9481
9617
  [activeDate, activeView, resolvedTimeZone, setDate]
9482
9618
  );
9483
- const goToday = React31.useCallback(() => setDate(resolvedNow), [resolvedNow, setDate]);
9484
- const [internalCollapsed, setInternalCollapsed] = React31.useState(() => defaultGroupCollapsed ?? {});
9619
+ const [internalCollapsed, setInternalCollapsed] = React32.useState(() => defaultGroupCollapsed ?? {});
9485
9620
  const collapsed = groupCollapsed ?? internalCollapsed;
9486
- const setCollapsed = React31.useCallback(
9621
+ const setCollapsed = React32.useCallback(
9487
9622
  (next) => {
9488
9623
  if (!groupCollapsed) setInternalCollapsed(next);
9489
9624
  onGroupCollapsedChange?.(next);
9490
9625
  },
9491
9626
  [groupCollapsed, onGroupCollapsedChange]
9492
9627
  );
9493
- const rows = React31.useMemo(() => buildRows({ resources, groups, collapsed }), [resources, groups, collapsed]);
9494
- const groupResourceCounts = React31.useMemo(() => getGroupResourceCounts(resources), [resources]);
9628
+ const rows = React32.useMemo(() => buildRows({ resources, groups, collapsed }), [resources, groups, collapsed]);
9629
+ const groupResourceCounts = React32.useMemo(() => getGroupResourceCounts(resources), [resources]);
9495
9630
  const { slots, range, slotStarts, todaySlotIdx, weekendSlotIdxs } = useTimelineSlots({
9496
9631
  activeView,
9497
9632
  activeDate,
@@ -9504,12 +9639,12 @@ function CalendarTimeline({
9504
9639
  resolvedNow,
9505
9640
  formatters
9506
9641
  });
9507
- React31.useEffect(() => {
9642
+ React32.useEffect(() => {
9508
9643
  onRangeChange?.(range);
9509
9644
  }, [range.start, range.end, onRangeChange]);
9510
- const leftRef = React31.useRef(null);
9511
- const bodyRef = React31.useRef(null);
9512
- const headerRef = React31.useRef(null);
9645
+ const leftRef = React32.useRef(null);
9646
+ const bodyRef = React32.useRef(null);
9647
+ const headerRef = React32.useRef(null);
9513
9648
  const bodyClientWidth = useClientWidth(bodyRef);
9514
9649
  const { normalizedEvents, eventsByResource, resourceById } = useNormalizedEvents({
9515
9650
  events,
@@ -9541,16 +9676,16 @@ function CalendarTimeline({
9541
9676
  slotLefts,
9542
9677
  slotCount: slots.length
9543
9678
  });
9544
- const selectedEvent = React31.useMemo(() => {
9679
+ const selectedEvent = React32.useMemo(() => {
9545
9680
  if (!activeSelectedEventId) return null;
9546
9681
  const found = normalizedEvents.find((e) => e.id === activeSelectedEventId);
9547
9682
  return found ?? null;
9548
9683
  }, [activeSelectedEventId, normalizedEvents]);
9549
- const selectedResource = React31.useMemo(() => {
9684
+ const selectedResource = React32.useMemo(() => {
9550
9685
  if (!selectedEvent) return void 0;
9551
9686
  return resourceById.get(selectedEvent.resourceId);
9552
9687
  }, [resourceById, selectedEvent]);
9553
- const selectedTimeText = React31.useMemo(() => {
9688
+ const selectedTimeText = React32.useMemo(() => {
9554
9689
  if (!selectedEvent) return "";
9555
9690
  return formatters?.eventTime?.({
9556
9691
  start: selectedEvent._start,
@@ -9560,7 +9695,7 @@ function CalendarTimeline({
9560
9695
  view: activeView
9561
9696
  }) ?? defaultEventTime({ start: selectedEvent._start, end: selectedEvent._end, locale: resolvedLocale, timeZone: resolvedTimeZone, view: activeView });
9562
9697
  }, [activeView, formatters, resolvedLocale, resolvedTimeZone, selectedEvent]);
9563
- React31.useEffect(() => {
9698
+ React32.useEffect(() => {
9564
9699
  if (!effectiveEnableEventSheet) return;
9565
9700
  if (activeEventSheetOpen && activeSelectedEventId && !selectedEvent) {
9566
9701
  setEventSheetOpen(false);
@@ -9570,24 +9705,24 @@ function CalendarTimeline({
9570
9705
  const virt = virtualization?.enabled;
9571
9706
  const overscan = virtualization?.overscan ?? 8;
9572
9707
  const isControlledRowHeights = rowHeights !== void 0;
9573
- const [internalRowHeights, setInternalRowHeights] = React31.useState(() => defaultRowHeights ?? {});
9574
- React31.useEffect(() => {
9708
+ const [internalRowHeights, setInternalRowHeights] = React32.useState(() => defaultRowHeights ?? {});
9709
+ React32.useEffect(() => {
9575
9710
  if (isControlledRowHeights) return;
9576
9711
  if (!defaultRowHeights) return;
9577
9712
  setInternalRowHeights(defaultRowHeights);
9578
9713
  }, [defaultRowHeights, isControlledRowHeights]);
9579
9714
  const activeRowHeights = isControlledRowHeights ? rowHeights : internalRowHeights;
9580
- const autoRowHeightCfg = React31.useMemo(() => {
9715
+ const autoRowHeightCfg = React32.useMemo(() => {
9581
9716
  if (!autoRowHeight) return null;
9582
9717
  return autoRowHeight === true ? {} : autoRowHeight;
9583
9718
  }, [autoRowHeight]);
9584
- const effectiveMaxLanesPerRow = React31.useMemo(() => {
9719
+ const effectiveMaxLanesPerRow = React32.useMemo(() => {
9585
9720
  if (!autoRowHeightCfg) return maxLanesPerRow;
9586
9721
  const maxLanes = autoRowHeightCfg.maxLanesPerRow;
9587
9722
  if (typeof maxLanes === "number" && Number.isFinite(maxLanes) && maxLanes > 0) return Math.floor(maxLanes);
9588
9723
  return Number.POSITIVE_INFINITY;
9589
9724
  }, [autoRowHeightCfg, maxLanesPerRow]);
9590
- const autoRowHeightsByResource = React31.useMemo(() => {
9725
+ const autoRowHeightsByResource = React32.useMemo(() => {
9591
9726
  if (!autoRowHeightCfg) return null;
9592
9727
  const maxRowHeight2 = autoRowHeightCfg.maxRowHeight;
9593
9728
  const out = /* @__PURE__ */ new Map();
@@ -9605,7 +9740,7 @@ function CalendarTimeline({
9605
9740
  }
9606
9741
  return out;
9607
9742
  }, [autoRowHeightCfg, eventHeight, eventsByResource, laneGap, lanePaddingY, slotStarts, slots.length, effectiveMaxLanesPerRow]);
9608
- const getResourceRowHeight = React31.useCallback(
9743
+ const getResourceRowHeight = React32.useCallback(
9609
9744
  (resourceId) => {
9610
9745
  const h = activeRowHeights[resourceId];
9611
9746
  const base = typeof h === "number" && Number.isFinite(h) && h > 0 ? h : effectiveRowHeight;
@@ -9615,7 +9750,7 @@ function CalendarTimeline({
9615
9750
  },
9616
9751
  [activeRowHeights, autoRowHeightsByResource, effectiveRowHeight]
9617
9752
  );
9618
- const setRowHeightForResource = React31.useCallback(
9753
+ const setRowHeightForResource = React32.useCallback(
9619
9754
  (resourceId, height) => {
9620
9755
  const clamped = clamp4(Math.round(height), rowMin, rowMax);
9621
9756
  onRowHeightChange?.(clamped);
@@ -9632,7 +9767,7 @@ function CalendarTimeline({
9632
9767
  },
9633
9768
  [activeRowHeights, isControlledRowHeights, onRowHeightChange, onRowHeightsChange, rowMax, rowMin]
9634
9769
  );
9635
- const rowHeightsArray = React31.useMemo(() => {
9770
+ const rowHeightsArray = React32.useMemo(() => {
9636
9771
  return rows.map((r) => {
9637
9772
  if (r.kind === "resource") return getResourceRowHeight(r.resource.id);
9638
9773
  return sizeConfig.groupRowHeight;
@@ -9648,13 +9783,13 @@ function CalendarTimeline({
9648
9783
  const endRow = virt ? virtualResult.endIndex : rows.length;
9649
9784
  const topSpacer = virt ? virtualResult.topSpacer : 0;
9650
9785
  const bottomSpacer = virt ? virtualResult.bottomSpacer : 0;
9651
- const renderedRowsHeight = React31.useMemo(() => {
9786
+ const renderedRowsHeight = React32.useMemo(() => {
9652
9787
  let h = 0;
9653
9788
  for (let i = startRow; i < endRow; i++) h += rowHeightsArray[i] ?? effectiveRowHeight;
9654
9789
  return h;
9655
9790
  }, [effectiveRowHeight, endRow, rowHeightsArray, startRow]);
9656
- const resizeRef = React31.useRef(null);
9657
- const setResourceColumnWidth = React31.useCallback(
9791
+ const resizeRef = React32.useRef(null);
9792
+ const setResourceColumnWidth = React32.useCallback(
9658
9793
  (next) => {
9659
9794
  const clamped = clamp4(Math.round(next), colMin, colMax);
9660
9795
  if (!isControlledResourceColumnWidth) setInternalResourceColumnWidth(clamped);
@@ -9662,7 +9797,7 @@ function CalendarTimeline({
9662
9797
  },
9663
9798
  [colMax, colMin, isControlledResourceColumnWidth, onResourceColumnWidthChange]
9664
9799
  );
9665
- const startResize = React31.useCallback(
9800
+ const startResize = React32.useCallback(
9666
9801
  (mode, e, args) => {
9667
9802
  if (e.button !== 0 || e.ctrlKey) return;
9668
9803
  resizeRef.current = {
@@ -9705,7 +9840,7 @@ function CalendarTimeline({
9705
9840
  },
9706
9841
  [setResourceColumnWidth, setRowHeightForResource]
9707
9842
  );
9708
- React31.useEffect(() => {
9843
+ React32.useEffect(() => {
9709
9844
  return () => {
9710
9845
  if (!resizeRef.current) return;
9711
9846
  resizeRef.current = null;
@@ -9713,7 +9848,7 @@ function CalendarTimeline({
9713
9848
  document.body.style.userSelect = "";
9714
9849
  };
9715
9850
  }, []);
9716
- const beginResizeColumn = React31.useCallback(
9851
+ const beginResizeColumn = React32.useCallback(
9717
9852
  (e) => {
9718
9853
  if (!canResizeColumn) return;
9719
9854
  if (typeof effectiveResourceColumnWidth !== "number") return;
@@ -9721,7 +9856,7 @@ function CalendarTimeline({
9721
9856
  },
9722
9857
  [canResizeColumn, effectiveResourceColumnWidth, effectiveRowHeight, startResize]
9723
9858
  );
9724
- const beginResizeResourceRow = React31.useCallback(
9859
+ const beginResizeResourceRow = React32.useCallback(
9725
9860
  (resourceId) => (e) => {
9726
9861
  if (!canResizeRow) return;
9727
9862
  startResize("row", e, {
@@ -9732,7 +9867,7 @@ function CalendarTimeline({
9732
9867
  },
9733
9868
  [canResizeRow, effectiveResourceColumnWidth, getResourceRowHeight, startResize]
9734
9869
  );
9735
- const title = React31.useMemo(() => {
9870
+ const title = React32.useMemo(() => {
9736
9871
  if (activeView === "month") {
9737
9872
  return formatters?.monthTitle?.(activeDate, { locale: resolvedLocale, timeZone: resolvedTimeZone }) ?? defaultMonthTitle(activeDate, resolvedLocale, resolvedTimeZone);
9738
9873
  }
@@ -9753,11 +9888,11 @@ function CalendarTimeline({
9753
9888
  }, [activeDate, activeView, formatters, l.week, range.end, range.start, resolvedLocale, resolvedTimeZone]);
9754
9889
  const createMode = interactions?.createMode ?? "drag";
9755
9890
  const canCreate = !isViewOnly && (interactions?.creatable ?? false) && !!onCreateEvent;
9756
- const [createOpen, setCreateOpen] = React31.useState(false);
9757
- const [createResourceId, setCreateResourceId] = React31.useState(null);
9758
- const [createStartIdx, setCreateStartIdx] = React31.useState(0);
9759
- const [createEndIdx, setCreateEndIdx] = React31.useState(1);
9760
- const resourceOptions = React31.useMemo(() => {
9891
+ const [createOpen, setCreateOpen] = React32.useState(false);
9892
+ const [createResourceId, setCreateResourceId] = React32.useState(null);
9893
+ const [createStartIdx, setCreateStartIdx] = React32.useState(0);
9894
+ const [createEndIdx, setCreateEndIdx] = React32.useState(1);
9895
+ const resourceOptions = React32.useMemo(() => {
9761
9896
  return resources.map((r) => ({
9762
9897
  label: typeof r.label === "string" ? r.label : r.id,
9763
9898
  value: r.id,
@@ -9765,12 +9900,12 @@ function CalendarTimeline({
9765
9900
  disabled: r.disabled ?? false
9766
9901
  }));
9767
9902
  }, [resources]);
9768
- const slotPickerLabel = React31.useMemo(() => {
9903
+ const slotPickerLabel = React32.useMemo(() => {
9769
9904
  const timeFmt = getDtf(resolvedLocale, resolvedTimeZone, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
9770
9905
  const dayFmt = getDtf(resolvedLocale, resolvedTimeZone, { weekday: "short", month: "short", day: "numeric" });
9771
9906
  return (d) => activeView === "day" ? timeFmt.format(d) : dayFmt.format(d);
9772
9907
  }, [activeView, resolvedLocale, resolvedTimeZone]);
9773
- const openCreate = React31.useCallback(() => {
9908
+ const openCreate = React32.useCallback(() => {
9774
9909
  if (!canCreate) return;
9775
9910
  if (activeEventSheetOpen) setEventSheetOpen(false);
9776
9911
  const firstResource = resources.find((r) => !r.disabled)?.id ?? resources[0]?.id ?? null;
@@ -9802,13 +9937,13 @@ function CalendarTimeline({
9802
9937
  slotStarts,
9803
9938
  slots.length
9804
9939
  ]);
9805
- React31.useEffect(() => {
9940
+ React32.useEffect(() => {
9806
9941
  setCreateEndIdx((prev) => Math.min(slots.length, Math.max(prev, createStartIdx + 1)));
9807
9942
  }, [createStartIdx, slots.length]);
9808
- const createStartOptions = React31.useMemo(() => {
9943
+ const createStartOptions = React32.useMemo(() => {
9809
9944
  return slotStarts.map((d, idx) => ({ label: slotPickerLabel(d), value: idx }));
9810
9945
  }, [slotStarts, slotPickerLabel]);
9811
- const createEndOptions = React31.useMemo(() => {
9946
+ const createEndOptions = React32.useMemo(() => {
9812
9947
  const out = [];
9813
9948
  for (let idx = createStartIdx + 1; idx <= slotStarts.length; idx++) {
9814
9949
  const boundary = idx >= slotStarts.length ? range.end : slotStarts[idx];
@@ -9816,7 +9951,7 @@ function CalendarTimeline({
9816
9951
  }
9817
9952
  return out;
9818
9953
  }, [createStartIdx, range.end, slotPickerLabel, slotStarts]);
9819
- const commitCreate = React31.useCallback(() => {
9954
+ const commitCreate = React32.useCallback(() => {
9820
9955
  if (!onCreateEvent) return;
9821
9956
  if (!createResourceId) return;
9822
9957
  const start = slotStarts[clamp4(createStartIdx, 0, Math.max(0, slotStarts.length - 1))];
@@ -9827,24 +9962,24 @@ function CalendarTimeline({
9827
9962
  onCreateEvent({ resourceId: createResourceId, start, end: endBoundary });
9828
9963
  setCreateOpen(false);
9829
9964
  }, [createEndIdx, createResourceId, createStartIdx, onCreateEvent, range.end, slotStarts]);
9830
- const dragRef = React31.useRef(null);
9831
- const [preview, setPreview] = React31.useState(null);
9832
- const suppressNextEventClickRef = React31.useRef(false);
9833
- const [hoverCell, setHoverCell] = React31.useState(null);
9834
- const autoScrollStateRef = React31.useRef({
9965
+ const dragRef = React32.useRef(null);
9966
+ const [preview, setPreview] = React32.useState(null);
9967
+ const suppressNextEventClickRef = React32.useRef(false);
9968
+ const [hoverCell, setHoverCell] = React32.useState(null);
9969
+ const autoScrollStateRef = React32.useRef({
9835
9970
  dir: 0,
9836
9971
  speed: 0,
9837
9972
  lastClientX: 0,
9838
9973
  lastClientY: 0
9839
9974
  });
9840
- const autoScrollRafRef = React31.useRef(null);
9841
- const stopAutoScroll = React31.useCallback(() => {
9975
+ const autoScrollRafRef = React32.useRef(null);
9976
+ const stopAutoScroll = React32.useCallback(() => {
9842
9977
  if (autoScrollRafRef.current != null) cancelAnimationFrame(autoScrollRafRef.current);
9843
9978
  autoScrollRafRef.current = null;
9844
9979
  autoScrollStateRef.current.dir = 0;
9845
9980
  autoScrollStateRef.current.speed = 0;
9846
9981
  }, []);
9847
- const getPointerContext = React31.useCallback(
9982
+ const getPointerContext = React32.useCallback(
9848
9983
  (clientX, clientY, opts) => {
9849
9984
  const body = bodyRef.current;
9850
9985
  if (!body) return null;
@@ -9862,7 +9997,7 @@ function CalendarTimeline({
9862
9997
  },
9863
9998
  [xToSlotIdx]
9864
9999
  );
9865
- const slotToDate = React31.useCallback(
10000
+ const slotToDate = React32.useCallback(
9866
10001
  (slotIdx) => {
9867
10002
  const start = slotStarts[clamp4(slotIdx, 0, slotStarts.length - 1)];
9868
10003
  if (activeView === "day") {
@@ -9873,7 +10008,7 @@ function CalendarTimeline({
9873
10008
  },
9874
10009
  [activeView, dayTimeStepMinutes, resolvedTimeZone, slotStarts]
9875
10010
  );
9876
- const updateDragPreview = React31.useCallback(
10011
+ const updateDragPreview = React32.useCallback(
9877
10012
  (clientX, clientY) => {
9878
10013
  const drag = dragRef.current;
9879
10014
  if (!drag) return;
@@ -9917,7 +10052,7 @@ function CalendarTimeline({
9917
10052
  },
9918
10053
  [getPointerContext, range.end, range.start, slotToDate, slots.length]
9919
10054
  );
9920
- const autoScrollTick = React31.useCallback(() => {
10055
+ const autoScrollTick = React32.useCallback(() => {
9921
10056
  const drag = dragRef.current;
9922
10057
  const body = bodyRef.current;
9923
10058
  const st = autoScrollStateRef.current;
@@ -9936,7 +10071,7 @@ function CalendarTimeline({
9936
10071
  updateDragPreview(st.lastClientX, st.lastClientY);
9937
10072
  autoScrollRafRef.current = requestAnimationFrame(autoScrollTick);
9938
10073
  }, [stopAutoScroll, updateDragPreview]);
9939
- const updateAutoScrollFromPointer = React31.useCallback(
10074
+ const updateAutoScrollFromPointer = React32.useCallback(
9940
10075
  (clientX, clientY) => {
9941
10076
  const body = bodyRef.current;
9942
10077
  if (!body) return;
@@ -9967,7 +10102,7 @@ function CalendarTimeline({
9967
10102
  },
9968
10103
  [autoScrollTick, stopAutoScroll]
9969
10104
  );
9970
- React31.useEffect(() => stopAutoScroll, [stopAutoScroll]);
10105
+ React32.useEffect(() => stopAutoScroll, [stopAutoScroll]);
9971
10106
  const onPointerDownEvent = (e, ev, mode) => {
9972
10107
  if (e.button !== 0 || e.ctrlKey) return;
9973
10108
  if (isViewOnly) return;
@@ -10119,7 +10254,7 @@ function CalendarTimeline({
10119
10254
  }
10120
10255
  );
10121
10256
  };
10122
- const slotHeaderNodes = React31.useMemo(() => {
10257
+ const slotHeaderNodes = React32.useMemo(() => {
10123
10258
  const startIdx = colVirtEnabled ? visibleSlots.startIdx : 0;
10124
10259
  const endIdx = colVirtEnabled ? visibleSlots.endIdx : slots.length;
10125
10260
  const leftSpacer = startIdx > 0 ? slotLefts[startIdx] ?? 0 : 0;
@@ -10189,7 +10324,8 @@ function CalendarTimeline({
10189
10324
  activeView,
10190
10325
  sizeConfig,
10191
10326
  navigate,
10192
- goToday,
10327
+ now: resolvedNow,
10328
+ onApplyDateTime: setDate,
10193
10329
  setView,
10194
10330
  effectiveResourceColumnWidth,
10195
10331
  canResizeColumn,
@@ -10214,7 +10350,7 @@ function CalendarTimeline({
10214
10350
  "div",
10215
10351
  {
10216
10352
  className: cn(
10217
- "border border-border/40 rounded-2xl overflow-hidden bg-background/95 backdrop-blur-sm",
10353
+ "border border-border/40 rounded-2xl md:rounded-3xl overflow-hidden bg-background/95 backdrop-blur-sm",
10218
10354
  "shadow-sm hover:shadow-md transition-shadow duration-300",
10219
10355
  densityClass,
10220
10356
  className
@@ -10356,16 +10492,19 @@ function CalendarTimeline({
10356
10492
  const resource = resourceById.get(ev.resourceId);
10357
10493
  const tooltipTitle = ev.title || ev.id;
10358
10494
  const shouldCompact = activeView === "day" && dayEventStyle === "compact";
10495
+ const eventInsetX = 2;
10496
+ const leftInset = left + eventInsetX;
10497
+ const widthInset = Math.max(1, width - eventInsetX * 2);
10359
10498
  const defaultMaxVisual = clamp4(Math.round(fixedSlotWidth * 1.2), 160, 360);
10360
10499
  const maxVisual = clamp4(Math.round(dayEventMaxWidth ?? defaultMaxVisual), 80, 1200);
10361
- const visualWidth = shouldCompact ? Math.min(width, maxVisual) : width;
10362
- const isClipped = shouldCompact && width > visualWidth + 1;
10500
+ const visualWidth = shouldCompact ? Math.min(widthInset, maxVisual) : widthInset;
10501
+ const isClipped = shouldCompact && widthInset > visualWidth + 1;
10363
10502
  const block = /* @__PURE__ */ jsxs33(
10364
10503
  "div",
10365
10504
  {
10366
10505
  className: cn("absolute select-none cursor-pointer", isPreview && "z-10"),
10367
10506
  "data-uv-ct-event": true,
10368
- style: { left, top, width, height: layout.eventHeight },
10507
+ style: { left: leftInset, top, width: widthInset, height: layout.eventHeight },
10369
10508
  role: "button",
10370
10509
  tabIndex: 0,
10371
10510
  "aria-label": aria,
@@ -10437,7 +10576,7 @@ function CalendarTimeline({
10437
10576
  ]
10438
10577
  }
10439
10578
  );
10440
- if (!enableEventTooltips) return /* @__PURE__ */ jsx38(React31.Fragment, { children: block }, ev.id);
10579
+ if (!enableEventTooltips) return /* @__PURE__ */ jsx38(React32.Fragment, { children: block }, ev.id);
10441
10580
  const tooltipContent = /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-0.5", children: [
10442
10581
  /* @__PURE__ */ jsx38("div", { className: "font-semibold", children: tooltipTitle }),
10443
10582
  /* @__PURE__ */ jsx38("div", { className: "text-xs opacity-80", children: timeText }),
@@ -10450,11 +10589,17 @@ function CalendarTimeline({
10450
10589
  const endIdx = clamp4(binarySearchFirstGE(slotStarts, preview.end), startIdx + 1, slots.length);
10451
10590
  const left = slotLefts[startIdx] ?? 0;
10452
10591
  const width = Math.max(1, (slotLefts[endIdx] ?? 0) - (slotLefts[startIdx] ?? 0));
10592
+ const eventInsetX = 2;
10453
10593
  return /* @__PURE__ */ jsx38(
10454
10594
  "div",
10455
10595
  {
10456
10596
  className: "absolute rounded-lg border-2 border-dashed border-primary/60 bg-primary/10 backdrop-blur-sm animate-pulse",
10457
- style: { left, top: layout.baseTop, width, height: layout.eventHeight }
10597
+ style: {
10598
+ left: left + eventInsetX,
10599
+ top: layout.baseTop,
10600
+ width: Math.max(1, width - eventInsetX * 2),
10601
+ height: layout.eventHeight
10602
+ }
10458
10603
  }
10459
10604
  );
10460
10605
  })() : null,
@@ -10587,7 +10732,7 @@ function CalendarTimeline({
10587
10732
  }
10588
10733
 
10589
10734
  // ../../components/ui/MultiCombobox.tsx
10590
- import * as React32 from "react";
10735
+ import * as React33 from "react";
10591
10736
  import { useId as useId5 } from "react";
10592
10737
  import { ChevronDown as ChevronDown3, Search as Search4, Check as Check5, SearchX as SearchX2, Loader2 as Loader24, X as X11, Sparkles as Sparkles3 } from "lucide-react";
10593
10738
  import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
@@ -10622,27 +10767,27 @@ var MultiCombobox = ({
10622
10767
  helperText,
10623
10768
  maxTagsVisible = 3
10624
10769
  }) => {
10625
- const [query, setQuery] = React32.useState("");
10626
- const [open, setOpen] = React32.useState(false);
10627
- const [activeIndex, setActiveIndex] = React32.useState(null);
10628
- const inputRef = React32.useRef(null);
10629
- const listRef = React32.useRef([]);
10630
- const triggerRef = React32.useRef(null);
10770
+ const [query, setQuery] = React33.useState("");
10771
+ const [open, setOpen] = React33.useState(false);
10772
+ const [activeIndex, setActiveIndex] = React33.useState(null);
10773
+ const inputRef = React33.useRef(null);
10774
+ const listRef = React33.useRef([]);
10775
+ const triggerRef = React33.useRef(null);
10631
10776
  useShadCNAnimations();
10632
- const normalizedOptions = React32.useMemo(
10777
+ const normalizedOptions = React33.useMemo(
10633
10778
  () => options.map(
10634
10779
  (o) => typeof o === "string" ? { value: o, label: o } : { value: o.value, label: o.label, icon: o.icon, description: o.description, disabled: o.disabled, group: o.group }
10635
10780
  ),
10636
10781
  [options]
10637
10782
  );
10638
10783
  const enableSearch = normalizedOptions.length > 10;
10639
- const filtered = React32.useMemo(
10784
+ const filtered = React33.useMemo(
10640
10785
  () => enableSearch ? normalizedOptions.filter(
10641
10786
  (opt) => opt.label.toLowerCase().includes(query.toLowerCase()) || opt.description?.toLowerCase().includes(query.toLowerCase())
10642
10787
  ) : normalizedOptions,
10643
10788
  [normalizedOptions, query, enableSearch]
10644
10789
  );
10645
- const groupedOptions = React32.useMemo(() => {
10790
+ const groupedOptions = React33.useMemo(() => {
10646
10791
  if (!groupBy) return null;
10647
10792
  const groups = /* @__PURE__ */ new Map();
10648
10793
  filtered.forEach((opt) => {
@@ -10678,7 +10823,7 @@ var MultiCombobox = ({
10678
10823
  const handleClearAll = () => {
10679
10824
  onChange([]);
10680
10825
  };
10681
- React32.useEffect(() => {
10826
+ React33.useEffect(() => {
10682
10827
  if (open && enableSearch) {
10683
10828
  setTimeout(() => {
10684
10829
  inputRef.current?.focus();
@@ -10903,7 +11048,7 @@ var MultiCombobox = ({
10903
11048
  /* @__PURE__ */ jsx39("div", { className: "flex items-center gap-1.5 flex-wrap min-h-6 flex-1", children: value.length > 0 ? showTags ? /* @__PURE__ */ jsxs34(Fragment13, { children: [
10904
11049
  visibleTags.map((option) => {
10905
11050
  if (renderTag) {
10906
- return /* @__PURE__ */ jsx39(React32.Fragment, { children: renderTag(option, () => handleRemove(option.value)) }, option.value);
11051
+ return /* @__PURE__ */ jsx39(React33.Fragment, { children: renderTag(option, () => handleRemove(option.value)) }, option.value);
10907
11052
  }
10908
11053
  return /* @__PURE__ */ jsxs34(
10909
11054
  "span",
@@ -11044,17 +11189,17 @@ var MultiCombobox = ({
11044
11189
  };
11045
11190
 
11046
11191
  // ../../components/ui/RadioGroup.tsx
11047
- import * as React33 from "react";
11192
+ import * as React34 from "react";
11048
11193
  import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
11049
- var RadioGroupContext = React33.createContext(void 0);
11194
+ var RadioGroupContext = React34.createContext(void 0);
11050
11195
  var useRadioGroup = () => {
11051
- const context = React33.useContext(RadioGroupContext);
11196
+ const context = React34.useContext(RadioGroupContext);
11052
11197
  if (!context) {
11053
11198
  throw new Error("RadioGroupItem must be used within a RadioGroup");
11054
11199
  }
11055
11200
  return context;
11056
11201
  };
11057
- var RadioGroup = React33.forwardRef(
11202
+ var RadioGroup = React34.forwardRef(
11058
11203
  ({
11059
11204
  value,
11060
11205
  defaultValue,
@@ -11070,7 +11215,7 @@ var RadioGroup = React33.forwardRef(
11070
11215
  error = false,
11071
11216
  errorMessage
11072
11217
  }, ref) => {
11073
- const [internalValue, setInternalValue] = React33.useState(defaultValue || "");
11218
+ const [internalValue, setInternalValue] = React34.useState(defaultValue || "");
11074
11219
  const isControlled = value !== void 0;
11075
11220
  const currentValue = isControlled ? value : internalValue;
11076
11221
  const handleValueChange = (newValue) => {
@@ -11081,7 +11226,7 @@ var RadioGroup = React33.forwardRef(
11081
11226
  onValueChange?.(newValue);
11082
11227
  }
11083
11228
  };
11084
- const uniqueId = React33.useId();
11229
+ const uniqueId = React34.useId();
11085
11230
  const radioName = name || `radio-group-${uniqueId}`;
11086
11231
  return /* @__PURE__ */ jsx40(
11087
11232
  RadioGroupContext.Provider,
@@ -11139,7 +11284,7 @@ var sizeStyles7 = {
11139
11284
  padding: "p-4"
11140
11285
  }
11141
11286
  };
11142
- var RadioGroupItem = React33.forwardRef(
11287
+ var RadioGroupItem = React34.forwardRef(
11143
11288
  ({ value, id, disabled, className, children, label, description, icon }, ref) => {
11144
11289
  const { value: selectedValue, onValueChange, name, disabled: groupDisabled, size = "md", variant = "default" } = useRadioGroup();
11145
11290
  const isDisabled = disabled || groupDisabled;
@@ -11316,7 +11461,7 @@ var RadioGroupItem = React33.forwardRef(
11316
11461
  RadioGroupItem.displayName = "RadioGroupItem";
11317
11462
 
11318
11463
  // ../../components/ui/Slider.tsx
11319
- import * as React34 from "react";
11464
+ import * as React35 from "react";
11320
11465
  import { Fragment as Fragment14, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
11321
11466
  var SIZE_STYLES = {
11322
11467
  sm: {
@@ -11336,7 +11481,7 @@ var SIZE_STYLES = {
11336
11481
  }
11337
11482
  };
11338
11483
  var clamp5 = (n, min, max) => Math.min(max, Math.max(min, n));
11339
- var Slider = React34.forwardRef(
11484
+ var Slider = React35.forwardRef(
11340
11485
  ({
11341
11486
  className,
11342
11487
  mode = "single",
@@ -11368,15 +11513,15 @@ var Slider = React34.forwardRef(
11368
11513
  ...props
11369
11514
  }, ref) => {
11370
11515
  const isRange = mode === "range";
11371
- const trackRef = React34.useRef(null);
11372
- const [internalValue, setInternalValue] = React34.useState(defaultValue);
11373
- const [internalRange, setInternalRange] = React34.useState(() => {
11516
+ const trackRef = React35.useRef(null);
11517
+ const [internalValue, setInternalValue] = React35.useState(defaultValue);
11518
+ const [internalRange, setInternalRange] = React35.useState(() => {
11374
11519
  if (defaultRangeValue) return defaultRangeValue;
11375
11520
  const v = clamp5(defaultValue, min, max);
11376
11521
  return [min, v];
11377
11522
  });
11378
- const [activeThumb, setActiveThumb] = React34.useState(null);
11379
- const dragRef = React34.useRef(null);
11523
+ const [activeThumb, setActiveThumb] = React35.useState(null);
11524
+ const dragRef = React35.useRef(null);
11380
11525
  const isControlled = value !== void 0;
11381
11526
  const currentValue = isControlled ? value : internalValue;
11382
11527
  const isRangeControlled = rangeValue !== void 0;
@@ -11384,7 +11529,7 @@ var Slider = React34.forwardRef(
11384
11529
  const rangeMin = clamp5(currentRange[0] ?? min, min, max);
11385
11530
  const rangeMax = clamp5(currentRange[1] ?? max, min, max);
11386
11531
  const normalizedRange = rangeMin <= rangeMax ? [rangeMin, rangeMax] : [rangeMax, rangeMin];
11387
- const handleSingleChange = React34.useCallback(
11532
+ const handleSingleChange = React35.useCallback(
11388
11533
  (e) => {
11389
11534
  const newValue = Number(e.target.value);
11390
11535
  if (!isControlled) {
@@ -11395,14 +11540,14 @@ var Slider = React34.forwardRef(
11395
11540
  },
11396
11541
  [isControlled, onChange, onValueChange]
11397
11542
  );
11398
- const emitRange = React34.useCallback(
11543
+ const emitRange = React35.useCallback(
11399
11544
  (next) => {
11400
11545
  onRangeChange?.(next);
11401
11546
  onRangeValueChange?.(next);
11402
11547
  },
11403
11548
  [onRangeChange, onRangeValueChange]
11404
11549
  );
11405
- const handleRangeChange = React34.useCallback(
11550
+ const handleRangeChange = React35.useCallback(
11406
11551
  (thumb) => (e) => {
11407
11552
  const nextVal = Number(e.target.value);
11408
11553
  const [curMin, curMax] = normalizedRange;
@@ -11417,7 +11562,7 @@ var Slider = React34.forwardRef(
11417
11562
  const rangeStartPct = (normalizedRange[0] - min) / denom * 100;
11418
11563
  const rangeEndPct = (normalizedRange[1] - min) / denom * 100;
11419
11564
  const sizeStyles8 = SIZE_STYLES[size];
11420
- const displayValue = React34.useMemo(() => {
11565
+ const displayValue = React35.useMemo(() => {
11421
11566
  if (isRange) {
11422
11567
  const a = formatValue ? formatValue(normalizedRange[0]) : normalizedRange[0].toString();
11423
11568
  const b = formatValue ? formatValue(normalizedRange[1]) : normalizedRange[1].toString();
@@ -11425,7 +11570,7 @@ var Slider = React34.forwardRef(
11425
11570
  }
11426
11571
  return formatValue ? formatValue(currentValue) : currentValue.toString();
11427
11572
  }, [currentValue, formatValue, isRange, normalizedRange]);
11428
- const quantize = React34.useCallback(
11573
+ const quantize = React35.useCallback(
11429
11574
  (v) => {
11430
11575
  const stepped = Math.round((v - min) / step) * step + min;
11431
11576
  const fixed = Number(stepped.toFixed(10));
@@ -11433,7 +11578,7 @@ var Slider = React34.forwardRef(
11433
11578
  },
11434
11579
  [max, min, step]
11435
11580
  );
11436
- const valueFromClientX = React34.useCallback(
11581
+ const valueFromClientX = React35.useCallback(
11437
11582
  (clientX) => {
11438
11583
  const el = trackRef.current;
11439
11584
  if (!el) return min;
@@ -11624,7 +11769,7 @@ Slider.displayName = "Slider";
11624
11769
 
11625
11770
  // ../../components/ui/OverlayControls.tsx
11626
11771
  import { Dot as Dot2, Maximize2, Pause, Play, RotateCcw, RotateCw, Volume2, VolumeX } from "lucide-react";
11627
- import React35 from "react";
11772
+ import React36 from "react";
11628
11773
  import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
11629
11774
  function OverlayControls({
11630
11775
  mode,
@@ -11655,24 +11800,24 @@ function OverlayControls({
11655
11800
  }) {
11656
11801
  const hoverClasses = showOnHover ? "opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto" : "opacity-100 pointer-events-auto";
11657
11802
  const showControlsBar = mode === "review";
11658
- const [rateOpen, setRateOpen] = React35.useState(false);
11659
- const rateWrapRef = React35.useRef(null);
11660
- const [controlsVisible, setControlsVisible] = React35.useState(true);
11661
- const hideTimerRef = React35.useRef(null);
11662
- const [previewData, setPreviewData] = React35.useState(null);
11663
- const sliderRef = React35.useRef(null);
11664
- const [isDragging, setIsDragging] = React35.useState(false);
11665
- const [dragValue, setDragValue] = React35.useState(value);
11666
- React35.useEffect(() => {
11803
+ const [rateOpen, setRateOpen] = React36.useState(false);
11804
+ const rateWrapRef = React36.useRef(null);
11805
+ const [controlsVisible, setControlsVisible] = React36.useState(true);
11806
+ const hideTimerRef = React36.useRef(null);
11807
+ const [previewData, setPreviewData] = React36.useState(null);
11808
+ const sliderRef = React36.useRef(null);
11809
+ const [isDragging, setIsDragging] = React36.useState(false);
11810
+ const [dragValue, setDragValue] = React36.useState(value);
11811
+ React36.useEffect(() => {
11667
11812
  if (!isDragging) {
11668
11813
  setDragValue(value);
11669
11814
  }
11670
11815
  }, [value, isDragging]);
11671
- const [keyboardFeedback, setKeyboardFeedback] = React35.useState(null);
11672
- const feedbackTimerRef = React35.useRef(null);
11673
- const seekAccumulatorRef = React35.useRef(0);
11674
- const seekAccumulatorTimerRef = React35.useRef(null);
11675
- React35.useEffect(() => {
11816
+ const [keyboardFeedback, setKeyboardFeedback] = React36.useState(null);
11817
+ const feedbackTimerRef = React36.useRef(null);
11818
+ const seekAccumulatorRef = React36.useRef(0);
11819
+ const seekAccumulatorTimerRef = React36.useRef(null);
11820
+ React36.useEffect(() => {
11676
11821
  const onDocDown = (e) => {
11677
11822
  if (!rateOpen) return;
11678
11823
  const wrap = rateWrapRef.current;
@@ -11683,7 +11828,7 @@ function OverlayControls({
11683
11828
  document.addEventListener("mousedown", onDocDown);
11684
11829
  return () => document.removeEventListener("mousedown", onDocDown);
11685
11830
  }, [rateOpen]);
11686
- React35.useEffect(() => {
11831
+ React36.useEffect(() => {
11687
11832
  if (!autoHide || showOnHover) return;
11688
11833
  const resetTimer = () => {
11689
11834
  if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
@@ -11721,7 +11866,7 @@ function OverlayControls({
11721
11866
  seekAccumulatorRef.current = 0;
11722
11867
  }, 1e3);
11723
11868
  };
11724
- React35.useEffect(() => {
11869
+ React36.useEffect(() => {
11725
11870
  if (!enableKeyboardShortcuts) return;
11726
11871
  const handleKeyDown = (e) => {
11727
11872
  if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
@@ -12056,7 +12201,7 @@ function OverlayControls({
12056
12201
  }
12057
12202
 
12058
12203
  // ../../components/ui/CategoryTreeSelect.tsx
12059
- import { useState as useState29, useEffect as useEffect19 } from "react";
12204
+ import { useState as useState30, useEffect as useEffect20 } from "react";
12060
12205
  import { ChevronRight as ChevronRight6, ChevronDown as ChevronDown4, Check as Check6, FolderTree, Layers } from "lucide-react";
12061
12206
  import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
12062
12207
  var defaultLabels = {
@@ -12076,8 +12221,8 @@ function CategoryTreeSelect(props) {
12076
12221
  className,
12077
12222
  singleSelect = false
12078
12223
  } = props;
12079
- const [isOpen, setIsOpen] = useState29(false);
12080
- const [expandedNodes, setExpandedNodes] = useState29(/* @__PURE__ */ new Set());
12224
+ const [isOpen, setIsOpen] = useState30(false);
12225
+ const [expandedNodes, setExpandedNodes] = useState30(/* @__PURE__ */ new Set());
12081
12226
  const mergedLabels = { ...defaultLabels, ...labels };
12082
12227
  const valueArray = singleSelect ? props.value != null ? [props.value] : [] : props.value || [];
12083
12228
  const parentCategories = categories.filter((c) => !c.parent_id);
@@ -12090,7 +12235,7 @@ function CategoryTreeSelect(props) {
12090
12235
  childrenMap.get(cat.parent_id).push(cat);
12091
12236
  }
12092
12237
  });
12093
- useEffect19(() => {
12238
+ useEffect20(() => {
12094
12239
  if ((viewOnly || inline) && defaultExpanded) {
12095
12240
  const allParentIds = categories.filter((c) => childrenMap.has(c.id)).map((c) => c.id);
12096
12241
  setExpandedNodes(new Set(allParentIds));
@@ -12315,7 +12460,7 @@ function CategoryTreeSelect(props) {
12315
12460
  }
12316
12461
 
12317
12462
  // ../../components/ui/ImageUpload.tsx
12318
- import { useState as useState30, useRef as useRef14, useCallback as useCallback11 } from "react";
12463
+ import { useState as useState31, useRef as useRef14, useCallback as useCallback12 } from "react";
12319
12464
  import { Upload, X as X12, Image as ImageIcon, Loader2 as Loader25, Check as Check7 } from "lucide-react";
12320
12465
  import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
12321
12466
  function ImageUpload({
@@ -12333,9 +12478,9 @@ function ImageUpload({
12333
12478
  browseText,
12334
12479
  supportedFormatsText
12335
12480
  }) {
12336
- const [isDragging, setIsDragging] = useState30(false);
12337
- const [uploading, setUploading] = useState30(false);
12338
- const [uploadedImages, setUploadedImages] = useState30([]);
12481
+ const [isDragging, setIsDragging] = useState31(false);
12482
+ const [uploading, setUploading] = useState31(false);
12483
+ const [uploadedImages, setUploadedImages] = useState31([]);
12339
12484
  const fileInputRef = useRef14(null);
12340
12485
  const { addToast } = useToast();
12341
12486
  const t = useTranslations("OCR.imageUpload");
@@ -12344,7 +12489,7 @@ function ImageUpload({
12344
12489
  md: "w-24 h-24",
12345
12490
  lg: "w-32 h-32"
12346
12491
  };
12347
- const handleDragOver = useCallback11(
12492
+ const handleDragOver = useCallback12(
12348
12493
  (e) => {
12349
12494
  e.preventDefault();
12350
12495
  if (!disabled) {
@@ -12353,11 +12498,11 @@ function ImageUpload({
12353
12498
  },
12354
12499
  [disabled]
12355
12500
  );
12356
- const handleDragLeave = useCallback11((e) => {
12501
+ const handleDragLeave = useCallback12((e) => {
12357
12502
  e.preventDefault();
12358
12503
  setIsDragging(false);
12359
12504
  }, []);
12360
- const handleFiles = useCallback11(
12505
+ const handleFiles = useCallback12(
12361
12506
  async (files) => {
12362
12507
  if (files.length === 0) return;
12363
12508
  const validFiles = files.filter((file) => {
@@ -12424,7 +12569,7 @@ function ImageUpload({
12424
12569
  },
12425
12570
  [maxSize, addToast, onUpload]
12426
12571
  );
12427
- const handleDrop = useCallback11(
12572
+ const handleDrop = useCallback12(
12428
12573
  (e) => {
12429
12574
  e.preventDefault();
12430
12575
  setIsDragging(false);
@@ -12434,7 +12579,7 @@ function ImageUpload({
12434
12579
  },
12435
12580
  [disabled, handleFiles]
12436
12581
  );
12437
- const handleFileSelect = useCallback11(
12582
+ const handleFileSelect = useCallback12(
12438
12583
  (e) => {
12439
12584
  const files = Array.from(e.target.files || []);
12440
12585
  handleFiles(files);
@@ -12537,7 +12682,7 @@ function ImageUpload({
12537
12682
  }
12538
12683
 
12539
12684
  // ../../components/ui/Carousel.tsx
12540
- import * as React37 from "react";
12685
+ import * as React38 from "react";
12541
12686
  import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight7 } from "lucide-react";
12542
12687
  import { Fragment as Fragment17, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
12543
12688
  function Carousel({
@@ -12560,19 +12705,19 @@ function Carousel({
12560
12705
  thumbnailRenderer,
12561
12706
  ariaLabel = "Carousel"
12562
12707
  }) {
12563
- const [currentIndex, setCurrentIndex] = React37.useState(0);
12564
- const [isPaused, setIsPaused] = React37.useState(false);
12565
- const [isDragging, setIsDragging] = React37.useState(false);
12566
- const [startPos, setStartPos] = React37.useState(0);
12567
- const [currentTranslate, setCurrentTranslate] = React37.useState(0);
12568
- const [prevTranslate, setPrevTranslate] = React37.useState(0);
12569
- const progressElRef = React37.useRef(null);
12570
- const carouselRef = React37.useRef(null);
12571
- const rafRef = React37.useRef(null);
12572
- const totalSlides = React37.Children.count(children);
12708
+ const [currentIndex, setCurrentIndex] = React38.useState(0);
12709
+ const [isPaused, setIsPaused] = React38.useState(false);
12710
+ const [isDragging, setIsDragging] = React38.useState(false);
12711
+ const [startPos, setStartPos] = React38.useState(0);
12712
+ const [currentTranslate, setCurrentTranslate] = React38.useState(0);
12713
+ const [prevTranslate, setPrevTranslate] = React38.useState(0);
12714
+ const progressElRef = React38.useRef(null);
12715
+ const carouselRef = React38.useRef(null);
12716
+ const rafRef = React38.useRef(null);
12717
+ const totalSlides = React38.Children.count(children);
12573
12718
  const maxIndex = Math.max(0, totalSlides - slidesToShow);
12574
12719
  const isHorizontal = orientation === "horizontal";
12575
- const scrollPrev = React37.useCallback(() => {
12720
+ const scrollPrev = React38.useCallback(() => {
12576
12721
  setCurrentIndex((prev) => {
12577
12722
  if (prev === 0) {
12578
12723
  return loop ? maxIndex : 0;
@@ -12580,7 +12725,7 @@ function Carousel({
12580
12725
  return Math.max(0, prev - slidesToScroll);
12581
12726
  });
12582
12727
  }, [loop, maxIndex, slidesToScroll]);
12583
- const scrollNext = React37.useCallback(() => {
12728
+ const scrollNext = React38.useCallback(() => {
12584
12729
  setCurrentIndex((prev) => {
12585
12730
  if (prev >= maxIndex) {
12586
12731
  return loop ? 0 : maxIndex;
@@ -12588,13 +12733,13 @@ function Carousel({
12588
12733
  return Math.min(maxIndex, prev + slidesToScroll);
12589
12734
  });
12590
12735
  }, [loop, maxIndex, slidesToScroll]);
12591
- const scrollTo = React37.useCallback(
12736
+ const scrollTo = React38.useCallback(
12592
12737
  (index) => {
12593
12738
  setCurrentIndex(Math.min(maxIndex, Math.max(0, index)));
12594
12739
  },
12595
12740
  [maxIndex]
12596
12741
  );
12597
- React37.useEffect(() => {
12742
+ React38.useEffect(() => {
12598
12743
  const handleKeyDown = (e) => {
12599
12744
  if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
12600
12745
  e.preventDefault();
@@ -12616,7 +12761,7 @@ function Carousel({
12616
12761
  return () => carousel.removeEventListener("keydown", handleKeyDown);
12617
12762
  }
12618
12763
  }, [scrollPrev, scrollNext, scrollTo, maxIndex]);
12619
- React37.useEffect(() => {
12764
+ React38.useEffect(() => {
12620
12765
  const stop = () => {
12621
12766
  if (rafRef.current != null) {
12622
12767
  cancelAnimationFrame(rafRef.current);
@@ -12675,7 +12820,7 @@ function Carousel({
12675
12820
  setCurrentTranslate(0);
12676
12821
  setPrevTranslate(0);
12677
12822
  };
12678
- React37.useEffect(() => {
12823
+ React38.useEffect(() => {
12679
12824
  onSlideChange?.(currentIndex);
12680
12825
  }, [currentIndex, onSlideChange]);
12681
12826
  const getAnimationStyles2 = () => {
@@ -12728,7 +12873,7 @@ function Carousel({
12728
12873
  role: "group",
12729
12874
  "aria-atomic": "false",
12730
12875
  "aria-live": autoScroll ? "off" : "polite",
12731
- children: React37.Children.map(children, (child, idx) => /* @__PURE__ */ jsx45(
12876
+ children: React38.Children.map(children, (child, idx) => /* @__PURE__ */ jsx45(
12732
12877
  "div",
12733
12878
  {
12734
12879
  className: cn(
@@ -12818,7 +12963,7 @@ function Carousel({
12818
12963
  "absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-linear-to-t from-black/50 to-transparent overflow-x-auto",
12819
12964
  isHorizontal ? "flex-row" : "flex-col"
12820
12965
  ),
12821
- children: React37.Children.map(children, (child, idx) => /* @__PURE__ */ jsx45(
12966
+ children: React38.Children.map(children, (child, idx) => /* @__PURE__ */ jsx45(
12822
12967
  "button",
12823
12968
  {
12824
12969
  onClick: () => scrollTo(idx),
@@ -12839,7 +12984,7 @@ function Carousel({
12839
12984
  }
12840
12985
 
12841
12986
  // ../../components/ui/FallingIcons.tsx
12842
- import React38 from "react";
12987
+ import React39 from "react";
12843
12988
  import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
12844
12989
  var DEFAULT_COUNT = 24;
12845
12990
  var DEFAULT_SPEED_RANGE = [6, 14];
@@ -12867,10 +13012,10 @@ function FallingIcons({
12867
13012
  physics,
12868
13013
  easingFunction = "linear"
12869
13014
  }) {
12870
- const uid = React38.useId().replace(/[:]/g, "");
12871
- const containerRef = React38.useRef(null);
12872
- const [fallDist, setFallDist] = React38.useState(null);
12873
- const idRef = React38.useRef(1);
13015
+ const uid = React39.useId().replace(/[:]/g, "");
13016
+ const containerRef = React39.useRef(null);
13017
+ const [fallDist, setFallDist] = React39.useState(null);
13018
+ const idRef = React39.useRef(1);
12874
13019
  const gravity = physics?.gravity ?? 1;
12875
13020
  const windDirection = physics?.windDirection ?? 0;
12876
13021
  const windStrength = physics?.windStrength ?? 0;
@@ -12884,7 +13029,7 @@ function FallingIcons({
12884
13029
  bounce: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
12885
13030
  elastic: "cubic-bezier(0.175, 0.885, 0.32, 1.275)"
12886
13031
  };
12887
- const makeParticle = React38.useCallback(() => {
13032
+ const makeParticle = React39.useCallback(() => {
12888
13033
  const rnd = (min, max) => min + Math.random() * (max - min);
12889
13034
  return {
12890
13035
  leftPct: rnd(0, 100),
@@ -12898,12 +13043,12 @@ function FallingIcons({
12898
13043
  key: idRef.current++
12899
13044
  };
12900
13045
  }, [sizeRange, speedRange, horizontalDrift, gravity, windDirection, windStrength]);
12901
- const [particles, setParticles] = React38.useState([]);
12902
- React38.useEffect(() => {
13046
+ const [particles, setParticles] = React39.useState([]);
13047
+ React39.useEffect(() => {
12903
13048
  const arr = Array.from({ length: Math.max(0, count) }).map(() => makeParticle());
12904
13049
  setParticles(arr);
12905
13050
  }, [count, makeParticle]);
12906
- React38.useEffect(() => {
13051
+ React39.useEffect(() => {
12907
13052
  if (fullScreen) {
12908
13053
  const measure2 = () => setFallDist(window.innerHeight + 200);
12909
13054
  measure2();
@@ -12928,14 +13073,14 @@ function FallingIcons({
12928
13073
  const SpinName = `uv-spin-${uid}`;
12929
13074
  const PopName = `uv-pop-${uid}`;
12930
13075
  const PhysicsSpinName = `uv-physics-spin-${uid}`;
12931
- const glowStyles = React38.useMemo(() => {
13076
+ const glowStyles = React39.useMemo(() => {
12932
13077
  if (!glow) return {};
12933
13078
  const intensity = Math.max(0, Math.min(1, glowIntensity));
12934
13079
  return {
12935
13080
  filter: `drop-shadow(0 0 ${4 * intensity}px ${glowColor}) drop-shadow(0 0 ${8 * intensity}px ${glowColor})`
12936
13081
  };
12937
13082
  }, [glow, glowColor, glowIntensity]);
12938
- const FallbackIcon = React38.useMemo(
13083
+ const FallbackIcon = React39.useMemo(
12939
13084
  () => (props) => /* @__PURE__ */ jsx46("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx46("circle", { cx: "12", cy: "12", r: "10" }) }),
12940
13085
  []
12941
13086
  );
@@ -12993,7 +13138,7 @@ function FallingIcons({
12993
13138
  });
12994
13139
  };
12995
13140
  const trailParticles = trail ? Array.from({ length: Math.min(5, Math.max(1, trailLength)) }) : [];
12996
- return /* @__PURE__ */ jsxs41(React38.Fragment, { children: [
13141
+ return /* @__PURE__ */ jsxs41(React39.Fragment, { children: [
12997
13142
  trail && trailParticles.map((_, trailIndex) => {
12998
13143
  const trailDelay = p.delay - (trailIndex + 1) * 0.15;
12999
13144
  const trailOpacity = 1 - (trailIndex + 1) * (1 / (trailParticles.length + 1));
@@ -13111,7 +13256,7 @@ function FallingIcons({
13111
13256
  }
13112
13257
 
13113
13258
  // ../../components/ui/List.tsx
13114
- import * as React39 from "react";
13259
+ import * as React40 from "react";
13115
13260
  import { ChevronRight as ChevronRight8 } from "lucide-react";
13116
13261
  import { Fragment as Fragment18, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
13117
13262
  var SIZE_STYLES2 = {
@@ -13137,7 +13282,7 @@ var ListItemSkeleton = ({ size }) => {
13137
13282
  ] })
13138
13283
  ] });
13139
13284
  };
13140
- var ListRoot = React39.forwardRef(
13285
+ var ListRoot = React40.forwardRef(
13141
13286
  ({
13142
13287
  as = "ul",
13143
13288
  ordered,
@@ -13157,7 +13302,7 @@ var ListRoot = React39.forwardRef(
13157
13302
  ...rest
13158
13303
  }, ref) => {
13159
13304
  const Comp = ordered ? "ol" : as;
13160
- const childCount = React39.Children.count(children);
13305
+ const childCount = React40.Children.count(children);
13161
13306
  const hasChildren = childCount > 0;
13162
13307
  const variantClasses2 = {
13163
13308
  plain: "",
@@ -13195,14 +13340,14 @@ var ListRoot = React39.forwardRef(
13195
13340
  className
13196
13341
  ),
13197
13342
  ...rest,
13198
- children: React39.Children.map(children, (child, idx) => {
13199
- if (!React39.isValidElement(child)) return child;
13343
+ children: React40.Children.map(children, (child, idx) => {
13344
+ if (!React40.isValidElement(child)) return child;
13200
13345
  const childClass = cn(
13201
13346
  child.props?.className,
13202
13347
  hoverable && variant !== "flush" && "hover:bg-accent/50 focus:bg-accent/60 focus:outline-none transition-colors",
13203
13348
  variant === "flush" && "hover:bg-accent/30"
13204
13349
  );
13205
- return React39.cloneElement(child, {
13350
+ return React40.cloneElement(child, {
13206
13351
  className: childClass,
13207
13352
  // Pass global item class to contentClassName of ListItem
13208
13353
  contentClassName: cn(itemClassName, child.props?.contentClassName),
@@ -13217,7 +13362,7 @@ var ListRoot = React39.forwardRef(
13217
13362
  }
13218
13363
  );
13219
13364
  ListRoot.displayName = "List";
13220
- var ListItem = React39.forwardRef(
13365
+ var ListItem = React40.forwardRef(
13221
13366
  ({
13222
13367
  as = "li",
13223
13368
  selected = false,
@@ -13240,7 +13385,7 @@ var ListItem = React39.forwardRef(
13240
13385
  children,
13241
13386
  ...rest
13242
13387
  }, ref) => {
13243
- const [internalExpanded, setInternalExpanded] = React39.useState(false);
13388
+ const [internalExpanded, setInternalExpanded] = React40.useState(false);
13244
13389
  const isExpanded = controlledExpanded !== void 0 ? controlledExpanded : internalExpanded;
13245
13390
  const sizeAttr = rest["data-size"];
13246
13391
  const resolvedSize = sizeAttr && ["xs", "sm", "md", "lg"].includes(sizeAttr) ? sizeAttr : "md";
@@ -13308,7 +13453,7 @@ var List = Object.assign(ListRoot, { Item: ListItem });
13308
13453
  var List_default = List;
13309
13454
 
13310
13455
  // ../../components/ui/Watermark.tsx
13311
- import * as React40 from "react";
13456
+ import * as React41 from "react";
13312
13457
  import { createPortal as createPortal5 } from "react-dom";
13313
13458
  import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
13314
13459
  var PRESETS2 = {
@@ -13320,8 +13465,8 @@ var PRESETS2 = {
13320
13465
  internal: { text: "INTERNAL USE ONLY", color: "rgba(156, 163, 175, 0.15)", rotate: -22, fontSize: 13, fontWeight: "600" }
13321
13466
  };
13322
13467
  function useWatermarkDataURL(opts) {
13323
- const [url, setUrl] = React40.useState(null);
13324
- React40.useEffect(() => {
13468
+ const [url, setUrl] = React41.useState(null);
13469
+ React41.useEffect(() => {
13325
13470
  let cancelled = false;
13326
13471
  const text = opts.text;
13327
13472
  const image = opts.image;
@@ -13498,9 +13643,9 @@ var Watermark = ({
13498
13643
  children,
13499
13644
  ...rest
13500
13645
  }) => {
13501
- const [visible, setVisible] = React40.useState(true);
13502
- const [isDark, setIsDark] = React40.useState(false);
13503
- React40.useEffect(() => {
13646
+ const [visible, setVisible] = React41.useState(true);
13647
+ const [isDark, setIsDark] = React41.useState(false);
13648
+ React41.useEffect(() => {
13504
13649
  if (!darkMode) return;
13505
13650
  const checkDarkMode = () => {
13506
13651
  const isDarkMode = document.documentElement.classList.contains("dark") || window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -13602,7 +13747,7 @@ var Watermark = ({
13602
13747
  var Watermark_default = Watermark;
13603
13748
 
13604
13749
  // ../../components/ui/Timeline.tsx
13605
- import * as React41 from "react";
13750
+ import * as React42 from "react";
13606
13751
  import { ChevronDown as ChevronDown5 } from "lucide-react";
13607
13752
  import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
13608
13753
  var SIZE_STYLE = {
@@ -13655,7 +13800,7 @@ var STATUS_COLOR = {
13655
13800
  error: "bg-destructive",
13656
13801
  info: "bg-info"
13657
13802
  };
13658
- var TimelineContext = React41.createContext(null);
13803
+ var TimelineContext = React42.createContext(null);
13659
13804
  var LINE_STYLE_MAP = {
13660
13805
  solid: "border-solid",
13661
13806
  dashed: "border-dashed",
@@ -13683,7 +13828,7 @@ var Marker = ({ index, last, size, color, status = "default", lineColor, lineSty
13683
13828
  !last && showLine && /* @__PURE__ */ jsx49("div", { className: cn("flex-1 border-l-2", LINE_STYLE_MAP[lineStyle]), style: { borderColor: lineColor || "hsl(var(--border))" } })
13684
13829
  ] });
13685
13830
  };
13686
- var TimelineRoot = React41.forwardRef(
13831
+ var TimelineRoot = React42.forwardRef(
13687
13832
  ({
13688
13833
  align = "left",
13689
13834
  variant = "default",
@@ -13713,7 +13858,7 @@ var TimelineRoot = React41.forwardRef(
13713
13858
  }
13714
13859
  );
13715
13860
  TimelineRoot.displayName = "Timeline";
13716
- var TimelineItem = React41.forwardRef(
13861
+ var TimelineItem = React42.forwardRef(
13717
13862
  ({
13718
13863
  title,
13719
13864
  description,
@@ -13732,11 +13877,11 @@ var TimelineItem = React41.forwardRef(
13732
13877
  children,
13733
13878
  ...rest
13734
13879
  }, ref) => {
13735
- const ctx = React41.useContext(TimelineContext);
13880
+ const ctx = React42.useContext(TimelineContext);
13736
13881
  const idx = rest["data-index"];
13737
13882
  const isLast = Boolean(rest["data-last"]);
13738
13883
  const sz = SIZE_STYLE[ctx.size];
13739
- const [internalExpanded, setInternalExpanded] = React41.useState(false);
13884
+ const [internalExpanded, setInternalExpanded] = React42.useState(false);
13740
13885
  const isExpanded = controlledExpanded !== void 0 ? controlledExpanded : internalExpanded;
13741
13886
  const toggleExpanded = () => {
13742
13887
  const newExpanded = !isExpanded;
@@ -13878,7 +14023,7 @@ var Timeline = Object.assign(TimelineRoot, { Item: TimelineItem });
13878
14023
  var Timeline_default = Timeline;
13879
14024
 
13880
14025
  // ../../components/ui/ColorPicker.tsx
13881
- import * as React42 from "react";
14026
+ import * as React43 from "react";
13882
14027
  import { Pipette, X as X13, Copy, Check as Check8, Palette, History } from "lucide-react";
13883
14028
  import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
13884
14029
  var clamp6 = (n, min, max) => Math.max(min, Math.min(max, n));
@@ -14072,12 +14217,12 @@ function ColorPicker({
14072
14217
  }) {
14073
14218
  const isControlled = value !== void 0;
14074
14219
  const initial = parseAnyColor(isControlled ? value : defaultValue) || { r: 79, g: 70, b: 229, a: 1 };
14075
- const [rgba, setRgba] = React42.useState(initial);
14076
- const [open, setOpen] = React42.useState(false);
14077
- const [text, setText] = React42.useState(() => formatOutput(initial, withAlpha, format));
14078
- const [copied, setCopied] = React42.useState(false);
14079
- const [recentColors, setRecentColors] = React42.useState([]);
14080
- React42.useEffect(() => {
14220
+ const [rgba, setRgba] = React43.useState(initial);
14221
+ const [open, setOpen] = React43.useState(false);
14222
+ const [text, setText] = React43.useState(() => formatOutput(initial, withAlpha, format));
14223
+ const [copied, setCopied] = React43.useState(false);
14224
+ const [recentColors, setRecentColors] = React43.useState([]);
14225
+ React43.useEffect(() => {
14081
14226
  if (isControlled) {
14082
14227
  const parsed = parseAnyColor(value);
14083
14228
  if (parsed) {
@@ -14400,7 +14545,7 @@ function ColorPicker({
14400
14545
  }
14401
14546
 
14402
14547
  // ../../components/ui/Grid.tsx
14403
- import React43, { useId as useId7 } from "react";
14548
+ import React44, { useId as useId7 } from "react";
14404
14549
  import { Fragment as Fragment20, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
14405
14550
  var BP_MIN = {
14406
14551
  sm: 640,
@@ -14440,7 +14585,7 @@ function getVariantClasses(variant = "default", outlined) {
14440
14585
  };
14441
14586
  return variants[variant] || "";
14442
14587
  }
14443
- var GridRoot = React43.forwardRef(
14588
+ var GridRoot = React44.forwardRef(
14444
14589
  ({
14445
14590
  columns,
14446
14591
  rows,
@@ -14524,7 +14669,7 @@ var GridRoot = React43.forwardRef(
14524
14669
  }
14525
14670
  );
14526
14671
  GridRoot.displayName = "Grid";
14527
- var GridItem = React43.forwardRef(
14672
+ var GridItem = React44.forwardRef(
14528
14673
  ({
14529
14674
  colSpan,
14530
14675
  rowSpan,
@@ -14588,19 +14733,19 @@ var Grid = Object.assign(GridRoot, { Item: GridItem });
14588
14733
  var Grid_default = Grid;
14589
14734
 
14590
14735
  // ../../components/ui/LineChart.tsx
14591
- import { useMemo as useMemo14, useState as useState37, useRef as useRef16 } from "react";
14736
+ import { useMemo as useMemo15, useState as useState38, useRef as useRef16 } from "react";
14592
14737
 
14593
14738
  // ../../components/ui/ChartTooltip.tsx
14594
- import { useEffect as useEffect23, useState as useState36 } from "react";
14739
+ import { useEffect as useEffect24, useState as useState37 } from "react";
14595
14740
  import { createPortal as createPortal6 } from "react-dom";
14596
14741
  import { Fragment as Fragment21, jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
14597
14742
  function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, secondaryValue, items, containerRef }) {
14598
- const [isMounted, setIsMounted] = useState36(false);
14599
- const [position, setPosition] = useState36(null);
14600
- useEffect23(() => {
14743
+ const [isMounted, setIsMounted] = useState37(false);
14744
+ const [position, setPosition] = useState37(null);
14745
+ useEffect24(() => {
14601
14746
  setIsMounted(true);
14602
14747
  }, []);
14603
- useEffect23(() => {
14748
+ useEffect24(() => {
14604
14749
  if (visible && containerRef?.current) {
14605
14750
  const rect = containerRef.current.getBoundingClientRect();
14606
14751
  setPosition({
@@ -14686,8 +14831,8 @@ function LineChart({
14686
14831
  const padding = { top: 20, right: 20, bottom: 40, left: 40 };
14687
14832
  const chartWidth = width - padding.left - padding.right;
14688
14833
  const chartHeight = height - padding.top - padding.bottom;
14689
- const [hoveredPoint, setHoveredPoint] = useState37(null);
14690
- const { minValue, maxValue, points, linePath, areaPath } = useMemo14(() => {
14834
+ const [hoveredPoint, setHoveredPoint] = useState38(null);
14835
+ const { minValue, maxValue, points, linePath, areaPath } = useMemo15(() => {
14691
14836
  if (!data.length) return { minValue: 0, maxValue: 0, points: [], linePath: "", areaPath: "" };
14692
14837
  const values = data.map((d) => d.value);
14693
14838
  const min = Math.min(...values);
@@ -14722,7 +14867,7 @@ function LineChart({
14722
14867
  }
14723
14868
  return { minValue: min, maxValue: max, points: pts, linePath: path, areaPath: area };
14724
14869
  }, [data, chartWidth, chartHeight, curved, padding.left, padding.top]);
14725
- const gridLines = useMemo14(() => {
14870
+ const gridLines = useMemo15(() => {
14726
14871
  const lines = [];
14727
14872
  const steps = 5;
14728
14873
  for (let i = 0; i <= steps; i++) {
@@ -14840,7 +14985,7 @@ function LineChart({
14840
14985
  }
14841
14986
 
14842
14987
  // ../../components/ui/BarChart.tsx
14843
- import { useMemo as useMemo15, useState as useState38, useRef as useRef17 } from "react";
14988
+ import { useMemo as useMemo16, useState as useState39, useRef as useRef17 } from "react";
14844
14989
  import { Fragment as Fragment23, jsx as jsx54, jsxs as jsxs49 } from "react/jsx-runtime";
14845
14990
  function BarChart({
14846
14991
  data,
@@ -14860,8 +15005,8 @@ function BarChart({
14860
15005
  const padding = horizontal ? { top: 20, right: 40, bottom: 20, left: 80 } : { top: 20, right: 20, bottom: 40, left: 40 };
14861
15006
  const chartWidth = width - padding.left - padding.right;
14862
15007
  const chartHeight = height - padding.top - padding.bottom;
14863
- const [hoveredBar, setHoveredBar] = useState38(null);
14864
- const { maxValue, bars, gridLines } = useMemo15(() => {
15008
+ const [hoveredBar, setHoveredBar] = useState39(null);
15009
+ const { maxValue, bars, gridLines } = useMemo16(() => {
14865
15010
  if (!data.length) return { maxValue: 0, bars: [], gridLines: [] };
14866
15011
  const max = Math.max(...data.map((d) => d.value));
14867
15012
  const barCount = data.length;
@@ -15022,7 +15167,7 @@ function BarChart({
15022
15167
  }
15023
15168
 
15024
15169
  // ../../components/ui/PieChart.tsx
15025
- import { useMemo as useMemo16, useState as useState39, useRef as useRef18 } from "react";
15170
+ import { useMemo as useMemo17, useState as useState40, useRef as useRef18 } from "react";
15026
15171
  import { jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
15027
15172
  function PieChart({
15028
15173
  data,
@@ -15040,7 +15185,7 @@ function PieChart({
15040
15185
  const center = size / 2;
15041
15186
  const radius = size / 2 - 10;
15042
15187
  const innerRadius = donut ? radius - donutWidth : 0;
15043
- const { segments, total } = useMemo16(() => {
15188
+ const { segments, total } = useMemo17(() => {
15044
15189
  if (!data.length) return { segments: [], total: 0 };
15045
15190
  const sum = data.reduce((acc, d) => acc + d.value, 0);
15046
15191
  let currentAngle = startAngle;
@@ -15086,7 +15231,7 @@ function PieChart({
15086
15231
  });
15087
15232
  return { segments: segs, total: sum };
15088
15233
  }, [data, center, radius, innerRadius, donut, startAngle]);
15089
- const [hoveredSegment, setHoveredSegment] = useState39(null);
15234
+ const [hoveredSegment, setHoveredSegment] = useState40(null);
15090
15235
  return /* @__PURE__ */ jsxs50("div", { ref: containerRef, className: `relative flex items-center gap-6 ${className}`, children: [
15091
15236
  /* @__PURE__ */ jsxs50("svg", { width: size + 40, height: size + 40, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
15092
15237
  /* @__PURE__ */ jsxs50("g", { transform: `translate(20, 20)`, children: [
@@ -15187,7 +15332,7 @@ function PieChart({
15187
15332
  }
15188
15333
 
15189
15334
  // ../../components/ui/AreaChart.tsx
15190
- import { useMemo as useMemo17, useState as useState40, useRef as useRef19 } from "react";
15335
+ import { useMemo as useMemo18, useState as useState41, useRef as useRef19 } from "react";
15191
15336
  import { jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
15192
15337
  function getCatmullRomSpline(points) {
15193
15338
  if (points.length < 2) return "";
@@ -15226,8 +15371,8 @@ function AreaChart({
15226
15371
  const padding = { top: 20, right: 20, bottom: 40, left: 50 };
15227
15372
  const chartWidth = width - padding.left - padding.right;
15228
15373
  const chartHeight = height - padding.top - padding.bottom;
15229
- const [hoveredPoint, setHoveredPoint] = useState40(null);
15230
- const { processedSeries, gridLines, maxValue, labels } = useMemo17(() => {
15374
+ const [hoveredPoint, setHoveredPoint] = useState41(null);
15375
+ const { processedSeries, gridLines, maxValue, labels } = useMemo18(() => {
15231
15376
  if (!series.length || !series[0]?.data?.length) {
15232
15377
  return { processedSeries: [], gridLines: [], maxValue: 0, labels: [] };
15233
15378
  }
@@ -15441,7 +15586,7 @@ function AreaChart({
15441
15586
  }
15442
15587
 
15443
15588
  // ../../components/ui/Sparkline.tsx
15444
- import { useMemo as useMemo18 } from "react";
15589
+ import { useMemo as useMemo19 } from "react";
15445
15590
  import { jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
15446
15591
  function getCatmullRomSpline2(points) {
15447
15592
  if (points.length < 2) return "";
@@ -15480,7 +15625,7 @@ function Sparkline({
15480
15625
  const padding = 4;
15481
15626
  const chartWidth = width - padding * 2;
15482
15627
  const chartHeight = height - padding * 2;
15483
- const { points, linePath, areaPath, lineLength, trend } = useMemo18(() => {
15628
+ const { points, linePath, areaPath, lineLength, trend } = useMemo19(() => {
15484
15629
  const normalizedData = data.map((d) => typeof d === "number" ? d : d.value);
15485
15630
  if (!normalizedData.length) {
15486
15631
  return { points: [], linePath: "", areaPath: "", lineLength: 0, trend: 0 };
@@ -15584,7 +15729,7 @@ function Sparkline({
15584
15729
  }
15585
15730
 
15586
15731
  // ../../components/ui/RadarChart.tsx
15587
- import { useMemo as useMemo19, useState as useState41, useRef as useRef20 } from "react";
15732
+ import { useMemo as useMemo20, useState as useState42, useRef as useRef20 } from "react";
15588
15733
  import { jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
15589
15734
  function RadarChart({
15590
15735
  series,
@@ -15599,8 +15744,8 @@ function RadarChart({
15599
15744
  const containerRef = useRef20(null);
15600
15745
  const center = size / 2;
15601
15746
  const radius = size / 2 - 40;
15602
- const [hoveredPoint, setHoveredPoint] = useState41(null);
15603
- const { axes, processedSeries, levelPaths } = useMemo19(() => {
15747
+ const [hoveredPoint, setHoveredPoint] = useState42(null);
15748
+ const { axes, processedSeries, levelPaths } = useMemo20(() => {
15604
15749
  if (!series.length || !series[0]?.data?.length) {
15605
15750
  return { axes: [], processedSeries: [], levelPaths: [] };
15606
15751
  }
@@ -15784,7 +15929,7 @@ function RadarChart({
15784
15929
  }
15785
15930
 
15786
15931
  // ../../components/ui/GaugeChart.tsx
15787
- import { useMemo as useMemo20 } from "react";
15932
+ import { useMemo as useMemo21 } from "react";
15788
15933
  import { jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
15789
15934
  function GaugeChart({
15790
15935
  value,
@@ -15804,7 +15949,7 @@ function GaugeChart({
15804
15949
  }) {
15805
15950
  const center = size / 2;
15806
15951
  const radius = center - thickness / 2 - 10;
15807
- const { backgroundPath, valuePath, percentage, needleAngle } = useMemo20(() => {
15952
+ const { backgroundPath, valuePath, percentage, needleAngle } = useMemo21(() => {
15808
15953
  const normalizedValue = Math.min(Math.max(value, min), max);
15809
15954
  const pct = (normalizedValue - min) / (max - min);
15810
15955
  const totalAngle = endAngle - startAngle;
@@ -15952,11 +16097,11 @@ function GaugeChart({
15952
16097
  }
15953
16098
 
15954
16099
  // ../../components/ui/ClientOnly.tsx
15955
- import { useEffect as useEffect24, useState as useState42 } from "react";
16100
+ import { useEffect as useEffect25, useState as useState43 } from "react";
15956
16101
  import { Fragment as Fragment24, jsx as jsx60 } from "react/jsx-runtime";
15957
16102
  function ClientOnly({ children, fallback = null }) {
15958
- const [hasMounted, setHasMounted] = useState42(false);
15959
- useEffect24(() => {
16103
+ const [hasMounted, setHasMounted] = useState43(false);
16104
+ useEffect25(() => {
15960
16105
  setHasMounted(true);
15961
16106
  }, []);
15962
16107
  if (!hasMounted) {
@@ -16052,9 +16197,9 @@ var LoadingBar = ({
16052
16197
  };
16053
16198
 
16054
16199
  // ../../components/ui/Table.tsx
16055
- import React52 from "react";
16200
+ import React53 from "react";
16056
16201
  import { jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
16057
- var Table = React52.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx62(
16202
+ var Table = React53.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx62(
16058
16203
  "div",
16059
16204
  {
16060
16205
  className: cn(
@@ -16068,16 +16213,16 @@ var Table = React52.forwardRef(({ className, containerClassName, ...props }, ref
16068
16213
  }
16069
16214
  ));
16070
16215
  Table.displayName = "Table";
16071
- var TableHeader = React52.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs56("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border", "bg-muted", className), ...props, children: [
16216
+ var TableHeader = React53.forwardRef(({ className, children, filterRow, ...props }, ref) => /* @__PURE__ */ jsxs56("thead", { ref, className: cn("[&_tr]:border-b [&_tr]:border-border", "bg-muted", className), ...props, children: [
16072
16217
  children,
16073
16218
  filterRow
16074
16219
  ] }));
16075
16220
  TableHeader.displayName = "TableHeader";
16076
- var TableBody = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
16221
+ var TableBody = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
16077
16222
  TableBody.displayName = "TableBody";
16078
- var TableFooter = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
16223
+ var TableFooter = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
16079
16224
  TableFooter.displayName = "TableFooter";
16080
- var TableRow = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
16225
+ var TableRow = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
16081
16226
  "tr",
16082
16227
  {
16083
16228
  ref,
@@ -16091,7 +16236,7 @@ var TableRow = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__
16091
16236
  }
16092
16237
  ));
16093
16238
  TableRow.displayName = "TableRow";
16094
- var TableHead = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
16239
+ var TableHead = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
16095
16240
  "th",
16096
16241
  {
16097
16242
  ref,
@@ -16100,14 +16245,14 @@ var TableHead = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE_
16100
16245
  }
16101
16246
  ));
16102
16247
  TableHead.displayName = "TableHead";
16103
- var TableCell = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props }));
16248
+ var TableCell = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props }));
16104
16249
  TableCell.displayName = "TableCell";
16105
- var TableCaption = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
16250
+ var TableCaption = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
16106
16251
  TableCaption.displayName = "TableCaption";
16107
16252
 
16108
16253
  // ../../components/ui/DataTable/DataTable.tsx
16109
16254
  import { Filter as FilterIcon } from "lucide-react";
16110
- import React56 from "react";
16255
+ import React57 from "react";
16111
16256
 
16112
16257
  // ../../components/ui/DataTable/components/Pagination.tsx
16113
16258
  import { jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
@@ -16381,10 +16526,10 @@ function DataTableToolbar({
16381
16526
  }
16382
16527
 
16383
16528
  // ../../components/ui/DataTable/hooks/useDebounced.ts
16384
- import React53 from "react";
16529
+ import React54 from "react";
16385
16530
  function useDebounced(value, delay = 300) {
16386
- const [debounced, setDebounced] = React53.useState(value);
16387
- React53.useEffect(() => {
16531
+ const [debounced, setDebounced] = React54.useState(value);
16532
+ React54.useEffect(() => {
16388
16533
  const id = setTimeout(() => setDebounced(value), delay);
16389
16534
  return () => clearTimeout(id);
16390
16535
  }, [value, delay]);
@@ -16392,10 +16537,10 @@ function useDebounced(value, delay = 300) {
16392
16537
  }
16393
16538
 
16394
16539
  // ../../components/ui/DataTable/hooks/usePageSizeStorage.ts
16395
- import React54 from "react";
16540
+ import React55 from "react";
16396
16541
  function usePageSizeStorage({ pageSize, storageKey }) {
16397
- const loadedFromStorage = React54.useRef(false);
16398
- const [curPageSize, setCurPageSize] = React54.useState(() => {
16542
+ const loadedFromStorage = React55.useRef(false);
16543
+ const [curPageSize, setCurPageSize] = React55.useState(() => {
16399
16544
  if (typeof window === "undefined" || !storageKey) return pageSize;
16400
16545
  try {
16401
16546
  const saved = localStorage.getItem(`datatable_${storageKey}_pageSize`);
@@ -16410,11 +16555,11 @@ function usePageSizeStorage({ pageSize, storageKey }) {
16410
16555
  }
16411
16556
  return pageSize;
16412
16557
  });
16413
- const hasMounted = React54.useRef(false);
16414
- React54.useEffect(() => {
16558
+ const hasMounted = React55.useRef(false);
16559
+ React55.useEffect(() => {
16415
16560
  hasMounted.current = true;
16416
16561
  }, []);
16417
- React54.useEffect(() => {
16562
+ React55.useEffect(() => {
16418
16563
  if (typeof window === "undefined" || !storageKey) return;
16419
16564
  if (!hasMounted.current) return;
16420
16565
  try {
@@ -16422,7 +16567,7 @@ function usePageSizeStorage({ pageSize, storageKey }) {
16422
16567
  } catch {
16423
16568
  }
16424
16569
  }, [curPageSize, storageKey]);
16425
- React54.useEffect(() => {
16570
+ React55.useEffect(() => {
16426
16571
  if (storageKey && loadedFromStorage.current) return;
16427
16572
  setCurPageSize(pageSize);
16428
16573
  }, [pageSize, storageKey]);
@@ -16430,7 +16575,7 @@ function usePageSizeStorage({ pageSize, storageKey }) {
16430
16575
  }
16431
16576
 
16432
16577
  // ../../components/ui/DataTable/hooks/useStickyColumns.ts
16433
- import React55 from "react";
16578
+ import React56 from "react";
16434
16579
 
16435
16580
  // ../../components/ui/DataTable/utils/columns.ts
16436
16581
  function getColumnWidth(col, fallback = 150) {
@@ -16448,9 +16593,9 @@ function getColumnWidth(col, fallback = 150) {
16448
16593
 
16449
16594
  // ../../components/ui/DataTable/hooks/useStickyColumns.ts
16450
16595
  function useStickyColumns(columns, visibleKeys) {
16451
- const visibleColumns = React55.useMemo(() => filterVisibleColumns(columns, visibleKeys), [columns, visibleKeys]);
16452
- const leafColumns = React55.useMemo(() => getLeafColumnsWithFixedInheritance(visibleColumns), [visibleColumns]);
16453
- const stickyPositions = React55.useMemo(() => {
16596
+ const visibleColumns = React56.useMemo(() => filterVisibleColumns(columns, visibleKeys), [columns, visibleKeys]);
16597
+ const leafColumns = React56.useMemo(() => getLeafColumnsWithFixedInheritance(visibleColumns), [visibleColumns]);
16598
+ const stickyPositions = React56.useMemo(() => {
16454
16599
  const positions = {};
16455
16600
  let leftOffset = 0;
16456
16601
  for (const col of leafColumns) {
@@ -16469,7 +16614,7 @@ function useStickyColumns(columns, visibleKeys) {
16469
16614
  }
16470
16615
  return positions;
16471
16616
  }, [leafColumns]);
16472
- const getStickyColumnStyle = React55.useCallback(
16617
+ const getStickyColumnStyle = React56.useCallback(
16473
16618
  (col) => {
16474
16619
  if (!col.fixed) return {};
16475
16620
  const pos = stickyPositions[col.key];
@@ -16480,7 +16625,7 @@ function useStickyColumns(columns, visibleKeys) {
16480
16625
  },
16481
16626
  [stickyPositions]
16482
16627
  );
16483
- const getStickyHeaderClass = React55.useCallback((col) => {
16628
+ const getStickyHeaderClass = React56.useCallback((col) => {
16484
16629
  if (!col.fixed) return "";
16485
16630
  return cn(
16486
16631
  "sticky",
@@ -16489,7 +16634,7 @@ function useStickyColumns(columns, visibleKeys) {
16489
16634
  "z-50 bg-muted!"
16490
16635
  );
16491
16636
  }, []);
16492
- const getStickyCellClass = React55.useCallback((col, isStripedRow) => {
16637
+ const getStickyCellClass = React56.useCallback((col, isStripedRow) => {
16493
16638
  if (!col.fixed) return "";
16494
16639
  return cn(
16495
16640
  "sticky z-10",
@@ -16498,7 +16643,7 @@ function useStickyColumns(columns, visibleKeys) {
16498
16643
  isStripedRow ? "bg-muted!" : "bg-card!"
16499
16644
  );
16500
16645
  }, []);
16501
- const getStickyHeaderCellStyle = React55.useCallback(
16646
+ const getStickyHeaderCellStyle = React56.useCallback(
16502
16647
  (headerCell) => {
16503
16648
  const col = headerCell.column;
16504
16649
  if (headerCell.isLeaf) {
@@ -16629,20 +16774,20 @@ function DataTable({
16629
16774
  labels
16630
16775
  }) {
16631
16776
  const t = useTranslations("Common");
16632
- const [headerAlign, setHeaderAlign] = React56.useState("left");
16633
- const [visibleCols, setVisibleCols] = React56.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
16634
- const [filters, setFilters] = React56.useState({});
16635
- const [sort, setSort] = React56.useState(null);
16636
- const [density, setDensity] = React56.useState("normal");
16637
- const [curPage, setCurPage] = React56.useState(page);
16777
+ const [headerAlign, setHeaderAlign] = React57.useState("left");
16778
+ const [visibleCols, setVisibleCols] = React57.useState(() => columns.filter((c) => c.visible !== false).map((c) => c.key));
16779
+ const [filters, setFilters] = React57.useState({});
16780
+ const [sort, setSort] = React57.useState(null);
16781
+ const [density, setDensity] = React57.useState("normal");
16782
+ const [curPage, setCurPage] = React57.useState(page);
16638
16783
  const { curPageSize, setCurPageSize } = usePageSizeStorage({ pageSize, storageKey });
16639
- React56.useEffect(() => {
16784
+ React57.useEffect(() => {
16640
16785
  if (process.env.NODE_ENV === "development") {
16641
16786
  const warnings = validateColumns(columns);
16642
16787
  warnings.forEach((w) => console.warn(`[DataTable] ${w}`));
16643
16788
  }
16644
16789
  }, [columns]);
16645
- React56.useEffect(() => {
16790
+ React57.useEffect(() => {
16646
16791
  const newColKeys = columns.filter((c) => c.visible !== false).map((c) => c.key);
16647
16792
  setVisibleCols((prev) => {
16648
16793
  const uniqueKeys = /* @__PURE__ */ new Set([...prev, ...newColKeys]);
@@ -16650,12 +16795,12 @@ function DataTable({
16650
16795
  });
16651
16796
  }, [columns]);
16652
16797
  const debouncedFilters = useDebounced(filters, 350);
16653
- React56.useEffect(() => {
16798
+ React57.useEffect(() => {
16654
16799
  setCurPage(page);
16655
16800
  }, [page]);
16656
16801
  const isServerMode = Boolean(onQueryChange);
16657
- const hasEmittedQuery = React56.useRef(false);
16658
- React56.useEffect(() => {
16802
+ const hasEmittedQuery = React57.useRef(false);
16803
+ React57.useEffect(() => {
16659
16804
  if (!onQueryChange) return;
16660
16805
  if (!hasEmittedQuery.current) {
16661
16806
  hasEmittedQuery.current = true;
@@ -16665,14 +16810,14 @@ function DataTable({
16665
16810
  }, [debouncedFilters, sort, curPage, curPageSize, onQueryChange]);
16666
16811
  const densityRowClass = density === "compact" ? "h-9" : density === "comfortable" ? "h-14" : "h-12";
16667
16812
  const cellPadding = density === "compact" ? "py-1.5 px-3" : density === "comfortable" ? "py-3 px-4" : "py-2.5 px-4";
16668
- const visibleColsSet = React56.useMemo(() => new Set(visibleCols), [visibleCols]);
16669
- const visibleColumns = React56.useMemo(() => {
16813
+ const visibleColsSet = React57.useMemo(() => new Set(visibleCols), [visibleCols]);
16814
+ const visibleColumns = React57.useMemo(() => {
16670
16815
  return filterVisibleColumns(columns, visibleColsSet);
16671
16816
  }, [columns, visibleColsSet]);
16672
- const leafColumns = React56.useMemo(() => {
16817
+ const leafColumns = React57.useMemo(() => {
16673
16818
  return getLeafColumns(visibleColumns);
16674
16819
  }, [visibleColumns]);
16675
- const totalColumnsWidth = React56.useMemo(() => {
16820
+ const totalColumnsWidth = React57.useMemo(() => {
16676
16821
  return leafColumns.reduce((sum, col) => sum + getColumnWidth(col), 0);
16677
16822
  }, [leafColumns]);
16678
16823
  const { getStickyCellClass, getStickyColumnStyle, getStickyHeaderClass, getStickyHeaderCellStyle } = useStickyColumns(
@@ -16734,7 +16879,7 @@ function DataTable({
16734
16879
  }
16735
16880
  return null;
16736
16881
  };
16737
- const headerRows = React56.useMemo(() => buildHeaderRows(visibleColumns), [visibleColumns]);
16882
+ const headerRows = React57.useMemo(() => buildHeaderRows(visibleColumns), [visibleColumns]);
16738
16883
  const renderHeaderContent = (col, isLeaf) => {
16739
16884
  if (!isLeaf) {
16740
16885
  return /* @__PURE__ */ jsx65(
@@ -16878,7 +17023,7 @@ function DataTable({
16878
17023
  col.key
16879
17024
  );
16880
17025
  }) }, `header-row-${rowIndex}`)) });
16881
- const processedData = React56.useMemo(() => {
17026
+ const processedData = React57.useMemo(() => {
16882
17027
  if (isServerMode) return data;
16883
17028
  let result = [...data];
16884
17029
  if (Object.keys(filters).length > 0) {
@@ -16910,7 +17055,7 @@ function DataTable({
16910
17055
  return result;
16911
17056
  }, [data, isServerMode, filters, sort, columns]);
16912
17057
  const totalItems = isServerMode ? total : processedData.length;
16913
- const displayedData = isServerMode ? data : React56.useMemo(() => {
17058
+ const displayedData = isServerMode ? data : React57.useMemo(() => {
16914
17059
  const start = (curPage - 1) * curPageSize;
16915
17060
  return processedData.slice(start, start + curPageSize);
16916
17061
  }, [processedData, curPage, curPageSize]);
@@ -17029,10 +17174,10 @@ function DataTable({
17029
17174
  var DataTable_default = DataTable;
17030
17175
 
17031
17176
  // ../../components/ui/Form.tsx
17032
- import * as React57 from "react";
17177
+ import * as React58 from "react";
17033
17178
  import { Controller, FormProvider, useFormContext, useForm } from "react-hook-form";
17034
17179
  import { jsx as jsx66, jsxs as jsxs60 } from "react/jsx-runtime";
17035
- var FormConfigContext = React57.createContext({ size: "md" });
17180
+ var FormConfigContext = React58.createContext({ size: "md" });
17036
17181
  var FormWrapper = ({
17037
17182
  children,
17038
17183
  onSubmit,
@@ -17045,7 +17190,7 @@ var FormWrapper = ({
17045
17190
  const methods = useForm({
17046
17191
  defaultValues: initialValues
17047
17192
  });
17048
- React57.useEffect(() => {
17193
+ React58.useEffect(() => {
17049
17194
  if (initialValues) {
17050
17195
  methods.reset(initialValues);
17051
17196
  }
@@ -17054,15 +17199,15 @@ var FormWrapper = ({
17054
17199
  return /* @__PURE__ */ jsx66(FormProvider, { ...methods, children: /* @__PURE__ */ jsx66(FormConfigContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx66("form", { onSubmit: methods.handleSubmit(onSubmit), className, ...formProps, children }) }) });
17055
17200
  };
17056
17201
  var Form = FormWrapper;
17057
- var FormFieldContext = React57.createContext({});
17202
+ var FormFieldContext = React58.createContext({});
17058
17203
  var FormField = ({
17059
17204
  ...props
17060
17205
  }) => {
17061
17206
  return /* @__PURE__ */ jsx66(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx66(Controller, { ...props }) });
17062
17207
  };
17063
17208
  var useFormField = () => {
17064
- const fieldContext = React57.useContext(FormFieldContext);
17065
- const itemContext = React57.useContext(FormItemContext);
17209
+ const fieldContext = React58.useContext(FormFieldContext);
17210
+ const itemContext = React58.useContext(FormItemContext);
17066
17211
  const { getFieldState, formState } = useFormContext();
17067
17212
  if (!fieldContext) {
17068
17213
  try {
@@ -17083,16 +17228,16 @@ var useFormField = () => {
17083
17228
  ...fieldState
17084
17229
  };
17085
17230
  };
17086
- var FormItemContext = React57.createContext({});
17087
- var FormItem = React57.forwardRef(({ className, ...props }, ref) => {
17088
- const id = React57.useId();
17231
+ var FormItemContext = React58.createContext({});
17232
+ var FormItem = React58.forwardRef(({ className, ...props }, ref) => {
17233
+ const id = React58.useId();
17089
17234
  return /* @__PURE__ */ jsx66(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx66("div", { ref, className: cn("space-y-2", className), ...props }) });
17090
17235
  });
17091
17236
  FormItem.displayName = "FormItem";
17092
- var FormLabel = React57.forwardRef(
17237
+ var FormLabel = React58.forwardRef(
17093
17238
  ({ className, children, required, ...props }, ref) => {
17094
17239
  const { error, formItemId } = useFormField();
17095
- const config = React57.useContext(FormConfigContext);
17240
+ const config = React58.useContext(FormConfigContext);
17096
17241
  const sizeClass = config.size === "sm" ? "text-xs" : config.size === "lg" ? "text-base" : "text-sm";
17097
17242
  return /* @__PURE__ */ jsxs60(Label, { ref, className: cn(sizeClass, error && "text-destructive", className), htmlFor: formItemId, ...props, children: [
17098
17243
  children,
@@ -17101,7 +17246,7 @@ var FormLabel = React57.forwardRef(
17101
17246
  }
17102
17247
  );
17103
17248
  FormLabel.displayName = "FormLabel";
17104
- var FormControl = React57.forwardRef(({ ...props }, ref) => {
17249
+ var FormControl = React58.forwardRef(({ ...props }, ref) => {
17105
17250
  const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
17106
17251
  return /* @__PURE__ */ jsx66(
17107
17252
  "div",
@@ -17115,12 +17260,12 @@ var FormControl = React57.forwardRef(({ ...props }, ref) => {
17115
17260
  );
17116
17261
  });
17117
17262
  FormControl.displayName = "FormControl";
17118
- var FormDescription = React57.forwardRef(({ className, ...props }, ref) => {
17263
+ var FormDescription = React58.forwardRef(({ className, ...props }, ref) => {
17119
17264
  const { formDescriptionId } = useFormField();
17120
17265
  return /* @__PURE__ */ jsx66("p", { ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props });
17121
17266
  });
17122
17267
  FormDescription.displayName = "FormDescription";
17123
- var FormMessage = React57.forwardRef(({ className, children, ...props }, ref) => {
17268
+ var FormMessage = React58.forwardRef(({ className, children, ...props }, ref) => {
17124
17269
  const { error, formMessageId } = useFormField();
17125
17270
  const body = error ? String(error?.message) : children;
17126
17271
  if (!body) {
@@ -17129,7 +17274,7 @@ var FormMessage = React57.forwardRef(({ className, children, ...props }, ref) =>
17129
17274
  return /* @__PURE__ */ jsx66("p", { ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body });
17130
17275
  });
17131
17276
  FormMessage.displayName = "FormMessage";
17132
- var FormInput = React57.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx66(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx66(
17277
+ var FormInput = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx66(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx66(
17133
17278
  FormField,
17134
17279
  {
17135
17280
  name,
@@ -17140,7 +17285,7 @@ var FormInput = React57.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */
17140
17285
  }
17141
17286
  ) }));
17142
17287
  FormInput.displayName = "FormInput";
17143
- var FormCheckbox = React57.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx66(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx66(
17288
+ var FormCheckbox = React58.forwardRef(({ name, ...props }, ref) => /* @__PURE__ */ jsx66(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx66(
17144
17289
  FormField,
17145
17290
  {
17146
17291
  name,
@@ -17164,9 +17309,9 @@ var FormCheckbox = React57.forwardRef(({ name, ...props }, ref) => /* @__PURE__
17164
17309
  }
17165
17310
  ) }));
17166
17311
  FormCheckbox.displayName = "FormCheckbox";
17167
- var FormActions = React57.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
17312
+ var FormActions = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx66("div", { ref, className: cn("flex gap-2 justify-end", className), ...props }));
17168
17313
  FormActions.displayName = "FormActions";
17169
- var FormSubmitButton = React57.forwardRef(
17314
+ var FormSubmitButton = React58.forwardRef(
17170
17315
  ({ children, loading: loading2, ...props }, ref) => /* @__PURE__ */ jsx66(FormConfigContext.Consumer, { children: ({ size }) => /* @__PURE__ */ jsx66(Button_default, { ref, type: "submit", size: props.size ?? size, disabled: loading2, ...props, children }) })
17171
17316
  );
17172
17317
  FormSubmitButton.displayName = "FormSubmitButton";
@@ -17341,7 +17486,7 @@ function AccessDenied({
17341
17486
 
17342
17487
  // ../../components/ui/ThemeToggleHeadless.tsx
17343
17488
  import { Moon as Moon2, Sun as Sun2, Monitor } from "lucide-react";
17344
- import { useEffect as useEffect26, useRef as useRef21, useState as useState43 } from "react";
17489
+ import { useEffect as useEffect27, useRef as useRef21, useState as useState44 } from "react";
17345
17490
  import { createPortal as createPortal7 } from "react-dom";
17346
17491
  import { Fragment as Fragment26, jsx as jsx70, jsxs as jsxs64 } from "react/jsx-runtime";
17347
17492
  function ThemeToggleHeadless({
@@ -17350,11 +17495,11 @@ function ThemeToggleHeadless({
17350
17495
  labels,
17351
17496
  className
17352
17497
  }) {
17353
- const [isOpen, setIsOpen] = useState43(false);
17354
- const [mounted, setMounted] = useState43(false);
17498
+ const [isOpen, setIsOpen] = useState44(false);
17499
+ const [mounted, setMounted] = useState44(false);
17355
17500
  const triggerRef = useRef21(null);
17356
- const [dropdownPosition, setDropdownPosition] = useState43(null);
17357
- useEffect26(() => setMounted(true), []);
17501
+ const [dropdownPosition, setDropdownPosition] = useState44(null);
17502
+ useEffect27(() => setMounted(true), []);
17358
17503
  const themes = [
17359
17504
  { value: "light", label: labels?.light ?? "Light", icon: Sun2 },
17360
17505
  { value: "dark", label: labels?.dark ?? "Dark", icon: Moon2 },
@@ -17443,7 +17588,7 @@ function ThemeToggleHeadless({
17443
17588
  }
17444
17589
 
17445
17590
  // ../../components/ui/LanguageSwitcherHeadless.tsx
17446
- import { useRef as useRef22, useState as useState44 } from "react";
17591
+ import { useRef as useRef22, useState as useState45 } from "react";
17447
17592
  import { createPortal as createPortal8 } from "react-dom";
17448
17593
  import { Globe } from "lucide-react";
17449
17594
  import { Fragment as Fragment27, jsx as jsx71, jsxs as jsxs65 } from "react/jsx-runtime";
@@ -17454,8 +17599,8 @@ function LanguageSwitcherHeadless({
17454
17599
  labels,
17455
17600
  className
17456
17601
  }) {
17457
- const [isOpen, setIsOpen] = useState44(false);
17458
- const [dropdownPosition, setDropdownPosition] = useState44(null);
17602
+ const [isOpen, setIsOpen] = useState45(false);
17603
+ const [dropdownPosition, setDropdownPosition] = useState45(null);
17459
17604
  const triggerButtonRef = useRef22(null);
17460
17605
  const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
17461
17606
  const calculatePosition = () => {
@@ -17948,7 +18093,7 @@ var VARIANT_STYLES_ALERT = {
17948
18093
  };
17949
18094
 
17950
18095
  // src/contexts/TranslationContext.tsx
17951
- import * as React59 from "react";
18096
+ import * as React60 from "react";
17952
18097
 
17953
18098
  // locales/en.json
17954
18099
  var en_default = {
@@ -18306,9 +18451,9 @@ var defaultTranslations2 = {
18306
18451
  ko: ko_default,
18307
18452
  ja: ja_default
18308
18453
  };
18309
- var TranslationContext2 = React59.createContext(null);
18454
+ var TranslationContext2 = React60.createContext(null);
18310
18455
  var TranslationProvider = ({ children, locale = "en", translations }) => {
18311
- const t = React59.useCallback(
18456
+ const t = React60.useCallback(
18312
18457
  (namespace) => {
18313
18458
  return (key) => {
18314
18459
  const mergedTranslations = {
@@ -18336,7 +18481,7 @@ var TranslationProvider = ({ children, locale = "en", translations }) => {
18336
18481
  return /* @__PURE__ */ jsx72(TranslationContext2.Provider, { value: { locale, t }, children });
18337
18482
  };
18338
18483
  var useUnderverseTranslations = (namespace) => {
18339
- const context = React59.useContext(TranslationContext2);
18484
+ const context = React60.useContext(TranslationContext2);
18340
18485
  if (!context) {
18341
18486
  return (key) => {
18342
18487
  const parts = namespace.split(".");
@@ -18358,12 +18503,12 @@ var useUnderverseTranslations = (namespace) => {
18358
18503
  return context.t(namespace);
18359
18504
  };
18360
18505
  var useUnderverseLocale = () => {
18361
- const context = React59.useContext(TranslationContext2);
18506
+ const context = React60.useContext(TranslationContext2);
18362
18507
  return context?.locale || "en";
18363
18508
  };
18364
18509
 
18365
18510
  // src/hooks/useSmartTranslations.tsx
18366
- import * as React60 from "react";
18511
+ import * as React61 from "react";
18367
18512
  import { jsx as jsx73 } from "react/jsx-runtime";
18368
18513
  var nextIntlHooks = null;
18369
18514
  try {
@@ -18375,12 +18520,12 @@ try {
18375
18520
  } catch {
18376
18521
  nextIntlHooks = null;
18377
18522
  }
18378
- var ForceInternalContext = React60.createContext(false);
18523
+ var ForceInternalContext = React61.createContext(false);
18379
18524
  var ForceInternalTranslationsProvider = ({ children }) => {
18380
18525
  return /* @__PURE__ */ jsx73(ForceInternalContext.Provider, { value: true, children });
18381
18526
  };
18382
18527
  function useSmartTranslations(namespace) {
18383
- const forceInternal = React60.useContext(ForceInternalContext);
18528
+ const forceInternal = React61.useContext(ForceInternalContext);
18384
18529
  const internalT = useUnderverseTranslations(namespace);
18385
18530
  if (forceInternal || !nextIntlHooks?.useTranslations) {
18386
18531
  return internalT;
@@ -18393,7 +18538,7 @@ function useSmartTranslations(namespace) {
18393
18538
  }
18394
18539
  }
18395
18540
  function useSmartLocale() {
18396
- const forceInternal = React60.useContext(ForceInternalContext);
18541
+ const forceInternal = React61.useContext(ForceInternalContext);
18397
18542
  const internalLocale = useUnderverseLocale();
18398
18543
  if (forceInternal || !nextIntlHooks?.useLocale) {
18399
18544
  return internalLocale;
@@ -18407,7 +18552,7 @@ function useSmartLocale() {
18407
18552
  }
18408
18553
 
18409
18554
  // ../../components/ui/UEditor/UEditor.tsx
18410
- import { useEffect as useEffect31, useMemo as useMemo23 } from "react";
18555
+ import { useEffect as useEffect32, useMemo as useMemo24 } from "react";
18411
18556
  import { useTranslations as useTranslations7 } from "next-intl";
18412
18557
  import { useEditor, EditorContent } from "@tiptap/react";
18413
18558
 
@@ -18450,7 +18595,7 @@ import { common, createLowlight } from "lowlight";
18450
18595
  import { Extension } from "@tiptap/core";
18451
18596
  import Suggestion from "@tiptap/suggestion";
18452
18597
  import { ReactRenderer } from "@tiptap/react";
18453
- import { forwardRef as forwardRef13, useEffect as useEffect27, useImperativeHandle, useRef as useRef23, useState as useState45 } from "react";
18598
+ import { forwardRef as forwardRef13, useEffect as useEffect28, useImperativeHandle, useRef as useRef23, useState as useState46 } from "react";
18454
18599
  import {
18455
18600
  FileCode,
18456
18601
  Heading1,
@@ -18467,12 +18612,12 @@ import {
18467
18612
  import tippy from "tippy.js";
18468
18613
  import { jsx as jsx74, jsxs as jsxs66 } from "react/jsx-runtime";
18469
18614
  var CommandList = forwardRef13((props, ref) => {
18470
- const [selectedIndex, setSelectedIndex] = useState45(0);
18615
+ const [selectedIndex, setSelectedIndex] = useState46(0);
18471
18616
  const listRef = useRef23(null);
18472
- useEffect27(() => {
18617
+ useEffect28(() => {
18473
18618
  setSelectedIndex(0);
18474
18619
  }, [props.items]);
18475
- useEffect27(() => {
18620
+ useEffect28(() => {
18476
18621
  const selectedElement = listRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
18477
18622
  selectedElement?.scrollIntoView({ block: "nearest" });
18478
18623
  }, [selectedIndex, props.items]);
@@ -18781,7 +18926,7 @@ var ClipboardImages = Extension2.create({
18781
18926
  });
18782
18927
 
18783
18928
  // ../../components/ui/UEditor/resizable-image.tsx
18784
- import { useEffect as useEffect28, useRef as useRef24, useState as useState46 } from "react";
18929
+ import { useEffect as useEffect29, useRef as useRef24, useState as useState47 } from "react";
18785
18930
  import Image3 from "@tiptap/extension-image";
18786
18931
  import { mergeAttributes } from "@tiptap/core";
18787
18932
  import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
@@ -18803,13 +18948,13 @@ function ResizableImageNodeView(props) {
18803
18948
  const { node, selected, updateAttributes, editor, getPos } = props;
18804
18949
  const wrapperRef = useRef24(null);
18805
18950
  const imgRef = useRef24(null);
18806
- const [isHovered, setIsHovered] = useState46(false);
18807
- const [isResizing, setIsResizing] = useState46(false);
18951
+ const [isHovered, setIsHovered] = useState47(false);
18952
+ const [isResizing, setIsResizing] = useState47(false);
18808
18953
  const widthAttr = toNullableNumber(node.attrs["width"]);
18809
18954
  const heightAttr = toNullableNumber(node.attrs["height"]);
18810
18955
  const textAlign = String(node.attrs["textAlign"] ?? "");
18811
18956
  const dragStateRef = useRef24(null);
18812
- useEffect28(() => {
18957
+ useEffect29(() => {
18813
18958
  const img = imgRef.current;
18814
18959
  if (!img) return;
18815
18960
  img.style.width = widthAttr ? `${widthAttr}px` : "";
@@ -19101,7 +19246,7 @@ function buildUEditorExtensions({
19101
19246
  }
19102
19247
 
19103
19248
  // ../../components/ui/UEditor/toolbar.tsx
19104
- import React65, { useRef as useRef26, useState as useState48 } from "react";
19249
+ import React66, { useRef as useRef26, useState as useState49 } from "react";
19105
19250
  import { useTranslations as useTranslations4 } from "next-intl";
19106
19251
  import {
19107
19252
  AlignCenter,
@@ -19139,13 +19284,13 @@ import {
19139
19284
  } from "lucide-react";
19140
19285
 
19141
19286
  // ../../components/ui/UEditor/colors.tsx
19142
- import { useMemo as useMemo21 } from "react";
19287
+ import { useMemo as useMemo22 } from "react";
19143
19288
  import { useTranslations as useTranslations2 } from "next-intl";
19144
19289
  import { X as X14 } from "lucide-react";
19145
19290
  import { jsx as jsx76, jsxs as jsxs68 } from "react/jsx-runtime";
19146
19291
  var useEditorColors = () => {
19147
19292
  const t = useTranslations2("UEditor");
19148
- const textColors = useMemo21(
19293
+ const textColors = useMemo22(
19149
19294
  () => [
19150
19295
  { name: t("colors.default"), color: "inherit", cssClass: "text-foreground" },
19151
19296
  { name: t("colors.muted"), color: "var(--muted-foreground)", cssClass: "text-muted-foreground" },
@@ -19158,7 +19303,7 @@ var useEditorColors = () => {
19158
19303
  ],
19159
19304
  [t]
19160
19305
  );
19161
- const highlightColors = useMemo21(
19306
+ const highlightColors = useMemo22(
19162
19307
  () => [
19163
19308
  { name: t("colors.default"), color: "", cssClass: "" },
19164
19309
  { name: t("colors.muted"), color: "var(--muted)", cssClass: "bg-muted" },
@@ -19203,7 +19348,7 @@ var EditorColorPalette = ({
19203
19348
  ] });
19204
19349
 
19205
19350
  // ../../components/ui/UEditor/inputs.tsx
19206
- import { useEffect as useEffect29, useRef as useRef25, useState as useState47 } from "react";
19351
+ import { useEffect as useEffect30, useRef as useRef25, useState as useState48 } from "react";
19207
19352
  import { useTranslations as useTranslations3 } from "next-intl";
19208
19353
  import { Check as Check9, X as X15 } from "lucide-react";
19209
19354
  import { jsx as jsx77, jsxs as jsxs69 } from "react/jsx-runtime";
@@ -19220,9 +19365,9 @@ var LinkInput = ({
19220
19365
  initialUrl = ""
19221
19366
  }) => {
19222
19367
  const t = useTranslations3("UEditor");
19223
- const [url, setUrl] = useState47(initialUrl);
19368
+ const [url, setUrl] = useState48(initialUrl);
19224
19369
  const inputRef = useRef25(null);
19225
- useEffect29(() => {
19370
+ useEffect30(() => {
19226
19371
  inputRef.current?.focus();
19227
19372
  inputRef.current?.select();
19228
19373
  }, []);
@@ -19249,10 +19394,10 @@ var LinkInput = ({
19249
19394
  };
19250
19395
  var ImageInput = ({ onSubmit, onCancel }) => {
19251
19396
  const t = useTranslations3("UEditor");
19252
- const [url, setUrl] = useState47("");
19253
- const [alt, setAlt] = useState47("");
19397
+ const [url, setUrl] = useState48("");
19398
+ const [alt, setAlt] = useState48("");
19254
19399
  const inputRef = useRef25(null);
19255
- useEffect29(() => {
19400
+ useEffect30(() => {
19256
19401
  inputRef.current?.focus();
19257
19402
  }, []);
19258
19403
  const handleSubmit = (e) => {
@@ -19314,7 +19459,7 @@ function fileToDataUrl2(file) {
19314
19459
  reader.readAsDataURL(file);
19315
19460
  });
19316
19461
  }
19317
- var ToolbarButton = React65.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
19462
+ var ToolbarButton = React66.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
19318
19463
  const button = /* @__PURE__ */ jsx78(
19319
19464
  "button",
19320
19465
  {
@@ -19352,10 +19497,10 @@ var EditorToolbar = ({
19352
19497
  }) => {
19353
19498
  const t = useTranslations4("UEditor");
19354
19499
  const { textColors, highlightColors } = useEditorColors();
19355
- const [showImageInput, setShowImageInput] = useState48(false);
19500
+ const [showImageInput, setShowImageInput] = useState49(false);
19356
19501
  const fileInputRef = useRef26(null);
19357
- const [isUploadingImage, setIsUploadingImage] = useState48(false);
19358
- const [imageUploadError, setImageUploadError] = useState48(null);
19502
+ const [isUploadingImage, setIsUploadingImage] = useState49(false);
19503
+ const [imageUploadError, setImageUploadError] = useState49(null);
19359
19504
  const insertImageFiles = async (files) => {
19360
19505
  if (files.length === 0) return;
19361
19506
  setIsUploadingImage(true);
@@ -19772,7 +19917,7 @@ var EditorToolbar = ({
19772
19917
  };
19773
19918
 
19774
19919
  // ../../components/ui/UEditor/menus.tsx
19775
- import { useCallback as useCallback14, useEffect as useEffect30, useMemo as useMemo22, useRef as useRef27, useState as useState49 } from "react";
19920
+ import { useCallback as useCallback15, useEffect as useEffect31, useMemo as useMemo23, useRef as useRef27, useState as useState50 } from "react";
19776
19921
  import { createPortal as createPortal9 } from "react-dom";
19777
19922
  import { useTranslations as useTranslations5 } from "next-intl";
19778
19923
  import {
@@ -19801,9 +19946,9 @@ import {
19801
19946
  import { jsx as jsx79, jsxs as jsxs71 } from "react/jsx-runtime";
19802
19947
  var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
19803
19948
  const t = useTranslations5("UEditor");
19804
- const [selectedIndex, setSelectedIndex] = useState49(0);
19949
+ const [selectedIndex, setSelectedIndex] = useState50(0);
19805
19950
  const menuRef = useRef27(null);
19806
- const allCommands = useMemo22(
19951
+ const allCommands = useMemo23(
19807
19952
  () => [
19808
19953
  {
19809
19954
  icon: Type3,
@@ -19874,19 +20019,19 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
19874
20019
  ],
19875
20020
  [editor, t]
19876
20021
  );
19877
- const commands = useMemo22(() => {
20022
+ const commands = useMemo23(() => {
19878
20023
  if (!filterText) return allCommands;
19879
20024
  const lowerFilter = filterText.toLowerCase();
19880
20025
  return allCommands.filter((cmd) => cmd.label.toLowerCase().includes(lowerFilter) || cmd.description.toLowerCase().includes(lowerFilter));
19881
20026
  }, [allCommands, filterText]);
19882
- useEffect30(() => {
20027
+ useEffect31(() => {
19883
20028
  setSelectedIndex(0);
19884
20029
  }, [filterText]);
19885
- useEffect30(() => {
20030
+ useEffect31(() => {
19886
20031
  const selectedElement = menuRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
19887
20032
  selectedElement?.scrollIntoView({ block: "nearest" });
19888
20033
  }, [selectedIndex]);
19889
- const selectCommand = useCallback14(
20034
+ const selectCommand = useCallback15(
19890
20035
  (index) => {
19891
20036
  const command = commands[index];
19892
20037
  if (command) {
@@ -19896,7 +20041,7 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
19896
20041
  },
19897
20042
  [commands, onClose]
19898
20043
  );
19899
- useEffect30(() => {
20044
+ useEffect31(() => {
19900
20045
  const handleKeyDown = (e) => {
19901
20046
  if (commands.length === 0) return;
19902
20047
  if (e.key === "ArrowDown") {
@@ -19956,7 +20101,7 @@ var SlashCommandMenu = ({ editor, onClose, filterText = "" }) => {
19956
20101
  };
19957
20102
  var FloatingMenuContent = ({ editor }) => {
19958
20103
  const t = useTranslations5("UEditor");
19959
- const [showCommands, setShowCommands] = useState49(false);
20104
+ const [showCommands, setShowCommands] = useState50(false);
19960
20105
  if (showCommands) {
19961
20106
  return /* @__PURE__ */ jsx79(SlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
19962
20107
  }
@@ -19979,12 +20124,12 @@ var BubbleMenuContent = ({
19979
20124
  }) => {
19980
20125
  const t = useTranslations5("UEditor");
19981
20126
  const { textColors, highlightColors } = useEditorColors();
19982
- const [showLinkInput, setShowLinkInput] = useState49(false);
19983
- const [showEditorColorPalette, setShowEditorColorPalette] = useState49(false);
19984
- useEffect30(() => {
20127
+ const [showLinkInput, setShowLinkInput] = useState50(false);
20128
+ const [showEditorColorPalette, setShowEditorColorPalette] = useState50(false);
20129
+ useEffect31(() => {
19985
20130
  onKeepOpenChange?.(showLinkInput);
19986
20131
  }, [onKeepOpenChange, showLinkInput]);
19987
- useEffect30(() => {
20132
+ useEffect31(() => {
19988
20133
  if (!showLinkInput) return;
19989
20134
  const close = () => setShowLinkInput(false);
19990
20135
  editor.on("selectionUpdate", close);
@@ -20107,15 +20252,15 @@ var BubbleMenuContent = ({
20107
20252
  ] });
20108
20253
  };
20109
20254
  var CustomBubbleMenu = ({ editor }) => {
20110
- const [isVisible, setIsVisible] = useState49(false);
20111
- const [position, setPosition] = useState49({ top: 0, left: 0 });
20255
+ const [isVisible, setIsVisible] = useState50(false);
20256
+ const [position, setPosition] = useState50({ top: 0, left: 0 });
20112
20257
  const menuRef = useRef27(null);
20113
20258
  const keepOpenRef = useRef27(false);
20114
- const setKeepOpen = useCallback14((next) => {
20259
+ const setKeepOpen = useCallback15((next) => {
20115
20260
  keepOpenRef.current = next;
20116
20261
  if (next) setIsVisible(true);
20117
20262
  }, []);
20118
- useEffect30(() => {
20263
+ useEffect31(() => {
20119
20264
  const updatePosition = () => {
20120
20265
  const { state, view } = editor;
20121
20266
  const { from, to, empty } = state.selection;
@@ -20168,9 +20313,9 @@ var CustomBubbleMenu = ({ editor }) => {
20168
20313
  );
20169
20314
  };
20170
20315
  var CustomFloatingMenu = ({ editor }) => {
20171
- const [isVisible, setIsVisible] = useState49(false);
20172
- const [position, setPosition] = useState49({ top: 0, left: 0 });
20173
- useEffect30(() => {
20316
+ const [isVisible, setIsVisible] = useState50(false);
20317
+ const [position, setPosition] = useState50({ top: 0, left: 0 });
20318
+ useEffect31(() => {
20174
20319
  const updatePosition = () => {
20175
20320
  const { state, view } = editor;
20176
20321
  const { $from, empty } = state.selection;
@@ -20266,7 +20411,7 @@ var UEditor = ({
20266
20411
  }) => {
20267
20412
  const t = useTranslations7("UEditor");
20268
20413
  const effectivePlaceholder = placeholder ?? t("placeholder");
20269
- const extensions = useMemo23(
20414
+ const extensions = useMemo24(
20270
20415
  () => buildUEditorExtensions({ placeholder: effectivePlaceholder, maxCharacters, uploadImage, imageInsertMode, editable }),
20271
20416
  [effectivePlaceholder, maxCharacters, uploadImage, imageInsertMode, editable]
20272
20417
  );
@@ -20375,7 +20520,7 @@ var UEditor = ({
20375
20520
  onJsonChange?.(editor2.getJSON());
20376
20521
  }
20377
20522
  });
20378
- useEffect31(() => {
20523
+ useEffect32(() => {
20379
20524
  if (editor && content !== editor.getHTML()) {
20380
20525
  if (editor.isEmpty && content) {
20381
20526
  editor.commands.setContent(content);