@moontra/moonui-pro 2.11.4 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as t from 'react';
4
- import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useContext, useMemo, useLayoutEffect, useDebugValue, Component } from 'react';
4
+ import t__default, { useState, useRef, useCallback, forwardRef, createContext, useEffect, useMemo, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
5
5
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
6
- import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, Upload, Play, Eye, CheckCircle2, Pause, RotateCcw, Download, Copy, Share, Trash2, CreditCard, Globe, XCircle, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, MapPin, User, GripVertical, MessageCircle, Paperclip, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Image as Image$1, Table as Table$1, Settings, Undo, Redo, RefreshCw, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Zap, Languages, Lightbulb, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Move, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Video, Music, Archive, File, Filter, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, Star, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Activity, Server, EyeOff, RotateCw, Timer, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Grip, Unlock, Minimize2, Map as Map$1, Target, MoreVertical, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
6
+ import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronRight, Circle, ChevronUp, Lock, Sparkles, Plus, Upload, Play, Eye, CheckCircle2, Pause, RotateCcw, Download, Copy, Share, Trash2, CreditCard, Globe, XCircle, Clock, HelpCircle, ChevronLeft, Calendar as Calendar$1, Edit, MapPin, User, Filter, Move, Archive, EyeOff, Settings, Timer, Palette, ArrowUpDown, FileText, Star, Square, CheckSquare, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Highlighter, Link2, Image as Image$1, Table as Table$1, Undo, Redo, RefreshCw, Wand2, Maximize, Briefcase, MessageSquare, Heart, GraduationCap, Zap, Languages, Lightbulb, TrendingUp, TrendingDown, ZoomOut, ZoomIn, FileSpreadsheet, FileJson, Maximize2, Menu, Bell, CheckCheck, CheckCircle, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Video, Music, File, FileDown, ArrowUp, ArrowDown, ChevronsLeft, ChevronsRight, Pin, Sun, Moon, Monitor, Activity, Send, MessageCircle, Tag, MoreVertical, Paperclip, ExternalLink, CalendarIcon, DollarSign, Users, Github, GitFork, Server, RotateCw, Cpu, MemoryStick, HardDrive, Network, BarChart3, Columns, Flag, Grip, Unlock, Minimize2, Map as Map$1, Target, BellOff, ArrowDownRight, ArrowUpRight } from 'lucide-react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
10
10
  import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, isSameMonth, isToday, isSameDay, startOfDay, endOfDay, subDays, formatDistanceToNow } from 'date-fns';
11
- import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate } from 'framer-motion';
11
+ import { motion, AnimatePresence, useMotionValue, useSpring, useTransform, animate, useDragControls } from 'framer-motion';
12
12
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
13
13
  import * as ReactDOM from 'react-dom';
14
14
  import ReactDOM__default from 'react-dom';
