@j3m-quantum/ui 2.1.8 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React30 = require('react');
3
+ var React36 = require('react');
4
4
  var reactSlot = require('@radix-ui/react-slot');
5
5
  var classVarianceAuthority = require('class-variance-authority');
6
6
  var clsx = require('clsx');
@@ -40,7 +40,6 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
40
40
  var HoverCardPrimitive = require('@radix-ui/react-hover-card');
41
41
  var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
42
42
  var ResizablePrimitive = require('react-resizable-panels');
43
- var reactLeaflet = require('react-leaflet');
44
43
  var reactTable = require('@tanstack/react-table');
45
44
  var dateFns = require('date-fns');
46
45
  var core = require('@dnd-kit/core');
@@ -73,7 +72,7 @@ function _interopNamespace(e) {
73
72
  return Object.freeze(n);
74
73
  }
75
74
 
76
- var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
75
+ var React36__namespace = /*#__PURE__*/_interopNamespace(React36);
77
76
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
78
77
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
79
78
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
@@ -108,8 +107,8 @@ var tunnel__default = /*#__PURE__*/_interopDefault(tunnel);
108
107
  // src/hooks/use-mobile.ts
109
108
  var MOBILE_BREAKPOINT = 1024;
110
109
  function useIsMobile() {
111
- const [isMobile, setIsMobile] = React30__namespace.useState(void 0);
112
- React30__namespace.useEffect(() => {
110
+ const [isMobile, setIsMobile] = React36__namespace.useState(void 0);
111
+ React36__namespace.useEffect(() => {
113
112
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
114
113
  const onChange = () => {
115
114
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -197,7 +196,7 @@ var buttonVariants = classVarianceAuthority.cva(
197
196
  }
198
197
  }
199
198
  );
200
- var Button = React30__namespace.forwardRef(
199
+ var Button = React36__namespace.forwardRef(
201
200
  ({ className, variant, size, asChild = false, ...props }, ref) => {
202
201
  const Comp = asChild ? reactSlot.Slot : "button";
203
202
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -561,7 +560,7 @@ function Slider({
561
560
  max = 100,
562
561
  ...props
563
562
  }) {
564
- const _values = React30__namespace.useMemo(
563
+ const _values = React36__namespace.useMemo(
565
564
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
566
565
  [value, defaultValue, min, max]
567
566
  );
@@ -847,7 +846,7 @@ function Toggle({
847
846
  }
848
847
  );
849
848
  }
850
- var ToggleGroupContext = React30__namespace.createContext({
849
+ var ToggleGroupContext = React36__namespace.createContext({
851
850
  size: "default",
852
851
  variant: "default",
853
852
  spacing: 0
@@ -884,7 +883,7 @@ function ToggleGroupItem({
884
883
  size,
885
884
  ...props
886
885
  }) {
887
- const context = React30__namespace.useContext(ToggleGroupContext);
886
+ const context = React36__namespace.useContext(ToggleGroupContext);
888
887
  return /* @__PURE__ */ jsxRuntime.jsx(
889
888
  ToggleGroupPrimitive__namespace.Item,
890
889
  {
@@ -914,7 +913,7 @@ function ThemeSwitch({
914
913
  className,
915
914
  size = "default"
916
915
  }) {
917
- const [isChecked, setIsChecked] = React30__namespace.useState(defaultChecked);
916
+ const [isChecked, setIsChecked] = React36__namespace.useState(defaultChecked);
918
917
  const isControlled = checked !== void 0;
919
918
  const currentChecked = isControlled ? checked : isChecked;
920
919
  const handleClick = () => {
@@ -1334,7 +1333,7 @@ function Label2({
1334
1333
  );
1335
1334
  }
1336
1335
  var Form = reactHookForm.FormProvider;
1337
- var FormFieldContext = React30__namespace.createContext(
1336
+ var FormFieldContext = React36__namespace.createContext(
1338
1337
  {}
1339
1338
  );
1340
1339
  var FormField = ({
@@ -1343,8 +1342,8 @@ var FormField = ({
1343
1342
  return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
1344
1343
  };
1345
1344
  var useFormField = () => {
1346
- const fieldContext = React30__namespace.useContext(FormFieldContext);
1347
- const itemContext = React30__namespace.useContext(FormItemContext);
1345
+ const fieldContext = React36__namespace.useContext(FormFieldContext);
1346
+ const itemContext = React36__namespace.useContext(FormItemContext);
1348
1347
  const { getFieldState } = reactHookForm.useFormContext();
1349
1348
  const formState = reactHookForm.useFormState({ name: fieldContext.name });
1350
1349
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1361,11 +1360,11 @@ var useFormField = () => {
1361
1360
  ...fieldState
1362
1361
  };
1363
1362
  };
1364
- var FormItemContext = React30__namespace.createContext(
1363
+ var FormItemContext = React36__namespace.createContext(
1365
1364
  {}
1366
1365
  );
1367
1366
  function FormItem({ className, ...props }) {
1368
- const id = React30__namespace.useId();
1367
+ const id = React36__namespace.useId();
1369
1368
  return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
1370
1369
  "div",
1371
1370
  {
@@ -1613,7 +1612,7 @@ function FieldError({
1613
1612
  errors,
1614
1613
  ...props
1615
1614
  }) {
1616
- const content = React30.useMemo(() => {
1615
+ const content = React36.useMemo(() => {
1617
1616
  if (children) {
1618
1617
  return children;
1619
1618
  }
@@ -1809,7 +1808,7 @@ var cardVariants = classVarianceAuthority.cva(
1809
1808
  {
1810
1809
  variants: {
1811
1810
  variant: {
1812
- default: "bg-card border shadow-sm",
1811
+ default: "bg-card border border-[var(--color-border-subtle)] shadow-[var(--j3m-shadow-default)]",
1813
1812
  glass: [
1814
1813
  "glass-context",
1815
1814
  // Enables glass semantic token overrides for children
@@ -2763,8 +2762,8 @@ function CalendarDayButton({
2763
2762
  modifiers,
2764
2763
  ...props
2765
2764
  }) {
2766
- const ref = React30__namespace.useRef(null);
2767
- React30__namespace.useEffect(() => {
2765
+ const ref = React36__namespace.useRef(null);
2766
+ React36__namespace.useEffect(() => {
2768
2767
  if (modifiers.focused) ref.current?.focus();
2769
2768
  }, [modifiers.focused]);
2770
2769
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2785,9 +2784,9 @@ function CalendarDayButton({
2785
2784
  }
2786
2785
  );
2787
2786
  }
2788
- var CarouselContext = React30__namespace.createContext(null);
2787
+ var CarouselContext = React36__namespace.createContext(null);
2789
2788
  function useCarousel() {
2790
- const context = React30__namespace.useContext(CarouselContext);
2789
+ const context = React36__namespace.useContext(CarouselContext);
2791
2790
  if (!context) {
2792
2791
  throw new Error("useCarousel must be used within a <Carousel />");
2793
2792
  }
@@ -2809,20 +2808,20 @@ function Carousel({
2809
2808
  },
2810
2809
  plugins
2811
2810
  );
2812
- const [canScrollPrev, setCanScrollPrev] = React30__namespace.useState(false);
2813
- const [canScrollNext, setCanScrollNext] = React30__namespace.useState(false);
2814
- const onSelect = React30__namespace.useCallback((api2) => {
2811
+ const [canScrollPrev, setCanScrollPrev] = React36__namespace.useState(false);
2812
+ const [canScrollNext, setCanScrollNext] = React36__namespace.useState(false);
2813
+ const onSelect = React36__namespace.useCallback((api2) => {
2815
2814
  if (!api2) return;
2816
2815
  setCanScrollPrev(api2.canScrollPrev());
2817
2816
  setCanScrollNext(api2.canScrollNext());
2818
2817
  }, []);
2819
- const scrollPrev = React30__namespace.useCallback(() => {
2818
+ const scrollPrev = React36__namespace.useCallback(() => {
2820
2819
  api?.scrollPrev();
2821
2820
  }, [api]);
2822
- const scrollNext = React30__namespace.useCallback(() => {
2821
+ const scrollNext = React36__namespace.useCallback(() => {
2823
2822
  api?.scrollNext();
2824
2823
  }, [api]);
2825
- const handleKeyDown = React30__namespace.useCallback(
2824
+ const handleKeyDown = React36__namespace.useCallback(
2826
2825
  (event) => {
2827
2826
  if (event.key === "ArrowLeft") {
2828
2827
  event.preventDefault();
@@ -2834,11 +2833,11 @@ function Carousel({
2834
2833
  },
2835
2834
  [scrollPrev, scrollNext]
2836
2835
  );
2837
- React30__namespace.useEffect(() => {
2836
+ React36__namespace.useEffect(() => {
2838
2837
  if (!api || !setApi) return;
2839
2838
  setApi(api);
2840
2839
  }, [api, setApi]);
2841
- React30__namespace.useEffect(() => {
2840
+ React36__namespace.useEffect(() => {
2842
2841
  if (!api) return;
2843
2842
  onSelect(api);
2844
2843
  api.on("reInit", onSelect);
@@ -2971,9 +2970,9 @@ function CarouselNext({
2971
2970
  );
2972
2971
  }
2973
2972
  var THEMES = { light: "", dark: ".dark" };
2974
- var ChartContext = React30__namespace.createContext(null);
2973
+ var ChartContext = React36__namespace.createContext(null);
2975
2974
  function useChart() {
2976
- const context = React30__namespace.useContext(ChartContext);
2975
+ const context = React36__namespace.useContext(ChartContext);
2977
2976
  if (!context) {
2978
2977
  throw new Error("useChart must be used within a <ChartContainer />");
2979
2978
  }
@@ -2986,7 +2985,7 @@ function ChartContainer({
2986
2985
  config,
2987
2986
  ...props
2988
2987
  }) {
2989
- const uniqueId = React30__namespace.useId();
2988
+ const uniqueId = React36__namespace.useId();
2990
2989
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
2991
2990
  return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
2992
2991
  "div",
@@ -3047,7 +3046,7 @@ function ChartTooltipContent({
3047
3046
  labelKey
3048
3047
  }) {
3049
3048
  const { config } = useChart();
3050
- const tooltipLabel = React30__namespace.useMemo(() => {
3049
+ const tooltipLabel = React36__namespace.useMemo(() => {
3051
3050
  if (hideLabel || !payload?.length) {
3052
3051
  return null;
3053
3052
  }
@@ -3882,7 +3881,7 @@ function StatusProgress({
3882
3881
  const resolvedVariant = variant ?? getVariantFromProgress(clampedValue);
3883
3882
  const colors = getStatusColors(resolvedVariant);
3884
3883
  const sizes = getSizeClasses(size);
3885
- const labelText = React30__namespace.useMemo(() => {
3884
+ const labelText = React36__namespace.useMemo(() => {
3886
3885
  if (currentCount !== void 0 && totalCount !== void 0) {
3887
3886
  return `${currentCount} / ${totalCount} ${unitLabel}`;
3888
3887
  }
@@ -3987,8 +3986,8 @@ function TooltipContent({
3987
3986
  ) });
3988
3987
  }
3989
3988
  function useDetectTheme() {
3990
- const [theme, setTheme] = React30__namespace.useState("light");
3991
- React30__namespace.useEffect(() => {
3989
+ const [theme, setTheme] = React36__namespace.useState("light");
3990
+ React36__namespace.useEffect(() => {
3992
3991
  const isDark = document.documentElement.classList.contains("dark");
3993
3992
  setTheme(isDark ? "dark" : "light");
3994
3993
  const observer = new MutationObserver((mutations) => {
@@ -4637,7 +4636,7 @@ function CommandShortcut({
4637
4636
  }
4638
4637
  );
4639
4638
  }
4640
- var SearchTrigger = React30__namespace.forwardRef(
4639
+ var SearchTrigger = React36__namespace.forwardRef(
4641
4640
  ({
4642
4641
  className,
4643
4642
  placeholder = "Search...",
@@ -4673,7 +4672,7 @@ var SearchTrigger = React30__namespace.forwardRef(
4673
4672
  );
4674
4673
  SearchTrigger.displayName = "SearchTrigger";
4675
4674
  function useSearchShortcut(onOpen, key = "k") {
4676
- React30__namespace.useEffect(() => {
4675
+ React36__namespace.useEffect(() => {
4677
4676
  const down = (e) => {
4678
4677
  if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
4679
4678
  e.preventDefault();
@@ -5648,9 +5647,9 @@ var SIDEBAR_WIDTH = "16rem";
5648
5647
  var SIDEBAR_WIDTH_MOBILE = "18rem";
5649
5648
  var SIDEBAR_WIDTH_ICON = "3rem";
5650
5649
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
5651
- var SidebarContext = React30__namespace.createContext(null);
5650
+ var SidebarContext = React36__namespace.createContext(null);
5652
5651
  function useSidebar() {
5653
- const context = React30__namespace.useContext(SidebarContext);
5652
+ const context = React36__namespace.useContext(SidebarContext);
5654
5653
  if (!context) {
5655
5654
  throw new Error("useSidebar must be used within a SidebarProvider.");
5656
5655
  }
@@ -5666,10 +5665,10 @@ function SidebarProvider({
5666
5665
  ...props
5667
5666
  }) {
5668
5667
  const isMobile = useIsMobile();
5669
- const [openMobile, setOpenMobile] = React30__namespace.useState(false);
5670
- const [_open, _setOpen] = React30__namespace.useState(defaultOpen);
5668
+ const [openMobile, setOpenMobile] = React36__namespace.useState(false);
5669
+ const [_open, _setOpen] = React36__namespace.useState(defaultOpen);
5671
5670
  const open = openProp ?? _open;
5672
- const setOpen = React30__namespace.useCallback(
5671
+ const setOpen = React36__namespace.useCallback(
5673
5672
  (value) => {
5674
5673
  const openState = typeof value === "function" ? value(open) : value;
5675
5674
  if (setOpenProp) {
@@ -5681,10 +5680,10 @@ function SidebarProvider({
5681
5680
  },
5682
5681
  [setOpenProp, open]
5683
5682
  );
5684
- const toggleSidebar = React30__namespace.useCallback(() => {
5683
+ const toggleSidebar = React36__namespace.useCallback(() => {
5685
5684
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
5686
5685
  }, [isMobile, setOpen, setOpenMobile]);
5687
- React30__namespace.useEffect(() => {
5686
+ React36__namespace.useEffect(() => {
5688
5687
  const handleKeyDown = (event) => {
5689
5688
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
5690
5689
  event.preventDefault();
@@ -5695,7 +5694,7 @@ function SidebarProvider({
5695
5694
  return () => window.removeEventListener("keydown", handleKeyDown);
5696
5695
  }, [toggleSidebar]);
5697
5696
  const state = open ? "expanded" : "collapsed";
5698
- const contextValue = React30__namespace.useMemo(
5697
+ const contextValue = React36__namespace.useMemo(
5699
5698
  () => ({
5700
5699
  state,
5701
5700
  open,
@@ -6153,7 +6152,7 @@ function SidebarMenuSkeleton({
6153
6152
  showIcon = false,
6154
6153
  ...props
6155
6154
  }) {
6156
- const width = React30__namespace.useMemo(() => {
6155
+ const width = React36__namespace.useMemo(() => {
6157
6156
  return `${Math.floor(Math.random() * 40) + 50}%`;
6158
6157
  }, []);
6159
6158
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6251,7 +6250,8 @@ var sectionVariants = classVarianceAuthority.cva(
6251
6250
  default: [
6252
6251
  "bg-[var(--color-bg-surface)]",
6253
6252
  "border border-[var(--color-border-subtle)]",
6254
- "text-[var(--color-text-main)]"
6253
+ "text-[var(--color-text-main)]",
6254
+ "shadow-[var(--j3m-shadow-default)]"
6255
6255
  ].join(" "),
6256
6256
  // Glass Light - frosted glass for dark or image backgrounds
6257
6257
  "glass-light": [
@@ -6296,7 +6296,7 @@ var sectionVariants = classVarianceAuthority.cva(
6296
6296
  }
6297
6297
  );
6298
6298
  var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
6299
- var Section = React30__namespace.forwardRef(
6299
+ var Section = React36__namespace.forwardRef(
6300
6300
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6301
6301
  "section",
6302
6302
  {
@@ -6308,7 +6308,7 @@ var Section = React30__namespace.forwardRef(
6308
6308
  )
6309
6309
  );
6310
6310
  Section.displayName = "Section";
6311
- var SectionHeader = React30__namespace.forwardRef(
6311
+ var SectionHeader = React36__namespace.forwardRef(
6312
6312
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6313
6313
  "div",
6314
6314
  {
@@ -6323,7 +6323,7 @@ var SectionHeader = React30__namespace.forwardRef(
6323
6323
  )
6324
6324
  );
6325
6325
  SectionHeader.displayName = "SectionHeader";
6326
- var SectionTitle = React30__namespace.forwardRef(
6326
+ var SectionTitle = React36__namespace.forwardRef(
6327
6327
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6328
6328
  "h2",
6329
6329
  {
@@ -6337,7 +6337,7 @@ var SectionTitle = React30__namespace.forwardRef(
6337
6337
  )
6338
6338
  );
6339
6339
  SectionTitle.displayName = "SectionTitle";
6340
- var SectionDescription = React30__namespace.forwardRef(
6340
+ var SectionDescription = React36__namespace.forwardRef(
6341
6341
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6342
6342
  "p",
6343
6343
  {
@@ -6351,7 +6351,7 @@ var SectionDescription = React30__namespace.forwardRef(
6351
6351
  )
6352
6352
  );
6353
6353
  SectionDescription.displayName = "SectionDescription";
6354
- var SectionContent = React30__namespace.forwardRef(
6354
+ var SectionContent = React36__namespace.forwardRef(
6355
6355
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6356
6356
  "div",
6357
6357
  {
@@ -6365,7 +6365,7 @@ var SectionContent = React30__namespace.forwardRef(
6365
6365
  )
6366
6366
  );
6367
6367
  SectionContent.displayName = "SectionContent";
6368
- var SectionFooter = React30__namespace.forwardRef(
6368
+ var SectionFooter = React36__namespace.forwardRef(
6369
6369
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6370
6370
  "div",
6371
6371
  {
@@ -6381,89 +6381,6 @@ var SectionFooter = React30__namespace.forwardRef(
6381
6381
  )
6382
6382
  );
6383
6383
  SectionFooter.displayName = "SectionFooter";
6384
- function Map2({
6385
- center,
6386
- zoom = 13,
6387
- className,
6388
- children,
6389
- ...props
6390
- }) {
6391
- return /* @__PURE__ */ jsxRuntime.jsx(
6392
- reactLeaflet.MapContainer,
6393
- {
6394
- center,
6395
- zoom,
6396
- className: cn(
6397
- "w-full rounded-lg border border-border overflow-hidden",
6398
- "[&_.leaflet-control-zoom]:border-border",
6399
- "[&_.leaflet-control-zoom]:rounded-md",
6400
- "[&_.leaflet-control-zoom]:shadow-sm",
6401
- "[&_.leaflet-control-zoom-in]:rounded-t-md",
6402
- "[&_.leaflet-control-zoom-in]:border-b",
6403
- "[&_.leaflet-control-zoom-in]:border-border",
6404
- "[&_.leaflet-control-zoom-out]:rounded-b-md",
6405
- "[&_.leaflet-popup-content-wrapper]:rounded-lg",
6406
- "[&_.leaflet-popup-content-wrapper]:shadow-lg",
6407
- "[&_.leaflet-popup-content-wrapper]:border",
6408
- "[&_.leaflet-popup-content-wrapper]:border-border",
6409
- className
6410
- ),
6411
- scrollWheelZoom: true,
6412
- ...props,
6413
- children
6414
- }
6415
- );
6416
- }
6417
- var TILE_LAYERS = {
6418
- default: {
6419
- url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
6420
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6421
- },
6422
- dark: {
6423
- url: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
6424
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
6425
- },
6426
- satellite: {
6427
- url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
6428
- attribution: "&copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
6429
- }
6430
- };
6431
- function MapTileLayer({
6432
- variant = "default",
6433
- ...props
6434
- }) {
6435
- const layer = TILE_LAYERS[variant];
6436
- return /* @__PURE__ */ jsxRuntime.jsx(
6437
- reactLeaflet.TileLayer,
6438
- {
6439
- url: layer.url,
6440
- attribution: layer.attribution,
6441
- ...props
6442
- }
6443
- );
6444
- }
6445
- function MapMarker({
6446
- position,
6447
- children,
6448
- ...props
6449
- }) {
6450
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Marker, { position, ...props, children });
6451
- }
6452
- function MapPopup({
6453
- children,
6454
- ...props
6455
- }) {
6456
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Popup, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children }) });
6457
- }
6458
- function MapTooltip({
6459
- children,
6460
- ...props
6461
- }) {
6462
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.Tooltip, { ...props, children });
6463
- }
6464
- function MapZoomControl(props) {
6465
- return /* @__PURE__ */ jsxRuntime.jsx(reactLeaflet.ZoomControl, { ...props });
6466
- }
6467
6384
  function DataTableColumnHeader({
6468
6385
  column,
6469
6386
  title,
@@ -6673,7 +6590,7 @@ function SiteHeader({
6673
6590
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[var(--header-height,3.5rem)] w-full items-center gap-[var(--j3m-spacing-s)] px-[var(--j3m-spacing-m)]", children: [
6674
6591
  trigger,
6675
6592
  trigger && /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
6676
- /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React30__namespace.Fragment, { children: [
6593
+ /* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React36__namespace.Fragment, { children: [
6677
6594
  index > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
6678
6595
  /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) })
6679
6596
  ] }, index)) }) }),
@@ -7294,11 +7211,11 @@ function PlanningWeekCommentPopover({
7294
7211
  open,
7295
7212
  onOpenChange
7296
7213
  }) {
7297
- const [newCommentText, setNewCommentText] = React30__namespace.useState("");
7298
- const [selectedLocationId, setSelectedLocationId] = React30__namespace.useState("");
7299
- const [viewCommentsOpen, setViewCommentsOpen] = React30__namespace.useState(true);
7300
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
7301
- const selectedLocation = React30__namespace.useMemo(() => {
7214
+ const [newCommentText, setNewCommentText] = React36__namespace.useState("");
7215
+ const [selectedLocationId, setSelectedLocationId] = React36__namespace.useState("");
7216
+ const [viewCommentsOpen, setViewCommentsOpen] = React36__namespace.useState(true);
7217
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
7218
+ const selectedLocation = React36__namespace.useMemo(() => {
7302
7219
  return locationOptions.find((opt) => opt.id === selectedLocationId);
7303
7220
  }, [locationOptions, selectedLocationId]);
7304
7221
  const handleSubmit = () => {
@@ -7334,7 +7251,7 @@ function PlanningWeekCommentPopover({
7334
7251
  onCommentClick(comment);
7335
7252
  }
7336
7253
  };
7337
- const formatDate3 = (date) => {
7254
+ const formatDate6 = (date) => {
7338
7255
  return new Intl.DateTimeFormat("en-US", {
7339
7256
  month: "short",
7340
7257
  day: "numeric",
@@ -7342,8 +7259,8 @@ function PlanningWeekCommentPopover({
7342
7259
  minute: "2-digit"
7343
7260
  }).format(date);
7344
7261
  };
7345
- const prevOpenRef = React30__namespace.useRef(open);
7346
- React30__namespace.useEffect(() => {
7262
+ const prevOpenRef = React36__namespace.useRef(open);
7263
+ React36__namespace.useEffect(() => {
7347
7264
  const wasOpen = prevOpenRef.current;
7348
7265
  prevOpenRef.current = open;
7349
7266
  if (wasOpen && !open) {
@@ -7414,7 +7331,7 @@ function PlanningWeekCommentPopover({
7414
7331
  ] }),
7415
7332
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
7416
7333
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
7417
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
7334
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
7418
7335
  ] }),
7419
7336
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
7420
7337
  ]
@@ -7722,15 +7639,15 @@ function PlanningTable({
7722
7639
  stickySupplierColumn = true,
7723
7640
  maxHeight = "600px"
7724
7641
  } = config;
7725
- const weeks = React30__namespace.useMemo(
7642
+ const weeks = React36__namespace.useMemo(
7726
7643
  () => generateWeeks(startDate, weekCount),
7727
7644
  [startDate, weekCount]
7728
7645
  );
7729
- const currentWeekKey = React30__namespace.useMemo(() => {
7646
+ const currentWeekKey = React36__namespace.useMemo(() => {
7730
7647
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
7731
7648
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
7732
7649
  }, [weeks]);
7733
- const columnSummaryData = React30__namespace.useMemo(() => {
7650
+ const columnSummaryData = React36__namespace.useMemo(() => {
7734
7651
  const summaryMap = /* @__PURE__ */ new Map();
7735
7652
  for (const week of weeks) {
7736
7653
  const weekKey = getWeekKey(week.startDate);
@@ -7772,14 +7689,14 @@ function PlanningTable({
7772
7689
  }
7773
7690
  return summaryMap;
7774
7691
  }, [weeks, suppliers]);
7775
- const columns = React30__namespace.useMemo(
7692
+ const columns = React36__namespace.useMemo(
7776
7693
  () => generateColumns(weeks, config, suppliers, columnSummaryData),
7777
7694
  [weeks, config, suppliers, columnSummaryData]
7778
7695
  );
7779
- const [sorting, setSorting] = React30__namespace.useState([]);
7780
- const [columnFilters, setColumnFilters] = React30__namespace.useState([]);
7781
- const [columnVisibility, setColumnVisibility] = React30__namespace.useState({});
7782
- const [rowSelection, setRowSelection] = React30__namespace.useState({});
7696
+ const [sorting, setSorting] = React36__namespace.useState([]);
7697
+ const [columnFilters, setColumnFilters] = React36__namespace.useState([]);
7698
+ const [columnVisibility, setColumnVisibility] = React36__namespace.useState({});
7699
+ const [rowSelection, setRowSelection] = React36__namespace.useState({});
7783
7700
  const table = reactTable.useReactTable({
7784
7701
  data: suppliers,
7785
7702
  columns,
@@ -7803,7 +7720,7 @@ function PlanningTable({
7803
7720
  }
7804
7721
  }
7805
7722
  });
7806
- const insightMetrics = React30__namespace.useMemo(() => {
7723
+ const insightMetrics = React36__namespace.useMemo(() => {
7807
7724
  let totalProduced = 0;
7808
7725
  let totalRequired = 0;
7809
7726
  let totalDeliveries = 0;
@@ -8037,10 +7954,10 @@ function DeliveryCommentPopover({
8037
7954
  onAddComment,
8038
7955
  deliveryLabel
8039
7956
  }) {
8040
- const [open, setOpen] = React30__namespace.useState(false);
8041
- const [newCommentText, setNewCommentText] = React30__namespace.useState("");
8042
- const [viewCommentsOpen, setViewCommentsOpen] = React30__namespace.useState(true);
8043
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
7957
+ const [open, setOpen] = React36__namespace.useState(false);
7958
+ const [newCommentText, setNewCommentText] = React36__namespace.useState("");
7959
+ const [viewCommentsOpen, setViewCommentsOpen] = React36__namespace.useState(true);
7960
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
8044
7961
  const handleSubmit = () => {
8045
7962
  if (newCommentText.trim() && onAddComment) {
8046
7963
  onAddComment(newCommentText.trim());
@@ -8059,7 +7976,7 @@ function DeliveryCommentPopover({
8059
7976
  setNewCommentText("");
8060
7977
  }
8061
7978
  };
8062
- const formatDate3 = (date) => {
7979
+ const formatDate6 = (date) => {
8063
7980
  return new Intl.DateTimeFormat("en-US", {
8064
7981
  month: "short",
8065
7982
  day: "numeric",
@@ -8067,8 +7984,8 @@ function DeliveryCommentPopover({
8067
7984
  minute: "2-digit"
8068
7985
  }).format(date);
8069
7986
  };
8070
- const prevOpenRef = React30__namespace.useRef(open);
8071
- React30__namespace.useEffect(() => {
7987
+ const prevOpenRef = React36__namespace.useRef(open);
7988
+ React36__namespace.useEffect(() => {
8072
7989
  const wasOpen = prevOpenRef.current;
8073
7990
  prevOpenRef.current = open;
8074
7991
  if (wasOpen && !open) {
@@ -8105,7 +8022,7 @@ function DeliveryCommentPopover({
8105
8022
  /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { className: "space-y-2 pt-2", children: comments.length > 0 ? comments.map((comment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-muted/50 p-3 space-y-2", children: [
8106
8023
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8107
8024
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
8108
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
8025
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
8109
8026
  ] }),
8110
8027
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
8111
8028
  ] }, comment.id)) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -8180,8 +8097,8 @@ function ProductionCommentSection({
8180
8097
  comments = [],
8181
8098
  onAddComment
8182
8099
  }) {
8183
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
8184
- const [newComment, setNewComment] = React30__namespace.useState("");
8100
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
8101
+ const [newComment, setNewComment] = React36__namespace.useState("");
8185
8102
  const handleSubmit = () => {
8186
8103
  if (newComment.trim() && onAddComment) {
8187
8104
  onAddComment(newComment.trim());
@@ -8199,7 +8116,7 @@ function ProductionCommentSection({
8199
8116
  setNewComment("");
8200
8117
  }
8201
8118
  };
8202
- const formatDate3 = (date) => {
8119
+ const formatDate6 = (date) => {
8203
8120
  return new Intl.DateTimeFormat("en-US", {
8204
8121
  month: "short",
8205
8122
  day: "numeric",
@@ -8211,7 +8128,7 @@ function ProductionCommentSection({
8211
8128
  comments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: comments.map((comment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-muted/50 p-2.5 space-y-1", children: [
8212
8129
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8213
8130
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
8214
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
8131
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
8215
8132
  ] }),
8216
8133
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
8217
8134
  ] }, comment.id)) }),
@@ -8366,7 +8283,7 @@ function DeliveryDetailsView({
8366
8283
  onAddComment
8367
8284
  }) {
8368
8285
  const elements = delivery.elements ?? [];
8369
- const categorizedElements = React30__namespace.useMemo(() => {
8286
+ const categorizedElements = React36__namespace.useMemo(() => {
8370
8287
  const sent = [];
8371
8288
  const notSent = [];
8372
8289
  const moved = [];
@@ -8734,15 +8651,15 @@ function WeekDetailDialog({
8734
8651
  }) {
8735
8652
  const production = data?.production;
8736
8653
  const initialProduced = production?.produced ?? 0;
8737
- const [producedValue, setProducedValue] = React30__namespace.useState(initialProduced.toString());
8738
- const [hasChanges, setHasChanges] = React30__namespace.useState(false);
8739
- const [selectedDelivery, setSelectedDelivery] = React30__namespace.useState(null);
8740
- React30__namespace.useEffect(() => {
8654
+ const [producedValue, setProducedValue] = React36__namespace.useState(initialProduced.toString());
8655
+ const [hasChanges, setHasChanges] = React36__namespace.useState(false);
8656
+ const [selectedDelivery, setSelectedDelivery] = React36__namespace.useState(null);
8657
+ React36__namespace.useEffect(() => {
8741
8658
  const newProduced = data?.production?.produced ?? 0;
8742
8659
  setProducedValue(newProduced.toString());
8743
8660
  setHasChanges(false);
8744
8661
  }, [data]);
8745
- React30__namespace.useEffect(() => {
8662
+ React36__namespace.useEffect(() => {
8746
8663
  if (!open) {
8747
8664
  setSelectedDelivery(null);
8748
8665
  }
@@ -8873,24 +8790,24 @@ function ElementProductionDialog({
8873
8790
  elements,
8874
8791
  onSave
8875
8792
  }) {
8876
- const [searchQuery, setSearchQuery] = React30__namespace.useState("");
8877
- const [selectedIds, setSelectedIds] = React30__namespace.useState(
8793
+ const [searchQuery, setSearchQuery] = React36__namespace.useState("");
8794
+ const [selectedIds, setSelectedIds] = React36__namespace.useState(
8878
8795
  new Set(elements.filter((e) => e.isProduced).map((e) => e.id))
8879
8796
  );
8880
- React30__namespace.useEffect(() => {
8797
+ React36__namespace.useEffect(() => {
8881
8798
  if (open) {
8882
8799
  setSelectedIds(new Set(elements.filter((e) => e.isProduced).map((e) => e.id)));
8883
8800
  setSearchQuery("");
8884
8801
  }
8885
8802
  }, [open, elements]);
8886
- const filteredElements = React30__namespace.useMemo(() => {
8803
+ const filteredElements = React36__namespace.useMemo(() => {
8887
8804
  if (!searchQuery.trim()) return elements;
8888
8805
  const query = searchQuery.toLowerCase();
8889
8806
  return elements.filter(
8890
8807
  (e) => e.name.toLowerCase().includes(query) || e.prefix?.toLowerCase().includes(query) || e.type?.toLowerCase().includes(query)
8891
8808
  );
8892
8809
  }, [elements, searchQuery]);
8893
- React30__namespace.useMemo(() => {
8810
+ React36__namespace.useMemo(() => {
8894
8811
  const prefixes = /* @__PURE__ */ new Set();
8895
8812
  elements.forEach((e) => {
8896
8813
  if (e.prefix) prefixes.add(e.prefix);
@@ -9076,10 +8993,10 @@ function DeliveryCommentPopover2({
9076
8993
  onAddComment,
9077
8994
  deliveryLabel
9078
8995
  }) {
9079
- const [open, setOpen] = React30__namespace.useState(false);
9080
- const [newCommentText, setNewCommentText] = React30__namespace.useState("");
9081
- const [viewCommentsOpen, setViewCommentsOpen] = React30__namespace.useState(true);
9082
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
8996
+ const [open, setOpen] = React36__namespace.useState(false);
8997
+ const [newCommentText, setNewCommentText] = React36__namespace.useState("");
8998
+ const [viewCommentsOpen, setViewCommentsOpen] = React36__namespace.useState(true);
8999
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
9083
9000
  const handleSubmit = () => {
9084
9001
  if (newCommentText.trim() && onAddComment) {
9085
9002
  onAddComment(newCommentText.trim());
@@ -9098,7 +9015,7 @@ function DeliveryCommentPopover2({
9098
9015
  setNewCommentText("");
9099
9016
  }
9100
9017
  };
9101
- const formatDate3 = (date) => {
9018
+ const formatDate6 = (date) => {
9102
9019
  return new Intl.DateTimeFormat("en-US", {
9103
9020
  month: "short",
9104
9021
  day: "numeric",
@@ -9106,7 +9023,7 @@ function DeliveryCommentPopover2({
9106
9023
  minute: "2-digit"
9107
9024
  }).format(date);
9108
9025
  };
9109
- React30__namespace.useEffect(() => {
9026
+ React36__namespace.useEffect(() => {
9110
9027
  if (!open) {
9111
9028
  setShowAddForm(false);
9112
9029
  setNewCommentText("");
@@ -9141,7 +9058,7 @@ function DeliveryCommentPopover2({
9141
9058
  /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { className: "space-y-2 pt-2", children: comments.length > 0 ? comments.map((comment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-muted/50 p-3 space-y-2", children: [
9142
9059
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
9143
9060
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
9144
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
9061
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
9145
9062
  ] }),
9146
9063
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
9147
9064
  ] }, comment.id)) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -9216,8 +9133,8 @@ function ProductionCommentSection2({
9216
9133
  comments = [],
9217
9134
  onAddComment
9218
9135
  }) {
9219
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
9220
- const [newComment, setNewComment] = React30__namespace.useState("");
9136
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
9137
+ const [newComment, setNewComment] = React36__namespace.useState("");
9221
9138
  const handleSubmit = () => {
9222
9139
  if (newComment.trim() && onAddComment) {
9223
9140
  onAddComment(newComment.trim());
@@ -9235,7 +9152,7 @@ function ProductionCommentSection2({
9235
9152
  setNewComment("");
9236
9153
  }
9237
9154
  };
9238
- const formatDate3 = (date) => {
9155
+ const formatDate6 = (date) => {
9239
9156
  return new Intl.DateTimeFormat("en-US", {
9240
9157
  month: "short",
9241
9158
  day: "numeric",
@@ -9247,7 +9164,7 @@ function ProductionCommentSection2({
9247
9164
  comments.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: comments.map((comment) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-muted/50 p-2.5 space-y-1", children: [
9248
9165
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
9249
9166
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
9250
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
9167
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
9251
9168
  ] }),
9252
9169
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
9253
9170
  ] }, comment.id)) }),
@@ -9402,7 +9319,7 @@ function DeliveryDetailsView2({
9402
9319
  onAddComment
9403
9320
  }) {
9404
9321
  const elements = delivery.elements ?? [];
9405
- const categorizedElements = React30__namespace.useMemo(() => {
9322
+ const categorizedElements = React36__namespace.useMemo(() => {
9406
9323
  const sent = [];
9407
9324
  const notSent = [];
9408
9325
  const moved = [];
@@ -9736,10 +9653,10 @@ function WeekDetailSheet({
9736
9653
  onAddProductionComment,
9737
9654
  onAddDeliveryComment
9738
9655
  }) {
9739
- const [selectedDelivery, setSelectedDelivery] = React30__namespace.useState(null);
9740
- const [productionDialogOpen, setProductionDialogOpen] = React30__namespace.useState(false);
9741
- const [previousProducedCount, setPreviousProducedCount] = React30__namespace.useState(void 0);
9742
- const productionElements = React30__namespace.useMemo(() => {
9656
+ const [selectedDelivery, setSelectedDelivery] = React36__namespace.useState(null);
9657
+ const [productionDialogOpen, setProductionDialogOpen] = React36__namespace.useState(false);
9658
+ const [previousProducedCount, setPreviousProducedCount] = React36__namespace.useState(void 0);
9659
+ const productionElements = React36__namespace.useMemo(() => {
9743
9660
  if (!data?.deliveries) return [];
9744
9661
  const elements = [];
9745
9662
  const seenIds = /* @__PURE__ */ new Set();
@@ -9763,12 +9680,12 @@ function WeekDetailSheet({
9763
9680
  return elements;
9764
9681
  }, [data?.deliveries]);
9765
9682
  const currentProducedCount = productionElements.filter((e) => e.isProduced).length;
9766
- React30__namespace.useEffect(() => {
9683
+ React36__namespace.useEffect(() => {
9767
9684
  if (open && data?.deliveries) {
9768
9685
  setPreviousProducedCount(currentProducedCount);
9769
9686
  }
9770
9687
  }, [open]);
9771
- React30__namespace.useEffect(() => {
9688
+ React36__namespace.useEffect(() => {
9772
9689
  if (!open) {
9773
9690
  setSelectedDelivery(null);
9774
9691
  setProductionDialogOpen(false);
@@ -10001,13 +9918,13 @@ function CalibrationWeekCell({
10001
9918
  onAddClick,
10002
9919
  ...props
10003
9920
  }) {
10004
- const inputRef = React30__namespace.useRef(null);
10005
- const [localValue, setLocalValue] = React30__namespace.useState(
9921
+ const inputRef = React36__namespace.useRef(null);
9922
+ const [localValue, setLocalValue] = React36__namespace.useState(
10006
9923
  data.entered !== null ? String(data.entered) : ""
10007
9924
  );
10008
- const [isHovered, setIsHovered] = React30__namespace.useState(false);
10009
- const [isEditing, setIsEditing] = React30__namespace.useState(false);
10010
- React30__namespace.useEffect(() => {
9925
+ const [isHovered, setIsHovered] = React36__namespace.useState(false);
9926
+ const [isEditing, setIsEditing] = React36__namespace.useState(false);
9927
+ React36__namespace.useEffect(() => {
10011
9928
  setLocalValue(data.entered !== null ? String(data.entered) : "");
10012
9929
  }, [data.entered]);
10013
9930
  const unitLabel = formatCalibrationUnit(unit);
@@ -10193,11 +10110,11 @@ function CommentPopover({
10193
10110
  open,
10194
10111
  onOpenChange
10195
10112
  }) {
10196
- const [newCommentText, setNewCommentText] = React30__namespace.useState("");
10197
- const [selectedPrefixId, setSelectedPrefixId] = React30__namespace.useState("");
10198
- const [viewCommentsOpen, setViewCommentsOpen] = React30__namespace.useState(true);
10199
- const [showAddForm, setShowAddForm] = React30__namespace.useState(false);
10200
- const selectedPrefixName = React30__namespace.useMemo(() => {
10113
+ const [newCommentText, setNewCommentText] = React36__namespace.useState("");
10114
+ const [selectedPrefixId, setSelectedPrefixId] = React36__namespace.useState("");
10115
+ const [viewCommentsOpen, setViewCommentsOpen] = React36__namespace.useState(true);
10116
+ const [showAddForm, setShowAddForm] = React36__namespace.useState(false);
10117
+ const selectedPrefixName = React36__namespace.useMemo(() => {
10201
10118
  const prefix = availablePrefixes.find((p) => p.id === selectedPrefixId);
10202
10119
  return prefix?.name ?? "";
10203
10120
  }, [availablePrefixes, selectedPrefixId]);
@@ -10221,7 +10138,7 @@ function CommentPopover({
10221
10138
  setNewCommentText("");
10222
10139
  }
10223
10140
  };
10224
- const formatDate3 = (date) => {
10141
+ const formatDate6 = (date) => {
10225
10142
  return new Intl.DateTimeFormat("en-US", {
10226
10143
  month: "short",
10227
10144
  day: "numeric",
@@ -10229,8 +10146,8 @@ function CommentPopover({
10229
10146
  minute: "2-digit"
10230
10147
  }).format(date);
10231
10148
  };
10232
- const prevOpenRef = React30__namespace.useRef(open);
10233
- React30__namespace.useEffect(() => {
10149
+ const prevOpenRef = React36__namespace.useRef(open);
10150
+ React36__namespace.useEffect(() => {
10234
10151
  const wasOpen = prevOpenRef.current;
10235
10152
  prevOpenRef.current = open;
10236
10153
  if (wasOpen && !open) {
@@ -10289,7 +10206,7 @@ function CommentPopover({
10289
10206
  ),
10290
10207
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
10291
10208
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
10292
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
10209
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
10293
10210
  ] }),
10294
10211
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: comment.text })
10295
10212
  ]
@@ -10475,7 +10392,7 @@ function CalibrationTable({
10475
10392
  onAddComment,
10476
10393
  onAddEarlierWeek
10477
10394
  } = config;
10478
- const calculatedStartDate = React30__namespace.useMemo(() => {
10395
+ const calculatedStartDate = React36__namespace.useMemo(() => {
10479
10396
  if (startDate) return startDate;
10480
10397
  let earliest = null;
10481
10398
  for (const prefix of prefixes) {
@@ -10496,31 +10413,31 @@ function CalibrationTable({
10496
10413
  }
10497
10414
  return earliest ?? /* @__PURE__ */ new Date();
10498
10415
  }, [startDate, prefixes]);
10499
- const [additionalWeeks, setAdditionalWeeks] = React30__namespace.useState(0);
10500
- const weeks = React30__namespace.useMemo(() => {
10416
+ const [additionalWeeks, setAdditionalWeeks] = React36__namespace.useState(0);
10417
+ const weeks = React36__namespace.useMemo(() => {
10501
10418
  const start = new Date(calculatedStartDate);
10502
10419
  start.setDate(start.getDate() - additionalWeeks * 7);
10503
10420
  return generateWeeks(start, weekCount + additionalWeeks);
10504
10421
  }, [calculatedStartDate, weekCount, additionalWeeks]);
10505
- React30__namespace.useMemo(() => {
10422
+ React36__namespace.useMemo(() => {
10506
10423
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
10507
10424
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
10508
10425
  }, [weeks]);
10509
- const [currentPage, setCurrentPage] = React30__namespace.useState(0);
10510
- const [pageSize, setPageSize] = React30__namespace.useState(defaultPageSize);
10511
- const [searchQuery, setSearchQuery] = React30__namespace.useState("");
10512
- const filteredPrefixes = React30__namespace.useMemo(() => {
10426
+ const [currentPage, setCurrentPage] = React36__namespace.useState(0);
10427
+ const [pageSize, setPageSize] = React36__namespace.useState(defaultPageSize);
10428
+ const [searchQuery, setSearchQuery] = React36__namespace.useState("");
10429
+ const filteredPrefixes = React36__namespace.useMemo(() => {
10513
10430
  if (!searchQuery) return prefixes;
10514
10431
  const query = searchQuery.toLowerCase();
10515
10432
  return prefixes.filter(
10516
10433
  (p) => p.name.toLowerCase().includes(query) || p.typeCode.toLowerCase().includes(query)
10517
10434
  );
10518
10435
  }, [prefixes, searchQuery]);
10519
- const paginatedPrefixes = React30__namespace.useMemo(() => {
10436
+ const paginatedPrefixes = React36__namespace.useMemo(() => {
10520
10437
  const start = currentPage * pageSize;
10521
10438
  return filteredPrefixes.slice(start, start + pageSize);
10522
10439
  }, [filteredPrefixes, currentPage, pageSize]);
10523
- React30__namespace.useMemo(
10440
+ React36__namespace.useMemo(
10524
10441
  () => canSubmitCalibration(prefixes),
10525
10442
  [prefixes]
10526
10443
  );
@@ -10544,11 +10461,11 @@ function CalibrationTable({
10544
10461
  }
10545
10462
  return allComments;
10546
10463
  };
10547
- const availablePrefixes = React30__namespace.useMemo(
10464
+ const availablePrefixes = React36__namespace.useMemo(
10548
10465
  () => prefixes.map((p) => ({ id: p.id, name: p.name })),
10549
10466
  [prefixes]
10550
10467
  );
10551
- const insightMetrics = React30__namespace.useMemo(() => {
10468
+ const insightMetrics = React36__namespace.useMemo(() => {
10552
10469
  let totalCalibrated = 0;
10553
10470
  let totalRequired = 0;
10554
10471
  for (const prefix of prefixes) {
@@ -10589,7 +10506,7 @@ function CalibrationTable({
10589
10506
  }
10590
10507
  ];
10591
10508
  }, [prefixes]);
10592
- const columnSummaryData = React30__namespace.useMemo(() => {
10509
+ const columnSummaryData = React36__namespace.useMemo(() => {
10593
10510
  const summaryMap = /* @__PURE__ */ new Map();
10594
10511
  for (const week of weeks) {
10595
10512
  const weekKey = getWeekKey(week.startDate);
@@ -10856,14 +10773,14 @@ function CommentDialog({
10856
10773
  open,
10857
10774
  onOpenChange
10858
10775
  }) {
10859
- const [selectedPrefixId, setSelectedPrefixId] = React30__namespace.useState("");
10860
- const [selectedWeekKey, setSelectedWeekKey] = React30__namespace.useState("");
10861
- const [commentText, setCommentText] = React30__namespace.useState("");
10862
- const currentWeek = React30__namespace.useMemo(
10776
+ const [selectedPrefixId, setSelectedPrefixId] = React36__namespace.useState("");
10777
+ const [selectedWeekKey, setSelectedWeekKey] = React36__namespace.useState("");
10778
+ const [commentText, setCommentText] = React36__namespace.useState("");
10779
+ const currentWeek = React36__namespace.useMemo(
10863
10780
  () => weeks.find((w) => w.isCurrentWeek),
10864
10781
  [weeks]
10865
10782
  );
10866
- React30__namespace.useEffect(() => {
10783
+ React36__namespace.useEffect(() => {
10867
10784
  if (open) {
10868
10785
  setSelectedPrefixId(prefixes[0]?.id ?? "");
10869
10786
  setSelectedWeekKey(currentWeek ? getWeekKey(currentWeek.startDate) : weeks[0] ? getWeekKey(weeks[0].startDate) : "");
@@ -11099,7 +11016,7 @@ function generateLoadingWeek(date) {
11099
11016
  const today = /* @__PURE__ */ new Date();
11100
11017
  today.setHours(0, 0, 0, 0);
11101
11018
  const isCurrentWeek = monday <= today && today <= friday;
11102
- const formatDate3 = (d) => {
11019
+ const formatDate6 = (d) => {
11103
11020
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
11104
11021
  };
11105
11022
  return {
@@ -11107,7 +11024,7 @@ function generateLoadingWeek(date) {
11107
11024
  label: `W${getLoadingISOWeek(monday).toString().padStart(2, "0")}`,
11108
11025
  startDate: monday,
11109
11026
  endDate: friday,
11110
- dateRange: `${formatDate3(monday)} - ${formatDate3(friday)}`,
11027
+ dateRange: `${formatDate6(monday)} - ${formatDate6(friday)}`,
11111
11028
  isCurrentWeek
11112
11029
  };
11113
11030
  }
@@ -11410,7 +11327,7 @@ function WeeklyLoadingView({
11410
11327
  showNavigation = true,
11411
11328
  className
11412
11329
  }) {
11413
- const [shippedOpenState, setShippedOpenState] = React30__namespace.useState({
11330
+ const [shippedOpenState, setShippedOpenState] = React36__namespace.useState({
11414
11331
  1: false,
11415
11332
  // Monday
11416
11333
  2: false,
@@ -11428,7 +11345,7 @@ function WeeklyLoadingView({
11428
11345
  [dayOfWeek]: !prev[dayOfWeek]
11429
11346
  }));
11430
11347
  };
11431
- const weekDays = React30__namespace.useMemo(() => {
11348
+ const weekDays = React36__namespace.useMemo(() => {
11432
11349
  const days = [];
11433
11350
  for (let i = 0; i < 5; i++) {
11434
11351
  const date = dateFns.addDays(week.startDate, i);
@@ -11440,7 +11357,7 @@ function WeeklyLoadingView({
11440
11357
  }
11441
11358
  return days;
11442
11359
  }, [week.startDate]);
11443
- const deliveriesByDay = React30__namespace.useMemo(() => {
11360
+ const deliveriesByDay = React36__namespace.useMemo(() => {
11444
11361
  const grouped = /* @__PURE__ */ new Map();
11445
11362
  for (let i = 1; i <= 5; i++) {
11446
11363
  grouped.set(i, { pending: [], shipped: [] });
@@ -11460,7 +11377,7 @@ function WeeklyLoadingView({
11460
11377
  }, [deliveries]);
11461
11378
  const totalPendingDeliveries = deliveries.filter((d) => !isShippedDelivery(d)).length;
11462
11379
  const totalShippedDeliveries = deliveries.filter((d) => isShippedDelivery(d)).length;
11463
- const daySummaryData = React30__namespace.useMemo(() => {
11380
+ const daySummaryData = React36__namespace.useMemo(() => {
11464
11381
  const summaries = /* @__PURE__ */ new Map();
11465
11382
  for (let i = 1; i <= 5; i++) {
11466
11383
  const dayData = deliveriesByDay.get(i) ?? { pending: [], shipped: [] };
@@ -11814,7 +11731,7 @@ function DeliveryTimeline({ timelineState }) {
11814
11731
  const state = getStateForStep(step.id);
11815
11732
  const styles = getStepStyles(state);
11816
11733
  const isLast = index === TIMELINE_STEPS.length - 1;
11817
- return /* @__PURE__ */ jsxRuntime.jsxs(React30__namespace.Fragment, { children: [
11734
+ return /* @__PURE__ */ jsxRuntime.jsxs(React36__namespace.Fragment, { children: [
11818
11735
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
11819
11736
  /* @__PURE__ */ jsxRuntime.jsx(
11820
11737
  "div",
@@ -11949,7 +11866,7 @@ function AddCommentDialog({
11949
11866
  weekId,
11950
11867
  onAddComment
11951
11868
  }) {
11952
- const [commentText, setCommentText] = React30__namespace.useState("");
11869
+ const [commentText, setCommentText] = React36__namespace.useState("");
11953
11870
  const handleSubmit = () => {
11954
11871
  if (commentText.trim() && onAddComment) {
11955
11872
  onAddComment({
@@ -11974,7 +11891,7 @@ function AddCommentDialog({
11974
11891
  handleSubmit();
11975
11892
  }
11976
11893
  };
11977
- React30__namespace.useEffect(() => {
11894
+ React36__namespace.useEffect(() => {
11978
11895
  if (!open) {
11979
11896
  setCommentText("");
11980
11897
  }
@@ -12037,9 +11954,9 @@ function CommentsSection({
12037
11954
  weekId,
12038
11955
  onAddComment
12039
11956
  }) {
12040
- const [viewCommentsOpen, setViewCommentsOpen] = React30__namespace.useState(true);
12041
- const [addDialogOpen, setAddDialogOpen] = React30__namespace.useState(false);
12042
- const formatDate3 = (date) => {
11957
+ const [viewCommentsOpen, setViewCommentsOpen] = React36__namespace.useState(true);
11958
+ const [addDialogOpen, setAddDialogOpen] = React36__namespace.useState(false);
11959
+ const formatDate6 = (date) => {
12043
11960
  return new Intl.DateTimeFormat("en-US", {
12044
11961
  month: "short",
12045
11962
  day: "numeric",
@@ -12083,7 +12000,7 @@ function CommentsSection({
12083
12000
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: comment.author }),
12084
12001
  comment.supplierName && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[9px] px-1.5 py-0 h-4", children: comment.prefixName ? `${comment.supplierName} - ${comment.prefixName}` : comment.supplierName })
12085
12002
  ] }),
12086
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
12003
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
12087
12004
  ] }),
12088
12005
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: comment.text })
12089
12006
  ] }, comment.id)) })
@@ -12112,7 +12029,7 @@ function DeliveryDetailPage({
12112
12029
  onConfirmLoad
12113
12030
  }) {
12114
12031
  const timelineState = getTimelineState(delivery);
12115
- const elementsByStatus = React30__namespace.useMemo(() => {
12032
+ const elementsByStatus = React36__namespace.useMemo(() => {
12116
12033
  const loaded = delivery.elements.filter((e) => e.status === "loaded");
12117
12034
  const missing = delivery.elements.filter((e) => e.status === "missing");
12118
12035
  const moved = delivery.elements.filter((e) => e.status === "moved");
@@ -12299,11 +12216,11 @@ function SupplierWeeklyLoading({
12299
12216
  bordered = true,
12300
12217
  className
12301
12218
  }) {
12302
- const [selectedDelivery, setSelectedDelivery] = React30__namespace.useState(null);
12303
- const [sheetOpen, setSheetOpen] = React30__namespace.useState(false);
12304
- const [commentDelivery, setCommentDelivery] = React30__namespace.useState(null);
12305
- const [commentDialogOpen, setCommentDialogOpen] = React30__namespace.useState(false);
12306
- const [commentText, setCommentText] = React30__namespace.useState("");
12219
+ const [selectedDelivery, setSelectedDelivery] = React36__namespace.useState(null);
12220
+ const [sheetOpen, setSheetOpen] = React36__namespace.useState(false);
12221
+ const [commentDelivery, setCommentDelivery] = React36__namespace.useState(null);
12222
+ const [commentDialogOpen, setCommentDialogOpen] = React36__namespace.useState(false);
12223
+ const [commentText, setCommentText] = React36__namespace.useState("");
12307
12224
  const handleDeliveryClick = (delivery) => {
12308
12225
  setSelectedDelivery(delivery);
12309
12226
  setSheetOpen(true);
@@ -12346,7 +12263,7 @@ function SupplierWeeklyLoading({
12346
12263
  handleCommentSubmit();
12347
12264
  }
12348
12265
  };
12349
- const insightMetrics = React30__namespace.useMemo(() => {
12266
+ const insightMetrics = React36__namespace.useMemo(() => {
12350
12267
  const totalDeliveries = deliveries.length;
12351
12268
  const readyDeliveries = deliveries.filter((d) => d.isReadyToUnload).length;
12352
12269
  deliveries.filter(
@@ -12765,11 +12682,11 @@ function CapacityPlanningChart({
12765
12682
  allowDragDrop = true,
12766
12683
  className
12767
12684
  }) {
12768
- const containerRef = React30__namespace.useRef(null);
12769
- const [draggedPackage, setDraggedPackage] = React30__namespace.useState(null);
12770
- const [showUnassigned, setShowUnassigned] = React30__namespace.useState(true);
12771
- const [containerWidth, setContainerWidth] = React30__namespace.useState(0);
12772
- React30__namespace.useEffect(() => {
12685
+ const containerRef = React36__namespace.useRef(null);
12686
+ const [draggedPackage, setDraggedPackage] = React36__namespace.useState(null);
12687
+ const [showUnassigned, setShowUnassigned] = React36__namespace.useState(true);
12688
+ const [containerWidth, setContainerWidth] = React36__namespace.useState(0);
12689
+ React36__namespace.useEffect(() => {
12773
12690
  const updateWidth = () => {
12774
12691
  if (containerRef.current) {
12775
12692
  setContainerWidth(containerRef.current.offsetWidth);
@@ -12782,15 +12699,15 @@ function CapacityPlanningChart({
12782
12699
  }
12783
12700
  return () => observer.disconnect();
12784
12701
  }, []);
12785
- const cumulativeNeed = React30__namespace.useMemo(
12702
+ const cumulativeNeed = React36__namespace.useMemo(
12786
12703
  () => calculateCumulativeNeed(weeks, deliveries),
12787
12704
  [weeks, deliveries]
12788
12705
  );
12789
- const packagePositions = React30__namespace.useMemo(
12706
+ const packagePositions = React36__namespace.useMemo(
12790
12707
  () => calculatePackagePositions(packages, weeks),
12791
12708
  [packages, weeks]
12792
12709
  );
12793
- const deliveriesByWeek = React30__namespace.useMemo(() => {
12710
+ const deliveriesByWeek = React36__namespace.useMemo(() => {
12794
12711
  const map = /* @__PURE__ */ new Map();
12795
12712
  for (const d of deliveries) {
12796
12713
  const existing = map.get(d.weekKey) || [];
@@ -13327,7 +13244,7 @@ var calculateInnerOffset = (date, range, columnWidth) => {
13327
13244
  const dayOfMonth = date.getDate();
13328
13245
  return dayOfMonth / totalRangeDays * columnWidth;
13329
13246
  };
13330
- var GanttContext = React30.createContext({
13247
+ var GanttContext = React36.createContext({
13331
13248
  zoom: 100,
13332
13249
  range: "monthly",
13333
13250
  columnWidth: 50,
@@ -13343,13 +13260,13 @@ var GanttContext = React30.createContext({
13343
13260
  setGroupExpanded: () => {
13344
13261
  }
13345
13262
  });
13346
- var useGanttContext = () => React30.useContext(GanttContext);
13263
+ var useGanttContext = () => React36.useContext(GanttContext);
13347
13264
  var GanttContentHeader = ({
13348
13265
  title,
13349
13266
  columns,
13350
13267
  renderHeaderItem
13351
13268
  }) => {
13352
- const id = React30.useId();
13269
+ const id = React36.useId();
13353
13270
  return /* @__PURE__ */ jsxRuntime.jsxs(
13354
13271
  "div",
13355
13272
  {
@@ -13397,8 +13314,8 @@ var getWeekStartDate = (year, weekNumber) => {
13397
13314
  return dateFns.addWeeks(week1Start, weekNumber - 1);
13398
13315
  };
13399
13316
  var WeeklyHeader = () => {
13400
- const gantt = React30.useContext(GanttContext);
13401
- const weeklyData = React30.useMemo(() => {
13317
+ const gantt = React36.useContext(GanttContext);
13318
+ const weeklyData = React36.useMemo(() => {
13402
13319
  const result = [];
13403
13320
  for (const yearData of gantt.timelineData) {
13404
13321
  const year = yearData.year;
@@ -13433,7 +13350,7 @@ var WeeklyHeader = () => {
13433
13350
  ] }, yearData.year));
13434
13351
  };
13435
13352
  var MonthlyHeader = () => {
13436
- const gantt = React30.useContext(GanttContext);
13353
+ const gantt = React36.useContext(GanttContext);
13437
13354
  return gantt.timelineData.map((year) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col", children: [
13438
13355
  /* @__PURE__ */ jsxRuntime.jsx(
13439
13356
  GanttContentHeader,
@@ -13452,7 +13369,7 @@ var MonthlyHeader = () => {
13452
13369
  ] }, year.year));
13453
13370
  };
13454
13371
  var QuarterlyHeader = () => {
13455
- const gantt = React30.useContext(GanttContext);
13372
+ const gantt = React36.useContext(GanttContext);
13456
13373
  return gantt.timelineData.map(
13457
13374
  (year) => year.quarters.map((quarter, quarterIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
13458
13375
  "div",
@@ -13480,7 +13397,7 @@ var headers = {
13480
13397
  quarterly: QuarterlyHeader
13481
13398
  };
13482
13399
  var GanttHeader = ({ className }) => {
13483
- const gantt = React30.useContext(GanttContext);
13400
+ const gantt = React36.useContext(GanttContext);
13484
13401
  const Header2 = headers[gantt.range];
13485
13402
  return /* @__PURE__ */ jsxRuntime.jsx(
13486
13403
  "div",
@@ -13498,7 +13415,7 @@ var GanttSidebarItem = ({
13498
13415
  onSelectItem,
13499
13416
  className
13500
13417
  }) => {
13501
- const gantt = React30.useContext(GanttContext);
13418
+ const gantt = React36.useContext(GanttContext);
13502
13419
  const tempEndAt = feature.endAt && dateFns.isSameDay(feature.startAt, feature.endAt) ? dateFns.addDays(feature.endAt, 1) : feature.endAt;
13503
13420
  const duration = tempEndAt ? dateFns.formatDistance(feature.startAt, tempEndAt) : `${dateFns.formatDistance(feature.startAt, /* @__PURE__ */ new Date())} so far`;
13504
13421
  const handleClick = (event) => {
@@ -13574,24 +13491,24 @@ function computeGroupRange(features) {
13574
13491
  }
13575
13492
  return { start: minStart, end: maxEnd };
13576
13493
  }
13577
- var GanttGroupSummaryBar = React30.memo(({
13494
+ var GanttGroupSummaryBar = React36.memo(({
13578
13495
  group,
13579
13496
  className
13580
13497
  }) => {
13581
- const gantt = React30.useContext(GanttContext);
13582
- const timelineStartDate = React30.useMemo(
13498
+ const gantt = React36.useContext(GanttContext);
13499
+ const timelineStartDate = React36.useMemo(
13583
13500
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
13584
13501
  [gantt.timelineData]
13585
13502
  );
13586
- const { start: groupStart, end: groupEnd } = React30.useMemo(
13503
+ const { start: groupStart, end: groupEnd } = React36.useMemo(
13587
13504
  () => computeGroupRange(group.features),
13588
13505
  [group.features]
13589
13506
  );
13590
- const offset = React30.useMemo(() => {
13507
+ const offset = React36.useMemo(() => {
13591
13508
  if (!groupStart) return 0;
13592
13509
  return Math.round(getOffset(groupStart, timelineStartDate, gantt));
13593
13510
  }, [groupStart, timelineStartDate, gantt]);
13594
- const width = React30.useMemo(() => {
13511
+ const width = React36.useMemo(() => {
13595
13512
  if (!groupStart || !groupEnd) return 0;
13596
13513
  return Math.round(getWidth(groupStart, groupEnd, gantt));
13597
13514
  }, [groupStart, groupEnd, gantt]);
@@ -13631,13 +13548,13 @@ var GanttCollapsibleSidebarGroup = ({
13631
13548
  children,
13632
13549
  className
13633
13550
  }) => {
13634
- const gantt = React30.useContext(GanttContext);
13551
+ const gantt = React36.useContext(GanttContext);
13635
13552
  const isExpanded = gantt.expandedGroups[group.id] ?? true;
13636
- const { start: groupStart, end: groupEnd } = React30.useMemo(
13553
+ const { start: groupStart, end: groupEnd } = React36.useMemo(
13637
13554
  () => computeGroupRange(group.features),
13638
13555
  [group.features]
13639
13556
  );
13640
- const duration = React30.useMemo(() => {
13557
+ const duration = React36.useMemo(() => {
13641
13558
  if (!groupStart || !groupEnd) return null;
13642
13559
  return dateFns.formatDistance(groupStart, groupEnd);
13643
13560
  }, [groupStart, groupEnd]);
@@ -13681,7 +13598,7 @@ var GanttCollapsibleTimelineGroup = ({
13681
13598
  children,
13682
13599
  className
13683
13600
  }) => {
13684
- const gantt = React30.useContext(GanttContext);
13601
+ const gantt = React36.useContext(GanttContext);
13685
13602
  const isExpanded = gantt.expandedGroups[group.id] ?? true;
13686
13603
  return /* @__PURE__ */ jsxRuntime.jsxs(
13687
13604
  Collapsible,
@@ -13741,7 +13658,7 @@ var GanttAddFeatureHelper = ({
13741
13658
  className
13742
13659
  }) => {
13743
13660
  const [scrollX] = useGanttScrollX();
13744
- const gantt = React30.useContext(GanttContext);
13661
+ const gantt = React36.useContext(GanttContext);
13745
13662
  const [mousePosition, mouseRef] = usehooks.useMouse();
13746
13663
  const handleClick = () => {
13747
13664
  const ganttRect = gantt.ref?.current?.getBoundingClientRect();
@@ -13780,10 +13697,10 @@ var GanttColumn = ({
13780
13697
  index,
13781
13698
  isColumnSecondary
13782
13699
  }) => {
13783
- const gantt = React30.useContext(GanttContext);
13700
+ const gantt = React36.useContext(GanttContext);
13784
13701
  const [dragging] = useGanttDragging();
13785
13702
  const [mousePosition, mouseRef] = usehooks.useMouse();
13786
- const [hovering, setHovering] = React30.useState(false);
13703
+ const [hovering, setHovering] = React36.useState(false);
13787
13704
  const [windowScroll] = usehooks.useWindowScroll();
13788
13705
  const handleMouseEnter = () => setHovering(true);
13789
13706
  const handleMouseLeave = () => setHovering(false);
@@ -13813,7 +13730,7 @@ var GanttColumns = ({
13813
13730
  columns,
13814
13731
  isColumnSecondary
13815
13732
  }) => {
13816
- const id = React30.useId();
13733
+ const id = React36.useId();
13817
13734
  return /* @__PURE__ */ jsxRuntime.jsx(
13818
13735
  "div",
13819
13736
  {
@@ -13832,12 +13749,12 @@ var GanttColumns = ({
13832
13749
  }
13833
13750
  );
13834
13751
  };
13835
- var GanttGridLines = React30.memo(({
13752
+ var GanttGridLines = React36.memo(({
13836
13753
  className
13837
13754
  }) => {
13838
- const gantt = React30.useContext(GanttContext);
13839
- const id = React30.useId();
13840
- const { columns, monthBoundaryIndices } = React30.useMemo(() => {
13755
+ const gantt = React36.useContext(GanttContext);
13756
+ const id = React36.useId();
13757
+ const { columns, monthBoundaryIndices } = React36.useMemo(() => {
13841
13758
  let totalColumns = 0;
13842
13759
  const monthIndices = [];
13843
13760
  if (gantt.range === "weekly") {
@@ -13901,7 +13818,7 @@ var GanttCreateMarkerTrigger = ({
13901
13818
  onCreateMarker,
13902
13819
  className
13903
13820
  }) => {
13904
- const gantt = React30.useContext(GanttContext);
13821
+ const gantt = React36.useContext(GanttContext);
13905
13822
  const [mousePosition, mouseRef] = usehooks.useMouse();
13906
13823
  const [windowScroll] = usehooks.useWindowScroll();
13907
13824
  const x = usehooks.useThrottle(
@@ -13950,7 +13867,7 @@ var GanttFeatureDragHelper = ({
13950
13867
  id: `feature-drag-helper-${featureId}`
13951
13868
  });
13952
13869
  const isPressed = Boolean(attributes["aria-pressed"]);
13953
- React30.useEffect(() => setDragging(isPressed), [isPressed, setDragging]);
13870
+ React36.useEffect(() => setDragging(isPressed), [isPressed, setDragging]);
13954
13871
  return /* @__PURE__ */ jsxRuntime.jsxs(
13955
13872
  "div",
13956
13873
  {
@@ -13996,7 +13913,7 @@ var GanttFeatureItemCard = ({
13996
13913
  const [, setDragging] = useGanttDragging();
13997
13914
  const { attributes, listeners, setNodeRef } = core.useDraggable({ id });
13998
13915
  const isPressed = Boolean(attributes["aria-pressed"]);
13999
- React30.useEffect(() => setDragging(isPressed), [isPressed, setDragging]);
13916
+ React36.useEffect(() => setDragging(isPressed), [isPressed, setDragging]);
14000
13917
  return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "h-full w-full rounded-sm border bg-background px-2 py-1.5 text-xs shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
14001
13918
  "div",
14002
13919
  {
@@ -14022,37 +13939,37 @@ var GanttFeatureItem = ({
14022
13939
  ...feature
14023
13940
  }) => {
14024
13941
  const [scrollX] = useGanttScrollX();
14025
- const gantt = React30.useContext(GanttContext);
14026
- const timelineStartDate = React30.useMemo(
13942
+ const gantt = React36.useContext(GanttContext);
13943
+ const timelineStartDate = React36.useMemo(
14027
13944
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
14028
13945
  [gantt.timelineData]
14029
13946
  );
14030
- const [startAt, setStartAt] = React30.useState(feature.startAt);
14031
- const [endAt, setEndAt] = React30.useState(feature.endAt);
14032
- const width = React30.useMemo(
13947
+ const [startAt, setStartAt] = React36.useState(feature.startAt);
13948
+ const [endAt, setEndAt] = React36.useState(feature.endAt);
13949
+ const width = React36.useMemo(
14033
13950
  () => Math.round(getWidth(startAt, endAt, gantt)),
14034
13951
  [startAt, endAt, gantt]
14035
13952
  );
14036
- const offset = React30.useMemo(
13953
+ const offset = React36.useMemo(
14037
13954
  () => Math.round(getOffset(startAt, timelineStartDate, gantt)),
14038
13955
  [startAt, timelineStartDate, gantt]
14039
13956
  );
14040
- const addRange = React30.useMemo(() => getAddRange(gantt.range), [gantt.range]);
13957
+ const addRange = React36.useMemo(() => getAddRange(gantt.range), [gantt.range]);
14041
13958
  const [mousePosition] = usehooks.useMouse();
14042
- const [previousMouseX, setPreviousMouseX] = React30.useState(0);
14043
- const [previousStartAt, setPreviousStartAt] = React30.useState(startAt);
14044
- const [previousEndAt, setPreviousEndAt] = React30.useState(endAt);
13959
+ const [previousMouseX, setPreviousMouseX] = React36.useState(0);
13960
+ const [previousStartAt, setPreviousStartAt] = React36.useState(startAt);
13961
+ const [previousEndAt, setPreviousEndAt] = React36.useState(endAt);
14045
13962
  const mouseSensor = core.useSensor(core.MouseSensor, {
14046
13963
  activationConstraint: {
14047
13964
  distance: 10
14048
13965
  }
14049
13966
  });
14050
- const handleItemDragStart = React30.useCallback(() => {
13967
+ const handleItemDragStart = React36.useCallback(() => {
14051
13968
  setPreviousMouseX(mousePosition.x);
14052
13969
  setPreviousStartAt(startAt);
14053
13970
  setPreviousEndAt(endAt);
14054
13971
  }, [mousePosition.x, startAt, endAt]);
14055
- const handleItemDragMove = React30.useCallback(() => {
13972
+ const handleItemDragMove = React36.useCallback(() => {
14056
13973
  const currentDate = getDateByMousePosition(gantt, mousePosition.x);
14057
13974
  const originalDate = getDateByMousePosition(gantt, previousMouseX);
14058
13975
  const delta = gantt.range === "weekly" ? dateFns.differenceInDays(currentDate, originalDate) : getInnerDifferenceIn(gantt.range)(currentDate, originalDate);
@@ -14061,17 +13978,17 @@ var GanttFeatureItem = ({
14061
13978
  setStartAt(newStartDate);
14062
13979
  setEndAt(newEndDate);
14063
13980
  }, [gantt, mousePosition.x, previousMouseX, previousStartAt, previousEndAt]);
14064
- const onDragEnd = React30.useCallback(
13981
+ const onDragEnd = React36.useCallback(
14065
13982
  () => onMove?.(feature.id, startAt, endAt),
14066
13983
  [onMove, feature.id, startAt, endAt]
14067
13984
  );
14068
- const handleLeftDragMove = React30.useCallback(() => {
13985
+ const handleLeftDragMove = React36.useCallback(() => {
14069
13986
  const ganttRect = gantt.ref?.current?.getBoundingClientRect();
14070
13987
  const x = mousePosition.x - (ganttRect?.left ?? 0) + scrollX - gantt.sidebarWidth;
14071
13988
  const newStartAt = getDateByMousePosition(gantt, x);
14072
13989
  setStartAt(newStartAt);
14073
13990
  }, [gantt, mousePosition.x, scrollX]);
14074
- const handleRightDragMove = React30.useCallback(() => {
13991
+ const handleRightDragMove = React36.useCallback(() => {
14075
13992
  const ganttRect = gantt.ref?.current?.getBoundingClientRect();
14076
13993
  const x = mousePosition.x - (ganttRect?.left ?? 0) + scrollX - gantt.sidebarWidth;
14077
13994
  const newEndAt = getDateByMousePosition(gantt, x);
@@ -14267,21 +14184,21 @@ var GanttFeatureList = ({
14267
14184
  children
14268
14185
  }
14269
14186
  );
14270
- var GanttMarker = React30.memo(({ label, date, id, onRemove, className }) => {
14271
- const gantt = React30.useContext(GanttContext);
14272
- const differenceIn = React30.useMemo(
14187
+ var GanttMarker = React36.memo(({ label, date, id, onRemove, className }) => {
14188
+ const gantt = React36.useContext(GanttContext);
14189
+ const differenceIn = React36.useMemo(
14273
14190
  () => getDifferenceIn(gantt.range),
14274
14191
  [gantt.range]
14275
14192
  );
14276
- const timelineStartDate = React30.useMemo(
14193
+ const timelineStartDate = React36.useMemo(
14277
14194
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
14278
14195
  [gantt.timelineData]
14279
14196
  );
14280
- const offset = React30.useMemo(
14197
+ const offset = React36.useMemo(
14281
14198
  () => differenceIn(date, timelineStartDate),
14282
14199
  [differenceIn, date, timelineStartDate]
14283
14200
  );
14284
- const innerOffset = React30.useMemo(
14201
+ const innerOffset = React36.useMemo(
14285
14202
  () => calculateInnerOffset(
14286
14203
  date,
14287
14204
  gantt.range,
@@ -14289,7 +14206,7 @@ var GanttMarker = React30.memo(({ label, date, id, onRemove, className }) => {
14289
14206
  ),
14290
14207
  [date, gantt.range, gantt.columnWidth, gantt.zoom]
14291
14208
  );
14292
- const handleRemove = React30.useCallback(() => onRemove?.(id), [onRemove, id]);
14209
+ const handleRemove = React36.useCallback(() => onRemove?.(id), [onRemove, id]);
14293
14210
  return /* @__PURE__ */ jsxRuntime.jsxs(
14294
14211
  "div",
14295
14212
  {
@@ -14339,14 +14256,14 @@ var GanttProvider = ({
14339
14256
  className,
14340
14257
  defaultExpandedGroups = {}
14341
14258
  }) => {
14342
- const scrollRef = React30.useRef(null);
14343
- const [timelineData, setTimelineData] = React30.useState(
14259
+ const scrollRef = React36.useRef(null);
14260
+ const [timelineData, setTimelineData] = React36.useState(
14344
14261
  createInitialTimelineData(/* @__PURE__ */ new Date())
14345
14262
  );
14346
14263
  const [, setScrollX] = useGanttScrollX();
14347
14264
  const sidebarWidth = 280;
14348
- const [expandedGroups, setExpandedGroups] = React30.useState(defaultExpandedGroups);
14349
- const setGroupExpanded = React30.useCallback((groupId, expanded) => {
14265
+ const [expandedGroups, setExpandedGroups] = React36.useState(defaultExpandedGroups);
14266
+ const setGroupExpanded = React36.useCallback((groupId, expanded) => {
14350
14267
  setExpandedGroups((prev) => ({ ...prev, [groupId]: expanded }));
14351
14268
  }, []);
14352
14269
  const headerHeight = 60;
@@ -14357,7 +14274,7 @@ var GanttProvider = ({
14357
14274
  } else if (range === "quarterly") {
14358
14275
  columnWidth = 100;
14359
14276
  }
14360
- const cssVariables = React30.useMemo(
14277
+ const cssVariables = React36.useMemo(
14361
14278
  () => ({
14362
14279
  "--gantt-zoom": `${zoom}`,
14363
14280
  "--gantt-column-width": `${zoom / 100 * columnWidth}px`,
@@ -14367,13 +14284,13 @@ var GanttProvider = ({
14367
14284
  }),
14368
14285
  [zoom, columnWidth, sidebarWidth]
14369
14286
  );
14370
- React30.useEffect(() => {
14287
+ React36.useEffect(() => {
14371
14288
  if (scrollRef.current) {
14372
14289
  scrollRef.current.scrollLeft = scrollRef.current.scrollWidth / 2 - scrollRef.current.clientWidth / 2;
14373
14290
  setScrollX(scrollRef.current.scrollLeft);
14374
14291
  }
14375
14292
  }, [setScrollX]);
14376
- const handleScroll = React30.useCallback(
14293
+ const handleScroll = React36.useCallback(
14377
14294
  throttle__default.default(() => {
14378
14295
  const scrollElement = scrollRef.current;
14379
14296
  if (!scrollElement) {
@@ -14425,7 +14342,7 @@ var GanttProvider = ({
14425
14342
  }, 100),
14426
14343
  []
14427
14344
  );
14428
- React30.useEffect(() => {
14345
+ React36.useEffect(() => {
14429
14346
  const scrollElement = scrollRef.current;
14430
14347
  if (scrollElement) {
14431
14348
  scrollElement.addEventListener("scroll", handleScroll);
@@ -14436,7 +14353,7 @@ var GanttProvider = ({
14436
14353
  }
14437
14354
  };
14438
14355
  }, [handleScroll]);
14439
- const scrollToFeature = React30.useCallback(
14356
+ const scrollToFeature = React36.useCallback(
14440
14357
  (feature) => {
14441
14358
  const scrollElement = scrollRef.current;
14442
14359
  if (!scrollElement) {
@@ -14516,21 +14433,21 @@ var GanttTimeline = ({
14516
14433
  );
14517
14434
  var GanttToday = ({ className }) => {
14518
14435
  const label = "Today";
14519
- const date = React30.useMemo(() => /* @__PURE__ */ new Date(), []);
14520
- const gantt = React30.useContext(GanttContext);
14521
- const differenceIn = React30.useMemo(
14436
+ const date = React36.useMemo(() => /* @__PURE__ */ new Date(), []);
14437
+ const gantt = React36.useContext(GanttContext);
14438
+ const differenceIn = React36.useMemo(
14522
14439
  () => getDifferenceIn(gantt.range),
14523
14440
  [gantt.range]
14524
14441
  );
14525
- const timelineStartDate = React30.useMemo(
14442
+ const timelineStartDate = React36.useMemo(
14526
14443
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
14527
14444
  [gantt.timelineData]
14528
14445
  );
14529
- const offset = React30.useMemo(
14446
+ const offset = React36.useMemo(
14530
14447
  () => differenceIn(date, timelineStartDate),
14531
14448
  [differenceIn, date, timelineStartDate]
14532
14449
  );
14533
- const innerOffset = React30.useMemo(
14450
+ const innerOffset = React36.useMemo(
14534
14451
  () => Math.round(calculateInnerOffset(
14535
14452
  date,
14536
14453
  gantt.range,
@@ -14622,11 +14539,11 @@ var getWeekStartDate2 = (year, weekNumber) => {
14622
14539
  targetDate.setDate(week1Start.getDate() + (weekNumber - 1) * 7);
14623
14540
  return targetDate;
14624
14541
  };
14625
- var EnhancedGridLines = React30.memo(({ rowCount }) => {
14542
+ var EnhancedGridLines = React36.memo(({ rowCount }) => {
14626
14543
  const gantt = useGanttContext();
14627
- const id = React30__namespace.useId();
14544
+ const id = React36__namespace.useId();
14628
14545
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
14629
- const { verticalLines, totalColumns } = React30.useMemo(() => {
14546
+ const { verticalLines, totalColumns } = React36.useMemo(() => {
14630
14547
  const lines = [];
14631
14548
  let totalCols = 0;
14632
14549
  if (gantt.range === "weekly") {
@@ -14666,7 +14583,7 @@ var EnhancedGridLines = React30.memo(({ rowCount }) => {
14666
14583
  }
14667
14584
  return { verticalLines: lines, totalColumns: totalCols };
14668
14585
  }, [gantt.timelineData, gantt.range, columnWidth]);
14669
- const horizontalLines = React30.useMemo(() => {
14586
+ const horizontalLines = React36.useMemo(() => {
14670
14587
  const lines = [];
14671
14588
  for (let i = 0; i <= rowCount; i++) {
14672
14589
  lines.push(i);
@@ -14716,7 +14633,7 @@ var EnhancedGridLines = React30.memo(({ rowCount }) => {
14716
14633
  ] });
14717
14634
  });
14718
14635
  EnhancedGridLines.displayName = "EnhancedGridLines";
14719
- var DeliveryCut = React30.memo(({
14636
+ var DeliveryCut = React36.memo(({
14720
14637
  date,
14721
14638
  packageEndDate,
14722
14639
  packageName,
@@ -14724,19 +14641,19 @@ var DeliveryCut = React30.memo(({
14724
14641
  feasibility
14725
14642
  }) => {
14726
14643
  const gantt = useGanttContext();
14727
- const timelineStartDate = React30.useMemo(
14644
+ const timelineStartDate = React36.useMemo(
14728
14645
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
14729
14646
  [gantt.timelineData]
14730
14647
  );
14731
- const offset = React30.useMemo(
14648
+ const offset = React36.useMemo(
14732
14649
  () => Math.round(getOffset(date, timelineStartDate, gantt)),
14733
14650
  [date, timelineStartDate, gantt]
14734
14651
  );
14735
- const deltaDays = React30.useMemo(
14652
+ const deltaDays = React36.useMemo(
14736
14653
  () => dateFns.differenceInDays(date, packageEndDate),
14737
14654
  [date, packageEndDate]
14738
14655
  );
14739
- const colors = React30.useMemo(() => {
14656
+ const colors = React36.useMemo(() => {
14740
14657
  switch (feasibility) {
14741
14658
  case "feasible":
14742
14659
  return {
@@ -14765,7 +14682,7 @@ var DeliveryCut = React30.memo(({
14765
14682
  };
14766
14683
  }
14767
14684
  }, [feasibility]);
14768
- const deltaText = React30.useMemo(() => {
14685
+ const deltaText = React36.useMemo(() => {
14769
14686
  if (deltaDays > 0) {
14770
14687
  return `+${deltaDays}d buffer`;
14771
14688
  } else if (deltaDays < 0) {
@@ -14803,7 +14720,7 @@ var DeliveryCut = React30.memo(({
14803
14720
  );
14804
14721
  });
14805
14722
  DeliveryCut.displayName = "DeliveryCut";
14806
- var FeasibilityFeatureItem = React30.memo(({
14723
+ var FeasibilityFeatureItem = React36.memo(({
14807
14724
  feature,
14808
14725
  pkg,
14809
14726
  feasibility,
@@ -14814,35 +14731,35 @@ var FeasibilityFeatureItem = React30.memo(({
14814
14731
  }) => {
14815
14732
  const gantt = useGanttContext();
14816
14733
  const [, setDragging] = useGanttDragging();
14817
- const timelineStartDate = React30.useMemo(
14734
+ const timelineStartDate = React36.useMemo(
14818
14735
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
14819
14736
  [gantt.timelineData]
14820
14737
  );
14821
- const [startAt, setStartAt] = React30.useState(feature.startAt);
14822
- const [endAt, setEndAt] = React30.useState(feature.endAt);
14823
- const originalDuration = React30.useMemo(
14738
+ const [startAt, setStartAt] = React36.useState(feature.startAt);
14739
+ const [endAt, setEndAt] = React36.useState(feature.endAt);
14740
+ const originalDuration = React36.useMemo(
14824
14741
  () => dateFns.differenceInDays(feature.endAt, feature.startAt),
14825
14742
  [feature.endAt, feature.startAt]
14826
14743
  );
14827
- const width = React30.useMemo(
14744
+ const width = React36.useMemo(
14828
14745
  () => Math.round(getWidth(startAt, endAt, gantt)),
14829
14746
  [startAt, endAt, gantt]
14830
14747
  );
14831
- const offset = React30.useMemo(
14748
+ const offset = React36.useMemo(
14832
14749
  () => Math.round(getOffset(startAt, timelineStartDate, gantt)),
14833
14750
  [startAt, timelineStartDate, gantt]
14834
14751
  );
14835
14752
  const [mousePosition] = usehooks.useMouse();
14836
- const [previousMouseX, setPreviousMouseX] = React30.useState(0);
14837
- const [previousStartAt, setPreviousStartAt] = React30.useState(startAt);
14753
+ const [previousMouseX, setPreviousMouseX] = React36.useState(0);
14754
+ const [previousStartAt, setPreviousStartAt] = React36.useState(startAt);
14838
14755
  const mouseSensor = core.useSensor(core.MouseSensor, {
14839
14756
  activationConstraint: { distance: 10 }
14840
14757
  });
14841
- const handleDragStart = React30.useCallback(() => {
14758
+ const handleDragStart = React36.useCallback(() => {
14842
14759
  setPreviousMouseX(mousePosition.x);
14843
14760
  setPreviousStartAt(startAt);
14844
14761
  }, [mousePosition.x, startAt]);
14845
- const handleDragMove = React30.useCallback(() => {
14762
+ const handleDragMove = React36.useCallback(() => {
14846
14763
  const currentDate = getDateByMousePosition(gantt, mousePosition.x);
14847
14764
  const originalDate = getDateByMousePosition(gantt, previousMouseX);
14848
14765
  const delta = dateFns.differenceInDays(currentDate, originalDate);
@@ -14851,18 +14768,18 @@ var FeasibilityFeatureItem = React30.memo(({
14851
14768
  setStartAt(newStart);
14852
14769
  setEndAt(newEnd);
14853
14770
  }, [gantt, mousePosition.x, previousMouseX, previousStartAt, originalDuration]);
14854
- const handleDragEnd = React30.useCallback(() => {
14771
+ const handleDragEnd = React36.useCallback(() => {
14855
14772
  onMove?.(feature.id, startAt, endAt);
14856
14773
  }, [onMove, feature.id, startAt, endAt]);
14857
14774
  const { attributes, listeners, setNodeRef, isDragging } = core.useDraggable({
14858
14775
  id: `feature-${feature.id}`
14859
14776
  });
14860
- React30.useEffect(() => setDragging(isDragging), [isDragging, setDragging]);
14777
+ React36.useEffect(() => setDragging(isDragging), [isDragging, setDragging]);
14861
14778
  const color = feature.status.color;
14862
- const handleMouseEnter = React30.useCallback(() => {
14779
+ const handleMouseEnter = React36.useCallback(() => {
14863
14780
  onHoverChange?.(true);
14864
14781
  }, [onHoverChange]);
14865
- const handleMouseLeave = React30.useCallback(() => {
14782
+ const handleMouseLeave = React36.useCallback(() => {
14866
14783
  onHoverChange?.(false);
14867
14784
  }, [onHoverChange]);
14868
14785
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -14996,13 +14913,13 @@ function ProductionPackageGantt({
14996
14913
  zoom = 100,
14997
14914
  className
14998
14915
  }) {
14999
- const [packageDates, setPackageDates] = React30.useState(
14916
+ const [packageDates, setPackageDates] = React36.useState(
15000
14917
  () => new Map(packages.map((pkg) => [pkg.id, { startDate: pkg.startDate, endDate: pkg.endDate }]))
15001
14918
  );
15002
- const [hoveredPackageId, setHoveredPackageId] = React30.useState(null);
15003
- const [selectedPackage, setSelectedPackage] = React30.useState(null);
15004
- const [sheetOpen, setSheetOpen] = React30.useState(false);
15005
- const packageFeasibility = React30.useMemo(() => {
14919
+ const [hoveredPackageId, setHoveredPackageId] = React36.useState(null);
14920
+ const [selectedPackage, setSelectedPackage] = React36.useState(null);
14921
+ const [sheetOpen, setSheetOpen] = React36.useState(false);
14922
+ const packageFeasibility = React36.useMemo(() => {
15006
14923
  const result = /* @__PURE__ */ new Map();
15007
14924
  for (const pkg of packages) {
15008
14925
  const dates = packageDates.get(pkg.id) ?? { startDate: pkg.startDate, endDate: pkg.endDate };
@@ -15010,7 +14927,7 @@ function ProductionPackageGantt({
15010
14927
  }
15011
14928
  return result;
15012
14929
  }, [packages, packageDates]);
15013
- const ganttFeatures = React30.useMemo(() => {
14930
+ const ganttFeatures = React36.useMemo(() => {
15014
14931
  return packages.map((pkg) => {
15015
14932
  const dates = packageDates.get(pkg.id) ?? { startDate: pkg.startDate, endDate: pkg.endDate };
15016
14933
  const status = packageFeasibility.get(pkg.id) ?? "feasible";
@@ -15027,7 +14944,7 @@ function ProductionPackageGantt({
15027
14944
  };
15028
14945
  });
15029
14946
  }, [packages, packageDates, packageFeasibility]);
15030
- const handleFeatureMove = React30.useCallback((id, startAt, endAt) => {
14947
+ const handleFeatureMove = React36.useCallback((id, startAt, endAt) => {
15031
14948
  setPackageDates((prev) => {
15032
14949
  const next = new Map(prev);
15033
14950
  next.set(id, { startDate: startAt, endDate: endAt });
@@ -15035,15 +14952,15 @@ function ProductionPackageGantt({
15035
14952
  });
15036
14953
  onPackageMove?.(id, startAt, endAt);
15037
14954
  }, [onPackageMove]);
15038
- const handlePackageClick = React30.useCallback((pkg) => {
14955
+ const handlePackageClick = React36.useCallback((pkg) => {
15039
14956
  setSelectedPackage(pkg);
15040
14957
  setSheetOpen(true);
15041
14958
  onPackageClick?.(pkg);
15042
14959
  }, [onPackageClick]);
15043
- const handleHoverChange = React30.useCallback((pkgId, isHovered) => {
14960
+ const handleHoverChange = React36.useCallback((pkgId, isHovered) => {
15044
14961
  setHoveredPackageId(isHovered ? pkgId : null);
15045
14962
  }, []);
15046
- const insightMetrics = React30.useMemo(() => {
14963
+ const insightMetrics = React36.useMemo(() => {
15047
14964
  const feasibleCount = Array.from(packageFeasibility.values()).filter((s) => s === "feasible").length;
15048
14965
  const atRiskCount = Array.from(packageFeasibility.values()).filter((s) => s === "at-risk").length;
15049
14966
  const infeasibleCount = Array.from(packageFeasibility.values()).filter((s) => s === "infeasible").length;
@@ -15217,11 +15134,11 @@ function getPhaseColor(phaseId, customColor) {
15217
15134
  if (customColor) return customColor;
15218
15135
  return PHASE_COLORS[phaseId] || "hsl(var(--chart-5))";
15219
15136
  }
15220
- var LightweightGridLines = React30.memo(() => {
15137
+ var LightweightGridLines = React36.memo(() => {
15221
15138
  const gantt = useGanttContext();
15222
- const id = React30__namespace.useId();
15139
+ const id = React36__namespace.useId();
15223
15140
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
15224
- const { lines, totalWidth } = React30.useMemo(() => {
15141
+ const { lines, totalWidth } = React36.useMemo(() => {
15225
15142
  const linePositions = [];
15226
15143
  let currentOffset = 0;
15227
15144
  let weekCounter = 0;
@@ -15268,13 +15185,13 @@ var LightweightGridLines = React30.memo(() => {
15268
15185
  );
15269
15186
  });
15270
15187
  LightweightGridLines.displayName = "LightweightGridLines";
15271
- var DeadlineMarker = React30.memo(({ date, label, visible }) => {
15188
+ var DeadlineMarker = React36.memo(({ date, label, visible }) => {
15272
15189
  const gantt = useGanttContext();
15273
- const timelineStartDate = React30.useMemo(
15190
+ const timelineStartDate = React36.useMemo(
15274
15191
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
15275
15192
  [gantt.timelineData]
15276
15193
  );
15277
- const offset = React30.useMemo(
15194
+ const offset = React36.useMemo(
15278
15195
  () => Math.round(getOffset(date, timelineStartDate, gantt)),
15279
15196
  [date, timelineStartDate, gantt]
15280
15197
  );
@@ -15318,8 +15235,8 @@ var DeadlineMarker = React30.memo(({ date, label, visible }) => {
15318
15235
  );
15319
15236
  });
15320
15237
  DeadlineMarker.displayName = "DeadlineMarker";
15321
- var PhaseIndicator = React30.memo(({ type, onClick }) => {
15322
- const handleClick = React30.useCallback((e) => {
15238
+ var PhaseIndicator = React36.memo(({ type, onClick }) => {
15239
+ const handleClick = React36.useCallback((e) => {
15323
15240
  e.stopPropagation();
15324
15241
  onClick?.(e);
15325
15242
  }, [onClick]);
@@ -15342,18 +15259,18 @@ var PhaseIndicator = React30.memo(({ type, onClick }) => {
15342
15259
  ] }) });
15343
15260
  });
15344
15261
  PhaseIndicator.displayName = "PhaseIndicator";
15345
- var PhaseBar = React30.memo(({ phase, isExpanded, onToggle, hasDeadline }) => {
15346
- const [isHovered, setIsHovered] = React30.useState(false);
15262
+ var PhaseBar = React36.memo(({ phase, isExpanded, onToggle, hasDeadline }) => {
15263
+ const [isHovered, setIsHovered] = React36.useState(false);
15347
15264
  const gantt = useGanttContext();
15348
- const timelineStartDate = React30.useMemo(
15265
+ const timelineStartDate = React36.useMemo(
15349
15266
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
15350
15267
  [gantt.timelineData]
15351
15268
  );
15352
- const width = React30.useMemo(
15269
+ const width = React36.useMemo(
15353
15270
  () => Math.round(getWidth(phase.startDate, phase.endDate, gantt)),
15354
15271
  [phase.startDate, phase.endDate, gantt]
15355
15272
  );
15356
- const offset = React30.useMemo(
15273
+ const offset = React36.useMemo(
15357
15274
  () => Math.round(getOffset(phase.startDate, timelineStartDate, gantt)),
15358
15275
  [phase.startDate, timelineStartDate, gantt]
15359
15276
  );
@@ -15435,17 +15352,17 @@ var PhaseBar = React30.memo(({ phase, isExpanded, onToggle, hasDeadline }) => {
15435
15352
  );
15436
15353
  });
15437
15354
  PhaseBar.displayName = "PhaseBar";
15438
- var PackageBar = React30.memo(({ pkg, phaseColor, onClick }) => {
15355
+ var PackageBar = React36.memo(({ pkg, phaseColor, onClick }) => {
15439
15356
  const gantt = useGanttContext();
15440
- const timelineStartDate = React30.useMemo(
15357
+ const timelineStartDate = React36.useMemo(
15441
15358
  () => new Date(gantt.timelineData.at(0)?.year ?? 0, 0, 1),
15442
15359
  [gantt.timelineData]
15443
15360
  );
15444
- const width = React30.useMemo(
15361
+ const width = React36.useMemo(
15445
15362
  () => Math.round(getWidth(pkg.startDate, pkg.endDate, gantt)),
15446
15363
  [pkg.startDate, pkg.endDate, gantt]
15447
15364
  );
15448
- const offset = React30.useMemo(
15365
+ const offset = React36.useMemo(
15449
15366
  () => Math.round(getOffset(pkg.startDate, timelineStartDate, gantt)),
15450
15367
  [pkg.startDate, pkg.endDate, gantt]
15451
15368
  );
@@ -15491,7 +15408,7 @@ var PackageBar = React30.memo(({ pkg, phaseColor, onClick }) => {
15491
15408
  );
15492
15409
  });
15493
15410
  PackageBar.displayName = "PackageBar";
15494
- var PhaseSidebarItem = React30.memo(({
15411
+ var PhaseSidebarItem = React36.memo(({
15495
15412
  phase,
15496
15413
  packageCount,
15497
15414
  isExpanded,
@@ -15546,7 +15463,7 @@ var PhaseSidebarItem = React30.memo(({
15546
15463
  );
15547
15464
  });
15548
15465
  PhaseSidebarItem.displayName = "PhaseSidebarItem";
15549
- var PackageSidebarItem = React30.memo(({
15466
+ var PackageSidebarItem = React36.memo(({
15550
15467
  pkg,
15551
15468
  phaseColor,
15552
15469
  onClick
@@ -15611,12 +15528,12 @@ function PhaseGantt({
15611
15528
  className,
15612
15529
  defaultExpandedPhases = []
15613
15530
  }) {
15614
- const [expandedPhases, setExpandedPhases] = React30.useState(
15531
+ const [expandedPhases, setExpandedPhases] = React36.useState(
15615
15532
  () => new Set(defaultExpandedPhases)
15616
15533
  );
15617
- const [selectedPackage, setSelectedPackage] = React30.useState(null);
15618
- const [sheetOpen, setSheetOpen] = React30.useState(false);
15619
- const togglePhase = React30.useCallback((phaseId) => {
15534
+ const [selectedPackage, setSelectedPackage] = React36.useState(null);
15535
+ const [sheetOpen, setSheetOpen] = React36.useState(false);
15536
+ const togglePhase = React36.useCallback((phaseId) => {
15620
15537
  setExpandedPhases((prev) => {
15621
15538
  const next = new Set(prev);
15622
15539
  if (next.has(phaseId)) {
@@ -15627,12 +15544,12 @@ function PhaseGantt({
15627
15544
  return next;
15628
15545
  });
15629
15546
  }, []);
15630
- const handlePackageClick = React30.useCallback((pkg) => {
15547
+ const handlePackageClick = React36.useCallback((pkg) => {
15631
15548
  setSelectedPackage(pkg);
15632
15549
  setSheetOpen(true);
15633
15550
  onPackageClick?.(pkg);
15634
15551
  }, [onPackageClick]);
15635
- const packagesByPhase = React30.useMemo(() => {
15552
+ const packagesByPhase = React36.useMemo(() => {
15636
15553
  const map = /* @__PURE__ */ new Map();
15637
15554
  for (const phase of phases) {
15638
15555
  map.set(phase.id, []);
@@ -15645,7 +15562,7 @@ function PhaseGantt({
15645
15562
  }
15646
15563
  return map;
15647
15564
  }, [phases, packages]);
15648
- const selectedPhase = React30.useMemo(() => {
15565
+ const selectedPhase = React36.useMemo(() => {
15649
15566
  if (!selectedPackage) return null;
15650
15567
  return phases.find((p) => p.id === selectedPackage.phaseId) ?? null;
15651
15568
  }, [selectedPackage, phases]);
@@ -15816,6 +15733,1366 @@ function PhaseGantt({
15816
15733
  }
15817
15734
  );
15818
15735
  }
15736
+ function getSubtaskTypeIcon(type) {
15737
+ switch (type) {
15738
+ case "calculation":
15739
+ return lucideReact.Calculator;
15740
+ case "review":
15741
+ return lucideReact.FileCheck;
15742
+ case "upload":
15743
+ return lucideReact.Upload;
15744
+ case "approval":
15745
+ return lucideReact.UserCheck;
15746
+ case "documentation":
15747
+ return lucideReact.FileText;
15748
+ default:
15749
+ return lucideReact.Circle;
15750
+ }
15751
+ }
15752
+ function getSubtaskTypeLabel(type) {
15753
+ switch (type) {
15754
+ case "calculation":
15755
+ return "Calculation";
15756
+ case "review":
15757
+ return "Review";
15758
+ case "upload":
15759
+ return "Upload";
15760
+ case "approval":
15761
+ return "Approval";
15762
+ case "documentation":
15763
+ return "Documentation";
15764
+ default:
15765
+ return "Task";
15766
+ }
15767
+ }
15768
+ function getStatusIcon(status) {
15769
+ switch (status) {
15770
+ case "done":
15771
+ return lucideReact.CheckCircle2;
15772
+ case "in_progress":
15773
+ return lucideReact.Loader2;
15774
+ case "blocked":
15775
+ return lucideReact.Lock;
15776
+ default:
15777
+ return lucideReact.Circle;
15778
+ }
15779
+ }
15780
+ function getStatusLabel3(status) {
15781
+ switch (status) {
15782
+ case "todo":
15783
+ return "To Do";
15784
+ case "in_progress":
15785
+ return "In Progress";
15786
+ case "done":
15787
+ return "Done";
15788
+ case "blocked":
15789
+ return "Blocked";
15790
+ default:
15791
+ return status;
15792
+ }
15793
+ }
15794
+ function getActionLabel(status, type) {
15795
+ if (status === "in_progress") {
15796
+ return "Mark Complete";
15797
+ }
15798
+ switch (type) {
15799
+ case "calculation":
15800
+ return "Start Calculation";
15801
+ case "review":
15802
+ return "Start Review";
15803
+ case "upload":
15804
+ return "Upload";
15805
+ case "approval":
15806
+ return "Request Approval";
15807
+ case "documentation":
15808
+ return "Start Documentation";
15809
+ default:
15810
+ return "Start";
15811
+ }
15812
+ }
15813
+ function SubtaskItem({
15814
+ subtaskState,
15815
+ onAction,
15816
+ compact = false,
15817
+ className
15818
+ }) {
15819
+ const { subtask, isLocked, lockReason, isNextAction, isActionable } = subtaskState;
15820
+ const TypeIcon = getSubtaskTypeIcon(subtask.type);
15821
+ const StatusIcon = getStatusIcon(subtask.status);
15822
+ const handleAction = React36__namespace.useCallback(() => {
15823
+ if (isActionable && onAction) {
15824
+ onAction(subtask);
15825
+ }
15826
+ }, [isActionable, onAction, subtask]);
15827
+ if (compact) {
15828
+ return /* @__PURE__ */ jsxRuntime.jsxs(
15829
+ "div",
15830
+ {
15831
+ className: cn(
15832
+ "flex items-center gap-2 py-1.5 px-2 rounded-md text-sm",
15833
+ isLocked && "opacity-60",
15834
+ subtask.status === "done" && "opacity-60",
15835
+ className
15836
+ ),
15837
+ children: [
15838
+ /* @__PURE__ */ jsxRuntime.jsx(
15839
+ StatusIcon,
15840
+ {
15841
+ className: cn(
15842
+ "h-4 w-4 shrink-0",
15843
+ subtask.status === "done" && "text-green-600 dark:text-green-400",
15844
+ subtask.status === "in_progress" && "text-primary animate-spin",
15845
+ isLocked && "text-muted-foreground"
15846
+ )
15847
+ }
15848
+ ),
15849
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
15850
+ "truncate flex-1",
15851
+ subtask.status === "done" && "line-through text-muted-foreground"
15852
+ ), children: subtask.title }),
15853
+ isLocked && /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
15854
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Lock, { className: "h-3 w-3 text-muted-foreground shrink-0" }) }),
15855
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "left", className: "max-w-xs", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs", children: lockReason }) })
15856
+ ] }) })
15857
+ ]
15858
+ }
15859
+ );
15860
+ }
15861
+ return /* @__PURE__ */ jsxRuntime.jsxs(
15862
+ "div",
15863
+ {
15864
+ className: cn(
15865
+ "flex items-start gap-3 py-3 px-3 rounded-lg border bg-card transition-colors",
15866
+ isNextAction && "ring-2 ring-primary/20 border-primary/30",
15867
+ isLocked && "opacity-70 bg-muted/30",
15868
+ subtask.status === "done" && "bg-muted/20",
15869
+ className
15870
+ ),
15871
+ children: [
15872
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
15873
+ StatusIcon,
15874
+ {
15875
+ className: cn(
15876
+ "h-5 w-5",
15877
+ subtask.status === "done" && "text-green-600 dark:text-green-400",
15878
+ subtask.status === "in_progress" && "text-primary animate-spin",
15879
+ subtask.status === "blocked" && "text-destructive",
15880
+ subtask.status === "todo" && !isLocked && "text-muted-foreground",
15881
+ isLocked && "text-muted-foreground"
15882
+ )
15883
+ }
15884
+ ) }),
15885
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
15886
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
15887
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
15888
+ "span",
15889
+ {
15890
+ className: cn(
15891
+ "font-medium text-sm",
15892
+ subtask.status === "done" && "line-through text-muted-foreground"
15893
+ ),
15894
+ children: subtask.title
15895
+ }
15896
+ ) }),
15897
+ /* @__PURE__ */ jsxRuntime.jsxs(
15898
+ Badge,
15899
+ {
15900
+ variant: "secondary",
15901
+ className: "shrink-0 text-[10px] px-1.5 py-0 gap-1",
15902
+ children: [
15903
+ /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { className: "h-3 w-3" }),
15904
+ getSubtaskTypeLabel(subtask.type)
15905
+ ]
15906
+ }
15907
+ )
15908
+ ] }),
15909
+ subtask.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground line-clamp-2", children: subtask.description }),
15910
+ isLocked && lockReason && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
15911
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Lock, { className: "h-3 w-3" }),
15912
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: lockReason })
15913
+ ] }),
15914
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 pt-1", children: [
15915
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
15916
+ /* @__PURE__ */ jsxRuntime.jsx(
15917
+ Badge,
15918
+ {
15919
+ variant: "outline",
15920
+ className: cn(
15921
+ "text-[10px] px-1.5 py-0",
15922
+ subtask.status === "done" && "bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",
15923
+ subtask.status === "in_progress" && "bg-primary/10 text-primary border-primary/20",
15924
+ subtask.status === "blocked" && "bg-destructive/10 text-destructive border-destructive/20"
15925
+ ),
15926
+ children: getStatusLabel3(subtask.status)
15927
+ }
15928
+ ),
15929
+ subtask.estimatedMinutes && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
15930
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "h-3 w-3" }),
15931
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
15932
+ subtask.estimatedMinutes,
15933
+ "m"
15934
+ ] })
15935
+ ] }),
15936
+ subtask.assignee && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate max-w-[100px]", children: subtask.assignee.name })
15937
+ ] }),
15938
+ isActionable && onAction && /* @__PURE__ */ jsxRuntime.jsx(
15939
+ Button,
15940
+ {
15941
+ size: "sm",
15942
+ variant: isNextAction ? "default" : "outline",
15943
+ className: "h-7 text-xs px-2",
15944
+ onClick: handleAction,
15945
+ children: getActionLabel(subtask.status, subtask.type)
15946
+ }
15947
+ )
15948
+ ] })
15949
+ ] })
15950
+ ]
15951
+ }
15952
+ );
15953
+ }
15954
+ function getPriorityConfig(priority) {
15955
+ switch (priority) {
15956
+ case "urgent":
15957
+ return {
15958
+ label: "Urgent",
15959
+ className: "bg-red-500/15 text-red-700 dark:bg-red-500/20 dark:text-red-400"
15960
+ };
15961
+ case "high":
15962
+ return {
15963
+ label: "High",
15964
+ className: "bg-orange-500/15 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400"
15965
+ };
15966
+ case "medium":
15967
+ return {
15968
+ label: "Medium",
15969
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
15970
+ };
15971
+ case "low":
15972
+ return {
15973
+ label: "Low",
15974
+ className: "bg-blue-500/15 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400"
15975
+ };
15976
+ default:
15977
+ return { label: priority, className: "" };
15978
+ }
15979
+ }
15980
+ function getStatusConfig(status) {
15981
+ switch (status) {
15982
+ case "done":
15983
+ return {
15984
+ label: "Done",
15985
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
15986
+ };
15987
+ case "in_progress":
15988
+ return {
15989
+ label: "In Progress",
15990
+ className: "bg-primary/15 text-primary"
15991
+ };
15992
+ case "waiting":
15993
+ return {
15994
+ label: "Waiting",
15995
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
15996
+ };
15997
+ case "ready":
15998
+ return {
15999
+ label: "Ready",
16000
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
16001
+ };
16002
+ case "not_started":
16003
+ return {
16004
+ label: "Not Started",
16005
+ className: "bg-muted text-muted-foreground"
16006
+ };
16007
+ default:
16008
+ return { label: status, className: "" };
16009
+ }
16010
+ }
16011
+ function formatDate3(date) {
16012
+ return new Intl.DateTimeFormat("en-US", {
16013
+ month: "short",
16014
+ day: "numeric"
16015
+ }).format(date);
16016
+ }
16017
+ function PackageCard({
16018
+ packageState,
16019
+ onSubtaskAction,
16020
+ onPackageClick,
16021
+ className
16022
+ }) {
16023
+ const [isExpanded, setIsExpanded] = React36__namespace.useState(false);
16024
+ const {
16025
+ package: pkg,
16026
+ status,
16027
+ progress,
16028
+ completedCount,
16029
+ totalCount,
16030
+ nextAction,
16031
+ nextActionLabel,
16032
+ subtaskStates,
16033
+ isComplete,
16034
+ isWaiting
16035
+ } = packageState;
16036
+ const priorityConfig = getPriorityConfig(pkg.priority);
16037
+ const statusConfig = getStatusConfig(status);
16038
+ const handleCardClick = React36__namespace.useCallback((e) => {
16039
+ if (e.target.closest('button, [role="button"]')) {
16040
+ return;
16041
+ }
16042
+ onPackageClick?.(pkg);
16043
+ }, [onPackageClick, pkg]);
16044
+ const handleNextAction = React36__namespace.useCallback(() => {
16045
+ if (nextAction && onSubtaskAction) {
16046
+ onSubtaskAction(nextAction.subtask);
16047
+ }
16048
+ }, [nextAction, onSubtaskAction]);
16049
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16050
+ Card,
16051
+ {
16052
+ className: cn(
16053
+ "p-3 space-y-3 cursor-pointer transition-all hover:shadow-md",
16054
+ isComplete && "opacity-80",
16055
+ className
16056
+ ),
16057
+ onClick: handleCardClick,
16058
+ children: [
16059
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
16060
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 min-w-0 flex-1", children: [
16061
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Package, { className: "h-4 w-4 mt-0.5 shrink-0 text-muted-foreground" }),
16062
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
16063
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm leading-tight truncate", children: pkg.name }),
16064
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: pkg.project })
16065
+ ] })
16066
+ ] }),
16067
+ /* @__PURE__ */ jsxRuntime.jsx(
16068
+ Badge,
16069
+ {
16070
+ variant: "secondary",
16071
+ className: cn("text-[10px] px-1.5 py-0 shrink-0", priorityConfig.className),
16072
+ children: priorityConfig.label
16073
+ }
16074
+ )
16075
+ ] }),
16076
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
16077
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
16078
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Progress" }),
16079
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium", children: [
16080
+ completedCount,
16081
+ "/",
16082
+ totalCount
16083
+ ] })
16084
+ ] }),
16085
+ /* @__PURE__ */ jsxRuntime.jsx(Progress, { value: progress * 100, className: "h-1.5" })
16086
+ ] }),
16087
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
16088
+ /* @__PURE__ */ jsxRuntime.jsx(
16089
+ Badge,
16090
+ {
16091
+ variant: "secondary",
16092
+ className: cn("text-[10px] px-1.5 py-0", statusConfig.className),
16093
+ children: statusConfig.label
16094
+ }
16095
+ ),
16096
+ isWaiting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16097
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "h-3 w-3" }),
16098
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting" })
16099
+ ] }) : nextAction ? /* @__PURE__ */ jsxRuntime.jsx(
16100
+ Button,
16101
+ {
16102
+ size: "sm",
16103
+ variant: "default",
16104
+ className: "h-6 text-[10px] px-2",
16105
+ onClick: (e) => {
16106
+ e.stopPropagation();
16107
+ handleNextAction();
16108
+ },
16109
+ children: nextActionLabel
16110
+ }
16111
+ ) : isComplete ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 bg-green-500/10 text-green-600 border-green-500/20", children: "Complete" }) : null
16112
+ ] }),
16113
+ (pkg.dueDate || pkg.tags && pkg.tags.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 pt-1 border-t border-border/50", children: [
16114
+ pkg.dueDate && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16115
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarDays, { className: "h-3 w-3" }),
16116
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: formatDate3(pkg.dueDate) })
16117
+ ] }),
16118
+ pkg.tags && pkg.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 flex-wrap justify-end", children: [
16119
+ pkg.tags.slice(0, 2).map((tag) => /* @__PURE__ */ jsxRuntime.jsx(
16120
+ Badge,
16121
+ {
16122
+ variant: "outline",
16123
+ className: "text-[9px] px-1 py-0 h-4",
16124
+ children: tag
16125
+ },
16126
+ tag
16127
+ )),
16128
+ pkg.tags.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[9px] text-muted-foreground", children: [
16129
+ "+",
16130
+ pkg.tags.length - 2
16131
+ ] })
16132
+ ] })
16133
+ ] }),
16134
+ /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { open: isExpanded, onOpenChange: setIsExpanded, children: [
16135
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
16136
+ Button,
16137
+ {
16138
+ variant: "ghost",
16139
+ size: "sm",
16140
+ className: "w-full h-7 text-xs text-muted-foreground hover:text-foreground justify-between",
16141
+ onClick: (e) => e.stopPropagation(),
16142
+ children: [
16143
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
16144
+ isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3" }),
16145
+ subtaskStates.length,
16146
+ " subtasks"
16147
+ ] }),
16148
+ subtaskStates.some((s) => s.isLocked) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 text-amber-600 dark:text-amber-400", children: [
16149
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-3 w-3" }),
16150
+ subtaskStates.filter((s) => s.isLocked).length,
16151
+ " locked"
16152
+ ] })
16153
+ ]
16154
+ }
16155
+ ) }),
16156
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { className: "pt-2 space-y-1.5", children: subtaskStates.map((subtaskState) => /* @__PURE__ */ jsxRuntime.jsx(
16157
+ SubtaskItem,
16158
+ {
16159
+ subtaskState,
16160
+ onAction: onSubtaskAction,
16161
+ compact: true
16162
+ },
16163
+ subtaskState.subtask.id
16164
+ )) })
16165
+ ] }),
16166
+ isWaiting && !isComplete && /* @__PURE__ */ jsxRuntime.jsxs(
16167
+ Button,
16168
+ {
16169
+ variant: "ghost",
16170
+ size: "sm",
16171
+ className: "w-full h-7 text-xs text-muted-foreground",
16172
+ onClick: (e) => {
16173
+ e.stopPropagation();
16174
+ onPackageClick?.(pkg);
16175
+ },
16176
+ children: [
16177
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-3 w-3 mr-1" }),
16178
+ "View context"
16179
+ ]
16180
+ }
16181
+ )
16182
+ ]
16183
+ }
16184
+ );
16185
+ }
16186
+
16187
+ // src/blocks/todo-board/rules.ts
16188
+ function areDependenciesSatisfied(subtask, allSubtasks) {
16189
+ if (subtask.dependsOn.length === 0) return true;
16190
+ return subtask.dependsOn.every((depId) => {
16191
+ const dep = allSubtasks.find((s) => s.id === depId);
16192
+ return dep?.status === "done";
16193
+ });
16194
+ }
16195
+ function getBlockingSubtasks(subtask, allSubtasks) {
16196
+ return subtask.dependsOn.map((depId) => allSubtasks.find((s) => s.id === depId)).filter((dep) => dep !== void 0 && dep.status !== "done");
16197
+ }
16198
+ function generateLockReason(blockingSubtasks) {
16199
+ if (blockingSubtasks.length === 0) return "";
16200
+ if (blockingSubtasks.length === 1) {
16201
+ return `Waiting for "${blockingSubtasks[0].title}" to complete`;
16202
+ }
16203
+ const typeGroups = blockingSubtasks.reduce((acc, subtask) => {
16204
+ acc[subtask.type] = (acc[subtask.type] || 0) + 1;
16205
+ return acc;
16206
+ }, {});
16207
+ const parts = Object.entries(typeGroups).map(
16208
+ ([type, count]) => count === 1 ? `1 ${type}` : `${count} ${type}s`
16209
+ );
16210
+ return `Waiting for ${parts.join(", ")} to complete`;
16211
+ }
16212
+ function computeSubtaskState(subtask, allSubtasks, isNextAction) {
16213
+ const blockingSubtasks = getBlockingSubtasks(subtask, allSubtasks);
16214
+ const isLocked = blockingSubtasks.length > 0;
16215
+ const lockReason = isLocked ? generateLockReason(blockingSubtasks) : void 0;
16216
+ const isActionable = !isLocked && subtask.status !== "done" && subtask.status !== "blocked";
16217
+ return {
16218
+ subtask,
16219
+ isLocked,
16220
+ lockReason,
16221
+ blockedBy: blockingSubtasks.map((s) => s.id),
16222
+ isNextAction,
16223
+ isActionable
16224
+ };
16225
+ }
16226
+ function allRequiredSubtasksDone(pkg, config) {
16227
+ if (!config?.requirements) {
16228
+ return pkg.subtasks.every((s) => s.status === "done");
16229
+ }
16230
+ for (const req of config.requirements) {
16231
+ const subtasksOfType = pkg.subtasks.filter((s) => s.type === req.type);
16232
+ const doneCount = subtasksOfType.filter((s) => s.status === "done").length;
16233
+ if (doneCount < req.minCount) return false;
16234
+ }
16235
+ return pkg.subtasks.every((s) => s.status === "done");
16236
+ }
16237
+ function anySubtaskStartedOrDone(pkg) {
16238
+ return pkg.subtasks.some(
16239
+ (s) => s.status === "in_progress" || s.status === "done"
16240
+ );
16241
+ }
16242
+ function derivePackageBucket(pkg, config) {
16243
+ if (allRequiredSubtasksDone(pkg, config)) {
16244
+ return "completed";
16245
+ }
16246
+ if (anySubtaskStartedOrDone(pkg)) {
16247
+ return "in_progress";
16248
+ }
16249
+ return "next";
16250
+ }
16251
+ function derivePackageStatus(pkg, bucket, hasNextAction) {
16252
+ if (bucket === "completed") {
16253
+ return "done";
16254
+ }
16255
+ if (bucket === "next" && !anySubtaskStartedOrDone(pkg)) {
16256
+ return "not_started";
16257
+ }
16258
+ if (!hasNextAction) {
16259
+ return "waiting";
16260
+ }
16261
+ return "in_progress";
16262
+ }
16263
+ function findNextActionableSubtask(subtaskStates) {
16264
+ const sorted = [...subtaskStates].sort(
16265
+ (a, b) => a.subtask.order - b.subtask.order
16266
+ );
16267
+ const inProgress = sorted.find(
16268
+ (s) => s.isActionable && s.subtask.status === "in_progress"
16269
+ );
16270
+ if (inProgress) return inProgress;
16271
+ const todo = sorted.find(
16272
+ (s) => s.isActionable && s.subtask.status === "todo"
16273
+ );
16274
+ return todo;
16275
+ }
16276
+ function generateNextActionLabel(nextAction) {
16277
+ if (!nextAction) return void 0;
16278
+ const { subtask } = nextAction;
16279
+ if (subtask.status === "in_progress") {
16280
+ switch (subtask.type) {
16281
+ case "calculation":
16282
+ return "Continue Calculation";
16283
+ case "review":
16284
+ return "Continue Review";
16285
+ case "upload":
16286
+ return "Resume Upload";
16287
+ case "approval":
16288
+ return "Continue Approval";
16289
+ case "documentation":
16290
+ return "Continue Documentation";
16291
+ default:
16292
+ return "Continue Task";
16293
+ }
16294
+ }
16295
+ switch (subtask.type) {
16296
+ case "calculation":
16297
+ return "Start Calculation";
16298
+ case "review":
16299
+ return "Start Review";
16300
+ case "upload":
16301
+ return "Upload Files";
16302
+ case "approval":
16303
+ return "Request Approval";
16304
+ case "documentation":
16305
+ return "Add Documentation";
16306
+ default:
16307
+ return "Start Task";
16308
+ }
16309
+ }
16310
+ function calculateProgress(pkg) {
16311
+ const totalCount = pkg.subtasks.length;
16312
+ if (totalCount === 0) {
16313
+ return { progress: 1, completedCount: 0, totalCount: 0 };
16314
+ }
16315
+ const completedCount = pkg.subtasks.filter((s) => s.status === "done").length;
16316
+ const progress = completedCount / totalCount;
16317
+ return { progress, completedCount, totalCount };
16318
+ }
16319
+ function computePackageDerivedState(pkg, config) {
16320
+ const subtaskStatesWithoutNextAction = pkg.subtasks.map(
16321
+ (subtask) => computeSubtaskState(subtask, pkg.subtasks, false)
16322
+ );
16323
+ const nextActionCandidate = findNextActionableSubtask(subtaskStatesWithoutNextAction);
16324
+ const subtaskStates = subtaskStatesWithoutNextAction.map((state) => ({
16325
+ ...state,
16326
+ isNextAction: state.subtask.id === nextActionCandidate?.subtask.id
16327
+ }));
16328
+ const nextAction = nextActionCandidate ? subtaskStates.find((s) => s.isNextAction) : void 0;
16329
+ const bucket = derivePackageBucket(pkg, config);
16330
+ const hasNextAction = nextAction !== void 0;
16331
+ const status = derivePackageStatus(pkg, bucket, hasNextAction);
16332
+ const { progress, completedCount, totalCount } = calculateProgress(pkg);
16333
+ const nextActionLabel = generateNextActionLabel(nextAction);
16334
+ return {
16335
+ package: pkg,
16336
+ bucket,
16337
+ status,
16338
+ progress,
16339
+ completedCount,
16340
+ totalCount,
16341
+ nextAction,
16342
+ nextActionLabel,
16343
+ subtaskStates,
16344
+ isComplete: bucket === "completed",
16345
+ isWaiting: status === "waiting"
16346
+ };
16347
+ }
16348
+ function computeAllPackageStates(packages, config) {
16349
+ return packages.map((pkg) => computePackageDerivedState(pkg, config));
16350
+ }
16351
+ function groupPackagesByBucket(packageStates) {
16352
+ return {
16353
+ next: packageStates.filter((p) => p.bucket === "next"),
16354
+ in_progress: packageStates.filter((p) => p.bucket === "in_progress"),
16355
+ completed: packageStates.filter((p) => p.bucket === "completed")
16356
+ };
16357
+ }
16358
+ function updateSubtaskStatus(pkg, subtaskId, newStatus, config) {
16359
+ const updatedSubtasks = pkg.subtasks.map((subtask) => {
16360
+ if (subtask.id !== subtaskId) return subtask;
16361
+ return {
16362
+ ...subtask,
16363
+ status: newStatus,
16364
+ completedAt: newStatus === "done" ? /* @__PURE__ */ new Date() : void 0
16365
+ };
16366
+ });
16367
+ const updatedPackage = {
16368
+ ...pkg,
16369
+ subtasks: updatedSubtasks,
16370
+ updatedAt: /* @__PURE__ */ new Date()
16371
+ };
16372
+ const derivedState = computePackageDerivedState(updatedPackage, config);
16373
+ return { updatedPackage, derivedState };
16374
+ }
16375
+ function startSubtask(pkg, subtaskId, config) {
16376
+ return updateSubtaskStatus(pkg, subtaskId, "in_progress", config);
16377
+ }
16378
+ function completeSubtask(pkg, subtaskId, config) {
16379
+ return updateSubtaskStatus(pkg, subtaskId, "done", config);
16380
+ }
16381
+ var DEFAULT_BUCKETS = [
16382
+ { id: "next", name: "Next" },
16383
+ { id: "in_progress", name: "In Progress" },
16384
+ { id: "completed", name: "Completed" }
16385
+ ];
16386
+ function getBucketConfig(config) {
16387
+ return config?.buckets ?? DEFAULT_BUCKETS;
16388
+ }
16389
+ function SortablePackageCard({
16390
+ packageState,
16391
+ onSubtaskAction,
16392
+ onPackageClick
16393
+ }) {
16394
+ const {
16395
+ attributes,
16396
+ listeners,
16397
+ setNodeRef,
16398
+ transform,
16399
+ transition,
16400
+ isDragging
16401
+ } = sortable.useSortable({
16402
+ id: packageState.package.id,
16403
+ data: {
16404
+ type: "package",
16405
+ packageState
16406
+ }
16407
+ });
16408
+ const style = {
16409
+ transform: utilities.CSS.Transform.toString(transform),
16410
+ transition
16411
+ };
16412
+ return /* @__PURE__ */ jsxRuntime.jsx(
16413
+ "div",
16414
+ {
16415
+ ref: setNodeRef,
16416
+ style,
16417
+ ...attributes,
16418
+ ...listeners,
16419
+ className: cn(
16420
+ "cursor-grab active:cursor-grabbing",
16421
+ isDragging && "opacity-30"
16422
+ ),
16423
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16424
+ PackageCard,
16425
+ {
16426
+ packageState,
16427
+ onSubtaskAction,
16428
+ onPackageClick
16429
+ }
16430
+ )
16431
+ }
16432
+ );
16433
+ }
16434
+ function KanbanColumn({
16435
+ id,
16436
+ name,
16437
+ packageStates,
16438
+ onSubtaskAction,
16439
+ onPackageClick
16440
+ }) {
16441
+ const packageIds = packageStates.map((p) => p.package.id);
16442
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-[280px] max-w-[320px] flex-1 h-full bg-muted/20 rounded-lg border", children: [
16443
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 border-b bg-muted/30 shrink-0", children: [
16444
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm", children: name }),
16445
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: "text-xs", children: packageStates.length })
16446
+ ] }),
16447
+ /* @__PURE__ */ jsxRuntime.jsxs(ScrollArea, { className: "flex-1 min-h-0", children: [
16448
+ /* @__PURE__ */ jsxRuntime.jsx(sortable.SortableContext, { items: packageIds, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 space-y-2", children: [
16449
+ packageStates.map((packageState) => /* @__PURE__ */ jsxRuntime.jsx(
16450
+ SortablePackageCard,
16451
+ {
16452
+ packageState,
16453
+ onSubtaskAction,
16454
+ onPackageClick
16455
+ },
16456
+ packageState.package.id
16457
+ )),
16458
+ packageStates.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[100px] text-sm text-muted-foreground", children: "No packages" })
16459
+ ] }) }),
16460
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "vertical" })
16461
+ ] })
16462
+ ] });
16463
+ }
16464
+ function TodoBoard({
16465
+ packages,
16466
+ workflowConfig,
16467
+ onSubtaskAction,
16468
+ onPackageClick,
16469
+ onPackagesChange,
16470
+ height = 600,
16471
+ className
16472
+ }) {
16473
+ const [activeId, setActiveId] = React36__namespace.useState(null);
16474
+ const sensors = core.useSensors(
16475
+ core.useSensor(core.MouseSensor, {
16476
+ activationConstraint: { distance: 8 }
16477
+ }),
16478
+ core.useSensor(core.TouchSensor, {
16479
+ activationConstraint: { delay: 200, tolerance: 5 }
16480
+ })
16481
+ );
16482
+ const packageStates = React36__namespace.useMemo(
16483
+ () => computeAllPackageStates(packages, workflowConfig),
16484
+ [packages, workflowConfig]
16485
+ );
16486
+ const groupedPackages = React36__namespace.useMemo(
16487
+ () => groupPackagesByBucket(packageStates),
16488
+ [packageStates]
16489
+ );
16490
+ const buckets = getBucketConfig(workflowConfig);
16491
+ const activePackageState = React36__namespace.useMemo(
16492
+ () => packageStates.find((p) => p.package.id === activeId),
16493
+ [packageStates, activeId]
16494
+ );
16495
+ const handleDragStart = React36__namespace.useCallback((event) => {
16496
+ setActiveId(event.active.id);
16497
+ }, []);
16498
+ const handleDragEnd = React36__namespace.useCallback((event) => {
16499
+ setActiveId(null);
16500
+ }, []);
16501
+ const heightStyle = typeof height === "number" ? `${height}px` : height;
16502
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-4", className), children: [
16503
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", className: "text-sm", children: [
16504
+ packages.length,
16505
+ " packages"
16506
+ ] }) }),
16507
+ /* @__PURE__ */ jsxRuntime.jsxs(
16508
+ core.DndContext,
16509
+ {
16510
+ sensors,
16511
+ collisionDetection: core.closestCenter,
16512
+ onDragStart: handleDragStart,
16513
+ onDragEnd: handleDragEnd,
16514
+ children: [
16515
+ /* @__PURE__ */ jsxRuntime.jsx(
16516
+ "div",
16517
+ {
16518
+ className: "flex gap-4 overflow-x-auto pb-2",
16519
+ style: { height: heightStyle },
16520
+ children: buckets.map((bucket) => /* @__PURE__ */ jsxRuntime.jsx(
16521
+ KanbanColumn,
16522
+ {
16523
+ id: bucket.id,
16524
+ name: bucket.name,
16525
+ packageStates: groupedPackages[bucket.id] || [],
16526
+ onSubtaskAction,
16527
+ onPackageClick
16528
+ },
16529
+ bucket.id
16530
+ ))
16531
+ }
16532
+ ),
16533
+ typeof window !== "undefined" && reactDom.createPortal(
16534
+ /* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { children: activePackageState && /* @__PURE__ */ jsxRuntime.jsx(
16535
+ PackageCard,
16536
+ {
16537
+ packageState: activePackageState,
16538
+ className: "rotate-3 shadow-xl ring-2 ring-primary"
16539
+ }
16540
+ ) }),
16541
+ document.body
16542
+ )
16543
+ ]
16544
+ }
16545
+ )
16546
+ ] });
16547
+ }
16548
+ var DEFAULT_BUCKETS2 = [
16549
+ { id: "in_progress", name: "In progress", color: "bg-orange-500" },
16550
+ { id: "next", name: "To-do", color: "bg-cyan-500" },
16551
+ { id: "completed", name: "Completed", color: "bg-green-500" }
16552
+ ];
16553
+ var PRIORITY_ORDER = {
16554
+ urgent: 0,
16555
+ high: 1,
16556
+ medium: 2,
16557
+ low: 3
16558
+ };
16559
+ function getBucketConfig2(config) {
16560
+ if (!config?.buckets) return DEFAULT_BUCKETS2;
16561
+ return config.buckets.map((b) => {
16562
+ const defaultBucket = DEFAULT_BUCKETS2.find((d) => d.id === b.id);
16563
+ return {
16564
+ ...b,
16565
+ color: defaultBucket?.color ?? "bg-muted"
16566
+ };
16567
+ });
16568
+ }
16569
+ function getPriorityBadge(priority) {
16570
+ const config = {
16571
+ urgent: { label: "Urgent", className: "bg-red-500/15 text-red-600 dark:text-red-400" },
16572
+ high: { label: "High", className: "bg-orange-500/15 text-orange-600 dark:text-orange-400" },
16573
+ medium: { label: "Normal", className: "bg-muted text-muted-foreground" },
16574
+ low: { label: "Low", className: "bg-blue-500/15 text-blue-600 dark:text-blue-400" }
16575
+ };
16576
+ return config[priority] ?? config.medium;
16577
+ }
16578
+ function getStatusBadge2(status, isLocked) {
16579
+ if (isLocked) {
16580
+ return { label: "Locked", className: "bg-muted text-muted-foreground" };
16581
+ }
16582
+ const config = {
16583
+ done: { label: "Completed", className: "bg-green-500/15 text-green-600 dark:text-green-400" },
16584
+ in_progress: { label: "Started", className: "bg-amber-500/15 text-amber-600 dark:text-amber-400" },
16585
+ todo: { label: "To do", className: "bg-muted text-muted-foreground" },
16586
+ blocked: { label: "Blocked", className: "bg-red-500/15 text-red-600 dark:text-red-400" }
16587
+ };
16588
+ return config[status] ?? config.todo;
16589
+ }
16590
+ function formatDate4(date) {
16591
+ const now = /* @__PURE__ */ new Date();
16592
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
16593
+ const dateOnly = new Date(date.getFullYear(), date.getMonth(), date.getDate());
16594
+ if (dateOnly.getTime() === today.getTime()) {
16595
+ return `Today, ${date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", hour12: true }).toLowerCase()}`;
16596
+ }
16597
+ const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
16598
+ const dayName = days[date.getDay()];
16599
+ const time = date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", hour12: true }).toLowerCase();
16600
+ return `${dayName}, ${time}`;
16601
+ }
16602
+ function sortPackages(packages, field, direction) {
16603
+ if (!direction) return packages;
16604
+ return [...packages].sort((a, b) => {
16605
+ let comparison = 0;
16606
+ switch (field) {
16607
+ case "status":
16608
+ comparison = a.progress - b.progress;
16609
+ break;
16610
+ case "dueDate":
16611
+ const dateA = a.package.dueDate?.getTime() ?? Infinity;
16612
+ const dateB = b.package.dueDate?.getTime() ?? Infinity;
16613
+ comparison = dateA - dateB;
16614
+ break;
16615
+ case "priority":
16616
+ comparison = PRIORITY_ORDER[a.package.priority] - PRIORITY_ORDER[b.package.priority];
16617
+ break;
16618
+ }
16619
+ return direction === "asc" ? comparison : -comparison;
16620
+ });
16621
+ }
16622
+ function SortableHeader({ label, field, currentSort, onSort }) {
16623
+ const isActive = currentSort.field === field && currentSort.direction !== null;
16624
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16625
+ Button,
16626
+ {
16627
+ variant: "ghost",
16628
+ size: "sm",
16629
+ className: cn(
16630
+ "h-auto p-0 font-medium hover:bg-transparent",
16631
+ isActive && "text-foreground"
16632
+ ),
16633
+ onClick: () => onSort(field),
16634
+ children: [
16635
+ label,
16636
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "ml-1 h-3 w-3" })
16637
+ ]
16638
+ }
16639
+ );
16640
+ }
16641
+ function BucketHeaderRow({ name, color, currentSort, onSort }) {
16642
+ return /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { className: "bg-background hover:bg-background border-t-2", children: [
16643
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: 2, className: "py-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16644
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-2.5 h-2.5 rounded-full", color) }),
16645
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm", children: name })
16646
+ ] }) }),
16647
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { label: "Status", field: "status", currentSort, onSort }) }),
16648
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { label: "Due Date", field: "dueDate", currentSort, onSort }) }),
16649
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsxRuntime.jsx(SortableHeader, { label: "Priority", field: "priority", currentSort, onSort }) })
16650
+ ] });
16651
+ }
16652
+ function PackageRow({ packageState, isExpanded, onToggleExpand, onPackageClick }) {
16653
+ const { package: pkg, completedCount, totalCount } = packageState;
16654
+ const priorityBadge = getPriorityBadge(pkg.priority);
16655
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16656
+ TableRow,
16657
+ {
16658
+ className: "cursor-pointer hover:bg-muted/50 transition-colors",
16659
+ onClick: () => onPackageClick?.(pkg),
16660
+ children: [
16661
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-10", children: /* @__PURE__ */ jsxRuntime.jsx(
16662
+ Button,
16663
+ {
16664
+ variant: "ghost",
16665
+ size: "icon",
16666
+ className: "h-6 w-6",
16667
+ onClick: (e) => {
16668
+ e.stopPropagation();
16669
+ onToggleExpand();
16670
+ },
16671
+ children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
16672
+ }
16673
+ ) }),
16674
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16675
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 shrink-0 bg-muted/50", children: "Main task" }),
16676
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: pkg.name }),
16677
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
16678
+ completedCount,
16679
+ "/",
16680
+ totalCount,
16681
+ " Completed"
16682
+ ] })
16683
+ ] }) }),
16684
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, {}),
16685
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "text-sm text-muted-foreground", children: pkg.dueDate ? formatDate4(pkg.dueDate) : "\u2014" }),
16686
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: cn("text-[10px] px-1.5 py-0", priorityBadge.className), children: priorityBadge.label }) })
16687
+ ]
16688
+ }
16689
+ );
16690
+ }
16691
+ function SubtaskRow({ subtaskState, onSubtaskAction }) {
16692
+ const { subtask, isLocked } = subtaskState;
16693
+ const statusBadge = getStatusBadge2(subtask.status, isLocked);
16694
+ subtask.assignee ? getPriorityBadge("medium") : getPriorityBadge("medium");
16695
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16696
+ TableRow,
16697
+ {
16698
+ className: cn(
16699
+ "hover:bg-muted/30 transition-colors",
16700
+ isLocked && "opacity-60"
16701
+ ),
16702
+ onClick: () => !isLocked && onSubtaskAction?.(subtask),
16703
+ children: [
16704
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-10" }),
16705
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "pl-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16706
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 shrink-0 bg-muted/30", children: "Subtask" }),
16707
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
16708
+ "text-sm",
16709
+ subtask.status === "done" && "text-muted-foreground",
16710
+ isLocked && "text-muted-foreground"
16711
+ ), children: subtask.title })
16712
+ ] }) }),
16713
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: cn("text-[10px] px-1.5 py-0", statusBadge.className), children: statusBadge.label }) }),
16714
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "text-sm text-muted-foreground", children: subtask.completedAt ? formatDate4(subtask.completedAt) : "\u2014" }),
16715
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: subtask.estimatedMinutes && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
16716
+ "~",
16717
+ subtask.estimatedMinutes,
16718
+ "m"
16719
+ ] }) })
16720
+ ]
16721
+ }
16722
+ );
16723
+ }
16724
+ function TodoList({
16725
+ packages,
16726
+ workflowConfig,
16727
+ onSubtaskAction,
16728
+ onPackageClick,
16729
+ className
16730
+ }) {
16731
+ const [expandedIds, setExpandedIds] = React36__namespace.useState(/* @__PURE__ */ new Set());
16732
+ const [sort, setSort] = React36__namespace.useState({
16733
+ field: "priority",
16734
+ direction: null
16735
+ });
16736
+ const packageStates = React36__namespace.useMemo(
16737
+ () => computeAllPackageStates(packages, workflowConfig),
16738
+ [packages, workflowConfig]
16739
+ );
16740
+ const groupedPackages = React36__namespace.useMemo(
16741
+ () => groupPackagesByBucket(packageStates),
16742
+ [packageStates]
16743
+ );
16744
+ const buckets = getBucketConfig2(workflowConfig);
16745
+ const toggleExpand = React36__namespace.useCallback((id) => {
16746
+ setExpandedIds((prev) => {
16747
+ const next = new Set(prev);
16748
+ if (next.has(id)) {
16749
+ next.delete(id);
16750
+ } else {
16751
+ next.add(id);
16752
+ }
16753
+ return next;
16754
+ });
16755
+ }, []);
16756
+ const handleSort = React36__namespace.useCallback((field) => {
16757
+ setSort((prev) => {
16758
+ if (prev.field !== field) {
16759
+ return { field, direction: "asc" };
16760
+ }
16761
+ if (prev.direction === "asc") {
16762
+ return { field, direction: "desc" };
16763
+ }
16764
+ if (prev.direction === "desc") {
16765
+ return { field, direction: null };
16766
+ }
16767
+ return { field, direction: "asc" };
16768
+ });
16769
+ }, []);
16770
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-4", className), children: [
16771
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", className: "text-sm", children: [
16772
+ packages.length,
16773
+ " packages"
16774
+ ] }) }),
16775
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(ScrollArea, { className: "w-full", children: [
16776
+ /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
16777
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { className: "bg-muted/30", children: [
16778
+ /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-10" }),
16779
+ /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "min-w-[300px]", children: "Task" }),
16780
+ /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-[120px]", children: "Status" }),
16781
+ /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-[140px]", children: "Due Date" }),
16782
+ /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-[100px]", children: "Priority" })
16783
+ ] }) }),
16784
+ /* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
16785
+ buckets.map((bucket) => {
16786
+ const bucketPackages = groupedPackages[bucket.id] || [];
16787
+ if (bucketPackages.length === 0) return null;
16788
+ const sortedPackages = sortPackages(bucketPackages, sort.field, sort.direction);
16789
+ return /* @__PURE__ */ jsxRuntime.jsxs(React36__namespace.Fragment, { children: [
16790
+ /* @__PURE__ */ jsxRuntime.jsx(
16791
+ BucketHeaderRow,
16792
+ {
16793
+ name: bucket.name,
16794
+ color: bucket.color,
16795
+ currentSort: sort,
16796
+ onSort: handleSort
16797
+ }
16798
+ ),
16799
+ sortedPackages.map((packageState) => {
16800
+ const isExpanded = expandedIds.has(packageState.package.id);
16801
+ return /* @__PURE__ */ jsxRuntime.jsxs(React36__namespace.Fragment, { children: [
16802
+ /* @__PURE__ */ jsxRuntime.jsx(
16803
+ PackageRow,
16804
+ {
16805
+ packageState,
16806
+ isExpanded,
16807
+ onToggleExpand: () => toggleExpand(packageState.package.id),
16808
+ onPackageClick
16809
+ }
16810
+ ),
16811
+ isExpanded && packageState.subtaskStates.map((subtaskState) => /* @__PURE__ */ jsxRuntime.jsx(
16812
+ SubtaskRow,
16813
+ {
16814
+ subtaskState,
16815
+ onSubtaskAction
16816
+ },
16817
+ subtaskState.subtask.id
16818
+ ))
16819
+ ] }, packageState.package.id);
16820
+ })
16821
+ ] }, bucket.id);
16822
+ }),
16823
+ packages.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: 5, className: "h-32 text-center text-muted-foreground", children: "No packages found" }) })
16824
+ ] })
16825
+ ] }),
16826
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "horizontal" })
16827
+ ] }) })
16828
+ ] });
16829
+ }
16830
+ function getPriorityConfig2(priority) {
16831
+ switch (priority) {
16832
+ case "urgent":
16833
+ return {
16834
+ label: "Urgent",
16835
+ className: "bg-red-500/15 text-red-700 dark:bg-red-500/20 dark:text-red-400"
16836
+ };
16837
+ case "high":
16838
+ return {
16839
+ label: "High",
16840
+ className: "bg-orange-500/15 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400"
16841
+ };
16842
+ case "medium":
16843
+ return {
16844
+ label: "Medium",
16845
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
16846
+ };
16847
+ case "low":
16848
+ return {
16849
+ label: "Low",
16850
+ className: "bg-blue-500/15 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400"
16851
+ };
16852
+ default:
16853
+ return { label: priority, className: "" };
16854
+ }
16855
+ }
16856
+ function getStatusConfig2(status) {
16857
+ switch (status) {
16858
+ case "done":
16859
+ return {
16860
+ label: "Done",
16861
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
16862
+ };
16863
+ case "in_progress":
16864
+ return {
16865
+ label: "In Progress",
16866
+ className: "bg-primary/15 text-primary"
16867
+ };
16868
+ case "waiting":
16869
+ return {
16870
+ label: "Waiting",
16871
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
16872
+ };
16873
+ case "ready":
16874
+ return {
16875
+ label: "Ready",
16876
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
16877
+ };
16878
+ case "not_started":
16879
+ return {
16880
+ label: "Not Started",
16881
+ className: "bg-muted text-muted-foreground"
16882
+ };
16883
+ default:
16884
+ return { label: status, className: "" };
16885
+ }
16886
+ }
16887
+ function formatDate5(date) {
16888
+ return new Intl.DateTimeFormat("en-US", {
16889
+ month: "short",
16890
+ day: "numeric"
16891
+ }).format(date);
16892
+ }
16893
+ function PackageRow2({
16894
+ packageState,
16895
+ onSubtaskAction,
16896
+ onPackageClick,
16897
+ isExpanded = false,
16898
+ onExpandToggle,
16899
+ className
16900
+ }) {
16901
+ const {
16902
+ package: pkg,
16903
+ status,
16904
+ progress,
16905
+ completedCount,
16906
+ totalCount,
16907
+ nextAction,
16908
+ nextActionLabel,
16909
+ subtaskStates,
16910
+ isComplete,
16911
+ isWaiting
16912
+ } = packageState;
16913
+ const priorityConfig = getPriorityConfig2(pkg.priority);
16914
+ const statusConfig = getStatusConfig2(status);
16915
+ const lockedCount = subtaskStates.filter((s) => s.isLocked).length;
16916
+ const handleRowClick = React36__namespace.useCallback(() => {
16917
+ onPackageClick?.(pkg);
16918
+ }, [onPackageClick, pkg]);
16919
+ const handleNextAction = React36__namespace.useCallback(() => {
16920
+ if (nextAction && onSubtaskAction) {
16921
+ onSubtaskAction(nextAction.subtask);
16922
+ }
16923
+ }, [nextAction, onSubtaskAction]);
16924
+ return /* @__PURE__ */ jsxRuntime.jsxs(Collapsible, { open: isExpanded, onOpenChange: onExpandToggle, children: [
16925
+ /* @__PURE__ */ jsxRuntime.jsxs(
16926
+ TableRow,
16927
+ {
16928
+ className: cn(
16929
+ "group cursor-pointer hover:bg-muted/50",
16930
+ isComplete && "opacity-70",
16931
+ isExpanded && "bg-muted/30",
16932
+ className
16933
+ ),
16934
+ onClick: handleRowClick,
16935
+ children: [
16936
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-10", children: /* @__PURE__ */ jsxRuntime.jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16937
+ Button,
16938
+ {
16939
+ variant: "ghost",
16940
+ size: "icon",
16941
+ className: "h-6 w-6",
16942
+ onClick: (e) => e.stopPropagation(),
16943
+ children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
16944
+ }
16945
+ ) }) }),
16946
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "min-w-[200px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16947
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Package, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
16948
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
16949
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-sm truncate", children: pkg.name }),
16950
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: pkg.project })
16951
+ ] })
16952
+ ] }) }),
16953
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-[120px]", children: /* @__PURE__ */ jsxRuntime.jsx(
16954
+ Badge,
16955
+ {
16956
+ variant: "secondary",
16957
+ className: cn("text-[10px] px-1.5 py-0", statusConfig.className),
16958
+ children: statusConfig.label
16959
+ }
16960
+ ) }),
16961
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx(
16962
+ Badge,
16963
+ {
16964
+ variant: "secondary",
16965
+ className: cn("text-[10px] px-1.5 py-0", priorityConfig.className),
16966
+ children: priorityConfig.label
16967
+ }
16968
+ ) }),
16969
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-[150px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
16970
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs", children: [
16971
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
16972
+ completedCount,
16973
+ "/",
16974
+ totalCount
16975
+ ] }),
16976
+ lockedCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-0.5 text-amber-600 dark:text-amber-400", children: [
16977
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-3 w-3" }),
16978
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: lockedCount })
16979
+ ] })
16980
+ ] }),
16981
+ /* @__PURE__ */ jsxRuntime.jsx(Progress, { value: progress * 100, className: "h-1.5" })
16982
+ ] }) }),
16983
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-[100px]", children: pkg.dueDate && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16984
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarDays, { className: "h-3 w-3" }),
16985
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: formatDate5(pkg.dueDate) })
16986
+ ] }) }),
16987
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-[150px]", children: isWaiting ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
16988
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16989
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "h-3 w-3" }),
16990
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting" })
16991
+ ] }),
16992
+ /* @__PURE__ */ jsxRuntime.jsxs(
16993
+ Button,
16994
+ {
16995
+ variant: "ghost",
16996
+ size: "sm",
16997
+ className: "h-6 text-[10px] px-2",
16998
+ onClick: (e) => {
16999
+ e.stopPropagation();
17000
+ onPackageClick?.(pkg);
17001
+ },
17002
+ children: [
17003
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-3 w-3 mr-1" }),
17004
+ "View"
17005
+ ]
17006
+ }
17007
+ )
17008
+ ] }) : nextAction ? /* @__PURE__ */ jsxRuntime.jsx(
17009
+ Button,
17010
+ {
17011
+ size: "sm",
17012
+ variant: "default",
17013
+ className: "h-6 text-[10px] px-2",
17014
+ onClick: (e) => {
17015
+ e.stopPropagation();
17016
+ handleNextAction();
17017
+ },
17018
+ children: nextActionLabel
17019
+ }
17020
+ ) : isComplete ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 bg-green-500/10 text-green-600 border-green-500/20", children: "Complete" }) : null })
17021
+ ]
17022
+ }
17023
+ ),
17024
+ /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 7, className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted/20 border-t border-b", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 space-y-2 max-w-3xl ml-10", children: [
17025
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs font-medium text-muted-foreground mb-3", children: [
17026
+ "Subtasks (",
17027
+ subtaskStates.length,
17028
+ ")"
17029
+ ] }),
17030
+ subtaskStates.map((subtaskState) => /* @__PURE__ */ jsxRuntime.jsx(
17031
+ SubtaskItem,
17032
+ {
17033
+ subtaskState,
17034
+ onAction: onSubtaskAction
17035
+ },
17036
+ subtaskState.subtask.id
17037
+ ))
17038
+ ] }) }) }) }) })
17039
+ ] });
17040
+ }
17041
+ function WorkflowViewToggle({
17042
+ value,
17043
+ onValueChange,
17044
+ className
17045
+ }) {
17046
+ const handleValueChange = React36__namespace.useCallback(
17047
+ (newValue) => {
17048
+ if (newValue === "kanban" || newValue === "list") {
17049
+ onValueChange(newValue);
17050
+ }
17051
+ },
17052
+ [onValueChange]
17053
+ );
17054
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
17055
+ ToggleGroup,
17056
+ {
17057
+ type: "single",
17058
+ value,
17059
+ onValueChange: handleValueChange,
17060
+ className: cn("border rounded-lg p-0.5 bg-muted/50", className),
17061
+ children: [
17062
+ /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
17063
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
17064
+ ToggleGroupItem,
17065
+ {
17066
+ value: "kanban",
17067
+ "aria-label": "Kanban view",
17068
+ className: cn(
17069
+ "h-8 w-8 p-0 data-[state=on]:bg-background data-[state=on]:shadow-sm",
17070
+ "rounded-md"
17071
+ ),
17072
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Kanban, { className: "h-4 w-4" })
17073
+ }
17074
+ ) }),
17075
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs", children: "Kanban View" }) })
17076
+ ] }),
17077
+ /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
17078
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
17079
+ ToggleGroupItem,
17080
+ {
17081
+ value: "list",
17082
+ "aria-label": "List view",
17083
+ className: cn(
17084
+ "h-8 w-8 p-0 data-[state=on]:bg-background data-[state=on]:shadow-sm",
17085
+ "rounded-md"
17086
+ ),
17087
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-4 w-4" })
17088
+ }
17089
+ ) }),
17090
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs", children: "List View" }) })
17091
+ ] })
17092
+ ]
17093
+ }
17094
+ ) });
17095
+ }
15819
17096
 
15820
17097
  // src/components/event-calendar/types.ts
15821
17098
  var DEFAULT_WORKING_HOURS = {
@@ -15879,7 +17156,7 @@ var BADGE_VARIANT_LABELS = {
15879
17156
  colored: "Colored",
15880
17157
  mixed: "Mixed"
15881
17158
  };
15882
- var CalendarContext = React30__namespace.createContext(null);
17159
+ var CalendarContext = React36__namespace.createContext(null);
15883
17160
  function EventCalendarProvider({
15884
17161
  children,
15885
17162
  events: initialEvents = [],
@@ -15894,38 +17171,38 @@ function EventCalendarProvider({
15894
17171
  onEventUpdate,
15895
17172
  onEventDelete
15896
17173
  }) {
15897
- const [selectedDate, setSelectedDate] = React30__namespace.useState(defaultDate);
15898
- const [selectedUserId, setSelectedUserId] = React30__namespace.useState(defaultUserId);
15899
- const [events, setEventsState] = React30__namespace.useState(initialEvents);
15900
- const [users] = React30__namespace.useState(initialUsers);
15901
- const [badgeVariant, setBadgeVariant] = React30__namespace.useState(defaultBadgeVariant);
15902
- const [view, setView] = React30__namespace.useState(defaultView);
15903
- const [workingHours, setWorkingHours] = React30__namespace.useState(defaultWorkingHours);
15904
- const [visibleHours, setVisibleHours] = React30__namespace.useState(defaultVisibleHours);
15905
- React30__namespace.useEffect(() => {
17174
+ const [selectedDate, setSelectedDate] = React36__namespace.useState(defaultDate);
17175
+ const [selectedUserId, setSelectedUserId] = React36__namespace.useState(defaultUserId);
17176
+ const [events, setEventsState] = React36__namespace.useState(initialEvents);
17177
+ const [users] = React36__namespace.useState(initialUsers);
17178
+ const [badgeVariant, setBadgeVariant] = React36__namespace.useState(defaultBadgeVariant);
17179
+ const [view, setView] = React36__namespace.useState(defaultView);
17180
+ const [workingHours, setWorkingHours] = React36__namespace.useState(defaultWorkingHours);
17181
+ const [visibleHours, setVisibleHours] = React36__namespace.useState(defaultVisibleHours);
17182
+ React36__namespace.useEffect(() => {
15906
17183
  setEventsState(initialEvents);
15907
17184
  }, [initialEvents]);
15908
- const setEvents = React30__namespace.useCallback((newEvents) => {
17185
+ const setEvents = React36__namespace.useCallback((newEvents) => {
15909
17186
  setEventsState(newEvents);
15910
17187
  }, []);
15911
- const addEvent = React30__namespace.useCallback((event) => {
17188
+ const addEvent = React36__namespace.useCallback((event) => {
15912
17189
  setEventsState((prev) => [...prev, event]);
15913
17190
  onEventAdd?.(event);
15914
17191
  }, [onEventAdd]);
15915
- const updateEvent = React30__namespace.useCallback((event) => {
17192
+ const updateEvent = React36__namespace.useCallback((event) => {
15916
17193
  setEventsState(
15917
17194
  (prev) => prev.map((e) => e.id === event.id ? event : e)
15918
17195
  );
15919
17196
  onEventUpdate?.(event);
15920
17197
  }, [onEventUpdate]);
15921
- const deleteEvent = React30__namespace.useCallback((eventId) => {
17198
+ const deleteEvent = React36__namespace.useCallback((eventId) => {
15922
17199
  setEventsState((prev) => prev.filter((e) => e.id !== eventId));
15923
17200
  onEventDelete?.(eventId);
15924
17201
  }, [onEventDelete]);
15925
- const goToToday = React30__namespace.useCallback(() => {
17202
+ const goToToday = React36__namespace.useCallback(() => {
15926
17203
  setSelectedDate(/* @__PURE__ */ new Date());
15927
17204
  }, []);
15928
- const goToPrevious = React30__namespace.useCallback(() => {
17205
+ const goToPrevious = React36__namespace.useCallback(() => {
15929
17206
  setSelectedDate((current) => {
15930
17207
  switch (view) {
15931
17208
  case "day":
@@ -15943,7 +17220,7 @@ function EventCalendarProvider({
15943
17220
  }
15944
17221
  });
15945
17222
  }, [view]);
15946
- const goToNext = React30__namespace.useCallback(() => {
17223
+ const goToNext = React36__namespace.useCallback(() => {
15947
17224
  setSelectedDate((current) => {
15948
17225
  switch (view) {
15949
17226
  case "day":
@@ -15961,7 +17238,7 @@ function EventCalendarProvider({
15961
17238
  }
15962
17239
  });
15963
17240
  }, [view]);
15964
- const contextValue = React30__namespace.useMemo(
17241
+ const contextValue = React36__namespace.useMemo(
15965
17242
  () => ({
15966
17243
  // State
15967
17244
  selectedDate,
@@ -16008,7 +17285,7 @@ function EventCalendarProvider({
16008
17285
  return /* @__PURE__ */ jsxRuntime.jsx(CalendarContext.Provider, { value: contextValue, children });
16009
17286
  }
16010
17287
  function useEventCalendar() {
16011
- const context = React30__namespace.useContext(CalendarContext);
17288
+ const context = React36__namespace.useContext(CalendarContext);
16012
17289
  if (!context) {
16013
17290
  throw new Error("useEventCalendar must be used within an EventCalendarProvider");
16014
17291
  }
@@ -16016,14 +17293,14 @@ function useEventCalendar() {
16016
17293
  }
16017
17294
  function useFilteredEvents() {
16018
17295
  const { events, selectedUserId } = useEventCalendar();
16019
- return React30__namespace.useMemo(() => {
17296
+ return React36__namespace.useMemo(() => {
16020
17297
  if (!selectedUserId) return events;
16021
17298
  return events.filter((event) => event.user.id === selectedUserId);
16022
17299
  }, [events, selectedUserId]);
16023
17300
  }
16024
17301
  function useEventsInRange(startDate, endDate) {
16025
17302
  const filteredEvents = useFilteredEvents();
16026
- return React30__namespace.useMemo(() => {
17303
+ return React36__namespace.useMemo(() => {
16027
17304
  return filteredEvents.filter((event) => {
16028
17305
  const eventStart = new Date(event.startDate);
16029
17306
  const eventEnd = new Date(event.endDate);
@@ -16581,8 +17858,8 @@ function MoreEvents({ count, onClick, className }) {
16581
17858
  );
16582
17859
  }
16583
17860
  function TimeIndicator({ className }) {
16584
- const [now, setNow] = React30__namespace.useState(/* @__PURE__ */ new Date());
16585
- React30__namespace.useEffect(() => {
17861
+ const [now, setNow] = React36__namespace.useState(/* @__PURE__ */ new Date());
17862
+ React36__namespace.useEffect(() => {
16586
17863
  const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
16587
17864
  return () => clearInterval(interval);
16588
17865
  }, []);
@@ -16619,24 +17896,24 @@ function DateBadge({ date, className }) {
16619
17896
  }
16620
17897
  );
16621
17898
  }
16622
- var DragContext = React30__namespace.createContext(null);
17899
+ var DragContext = React36__namespace.createContext(null);
16623
17900
  function DragProvider({
16624
17901
  children,
16625
17902
  snapMinutes = 15,
16626
17903
  onDragStart,
16627
17904
  onDragEnd
16628
17905
  }) {
16629
- const [draggedEvent, setDraggedEventState] = React30__namespace.useState(null);
16630
- const [isDragging, setIsDragging] = React30__namespace.useState(false);
17906
+ const [draggedEvent, setDraggedEventState] = React36__namespace.useState(null);
17907
+ const [isDragging, setIsDragging] = React36__namespace.useState(false);
16631
17908
  const { updateEvent } = useEventCalendar();
16632
- const setDraggedEvent = React30__namespace.useCallback((event) => {
17909
+ const setDraggedEvent = React36__namespace.useCallback((event) => {
16633
17910
  setDraggedEventState(event);
16634
17911
  setIsDragging(!!event);
16635
17912
  if (event) {
16636
17913
  onDragStart?.(event);
16637
17914
  }
16638
17915
  }, [onDragStart]);
16639
- const handleDrop = React30__namespace.useCallback((newStartDate) => {
17916
+ const handleDrop = React36__namespace.useCallback((newStartDate) => {
16640
17917
  if (!draggedEvent) return;
16641
17918
  const snappedDate = snapToInterval(newStartDate, snapMinutes);
16642
17919
  const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
@@ -16649,7 +17926,7 @@ function DragProvider({
16649
17926
  onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
16650
17927
  setDraggedEvent(null);
16651
17928
  }, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
16652
- const contextValue = React30__namespace.useMemo(
17929
+ const contextValue = React36__namespace.useMemo(
16653
17930
  () => ({
16654
17931
  draggedEvent,
16655
17932
  setDraggedEvent,
@@ -16660,7 +17937,7 @@ function DragProvider({
16660
17937
  return /* @__PURE__ */ jsxRuntime.jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(DragDropHandler, { onDrop: handleDrop, children }) });
16661
17938
  }
16662
17939
  function useDrag() {
16663
- const context = React30__namespace.useContext(DragContext);
17940
+ const context = React36__namespace.useContext(DragContext);
16664
17941
  if (!context) {
16665
17942
  throw new Error("useDrag must be used within a DragProvider");
16666
17943
  }
@@ -16705,7 +17982,7 @@ function DroppableZone({
16705
17982
  }) {
16706
17983
  const { draggedEvent, setDraggedEvent } = useDrag();
16707
17984
  const { updateEvent } = useEventCalendar();
16708
- const [isOver, setIsOver] = React30__namespace.useState(false);
17985
+ const [isOver, setIsOver] = React36__namespace.useState(false);
16709
17986
  const handleDragOver = (e) => {
16710
17987
  e.preventDefault();
16711
17988
  e.dataTransfer.dropEffect = "move";
@@ -16743,23 +18020,23 @@ function DroppableZone({
16743
18020
  function useDroppable({ date, hour, minute = 0, onDrop }) {
16744
18021
  const { draggedEvent, setDraggedEvent } = useDrag();
16745
18022
  const { updateEvent } = useEventCalendar();
16746
- const [isOver, setIsOver] = React30__namespace.useState(false);
16747
- const dropTargetDate = React30__namespace.useMemo(() => {
18023
+ const [isOver, setIsOver] = React36__namespace.useState(false);
18024
+ const dropTargetDate = React36__namespace.useMemo(() => {
16748
18025
  const targetDate = new Date(date);
16749
18026
  if (hour !== void 0) {
16750
18027
  targetDate.setHours(hour, minute, 0, 0);
16751
18028
  }
16752
18029
  return targetDate;
16753
18030
  }, [date, hour, minute]);
16754
- const handleDragOver = React30__namespace.useCallback((e) => {
18031
+ const handleDragOver = React36__namespace.useCallback((e) => {
16755
18032
  e.preventDefault();
16756
18033
  e.dataTransfer.dropEffect = "move";
16757
18034
  if (!isOver) setIsOver(true);
16758
18035
  }, [isOver]);
16759
- const handleDragLeave = React30__namespace.useCallback(() => {
18036
+ const handleDragLeave = React36__namespace.useCallback(() => {
16760
18037
  setIsOver(false);
16761
18038
  }, []);
16762
- const handleDrop = React30__namespace.useCallback((e) => {
18039
+ const handleDrop = React36__namespace.useCallback((e) => {
16763
18040
  e.preventDefault();
16764
18041
  setIsOver(false);
16765
18042
  if (!draggedEvent) return;
@@ -16786,13 +18063,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
16786
18063
  function useDraggable3(event, disabled = false) {
16787
18064
  const { setDraggedEvent, draggedEvent } = useDrag();
16788
18065
  const isDragged = draggedEvent?.id === event.id;
16789
- const handleDragStart = React30__namespace.useCallback((e) => {
18066
+ const handleDragStart = React36__namespace.useCallback((e) => {
16790
18067
  if (disabled) return;
16791
18068
  e.dataTransfer.effectAllowed = "move";
16792
18069
  e.dataTransfer.setData("text/plain", event.id);
16793
18070
  setDraggedEvent(event);
16794
18071
  }, [disabled, event, setDraggedEvent]);
16795
- const handleDragEnd = React30__namespace.useCallback(() => {
18072
+ const handleDragEnd = React36__namespace.useCallback(() => {
16796
18073
  setDraggedEvent(null);
16797
18074
  }, [setDraggedEvent]);
16798
18075
  return {
@@ -16833,15 +18110,15 @@ function MonthView({
16833
18110
  }) {
16834
18111
  const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
16835
18112
  const filteredEvents = useFilteredEvents();
16836
- const { singleDayEvents, multiDayEvents } = React30__namespace.useMemo(
18113
+ const { singleDayEvents, multiDayEvents } = React36__namespace.useMemo(
16837
18114
  () => splitEventsByDuration(filteredEvents),
16838
18115
  [filteredEvents]
16839
18116
  );
16840
- const cells = React30__namespace.useMemo(
18117
+ const cells = React36__namespace.useMemo(
16841
18118
  () => getCalendarCells(selectedDate),
16842
18119
  [selectedDate]
16843
18120
  );
16844
- const eventPositions = React30__namespace.useMemo(
18121
+ const eventPositions = React36__namespace.useMemo(
16845
18122
  () => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
16846
18123
  [multiDayEvents, singleDayEvents, selectedDate]
16847
18124
  );
@@ -17023,7 +18300,7 @@ function WeekView({
17023
18300
  visibleHours
17024
18301
  } = useEventCalendar();
17025
18302
  const filteredEvents = useFilteredEvents();
17026
- const { singleDayEvents, multiDayEvents } = React30__namespace.useMemo(
18303
+ const { singleDayEvents, multiDayEvents } = React36__namespace.useMemo(
17027
18304
  () => splitEventsByDuration(filteredEvents),
17028
18305
  [filteredEvents]
17029
18306
  );
@@ -17229,8 +18506,8 @@ function CalendarTimeline({
17229
18506
  firstVisibleHour,
17230
18507
  lastVisibleHour
17231
18508
  }) {
17232
- const [currentTime, setCurrentTime] = React30__namespace.useState(/* @__PURE__ */ new Date());
17233
- React30__namespace.useEffect(() => {
18509
+ const [currentTime, setCurrentTime] = React36__namespace.useState(/* @__PURE__ */ new Date());
18510
+ React36__namespace.useEffect(() => {
17234
18511
  const interval = setInterval(() => {
17235
18512
  setCurrentTime(/* @__PURE__ */ new Date());
17236
18513
  }, 6e4);
@@ -17313,7 +18590,7 @@ function DayView({
17313
18590
  visibleHours
17314
18591
  } = useEventCalendar();
17315
18592
  const filteredEvents = useFilteredEvents();
17316
- const { singleDayEvents, multiDayEvents } = React30__namespace.useMemo(
18593
+ const { singleDayEvents, multiDayEvents } = React36__namespace.useMemo(
17317
18594
  () => splitEventsByDuration(filteredEvents),
17318
18595
  [filteredEvents]
17319
18596
  );
@@ -17321,7 +18598,7 @@ function DayView({
17321
18598
  visibleHours,
17322
18599
  singleDayEvents
17323
18600
  );
17324
- const currentEvents = React30__namespace.useMemo(() => {
18601
+ const currentEvents = React36__namespace.useMemo(() => {
17325
18602
  if (!dateFns.isToday(selectedDate)) return [];
17326
18603
  return getCurrentEvents(singleDayEvents);
17327
18604
  }, [singleDayEvents, selectedDate]);
@@ -17545,8 +18822,8 @@ function CalendarTimeline2({
17545
18822
  firstVisibleHour,
17546
18823
  lastVisibleHour
17547
18824
  }) {
17548
- const [currentTime, setCurrentTime] = React30__namespace.useState(/* @__PURE__ */ new Date());
17549
- React30__namespace.useEffect(() => {
18825
+ const [currentTime, setCurrentTime] = React36__namespace.useState(/* @__PURE__ */ new Date());
18826
+ React36__namespace.useEffect(() => {
17550
18827
  const interval = setInterval(() => {
17551
18828
  setCurrentTime(/* @__PURE__ */ new Date());
17552
18829
  }, 6e4);
@@ -17580,7 +18857,7 @@ function YearView({
17580
18857
  }) {
17581
18858
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17582
18859
  const filteredEvents = useFilteredEvents();
17583
- const months = React30__namespace.useMemo(() => {
18860
+ const months = React36__namespace.useMemo(() => {
17584
18861
  const yearStart = dateFns.startOfYear(selectedDate);
17585
18862
  return Array.from({ length: 12 }, (_, i) => dateFns.addMonths(yearStart, i));
17586
18863
  }, [selectedDate]);
@@ -17703,11 +18980,11 @@ function AgendaView({
17703
18980
  }) {
17704
18981
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17705
18982
  const filteredEvents = useFilteredEvents();
17706
- const { singleDayEvents, multiDayEvents } = React30__namespace.useMemo(
18983
+ const { singleDayEvents, multiDayEvents } = React36__namespace.useMemo(
17707
18984
  () => splitEventsByDuration(filteredEvents),
17708
18985
  [filteredEvents]
17709
18986
  );
17710
- const eventsByDay = React30__namespace.useMemo(() => {
18987
+ const eventsByDay = React36__namespace.useMemo(() => {
17711
18988
  const allDates = /* @__PURE__ */ new Map();
17712
18989
  singleDayEvents.forEach((event) => {
17713
18990
  const eventDate = dateFns.parseISO(event.startDate);
@@ -18172,16 +19449,16 @@ function EventDialog({
18172
19449
  defaultUserId
18173
19450
  }) {
18174
19451
  const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
18175
- const [title, setTitle] = React30__namespace.useState("");
18176
- const [description, setDescription] = React30__namespace.useState("");
18177
- const [startDate, setStartDate] = React30__namespace.useState("");
18178
- const [startTime, setStartTime] = React30__namespace.useState("");
18179
- const [endDate, setEndDate] = React30__namespace.useState("");
18180
- const [endTime, setEndTime] = React30__namespace.useState("");
18181
- const [color, setColor] = React30__namespace.useState("blue");
18182
- const [userId, setUserId] = React30__namespace.useState("");
18183
- const [isSubmitting, setIsSubmitting] = React30__namespace.useState(false);
18184
- React30__namespace.useEffect(() => {
19452
+ const [title, setTitle] = React36__namespace.useState("");
19453
+ const [description, setDescription] = React36__namespace.useState("");
19454
+ const [startDate, setStartDate] = React36__namespace.useState("");
19455
+ const [startTime, setStartTime] = React36__namespace.useState("");
19456
+ const [endDate, setEndDate] = React36__namespace.useState("");
19457
+ const [endTime, setEndTime] = React36__namespace.useState("");
19458
+ const [color, setColor] = React36__namespace.useState("blue");
19459
+ const [userId, setUserId] = React36__namespace.useState("");
19460
+ const [isSubmitting, setIsSubmitting] = React36__namespace.useState(false);
19461
+ React36__namespace.useEffect(() => {
18185
19462
  if (open) {
18186
19463
  if (mode === "edit" && event) {
18187
19464
  const start = dateFns.parseISO(event.startDate);
@@ -18404,7 +19681,7 @@ function QuickAddEvent({
18404
19681
  onOpenDialog,
18405
19682
  onClose
18406
19683
  }) {
18407
- const [title, setTitle] = React30__namespace.useState("");
19684
+ const [title, setTitle] = React36__namespace.useState("");
18408
19685
  const { users } = useEventCalendar();
18409
19686
  const handleSubmit = (e) => {
18410
19687
  e.preventDefault();
@@ -18471,8 +19748,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
18471
19748
  });
18472
19749
  function ChangeVisibleHoursInput() {
18473
19750
  const { visibleHours, setVisibleHours } = useEventCalendar();
18474
- const [from, setFrom] = React30__namespace.useState(visibleHours.from);
18475
- const [to, setTo] = React30__namespace.useState(visibleHours.to);
19751
+ const [from, setFrom] = React36__namespace.useState(visibleHours.from);
19752
+ const [to, setTo] = React36__namespace.useState(visibleHours.to);
18476
19753
  const handleApply = () => {
18477
19754
  const toHour = to === 0 ? 24 : to;
18478
19755
  setVisibleHours({ from, to: toHour });
@@ -18518,7 +19795,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
18518
19795
  });
18519
19796
  function ChangeWorkingHoursInput() {
18520
19797
  const { workingHours, setWorkingHours } = useEventCalendar();
18521
- const [localWorkingHours, setLocalWorkingHours] = React30__namespace.useState({
19798
+ const [localWorkingHours, setLocalWorkingHours] = React36__namespace.useState({
18522
19799
  ...workingHours
18523
19800
  });
18524
19801
  const handleToggleDay = (dayId) => {
@@ -18667,8 +19944,8 @@ function CalendarSettingsButton({
18667
19944
  );
18668
19945
  }
18669
19946
  function useMediaQuery(query) {
18670
- const [matches, setMatches] = React30__namespace.useState(false);
18671
- React30__namespace.useEffect(() => {
19947
+ const [matches, setMatches] = React36__namespace.useState(false);
19948
+ React36__namespace.useEffect(() => {
18672
19949
  const media = window.matchMedia(query);
18673
19950
  setMatches(media.matches);
18674
19951
  const listener = (event) => {
@@ -18720,11 +19997,11 @@ function BigCalendarInner({
18720
19997
  maxEventsPerDay
18721
19998
  }) {
18722
19999
  const { view, setView } = useEventCalendar();
18723
- const [dialogOpen, setDialogOpen] = React30__namespace.useState(false);
18724
- const [settingsDialogOpen, setSettingsDialogOpen] = React30__namespace.useState(false);
18725
- const [selectedEvent, setSelectedEvent] = React30__namespace.useState(null);
18726
- const [dialogMode, setDialogMode] = React30__namespace.useState("add");
18727
- const [defaultDate, setDefaultDate] = React30__namespace.useState(/* @__PURE__ */ new Date());
20000
+ const [dialogOpen, setDialogOpen] = React36__namespace.useState(false);
20001
+ const [settingsDialogOpen, setSettingsDialogOpen] = React36__namespace.useState(false);
20002
+ const [selectedEvent, setSelectedEvent] = React36__namespace.useState(null);
20003
+ const [dialogMode, setDialogMode] = React36__namespace.useState("add");
20004
+ const [defaultDate, setDefaultDate] = React36__namespace.useState(/* @__PURE__ */ new Date());
18728
20005
  const isMobile = useMediaQuery("(max-width: 768px)");
18729
20006
  const isCompact = compact === "auto" ? isMobile : compact;
18730
20007
  const handleAddClick = () => {
@@ -18883,7 +20160,7 @@ function CalendarView({
18883
20160
  }
18884
20161
  }
18885
20162
  var t = tunnel__default.default();
18886
- var KanbanContext = React30.createContext({
20163
+ var KanbanContext = React36.createContext({
18887
20164
  columns: [],
18888
20165
  data: [],
18889
20166
  activeCardId: null
@@ -18921,7 +20198,7 @@ var KanbanCard = ({
18921
20198
  } = sortable.useSortable({
18922
20199
  id
18923
20200
  });
18924
- const { activeCardId } = React30.useContext(KanbanContext);
20201
+ const { activeCardId } = React36.useContext(KanbanContext);
18925
20202
  const style = {
18926
20203
  transition,
18927
20204
  transform: utilities.CSS.Transform.toString(transform)
@@ -18956,7 +20233,7 @@ var KanbanCards = ({
18956
20233
  className,
18957
20234
  ...props
18958
20235
  }) => {
18959
- const { data } = React30.useContext(KanbanContext);
20236
+ const { data } = React36.useContext(KanbanContext);
18960
20237
  const filteredData = data.filter((item) => item.column === props.id);
18961
20238
  const items = filteredData.map((item) => item.id);
18962
20239
  return /* @__PURE__ */ jsxRuntime.jsxs(ScrollArea, { className: "overflow-hidden", children: [
@@ -18983,7 +20260,7 @@ var KanbanProvider = ({
18983
20260
  onDataChange,
18984
20261
  ...props
18985
20262
  }) => {
18986
- const [activeCardId, setActiveCardId] = React30.useState(null);
20263
+ const [activeCardId, setActiveCardId] = React36.useState(null);
18987
20264
  const sensors = core.useSensors(
18988
20265
  core.useSensor(core.MouseSensor),
18989
20266
  core.useSensor(core.TouchSensor),
@@ -19368,12 +20645,6 @@ exports.KanbanProvider = KanbanProvider;
19368
20645
  exports.Kbd = Kbd;
19369
20646
  exports.KbdGroup = KbdGroup;
19370
20647
  exports.Label = Label2;
19371
- exports.Map = Map2;
19372
- exports.MapMarker = MapMarker;
19373
- exports.MapPopup = MapPopup;
19374
- exports.MapTileLayer = MapTileLayer;
19375
- exports.MapTooltip = MapTooltip;
19376
- exports.MapZoomControl = MapZoomControl;
19377
20648
  exports.Menubar = Menubar;
19378
20649
  exports.MenubarCheckboxItem = MenubarCheckboxItem;
19379
20650
  exports.MenubarContent = MenubarContent;
@@ -19409,6 +20680,8 @@ exports.NavigationMenuTrigger = NavigationMenuTrigger;
19409
20680
  exports.NavigationMenuViewport = NavigationMenuViewport;
19410
20681
  exports.NetBadge = NetBadge;
19411
20682
  exports.PHASE_COLORS = PHASE_COLORS;
20683
+ exports.PackageCard = PackageCard;
20684
+ exports.PackageRow = PackageRow2;
19412
20685
  exports.Pagination = Pagination;
19413
20686
  exports.PaginationContent = PaginationContent;
19414
20687
  exports.PaginationEllipsis = PaginationEllipsis;
@@ -19509,6 +20782,7 @@ exports.Slider = Slider;
19509
20782
  exports.Spinner = Spinner;
19510
20783
  exports.StatusProgress = StatusProgress;
19511
20784
  exports.SubmitCalibrationBar = SubmitCalibrationBar;
20785
+ exports.SubtaskItem = SubtaskItem;
19512
20786
  exports.SupplierCell = SupplierCell;
19513
20787
  exports.SupplierWeeklyLoading = SupplierWeeklyLoading;
19514
20788
  exports.Switch = Switch;
@@ -19528,6 +20802,8 @@ exports.Textarea = Textarea;
19528
20802
  exports.ThemeSwitch = ThemeSwitch;
19529
20803
  exports.TimeIndicator = TimeIndicator;
19530
20804
  exports.Toaster = Toaster;
20805
+ exports.TodoBoard = TodoBoard;
20806
+ exports.TodoList = TodoList;
19531
20807
  exports.Toggle = Toggle;
19532
20808
  exports.ToggleGroup = ToggleGroup;
19533
20809
  exports.ToggleGroupItem = ToggleGroupItem;
@@ -19547,7 +20823,11 @@ exports.WeekDetailSheet = WeekDetailSheet;
19547
20823
  exports.WeekHeader = WeekHeader;
19548
20824
  exports.WeekView = WeekView;
19549
20825
  exports.WeeklyLoadingView = WeeklyLoadingView;
20826
+ exports.WorkflowViewToggle = WorkflowViewToggle;
19550
20827
  exports.YearView = YearView;
20828
+ exports.allRequiredSubtasksDone = allRequiredSubtasksDone;
20829
+ exports.anySubtaskStartedOrDone = anySubtaskStartedOrDone;
20830
+ exports.areDependenciesSatisfied = areDependenciesSatisfied;
19551
20831
  exports.badgeVariants = badgeVariants;
19552
20832
  exports.buttonGroupVariants = buttonGroupVariants;
19553
20833
  exports.buttonVariants = buttonVariants;
@@ -19558,11 +20838,19 @@ exports.calculateDropDates = calculateDropDates;
19558
20838
  exports.calculateFeasibility = calculateFeasibility;
19559
20839
  exports.calculateMonthEventPositions = calculateMonthEventPositions;
19560
20840
  exports.calculatePackagePositions = calculatePackagePositions;
20841
+ exports.calculateProgress = calculateProgress;
19561
20842
  exports.canSubmitCalibration = canSubmitCalibration;
19562
20843
  exports.cardVariants = cardVariants;
20844
+ exports.completeSubtask = completeSubtask;
20845
+ exports.computeAllPackageStates = computeAllPackageStates;
20846
+ exports.computePackageDerivedState = computePackageDerivedState;
20847
+ exports.computeSubtaskState = computeSubtaskState;
19563
20848
  exports.createDefaultEvent = createDefaultEvent;
19564
20849
  exports.deliveryIndicatorVariants = deliveryIndicatorVariants;
20850
+ exports.derivePackageBucket = derivePackageBucket;
20851
+ exports.derivePackageStatus = derivePackageStatus;
19565
20852
  exports.extractPrefixes = extractPrefixes;
20853
+ exports.findNextActionableSubtask = findNextActionableSubtask;
19566
20854
  exports.formatCalibrationUnit = formatCalibrationUnit;
19567
20855
  exports.formatDateRange = formatDateRange2;
19568
20856
  exports.formatDisplayDate = formatDisplayDate;
@@ -19575,8 +20863,11 @@ exports.generateColumns = generateColumns;
19575
20863
  exports.generateEventId = generateEventId;
19576
20864
  exports.generateLoadingWeek = generateLoadingWeek;
19577
20865
  exports.generateLocationOptions = generateLocationOptions;
20866
+ exports.generateLockReason = generateLockReason;
20867
+ exports.generateNextActionLabel = generateNextActionLabel;
19578
20868
  exports.generateWeekColumns = generateWeekColumns;
19579
20869
  exports.generateWeeks = generateWeeks;
20870
+ exports.getBlockingSubtasks = getBlockingSubtasks;
19580
20871
  exports.getCalendarCells = getCalendarCells;
19581
20872
  exports.getCommentLocationLabel = getCommentLocationLabel;
19582
20873
  exports.getCurrentEvents = getCurrentEvents;
@@ -19616,6 +20907,7 @@ exports.getYearMonths = getYearMonths;
19616
20907
  exports.groupDeliveriesByDay = groupDeliveriesByDay;
19617
20908
  exports.groupDeliveriesByPrefixAndDay = groupDeliveriesByPrefixAndDay;
19618
20909
  exports.groupEvents = groupEvents;
20910
+ exports.groupPackagesByBucket = groupPackagesByBucket;
19619
20911
  exports.isMultiDayEvent = isMultiDayEvent;
19620
20912
  exports.isWorkingHour = isWorkingHour;
19621
20913
  exports.navigateDate = navigateDate;
@@ -19628,8 +20920,10 @@ exports.sectionVariants = sectionVariants;
19628
20920
  exports.snapToInterval = snapToInterval;
19629
20921
  exports.sortEvents = sortEvents;
19630
20922
  exports.splitEventsByDuration = splitEventsByDuration;
20923
+ exports.startSubtask = startSubtask;
19631
20924
  exports.toggleVariants = toggleVariants;
19632
20925
  exports.toolBarCanvasButtonVariants = toolBarCanvasButtonVariants;
20926
+ exports.updateSubtaskStatus = updateSubtaskStatus;
19633
20927
  exports.useDrag = useDrag;
19634
20928
  exports.useDraggable = useDraggable3;
19635
20929
  exports.useDroppable = useDroppable;