@@ -1995,9 +1995,19 @@ var MoonUIAvatarFallbackPro = t.forwardRef(({ className, ...props }, ref) => /*
1995
1995
  ));
1996
1996
  MoonUIAvatarFallbackPro.displayName = AvatarPrimitive.Fallback.displayName;
1997
1997
  var MoonUIAvatarGroupPro = t.forwardRef(
1998
- ({ className, limit, avatars, overlapOffset = -8, ...props }, ref) => {
1999
- const visibleAvatars = limit ? avatars.slice(0, limit) : avatars;
2000
- const remainingCount = limit ? Math.max(0, avatars.length - limit) : 0;
1998
+ ({ className, max: max2 = 3, size: size4 = "md", children, overlapOffset, ...props }, ref) => {
1999
+ const childrenArray = t.Children.toArray(children);
2000
+ const visibleChildren = max2 ? childrenArray.slice(0, max2) : childrenArray;
2001
+ const remainingCount = max2 ? Math.max(0, childrenArray.length - max2) : 0;
2002
+ const defaultOffsets = {
2003
+ xs: -4,
2004
+ sm: -6,
2005
+ md: -8,
2006
+ lg: -10,
2007
+ xl: -12,
2008
+ "2xl": -16
2009
+ };
2010
+ const finalOffset = overlapOffset ?? defaultOffsets[size4] ?? -8;
2001
2011
  return /* @__PURE__ */ jsx(
2002
2012
  "div",
2003
2013
  {
@@ -2005,24 +2015,24 @@ var MoonUIAvatarGroupPro = t.forwardRef(
2005
2015
  className: cn("flex items-center", className),
2006
2016
  ...props,
2007
2017
  children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
2008
- visibleAvatars.map((avatar, index2) => /* @__PURE__ */ jsx(
2018
+ visibleChildren.map((child, index2) => /* @__PURE__ */ jsx(
2009
2019
  "div",
2010
2020
  {
2011
- className: "relative",
2021
+ className: "relative ring-2 ring-background rounded-full",
2012
2022
  style: {
2013
- marginLeft: index2 === 0 ? 0 : `${overlapOffset}px`,
2014
- zIndex: visibleAvatars.length - index2
2023
+ marginLeft: index2 === 0 ? 0 : `${finalOffset}px`,
2024
+ zIndex: visibleChildren.length - index2
2015
2025
  },
2016
- children: avatar
2026
+ children: t.isValidElement(child) && child.type === MoonUIAvatarPro ? t.cloneElement(child, { size: size4 }) : child
2017
2027
  },
2018
2028
  index2
2019
2029
  )),
2020
2030
  remainingCount > 0 && /* @__PURE__ */ jsx(
2021
2031
  "div",
2022
2032
  {
2023
- className: "relative z-0",
2024
- style: { marginLeft: `${overlapOffset}px` },
2025
- children: /* @__PURE__ */ jsx(MoonUIAvatarPro, { variant: "border", children: /* @__PURE__ */ jsxs(MoonUIAvatarFallbackPro, { children: [
2033
+ className: "relative z-0 ring-2 ring-background rounded-full",
2034
+ style: { marginLeft: `${finalOffset}px` },
2035
+ children: /* @__PURE__ */ jsx(MoonUIAvatarPro, { size: size4, className: "bg-muted", children: /* @__PURE__ */ jsxs(MoonUIAvatarFallbackPro, { className: "text-xs font-medium", children: [
2026
2036
  "+",
2027
2037
  remainingCount
2028
2038
  ] }) })
@@ -2033,7 +2043,7 @@ var MoonUIAvatarGroupPro = t.forwardRef(
2033
2043
  );
2034
2044
  }
2035
2045
  );
2036
- MoonUIAvatarGroupPro.displayName = "AvatarGroup";
2046
+ MoonUIAvatarGroupPro.displayName = "MoonUIAvatarGroupPro";
2037
2047
  var moonUIBadgeVariantsPro = cva(
2038
2048
  [
2039
2049
  "inline-flex items-center gap-1.5",
@@ -4044,7 +4054,7 @@ var me = t.forwardRef((r2, o) => {
4044
4054
  var e;
4045
4055
  return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
4046
4056
  }
4047
- function X20(e) {
4057
+ function X22(e) {
4048
4058
  let s = V()[e];
4049
4059
  s && E.setState("value", s.getAttribute(T));
4050
4060
  }
@@ -4059,10 +4069,10 @@ var me = t.forwardRef((r2, o) => {
4059
4069
  s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
4060
4070
  i ? E.setState("value", i.getAttribute(T)) : Q(e);
4061
4071
  }
4062
- let oe = () => X20(V().length - 1), ie3 = (e) => {
4072
+ let oe = () => X22(V().length - 1), ie3 = (e) => {
4063
4073
  e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
4064
4074
  }, se = (e) => {
4065
- e.preventDefault(), e.metaKey ? X20(0) : e.altKey ? re(-1) : Q(-1);
4075
+ e.preventDefault(), e.metaKey ? X22(0) : e.altKey ? re(-1) : Q(-1);
4066
4076
  };
4067
4077
  return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
4068
4078
  var s;
@@ -4089,7 +4099,7 @@ var me = t.forwardRef((r2, o) => {
4089
4099
  break;
4090
4100
  }
4091
4101
  case "Home": {
4092
- e.preventDefault(), X20(0);
4102
+ e.preventDefault(), X22(0);
4093
4103
  break;
4094
4104
  }
4095
4105
  case "End": {
@@ -6512,8 +6522,8 @@ var reducer = (state, action) => {
6512
6522
  if (toastId) {
6513
6523
  addToRemoveQueue(toastId);
6514
6524
  } else {
6515
- state.toasts.forEach((toast2) => {
6516
- addToRemoveQueue(toast2.id);
6525
+ state.toasts.forEach((toast3) => {
6526
+ addToRemoveQueue(toast3.id);
6517
6527
  });
6518
6528
  }
6519
6529
  return {
@@ -11111,24 +11121,1280 @@ function Calendar3({
11111
11121
  )
11112
11122
  ] });
11113
11123
  }
11114
- var PRIORITY_DOTS = {
11115
- low: "bg-green-500",
11116
- medium: "bg-yellow-500",
11117
- high: "bg-orange-500",
11118
- urgent: "bg-red-500"
11124
+ var PRIORITY_OPTIONS = [
11125
+ { value: "low", label: "Low", icon: Flag, color: "text-green-600" },
11126
+ { value: "medium", label: "Medium", icon: Flag, color: "text-yellow-600" },
11127
+ { value: "high", label: "High", icon: Flag, color: "text-orange-600" },
11128
+ { value: "urgent", label: "Urgent", icon: AlertCircle, color: "text-red-600" }
11129
+ ];
11130
+ var formatFileSize = (bytes) => {
11131
+ if (bytes === 0)
11132
+ return "0 Bytes";
11133
+ const k3 = 1024;
11134
+ const sizes = ["Bytes", "KB", "MB", "GB"];
11135
+ const i = Math.floor(Math.log(bytes) / Math.log(k3));
11136
+ return parseFloat((bytes / Math.pow(k3, i)).toFixed(2)) + " " + sizes[i];
11137
+ };
11138
+ var getInitials = (name) => {
11139
+ return name.split(" ").map((n) => n[0]).join("").toUpperCase();
11140
+ };
11141
+ function CardDetailModal({
11142
+ card: initialCard,
11143
+ isOpen,
11144
+ onClose,
11145
+ onUpdate,
11146
+ onDelete,
11147
+ availableAssignees = [],
11148
+ availableLabels = [],
11149
+ currentColumn,
11150
+ availableColumns = []
11151
+ }) {
11152
+ const [card, setCard] = useState(initialCard);
11153
+ const [isEditingTitle, setIsEditingTitle] = useState(false);
11154
+ const [isEditingDescription, setIsEditingDescription] = useState(false);
11155
+ const [newComment, setNewComment] = useState("");
11156
+ const [newChecklistItem, setNewChecklistItem] = useState("");
11157
+ const [selectedTab, setSelectedTab] = useState("overview");
11158
+ useEffect(() => {
11159
+ setCard(initialCard);
11160
+ }, [initialCard]);
11161
+ const updateCard = (updates) => {
11162
+ const updatedCard = { ...card, ...updates };
11163
+ setCard(updatedCard);
11164
+ onUpdate(updatedCard);
11165
+ };
11166
+ const addComment = () => {
11167
+ if (!newComment.trim())
11168
+ return;
11169
+ const newActivity = {
11170
+ id: Date.now().toString(),
11171
+ user: {
11172
+ id: "current-user",
11173
+ name: "Current User",
11174
+ email: "user@example.com"
11175
+ },
11176
+ action: "commented",
11177
+ timestamp: /* @__PURE__ */ new Date(),
11178
+ details: newComment
11179
+ };
11180
+ updateCard({
11181
+ activities: [newActivity, ...card.activities || []],
11182
+ comments: (card.comments || 0) + 1
11183
+ });
11184
+ setNewComment("");
11185
+ };
11186
+ const addChecklistItem = () => {
11187
+ if (!newChecklistItem.trim())
11188
+ return;
11189
+ const checklist = card.checklist || {
11190
+ id: Date.now().toString(),
11191
+ title: "Checklist",
11192
+ items: []
11193
+ };
11194
+ checklist.items.push({
11195
+ id: Date.now().toString(),
11196
+ text: newChecklistItem,
11197
+ completed: false
11198
+ });
11199
+ updateCard({ checklist });
11200
+ setNewChecklistItem("");
11201
+ };
11202
+ const toggleChecklistItem = (itemId) => {
11203
+ if (!card.checklist)
11204
+ return;
11205
+ const updatedChecklist = {
11206
+ ...card.checklist,
11207
+ items: card.checklist.items.map(
11208
+ (item) => item.id === itemId ? { ...item, completed: !item.completed } : item
11209
+ )
11210
+ };
11211
+ updateCard({ checklist: updatedChecklist });
11212
+ };
11213
+ const deleteChecklistItem = (itemId) => {
11214
+ if (!card.checklist)
11215
+ return;
11216
+ const updatedChecklist = {
11217
+ ...card.checklist,
11218
+ items: card.checklist.items.filter((item) => item.id !== itemId)
11219
+ };
11220
+ updateCard({ checklist: updatedChecklist });
11221
+ };
11222
+ const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
11223
+ const totalChecklistItems = card.checklist?.items.length || 0;
11224
+ const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
11225
+ const handleFileUpload = (e) => {
11226
+ const files = e.target.files;
11227
+ if (!files)
11228
+ return;
11229
+ const newAttachments = Array.from(files).map((file) => ({
11230
+ id: Date.now().toString() + Math.random(),
11231
+ name: file.name,
11232
+ type: file.type,
11233
+ url: URL.createObjectURL(file),
11234
+ size: file.size
11235
+ }));
11236
+ updateCard({
11237
+ attachments: [...card.attachments || [], ...newAttachments]
11238
+ });
11239
+ };
11240
+ const removeAttachment = (attachmentId) => {
11241
+ updateCard({
11242
+ attachments: card.attachments?.filter((a) => a.id !== attachmentId)
11243
+ });
11244
+ };
11245
+ return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-4xl max-h-[90vh] overflow-hidden p-0", children: [
11246
+ /* @__PURE__ */ jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
11247
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11248
+ isEditingTitle ? /* @__PURE__ */ jsx(
11249
+ MoonUIInputPro,
11250
+ {
11251
+ value: card.title,
11252
+ onChange: (e) => updateCard({ title: e.target.value }),
11253
+ onBlur: () => setIsEditingTitle(false),
11254
+ onKeyDown: (e) => {
11255
+ if (e.key === "Enter")
11256
+ setIsEditingTitle(false);
11257
+ if (e.key === "Escape") {
11258
+ setCard(initialCard);
11259
+ setIsEditingTitle(false);
11260
+ }
11261
+ },
11262
+ className: "text-xl font-semibold",
11263
+ autoFocus: true
11264
+ }
11265
+ ) : /* @__PURE__ */ jsx(
11266
+ "h2",
11267
+ {
11268
+ className: "text-xl font-semibold cursor-pointer hover:bg-muted rounded px-2 -mx-2 py-1",
11269
+ onClick: () => setIsEditingTitle(true),
11270
+ children: card.title
11271
+ }
11272
+ ),
11273
+ currentColumn && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-1", children: [
11274
+ "in ",
11275
+ currentColumn
11276
+ ] })
11277
+ ] }),
11278
+ /* @__PURE__ */ jsx(
11279
+ MoonUIButtonPro,
11280
+ {
11281
+ variant: "ghost",
11282
+ size: "icon",
11283
+ onClick: onClose,
11284
+ className: "h-8 w-8",
11285
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
11286
+ }
11287
+ )
11288
+ ] }) }),
11289
+ /* @__PURE__ */ jsxs(MoonUITabsPro, { value: selectedTab, onValueChange: setSelectedTab, className: "flex-1", children: [
11290
+ /* @__PURE__ */ jsx("div", { className: "px-6 pt-4", children: /* @__PURE__ */ jsxs(MoonUITabsListPro, { children: [
11291
+ /* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "overview", children: "Overview" }),
11292
+ /* @__PURE__ */ jsxs(MoonUITabsTriggerPro, { value: "activity", children: [
11293
+ "Activity",
11294
+ card.activities && card.activities.length > 0 && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: card.activities.length })
11295
+ ] }),
11296
+ /* @__PURE__ */ jsxs(MoonUITabsTriggerPro, { value: "comments", children: [
11297
+ "Comments",
11298
+ card.comments && card.comments > 0 && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: card.comments })
11299
+ ] })
11300
+ ] }) }),
11301
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 max-h-[calc(90vh-200px)]", children: /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
11302
+ /* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "overview", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
11303
+ /* @__PURE__ */ jsxs("div", { children: [
11304
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold mb-2 block", children: "Description" }),
11305
+ isEditingDescription ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
11306
+ /* @__PURE__ */ jsx(
11307
+ MoonUITextareaPro,
11308
+ {
11309
+ value: card.description || "",
11310
+ onChange: (e) => updateCard({ description: e.target.value }),
11311
+ placeholder: "Add a description...",
11312
+ className: "min-h-[100px]",
11313
+ autoFocus: true
11314
+ }
11315
+ ),
11316
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
11317
+ /* @__PURE__ */ jsx(
11318
+ MoonUIButtonPro,
11319
+ {
11320
+ size: "sm",
11321
+ onClick: () => setIsEditingDescription(false),
11322
+ children: "Save"
11323
+ }
11324
+ ),
11325
+ /* @__PURE__ */ jsx(
11326
+ MoonUIButtonPro,
11327
+ {
11328
+ size: "sm",
11329
+ variant: "ghost",
11330
+ onClick: () => {
11331
+ setCard(initialCard);
11332
+ setIsEditingDescription(false);
11333
+ },
11334
+ children: "Cancel"
11335
+ }
11336
+ )
11337
+ ] })
11338
+ ] }) : /* @__PURE__ */ jsx(
11339
+ "div",
11340
+ {
11341
+ className: "min-h-[50px] p-3 rounded-md border cursor-pointer hover:bg-muted/50",
11342
+ onClick: () => setIsEditingDescription(true),
11343
+ children: card.description || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add a description..." })
11344
+ }
11345
+ )
11346
+ ] }),
11347
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11348
+ /* @__PURE__ */ jsxs("div", { children: [
11349
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Assignees" }),
11350
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11351
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.assignees && card.assignees.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11352
+ /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 3, size: "xs", children: card.assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
11353
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
11354
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(assignee.name) })
11355
+ ] }, assignee.id)) }),
11356
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: card.assignees.map((a) => a.name).join(", ") })
11357
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add assignee" }) }) }),
11358
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { children: [
11359
+ /* @__PURE__ */ jsx(MoonUICommandInputPro, { placeholder: "Search assignees..." }),
11360
+ /* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No assignees found." }),
11361
+ /* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: availableAssignees.map((assignee) => {
11362
+ const isSelected = card.assignees?.some((a) => a.id === assignee.id);
11363
+ return /* @__PURE__ */ jsxs(
11364
+ MoonUICommandItemPro,
11365
+ {
11366
+ onSelect: () => {
11367
+ if (isSelected) {
11368
+ updateCard({
11369
+ assignees: card.assignees?.filter((a) => a.id !== assignee.id)
11370
+ });
11371
+ } else {
11372
+ updateCard({
11373
+ assignees: [...card.assignees || [], assignee]
11374
+ });
11375
+ }
11376
+ },
11377
+ children: [
11378
+ /* @__PURE__ */ jsx(
11379
+ Check,
11380
+ {
11381
+ className: cn(
11382
+ "mr-2 h-4 w-4",
11383
+ isSelected ? "opacity-100" : "opacity-0"
11384
+ )
11385
+ }
11386
+ ),
11387
+ /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6 mr-2", children: [
11388
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
11389
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(assignee.name) })
11390
+ ] }),
11391
+ /* @__PURE__ */ jsx("span", { children: assignee.name })
11392
+ ]
11393
+ },
11394
+ assignee.id
11395
+ );
11396
+ }) })
11397
+ ] }) })
11398
+ ] })
11399
+ ] }),
11400
+ /* @__PURE__ */ jsxs("div", { children: [
11401
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Priority" }),
11402
+ /* @__PURE__ */ jsxs(MoonUISelectPro, { value: card.priority || "medium", onValueChange: (value) => updateCard({ priority: value }), children: [
11403
+ /* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
11404
+ /* @__PURE__ */ jsx(MoonUISelectContentPro, { children: PRIORITY_OPTIONS.map((option) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: option.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11405
+ /* @__PURE__ */ jsx(option.icon, { className: cn("h-4 w-4", option.color) }),
11406
+ /* @__PURE__ */ jsx("span", { children: option.label })
11407
+ ] }) }, option.value)) })
11408
+ ] })
11409
+ ] }),
11410
+ /* @__PURE__ */ jsxs("div", { children: [
11411
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Due Date" }),
11412
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11413
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.dueDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
11414
+ /* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
11415
+ format(card.dueDate, "PPP")
11416
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Set due date" }) }) }),
11417
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
11418
+ Calendar,
11419
+ {
11420
+ mode: "single",
11421
+ selected: card.dueDate,
11422
+ onSelect: (date) => {
11423
+ if (date instanceof Date) {
11424
+ updateCard({ dueDate: date });
11425
+ } else {
11426
+ updateCard({ dueDate: void 0 });
11427
+ }
11428
+ },
11429
+ initialFocus: true
11430
+ }
11431
+ ) })
11432
+ ] })
11433
+ ] }),
11434
+ /* @__PURE__ */ jsxs("div", { children: [
11435
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-sm font-medium mb-2 block", children: "Labels" }),
11436
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11437
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: card.labels && card.labels.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: card.labels.map((label) => /* @__PURE__ */ jsx(
11438
+ "div",
11439
+ {
11440
+ className: "px-2 py-0.5 rounded text-xs text-white",
11441
+ style: { backgroundColor: label.color },
11442
+ children: label.name
11443
+ },
11444
+ label.id
11445
+ )) }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Add labels" }) }) }),
11446
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-3", align: "start", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: availableLabels.map((label) => {
11447
+ const isSelected = card.labels?.some((l) => l.id === label.id);
11448
+ return /* @__PURE__ */ jsxs(
11449
+ "div",
11450
+ {
11451
+ className: cn(
11452
+ "flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
11453
+ isSelected && "bg-muted"
11454
+ ),
11455
+ onClick: () => {
11456
+ if (isSelected) {
11457
+ updateCard({
11458
+ labels: card.labels?.filter((l) => l.id !== label.id)
11459
+ });
11460
+ } else {
11461
+ updateCard({
11462
+ labels: [...card.labels || [], label]
11463
+ });
11464
+ }
11465
+ },
11466
+ children: [
11467
+ /* @__PURE__ */ jsx(
11468
+ "div",
11469
+ {
11470
+ className: "w-6 h-6 rounded",
11471
+ style: { backgroundColor: label.color }
11472
+ }
11473
+ ),
11474
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: label.name }),
11475
+ isSelected && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-auto" })
11476
+ ]
11477
+ },
11478
+ label.id
11479
+ );
11480
+ }) }) })
11481
+ ] })
11482
+ ] })
11483
+ ] }),
11484
+ /* @__PURE__ */ jsxs("div", { children: [
11485
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
11486
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold", children: "Checklist" }),
11487
+ totalChecklistItems > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11488
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
11489
+ completedChecklistItems,
11490
+ "/",
11491
+ totalChecklistItems
11492
+ ] }),
11493
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: checklistProgress, className: "w-20 h-2" })
11494
+ ] })
11495
+ ] }),
11496
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
11497
+ card.checklist?.items.map((item) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 group", children: [
11498
+ /* @__PURE__ */ jsx(
11499
+ MoonUICheckboxPro,
11500
+ {
11501
+ checked: item.completed,
11502
+ onCheckedChange: () => toggleChecklistItem(item.id)
11503
+ }
11504
+ ),
11505
+ /* @__PURE__ */ jsx("span", { className: cn(
11506
+ "flex-1",
11507
+ item.completed && "line-through text-muted-foreground"
11508
+ ), children: item.text }),
11509
+ /* @__PURE__ */ jsx(
11510
+ MoonUIButtonPro,
11511
+ {
11512
+ variant: "ghost",
11513
+ size: "icon",
11514
+ className: "h-6 w-6 opacity-0 group-hover:opacity-100",
11515
+ onClick: () => deleteChecklistItem(item.id),
11516
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
11517
+ }
11518
+ )
11519
+ ] }, item.id)),
11520
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11521
+ /* @__PURE__ */ jsx(MoonUICheckboxPro, { disabled: true, className: "invisible" }),
11522
+ /* @__PURE__ */ jsx(
11523
+ MoonUIInputPro,
11524
+ {
11525
+ placeholder: "Add an item...",
11526
+ value: newChecklistItem,
11527
+ onChange: (e) => setNewChecklistItem(e.target.value),
11528
+ onKeyDown: (e) => {
11529
+ if (e.key === "Enter") {
11530
+ e.preventDefault();
11531
+ addChecklistItem();
11532
+ }
11533
+ }
11534
+ }
11535
+ ),
11536
+ /* @__PURE__ */ jsx(
11537
+ MoonUIButtonPro,
11538
+ {
11539
+ size: "sm",
11540
+ onClick: addChecklistItem,
11541
+ disabled: !newChecklistItem.trim(),
11542
+ children: "Add"
11543
+ }
11544
+ )
11545
+ ] })
11546
+ ] })
11547
+ ] }),
11548
+ /* @__PURE__ */ jsxs("div", { children: [
11549
+ /* @__PURE__ */ jsx(MoonUILabelPro, { className: "text-base font-semibold mb-3 block", children: "Attachments" }),
11550
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
11551
+ card.attachments?.map((attachment) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-3 border rounded-lg group", children: [
11552
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: attachment.type.startsWith("image/") ? /* @__PURE__ */ jsx(Image$1, { className: "h-8 w-8 text-muted-foreground" }) : /* @__PURE__ */ jsx(FileText, { className: "h-8 w-8 text-muted-foreground" }) }),
11553
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
11554
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: attachment.name }),
11555
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: formatFileSize(attachment.size) })
11556
+ ] }),
11557
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100", children: [
11558
+ /* @__PURE__ */ jsx(
11559
+ MoonUIButtonPro,
11560
+ {
11561
+ variant: "ghost",
11562
+ size: "icon",
11563
+ className: "h-8 w-8",
11564
+ onClick: () => window.open(attachment.url, "_blank"),
11565
+ children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
11566
+ }
11567
+ ),
11568
+ /* @__PURE__ */ jsx(
11569
+ MoonUIButtonPro,
11570
+ {
11571
+ variant: "ghost",
11572
+ size: "icon",
11573
+ className: "h-8 w-8",
11574
+ onClick: () => removeAttachment(attachment.id),
11575
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
11576
+ }
11577
+ )
11578
+ ] })
11579
+ ] }, attachment.id)),
11580
+ /* @__PURE__ */ jsxs("div", { children: [
11581
+ /* @__PURE__ */ jsx(
11582
+ "input",
11583
+ {
11584
+ type: "file",
11585
+ id: "file-upload",
11586
+ className: "hidden",
11587
+ multiple: true,
11588
+ onChange: handleFileUpload
11589
+ }
11590
+ ),
11591
+ /* @__PURE__ */ jsxs(
11592
+ MoonUIButtonPro,
11593
+ {
11594
+ variant: "outline",
11595
+ className: "w-full",
11596
+ onClick: () => document.getElementById("file-upload")?.click(),
11597
+ children: [
11598
+ /* @__PURE__ */ jsx(Upload, { className: "mr-2 h-4 w-4" }),
11599
+ "Add attachment"
11600
+ ]
11601
+ }
11602
+ )
11603
+ ] })
11604
+ ] })
11605
+ ] })
11606
+ ] }) }),
11607
+ /* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "activity", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
11608
+ card.activities?.map((activity) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
11609
+ /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-8 w-8", children: [
11610
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: activity.user.avatar }),
11611
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(activity.user.name) })
11612
+ ] }),
11613
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11614
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
11615
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: activity.user.name }),
11616
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: activity.action }),
11617
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: format(activity.timestamp, "PPp") })
11618
+ ] }),
11619
+ activity.details && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: activity.details })
11620
+ ] })
11621
+ ] }, activity.id)),
11622
+ (!card.activities || card.activities.length === 0) && /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
11623
+ /* @__PURE__ */ jsx(Activity, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
11624
+ /* @__PURE__ */ jsx("p", { children: "No activity yet" })
11625
+ ] })
11626
+ ] }) }),
11627
+ /* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "comments", className: "mt-0", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
11628
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
11629
+ /* @__PURE__ */ jsx(MoonUIAvatarPro, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { children: "U" }) }),
11630
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
11631
+ /* @__PURE__ */ jsx(
11632
+ MoonUITextareaPro,
11633
+ {
11634
+ placeholder: "Add a comment...",
11635
+ value: newComment,
11636
+ onChange: (e) => setNewComment(e.target.value),
11637
+ className: "min-h-[80px]"
11638
+ }
11639
+ ),
11640
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs(
11641
+ MoonUIButtonPro,
11642
+ {
11643
+ size: "sm",
11644
+ onClick: addComment,
11645
+ disabled: !newComment.trim(),
11646
+ children: [
11647
+ /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
11648
+ "Comment"
11649
+ ]
11650
+ }
11651
+ ) })
11652
+ ] })
11653
+ ] }),
11654
+ /* @__PURE__ */ jsx(MoonUISeparatorPro, {}),
11655
+ card.activities?.filter((a) => a.action === "commented").map((comment) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
11656
+ /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-8 w-8", children: [
11657
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: comment.user.avatar }),
11658
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(comment.user.name) })
11659
+ ] }),
11660
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11661
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
11662
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: comment.user.name }),
11663
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: format(comment.timestamp, "PPp") })
11664
+ ] }),
11665
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: comment.details })
11666
+ ] })
11667
+ ] }, comment.id)),
11668
+ !card.activities?.some((a) => a.action === "commented") && /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
11669
+ /* @__PURE__ */ jsx(MessageCircle, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
11670
+ /* @__PURE__ */ jsx("p", { children: "No comments yet" }),
11671
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: "Be the first to comment" })
11672
+ ] })
11673
+ ] }) })
11674
+ ] }) })
11675
+ ] }),
11676
+ /* @__PURE__ */ jsxs("div", { className: "border-t p-4 flex items-center justify-between", children: [
11677
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
11678
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
11679
+ /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4 mr-2" }),
11680
+ "Actions"
11681
+ ] }) }),
11682
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", children: [
11683
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11684
+ /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
11685
+ "Duplicate card"
11686
+ ] }),
11687
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11688
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
11689
+ "Archive card"
11690
+ ] }),
11691
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
11692
+ /* @__PURE__ */ jsx(Link2, { className: "mr-2 h-4 w-4" }),
11693
+ "Copy link"
11694
+ ] }),
11695
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
11696
+ /* @__PURE__ */ jsxs(
11697
+ MoonUIDropdownMenuItemPro,
11698
+ {
11699
+ onClick: () => {
11700
+ onDelete(card);
11701
+ onClose();
11702
+ },
11703
+ className: "text-destructive",
11704
+ children: [
11705
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
11706
+ "Delete card"
11707
+ ]
11708
+ }
11709
+ )
11710
+ ] })
11711
+ ] }) }),
11712
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: onClose, children: "Close" })
11713
+ ] })
11714
+ ] }) });
11715
+ }
11716
+ var PRIORITY_OPTIONS2 = [
11717
+ { value: "low", label: "Low Priority", icon: Flag, color: "text-green-600" },
11718
+ { value: "medium", label: "Medium Priority", icon: Flag, color: "text-yellow-600" },
11719
+ { value: "high", label: "High Priority", icon: Flag, color: "text-orange-600" },
11720
+ { value: "urgent", label: "Urgent", icon: Zap, color: "text-red-600" }
11721
+ ];
11722
+ var CARD_TEMPLATES = [
11723
+ {
11724
+ name: "Bug Report",
11725
+ icon: Flag,
11726
+ template: {
11727
+ title: "Bug: ",
11728
+ description: "**Steps to Reproduce:**\n1. \n2. \n3. \n\n**Expected Behavior:**\n\n**Actual Behavior:**",
11729
+ priority: "high",
11730
+ tags: ["bug"]
11731
+ }
11732
+ },
11733
+ {
11734
+ name: "Feature Request",
11735
+ icon: Star,
11736
+ template: {
11737
+ title: "Feature: ",
11738
+ description: "**User Story:**\nAs a [user type], I want [feature] so that [benefit].\n\n**Acceptance Criteria:**\n- [ ] ",
11739
+ priority: "medium",
11740
+ tags: ["feature"]
11741
+ }
11742
+ },
11743
+ {
11744
+ name: "Task",
11745
+ icon: CheckSquare,
11746
+ template: {
11747
+ title: "Task: ",
11748
+ description: "**Objective:**\n\n**Tasks:**\n- [ ] ",
11749
+ priority: "medium",
11750
+ tags: ["task"]
11751
+ }
11752
+ },
11753
+ {
11754
+ name: "User Story",
11755
+ icon: User,
11756
+ template: {
11757
+ title: "As a ",
11758
+ description: "**Story:**\nAs a [user type]\nI want [functionality]\nSo that [benefit]\n\n**Acceptance Criteria:**\n- [ ] ",
11759
+ priority: "medium",
11760
+ tags: ["story"]
11761
+ }
11762
+ }
11763
+ ];
11764
+ var getInitials2 = (name) => {
11765
+ return name.split(" ").map((n) => n[0]).join("").toUpperCase();
11766
+ };
11767
+ function AddCardModal({
11768
+ isOpen,
11769
+ onClose,
11770
+ onAdd,
11771
+ columnId,
11772
+ columnTitle,
11773
+ availableAssignees = [],
11774
+ availableLabels = [],
11775
+ templates = []
11776
+ }) {
11777
+ const [selectedTab, setSelectedTab] = useState("blank");
11778
+ const [title, setTitle] = useState("");
11779
+ const [description, setDescription] = useState("");
11780
+ const [priority, setPriority] = useState("medium");
11781
+ const [assignees, setAssignees] = useState([]);
11782
+ const [labels, setLabels] = useState([]);
11783
+ const [dueDate, setDueDate] = useState();
11784
+ const [tags, setTags] = useState([]);
11785
+ const [tagInput, setTagInput] = useState("");
11786
+ const handleTemplateSelect = (template) => {
11787
+ setTitle(template.title || "");
11788
+ setDescription(template.description || "");
11789
+ setPriority(template.priority || "medium");
11790
+ setTags(template.tags || []);
11791
+ if (template.assignees)
11792
+ setAssignees(template.assignees);
11793
+ if (template.labels)
11794
+ setLabels(template.labels);
11795
+ if (template.dueDate)
11796
+ setDueDate(template.dueDate);
11797
+ };
11798
+ const handleSubmit = () => {
11799
+ if (!title.trim())
11800
+ return;
11801
+ const newCard = {
11802
+ title: title.trim(),
11803
+ description: description.trim() || void 0,
11804
+ priority,
11805
+ assignees: assignees.length > 0 ? assignees : void 0,
11806
+ labels: labels.length > 0 ? labels : void 0,
11807
+ dueDate,
11808
+ tags: tags.length > 0 ? tags : void 0,
11809
+ position: Date.now()
11810
+ };
11811
+ onAdd(newCard);
11812
+ resetForm();
11813
+ onClose();
11814
+ };
11815
+ const resetForm = () => {
11816
+ setTitle("");
11817
+ setDescription("");
11818
+ setPriority("medium");
11819
+ setAssignees([]);
11820
+ setLabels([]);
11821
+ setDueDate(void 0);
11822
+ setTags([]);
11823
+ setTagInput("");
11824
+ setSelectedTab("blank");
11825
+ };
11826
+ const handleAddTag = () => {
11827
+ if (tagInput.trim() && !tags.includes(tagInput.trim())) {
11828
+ setTags([...tags, tagInput.trim()]);
11829
+ setTagInput("");
11830
+ }
11831
+ };
11832
+ [...CARD_TEMPLATES.map((t2) => ({ ...t2.template, name: t2.name, icon: t2.icon })), ...templates];
11833
+ return /* @__PURE__ */ jsx(MoonUIDialogPro, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "max-w-2xl", children: [
11834
+ /* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { children: [
11835
+ "Add Card to ",
11836
+ columnTitle
11837
+ ] }) }),
11838
+ /* @__PURE__ */ jsxs(MoonUITabsPro, { value: selectedTab, onValueChange: setSelectedTab, children: [
11839
+ /* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-2", children: [
11840
+ /* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "blank", children: "Blank Card" }),
11841
+ /* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "template", children: "From Template" })
11842
+ ] }),
11843
+ /* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "blank", className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
11844
+ /* @__PURE__ */ jsxs("div", { children: [
11845
+ /* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "title", children: "Title *" }),
11846
+ /* @__PURE__ */ jsx(
11847
+ MoonUIInputPro,
11848
+ {
11849
+ id: "title",
11850
+ placeholder: "Enter card title...",
11851
+ value: title,
11852
+ onChange: (e) => setTitle(e.target.value),
11853
+ autoFocus: true
11854
+ }
11855
+ )
11856
+ ] }),
11857
+ /* @__PURE__ */ jsxs("div", { children: [
11858
+ /* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "description", children: "Description" }),
11859
+ /* @__PURE__ */ jsx(
11860
+ MoonUITextareaPro,
11861
+ {
11862
+ id: "description",
11863
+ placeholder: "Add a more detailed description...",
11864
+ value: description,
11865
+ onChange: (e) => setDescription(e.target.value),
11866
+ className: "min-h-[100px]"
11867
+ }
11868
+ )
11869
+ ] }),
11870
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11871
+ /* @__PURE__ */ jsxs("div", { children: [
11872
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Priority" }),
11873
+ /* @__PURE__ */ jsxs(MoonUISelectPro, { value: priority, onValueChange: (value) => setPriority(value), children: [
11874
+ /* @__PURE__ */ jsx(MoonUISelectTriggerPro, { children: /* @__PURE__ */ jsx(MoonUISelectValuePro, {}) }),
11875
+ /* @__PURE__ */ jsx(MoonUISelectContentPro, { children: PRIORITY_OPTIONS2.map((option) => /* @__PURE__ */ jsx(MoonUISelectItemPro, { value: option.value, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11876
+ /* @__PURE__ */ jsx(option.icon, { className: cn("h-4 w-4", option.color) }),
11877
+ /* @__PURE__ */ jsx("span", { children: option.label })
11878
+ ] }) }, option.value)) })
11879
+ ] })
11880
+ ] }),
11881
+ /* @__PURE__ */ jsxs("div", { children: [
11882
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Due Date" }),
11883
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11884
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: dueDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
11885
+ /* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
11886
+ format(dueDate, "PPP")
11887
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11888
+ /* @__PURE__ */ jsx(Calendar$1, { className: "mr-2 h-4 w-4" }),
11889
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Pick a date" })
11890
+ ] }) }) }),
11891
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
11892
+ Calendar,
11893
+ {
11894
+ mode: "single",
11895
+ selected: dueDate,
11896
+ onSelect: (date) => {
11897
+ if (date instanceof Date) {
11898
+ setDueDate(date);
11899
+ } else {
11900
+ setDueDate(void 0);
11901
+ }
11902
+ },
11903
+ initialFocus: true
11904
+ }
11905
+ ) })
11906
+ ] })
11907
+ ] })
11908
+ ] }),
11909
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11910
+ /* @__PURE__ */ jsxs("div", { children: [
11911
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Assignees" }),
11912
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11913
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: assignees.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11914
+ /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 2, size: "xs", children: assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
11915
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
11916
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials2(assignee.name) })
11917
+ ] }, assignee.id)) }),
11918
+ /* @__PURE__ */ jsx("span", { className: "text-sm truncate", children: assignees.map((a) => a.name).join(", ") })
11919
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11920
+ /* @__PURE__ */ jsx(User, { className: "mr-2 h-4 w-4" }),
11921
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select assignees" })
11922
+ ] }) }) }),
11923
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-0", align: "start", children: /* @__PURE__ */ jsxs(MoonUICommandPro, { children: [
11924
+ /* @__PURE__ */ jsx(MoonUICommandInputPro, { placeholder: "Search people..." }),
11925
+ /* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No assignees found." }),
11926
+ /* @__PURE__ */ jsx(MoonUICommandGroupPro, { children: availableAssignees.map((assignee) => {
11927
+ const isSelected = assignees.some((a) => a.id === assignee.id);
11928
+ return /* @__PURE__ */ jsxs(
11929
+ MoonUICommandItemPro,
11930
+ {
11931
+ onSelect: () => {
11932
+ if (isSelected) {
11933
+ setAssignees(assignees.filter((a) => a.id !== assignee.id));
11934
+ } else {
11935
+ setAssignees([...assignees, assignee]);
11936
+ }
11937
+ },
11938
+ children: [
11939
+ /* @__PURE__ */ jsx(
11940
+ Check,
11941
+ {
11942
+ className: cn(
11943
+ "mr-2 h-4 w-4",
11944
+ isSelected ? "opacity-100" : "opacity-0"
11945
+ )
11946
+ }
11947
+ ),
11948
+ /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6 mr-2", children: [
11949
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
11950
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials2(assignee.name) })
11951
+ ] }),
11952
+ /* @__PURE__ */ jsx("span", { children: assignee.name })
11953
+ ]
11954
+ },
11955
+ assignee.id
11956
+ );
11957
+ }) })
11958
+ ] }) })
11959
+ ] })
11960
+ ] }),
11961
+ /* @__PURE__ */ jsxs("div", { children: [
11962
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Labels" }),
11963
+ /* @__PURE__ */ jsxs(MoonUIPopoverPro, { children: [
11964
+ /* @__PURE__ */ jsx(MoonUIPopoverTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", className: "w-full justify-start", children: labels.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 truncate", children: [
11965
+ labels.slice(0, 2).map((label) => /* @__PURE__ */ jsx(
11966
+ "div",
11967
+ {
11968
+ className: "px-2 py-0.5 rounded text-xs text-white",
11969
+ style: { backgroundColor: label.color },
11970
+ children: label.name
11971
+ },
11972
+ label.id
11973
+ )),
11974
+ labels.length > 2 && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
11975
+ "+",
11976
+ labels.length - 2,
11977
+ " more"
11978
+ ] })
11979
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11980
+ /* @__PURE__ */ jsx(Tag, { className: "mr-2 h-4 w-4" }),
11981
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Select labels" })
11982
+ ] }) }) }),
11983
+ /* @__PURE__ */ jsx(MoonUIPopoverContentPro, { className: "p-3", align: "start", children: /* @__PURE__ */ jsx("div", { className: "space-y-2", children: availableLabels.map((label) => {
11984
+ const isSelected = labels.some((l) => l.id === label.id);
11985
+ return /* @__PURE__ */ jsxs(
11986
+ "div",
11987
+ {
11988
+ className: cn(
11989
+ "flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
11990
+ isSelected && "bg-muted"
11991
+ ),
11992
+ onClick: () => {
11993
+ if (isSelected) {
11994
+ setLabels(labels.filter((l) => l.id !== label.id));
11995
+ } else {
11996
+ setLabels([...labels, label]);
11997
+ }
11998
+ },
11999
+ children: [
12000
+ /* @__PURE__ */ jsx(
12001
+ "div",
12002
+ {
12003
+ className: "w-6 h-6 rounded",
12004
+ style: { backgroundColor: label.color }
12005
+ }
12006
+ ),
12007
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: label.name }),
12008
+ isSelected && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-auto" })
12009
+ ]
12010
+ },
12011
+ label.id
12012
+ );
12013
+ }) }) })
12014
+ ] })
12015
+ ] })
12016
+ ] }),
12017
+ /* @__PURE__ */ jsxs("div", { children: [
12018
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Tags" }),
12019
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
12020
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
12021
+ /* @__PURE__ */ jsx(
12022
+ MoonUIInputPro,
12023
+ {
12024
+ placeholder: "Add a tag...",
12025
+ value: tagInput,
12026
+ onChange: (e) => setTagInput(e.target.value),
12027
+ onKeyDown: (e) => {
12028
+ if (e.key === "Enter") {
12029
+ e.preventDefault();
12030
+ handleAddTag();
12031
+ }
12032
+ }
12033
+ }
12034
+ ),
12035
+ /* @__PURE__ */ jsx(
12036
+ MoonUIButtonPro,
12037
+ {
12038
+ type: "button",
12039
+ variant: "outline",
12040
+ onClick: handleAddTag,
12041
+ disabled: !tagInput.trim(),
12042
+ children: "Add"
12043
+ }
12044
+ )
12045
+ ] }),
12046
+ tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => /* @__PURE__ */ jsxs(
12047
+ MoonUIBadgePro,
12048
+ {
12049
+ variant: "secondary",
12050
+ className: "cursor-pointer",
12051
+ onClick: () => setTags(tags.filter((t2) => t2 !== tag)),
12052
+ children: [
12053
+ tag,
12054
+ /* @__PURE__ */ jsx("span", { className: "ml-1 hover:text-destructive", children: "\xD7" })
12055
+ ]
12056
+ },
12057
+ tag
12058
+ )) })
12059
+ ] })
12060
+ ] })
12061
+ ] }) }),
12062
+ /* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "template", className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12063
+ CARD_TEMPLATES.map((template) => /* @__PURE__ */ jsxs(
12064
+ "div",
12065
+ {
12066
+ className: "p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",
12067
+ onClick: () => {
12068
+ handleTemplateSelect(template.template);
12069
+ setSelectedTab("blank");
12070
+ },
12071
+ children: [
12072
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
12073
+ /* @__PURE__ */ jsx(template.icon, { className: "h-5 w-5 text-muted-foreground" }),
12074
+ /* @__PURE__ */ jsx("h4", { className: "font-medium", children: template.name })
12075
+ ] }),
12076
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
12077
+ template.name === "Bug Report" && "Track and fix bugs with detailed information",
12078
+ template.name === "Feature Request" && "Plan new features with user stories",
12079
+ template.name === "Task" && "Create actionable tasks with clear objectives",
12080
+ template.name === "User Story" && "Define user needs and acceptance criteria"
12081
+ ] })
12082
+ ]
12083
+ },
12084
+ template.name
12085
+ )),
12086
+ templates.map((template, index2) => /* @__PURE__ */ jsxs(
12087
+ "div",
12088
+ {
12089
+ className: "p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",
12090
+ onClick: () => {
12091
+ handleTemplateSelect(template);
12092
+ setSelectedTab("blank");
12093
+ },
12094
+ children: [
12095
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
12096
+ /* @__PURE__ */ jsx(Star, { className: "h-5 w-5 text-muted-foreground" }),
12097
+ /* @__PURE__ */ jsx("h4", { className: "font-medium", children: template.title || `Template ${index2 + 1}` })
12098
+ ] }),
12099
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2", children: template.description || "Custom template" })
12100
+ ]
12101
+ },
12102
+ `custom-${index2}`
12103
+ ))
12104
+ ] }) })
12105
+ ] }),
12106
+ /* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
12107
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: onClose, children: "Cancel" }),
12108
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleSubmit, disabled: !title.trim(), children: "Add Card" })
12109
+ ] })
12110
+ ] }) });
12111
+ }
12112
+
12113
+ // src/hooks/use-toast.ts
12114
+ function useToast() {
12115
+ const toast3 = (options) => {
12116
+ console.log(`[Toast] ${options.title}${options.description ? ": " + options.description : ""}`);
12117
+ };
12118
+ return { toast: toast3 };
12119
+ }
12120
+ var PRIORITY_CONFIG = {
12121
+ low: {
12122
+ color: "bg-green-100 text-green-800 border-green-200",
12123
+ dot: "bg-green-500",
12124
+ icon: ArrowDown
12125
+ },
12126
+ medium: {
12127
+ color: "bg-yellow-100 text-yellow-800 border-yellow-200",
12128
+ dot: "bg-yellow-500",
12129
+ icon: ArrowUp
12130
+ },
12131
+ high: {
12132
+ color: "bg-orange-100 text-orange-800 border-orange-200",
12133
+ dot: "bg-orange-500",
12134
+ icon: Zap
12135
+ },
12136
+ urgent: {
12137
+ color: "bg-red-100 text-red-800 border-red-200",
12138
+ dot: "bg-red-500",
12139
+ icon: AlertCircle
12140
+ }
12141
+ };
12142
+ var COLUMN_TEMPLATES = {
12143
+ todo: { title: "To Do", color: "#6B7280" },
12144
+ inProgress: { title: "In Progress", color: "#3B82F6" },
12145
+ done: { title: "Done", color: "#10B981" }
12146
+ };
12147
+ var formatDate = (date) => {
12148
+ return date.toLocaleDateString("en-US", {
12149
+ month: "short",
12150
+ day: "numeric",
12151
+ year: date.getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() ? "numeric" : void 0
12152
+ });
12153
+ };
12154
+ var isOverdue = (dueDate) => {
12155
+ return dueDate < /* @__PURE__ */ new Date();
12156
+ };
12157
+ var getInitials3 = (name) => {
12158
+ return name.split(" ").map((n) => n[0]).join("").toUpperCase();
12159
+ };
12160
+ var useAutoScroll = () => {
12161
+ const scrollRef = useRef(null);
12162
+ const scrollIntervalRef = useRef(null);
12163
+ const startAutoScroll = useCallback((direction) => {
12164
+ if (scrollIntervalRef.current)
12165
+ return;
12166
+ scrollIntervalRef.current = setInterval(() => {
12167
+ if (scrollRef.current) {
12168
+ const scrollAmount = direction === "left" ? -10 : 10;
12169
+ scrollRef.current.scrollLeft += scrollAmount;
12170
+ }
12171
+ }, 20);
12172
+ }, []);
12173
+ const stopAutoScroll = useCallback(() => {
12174
+ if (scrollIntervalRef.current) {
12175
+ clearInterval(scrollIntervalRef.current);
12176
+ scrollIntervalRef.current = null;
12177
+ }
12178
+ }, []);
12179
+ useEffect(() => {
12180
+ return () => stopAutoScroll();
12181
+ }, [stopAutoScroll]);
12182
+ return { scrollRef, startAutoScroll, stopAutoScroll };
12183
+ };
12184
+ var KanbanCardComponent = ({
12185
+ card,
12186
+ isDragging,
12187
+ onEdit,
12188
+ onDelete,
12189
+ onClick,
12190
+ showDetails,
12191
+ disabled
12192
+ }) => {
12193
+ const [isEditingTitle, setIsEditingTitle] = useState(false);
12194
+ const [title, setTitle] = useState(card.title);
12195
+ const dragControls = useDragControls();
12196
+ const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
12197
+ const totalChecklistItems = card.checklist?.items.length || 0;
12198
+ const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
12199
+ return /* @__PURE__ */ jsx(
12200
+ motion.div,
12201
+ {
12202
+ layout: true,
12203
+ initial: { opacity: 0, y: 20 },
12204
+ animate: { opacity: 1, y: 0 },
12205
+ exit: { opacity: 0, y: -20 },
12206
+ whileHover: { scale: 1.02 },
12207
+ whileDrag: { scale: 1.05, rotate: 3 },
12208
+ transition: { duration: 0.2 },
12209
+ className: cn(
12210
+ "relative group cursor-pointer select-none",
12211
+ isDragging && "z-50"
12212
+ ),
12213
+ children: /* @__PURE__ */ jsxs(
12214
+ MoonUICardPro,
12215
+ {
12216
+ className: cn(
12217
+ "border hover:shadow-md transition-all duration-200",
12218
+ isDragging && "shadow-2xl ring-2 ring-primary ring-offset-2",
12219
+ disabled && "cursor-not-allowed opacity-50"
12220
+ ),
12221
+ onClick,
12222
+ children: [
12223
+ /* @__PURE__ */ jsx(
12224
+ "div",
12225
+ {
12226
+ className: "absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-primary/20 to-primary/10 opacity-0 group-hover:opacity-100 transition-opacity cursor-move",
12227
+ onPointerDown: (e) => dragControls.start(e)
12228
+ }
12229
+ ),
12230
+ card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
12231
+ /* @__PURE__ */ jsx(
12232
+ "img",
12233
+ {
12234
+ src: card.coverImage,
12235
+ alt: "",
12236
+ className: "w-full h-full object-cover"
12237
+ }
12238
+ ),
12239
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent" })
12240
+ ] }),
12241
+ /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "p-3", children: [
12242
+ card.labels && card.labels.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.labels.map((label) => /* @__PURE__ */ jsx(
12243
+ "div",
12244
+ {
12245
+ className: "h-2 w-12 rounded-full",
12246
+ style: { backgroundColor: label.color },
12247
+ title: label.name
12248
+ },
12249
+ label.id
12250
+ )) }),
12251
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2 mb-2", children: [
12252
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: isEditingTitle ? /* @__PURE__ */ jsx(
12253
+ MoonUIInputPro,
12254
+ {
12255
+ value: title,
12256
+ onChange: (e) => setTitle(e.target.value),
12257
+ onBlur: () => setIsEditingTitle(false),
12258
+ onKeyDown: (e) => {
12259
+ if (e.key === "Enter") {
12260
+ setIsEditingTitle(false);
12261
+ }
12262
+ if (e.key === "Escape") {
12263
+ setTitle(card.title);
12264
+ setIsEditingTitle(false);
12265
+ }
12266
+ },
12267
+ className: "h-6 px-1 py-0 text-sm font-medium",
12268
+ autoFocus: true,
12269
+ onClick: (e) => e.stopPropagation()
12270
+ }
12271
+ ) : /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm line-clamp-2", children: card.title }) }),
12272
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
12273
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
12274
+ MoonUIButtonPro,
12275
+ {
12276
+ variant: "ghost",
12277
+ size: "sm",
12278
+ className: "h-6 w-6 p-0",
12279
+ onClick: (e) => e.stopPropagation(),
12280
+ children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-3 w-3" })
12281
+ }
12282
+ ) }),
12283
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
12284
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: onEdit, children: [
12285
+ /* @__PURE__ */ jsx(Edit, { className: "mr-2 h-4 w-4" }),
12286
+ "Edit"
12287
+ ] }),
12288
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
12289
+ /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
12290
+ "Duplicate"
12291
+ ] }),
12292
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
12293
+ /* @__PURE__ */ jsx(Move, { className: "mr-2 h-4 w-4" }),
12294
+ "Move"
12295
+ ] }),
12296
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
12297
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
12298
+ "Archive"
12299
+ ] }),
12300
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
12301
+ /* @__PURE__ */ jsxs(
12302
+ MoonUIDropdownMenuItemPro,
12303
+ {
12304
+ onClick: onDelete,
12305
+ className: "text-destructive",
12306
+ children: [
12307
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
12308
+ "Delete"
12309
+ ]
12310
+ }
12311
+ )
12312
+ ] })
12313
+ ] }) })
12314
+ ] }),
12315
+ card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-3 line-clamp-2", children: card.description }),
12316
+ (card.progress !== void 0 || card.checklist) && /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
12317
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground mb-1", children: [
12318
+ /* @__PURE__ */ jsx("span", { children: "Progress" }),
12319
+ /* @__PURE__ */ jsxs("span", { children: [
12320
+ Math.round(card.progress || checklistProgress),
12321
+ "%"
12322
+ ] })
12323
+ ] }),
12324
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: card.progress || checklistProgress, className: "h-1" })
12325
+ ] }),
12326
+ card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-3", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs px-1.5 py-0", children: tag }, index2)) }),
12327
+ showDetails && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
12328
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12329
+ card.priority && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
12330
+ /* @__PURE__ */ jsx("div", { className: cn("w-2 h-2 rounded-full", PRIORITY_CONFIG[card.priority].dot) }),
12331
+ /* @__PURE__ */ jsx("span", { className: "capitalize", children: card.priority })
12332
+ ] }),
12333
+ card.dueDate && /* @__PURE__ */ jsxs("div", { className: cn(
12334
+ "flex items-center gap-1",
12335
+ isOverdue(card.dueDate) && "text-destructive"
12336
+ ), children: [
12337
+ /* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
12338
+ /* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
12339
+ ] }),
12340
+ card.checklist && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
12341
+ /* @__PURE__ */ jsx(CheckSquare, { className: "h-3 w-3" }),
12342
+ /* @__PURE__ */ jsxs("span", { children: [
12343
+ completedChecklistItems,
12344
+ "/",
12345
+ totalChecklistItems
12346
+ ] })
12347
+ ] })
12348
+ ] }),
12349
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12350
+ card.comments && card.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
12351
+ /* @__PURE__ */ jsx(MessageCircle, { className: "h-3 w-3" }),
12352
+ /* @__PURE__ */ jsx("span", { children: card.comments })
12353
+ ] }),
12354
+ card.attachments && card.attachments.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
12355
+ /* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
12356
+ /* @__PURE__ */ jsx("span", { children: card.attachments.length })
12357
+ ] }),
12358
+ card.assignees && card.assignees.length > 0 && /* @__PURE__ */ jsx(MoonUIAvatarGroupPro, { max: 3, size: "xs", children: card.assignees.map((assignee) => /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
12359
+ /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: assignee.avatar }),
12360
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials3(assignee.name) })
12361
+ ] }, assignee.id)) })
12362
+ ] })
12363
+ ] })
12364
+ ] })
12365
+ ]
12366
+ }
12367
+ )
12368
+ }
12369
+ );
11119
12370
  };
11120
12371
  function Kanban({
11121
- columns,
12372
+ columns: initialColumns,
11122
12373
  onCardMove,
11123
12374
  onCardClick,
11124
12375
  onCardEdit,
11125
12376
  onCardDelete,
12377
+ onCardUpdate,
11126
12378
  onAddCard,
11127
12379
  onAddColumn,
12380
+ onColumnUpdate,
12381
+ onColumnDelete,
12382
+ onBulkAction,
12383
+ onExport,
11128
12384
  className,
11129
12385
  showAddColumn = true,
11130
12386
  showCardDetails = true,
11131
- disabled = false
12387
+ showFilters = true,
12388
+ showSearch = true,
12389
+ enableKeyboardShortcuts = true,
12390
+ cardTemplates = [],
12391
+ columnTemplates = [],
12392
+ filters = [],
12393
+ defaultFilter,
12394
+ loading = false,
12395
+ disabled = false,
12396
+ labels = [],
12397
+ users = []
11132
12398
  }) {
11133
12399
  const { hasProAccess, isLoading } = useSubscription();
11134
12400
  if (!isLoading && !hasProAccess) {
@@ -11144,243 +12410,852 @@ function Kanban({
11144
12410
  ] })
11145
12411
  ] }) }) });
11146
12412
  }
11147
- const [draggedCard, setDraggedCard] = t__default.useState(null);
11148
- const [draggedOverColumn, setDraggedOverColumn] = t__default.useState(null);
11149
- const [draggedFromColumn, setDraggedFromColumn] = t__default.useState(null);
11150
- const handleDragStart = (e, cardId) => {
11151
- if (disabled)
12413
+ const [columns, setColumns] = useState(initialColumns);
12414
+ const [searchQuery, setSearchQuery] = useState("");
12415
+ const [activeFilter, setActiveFilter] = useState(defaultFilter);
12416
+ const [selectedCards, setSelectedCards] = useState([]);
12417
+ const [draggedCard, setDraggedCard] = useState(null);
12418
+ const [draggedOverColumn, setDraggedOverColumn] = useState(null);
12419
+ const [isCreatingColumn, setIsCreatingColumn] = useState(false);
12420
+ const [newColumnTitle, setNewColumnTitle] = useState("");
12421
+ const [selectedCard, setSelectedCard] = useState(null);
12422
+ const [addCardColumnId, setAddCardColumnId] = useState(null);
12423
+ const [editingColumnId, setEditingColumnId] = useState(null);
12424
+ const [editingColumnTitle, setEditingColumnTitle] = useState("");
12425
+ const [wipLimitModalOpen, setWipLimitModalOpen] = useState(false);
12426
+ const [wipLimitColumnId, setWipLimitColumnId] = useState(null);
12427
+ const [wipLimit, setWipLimit] = useState();
12428
+ const [colorPickerOpen, setColorPickerOpen] = useState(false);
12429
+ const [colorPickerColumnId, setColorPickerColumnId] = useState(null);
12430
+ const [selectedColor, setSelectedColor] = useState("#6B7280");
12431
+ const { scrollRef, startAutoScroll, stopAutoScroll } = useAutoScroll();
12432
+ const { toast: toast3 } = useToast();
12433
+ const filteredColumns = useMemo(() => {
12434
+ if (!searchQuery && !activeFilter)
12435
+ return columns;
12436
+ return columns.map((column) => ({
12437
+ ...column,
12438
+ cards: column.cards.filter((card) => {
12439
+ if (searchQuery) {
12440
+ const query = searchQuery.toLowerCase();
12441
+ const matchesSearch = card.title.toLowerCase().includes(query) || card.description?.toLowerCase().includes(query) || card.tags?.some((tag) => tag.toLowerCase().includes(query)) || card.assignees?.some((a) => a.name.toLowerCase().includes(query));
12442
+ if (!matchesSearch)
12443
+ return false;
12444
+ }
12445
+ if (activeFilter) {
12446
+ const filter = filters.find((f) => f.id === activeFilter);
12447
+ if (filter) {
12448
+ if (filter.assignees?.length && !card.assignees?.some((a) => filter.assignees.includes(a.id))) {
12449
+ return false;
12450
+ }
12451
+ if (filter.priority?.length && !filter.priority.includes(card.priority || "")) {
12452
+ return false;
12453
+ }
12454
+ if (filter.labels?.length && !card.labels?.some((l) => filter.labels.includes(l.id))) {
12455
+ return false;
12456
+ }
12457
+ }
12458
+ }
12459
+ return true;
12460
+ })
12461
+ }));
12462
+ }, [columns, searchQuery, activeFilter, filters]);
12463
+ useEffect(() => {
12464
+ if (!enableKeyboardShortcuts)
11152
12465
  return;
11153
- const sourceColumn = columns.find(
11154
- (col) => col.cards.some((card) => card.id === cardId)
11155
- );
11156
- setDraggedCard(cardId);
11157
- setDraggedFromColumn(sourceColumn?.id || null);
11158
- e.dataTransfer.effectAllowed = "move";
11159
- e.dataTransfer.setData("text/plain", cardId);
11160
- e.currentTarget.classList.add("opacity-50");
11161
- };
11162
- const handleDragEnd = (e) => {
12466
+ const handleKeyDown3 = (e) => {
12467
+ if ((e.metaKey || e.ctrlKey) && e.key === "f") {
12468
+ e.preventDefault();
12469
+ document.getElementById("kanban-search")?.focus();
12470
+ }
12471
+ if ((e.metaKey || e.ctrlKey) && e.key === "n") {
12472
+ e.preventDefault();
12473
+ const firstColumn = columns[0];
12474
+ if (firstColumn && onAddCard) {
12475
+ onAddCard(firstColumn.id);
12476
+ }
12477
+ }
12478
+ if (e.key === "Escape") {
12479
+ setSelectedCards([]);
12480
+ }
12481
+ };
12482
+ window.addEventListener("keydown", handleKeyDown3);
12483
+ return () => window.removeEventListener("keydown", handleKeyDown3);
12484
+ }, [enableKeyboardShortcuts, columns, onAddCard]);
12485
+ const handleDragStart = (card, columnId) => {
11163
12486
  if (disabled)
11164
12487
  return;
11165
- setDraggedCard(null);
11166
- setDraggedOverColumn(null);
11167
- setDraggedFromColumn(null);
11168
- e.currentTarget.classList.remove("opacity-50");
12488
+ setDraggedCard(card.id);
11169
12489
  };
11170
12490
  const handleDragOver = (e, columnId) => {
11171
12491
  if (disabled)
11172
12492
  return;
11173
12493
  e.preventDefault();
11174
- e.dataTransfer.dropEffect = "move";
11175
12494
  setDraggedOverColumn(columnId);
11176
- };
11177
- const handleDragEnter = (e, columnId) => {
11178
- if (disabled)
12495
+ const container = scrollRef.current;
12496
+ if (!container)
11179
12497
  return;
11180
- e.preventDefault();
11181
- setDraggedOverColumn(columnId);
12498
+ const rect = container.getBoundingClientRect();
12499
+ const x = e.clientX;
12500
+ if (x < rect.left + 100) {
12501
+ startAutoScroll("left");
12502
+ } else if (x > rect.right - 100) {
12503
+ startAutoScroll("right");
12504
+ } else {
12505
+ stopAutoScroll();
12506
+ }
11182
12507
  };
11183
- const handleDragLeave = (e, columnId) => {
11184
- if (disabled)
12508
+ const handleDragEnd = () => {
12509
+ setDraggedCard(null);
12510
+ setDraggedOverColumn(null);
12511
+ stopAutoScroll();
12512
+ };
12513
+ const handleDrop = (e, targetColumnId, targetIndex) => {
12514
+ if (disabled || !draggedCard || !onCardMove)
11185
12515
  return;
11186
12516
  e.preventDefault();
11187
- const rect = e.currentTarget.getBoundingClientRect();
11188
- const isLeavingColumn = e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom;
11189
- if (isLeavingColumn) {
11190
- setDraggedOverColumn(null);
12517
+ let sourceColumnId = null;
12518
+ let sourceCard = null;
12519
+ for (const column of columns) {
12520
+ const card = column.cards.find((c2) => c2.id === draggedCard);
12521
+ if (card) {
12522
+ sourceColumnId = column.id;
12523
+ sourceCard = card;
12524
+ break;
12525
+ }
12526
+ }
12527
+ if (sourceColumnId && sourceCard) {
12528
+ onCardMove(draggedCard, sourceColumnId, targetColumnId, targetIndex);
11191
12529
  }
12530
+ handleDragEnd();
11192
12531
  };
11193
- const handleDrop = (e, columnId) => {
11194
- if (disabled)
11195
- return;
11196
- e.preventDefault();
11197
- const cardId = e.dataTransfer.getData("text/plain") || draggedCard;
11198
- if (cardId && onCardMove && draggedFromColumn && draggedFromColumn !== columnId) {
11199
- const targetColumn = columns.find((col) => col.id === columnId);
11200
- const newIndex = targetColumn?.cards.length || 0;
11201
- onCardMove(cardId, draggedFromColumn, columnId, newIndex);
12532
+ const handleBulkAction = (action) => {
12533
+ if (onBulkAction && selectedCards.length > 0) {
12534
+ onBulkAction(action, selectedCards);
12535
+ setSelectedCards([]);
12536
+ }
12537
+ };
12538
+ const handleColumnAction = (column, action) => {
12539
+ switch (action) {
12540
+ case "rename":
12541
+ setEditingColumnId(column.id);
12542
+ setEditingColumnTitle(column.title);
12543
+ break;
12544
+ case "delete":
12545
+ onColumnDelete?.(column.id);
12546
+ toast3({
12547
+ title: "Column deleted",
12548
+ description: `"${column.title}" has been deleted`
12549
+ });
12550
+ break;
12551
+ case "collapse":
12552
+ const updatedColumn = { ...column, collapsed: !column.collapsed };
12553
+ onColumnUpdate?.(updatedColumn);
12554
+ setColumns(columns.map((col) => col.id === column.id ? updatedColumn : col));
12555
+ break;
12556
+ case "setLimit":
12557
+ setWipLimitColumnId(column.id);
12558
+ setWipLimit(column.limit);
12559
+ setWipLimitModalOpen(true);
12560
+ break;
12561
+ case "changeColor":
12562
+ setColorPickerColumnId(column.id);
12563
+ setSelectedColor(column.color || "#6B7280");
12564
+ setColorPickerOpen(true);
12565
+ break;
12566
+ case "sortByPriority":
12567
+ const sortedCards = [...column.cards].sort((a, b) => {
12568
+ const priorityOrder = { urgent: 4, high: 3, medium: 2, low: 1 };
12569
+ return (priorityOrder[b.priority || "medium"] || 2) - (priorityOrder[a.priority || "medium"] || 2);
12570
+ });
12571
+ const sortedColumn = { ...column, cards: sortedCards };
12572
+ onColumnUpdate?.(sortedColumn);
12573
+ setColumns(columns.map((col) => col.id === column.id ? sortedColumn : col));
12574
+ toast3({
12575
+ title: "Cards sorted",
12576
+ description: "Cards sorted by priority"
12577
+ });
12578
+ break;
12579
+ case "sortByDueDate":
12580
+ const dateCards = [...column.cards].sort((a, b) => {
12581
+ if (!a.dueDate && !b.dueDate)
12582
+ return 0;
12583
+ if (!a.dueDate)
12584
+ return 1;
12585
+ if (!b.dueDate)
12586
+ return -1;
12587
+ return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime();
12588
+ });
12589
+ const dateColumn = { ...column, cards: dateCards };
12590
+ onColumnUpdate?.(dateColumn);
12591
+ setColumns(columns.map((col) => col.id === column.id ? dateColumn : col));
12592
+ toast3({
12593
+ title: "Cards sorted",
12594
+ description: "Cards sorted by due date"
12595
+ });
12596
+ break;
12597
+ case "sortAlphabetically":
12598
+ const alphaCards = [...column.cards].sort((a, b) => a.title.localeCompare(b.title));
12599
+ const alphaColumn = { ...column, cards: alphaCards };
12600
+ onColumnUpdate?.(alphaColumn);
12601
+ setColumns(columns.map((col) => col.id === column.id ? alphaColumn : col));
12602
+ toast3({
12603
+ title: "Cards sorted",
12604
+ description: "Cards sorted alphabetically"
12605
+ });
12606
+ break;
11202
12607
  }
11203
- setDraggedCard(null);
11204
- setDraggedOverColumn(null);
11205
- setDraggedFromColumn(null);
11206
12608
  };
11207
12609
  const handleCardClick = (card) => {
11208
- if (disabled)
11209
- return;
11210
- onCardClick?.(card);
12610
+ if (onCardClick) {
12611
+ onCardClick(card);
12612
+ } else {
12613
+ setSelectedCard(card);
12614
+ }
11211
12615
  };
11212
- const handleCardEdit = (card, e) => {
11213
- if (disabled)
12616
+ const handleCardUpdate = (updatedCard) => {
12617
+ onCardUpdate?.(updatedCard);
12618
+ setColumns(columns.map((col) => ({
12619
+ ...col,
12620
+ cards: col.cards.map((card) => card.id === updatedCard.id ? updatedCard : card)
12621
+ })));
12622
+ };
12623
+ const handleAddCard = (columnId, newCard) => {
12624
+ if (onAddCard) {
12625
+ onAddCard(columnId, newCard);
12626
+ } else {
12627
+ setAddCardColumnId(columnId);
12628
+ }
12629
+ };
12630
+ const handleAddNewCard = (card) => {
12631
+ if (!addCardColumnId)
11214
12632
  return;
11215
- e.stopPropagation();
11216
- onCardEdit?.(card);
12633
+ const newCard = {
12634
+ id: Date.now().toString(),
12635
+ title: card.title || "New Card",
12636
+ position: Date.now(),
12637
+ ...card
12638
+ };
12639
+ setColumns(columns.map((col) => {
12640
+ if (col.id === addCardColumnId) {
12641
+ return {
12642
+ ...col,
12643
+ cards: [...col.cards, newCard]
12644
+ };
12645
+ }
12646
+ return col;
12647
+ }));
12648
+ onAddCard?.(addCardColumnId, newCard);
12649
+ toast3({
12650
+ title: "Card added",
12651
+ description: `"${newCard.title}" has been added`
12652
+ });
11217
12653
  };
11218
- const handleCardDelete = (card, e) => {
11219
- if (disabled)
12654
+ const handleColumnRename = (columnId) => {
12655
+ const column = columns.find((col) => col.id === columnId);
12656
+ if (!column || !editingColumnTitle.trim())
11220
12657
  return;
11221
- e.stopPropagation();
11222
- onCardDelete?.(card);
12658
+ const updatedColumn = { ...column, title: editingColumnTitle.trim() };
12659
+ onColumnUpdate?.(updatedColumn);
12660
+ setColumns(columns.map((col) => col.id === columnId ? updatedColumn : col));
12661
+ setEditingColumnId(null);
12662
+ setEditingColumnTitle("");
12663
+ toast3({
12664
+ title: "Column renamed",
12665
+ description: `Column renamed to "${editingColumnTitle.trim()}"`
12666
+ });
11223
12667
  };
11224
- const formatDate = (date) => {
11225
- return date.toLocaleDateString("en-US", {
11226
- month: "short",
11227
- day: "numeric"
12668
+ const handleWipLimitUpdate = () => {
12669
+ const column = columns.find((col) => col.id === wipLimitColumnId);
12670
+ if (!column)
12671
+ return;
12672
+ const updatedColumn = { ...column, limit: wipLimit };
12673
+ onColumnUpdate?.(updatedColumn);
12674
+ setColumns(columns.map((col) => col.id === wipLimitColumnId ? updatedColumn : col));
12675
+ setWipLimitModalOpen(false);
12676
+ toast3({
12677
+ title: "WIP limit updated",
12678
+ description: wipLimit ? `WIP limit set to ${wipLimit}` : "WIP limit removed"
11228
12679
  });
11229
12680
  };
11230
- const isOverdue = (dueDate) => {
11231
- return dueDate < /* @__PURE__ */ new Date();
12681
+ const handleColorUpdate = () => {
12682
+ const column = columns.find((col) => col.id === colorPickerColumnId);
12683
+ if (!column)
12684
+ return;
12685
+ const updatedColumn = { ...column, color: selectedColor };
12686
+ onColumnUpdate?.(updatedColumn);
12687
+ setColumns(columns.map((col) => col.id === colorPickerColumnId ? updatedColumn : col));
12688
+ setColorPickerOpen(false);
12689
+ toast3({
12690
+ title: "Column color updated",
12691
+ description: "Column color has been changed"
12692
+ });
11232
12693
  };
11233
- const getInitials = (name) => {
11234
- return name.split(" ").map((n) => n[0]).join("").toUpperCase();
12694
+ const handleExport = (format5) => {
12695
+ if (onExport) {
12696
+ onExport(format5);
12697
+ } else {
12698
+ if (format5 === "json") {
12699
+ const data = JSON.stringify(columns, null, 2);
12700
+ const blob = new Blob([data], { type: "application/json" });
12701
+ const url = URL.createObjectURL(blob);
12702
+ const a = document.createElement("a");
12703
+ a.href = url;
12704
+ a.download = "kanban-board.json";
12705
+ document.body.appendChild(a);
12706
+ a.click();
12707
+ document.body.removeChild(a);
12708
+ URL.revokeObjectURL(url);
12709
+ toast3({
12710
+ title: "Board exported",
12711
+ description: "Board exported as JSON file"
12712
+ });
12713
+ } else if (format5 === "csv") {
12714
+ let csv = "Column,Card Title,Description,Priority,Assignees,Due Date,Tags\n";
12715
+ columns.forEach((column) => {
12716
+ column.cards.forEach((card) => {
12717
+ csv += `"${column.title}",`;
12718
+ csv += `"${card.title}",`;
12719
+ csv += `"${card.description || ""}",`;
12720
+ csv += `"${card.priority || ""}",`;
12721
+ csv += `"${card.assignees?.map((a2) => a2.name).join(", ") || ""}",`;
12722
+ csv += `"${card.dueDate ? new Date(card.dueDate).toLocaleDateString() : ""}",`;
12723
+ csv += `"${card.tags?.join(", ") || ""}"
12724
+ `;
12725
+ });
12726
+ });
12727
+ const blob = new Blob([csv], { type: "text/csv" });
12728
+ const url = URL.createObjectURL(blob);
12729
+ const a = document.createElement("a");
12730
+ a.href = url;
12731
+ a.download = "kanban-board.csv";
12732
+ document.body.appendChild(a);
12733
+ a.click();
12734
+ document.body.removeChild(a);
12735
+ URL.revokeObjectURL(url);
12736
+ toast3({
12737
+ title: "Board exported",
12738
+ description: "Board exported as CSV file"
12739
+ });
12740
+ }
12741
+ }
11235
12742
  };
11236
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs("div", { className: "flex gap-6 overflow-x-auto pb-4", children: [
11237
- columns.map((column) => {
11238
- const isOverLimit = column.limit && column.cards.length > column.limit;
11239
- const isDraggedOver = draggedOverColumn === column.id;
11240
- return /* @__PURE__ */ jsx(
11241
- "div",
11242
- {
11243
- className: cn(
11244
- "flex-shrink-0 w-80 transition-colors duration-200",
11245
- isDraggedOver && "bg-primary/5 rounded-lg border-2 border-primary/20"
11246
- ),
11247
- onDragOver: (e) => handleDragOver(e, column.id),
11248
- onDragEnter: (e) => handleDragEnter(e, column.id),
11249
- onDragLeave: (e) => handleDragLeave(e, column.id),
11250
- onDrop: (e) => handleDrop(e, column.id),
11251
- children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: "h-full", children: [
11252
- /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "pb-3", children: [
11253
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
11254
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11255
- column.color && /* @__PURE__ */ jsx(
11256
- "div",
11257
- {
11258
- className: "w-3 h-3 rounded-full",
11259
- style: { backgroundColor: column.color }
11260
- }
11261
- ),
11262
- /* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-sm font-medium", children: column.title }),
11263
- /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: column.cards.length })
11264
- ] }),
11265
- /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) })
12743
+ if (loading) {
12744
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsx("div", { className: "flex gap-6 overflow-x-auto pb-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-80", children: /* @__PURE__ */ jsxs(MoonUICardPro, { children: [
12745
+ /* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-4 w-24" }) }),
12746
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "space-y-3", children: [1, 2, 3].map((j) => /* @__PURE__ */ jsx(MoonUISkeletonPro, { className: "h-24 w-full" }, j)) })
12747
+ ] }) }, i)) }) });
12748
+ }
12749
+ return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
12750
+ (showSearch || showFilters) && /* @__PURE__ */ jsxs("div", { className: "mb-6 space-y-4", children: [
12751
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
12752
+ showSearch && /* @__PURE__ */ jsxs("div", { className: "relative flex-1 max-w-md", children: [
12753
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
12754
+ /* @__PURE__ */ jsx(
12755
+ MoonUIInputPro,
12756
+ {
12757
+ id: "kanban-search",
12758
+ placeholder: "Search cards...",
12759
+ value: searchQuery,
12760
+ onChange: (e) => setSearchQuery(e.target.value),
12761
+ className: "pl-9"
12762
+ }
12763
+ )
12764
+ ] }),
12765
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12766
+ showFilters && filters.length > 0 && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
12767
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
12768
+ /* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
12769
+ "Filter",
12770
+ activeFilter && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "ml-2", children: filters.find((f) => f.id === activeFilter)?.name })
12771
+ ] }) }),
12772
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", className: "w-48", children: [
12773
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Quick Filters" }),
12774
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
12775
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setActiveFilter(void 0), children: [
12776
+ /* @__PURE__ */ jsx(X, { className: "mr-2 h-4 w-4" }),
12777
+ "Clear filter"
11266
12778
  ] }),
11267
- column.limit && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { className: cn(
11268
- "text-xs",
11269
- isOverLimit && "text-destructive"
11270
- ), children: isOverLimit ? "Over limit" : `${column.cards.length}/${column.limit} cards` })
11271
- ] }),
11272
- /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", children: [
11273
- column.cards.map((card) => /* @__PURE__ */ jsxs(
11274
- "div",
12779
+ filters.map((filter) => /* @__PURE__ */ jsxs(
12780
+ MoonUIDropdownMenuItemPro,
11275
12781
  {
11276
- draggable: !disabled,
11277
- onDragStart: (e) => handleDragStart(e, card.id),
11278
- onDragEnd: handleDragEnd,
11279
- onClick: () => handleCardClick(card),
11280
- className: cn(
11281
- "p-3 bg-background border rounded-lg cursor-pointer hover:shadow-md transition-all duration-200",
11282
- "group relative select-none",
11283
- draggedCard === card.id && "opacity-50 scale-95",
11284
- disabled && "cursor-not-allowed"
11285
- ),
12782
+ onClick: () => setActiveFilter(filter.id),
11286
12783
  children: [
11287
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
11288
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
11289
- /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm mb-1", children: card.title }),
11290
- card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-2 line-clamp-2", children: card.description })
11291
- ] }),
11292
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: [
11293
- /* @__PURE__ */ jsx(
11294
- MoonUIButtonPro,
12784
+ /* @__PURE__ */ jsx(
12785
+ Check,
12786
+ {
12787
+ className: cn(
12788
+ "mr-2 h-4 w-4",
12789
+ activeFilter === filter.id ? "opacity-100" : "opacity-0"
12790
+ )
12791
+ }
12792
+ ),
12793
+ filter.name
12794
+ ]
12795
+ },
12796
+ filter.id
12797
+ ))
12798
+ ] })
12799
+ ] }),
12800
+ selectedCards.length > 0 && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
12801
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
12802
+ /* @__PURE__ */ jsxs("span", { className: "mr-2", children: [
12803
+ selectedCards.length,
12804
+ " selected"
12805
+ ] }),
12806
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
12807
+ ] }) }),
12808
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
12809
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("move"), children: [
12810
+ /* @__PURE__ */ jsx(Move, { className: "mr-2 h-4 w-4" }),
12811
+ "Move cards"
12812
+ ] }),
12813
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("archive"), children: [
12814
+ /* @__PURE__ */ jsx(Archive, { className: "mr-2 h-4 w-4" }),
12815
+ "Archive cards"
12816
+ ] }),
12817
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleBulkAction("delete"), children: [
12818
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
12819
+ "Delete cards"
12820
+ ] })
12821
+ ] })
12822
+ ] }),
12823
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
12824
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "outline", size: "sm", children: [
12825
+ /* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
12826
+ "Export"
12827
+ ] }) }),
12828
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
12829
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleExport("json"), children: "Export as JSON" }),
12830
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleExport("csv"), children: "Export as CSV" })
12831
+ ] })
12832
+ ] })
12833
+ ] })
12834
+ ] }),
12835
+ activeFilter && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12836
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Active filters:" }),
12837
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "secondary", children: [
12838
+ filters.find((f) => f.id === activeFilter)?.name,
12839
+ /* @__PURE__ */ jsx(
12840
+ MoonUIButtonPro,
12841
+ {
12842
+ variant: "ghost",
12843
+ size: "sm",
12844
+ className: "ml-1 h-auto p-0",
12845
+ onClick: () => setActiveFilter(void 0),
12846
+ children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
12847
+ }
12848
+ )
12849
+ ] })
12850
+ ] })
12851
+ ] }),
12852
+ /* @__PURE__ */ jsxs(
12853
+ "div",
12854
+ {
12855
+ ref: scrollRef,
12856
+ className: "flex gap-6 overflow-x-auto pb-4",
12857
+ onDragOver: (e) => e.preventDefault(),
12858
+ children: [
12859
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: filteredColumns.map((column) => {
12860
+ const isOverLimit = column.limit && column.cards.length >= column.limit;
12861
+ const isDraggedOver = draggedOverColumn === column.id;
12862
+ return /* @__PURE__ */ jsx(
12863
+ motion.div,
12864
+ {
12865
+ layout: true,
12866
+ initial: { opacity: 0, x: -20 },
12867
+ animate: { opacity: 1, x: 0 },
12868
+ exit: { opacity: 0, x: 20 },
12869
+ className: cn(
12870
+ "flex-shrink-0 w-80 transition-all duration-200",
12871
+ isDraggedOver && "scale-105"
12872
+ ),
12873
+ onDragOver: (e) => handleDragOver(e, column.id),
12874
+ onDragLeave: () => setDraggedOverColumn(null),
12875
+ onDrop: (e) => handleDrop(e, column.id, column.cards.length),
12876
+ children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
12877
+ "h-full transition-all duration-200",
12878
+ isDraggedOver && "ring-2 ring-primary ring-offset-2 bg-primary/5",
12879
+ column.collapsed && "opacity-60"
12880
+ ), children: [
12881
+ /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "pb-3", children: [
12882
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
12883
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
12884
+ column.color && /* @__PURE__ */ jsx(
12885
+ "div",
11295
12886
  {
11296
- variant: "ghost",
11297
- size: "sm",
11298
- className: "h-6 w-6 p-0",
11299
- onClick: (e) => handleCardEdit(card, e),
11300
- children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
12887
+ className: "w-3 h-3 rounded-full",
12888
+ style: { backgroundColor: column.color }
11301
12889
  }
11302
12890
  ),
11303
- /* @__PURE__ */ jsx(
11304
- MoonUIButtonPro,
12891
+ /* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-sm font-medium flex items-center gap-2", children: editingColumnId === column.id ? /* @__PURE__ */ jsx(
12892
+ MoonUIInputPro,
11305
12893
  {
11306
- variant: "ghost",
11307
- size: "sm",
11308
- className: "h-6 w-6 p-0",
11309
- onClick: (e) => handleCardDelete(card, e),
11310
- children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
12894
+ value: editingColumnTitle,
12895
+ onChange: (e) => setEditingColumnTitle(e.target.value),
12896
+ onBlur: () => handleColumnRename(column.id),
12897
+ onKeyDown: (e) => {
12898
+ if (e.key === "Enter") {
12899
+ handleColumnRename(column.id);
12900
+ }
12901
+ if (e.key === "Escape") {
12902
+ setEditingColumnId(null);
12903
+ setEditingColumnTitle("");
12904
+ }
12905
+ },
12906
+ className: "h-6 w-32 text-sm",
12907
+ autoFocus: true,
12908
+ onClick: (e) => e.stopPropagation()
11311
12909
  }
11312
- ),
11313
- /* @__PURE__ */ jsx("div", { className: "cursor-move", children: /* @__PURE__ */ jsx(GripVertical, { className: "h-3 w-3 text-muted-foreground" }) })
12910
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
12911
+ column.title,
12912
+ column.locked && /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" })
12913
+ ] }) }),
12914
+ /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: column.cards.length })
12915
+ ] }),
12916
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
12917
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
12918
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
12919
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "rename"), children: [
12920
+ /* @__PURE__ */ jsx(Edit, { className: "mr-2 h-4 w-4" }),
12921
+ "Rename"
12922
+ ] }),
12923
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "collapse"), children: column.collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
12924
+ /* @__PURE__ */ jsx(Eye, { className: "mr-2 h-4 w-4" }),
12925
+ "Expand"
12926
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
12927
+ /* @__PURE__ */ jsx(EyeOff, { className: "mr-2 h-4 w-4" }),
12928
+ "Collapse"
12929
+ ] }) }),
12930
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
12931
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
12932
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
12933
+ /* @__PURE__ */ jsx(Settings, { className: "mr-2 h-4 w-4" }),
12934
+ "Settings"
12935
+ ] }),
12936
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubContentPro, { children: [
12937
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "setLimit"), children: [
12938
+ /* @__PURE__ */ jsx(Timer, { className: "mr-2 h-4 w-4" }),
12939
+ "Set WIP limit"
12940
+ ] }),
12941
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "changeColor"), children: [
12942
+ /* @__PURE__ */ jsx(Palette, { className: "mr-2 h-4 w-4" }),
12943
+ "Change color"
12944
+ ] }),
12945
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubPro, { children: [
12946
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubTriggerPro, { children: [
12947
+ /* @__PURE__ */ jsx(ArrowUpDown, { className: "mr-2 h-4 w-4" }),
12948
+ "Sort cards"
12949
+ ] }),
12950
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuSubContentPro, { children: [
12951
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortByPriority"), children: "By Priority" }),
12952
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortByDueDate"), children: "By Due Date" }),
12953
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuItemPro, { onClick: () => handleColumnAction(column, "sortAlphabetically"), children: "Alphabetically" })
12954
+ ] })
12955
+ ] })
12956
+ ] })
12957
+ ] }),
12958
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
12959
+ /* @__PURE__ */ jsxs(
12960
+ MoonUIDropdownMenuItemPro,
12961
+ {
12962
+ onClick: () => handleColumnAction(column, "delete"),
12963
+ className: "text-destructive",
12964
+ children: [
12965
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 h-4 w-4" }),
12966
+ "Delete column"
12967
+ ]
12968
+ }
12969
+ )
12970
+ ] })
11314
12971
  ] })
11315
12972
  ] }),
11316
- card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mb-2", children: card.tags.map((tag, index2) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "outline", className: "text-xs px-1 py-0", children: tag }, index2)) }),
11317
- showCardDetails && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
11318
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11319
- card.priority && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11320
- /* @__PURE__ */ jsx("div", { className: cn("w-2 h-2 rounded-full", PRIORITY_DOTS[card.priority]) }),
11321
- /* @__PURE__ */ jsx("span", { className: "capitalize", children: card.priority })
11322
- ] }),
11323
- card.dueDate && /* @__PURE__ */ jsxs("div", { className: cn(
11324
- "flex items-center gap-1",
11325
- isOverdue(card.dueDate) && "text-destructive"
11326
- ), children: [
11327
- /* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
11328
- /* @__PURE__ */ jsx("span", { children: formatDate(card.dueDate) })
11329
- ] })
11330
- ] }),
11331
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11332
- card.comments && card.comments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11333
- /* @__PURE__ */ jsx(MessageCircle, { className: "h-3 w-3" }),
11334
- /* @__PURE__ */ jsx("span", { children: card.comments })
11335
- ] }),
11336
- card.attachments && card.attachments > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11337
- /* @__PURE__ */ jsx(Paperclip, { className: "h-3 w-3" }),
11338
- /* @__PURE__ */ jsx("span", { children: card.attachments })
12973
+ column.limit && /* @__PURE__ */ jsx(MoonUICardDescriptionPro, { className: cn(
12974
+ "text-xs flex items-center gap-1 mt-1",
12975
+ isOverLimit && "text-destructive"
12976
+ ), children: isOverLimit ? /* @__PURE__ */ jsxs(Fragment, { children: [
12977
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3" }),
12978
+ "Over WIP limit (",
12979
+ column.cards.length,
12980
+ "/",
12981
+ column.limit,
12982
+ ")"
12983
+ ] }) : `WIP limit: ${column.cards.length}/${column.limit}` })
12984
+ ] }),
12985
+ !column.collapsed && /* @__PURE__ */ jsxs(MoonUICardContentPro, { className: "space-y-3", children: [
12986
+ /* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-300px)]", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: column.cards.sort((a, b) => a.position - b.position).map((card, index2) => /* @__PURE__ */ jsx(
12987
+ "div",
12988
+ {
12989
+ draggable: !disabled,
12990
+ onDragStart: () => handleDragStart(card, column.id),
12991
+ onDragEnd: handleDragEnd,
12992
+ onDrop: (e) => {
12993
+ e.preventDefault();
12994
+ e.stopPropagation();
12995
+ handleDrop(e, column.id, index2);
12996
+ },
12997
+ className: "mb-3",
12998
+ children: /* @__PURE__ */ jsx(
12999
+ KanbanCardComponent,
13000
+ {
13001
+ card,
13002
+ isDragging: draggedCard === card.id,
13003
+ onEdit: (e) => {
13004
+ e.stopPropagation();
13005
+ onCardEdit?.(card);
13006
+ },
13007
+ onDelete: (e) => {
13008
+ e.stopPropagation();
13009
+ onCardDelete?.(card);
13010
+ },
13011
+ onClick: () => handleCardClick(card),
13012
+ showDetails: showCardDetails,
13013
+ disabled
13014
+ }
13015
+ )
13016
+ },
13017
+ card.id
13018
+ )) }) }),
13019
+ onAddCard && !column.locked && !isOverLimit && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
13020
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
13021
+ MoonUIButtonPro,
13022
+ {
13023
+ variant: "ghost",
13024
+ size: "sm",
13025
+ className: "w-full justify-start text-muted-foreground hover:text-foreground",
13026
+ disabled,
13027
+ children: [
13028
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
13029
+ "Add card"
13030
+ ]
13031
+ }
13032
+ ) }),
13033
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", className: "w-48", children: [
13034
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Card Templates" }),
13035
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
13036
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => handleAddCard(column.id), children: [
13037
+ /* @__PURE__ */ jsx(FileText, { className: "mr-2 h-4 w-4" }),
13038
+ "Blank card"
11339
13039
  ] }),
11340
- card.assignee && /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-5 w-5", children: [
11341
- /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: card.assignee.avatar }),
11342
- /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(card.assignee.name) })
11343
- ] })
13040
+ cardTemplates.map((template, index2) => /* @__PURE__ */ jsxs(
13041
+ MoonUIDropdownMenuItemPro,
13042
+ {
13043
+ onClick: () => handleAddCard(column.id, template),
13044
+ children: [
13045
+ /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
13046
+ template.title || `Template ${index2 + 1}`
13047
+ ]
13048
+ },
13049
+ index2
13050
+ ))
11344
13051
  ] })
11345
13052
  ] })
11346
- ]
11347
- },
11348
- card.id
11349
- )),
11350
- onAddCard && /* @__PURE__ */ jsxs(
11351
- MoonUIButtonPro,
11352
- {
11353
- variant: "ghost",
11354
- size: "sm",
11355
- onClick: () => onAddCard(column.id),
11356
- className: "w-full justify-start text-muted-foreground hover:text-foreground",
11357
- disabled,
11358
- children: [
11359
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
11360
- "Add card"
11361
- ]
11362
- }
11363
- )
11364
- ] })
11365
- ] })
13053
+ ] })
13054
+ ] })
13055
+ },
13056
+ column.id
13057
+ );
13058
+ }) }),
13059
+ showAddColumn && onAddColumn && /* @__PURE__ */ jsx(
13060
+ motion.div,
13061
+ {
13062
+ initial: { opacity: 0 },
13063
+ animate: { opacity: 1 },
13064
+ className: "flex-shrink-0 w-80",
13065
+ children: isCreatingColumn ? /* @__PURE__ */ jsxs(MoonUICardPro, { children: [
13066
+ /* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsx(
13067
+ MoonUIInputPro,
13068
+ {
13069
+ placeholder: "Enter column title...",
13070
+ value: newColumnTitle,
13071
+ onChange: (e) => setNewColumnTitle(e.target.value),
13072
+ onKeyDown: (e) => {
13073
+ if (e.key === "Enter" && newColumnTitle) {
13074
+ onAddColumn({ title: newColumnTitle });
13075
+ setNewColumnTitle("");
13076
+ setIsCreatingColumn(false);
13077
+ }
13078
+ if (e.key === "Escape") {
13079
+ setNewColumnTitle("");
13080
+ setIsCreatingColumn(false);
13081
+ }
13082
+ },
13083
+ autoFocus: true
13084
+ }
13085
+ ) }),
13086
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
13087
+ /* @__PURE__ */ jsx(
13088
+ MoonUIButtonPro,
13089
+ {
13090
+ size: "sm",
13091
+ onClick: () => {
13092
+ if (newColumnTitle) {
13093
+ onAddColumn({ title: newColumnTitle });
13094
+ setNewColumnTitle("");
13095
+ setIsCreatingColumn(false);
13096
+ }
13097
+ },
13098
+ children: "Add column"
13099
+ }
13100
+ ),
13101
+ /* @__PURE__ */ jsx(
13102
+ MoonUIButtonPro,
13103
+ {
13104
+ size: "sm",
13105
+ variant: "ghost",
13106
+ onClick: () => {
13107
+ setNewColumnTitle("");
13108
+ setIsCreatingColumn(false);
13109
+ },
13110
+ children: "Cancel"
13111
+ }
13112
+ )
13113
+ ] }) })
13114
+ ] }) : /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
13115
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
13116
+ MoonUIButtonPro,
13117
+ {
13118
+ variant: "outline",
13119
+ className: "w-full h-full min-h-[200px] border-dashed justify-center items-center",
13120
+ disabled,
13121
+ children: [
13122
+ /* @__PURE__ */ jsx(Plus, { className: "h-6 w-6 mr-2" }),
13123
+ "Add column"
13124
+ ]
13125
+ }
13126
+ ) }),
13127
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "start", className: "w-48", children: [
13128
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuLabelPro, { children: "Column Templates" }),
13129
+ /* @__PURE__ */ jsx(MoonUIDropdownMenuSeparatorPro, {}),
13130
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => setIsCreatingColumn(true), children: [
13131
+ /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
13132
+ "Blank column"
13133
+ ] }),
13134
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.todo), children: [
13135
+ /* @__PURE__ */ jsx(Square, { className: "mr-2 h-4 w-4" }),
13136
+ "To Do"
13137
+ ] }),
13138
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.inProgress), children: [
13139
+ /* @__PURE__ */ jsx(Clock, { className: "mr-2 h-4 w-4" }),
13140
+ "In Progress"
13141
+ ] }),
13142
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: () => onAddColumn(COLUMN_TEMPLATES.done), children: [
13143
+ /* @__PURE__ */ jsx(CheckSquare, { className: "mr-2 h-4 w-4" }),
13144
+ "Done"
13145
+ ] }),
13146
+ columnTemplates.map((template, index2) => /* @__PURE__ */ jsxs(
13147
+ MoonUIDropdownMenuItemPro,
13148
+ {
13149
+ onClick: () => onAddColumn(template),
13150
+ children: [
13151
+ /* @__PURE__ */ jsx(Star, { className: "mr-2 h-4 w-4" }),
13152
+ template.title || `Template ${index2 + 1}`
13153
+ ]
13154
+ },
13155
+ index2
13156
+ ))
13157
+ ] })
13158
+ ] })
13159
+ }
13160
+ )
13161
+ ]
13162
+ }
13163
+ ),
13164
+ selectedCard && /* @__PURE__ */ jsx(
13165
+ CardDetailModal,
13166
+ {
13167
+ card: selectedCard,
13168
+ isOpen: !!selectedCard,
13169
+ onClose: () => setSelectedCard(null),
13170
+ onUpdate: handleCardUpdate,
13171
+ onDelete: (card) => {
13172
+ onCardDelete?.(card);
13173
+ toast3({
13174
+ title: "Card deleted",
13175
+ description: `"${card.title}" has been deleted`
13176
+ });
11366
13177
  },
11367
- column.id
11368
- );
11369
- }),
11370
- showAddColumn && onAddColumn && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-80", children: /* @__PURE__ */ jsxs(
11371
- MoonUIButtonPro,
13178
+ availableAssignees: users,
13179
+ availableLabels: labels,
13180
+ currentColumn: columns.find((col) => col.cards.some((c2) => c2.id === selectedCard.id))?.title,
13181
+ availableColumns: columns.map((col) => ({ id: col.id, title: col.title }))
13182
+ }
13183
+ ),
13184
+ addCardColumnId && /* @__PURE__ */ jsx(
13185
+ AddCardModal,
11372
13186
  {
11373
- variant: "outline",
11374
- onClick: onAddColumn,
11375
- className: "w-full h-full min-h-[200px] border-dashed justify-center items-center",
11376
- disabled,
11377
- children: [
11378
- /* @__PURE__ */ jsx(Plus, { className: "h-6 w-6 mr-2" }),
11379
- "Add column"
11380
- ]
13187
+ isOpen: !!addCardColumnId,
13188
+ onClose: () => setAddCardColumnId(null),
13189
+ onAdd: handleAddNewCard,
13190
+ columnId: addCardColumnId,
13191
+ columnTitle: columns.find((col) => col.id === addCardColumnId)?.title || "",
13192
+ availableAssignees: users,
13193
+ availableLabels: labels,
13194
+ templates: cardTemplates
11381
13195
  }
11382
- ) })
11383
- ] }) });
13196
+ ),
13197
+ /* @__PURE__ */ jsx(MoonUIDialogPro, { open: wipLimitModalOpen, onOpenChange: setWipLimitModalOpen, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "sm:max-w-md", children: [
13198
+ /* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsx(MoonUIDialogTitlePro, { children: "Set WIP Limit" }) }),
13199
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
13200
+ /* @__PURE__ */ jsx(MoonUILabelPro, { htmlFor: "wip-limit", children: "Work In Progress Limit" }),
13201
+ /* @__PURE__ */ jsx(
13202
+ MoonUIInputPro,
13203
+ {
13204
+ id: "wip-limit",
13205
+ type: "number",
13206
+ min: "0",
13207
+ value: wipLimit || "",
13208
+ onChange: (e) => setWipLimit(e.target.value ? parseInt(e.target.value) : void 0),
13209
+ placeholder: "Enter a number (leave empty to remove limit)"
13210
+ }
13211
+ ),
13212
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Set a maximum number of cards allowed in this column. Leave empty to remove the limit." })
13213
+ ] }) }),
13214
+ /* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
13215
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: () => setWipLimitModalOpen(false), children: "Cancel" }),
13216
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleWipLimitUpdate, children: "Save" })
13217
+ ] })
13218
+ ] }) }),
13219
+ /* @__PURE__ */ jsx(MoonUIDialogPro, { open: colorPickerOpen, onOpenChange: setColorPickerOpen, children: /* @__PURE__ */ jsxs(MoonUIDialogContentPro, { className: "sm:max-w-md", children: [
13220
+ /* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsx(MoonUIDialogTitlePro, { children: "Change Column Color" }) }),
13221
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
13222
+ /* @__PURE__ */ jsx(MoonUILabelPro, { children: "Select a color" }),
13223
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-8 gap-2", children: [
13224
+ "#6B7280",
13225
+ "#EF4444",
13226
+ "#F59E0B",
13227
+ "#10B981",
13228
+ "#3B82F6",
13229
+ "#8B5CF6",
13230
+ "#EC4899",
13231
+ "#06B6D4",
13232
+ "#F43F5E",
13233
+ "#84CC16",
13234
+ "#14B8A6",
13235
+ "#6366F1",
13236
+ "#A855F7",
13237
+ "#F472B6",
13238
+ "#0EA5E9",
13239
+ "#22D3EE"
13240
+ ].map((color) => /* @__PURE__ */ jsx(
13241
+ "button",
13242
+ {
13243
+ className: cn(
13244
+ "w-10 h-10 rounded-md border-2 transition-all",
13245
+ selectedColor === color ? "border-primary scale-110" : "border-transparent"
13246
+ ),
13247
+ style: { backgroundColor: color },
13248
+ onClick: () => setSelectedColor(color)
13249
+ },
13250
+ color
13251
+ )) })
13252
+ ] }) }),
13253
+ /* @__PURE__ */ jsxs(MoonUIDialogFooterPro, { children: [
13254
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { variant: "outline", onClick: () => setColorPickerOpen(false), children: "Cancel" }),
13255
+ /* @__PURE__ */ jsx(MoonUIButtonPro, { onClick: handleColorUpdate, children: "Save" })
13256
+ ] })
13257
+ ] }) })
13258
+ ] });
11384
13259
  }
11385
13260
 
11386
13261
  // ../../node_modules/orderedmap/dist/index.js
@@ -11565,7 +13440,7 @@ function findDiffEnd(a, b, posA, posB) {
11565
13440
  posB -= size4;
11566
13441
  }
11567
13442
  }
11568
- var Fragment4 = class {
13443
+ var Fragment7 = class {
11569
13444
  /**
11570
13445
  @internal
11571
13446
  */
@@ -11633,7 +13508,7 @@ var Fragment4 = class {
11633
13508
  }
11634
13509
  for (; i < other.content.length; i++)
11635
13510
  content.push(other.content[i]);
11636
- return new Fragment4(content, this.size + other.size);
13511
+ return new Fragment7(content, this.size + other.size);
11637
13512
  }
11638
13513
  /**
11639
13514
  Cut out the sub-fragment between the two given positions.
@@ -11657,17 +13532,17 @@ var Fragment4 = class {
11657
13532
  }
11658
13533
  pos = end;
11659
13534
  }
11660
- return new Fragment4(result, size4);
13535
+ return new Fragment7(result, size4);
11661
13536
  }
11662
13537
  /**
11663
13538
  @internal
11664
13539
  */
11665
13540
  cutByIndex(from2, to) {
11666
13541
  if (from2 == to)
11667
- return Fragment4.empty;
13542
+ return Fragment7.empty;
11668
13543
  if (from2 == 0 && to == this.content.length)
11669
13544
  return this;
11670
- return new Fragment4(this.content.slice(from2, to));
13545
+ return new Fragment7(this.content.slice(from2, to));
11671
13546
  }
11672
13547
  /**
11673
13548
  Create a new fragment in which the node at the given index is
@@ -11680,21 +13555,21 @@ var Fragment4 = class {
11680
13555
  let copy2 = this.content.slice();
11681
13556
  let size4 = this.size + node.nodeSize - current.nodeSize;
11682
13557
  copy2[index2] = node;
11683
- return new Fragment4(copy2, size4);
13558
+ return new Fragment7(copy2, size4);
11684
13559
  }
11685
13560
  /**
11686
13561
  Create a new fragment by prepending the given node to this
11687
13562
  fragment.
11688
13563
  */
11689
13564
  addToStart(node) {
11690
- return new Fragment4([node].concat(this.content), this.size + node.nodeSize);
13565
+ return new Fragment7([node].concat(this.content), this.size + node.nodeSize);
11691
13566
  }
11692
13567
  /**
11693
13568
  Create a new fragment by appending the given node to this
11694
13569
  fragment.
11695
13570
  */
11696
13571
  addToEnd(node) {
11697
- return new Fragment4(this.content.concat(node), this.size + node.nodeSize);
13572
+ return new Fragment7(this.content.concat(node), this.size + node.nodeSize);
11698
13573
  }
11699
13574
  /**
11700
13575
  Compare this fragment to another one.
@@ -11813,10 +13688,10 @@ var Fragment4 = class {
11813
13688
  */
11814
13689
  static fromJSON(schema, value) {
11815
13690
  if (!value)
11816
- return Fragment4.empty;
13691
+ return Fragment7.empty;
11817
13692
  if (!Array.isArray(value))
11818
13693
  throw new RangeError("Invalid input for Fragment.fromJSON");
11819
- return new Fragment4(value.map(schema.nodeFromJSON));
13694
+ return new Fragment7(value.map(schema.nodeFromJSON));
11820
13695
  }
11821
13696
  /**
11822
13697
  Build a fragment from an array of nodes. Ensures that adjacent
@@ -11824,7 +13699,7 @@ var Fragment4 = class {
11824
13699
  */
11825
13700
  static fromArray(array) {
11826
13701
  if (!array.length)
11827
- return Fragment4.empty;
13702
+ return Fragment7.empty;
11828
13703
  let joined, size4 = 0;
11829
13704
  for (let i = 0; i < array.length; i++) {
11830
13705
  let node = array[i];
@@ -11837,7 +13712,7 @@ var Fragment4 = class {
11837
13712
  joined.push(node);
11838
13713
  }
11839
13714
  }
11840
- return new Fragment4(joined || array, size4);
13715
+ return new Fragment7(joined || array, size4);
11841
13716
  }
11842
13717
  /**
11843
13718
  Create a fragment from something that can be interpreted as a
@@ -11847,17 +13722,17 @@ var Fragment4 = class {
11847
13722
  */
11848
13723
  static from(nodes) {
11849
13724
  if (!nodes)
11850
- return Fragment4.empty;
11851
- if (nodes instanceof Fragment4)
13725
+ return Fragment7.empty;
13726
+ if (nodes instanceof Fragment7)
11852
13727
  return nodes;
11853
13728
  if (Array.isArray(nodes))
11854
13729
  return this.fromArray(nodes);
11855
13730
  if (nodes.attrs)
11856
- return new Fragment4([nodes], nodes.nodeSize);
13731
+ return new Fragment7([nodes], nodes.nodeSize);
11857
13732
  throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
11858
13733
  }
11859
13734
  };
11860
- Fragment4.empty = new Fragment4([], 0);
13735
+ Fragment7.empty = new Fragment7([], 0);
11861
13736
  var found = { index: 0, offset: 0 };
11862
13737
  function retIndex(index2, offset4) {
11863
13738
  found.index = index2;
@@ -12082,7 +13957,7 @@ var Slice = class {
12082
13957
  let openStart = json2.openStart || 0, openEnd = json2.openEnd || 0;
12083
13958
  if (typeof openStart != "number" || typeof openEnd != "number")
12084
13959
  throw new RangeError("Invalid input for Slice.fromJSON");
12085
- return new Slice(Fragment4.fromJSON(schema, json2.content), openStart, openEnd);
13960
+ return new Slice(Fragment7.fromJSON(schema, json2.content), openStart, openEnd);
12086
13961
  }
12087
13962
  /**
12088
13963
  Create a slice from a fragment by taking the maximum possible
@@ -12097,7 +13972,7 @@ var Slice = class {
12097
13972
  return new Slice(fragment, openStart, openEnd);
12098
13973
  }
12099
13974
  };
12100
- Slice.empty = new Slice(Fragment4.empty, 0, 0);
13975
+ Slice.empty = new Slice(Fragment7.empty, 0, 0);
12101
13976
  function removeRange(content, from2, to) {
12102
13977
  let { index: index2, offset: offset4 } = content.findIndex(from2), child = content.maybeChild(index2);
12103
13978
  let { index: indexTo, offset: offsetTo } = content.findIndex(to);
@@ -12195,7 +14070,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
12195
14070
  addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
12196
14071
  }
12197
14072
  addRange($to, null, depth, content);
12198
- return new Fragment4(content);
14073
+ return new Fragment7(content);
12199
14074
  }
12200
14075
  function replaceTwoWay($from, $to, depth) {
12201
14076
  let content = [];
@@ -12205,13 +14080,13 @@ function replaceTwoWay($from, $to, depth) {
12205
14080
  addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
12206
14081
  }
12207
14082
  addRange($to, null, depth, content);
12208
- return new Fragment4(content);
14083
+ return new Fragment7(content);
12209
14084
  }
12210
14085
  function prepareSliceForReplace(slice2, $along) {
12211
14086
  let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
12212
14087
  let node = parent.copy(slice2.content);
12213
14088
  for (let i = extra - 1; i >= 0; i--)
12214
- node = $along.node(i).copy(Fragment4.from(node));
14089
+ node = $along.node(i).copy(Fragment7.from(node));
12215
14090
  return {
12216
14091
  start: node.resolveNoCache(slice2.openStart + extra),
12217
14092
  end: node.resolveNoCache(node.content.size - slice2.openEnd - extra)
@@ -12550,7 +14425,7 @@ var Node2 = class {
12550
14425
  this.type = type;
12551
14426
  this.attrs = attrs;
12552
14427
  this.marks = marks;
12553
- this.content = content || Fragment4.empty;
14428
+ this.content = content || Fragment7.empty;
12554
14429
  }
12555
14430
  /**
12556
14431
  The array of this node's child nodes.
@@ -12855,7 +14730,7 @@ var Node2 = class {
12855
14730
  can optionally pass `start` and `end` indices into the
12856
14731
  replacement fragment.
12857
14732
  */
12858
- canReplace(from2, to, replacement = Fragment4.empty, start = 0, end = replacement.childCount) {
14733
+ canReplace(from2, to, replacement = Fragment7.empty, start = 0, end = replacement.childCount) {
12859
14734
  let one = this.contentMatchAt(from2).matchFragment(replacement, start, end);
12860
14735
  let two = one && one.matchFragment(this.content, to);
12861
14736
  if (!two || !two.validEnd)
@@ -12937,7 +14812,7 @@ var Node2 = class {
12937
14812
  throw new RangeError("Invalid text node in JSON");
12938
14813
  return schema.text(json2.text, marks);
12939
14814
  }
12940
- let content = Fragment4.fromJSON(schema, json2.content);
14815
+ let content = Fragment7.fromJSON(schema, json2.content);
12941
14816
  let node = schema.nodeType(json2.type).create(json2.attrs, content, marks);
12942
14817
  node.type.checkAttrs(node.attrs);
12943
14818
  return node;
@@ -13079,7 +14954,7 @@ var ContentMatch = class {
13079
14954
  function search(match, types) {
13080
14955
  let finished = match.matchFragment(after, startIndex);
13081
14956
  if (finished && (!toEnd || finished.validEnd))
13082
- return Fragment4.from(types.map((tp) => tp.createAndFill()));
14957
+ return Fragment7.from(types.map((tp) => tp.createAndFill()));
13083
14958
  for (let i = 0; i < match.next.length; i++) {
13084
14959
  let { type, next } = match.next[i];
13085
14960
  if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
@@ -13531,7 +15406,7 @@ var NodeType = class {
13531
15406
  create(attrs = null, content, marks) {
13532
15407
  if (this.isText)
13533
15408
  throw new Error("NodeType.create can't construct text nodes");
13534
- return new Node2(this, this.computeAttrs(attrs), Fragment4.from(content), Mark.setFrom(marks));
15409
+ return new Node2(this, this.computeAttrs(attrs), Fragment7.from(content), Mark.setFrom(marks));
13535
15410
  }
13536
15411
  /**
13537
15412
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
@@ -13539,7 +15414,7 @@ var NodeType = class {
13539
15414
  if it doesn't match.
13540
15415
  */
13541
15416
  createChecked(attrs = null, content, marks) {
13542
- content = Fragment4.from(content);
15417
+ content = Fragment7.from(content);
13543
15418
  this.checkContent(content);
13544
15419
  return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
13545
15420
  }
@@ -13553,7 +15428,7 @@ var NodeType = class {
13553
15428
  */
13554
15429
  createAndFill(attrs = null, content, marks) {
13555
15430
  attrs = this.computeAttrs(attrs);
13556
- content = Fragment4.from(content);
15431
+ content = Fragment7.from(content);
13557
15432
  if (content.size) {
13558
15433
  let before = this.contentMatch.fillBefore(content);
13559
15434
  if (!before)
@@ -13561,7 +15436,7 @@ var NodeType = class {
13561
15436
  content = before.append(content);
13562
15437
  }
13563
15438
  let matched = this.contentMatch.matchFragment(content);
13564
- let after = matched && matched.fillBefore(Fragment4.empty, true);
15439
+ let after = matched && matched.fillBefore(Fragment7.empty, true);
13565
15440
  if (!after)
13566
15441
  return null;
13567
15442
  return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
@@ -14025,7 +15900,7 @@ var NodeContext = class {
14025
15900
  if (!this.match) {
14026
15901
  if (!this.type)
14027
15902
  return [];
14028
- let fill = this.type.contentMatch.fillBefore(Fragment4.from(node));
15903
+ let fill = this.type.contentMatch.fillBefore(Fragment7.from(node));
14029
15904
  if (fill) {
14030
15905
  this.match = this.type.contentMatch.matchFragment(fill);
14031
15906
  } else {
@@ -14051,9 +15926,9 @@ var NodeContext = class {
14051
15926
  this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m2[0].length));
14052
15927
  }
14053
15928
  }
14054
- let content = Fragment4.from(this.content);
15929
+ let content = Fragment7.from(this.content);
14055
15930
  if (!openEnd && this.match)
14056
- content = content.append(this.match.fillBefore(Fragment4.empty, true));
15931
+ content = content.append(this.match.fillBefore(Fragment7.empty, true));
14057
15932
  return this.type ? this.type.create(this.attrs, content, this.marks) : content;
14058
15933
  }
14059
15934
  inlineContext(node) {
@@ -15070,7 +16945,7 @@ function mapFragment(fragment, f, parent) {
15070
16945
  child = f(child, parent, i);
15071
16946
  mapped.push(child);
15072
16947
  }
15073
- return Fragment4.fromArray(mapped);
16948
+ return Fragment7.fromArray(mapped);
15074
16949
  }
15075
16950
  var AddMarkStep = class extends Step {
15076
16951
  /**
@@ -15187,7 +17062,7 @@ var AddNodeMarkStep = class extends Step {
15187
17062
  if (!node)
15188
17063
  return StepResult.fail("No node at mark step's position");
15189
17064
  let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
15190
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
17065
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
15191
17066
  }
15192
17067
  invert(doc3) {
15193
17068
  let node = doc3.nodeAt(this.pos);
@@ -15233,7 +17108,7 @@ var RemoveNodeMarkStep = class extends Step {
15233
17108
  if (!node)
15234
17109
  return StepResult.fail("No node at mark step's position");
15235
17110
  let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
15236
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
17111
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
15237
17112
  }
15238
17113
  invert(doc3) {
15239
17114
  let node = doc3.nodeAt(this.pos);
@@ -15498,7 +17373,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
15498
17373
  let m2, newline = /\r?\n|\r/g, slice2;
15499
17374
  while (m2 = newline.exec(child.text)) {
15500
17375
  if (!slice2)
15501
- slice2 = new Slice(Fragment4.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
17376
+ slice2 = new Slice(Fragment7.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
15502
17377
  replSteps.push(new ReplaceStep(cur + m2.index, cur + m2.index + m2[0].length, slice2));
15503
17378
  }
15504
17379
  }
@@ -15506,7 +17381,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
15506
17381
  cur = end;
15507
17382
  }
15508
17383
  if (!match.validEnd) {
15509
- let fill = match.fillBefore(Fragment4.empty, true);
17384
+ let fill = match.fillBefore(Fragment7.empty, true);
15510
17385
  tr2.replace(cur, cur, new Slice(fill, 0, 0));
15511
17386
  }
15512
17387
  for (let i = replSteps.length - 1; i >= 0; i--)
@@ -15532,20 +17407,20 @@ function lift(tr2, range, target) {
15532
17407
  let { $from, $to, depth } = range;
15533
17408
  let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
15534
17409
  let start = gapStart, end = gapEnd;
15535
- let before = Fragment4.empty, openStart = 0;
17410
+ let before = Fragment7.empty, openStart = 0;
15536
17411
  for (let d = depth, splitting = false; d > target; d--)
15537
17412
  if (splitting || $from.index(d) > 0) {
15538
17413
  splitting = true;
15539
- before = Fragment4.from($from.node(d).copy(before));
17414
+ before = Fragment7.from($from.node(d).copy(before));
15540
17415
  openStart++;
15541
17416
  } else {
15542
17417
  start--;
15543
17418
  }
15544
- let after = Fragment4.empty, openEnd = 0;
17419
+ let after = Fragment7.empty, openEnd = 0;
15545
17420
  for (let d = depth, splitting = false; d > target; d--)
15546
17421
  if (splitting || $to.after(d + 1) < $to.end(d)) {
15547
17422
  splitting = true;
15548
- after = Fragment4.from($to.node(d).copy(after));
17423
+ after = Fragment7.from($to.node(d).copy(after));
15549
17424
  openEnd++;
15550
17425
  } else {
15551
17426
  end++;
@@ -15585,14 +17460,14 @@ function findWrappingInside(range, type) {
15585
17460
  return inside;
15586
17461
  }
15587
17462
  function wrap(tr2, range, wrappers) {
15588
- let content = Fragment4.empty;
17463
+ let content = Fragment7.empty;
15589
17464
  for (let i = wrappers.length - 1; i >= 0; i--) {
15590
17465
  if (content.size) {
15591
17466
  let match = wrappers[i].type.contentMatch.matchFragment(content);
15592
17467
  if (!match || !match.validEnd)
15593
17468
  throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
15594
17469
  }
15595
- content = Fragment4.from(wrappers[i].type.create(wrappers[i].attrs, content));
17470
+ content = Fragment7.from(wrappers[i].type.create(wrappers[i].attrs, content));
15596
17471
  }
15597
17472
  let start = range.start, end = range.end;
15598
17473
  tr2.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
@@ -15617,7 +17492,7 @@ function setBlockType(tr2, from2, to, type, attrs) {
15617
17492
  clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
15618
17493
  let mapping = tr2.mapping.slice(mapFrom);
15619
17494
  let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
15620
- tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment4.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
17495
+ tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment7.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
15621
17496
  if (convertNewlines === true)
15622
17497
  replaceNewlines(tr2, node, pos, mapFrom);
15623
17498
  return false;
@@ -15658,7 +17533,7 @@ function setNodeMarkup(tr2, pos, type, attrs, marks) {
15658
17533
  return tr2.replaceWith(pos, pos + node.nodeSize, newNode);
15659
17534
  if (!type.validContent(node.content))
15660
17535
  throw new RangeError("Invalid content for node type " + type.name);
15661
- tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment4.from(newNode), 0, 0), 1, true));
17536
+ tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment7.from(newNode), 0, 0), 1, true));
15662
17537
  }
15663
17538
  function canSplit(doc3, pos, depth = 1, typesAfter) {
15664
17539
  let $pos = doc3.resolve(pos), base2 = $pos.depth - depth;
@@ -15682,11 +17557,11 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
15682
17557
  return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
15683
17558
  }
15684
17559
  function split(tr2, pos, depth = 1, typesAfter) {
15685
- let $pos = tr2.doc.resolve(pos), before = Fragment4.empty, after = Fragment4.empty;
17560
+ let $pos = tr2.doc.resolve(pos), before = Fragment7.empty, after = Fragment7.empty;
15686
17561
  for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
15687
- before = Fragment4.from($pos.node(d).copy(before));
17562
+ before = Fragment7.from($pos.node(d).copy(before));
15688
17563
  let typeAfter = typesAfter && typesAfter[i];
15689
- after = Fragment4.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
17564
+ after = Fragment7.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
15690
17565
  }
15691
17566
  tr2.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
15692
17567
  }
@@ -15825,7 +17700,7 @@ var Fitter = class {
15825
17700
  this.$to = $to;
15826
17701
  this.unplaced = unplaced;
15827
17702
  this.frontier = [];
15828
- this.placed = Fragment4.empty;
17703
+ this.placed = Fragment7.empty;
15829
17704
  for (let i = 0; i <= $from.depth; i++) {
15830
17705
  let node = $from.node(i);
15831
17706
  this.frontier.push({
@@ -15834,7 +17709,7 @@ var Fitter = class {
15834
17709
  });
15835
17710
  }
15836
17711
  for (let i = $from.depth; i > 0; i--)
15837
- this.placed = Fragment4.from($from.node(i).copy(this.placed));
17712
+ this.placed = Fragment7.from($from.node(i).copy(this.placed));
15838
17713
  }
15839
17714
  get depth() {
15840
17715
  return this.frontier.length - 1;
@@ -15891,7 +17766,7 @@ var Fitter = class {
15891
17766
  let first2 = fragment.firstChild;
15892
17767
  for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
15893
17768
  let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
15894
- if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment4.from(first2), false)) : parent && type.compatibleContent(parent.type)))
17769
+ if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment7.from(first2), false)) : parent && type.compatibleContent(parent.type)))
15895
17770
  return { sliceDepth, frontierDepth, parent, inject };
15896
17771
  else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
15897
17772
  return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
@@ -15951,7 +17826,7 @@ var Fitter = class {
15951
17826
  let toEnd = taken == fragment.childCount;
15952
17827
  if (!toEnd)
15953
17828
  openEndCount = -1;
15954
- this.placed = addToFragment(this.placed, frontierDepth, Fragment4.from(add));
17829
+ this.placed = addToFragment(this.placed, frontierDepth, Fragment7.from(add));
15955
17830
  this.frontier[frontierDepth].match = match;
15956
17831
  if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
15957
17832
  this.closeFrontierNode();
@@ -16008,12 +17883,12 @@ var Fitter = class {
16008
17883
  openFrontierNode(type, attrs = null, content) {
16009
17884
  let top = this.frontier[this.depth];
16010
17885
  top.match = top.match.matchType(type);
16011
- this.placed = addToFragment(this.placed, this.depth, Fragment4.from(type.create(attrs, content)));
17886
+ this.placed = addToFragment(this.placed, this.depth, Fragment7.from(type.create(attrs, content)));
16012
17887
  this.frontier.push({ type, match: type.contentMatch });
16013
17888
  }
16014
17889
  closeFrontierNode() {
16015
17890
  let open = this.frontier.pop();
16016
- let add = open.match.fillBefore(Fragment4.empty, true);
17891
+ let add = open.match.fillBefore(Fragment7.empty, true);
16017
17892
  if (add.childCount)
16018
17893
  this.placed = addToFragment(this.placed, this.frontier.length, add);
16019
17894
  }
@@ -16042,7 +17917,7 @@ function closeNodeStart(node, openStart, openEnd) {
16042
17917
  if (openStart > 0) {
16043
17918
  frag = node.type.contentMatch.fillBefore(frag).append(frag);
16044
17919
  if (openEnd <= 0)
16045
- frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment4.empty, true));
17920
+ frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment7.empty, true));
16046
17921
  }
16047
17922
  return node.copy(frag);
16048
17923
  }
@@ -16134,7 +18009,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
16134
18009
  if (depth > newOpen) {
16135
18010
  let match = parent.contentMatchAt(0);
16136
18011
  let start = match.fillBefore(fragment).append(fragment);
16137
- fragment = start.append(match.matchFragment(start).fillBefore(Fragment4.empty, true));
18012
+ fragment = start.append(match.matchFragment(start).fillBefore(Fragment7.empty, true));
16138
18013
  }
16139
18014
  return fragment;
16140
18015
  }
@@ -16144,7 +18019,7 @@ function replaceRangeWith(tr2, from2, to, node) {
16144
18019
  if (point != null)
16145
18020
  from2 = to = point;
16146
18021
  }
16147
- tr2.replaceRange(from2, to, new Slice(Fragment4.from(node), 0, 0));
18022
+ tr2.replaceRange(from2, to, new Slice(Fragment7.from(node), 0, 0));
16148
18023
  }
16149
18024
  function deleteRange(tr2, from2, to) {
16150
18025
  let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
@@ -16192,7 +18067,7 @@ var AttrStep = class extends Step {
16192
18067
  attrs[name] = node.attrs[name];
16193
18068
  attrs[this.attr] = this.value;
16194
18069
  let updated = node.type.create(attrs, null, node.marks);
16195
- return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment4.from(updated), 0, node.isLeaf ? 0 : 1));
18070
+ return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment7.from(updated), 0, node.isLeaf ? 0 : 1));
16196
18071
  }
16197
18072
  getMap() {
16198
18073
  return StepMap.empty;
@@ -16327,7 +18202,7 @@ var Transform = class {
16327
18202
  fragment, node, or array of nodes.
16328
18203
  */
16329
18204
  replaceWith(from2, to, content) {
16330
- return this.replace(from2, to, new Slice(Fragment4.from(content), 0, 0));
18205
+ return this.replace(from2, to, new Slice(Fragment7.from(content), 0, 0));
16331
18206
  }
16332
18207
  /**
16333
18208
  Delete the content between the given positions.
@@ -16829,7 +18704,7 @@ var NodeSelection = class extends Selection {
16829
18704
  return new NodeSelection($pos);
16830
18705
  }
16831
18706
  content() {
16832
- return new Slice(Fragment4.from(this.node), 0, 0);
18707
+ return new Slice(Fragment7.from(this.node), 0, 0);
16833
18708
  }
16834
18709
  eq(other) {
16835
18710
  return other instanceof NodeSelection && other.anchor == this.anchor;
@@ -18651,7 +20526,7 @@ var NodeViewDesc = class extends ViewDesc {
18651
20526
  }
18652
20527
  }
18653
20528
  if (!rule.contentElement)
18654
- rule.getContent = () => Fragment4.empty;
20529
+ rule.getContent = () => Fragment7.empty;
18655
20530
  }
18656
20531
  return rule;
18657
20532
  }
@@ -19970,7 +21845,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
19970
21845
  text = f(text, inCode || plainText, view);
19971
21846
  });
19972
21847
  if (inCode)
19973
- return text ? new Slice(Fragment4.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
21848
+ return text ? new Slice(Fragment7.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
19974
21849
  let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
19975
21850
  if (parsed) {
19976
21851
  slice2 = parsed;
@@ -20059,13 +21934,13 @@ function normalizeSiblings(fragment, $context) {
20059
21934
  }
20060
21935
  });
20061
21936
  if (result)
20062
- return Fragment4.from(result);
21937
+ return Fragment7.from(result);
20063
21938
  }
20064
21939
  return fragment;
20065
21940
  }
20066
21941
  function withWrappers(node, wrap2, from2 = 0) {
20067
21942
  for (let i = wrap2.length - 1; i >= from2; i--)
20068
- node = wrap2[i].create(null, Fragment4.from(node));
21943
+ node = wrap2[i].create(null, Fragment7.from(node));
20069
21944
  return node;
20070
21945
  }
20071
21946
  function addToSibling(wrap2, lastWrap, node, sibling, depth) {
@@ -20075,14 +21950,14 @@ function addToSibling(wrap2, lastWrap, node, sibling, depth) {
20075
21950
  return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
20076
21951
  let match = sibling.contentMatchAt(sibling.childCount);
20077
21952
  if (match.matchType(depth == wrap2.length - 1 ? node.type : wrap2[depth + 1]))
20078
- return sibling.copy(sibling.content.append(Fragment4.from(withWrappers(node, wrap2, depth + 1))));
21953
+ return sibling.copy(sibling.content.append(Fragment7.from(withWrappers(node, wrap2, depth + 1))));
20079
21954
  }
20080
21955
  }
20081
21956
  function closeRight(node, depth) {
20082
21957
  if (depth == 0)
20083
21958
  return node;
20084
21959
  let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
20085
- let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment4.empty, true);
21960
+ let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment7.empty, true);
20086
21961
  return node.copy(fragment.append(fill));
20087
21962
  }
20088
21963
  function closeRange(fragment, side, from2, to, depth, openEnd) {
@@ -20092,7 +21967,7 @@ function closeRange(fragment, side, from2, to, depth, openEnd) {
20092
21967
  if (depth < to - 1)
20093
21968
  inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
20094
21969
  if (depth >= from2)
20095
- inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment4.empty, true));
21970
+ inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment7.empty, true));
20096
21971
  return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
20097
21972
  }
20098
21973
  function closeSlice(slice2, openStart, openEnd) {
@@ -20162,7 +22037,7 @@ function addContext(slice2, context) {
20162
22037
  let type = schema.nodes[array[i]];
20163
22038
  if (!type || type.hasRequiredAttrs())
20164
22039
  break;
20165
- content = Fragment4.from(type.create(array[i + 1], content));
22040
+ content = Fragment7.from(type.create(array[i + 1], content));
20166
22041
  openStart++;
20167
22042
  openEnd++;
20168
22043
  }
@@ -22023,7 +23898,7 @@ function isMarkChange(cur, prev) {
22023
23898
  let updated = [];
22024
23899
  for (let i = 0; i < prev.childCount; i++)
22025
23900
  updated.push(update(prev.child(i)));
22026
- if (Fragment4.from(updated).eq(cur))
23901
+ if (Fragment7.from(updated).eq(cur))
22027
23902
  return { mark, type };
22028
23903
  }
22029
23904
  function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
@@ -23133,10 +25008,10 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
23133
25008
  let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
23134
25009
  if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
23135
25010
  if (dispatch2) {
23136
- let end = $cut.pos + after.nodeSize, wrap2 = Fragment4.empty;
25011
+ let end = $cut.pos + after.nodeSize, wrap2 = Fragment7.empty;
23137
25012
  for (let i = conn.length - 1; i >= 0; i--)
23138
- wrap2 = Fragment4.from(conn[i].create(null, wrap2));
23139
- wrap2 = Fragment4.from(before.copy(wrap2));
25013
+ wrap2 = Fragment7.from(conn[i].create(null, wrap2));
25014
+ wrap2 = Fragment7.from(before.copy(wrap2));
23140
25015
  let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
23141
25016
  let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
23142
25017
  if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
@@ -23165,9 +25040,9 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
23165
25040
  afterDepth++;
23166
25041
  if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
23167
25042
  if (dispatch2) {
23168
- let end = Fragment4.empty;
25043
+ let end = Fragment7.empty;
23169
25044
  for (let i = wrap2.length - 1; i >= 0; i--)
23170
- end = Fragment4.from(wrap2[i].copy(end));
25045
+ end = Fragment7.from(wrap2[i].copy(end));
23171
25046
  let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
23172
25047
  dispatch2(tr2.scrollIntoView());
23173
25048
  }
@@ -23272,9 +25147,9 @@ function wrapRangeInList(tr2, range, listType, attrs = null) {
23272
25147
  return true;
23273
25148
  }
23274
25149
  function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
23275
- let content = Fragment4.empty;
25150
+ let content = Fragment7.empty;
23276
25151
  for (let i = wrappers.length - 1; i >= 0; i--)
23277
- content = Fragment4.from(wrappers[i].type.create(wrappers[i].attrs, content));
25152
+ content = Fragment7.from(wrappers[i].type.create(wrappers[i].attrs, content));
23278
25153
  tr2.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
23279
25154
  let found2 = 0;
23280
25155
  for (let i = 0; i < wrappers.length; i++)
@@ -23308,7 +25183,7 @@ function liftListItem(itemType) {
23308
25183
  function liftToOuterList(state, dispatch2, itemType, range) {
23309
25184
  let tr2 = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
23310
25185
  if (end < endOfList) {
23311
- tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment4.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
25186
+ tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment7.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
23312
25187
  range = new NodeRange(tr2.doc.resolve(range.$from.pos), tr2.doc.resolve(endOfList), range.depth);
23313
25188
  }
23314
25189
  const target = liftTarget(range);
@@ -23332,10 +25207,10 @@ function liftOutOfList(state, dispatch2, range) {
23332
25207
  return false;
23333
25208
  let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
23334
25209
  let parent = $start.node(-1), indexBefore = $start.index(-1);
23335
- if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment4.empty : Fragment4.from(list))))
25210
+ if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment7.empty : Fragment7.from(list))))
23336
25211
  return false;
23337
25212
  let start = $start.pos, end = start + item.nodeSize;
23338
- tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment4.empty : Fragment4.from(list.copy(Fragment4.empty))).append(atEnd ? Fragment4.empty : Fragment4.from(list.copy(Fragment4.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
25213
+ tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment7.empty : Fragment7.from(list.copy(Fragment7.empty))).append(atEnd ? Fragment7.empty : Fragment7.from(list.copy(Fragment7.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
23339
25214
  dispatch2(tr2.scrollIntoView());
23340
25215
  return true;
23341
25216
  }
@@ -23353,8 +25228,8 @@ function sinkListItem(itemType) {
23353
25228
  return false;
23354
25229
  if (dispatch2) {
23355
25230
  let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
23356
- let inner = Fragment4.from(nestedBefore ? itemType.create() : null);
23357
- let slice2 = new Slice(Fragment4.from(itemType.create(null, Fragment4.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
25231
+ let inner = Fragment7.from(nestedBefore ? itemType.create() : null);
25232
+ let slice2 = new Slice(Fragment7.from(itemType.create(null, Fragment7.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
23358
25233
  let before = range.start, after = range.end;
23359
25234
  dispatch2(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
23360
25235
  }
@@ -23572,7 +25447,7 @@ function elementFromString(value) {
23572
25447
  return removeWhitespaces(html);
23573
25448
  }
23574
25449
  function createNodeFromContent(content, schema, options) {
23575
- if (content instanceof Node2 || content instanceof Fragment4) {
25450
+ if (content instanceof Node2 || content instanceof Fragment7) {
23576
25451
  return content;
23577
25452
  }
23578
25453
  options = {
@@ -23586,7 +25461,7 @@ function createNodeFromContent(content, schema, options) {
23586
25461
  try {
23587
25462
  const isArrayContent = Array.isArray(content) && content.length > 0;
23588
25463
  if (isArrayContent) {
23589
- return Fragment4.fromArray(content.map((item) => schema.nodeFromJSON(item)));
25464
+ return Fragment7.fromArray(content.map((item) => schema.nodeFromJSON(item)));
23590
25465
  }
23591
25466
  const node = schema.nodeFromJSON(content);
23592
25467
  if (options.errorOnInvalidContent) {
@@ -24720,7 +26595,7 @@ function inputRulesPlugin(props) {
24720
26595
  if (typeof text === "string") {
24721
26596
  text = text;
24722
26597
  } else {
24723
- text = getHTMLFromFragment(Fragment4.from(text), state.schema);
26598
+ text = getHTMLFromFragment(Fragment7.from(text), state.schema);
24724
26599
  }
24725
26600
  const { from: from2 } = simulatedInputMeta;
24726
26601
  const to = from2 + text.length;
@@ -25098,7 +26973,7 @@ function pasteRulesPlugin(props) {
25098
26973
  if (typeof text === "string") {
25099
26974
  text = text;
25100
26975
  } else {
25101
- text = getHTMLFromFragment(Fragment4.from(text), state.schema);
26976
+ text = getHTMLFromFragment(Fragment7.from(text), state.schema);
25102
26977
  }
25103
26978
  const { from: from22 } = simulatedPasteMeta;
25104
26979
  const to2 = from22 + text.length;
@@ -25756,7 +27631,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
25756
27631
  if (isOnlyTextContent) {
25757
27632
  if (Array.isArray(value)) {
25758
27633
  newContent = value.map((v) => v.text || "").join("");
25759
- } else if (value instanceof Fragment4) {
27634
+ } else if (value instanceof Fragment7) {
25760
27635
  let text = "";
25761
27636
  value.forEach((node) => {
25762
27637
  if (node.text) {
@@ -26223,10 +28098,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
26223
28098
  return false;
26224
28099
  }
26225
28100
  if (dispatch2) {
26226
- let wrap2 = Fragment4.empty;
28101
+ let wrap2 = Fragment7.empty;
26227
28102
  const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
26228
28103
  for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
26229
- wrap2 = Fragment4.from($from.node(d).copy(wrap2));
28104
+ wrap2 = Fragment7.from($from.node(d).copy(wrap2));
26230
28105
  }
26231
28106
  const depthAfter = (
26232
28107
  // eslint-disable-next-line no-nested-ternary
@@ -26237,7 +28112,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
26237
28112
  ...overrideAttrs
26238
28113
  };
26239
28114
  const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
26240
- wrap2 = wrap2.append(Fragment4.from(type.createAndFill(null, nextType2) || void 0));
28115
+ wrap2 = wrap2.append(Fragment7.from(type.createAndFill(null, nextType2) || void 0));
26241
28116
  const start = $from.before($from.depth - (depthBefore - 1));
26242
28117
  tr2.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
26243
28118
  let sel = -1;
@@ -27868,7 +29743,7 @@ function markPasteRule(config) {
27868
29743
  }
27869
29744
 
27870
29745
  // ../../node_modules/@tiptap/react/dist/index.js
27871
- var import_react17 = __toESM(require_react(), 1);
29746
+ var import_react19 = __toESM(require_react(), 1);
27872
29747
  var mergeRefs = (...refs) => {
27873
29748
  return (node) => {
27874
29749
  refs.forEach((ref) => {
@@ -28087,7 +29962,7 @@ function useEditorState(options) {
28087
29962
  editorStateManager.getSnapshot,
28088
29963
  editorStateManager.getServerSnapshot,
28089
29964
  options.selector,
28090
- (_a = options.equalityFn) != null ? _a : import_react17.default
29965
+ (_a = options.equalityFn) != null ? _a : import_react19.default
28091
29966
  );
28092
29967
  useIsomorphicLayoutEffect(() => {
28093
29968
  return editorStateManager.watch(options.editor);
@@ -28366,11 +30241,11 @@ var ReactNodeViewContext = createContext({
28366
30241
  var useReactNodeView = () => useContext(ReactNodeViewContext);
28367
30242
  t__default.forwardRef((props, ref) => {
28368
30243
  const { onDragStart } = useReactNodeView();
28369
- const Tag = props.as || "div";
30244
+ const Tag4 = props.as || "div";
28370
30245
  return (
28371
30246
  // @ts-ignore
28372
30247
  /* @__PURE__ */ jsx(
28373
- Tag,
30248
+ Tag4,
28374
30249
  {
28375
30250
  ...props,
28376
30251
  ref,
@@ -31683,9 +33558,9 @@ function beforeinput(view, event) {
31683
33558
  let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
31684
33559
  if (!insert)
31685
33560
  return false;
31686
- let frag = Fragment4.empty;
33561
+ let frag = Fragment7.empty;
31687
33562
  for (let i = insert.length - 1; i >= 0; i--)
31688
- frag = Fragment4.from(insert[i].createAndFill(null, frag));
33563
+ frag = Fragment7.from(insert[i].createAndFill(null, frag));
31689
33564
  let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
31690
33565
  tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
31691
33566
  view.dispatch(tr2);
@@ -32810,7 +34685,7 @@ var index_default7 = Highlight;
32810
34685
 
32811
34686
  // ../../node_modules/@tiptap/extension-image/dist/index.js
32812
34687
  var inputRegex6 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
32813
- var Image3 = Node3.create({
34688
+ var Image5 = Node3.create({
32814
34689
  name: "image",
32815
34690
  addOptions() {
32816
34691
  return {
@@ -32878,7 +34753,7 @@ var Image3 = Node3.create({
32878
34753
  ];
32879
34754
  }
32880
34755
  });
32881
- var index_default8 = Image3;
34756
+ var index_default8 = Image5;
32882
34757
 
32883
34758
  // ../../node_modules/prosemirror-tables/dist/index.js
32884
34759
  var readFromCache;
@@ -33365,10 +35240,10 @@ var CellSelection = class _CellSelection extends Selection {
33365
35240
  }
33366
35241
  rowContent.push(cell);
33367
35242
  }
33368
- rows.push(table.child(row).copy(Fragment4.from(rowContent)));
35243
+ rows.push(table.child(row).copy(Fragment7.from(rowContent)));
33369
35244
  }
33370
35245
  const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
33371
- return new Slice(Fragment4.from(fragment), 1, 1);
35246
+ return new Slice(Fragment7.from(fragment), 1, 1);
33372
35247
  }
33373
35248
  replace(tr2, content = Slice.empty) {
33374
35249
  const mapFrom = tr2.steps.length, ranges = this.ranges;
@@ -33388,7 +35263,7 @@ var CellSelection = class _CellSelection extends Selection {
33388
35263
  tr2.setSelection(sel);
33389
35264
  }
33390
35265
  replaceWith(tr2, node) {
33391
- this.replace(tr2, new Slice(Fragment4.from(node), 0, 0));
35266
+ this.replace(tr2, new Slice(Fragment7.from(node), 0, 0));
33392
35267
  }
33393
35268
  forEachCell(f) {
33394
35269
  const table = this.$anchorCell.node(-1);
@@ -33936,7 +35811,7 @@ function mergeCells(state, dispatch2) {
33936
35811
  if (dispatch2) {
33937
35812
  const tr2 = state.tr;
33938
35813
  const seen = {};
33939
- let content = Fragment4.empty;
35814
+ let content = Fragment7.empty;
33940
35815
  let mergedPos;
33941
35816
  let mergedCell;
33942
35817
  for (let row = rect.top; row < rect.bottom; row++) {
@@ -34317,14 +36192,14 @@ function ensureRectangular(schema, rows) {
34317
36192
  width = Math.max(width, widths[r2]);
34318
36193
  for (let r2 = 0; r2 < widths.length; r2++) {
34319
36194
  if (r2 >= rows.length)
34320
- rows.push(Fragment4.empty);
36195
+ rows.push(Fragment7.empty);
34321
36196
  if (widths[r2] < width) {
34322
36197
  const empty2 = tableNodeTypes(schema).cell.createAndFill();
34323
36198
  const cells = [];
34324
36199
  for (let i = widths[r2]; i < width; i++) {
34325
36200
  cells.push(empty2);
34326
36201
  }
34327
- rows[r2] = rows[r2].append(Fragment4.from(cells));
36202
+ rows[r2] = rows[r2].append(Fragment7.from(cells));
34328
36203
  }
34329
36204
  }
34330
36205
  return { height: rows.length, width, rows };
@@ -34356,7 +36231,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
34356
36231
  for (let j = 1; j < cell.attrs.rowspan; j++)
34357
36232
  added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
34358
36233
  }
34359
- newRows.push(Fragment4.from(cells));
36234
+ newRows.push(Fragment7.from(cells));
34360
36235
  }
34361
36236
  rows = newRows;
34362
36237
  width = newWidth;
@@ -34377,7 +36252,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
34377
36252
  );
34378
36253
  cells.push(cell);
34379
36254
  }
34380
- newRows.push(Fragment4.from(cells));
36255
+ newRows.push(Fragment7.from(cells));
34381
36256
  }
34382
36257
  rows = newRows;
34383
36258
  height = newHeight;
@@ -34412,7 +36287,7 @@ function growTable(tr2, map2, table, start, width, height, mapFrom) {
34412
36287
  header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty2 || (empty2 = types.cell.createAndFill())
34413
36288
  );
34414
36289
  }
34415
- const emptyRow = types.row.create(null, Fragment4.from(cells)), rows = [];
36290
+ const emptyRow = types.row.create(null, Fragment7.from(cells)), rows = [];
34416
36291
  for (let i = map2.height; i < height; i++)
34417
36292
  rows.push(emptyRow);
34418
36293
  tr2.insert(tr2.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
@@ -34621,7 +36496,7 @@ function handlePaste(view, _, slice2) {
34621
36496
  width: 1,
34622
36497
  height: 1,
34623
36498
  rows: [
34624
- Fragment4.from(
36499
+ Fragment7.from(
34625
36500
  fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
34626
36501
  )
34627
36502
  ]
@@ -52783,7 +54658,7 @@ function Timeline({
52783
54658
  interactive = true
52784
54659
  }) {
52785
54660
  const sortedEvents = [...events].sort((a, b) => b.date.getTime() - a.date.getTime());
52786
- const formatDate = (date) => {
54661
+ const formatDate2 = (date) => {
52787
54662
  return date.toLocaleDateString("en-US", {
52788
54663
  year: "numeric",
52789
54664
  month: "long",
@@ -52812,16 +54687,16 @@ function Timeline({
52812
54687
  const days = Math.floor(diffInSeconds / 86400);
52813
54688
  return `${days} day${days > 1 ? "s" : ""} ago`;
52814
54689
  } else {
52815
- return formatDate(date);
54690
+ return formatDate2(date);
52816
54691
  }
52817
54692
  };
52818
- const getInitials = (name) => {
54693
+ const getInitials4 = (name) => {
52819
54694
  return name.split(" ").map((n) => n[0]).join("").toUpperCase();
52820
54695
  };
52821
54696
  const groupEventsByDate = (events2) => {
52822
54697
  const groups = {};
52823
54698
  events2.forEach((event) => {
52824
- const dateKey = formatDate(event.date);
54699
+ const dateKey = formatDate2(event.date);
52825
54700
  if (!groups[dateKey]) {
52826
54701
  groups[dateKey] = [];
52827
54702
  }
@@ -52875,7 +54750,7 @@ function Timeline({
52875
54750
  showUserInfo && event.user && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
52876
54751
  /* @__PURE__ */ jsxs(MoonUIAvatarPro, { className: "h-6 w-6", children: [
52877
54752
  /* @__PURE__ */ jsx(MoonUIAvatarImagePro, { src: event.user.avatar }),
52878
- /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials(event.user.name) })
54753
+ /* @__PURE__ */ jsx(MoonUIAvatarFallbackPro, { className: "text-xs", children: getInitials4(event.user.name) })
52879
54754
  ] }),
52880
54755
  /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: event.user.name })
52881
54756
  ] }),
@@ -53181,9 +55056,9 @@ function AdvancedChart({
53181
55056
  toggleSeriesVisibility(entry.dataKey);
53182
55057
  }
53183
55058
  };
53184
- const handleExport = (format3) => {
55059
+ const handleExport = (format5) => {
53185
55060
  if (onExport) {
53186
- onExport(format3);
55061
+ onExport(format5);
53187
55062
  }
53188
55063
  };
53189
55064
  const handleZoom = (direction) => {
@@ -56678,7 +58553,7 @@ var GitHubStarsInternal = ({
56678
58553
  }
56679
58554
  return num.toString();
56680
58555
  };
56681
- const formatDate = (dateString) => {
58556
+ const formatDate2 = (dateString) => {
56682
58557
  const date = new Date(dateString);
56683
58558
  return date.toLocaleDateString("en-US", {
56684
58559
  year: "numeric",
@@ -56828,7 +58703,7 @@ var GitHubStarsInternal = ({
56828
58703
  ] }),
56829
58704
  /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
56830
58705
  "Updated ",
56831
- formatDate(repo.updated_at)
58706
+ formatDate2(repo.updated_at)
56832
58707
  ] })
56833
58708
  ] }) })
56834
58709
  }
@@ -57379,7 +59254,7 @@ var OptimizedImageInternal = ({
57379
59254
  width,
57380
59255
  height,
57381
59256
  quality = 75,
57382
- format: format3 = "auto",
59257
+ format: format5 = "auto",
57383
59258
  lazy = true,
57384
59259
  blur: blur2 = true,
57385
59260
  priority = false,
@@ -57418,7 +59293,7 @@ var OptimizedImageInternal = ({
57418
59293
  params.set("f", options.format);
57419
59294
  return optimizedUrl;
57420
59295
  };
57421
- const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format: format3 });
59296
+ const optimizedSrc = getOptimizedSrc(src, { width, height, quality, format: format5 });
57422
59297
  const handleImageLoad = () => {
57423
59298
  setIsLoaded(true);
57424
59299
  setIsLoading(false);
@@ -57582,7 +59457,7 @@ var OptimizedImageInternal = ({
57582
59457
  ] }),
57583
59458
  /* @__PURE__ */ jsxs("div", { children: [
57584
59459
  "Format: ",
57585
- format3
59460
+ format5
57586
59461
  ] })
57587
59462
  ]
57588
59463
  }
@@ -58712,6 +60587,24 @@ var PerformanceMonitor = ({ className, ...props }) => {
58712
60587
  }
58713
60588
  return /* @__PURE__ */ jsx(PerformanceMonitorInternal, { className, ...props });
58714
60589
  };
60590
+
60591
+ // src/use-toast.ts
60592
+ function toast2(options) {
60593
+ console.log("Toast:", options);
60594
+ if (typeof window !== "undefined") {
60595
+ const message = options.description ? `${options.title}
60596
+
60597
+ ${options.description}` : options.title;
60598
+ if (options.variant === "destructive") {
60599
+ console.error(message);
60600
+ } else {
60601
+ console.log(message);
60602
+ }
60603
+ }
60604
+ }
60605
+ var useToast2 = () => {
60606
+ return { toast: toast2 };
60607
+ };
58715
60608
  var fileUploadVariants = cva(
58716
60609
  "relative overflow-hidden transition-all duration-200",
58717
60610
  {
@@ -58733,7 +60626,7 @@ var fileUploadVariants = cva(
58733
60626
  }
58734
60627
  }
58735
60628
  );
58736
- var formatFileSize = (bytes) => {
60629
+ var formatFileSize2 = (bytes) => {
58737
60630
  if (bytes === 0)
58738
60631
  return "0 B";
58739
60632
  const k3 = 1024;
@@ -58898,7 +60791,7 @@ var FilePreviewModal = ({
58898
60791
  /* @__PURE__ */ jsx(MoonUIDialogHeaderPro, { children: /* @__PURE__ */ jsxs(MoonUIDialogTitlePro, { className: "flex items-center gap-2", children: [
58899
60792
  getFileIcon(file.file.type),
58900
60793
  file.file.name,
58901
- /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", children: formatFileSize(file.file.size) })
60794
+ /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", children: formatFileSize2(file.file.size) })
58902
60795
  ] }) }),
58903
60796
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center p-4 bg-muted/20 rounded-lg", children: [
58904
60797
  file.preview.type === "image" && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
@@ -59006,7 +60899,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
59006
60899
  }
59007
60900
  const validateFile = useCallback(async (file) => {
59008
60901
  if (file.size > maxSize) {
59009
- return `File size exceeds ${formatFileSize(maxSize)} limit`;
60902
+ return `File size exceeds ${formatFileSize2(maxSize)} limit`;
59010
60903
  }
59011
60904
  if (allowedMimeTypes.length > 0 && !allowedMimeTypes.includes(file.type)) {
59012
60905
  return `File type ${file.type} is not supported`;
@@ -59359,7 +61252,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
59359
61252
  const currentSize = files.reduce((sum, f) => sum + f.file.size, 0);
59360
61253
  const newSize = fileArray.reduce((sum, f) => sum + f.size, 0);
59361
61254
  if (currentSize + newSize > maxTotalSize) {
59362
- setError(`Total file size exceeds ${formatFileSize(maxTotalSize)} limit`);
61255
+ setError(`Total file size exceeds ${formatFileSize2(maxTotalSize)} limit`);
59363
61256
  return;
59364
61257
  }
59365
61258
  }
@@ -59572,7 +61465,7 @@ var MoonUIFileUploadPro = t__default.forwardRef(
59572
61465
  ] }),
59573
61466
  /* @__PURE__ */ jsx("span", { children: "\u2022" }),
59574
61467
  /* @__PURE__ */ jsxs("span", { children: [
59575
- formatFileSize(maxSize),
61468
+ formatFileSize2(maxSize),
59576
61469
  " per file"
59577
61470
  ] }),
59578
61471
  resumable && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -59685,6 +61578,7 @@ var FileUploadItem = ({
59685
61578
  onPauseResume,
59686
61579
  onPreview
59687
61580
  }) => {
61581
+ const { toast: toast3 } = useToast2();
59688
61582
  const canPauseResume = resumable && ["uploading", "paused"].includes(file.status);
59689
61583
  const canPreview = showPreview && file.preview && ["image", "video", "audio"].includes(file.preview.type);
59690
61584
  return /* @__PURE__ */ jsxs(
@@ -59702,18 +61596,27 @@ var FileUploadItem = ({
59702
61596
  variant === "grid" && "p-4"
59703
61597
  ),
59704
61598
  children: [
59705
- allowBulkOperations && /* @__PURE__ */ jsx("div", { className: "absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsx(
61599
+ allowBulkOperations && variant === "grid" && /* @__PURE__ */ jsx("div", { className: "absolute top-3 left-3 z-10", children: /* @__PURE__ */ jsx(
59706
61600
  "input",
59707
61601
  {
59708
61602
  type: "checkbox",
59709
61603
  checked: selected,
59710
61604
  onChange: (e) => onSelect?.(e.target.checked),
59711
- className: "rounded border-muted-foreground/25"
61605
+ className: "rounded border-muted-foreground/25 h-4 w-4"
59712
61606
  }
59713
61607
  ) }),
61608
+ allowBulkOperations && variant !== "grid" && /* @__PURE__ */ jsx(
61609
+ "input",
61610
+ {
61611
+ type: "checkbox",
61612
+ checked: selected,
61613
+ onChange: (e) => onSelect?.(e.target.checked),
61614
+ className: "rounded border-muted-foreground/25 h-4 w-4 mt-1 mr-3 float-left"
61615
+ }
61616
+ ),
59714
61617
  showPreview && file.preview && /* @__PURE__ */ jsxs("div", { className: cn(
59715
61618
  "relative overflow-hidden rounded bg-muted/20",
59716
- variant === "grid" ? "aspect-video mb-3" : "w-12 h-12 float-left mr-3"
61619
+ variant === "grid" ? "aspect-video mb-3" : variant === "compact" ? "w-10 h-10 float-left mr-2" : "w-12 h-12 float-left mr-3"
59717
61620
  ), children: [
59718
61621
  file.preview.type === "image" && file.preview.thumbnail && /* @__PURE__ */ jsx(
59719
61622
  "img",
@@ -59748,12 +61651,10 @@ var FileUploadItem = ({
59748
61651
  ] }),
59749
61652
  /* @__PURE__ */ jsxs("div", { className: cn(
59750
61653
  "flex-1 min-w-0",
59751
- variant === "grid" && "text-center",
59752
- allowBulkOperations && variant !== "grid" && "ml-8"
59753
- // Add margin when checkbox is present
61654
+ variant === "grid" ? "text-center w-full" : "overflow-hidden"
59754
61655
  ), children: [
59755
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
59756
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
61656
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
61657
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
59757
61658
  /* @__PURE__ */ jsx("h5", { className: cn(
59758
61659
  "font-medium truncate",
59759
61660
  variant === "compact" ? "text-sm" : "text-base"
@@ -59763,7 +61664,7 @@ var FileUploadItem = ({
59763
61664
  variant === "compact" ? "text-xs" : "text-sm",
59764
61665
  variant === "grid" && "justify-center"
59765
61666
  ), children: [
59766
- /* @__PURE__ */ jsx("span", { children: formatFileSize(file.file.size) }),
61667
+ /* @__PURE__ */ jsx("span", { children: formatFileSize2(file.file.size) }),
59767
61668
  file.preview?.dimensions && /* @__PURE__ */ jsxs(Fragment, { children: [
59768
61669
  /* @__PURE__ */ jsx("span", { children: "\u2022" }),
59769
61670
  /* @__PURE__ */ jsxs("span", { children: [
@@ -59782,13 +61683,17 @@ var FileUploadItem = ({
59782
61683
  MoonUIBadgePro,
59783
61684
  {
59784
61685
  variant: file.status === "success" ? "success" : file.status === "error" ? "destructive" : file.status === "paused" ? "secondary" : "secondary",
59785
- className: "flex-shrink-0",
61686
+ size: variant === "compact" ? "sm" : "md",
61687
+ className: cn(
61688
+ "flex-shrink-0 whitespace-nowrap min-w-fit",
61689
+ file.status === "success" && "bg-green-500 hover:bg-green-600 text-white border-transparent"
61690
+ ),
59786
61691
  children: [
59787
- file.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 mr-1 animate-spin" }),
59788
- file.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: "h-3 w-3 mr-1" }),
59789
- file.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 mr-1" }),
59790
- file.status === "paused" && /* @__PURE__ */ jsx(Pause, { className: "h-3 w-3 mr-1" }),
59791
- file.status === "pending" ? "Pending" : file.status === "uploading" ? "Uploading" : file.status === "paused" ? "Paused" : file.status === "success" ? "Completed" : file.status === "error" ? "Error" : "Cancelled"
61692
+ file.status === "uploading" && /* @__PURE__ */ jsx(Loader2, { className: cn("h-3 w-3 animate-spin flex-shrink-0", variant !== "compact" && "mr-1") }),
61693
+ file.status === "success" && /* @__PURE__ */ jsx(CheckCircle2, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
61694
+ file.status === "error" && /* @__PURE__ */ jsx(AlertCircle, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
61695
+ file.status === "paused" && /* @__PURE__ */ jsx(Pause, { className: cn("h-3 w-3 flex-shrink-0", variant !== "compact" && "mr-1") }),
61696
+ variant !== "compact" && (file.status === "pending" ? "Pending" : file.status === "uploading" ? "Uploading" : file.status === "paused" ? "Paused" : file.status === "success" ? "Done" : file.status === "error" ? "Error" : "Cancelled")
59792
61697
  ]
59793
61698
  }
59794
61699
  )
@@ -59800,7 +61705,7 @@ var FileUploadItem = ({
59800
61705
  "%"
59801
61706
  ] }),
59802
61707
  file.speed && /* @__PURE__ */ jsxs("span", { children: [
59803
- formatFileSize(file.speed),
61708
+ formatFileSize2(file.speed),
59804
61709
  "/s"
59805
61710
  ] }),
59806
61711
  file.estimatedTime && file.estimatedTime > 0 && /* @__PURE__ */ jsxs("span", { children: [
@@ -59812,7 +61717,7 @@ var FileUploadItem = ({
59812
61717
  ] }),
59813
61718
  file.status === "error" && file.error && /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-destructive", children: file.error }),
59814
61719
  /* @__PURE__ */ jsxs("div", { className: cn(
59815
- "flex items-center gap-1 mt-3",
61720
+ "flex items-center gap-1 mt-3 clear-both",
59816
61721
  variant === "grid" && "justify-center"
59817
61722
  ), children: [
59818
61723
  canPauseResume && /* @__PURE__ */ jsx(
@@ -59841,6 +61746,12 @@ var FileUploadItem = ({
59841
61746
  variant: "ghost",
59842
61747
  size: "sm",
59843
61748
  className: "h-7 px-2",
61749
+ onClick: () => {
61750
+ const link = document.createElement("a");
61751
+ link.href = file.preview?.url || URL.createObjectURL(file.file);
61752
+ link.download = file.file.name;
61753
+ link.click();
61754
+ },
59844
61755
  children: /* @__PURE__ */ jsx(Download, { className: "h-3 w-3" })
59845
61756
  }
59846
61757
  ),
@@ -59851,11 +61762,38 @@ var FileUploadItem = ({
59851
61762
  /* @__PURE__ */ jsx(Eye, { className: "mr-2 h-4 w-4" }),
59852
61763
  "Preview"
59853
61764
  ] }),
59854
- /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
61765
+ /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: async () => {
61766
+ try {
61767
+ const url = file.result?.url || file.preview?.url || URL.createObjectURL(file.file);
61768
+ await navigator.clipboard.writeText(url);
61769
+ toast3({
61770
+ title: "Link copied",
61771
+ description: "File link has been copied to clipboard"
61772
+ });
61773
+ } catch (err) {
61774
+ console.error("Failed to copy link:", err);
61775
+ toast3({
61776
+ title: "Failed to copy",
61777
+ description: "Could not copy link to clipboard",
61778
+ variant: "destructive"
61779
+ });
61780
+ }
61781
+ }, children: [
59855
61782
  /* @__PURE__ */ jsx(Copy, { className: "mr-2 h-4 w-4" }),
59856
61783
  "Copy Link"
59857
61784
  ] }),
59858
- /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { children: [
61785
+ navigator.share && /* @__PURE__ */ jsxs(MoonUIDropdownMenuItemPro, { onClick: async () => {
61786
+ try {
61787
+ await navigator.share({
61788
+ title: file.file.name,
61789
+ text: `Check out this file: ${file.file.name}`,
61790
+ url: file.result?.url || file.preview?.url || window.location.href,
61791
+ files: [file.file]
61792
+ });
61793
+ } catch (err) {
61794
+ console.log("Share cancelled or failed:", err);
61795
+ }
61796
+ }, children: [
59859
61797
  /* @__PURE__ */ jsx(Share, { className: "mr-2 h-4 w-4" }),
59860
61798
  "Share"
59861
61799
  ] }),
@@ -60399,11 +62337,11 @@ function downloadFile(content, filename, mimeType) {
60399
62337
  URL.revokeObjectURL(url);
60400
62338
  }
60401
62339
  async function exportData(data, options) {
60402
- const { format: format3, filename = "data-export", columns, includeHeaders = true } = options;
62340
+ const { format: format5, filename = "data-export", columns, includeHeaders = true } = options;
60403
62341
  let content;
60404
62342
  let mimeType;
60405
62343
  let extension;
60406
- switch (format3) {
62344
+ switch (format5) {
60407
62345
  case "csv":
60408
62346
  content = dataToCSV(data, columns, includeHeaders);
60409
62347
  mimeType = "text/csv;charset=utf-8;";
@@ -60417,7 +62355,7 @@ async function exportData(data, options) {
60417
62355
  case "xlsx":
60418
62356
  throw new Error("XLSX export requires additional dependencies. Use CSV format instead.");
60419
62357
  default:
60420
- throw new Error(`Unsupported export format: ${format3}`);
62358
+ throw new Error(`Unsupported export format: ${format5}`);
60421
62359
  }
60422
62360
  const finalFilename = `${filename}-${( new Date()).toISOString().split("T")[0]}.${extension}`;
60423
62361
  downloadFile(content, finalFilename, mimeType);
@@ -60900,11 +62838,11 @@ function DataTable({
60900
62838
  rowSelection: features.rowSelection !== false || selectable,
60901
62839
  export: features.export !== false || exportable
60902
62840
  });
60903
- const handleExport = async (format3) => {
62841
+ const handleExport = async (format5) => {
60904
62842
  const selectedRows = table.getFilteredSelectedRowModel().rows;
60905
62843
  const dataToExport = selectedRows.length > 0 ? selectedRows.map((row) => row.original) : table.getFilteredRowModel().rows.map((row) => row.original);
60906
62844
  if (typeof exportable === "object" && exportable.onExport) {
60907
- exportable.onExport(dataToExport, format3);
62845
+ exportable.onExport(dataToExport, format5);
60908
62846
  return;
60909
62847
  }
60910
62848
  if (onExport) {
@@ -60914,7 +62852,7 @@ function DataTable({
60914
62852
  const filename = typeof exportable === "object" && exportable.filename ? exportable.filename : "data-export";
60915
62853
  const visibleColumns = getVisibleColumns(columns, columnVisibility);
60916
62854
  await exportData(dataToExport, {
60917
- format: format3,
62855
+ format: format5,
60918
62856
  filename,
60919
62857
  columns: visibleColumns,
60920
62858
  includeHeaders: true
@@ -62846,18 +64784,18 @@ var countries = [
62846
64784
  { code: "NO", name: "Norway", dialCode: "+47", flag: "\u{1F1F3}\u{1F1F4}", format: "xxx xx xxx" },
62847
64785
  { code: "FI", name: "Finland", dialCode: "+358", flag: "\u{1F1EB}\u{1F1EE}", format: "xx xxxxxxx" }
62848
64786
  ];
62849
- function formatPhoneNumber(number, format3) {
62850
- if (!number || !format3)
64787
+ function formatPhoneNumber(number, format5) {
64788
+ if (!number || !format5)
62851
64789
  return "";
62852
64790
  const cleaned = number.replace(/\D/g, "");
62853
64791
  let formatted = "";
62854
64792
  let digitIndex = 0;
62855
- for (let i = 0; i < format3.length && digitIndex < cleaned.length; i++) {
62856
- if (format3[i] === "x") {
64793
+ for (let i = 0; i < format5.length && digitIndex < cleaned.length; i++) {
64794
+ if (format5[i] === "x") {
62857
64795
  formatted += cleaned[digitIndex];
62858
64796
  digitIndex++;
62859
64797
  } else {
62860
- formatted += format3[i];
64798
+ formatted += format5[i];
62861
64799
  }
62862
64800
  }
62863
64801
  return formatted;