@genfeedai/workflow-ui 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,11 +10,11 @@ import { useWorkflowStore } from './chunk-7DJHFOIW.mjs';
10
10
  import { usePromptLibraryStore } from './chunk-4JOFNZW6.mjs';
11
11
  import { Wand2, Volume2, Video, Subtitles, Sparkles, Share2, Scissors, RefreshCw, Puzzle, Pencil, Navigation, Mic, MessageSquare, Maximize2, Maximize, LayoutGrid, Layers, Image as Image$1, Grid3X3, GitBranch, Film, FileVideo, FileText, Eye, Download, Crop, Columns2, CheckCircle, Brain, AudioLines, AtSign, ArrowRightToLine, ArrowLeftFromLine, Square, Lock, Unlock, Copy, RotateCcw, Loader2, ChevronDown, ChevronRight, AlertCircle, ImageIcon, Expand, Play, AlertTriangle, CheckCircle2, Upload, Link, X, Music, Save, Clock, Shapes, ChevronLeft, SplitSquareHorizontal, Zap, ZoomOut, ZoomIn } from 'lucide-react';
12
12
  import Image4 from 'next/image';
13
- import { memo, forwardRef, useRef, useState, useCallback, useEffect, useImperativeHandle, useMemo, Children, Component, useLayoutEffect } from 'react';
13
+ import { memo, createContext, useRef, useState, useMemo, Children, useEffect, useCallback, Component, useLayoutEffect, useContext } from 'react';
14
14
  import { NODE_DEFINITIONS, NodeStatusEnum } from '@genfeedai/types';
15
15
  import { useUpdateNodeInternals, NodeResizer, Handle, Position } from '@xyflow/react';
16
16
  import { clsx } from 'clsx';
17
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
17
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
18
18
  import { createPortal } from 'react-dom';
19
19
  import { useShallow } from 'zustand/react/shallow';
20
20
  import { LUMA_ASPECT_RATIOS } from '@genfeedai/core';
@@ -275,8 +275,8 @@ function BaseNodeComponent({
275
275
  (state) => state.activeNodeExecutions.has(id)
276
276
  );
277
277
  const handleRetry = useCallback(
278
- (e) => {
279
- e.stopPropagation();
278
+ (e3) => {
279
+ e3.stopPropagation();
280
280
  if (!nodeExecuting) {
281
281
  updateNodeData(id, {
282
282
  error: void 0,
@@ -288,8 +288,8 @@ function BaseNodeComponent({
288
288
  [id, nodeExecuting, executeNode, updateNodeData]
289
289
  );
290
290
  const handleStopNode = useCallback(
291
- (e) => {
292
- e.stopPropagation();
291
+ (e3) => {
292
+ e3.stopPropagation();
293
293
  if (isRunning) {
294
294
  stopExecution();
295
295
  } else if (nodeExecuting) {
@@ -308,8 +308,8 @@ function BaseNodeComponent({
308
308
  ]
309
309
  );
310
310
  const handleCopyError = useCallback(
311
- async (e) => {
312
- e.stopPropagation();
311
+ async (e3) => {
312
+ e3.stopPropagation();
313
313
  if (nodeData.error) {
314
314
  if (navigator.clipboard) {
315
315
  await navigator.clipboard.writeText(nodeData.error);
@@ -353,8 +353,8 @@ function BaseNodeComponent({
353
353
  const Icon = ICON_MAP[nodeDef.icon] ?? Sparkles;
354
354
  const isSelected = selected || selectedNodeId === id;
355
355
  const isLocked = isNodeLocked(id);
356
- const handleLockToggle = (e) => {
357
- e.stopPropagation();
356
+ const handleLockToggle = (e3) => {
357
+ e3.stopPropagation();
358
358
  toggleNodeLock(id);
359
359
  };
360
360
  const categoryCssVars = {
@@ -557,8 +557,8 @@ function arePropsEqual(prev, next) {
557
557
  const prevDisabled = prev.disabledInputs ?? [];
558
558
  const nextDisabled = next.disabledInputs ?? [];
559
559
  if (prevDisabled.length !== nextDisabled.length) return false;
560
- for (let i = 0; i < prevDisabled.length; i++) {
561
- if (prevDisabled[i] !== nextDisabled[i]) return false;
560
+ for (let i3 = 0; i3 < prevDisabled.length; i3++) {
561
+ if (prevDisabled[i3] !== nextDisabled[i3]) return false;
562
562
  }
563
563
  const prevData = prev.data;
564
564
  const nextData = next.data;
@@ -715,7 +715,7 @@ function NegativePromptSelectorComponent({
715
715
  {
716
716
  type: "text",
717
717
  value: customText,
718
- onChange: (e) => handleCustomChange(e.target.value),
718
+ onChange: (e3) => handleCustomChange(e3.target.value),
719
719
  placeholder: "ugly, deformed, ...",
720
720
  className: "nodrag nopan w-full h-7 rounded-md border border-input bg-background px-2 text-xs shadow-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
721
721
  }
@@ -796,7 +796,7 @@ function getEnumKey(refPath) {
796
796
  }
797
797
  function formatLabel(key, title) {
798
798
  if (title) return title;
799
- return key.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
799
+ return key.replace(/_/g, " ").replace(/\b\w/g, (c3) => c3.toUpperCase());
800
800
  }
801
801
  function EnumSelect({
802
802
  propertyKey,
@@ -852,7 +852,7 @@ function SliderInput({
852
852
  max,
853
853
  step,
854
854
  value: currentValue,
855
- onChange: (e) => onChange(Number(e.target.value)),
855
+ onChange: (e3) => onChange(Number(e3.target.value)),
856
856
  className: "nodrag nopan w-16 h-7 rounded-md border border-input bg-background px-2 text-xs text-center shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
857
857
  }
858
858
  )
@@ -905,8 +905,8 @@ function NumberInput({
905
905
  type: "number",
906
906
  value: currentValue ?? "",
907
907
  placeholder: property.nullable ? "Random" : void 0,
908
- onChange: (e) => {
909
- const val = e.target.value;
908
+ onChange: (e3) => {
909
+ const val = e3.target.value;
910
910
  onChange(val === "" ? null : Number(val));
911
911
  },
912
912
  className: "nodrag nopan w-full h-8 rounded-md border border-input bg-background px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
@@ -930,9 +930,9 @@ function SchemaInputsComponent({
930
930
  );
931
931
  const sortedProperties = useMemo(() => {
932
932
  if (!schema) return [];
933
- return Object.entries(schema).filter(([key]) => !CONNECTION_FIELDS.has(key)).sort((a, b) => {
934
- const orderA = a[1]["x-order"] ?? 999;
935
- const orderB = b[1]["x-order"] ?? 999;
933
+ return Object.entries(schema).filter(([key]) => !CONNECTION_FIELDS.has(key)).sort((a4, b2) => {
934
+ const orderA = a4[1]["x-order"] ?? 999;
935
+ const orderB = b2[1]["x-order"] ?? 999;
936
936
  return orderA - orderB;
937
937
  });
938
938
  }, [schema]);
@@ -950,7 +950,7 @@ function SchemaInputsComponent({
950
950
  NegativePromptSelector,
951
951
  {
952
952
  value: value ?? "",
953
- onChange: (v) => handleChange(key, v)
953
+ onChange: (v2) => handleChange(key, v2)
954
954
  },
955
955
  key
956
956
  );
@@ -968,13 +968,13 @@ function SchemaInputsComponent({
968
968
  property,
969
969
  value,
970
970
  options,
971
- onChange: (v) => {
971
+ onChange: (v2) => {
972
972
  if (enumType === "integer") {
973
- handleChange(key, Number.parseInt(v, 10));
973
+ handleChange(key, Number.parseInt(v2, 10));
974
974
  } else if (enumType === "number") {
975
- handleChange(key, Number.parseFloat(v));
975
+ handleChange(key, Number.parseFloat(v2));
976
976
  } else {
977
- handleChange(key, v);
977
+ handleChange(key, v2);
978
978
  }
979
979
  }
980
980
  },
@@ -990,7 +990,7 @@ function SchemaInputsComponent({
990
990
  property,
991
991
  value,
992
992
  options: property.enum,
993
- onChange: (v) => handleChange(key, v)
993
+ onChange: (v2) => handleChange(key, v2)
994
994
  },
995
995
  key
996
996
  );
@@ -1002,7 +1002,7 @@ function SchemaInputsComponent({
1002
1002
  propertyKey: key,
1003
1003
  property,
1004
1004
  value,
1005
- onChange: (v) => handleChange(key, v)
1005
+ onChange: (v2) => handleChange(key, v2)
1006
1006
  },
1007
1007
  key
1008
1008
  );
@@ -1014,7 +1014,7 @@ function SchemaInputsComponent({
1014
1014
  propertyKey: key,
1015
1015
  property,
1016
1016
  value,
1017
- onChange: (v) => handleChange(key, v)
1017
+ onChange: (v2) => handleChange(key, v2)
1018
1018
  },
1019
1019
  key
1020
1020
  );
@@ -1026,7 +1026,7 @@ function SchemaInputsComponent({
1026
1026
  propertyKey: key,
1027
1027
  property,
1028
1028
  value,
1029
- onChange: (v) => handleChange(key, v)
1029
+ onChange: (v2) => handleChange(key, v2)
1030
1030
  },
1031
1031
  key
1032
1032
  );
@@ -1067,7 +1067,7 @@ function ImageGenNodeComponent(props) {
1067
1067
  );
1068
1068
  const handleDownloadAll = useCallback(() => {
1069
1069
  const images = nodeData.outputImages ?? [];
1070
- images.forEach((_, index) => {
1070
+ images.forEach((_2, index) => {
1071
1071
  setTimeout(() => handleDownload(index), index * 100);
1072
1072
  });
1073
1073
  }, [nodeData.outputImages, handleDownload]);
@@ -1099,7 +1099,7 @@ function ImageGenNodeComponent(props) {
1099
1099
  openNodeDetailModal(id, "preview", selectedPreview ?? 0);
1100
1100
  }, [id, openNodeDetailModal, selectedPreview]);
1101
1101
  const modelDisplayName = useMemo(
1102
- () => nodeData.selectedModel?.displayName || IMAGE_MODELS.find((m) => m.value === nodeData.model)?.label || nodeData.model,
1102
+ () => nodeData.selectedModel?.displayName || IMAGE_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model,
1103
1103
  [nodeData.selectedModel?.displayName, nodeData.model]
1104
1104
  );
1105
1105
  const isProcessing = nodeData.status === "processing";
@@ -1160,17 +1160,17 @@ function ImageGenNodeComponent(props) {
1160
1160
  }
1161
1161
  )
1162
1162
  ] }),
1163
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: nodeData.outputImages.map((img, i) => /* @__PURE__ */ jsxs(
1163
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: nodeData.outputImages.map((img, i3) => /* @__PURE__ */ jsxs(
1164
1164
  "div",
1165
1165
  {
1166
1166
  className: "relative group aspect-square rounded overflow-hidden border border-border cursor-pointer",
1167
- onClick: () => setSelectedPreview(selectedPreview === i ? null : i),
1167
+ onClick: () => setSelectedPreview(selectedPreview === i3 ? null : i3),
1168
1168
  children: [
1169
1169
  /* @__PURE__ */ jsx(
1170
1170
  Image4,
1171
1171
  {
1172
1172
  src: img,
1173
- alt: `Generated ${i + 1}`,
1173
+ alt: `Generated ${i3 + 1}`,
1174
1174
  fill: true,
1175
1175
  sizes: "150px",
1176
1176
  className: "object-cover",
@@ -1183,17 +1183,17 @@ function ImageGenNodeComponent(props) {
1183
1183
  variant: "ghost",
1184
1184
  size: "icon-sm",
1185
1185
  className: "h-6 w-6 bg-white/20 hover:bg-white/30",
1186
- onClick: (e) => {
1187
- e.stopPropagation();
1188
- handleDownload(i);
1186
+ onClick: (e3) => {
1187
+ e3.stopPropagation();
1188
+ handleDownload(i3);
1189
1189
  },
1190
1190
  children: /* @__PURE__ */ jsx(Download, { className: "w-3 h-3 text-white" })
1191
1191
  }
1192
1192
  ) }),
1193
- /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-[8px] text-center py-0.5", children: i + 1 })
1193
+ /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-[8px] text-center py-0.5", children: i3 + 1 })
1194
1194
  ]
1195
1195
  },
1196
- i
1196
+ i3
1197
1197
  )) }),
1198
1198
  selectedPreview !== null && nodeData.outputImages[selectedPreview] && /* @__PURE__ */ jsxs("div", { className: "relative aspect-[4/3] rounded overflow-hidden", children: [
1199
1199
  /* @__PURE__ */ jsx(
@@ -1295,7 +1295,7 @@ function LipSyncNodeComponent(props) {
1295
1295
  const handleExpand = useCallback(() => {
1296
1296
  openNodeDetailModal(id, "preview");
1297
1297
  }, [id, openNodeDetailModal]);
1298
- const currentModel = LIPSYNC_MODELS.find((m) => m.value === nodeData.model);
1298
+ const currentModel = LIPSYNC_MODELS.find((m2) => m2.value === nodeData.model);
1299
1299
  const isSyncModel = nodeData.model.startsWith("sync/");
1300
1300
  const supportsImage = currentModel?.supportsImage ?? false;
1301
1301
  const headerActions = useMemo(
@@ -1437,8 +1437,8 @@ function LLMNodeComponent(props) {
1437
1437
  selectedModel: nodeData.selectedModel
1438
1438
  });
1439
1439
  const handleSystemPromptChange = useCallback(
1440
- (e) => {
1441
- updateNodeData(id, { systemPrompt: e.target.value });
1440
+ (e3) => {
1441
+ updateNodeData(id, { systemPrompt: e3.target.value });
1442
1442
  },
1443
1443
  [id, updateNodeData]
1444
1444
  );
@@ -1449,9 +1449,9 @@ function LLMNodeComponent(props) {
1449
1449
  [id, updateNodeData]
1450
1450
  );
1451
1451
  const handleMaxTokensChange = useCallback(
1452
- (e) => {
1452
+ (e3) => {
1453
1453
  updateNodeData(id, {
1454
- maxTokens: parseInt(e.target.value, 10)
1454
+ maxTokens: parseInt(e3.target.value, 10)
1455
1455
  });
1456
1456
  },
1457
1457
  [id, updateNodeData]
@@ -1460,7 +1460,7 @@ function LLMNodeComponent(props) {
1460
1460
  openNodeDetailModal(id, "preview");
1461
1461
  }, [id, openNodeDetailModal]);
1462
1462
  const modelDisplayName = useMemo(
1463
- () => nodeData.selectedModel?.displayName || LLM_MODELS.find((m) => m.value === nodeData.model)?.label || nodeData.model || "Llama 3.1 405B",
1463
+ () => nodeData.selectedModel?.displayName || LLM_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model || "Llama 3.1 405B",
1464
1464
  [nodeData.selectedModel?.displayName, nodeData.model]
1465
1465
  );
1466
1466
  const isProcessing = nodeData.status === "processing";
@@ -1808,7 +1808,7 @@ function MotionControlNodeComponent(props) {
1808
1808
  onValueChange: handleDurationChange,
1809
1809
  children: [
1810
1810
  /* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
1811
- /* @__PURE__ */ jsx(SelectContent, { children: DURATIONS.map((d) => /* @__PURE__ */ jsx(SelectItem, { value: String(d.value), children: d.label }, d.value)) })
1811
+ /* @__PURE__ */ jsx(SelectContent, { children: DURATIONS.map((d3) => /* @__PURE__ */ jsx(SelectItem, { value: String(d3.value), children: d3.label }, d3.value)) })
1812
1812
  ]
1813
1813
  }
1814
1814
  )
@@ -2264,7 +2264,7 @@ function VideoGenNodeComponent(props) {
2264
2264
  openNodeDetailModal(id, "preview");
2265
2265
  }, [id, openNodeDetailModal]);
2266
2266
  const modelDisplayName = useMemo(
2267
- () => nodeData.selectedModel?.displayName || VIDEO_MODELS.find((m) => m.value === nodeData.model)?.label || nodeData.model,
2267
+ () => nodeData.selectedModel?.displayName || VIDEO_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model,
2268
2268
  [nodeData.selectedModel?.displayName, nodeData.model]
2269
2269
  );
2270
2270
  const isProcessing = nodeData.status === "processing";
@@ -2483,10 +2483,10 @@ function WorkflowInputNodeComponent(props) {
2483
2483
  const nodeData = data;
2484
2484
  const updateNodeData = useWorkflowStore((state) => state.updateNodeData);
2485
2485
  const handleNameChange = useCallback(
2486
- (e) => {
2486
+ (e3) => {
2487
2487
  updateNodeData(id, {
2488
- inputName: e.target.value,
2489
- label: `Input: ${e.target.value}`
2488
+ inputName: e3.target.value,
2489
+ label: `Input: ${e3.target.value}`
2490
2490
  });
2491
2491
  },
2492
2492
  [id, updateNodeData]
@@ -2510,9 +2510,9 @@ function WorkflowInputNodeComponent(props) {
2510
2510
  [id, updateNodeData]
2511
2511
  );
2512
2512
  const handleDescriptionChange = useCallback(
2513
- (e) => {
2513
+ (e3) => {
2514
2514
  updateNodeData(id, {
2515
- description: e.target.value
2515
+ description: e3.target.value
2516
2516
  });
2517
2517
  },
2518
2518
  [id, updateNodeData]
@@ -2592,10 +2592,10 @@ function WorkflowOutputNodeComponent(props) {
2592
2592
  const videoRef = useRef(null);
2593
2593
  const [isPlaying, setIsPlaying] = useState(false);
2594
2594
  const handleNameChange = useCallback(
2595
- (e) => {
2595
+ (e3) => {
2596
2596
  updateNodeData(id, {
2597
- label: `Output: ${e.target.value}`,
2598
- outputName: e.target.value
2597
+ label: `Output: ${e3.target.value}`,
2598
+ outputName: e3.target.value
2599
2599
  });
2600
2600
  },
2601
2601
  [id, updateNodeData]
@@ -2609,9 +2609,9 @@ function WorkflowOutputNodeComponent(props) {
2609
2609
  [id, updateNodeData]
2610
2610
  );
2611
2611
  const handleDescriptionChange = useCallback(
2612
- (e) => {
2612
+ (e3) => {
2613
2613
  updateNodeData(id, {
2614
- description: e.target.value
2614
+ description: e3.target.value
2615
2615
  });
2616
2616
  },
2617
2617
  [id, updateNodeData]
@@ -2949,7 +2949,7 @@ function WorkflowRefNodeComponent(props) {
2949
2949
  ] }),
2950
2950
  nodeData.cachedInterface.inputs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px]", children: [
2951
2951
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Inputs: " }),
2952
- nodeData.cachedInterface.inputs.map((input, i) => /* @__PURE__ */ jsxs("span", { children: [
2952
+ nodeData.cachedInterface.inputs.map((input, i3) => /* @__PURE__ */ jsxs("span", { children: [
2953
2953
  /* @__PURE__ */ jsxs("span", { className: "text-foreground", children: [
2954
2954
  input.name,
2955
2955
  /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
@@ -2958,12 +2958,12 @@ function WorkflowRefNodeComponent(props) {
2958
2958
  ] }),
2959
2959
  input.required && /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "*" })
2960
2960
  ] }),
2961
- i < nodeData.cachedInterface.inputs.length - 1 && ", "
2961
+ i3 < nodeData.cachedInterface.inputs.length - 1 && ", "
2962
2962
  ] }, input.nodeId))
2963
2963
  ] }),
2964
2964
  nodeData.cachedInterface.outputs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px]", children: [
2965
2965
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Outputs: " }),
2966
- nodeData.cachedInterface.outputs.map((output, i) => /* @__PURE__ */ jsxs("span", { children: [
2966
+ nodeData.cachedInterface.outputs.map((output, i3) => /* @__PURE__ */ jsxs("span", { children: [
2967
2967
  /* @__PURE__ */ jsxs("span", { className: "text-foreground", children: [
2968
2968
  output.name,
2969
2969
  /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
@@ -2971,7 +2971,7 @@ function WorkflowRefNodeComponent(props) {
2971
2971
  output.type
2972
2972
  ] })
2973
2973
  ] }),
2974
- i < nodeData.cachedInterface.outputs.length - 1 && ", "
2974
+ i3 < nodeData.cachedInterface.outputs.length - 1 && ", "
2975
2975
  ] }, output.nodeId))
2976
2976
  ] })
2977
2977
  ] }),
@@ -3012,8 +3012,8 @@ function AudioInputNodeComponent(props) {
3012
3012
  const [showUrlInput, setShowUrlInput] = useState(false);
3013
3013
  const [urlValue, setUrlValue] = useState(nodeData.url || "");
3014
3014
  const handleFileSelect = useCallback(
3015
- (e) => {
3016
- const file = e.target.files?.[0];
3015
+ (e3) => {
3016
+ const file = e3.target.files?.[0];
3017
3017
  if (!file) return;
3018
3018
  const reader = new FileReader();
3019
3019
  reader.onload = (event) => {
@@ -3068,10 +3068,10 @@ function AudioInputNodeComponent(props) {
3068
3068
  audio.src = urlValue;
3069
3069
  }, [id, updateNodeData, urlValue]);
3070
3070
  const handleUrlKeyDown = useCallback(
3071
- (e) => {
3072
- if (e.key === "Enter") {
3071
+ (e3) => {
3072
+ if (e3.key === "Enter") {
3073
3073
  handleUrlSubmit();
3074
- } else if (e.key === "Escape") {
3074
+ } else if (e3.key === "Escape") {
3075
3075
  setShowUrlInput(false);
3076
3076
  setUrlValue(nodeData.url || "");
3077
3077
  }
@@ -3139,7 +3139,7 @@ function AudioInputNodeComponent(props) {
3139
3139
  {
3140
3140
  type: "url",
3141
3141
  value: urlValue,
3142
- onChange: (e) => setUrlValue(e.target.value),
3142
+ onChange: (e3) => setUrlValue(e3.target.value),
3143
3143
  onKeyDown: handleUrlKeyDown,
3144
3144
  placeholder: "https://...",
3145
3145
  className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
@@ -3287,7 +3287,7 @@ function ImageInputNodeComponent(props) {
3287
3287
  {
3288
3288
  type: "url",
3289
3289
  value: urlValue,
3290
- onChange: (e) => setUrlValue(e.target.value),
3290
+ onChange: (e3) => setUrlValue(e3.target.value),
3291
3291
  onKeyDown: handleUrlKeyDown,
3292
3292
  placeholder: "https://...",
3293
3293
  className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
@@ -3365,8 +3365,8 @@ function PromptConstructorNodeComponent(props) {
3365
3365
  }
3366
3366
  }, [nodeData.template, isEditing]);
3367
3367
  const availableVariables = useMemo(() => {
3368
- const connectedPromptNodes = edges.filter((e) => e.target === id && e.targetHandle === "text").map((e) => nodes.find((n) => n.id === e.source)).filter(
3369
- (n) => n !== void 0 && n.type === "prompt"
3368
+ const connectedPromptNodes = edges.filter((e3) => e3.target === id && e3.targetHandle === "text").map((e3) => nodes.find((n2) => n2.id === e3.source)).filter(
3369
+ (n2) => n2 !== void 0 && n2.type === "prompt"
3370
3370
  );
3371
3371
  const vars = [];
3372
3372
  connectedPromptNodes.forEach((promptNode) => {
@@ -3402,7 +3402,7 @@ function PromptConstructorNodeComponent(props) {
3402
3402
  const varPattern = /@(\w+)/g;
3403
3403
  const unresolved = [];
3404
3404
  const matches = localTemplate.matchAll(varPattern);
3405
- const availableNames = new Set(availableVariables.map((v) => v.name));
3405
+ const availableNames = new Set(availableVariables.map((v2) => v2.name));
3406
3406
  for (const match of matches) {
3407
3407
  const varName = match[1];
3408
3408
  if (!availableNames.has(varName) && !unresolved.includes(varName)) {
@@ -3413,15 +3413,15 @@ function PromptConstructorNodeComponent(props) {
3413
3413
  }, [localTemplate, availableVariables]);
3414
3414
  const resolvedPreview = useMemo(() => {
3415
3415
  let resolved = localTemplate;
3416
- availableVariables.forEach((v) => {
3417
- resolved = resolved.replace(new RegExp(`@${v.name}`, "g"), v.value);
3416
+ availableVariables.forEach((v2) => {
3417
+ resolved = resolved.replace(new RegExp(`@${v2.name}`, "g"), v2.value);
3418
3418
  });
3419
3419
  return resolved;
3420
3420
  }, [localTemplate, availableVariables]);
3421
3421
  useEffect(() => {
3422
3422
  let resolved = nodeData.template;
3423
- availableVariables.forEach((v) => {
3424
- resolved = resolved.replace(new RegExp(`@${v.name}`, "g"), v.value);
3423
+ availableVariables.forEach((v2) => {
3424
+ resolved = resolved.replace(new RegExp(`@${v2.name}`, "g"), v2.value);
3425
3425
  });
3426
3426
  const outputValue = resolved || null;
3427
3427
  if (outputValue !== nodeData.outputText) {
@@ -3453,7 +3453,7 @@ function PromptConstructorNodeComponent(props) {
3453
3453
  unresolvedVars.length > 0 && /* @__PURE__ */ jsxs("div", { className: "px-2 py-1 bg-amber-900/30 border border-amber-700/50 rounded text-[10px] text-amber-400", children: [
3454
3454
  /* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Unresolved:" }),
3455
3455
  " ",
3456
- unresolvedVars.map((v) => `@${v}`).join(", ")
3456
+ unresolvedVars.map((v2) => `@${v2}`).join(", ")
3457
3457
  ] }),
3458
3458
  /* @__PURE__ */ jsxs("div", { className: "relative flex-1 flex flex-col", children: [
3459
3459
  /* @__PURE__ */ jsx(
@@ -3481,8 +3481,8 @@ function PromptConstructorNodeComponent(props) {
3481
3481
  children: filteredAutocompleteVars.map((variable, index) => /* @__PURE__ */ jsxs(
3482
3482
  "button",
3483
3483
  {
3484
- onMouseDown: (e) => {
3485
- e.preventDefault();
3484
+ onMouseDown: (e3) => {
3485
+ e3.preventDefault();
3486
3486
  handleAutocompleteSelect(variable.name);
3487
3487
  },
3488
3488
  className: `w-full px-3 py-2 text-left text-[11px] flex flex-col gap-0.5 transition-colors ${index === selectedAutocompleteIndex ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:bg-accent"}`,
@@ -3501,7 +3501,7 @@ function PromptConstructorNodeComponent(props) {
3501
3501
  ] }),
3502
3502
  availableVariables.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px] text-muted-foreground px-2", children: [
3503
3503
  "Available: ",
3504
- availableVariables.map((v) => `@${v.name}`).join(", ")
3504
+ availableVariables.map((v2) => `@${v2.name}`).join(", ")
3505
3505
  ] })
3506
3506
  ] }) });
3507
3507
  }
@@ -3514,8 +3514,8 @@ function PromptNodeComponent(props) {
3514
3514
  const { openCreateModal } = usePromptLibraryStore();
3515
3515
  const { openEditor } = usePromptEditorStore();
3516
3516
  const handlePromptChange = useCallback(
3517
- (e) => {
3518
- updateNodeData(id, { prompt: e.target.value });
3517
+ (e3) => {
3518
+ updateNodeData(id, { prompt: e3.target.value });
3519
3519
  },
3520
3520
  [id, updateNodeData]
3521
3521
  );
@@ -3712,7 +3712,7 @@ function VideoInputNodeComponent(props) {
3712
3712
  {
3713
3713
  type: "url",
3714
3714
  value: urlValue,
3715
- onChange: (e) => setUrlValue(e.target.value),
3715
+ onChange: (e3) => setUrlValue(e3.target.value),
3716
3716
  onKeyDown: handleUrlKeyDown,
3717
3717
  placeholder: "https://...",
3718
3718
  className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
@@ -3828,25 +3828,25 @@ function NodeDetailModal() {
3828
3828
  setCurrentIndex(nodeDetailStartIndex);
3829
3829
  }, [nodeDetailNodeId, nodeDetailStartIndex]);
3830
3830
  useEffect(() => {
3831
- const handleKeyDown = (e) => {
3831
+ const handleKeyDown = (e3) => {
3832
3832
  if (activeModal !== "nodeDetail") return;
3833
- if (e.key === "Escape") {
3833
+ if (e3.key === "Escape") {
3834
3834
  closeNodeDetailModal();
3835
3835
  }
3836
- if (e.key === "+" || e.key === "=") {
3836
+ if (e3.key === "+" || e3.key === "=") {
3837
3837
  setZoomLevel((prev) => Math.min(prev + 0.25, 4));
3838
3838
  }
3839
- if (e.key === "-") {
3839
+ if (e3.key === "-") {
3840
3840
  setZoomLevel((prev) => Math.max(prev - 0.25, 0.25));
3841
3841
  }
3842
- if (e.key === "0") {
3842
+ if (e3.key === "0") {
3843
3843
  setZoomLevel(1);
3844
3844
  setPanOffset({ x: 0, y: 0 });
3845
3845
  }
3846
- if (e.key === "ArrowLeft") {
3846
+ if (e3.key === "ArrowLeft") {
3847
3847
  goToPrevious();
3848
3848
  }
3849
- if (e.key === "ArrowRight") {
3849
+ if (e3.key === "ArrowRight") {
3850
3850
  goToNext();
3851
3851
  }
3852
3852
  };
@@ -3854,20 +3854,20 @@ function NodeDetailModal() {
3854
3854
  return () => window.removeEventListener("keydown", handleKeyDown);
3855
3855
  }, [activeModal, closeNodeDetailModal, goToPrevious, goToNext]);
3856
3856
  const handleMouseDown = useCallback(
3857
- (e) => {
3857
+ (e3) => {
3858
3858
  if (zoomLevel > 1) {
3859
3859
  setIsPanning(true);
3860
- setPanStart({ x: e.clientX - panOffset.x, y: e.clientY - panOffset.y });
3860
+ setPanStart({ x: e3.clientX - panOffset.x, y: e3.clientY - panOffset.y });
3861
3861
  }
3862
3862
  },
3863
3863
  [zoomLevel, panOffset]
3864
3864
  );
3865
3865
  const handleMouseMove = useCallback(
3866
- (e) => {
3866
+ (e3) => {
3867
3867
  if (isPanning) {
3868
3868
  setPanOffset({
3869
- x: e.clientX - panStart.x,
3870
- y: e.clientY - panStart.y
3869
+ x: e3.clientX - panStart.x,
3870
+ y: e3.clientY - panStart.y
3871
3871
  });
3872
3872
  }
3873
3873
  },
@@ -4072,8 +4072,8 @@ function DownloadNodeComponent(props) {
4072
4072
  const activeType = nodeData.inputVideo ? "video" : nodeData.inputImage ? "image" : null;
4073
4073
  const fileExtension = activeMedia ? getExtensionFromUrl(activeMedia, activeType || "image") : "png";
4074
4074
  const handleFilenameChange = useCallback(
4075
- (e) => {
4076
- updateNodeData(id, { outputName: e.target.value });
4075
+ (e3) => {
4076
+ updateNodeData(id, { outputName: e3.target.value });
4077
4077
  },
4078
4078
  [id, updateNodeData]
4079
4079
  );
@@ -4270,7 +4270,7 @@ function AnimationNodeComponent(props) {
4270
4270
  CubicBezierEditor,
4271
4271
  {
4272
4272
  value: curve,
4273
- onChange: (v) => updateNodeData(id, { customCurve: v }),
4273
+ onChange: (v2) => updateNodeData(id, { customCurve: v2 }),
4274
4274
  disabled: nodeData.status === "processing"
4275
4275
  }
4276
4276
  ),
@@ -4453,105 +4453,111 @@ function AnnotationNodeComponent(props) {
4453
4453
  ] }) });
4454
4454
  }
4455
4455
  var AnnotationNode = memo(AnnotationNodeComponent);
4456
- var B = forwardRef(({ transition: e, ...t }, r) => {
4457
- let o = { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", transition: e ? `clip-path ${e}` : void 0, userSelect: "none", willChange: "clip-path, transition", KhtmlUserSelect: "none", MozUserSelect: "none", WebkitUserSelect: "none" };
4458
- return jsx("div", { ...t, style: o, "data-rcs": "clip-item", ref: r });
4459
- });
4460
- B.displayName = "ContainerClip";
4461
- var W = forwardRef(({ children: e, disabled: t, portrait: r, position: o, transition: i }, m) => {
4462
- let u = { position: "absolute", top: 0, width: r ? "100%" : void 0, height: r ? void 0 : "100%", background: "none", border: 0, padding: 0, pointerEvents: "all", appearance: "none", WebkitAppearance: "none", MozAppearance: "none", outline: 0, transform: r ? "translate3d(0, -50% ,0)" : "translate3d(-50%, 0, 0)", transition: i ? `${r ? "top" : "left"} ${i}` : void 0 };
4463
- return jsx("button", { ref: m, "aria-label": "Drag to move or focus and use arrow keys", "aria-orientation": r ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": o, "data-rcs": "handle-container", disabled: t, role: "slider", style: u, children: e });
4464
- });
4465
- W.displayName = "ThisHandleContainer";
4466
- var re = ({ flip: e }) => jsx("div", { className: "__rcs-handle-arrow", style: { width: 0, height: 0, borderTop: "8px solid transparent", borderRight: "10px solid", borderBottom: "8px solid transparent", transform: e ? "rotate(180deg)" : void 0 } });
4467
- var F = ({ className: e = "__rcs-handle-root", disabled: t, buttonStyle: r, linesStyle: o, portrait: i, style: m, ...C }) => {
4468
- let u = { display: "flex", flexDirection: i ? "row" : "column", placeItems: "center", height: "100%", cursor: t ? "not-allowed" : i ? "ns-resize" : "ew-resize", pointerEvents: "none", color: "#fff", ...m }, E = { flexGrow: 1, height: i ? 2 : "100%", width: i ? "100%" : 2, backgroundColor: "currentColor", pointerEvents: "auto", boxShadow: "0 0 4px rgba(0,0,0,.5)", ...o }, y = { display: "grid", gridAutoFlow: "column", gap: 8, placeContent: "center", flexShrink: 0, width: 56, height: 56, borderRadius: "50%", borderStyle: "solid", borderWidth: 2, pointerEvents: "auto", backdropFilter: "blur(7px)", WebkitBackdropFilter: "blur(7px)", backgroundColor: "rgba(0, 0, 0, 0.125)", boxShadow: "0 0 4px rgba(0,0,0,.35)", transform: i ? "rotate(90deg)" : void 0, ...r };
4469
- return jsxs("div", { ...C, className: e, style: u, children: [jsx("div", { className: "__rcs-handle-line", style: E }), jsxs("div", { className: "__rcs-handle-button", style: y, children: [jsx(re, {}), jsx(re, { flip: true })] }), jsx("div", { className: "__rcs-handle-line", style: E })] });
4470
- };
4471
- var $ = ((i) => (i.ARROW_LEFT = "ArrowLeft", i.ARROW_RIGHT = "ArrowRight", i.ARROW_UP = "ArrowUp", i.ARROW_DOWN = "ArrowDown", i))($ || {});
4472
- var G = ({ boxSizing: e = "border-box", objectFit: t = "cover", objectPosition: r = "center center", ...o } = {}) => ({ display: "block", width: "100%", height: "100%", maxWidth: "100%", boxSizing: e, objectFit: t, objectPosition: r, ...o });
4473
- var oe = (e) => {
4474
- let t = useRef(e);
4475
- return useEffect(() => {
4476
- t.current = e;
4477
- }), t.current;
4478
- };
4479
- var U = (e, t, r, o) => {
4480
- let i = useRef();
4456
+
4457
+ // ../node_modules/.bun/react-compare-slider@4.0.0+bf16f8eded5e12ee/node_modules/react-compare-slider/dist/consts.mjs
4458
+ var e = { all: `all`, itemOne: `itemOne`, itemTwo: `itemTwo` };
4459
+ var t = { rawPosition: `--rcs-raw-position`, currentPosition: `--rcs-current-position`, boundsPadding: `--rcs-bounds-padding`, handleColor: `--rcs-handle-color` };
4460
+ var n = { capture: false, passive: true };
4461
+ var r = { capture: true, passive: false };
4462
+ var i = (function(e3) {
4463
+ return e3.ARROW_LEFT = `ArrowLeft`, e3.ARROW_RIGHT = `ArrowRight`, e3.ARROW_UP = `ArrowUp`, e3.ARROW_DOWN = `ArrowDown`, e3;
4464
+ })({});
4465
+ var a = (n2, r3, i3, a4) => {
4466
+ let o3 = useRef(void 0);
4481
4467
  useEffect(() => {
4482
- i.current = t;
4483
- }, [t]), useEffect(() => {
4484
- if (!(r && r.addEventListener)) return;
4485
- let m = (C) => i.current && i.current(C);
4486
- return r.addEventListener(e, m, o), () => {
4487
- r.removeEventListener(e, m, o);
4468
+ o3.current = r3;
4469
+ }, [r3]), useEffect(() => {
4470
+ if (!i3?.addEventListener) return;
4471
+ let e3 = (e4) => o3.current?.(e4);
4472
+ return i3.addEventListener(n2, e3, a4), () => {
4473
+ i3.removeEventListener(n2, e3, a4);
4488
4474
  };
4489
- }, [e, r, o]);
4475
+ }, [n2, i3, a4]);
4490
4476
  };
4491
- var Te = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? useLayoutEffect : useEffect;
4492
- var ie = (e, t) => {
4493
- let r = useRef(), o = useCallback(() => {
4494
- e.current && r.current && r.current.observe(e.current);
4495
- }, [e]);
4496
- Te(() => (r.current = new ResizeObserver(([i]) => t(i.contentRect)), o(), () => {
4497
- r.current && r.current.disconnect();
4498
- }), [t, o]);
4477
+ var u = createContext(null);
4478
+ var d = ({ children: e3, ...t3 }) => jsx(u.Provider, { value: t3, children: e3 });
4479
+ var f = () => {
4480
+ let e3 = useContext(u);
4481
+ if (!e3) throw Error(`useReactCompareSliderContext must be used within the Provider component`);
4482
+ return e3;
4499
4483
  };
4500
- var I = { capture: false, passive: true };
4501
- var X5 = { capture: true, passive: false };
4502
- var Me = (e) => {
4503
- e.preventDefault(), e.currentTarget.focus();
4484
+ var p = ({ flip: e3 }) => {
4485
+ let n2 = { width: `0.85rem`, height: `0.85rem`, clipPath: `polygon(100% 0%, 100% 100%, 30% 50%)`, rotate: e3 ? `180deg` : `0deg`, outline: `0.5rem solid var(${t.handleColor})`, outlineOffset: `-0.5rem` };
4486
+ return jsx(`div`, { "aria-hidden": `true`, className: `__rcs-handle-arrow`, style: n2 });
4504
4487
  };
4505
- var se = forwardRef(({ boundsPadding: e = 0, browsingContext: t = globalThis, changePositionOnHover: r = false, disabled: o = false, handle: i, itemOne: m, itemTwo: C, keyboardIncrement: u = "5%", onlyHandleDraggable: E = false, onPositionChange: y, portrait: a = false, position: g = 50, style: le, transition: ce, ...pe }, de) => {
4506
- let p = useRef(null), j = useRef(null), f = useRef(null), d = useRef(g), [L, q] = useState(false), [me, x] = useState(true), w = useRef(false), [ue, fe] = useState(), J = oe(g), l = useCallback(function({ x: s, y: c, isOffset: R }) {
4507
- let b = p.current, A = f.current, D = j.current, { width: h, height: S, left: Pe, top: Ee } = b.getBoundingClientRect();
4508
- if (h === 0 || S === 0) return;
4509
- let ye = a ? R ? c - Ee - t.scrollY : c : R ? s - Pe - t.scrollX : s, Q = Math.min(Math.max(ye / (a ? S : h) * 100, 0), 100), z = a ? S / (b.offsetHeight || 1) : h / (b.offsetWidth || 1), Z = e * z / (a ? S : h) * 100, _ = Math.min(Math.max(Q, Z * z), 100 - Z * z);
4510
- d.current = Q, A.setAttribute("aria-valuenow", `${Math.round(d.current)}`), A.style.top = a ? `${_}%` : "0", A.style.left = a ? "0" : `${_}%`, D.style.clipPath = a ? `inset(${_}% 0 0 0)` : `inset(0 0 0 ${_}%)`, y && y(d.current);
4511
- }, [e, y, a, t]);
4512
- useEffect(() => {
4513
- let { width: n, height: s } = p.current.getBoundingClientRect(), c = g === J ? d.current : g;
4514
- l({ x: n / 100 * c, y: s / 100 * c });
4515
- }, [e, g, a, J, l]);
4516
- let Re = useCallback((n) => {
4517
- n.preventDefault(), !(o || n.button !== 0) && (l({ isOffset: true, x: n.pageX, y: n.pageY }), q(true), x(true));
4518
- }, [o, l]), v = useCallback(function(s) {
4519
- l({ isOffset: true, x: s.pageX, y: s.pageY }), x(false);
4520
- }, [l]), T = useCallback(() => {
4521
- q(false), x(true);
4522
- }, []), Se = useCallback(({ width: n, height: s }) => {
4523
- let { width: c, height: R } = p.current.getBoundingClientRect();
4524
- l({ x: n / 100 * d.current * c / n, y: s / 100 * d.current * R / s });
4525
- }, [l]), Ce = useCallback((n) => {
4526
- if (!Object.values($).includes(n.key)) return;
4527
- n.preventDefault(), x(true);
4528
- let { top: s, left: c } = f.current.getBoundingClientRect(), { width: R, height: b } = p.current.getBoundingClientRect(), D = typeof u == "string" ? parseFloat(u) : u / R * 100, h = a ? n.key === "ArrowLeft" || n.key === "ArrowDown" : n.key === "ArrowRight" || n.key === "ArrowUp", S = Math.min(Math.max(h ? d.current + D : d.current - D, 0), 100);
4529
- l({ x: a ? c : R * S / 100, y: a ? b * S / 100 : s });
4530
- }, [u, a, l]);
4531
- useEffect(() => {
4532
- fe(E ? f.current : p.current);
4533
- }, [E]), useEffect(() => {
4534
- let n = p.current, s = () => {
4535
- L || T();
4488
+ var m = ({ className: e3 = `__rcs-handle-root`, buttonStyle: n2, linesStyle: r3, style: i3, ...a4 }) => {
4489
+ let { disabled: o3, portrait: s3 } = f(), u3 = { boxSizing: `border-box`, position: `relative`, display: `inline-flex`, flexDirection: s3 ? `row` : `column`, placeItems: `center`, width: s3 ? `100%` : void 0, height: s3 ? void 0 : `100%`, cursor: o3 ? `not-allowed` : s3 ? `ns-resize` : `ew-resize`, pointerEvents: `none`, [t.handleColor]: `rgba(255, 255, 255, 1)`, ...i3 }, d3 = { flexGrow: 1, height: s3 ? 2 : `100%`, width: s3 ? `100%` : 2, outline: `1px solid var(${t.handleColor})`, outlineOffset: -1, pointerEvents: `auto`, boxShadow: `0 0 4px rgba(0,0,0,.5)`, ...r3 }, m2 = { direction: `ltr`, display: `grid`, gridAutoFlow: `column`, gap: `0.5rem`, placeContent: `center`, flexShrink: 0, width: `3.5rem`, height: `3.5rem`, borderRadius: `50%`, border: `2px solid var(${t.handleColor})`, color: `inherit`, pointerEvents: `auto`, backdropFilter: `blur(0.5rem)`, WebkitBackdropFilter: `blur(0.5rem)`, backgroundColor: `rgba(0, 0, 0, 0.125)`, boxShadow: `0 0 4px rgba(0,0,0,.35)`, transform: s3 ? `rotate(90deg)` : void 0, ...n2 };
4490
+ return jsxs(`div`, { "data-rcs": `handle`, ...a4, className: e3, style: u3, children: [jsx(`div`, { className: `__rcs-handle-line`, style: d3 }), jsxs(`div`, { className: `__rcs-handle-button`, style: m2, children: [jsx(p, {}), jsx(p, { flip: true })] }), jsx(`div`, { className: `__rcs-handle-line`, style: d3 })] });
4491
+ };
4492
+ var h = ({ display: e3 = `block`, width: t3 = `100%`, height: n2 = `100%`, maxWidth: r3 = `100%`, boxSizing: i3 = `border-box`, objectFit: a4 = `cover`, objectPosition: o3 = `center center`, ...s3 } = {}) => ({ display: e3, width: t3, height: n2, maxWidth: r3, boxSizing: i3, objectFit: a4, objectPosition: o3, ...s3 });
4493
+ var g = ({ alt: e3, style: t3, ...n2 }) => {
4494
+ let r3 = h(t3);
4495
+ return jsx(`img`, { "data-rcs": `image`, ...n2, alt: e3, style: r3 });
4496
+ };
4497
+ var _ = ({ style: e3, ...r3 }) => {
4498
+ let { disabled: a4, portrait: o3, position: s3, handleRootRef: l3, onHandleRootClick: u3, onHandleRootKeyDown: d3 } = f(), p3 = { WebkitAppearance: `none`, MozAppearance: `none`, WebkitTapHighlightColor: `transparent`, boxSizing: `border-box`, position: `absolute`, display: `flex`, flexDirection: o3 ? `row` : `column`, placeItems: `center`, contain: `layout`, top: o3 ? `-50%` : void 0, left: o3 ? void 0 : `-50%`, width: `100%`, height: `100%`, background: `none`, border: 0, padding: 0, pointerEvents: `none`, appearance: `none`, outline: 0, zIndex: 1, translate: o3 ? `0 var(${t.currentPosition}) 0` : `var(${t.currentPosition}) 0 0`, backfaceVisibility: `hidden`, willChange: `translate`, ...e3 };
4499
+ return a(`keydown`, d3, l3.current, r), a(`click`, u3, l3.current, r), jsx(`div`, { ref: l3, tabIndex: 0, "aria-label": `Click and drag or focus and use arrow keys to change the position of the slider`, "aria-orientation": o3 ? `vertical` : `horizontal`, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": s3.current, "aria-disabled": a4, "data-rcs": `handle-root`, role: `slider`, style: p3, ...r3 });
4500
+ };
4501
+ var v = ({ itemClip: n2, portrait: r3 }) => n2 === e.itemOne ? r3 ? `inset(0px 0px calc(100% - var(${t.currentPosition})) 0px)` : `inset(0px calc(100% - var(${t.currentPosition})) 0px 0px)` : n2 === e.itemTwo ? r3 ? `inset(var(${t.currentPosition}) 0px 0px 0px)` : `inset(0px 0px 0px var(${t.currentPosition}))` : `none`;
4502
+ var y = ({ item: t3, style: n2, ...r3 }) => {
4503
+ let { clip: i3, portrait: a4 } = f(), o3 = { KhtmlUserSelect: `none`, MozUserSelect: `none`, WebkitUserSelect: `none`, backfaceVisibility: `hidden`, WebkitBackfaceVisibility: `hidden`, gridArea: `1 / 1`, maxWidth: `100%`, overflow: `hidden`, clipPath: v({ itemClip: i3 === e.all || i3 === t3 ? t3 : void 0, portrait: a4 }), boxSizing: `border-box`, transform: `translateZ(0)`, userSelect: `none`, zIndex: t3 === e.itemOne ? 1 : void 0, willChange: `clip-path`, ...n2 };
4504
+ return jsx(`div`, { "data-rcs": `item`, "data-rcs-item": t3, ...r3, style: o3 });
4505
+ };
4506
+ var b = `clamp(var(${t.boundsPadding}), var(${t.rawPosition}) - var(${t.boundsPadding}) + var(${t.boundsPadding}), calc(100% - var(${t.boundsPadding})))`;
4507
+ var x = ({ style: e3, ...a4 }) => {
4508
+ let { browsingContext: o3, boundsPadding: l3, changePositionOnHover: u3, clip: d3, isDragging: p3, portrait: m2, position: h2, onTouchEnd: g2, onPointerDown: _2, onPointerMove: v2, onPointerUp: y2, interactiveTarget: x2, rootRef: S, transition: C, canTransition: w } = f(), T = { position: `relative`, boxSizing: `border-box`, display: `grid`, maxWidth: `100%`, maxHeight: `100%`, overflow: `hidden`, cursor: p3 ? m2 ? `ns-resize` : `ew-resize` : void 0, touchAction: `pan-y`, userSelect: `none`, KhtmlUserSelect: `none`, msUserSelect: `none`, MozUserSelect: `none`, WebkitUserSelect: `none`, transition: w && C ? `${t.rawPosition} ${C}` : `none`, [t.rawPosition]: `${h2.current}%`, [t.boundsPadding]: l3, [t.currentPosition]: b, ...e3 };
4509
+ return a(`touchend`, g2, x2, r), a(`pointerdown`, _2, x2, r), useEffect(() => {
4510
+ let e4 = S.current, t3 = (e5) => {
4511
+ p3 || y2(e5);
4536
4512
  };
4537
- return r && (n.addEventListener("pointermove", v, I), n.addEventListener("pointerleave", s, I)), () => {
4538
- n.removeEventListener("pointermove", v), n.removeEventListener("pointerleave", s);
4513
+ return u3 && (e4.addEventListener(`pointermove`, v2, n), e4.addEventListener(`pointerleave`, t3, n)), () => {
4514
+ e4.removeEventListener(`pointermove`, v2), e4.removeEventListener(`pointerleave`, t3);
4539
4515
  };
4540
- }, [r, v, T, L]), useEffect(() => (L && !w.current && (t.addEventListener("pointermove", v, I), t.addEventListener("pointerup", T, I), w.current = true), () => {
4541
- w.current && (t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", T), w.current = false);
4542
- }), [v, T, L, t]), useImperativeHandle(de, () => ({ rootContainer: p.current, handleContainer: f.current, setPosition(n) {
4543
- let { width: s, height: c } = p.current.getBoundingClientRect();
4544
- l({ x: s / 100 * n, y: c / 100 * n });
4545
- } }), [l]), ie(p, Se), U("keydown", Ce, f.current, X5), U("click", Me, f.current, X5), U("pointerdown", Re, ue, X5);
4546
- let ve = i || jsx(F, { disabled: o, portrait: a }), K = me ? ce : void 0, he = { position: "relative", display: "flex", overflow: "hidden", cursor: L ? a ? "ns-resize" : "ew-resize" : void 0, touchAction: "none", userSelect: "none", KhtmlUserSelect: "none", msUserSelect: "none", MozUserSelect: "none", WebkitUserSelect: "none", ...le };
4547
- return jsxs("div", { ...pe, ref: p, style: he, "data-rcs": "root", children: [m, jsx(B, { ref: j, transition: K, children: C }), jsx(W, { disabled: o, portrait: a, position: Math.round(d.current), ref: f, transition: K, children: ve })] });
4548
- });
4549
- se.displayName = "ReactCompareSlider";
4550
- var ae = forwardRef(({ style: e, ...t }, r) => {
4551
- let o = G(e);
4552
- return jsx("img", { ref: r, ...t, style: o, "data-rcs": "image" });
4553
- });
4554
- ae.displayName = "ReactCompareSliderImage";
4516
+ }, [u3, v2, y2, p3, S]), useEffect(() => {
4517
+ if (p3) return o3.addEventListener(`pointermove`, v2, n), o3.addEventListener(`pointerup`, y2, n), () => {
4518
+ o3?.removeEventListener(`pointermove`, v2), o3?.removeEventListener(`pointerup`, y2);
4519
+ };
4520
+ }, [v2, y2, p3, o3]), jsx(`div`, { ref: S, style: T, "data-rcs": `root`, "data-rcs-clip": d3, ...a4 });
4521
+ };
4522
+ (() => {
4523
+ try {
4524
+ typeof CSS < `u` && CSS.registerProperty({ name: t.rawPosition, syntax: `<percentage>`, inherits: true, initialValue: `50%` });
4525
+ } catch (e3) {
4526
+ console.debug(`[react-compare-slider] register CSS property:`, e3);
4527
+ }
4528
+ })();
4529
+ var c2 = () => globalThis.matchMedia?.(`(prefers-reduced-motion: no-preference)`)?.matches ? `0.15s ease-out` : `none`;
4530
+ var l2 = () => !!globalThis.matchMedia?.(`(pointer: coarse)`)?.matches;
4531
+ var u2 = ({ boundsPadding: u3 = `0px`, browsingContext: d3 = globalThis, changePositionOnHover: f3 = false, clip: p3 = e.all, defaultPosition: m2 = 50, disabled: h2 = false, keyboardIncrement: g2 = `5%`, onlyHandleDraggable: _2 = l2(), onPositionChange: v2, portrait: y2 = false, transition: b2 = c2() } = {}) => {
4532
+ let x2 = useRef(null), S = useRef(null), C = useRef(m2), [w, T] = useState(false), [E, D] = useState(true), [O, k] = useState(null), A = useCallback((e3) => {
4533
+ let n2 = Math.min(Math.max(e3, 0), 100);
4534
+ x2.current?.style.setProperty(t.rawPosition, `${n2}%`), S.current?.setAttribute(`aria-valuenow`, `${Math.round(n2)}`), C.current = n2, v2?.(n2);
4535
+ }, [v2]), j = useCallback(function({ x: e3, y: t3 }) {
4536
+ let { width: n2, height: r3, top: i3, left: a4 } = x2.current.getBoundingClientRect();
4537
+ n2 === 0 || r3 === 0 || A((y2 ? t3 - i3 - d3.scrollY : e3 - a4 - d3.scrollX) / (y2 ? r3 : n2) * 100);
4538
+ }, [d3, y2, A]), M = useCallback((e3) => {
4539
+ e3.preventDefault(), !(h2 || e3.button !== 0) && (j({ x: e3.pageX, y: e3.pageY }), T(true), D(true));
4540
+ }, [h2, j]), N = useCallback(function(e3) {
4541
+ D(false), j({ x: e3.pageX, y: e3.pageY });
4542
+ }, [j]), P = useCallback((e3) => {
4543
+ T(false), D(true);
4544
+ }, []), F = useCallback((e3) => {
4545
+ T(false), D(true);
4546
+ }, []), I = useCallback((e3) => {
4547
+ e3.preventDefault(), e3.currentTarget?.focus();
4548
+ }, []), L = useCallback((e3) => {
4549
+ if (!Object.values(i).includes(e3.key)) return;
4550
+ e3.preventDefault(), D(true);
4551
+ let t3 = typeof g2 == `string` ? Number.parseFloat(g2) : g2 / x2.current?.getBoundingClientRect().width * 100;
4552
+ A((y2 ? e3.key === i.ARROW_LEFT || e3.key === i.ARROW_DOWN : e3.key === i.ARROW_RIGHT || e3.key === i.ARROW_UP) ? C.current + t3 : C.current - t3);
4553
+ }, [g2, y2, A]);
4554
+ return useLayoutEffect(() => {
4555
+ k(_2 ? S.current : x2.current);
4556
+ }, [_2]), useEffect(() => {
4557
+ A(m2);
4558
+ }, [m2, A]), { boundsPadding: u3, browsingContext: d3, changePositionOnHover: f3, clip: p3, defaultPosition: m2, disabled: h2, keyboardIncrement: g2, onlyHandleDraggable: _2, portrait: y2, transition: b2, onHandleRootKeyDown: L, onPointerDown: M, onPointerMove: N, onPointerUp: P, onTouchEnd: F, onHandleRootClick: I, canTransition: E, isDragging: w, position: C, setPosition: A, setPositionFromBounds: j, rootRef: x2, handleRootRef: S, interactiveTarget: O };
4559
+ };
4560
+ var p2 = ({ boundsPadding: e3, browsingContext: t3, changePositionOnHover: n2, clip: c3, defaultPosition: l3, disabled: p3, handle: m2, itemOne: h2, itemTwo: g2, keyboardIncrement: _2, onPositionChange: v2, onlyHandleDraggable: y2, portrait: b2, transition: x2, ...S }) => jsx(d, { ...u2({ boundsPadding: e3, browsingContext: t3, changePositionOnHover: n2, clip: c3, defaultPosition: l3, disabled: p3, keyboardIncrement: _2, onPositionChange: v2, onlyHandleDraggable: y2, portrait: b2, transition: x2 }), children: jsxs(x, { ...S, children: [jsx(y, { item: `itemOne`, children: h2 }), jsx(y, { item: `itemTwo`, children: g2 }), jsx(_, { children: m2 || jsx(m, {}) })] }) });
4555
4561
  function ImageCompareNodeComponent(props) {
4556
4562
  const { id, data } = props;
4557
4563
  const nodeData = data;
@@ -4559,13 +4565,13 @@ function ImageCompareNodeComponent(props) {
4559
4565
  const nodes = useWorkflowStore((state) => state.nodes);
4560
4566
  const displayImages = useMemo(() => {
4561
4567
  const connectedImages = [];
4562
- const sortedEdges = edges.filter((edge) => edge.target === id).sort((a, b) => {
4563
- const aTime = a.data?.createdAt || 0;
4564
- const bTime = b.data?.createdAt || 0;
4568
+ const sortedEdges = edges.filter((edge) => edge.target === id).sort((a4, b2) => {
4569
+ const aTime = a4.data?.createdAt || 0;
4570
+ const bTime = b2.data?.createdAt || 0;
4565
4571
  return aTime - bTime;
4566
4572
  });
4567
4573
  sortedEdges.forEach((edge) => {
4568
- const sourceNode = nodes.find((n) => n.id === edge.source);
4574
+ const sourceNode = nodes.find((n2) => n2.id === edge.source);
4569
4575
  if (!sourceNode) return;
4570
4576
  const sourceData = sourceNode.data;
4571
4577
  let image = null;
@@ -4586,10 +4592,10 @@ function ImageCompareNodeComponent(props) {
4586
4592
  const imageB = displayImages[1] || nodeData.imageB || null;
4587
4593
  return /* @__PURE__ */ jsx(BaseNode, { ...props, children: imageA && imageB ? /* @__PURE__ */ jsxs("div", { className: "flex-1 relative nodrag nopan nowheel min-h-[200px]", children: [
4588
4594
  /* @__PURE__ */ jsx(
4589
- se,
4595
+ p2,
4590
4596
  {
4591
4597
  itemOne: /* @__PURE__ */ jsx(
4592
- ae,
4598
+ g,
4593
4599
  {
4594
4600
  src: imageA,
4595
4601
  alt: "Image A",
@@ -4597,7 +4603,7 @@ function ImageCompareNodeComponent(props) {
4597
4603
  }
4598
4604
  ),
4599
4605
  itemTwo: /* @__PURE__ */ jsx(
4600
- ae,
4606
+ g,
4601
4607
  {
4602
4608
  src: imageB,
4603
4609
  alt: "Image B",
@@ -4629,20 +4635,20 @@ function ImageGridSplitNodeComponent(props) {
4629
4635
  const executeNode = useExecutionStore((state) => state.executeNode);
4630
4636
  const [selectedPreview, setSelectedPreview] = useState(null);
4631
4637
  const handleRowsChange = useCallback(
4632
- (e) => {
4638
+ (e3) => {
4633
4639
  const value = Math.min(
4634
4640
  10,
4635
- Math.max(1, Number.parseInt(e.target.value, 10) || 1)
4641
+ Math.max(1, Number.parseInt(e3.target.value, 10) || 1)
4636
4642
  );
4637
4643
  updateNodeData(id, { gridRows: value });
4638
4644
  },
4639
4645
  [id, updateNodeData]
4640
4646
  );
4641
4647
  const handleColsChange = useCallback(
4642
- (e) => {
4648
+ (e3) => {
4643
4649
  const value = Math.min(
4644
4650
  10,
4645
- Math.max(1, Number.parseInt(e.target.value, 10) || 1)
4651
+ Math.max(1, Number.parseInt(e3.target.value, 10) || 1)
4646
4652
  );
4647
4653
  updateNodeData(id, { gridCols: value });
4648
4654
  },
@@ -4690,7 +4696,7 @@ function ImageGridSplitNodeComponent(props) {
4690
4696
  [nodeData.outputImages, nodeData.outputFormat]
4691
4697
  );
4692
4698
  const handleDownloadAll = useCallback(() => {
4693
- nodeData.outputImages.forEach((_, index) => {
4699
+ nodeData.outputImages.forEach((_2, index) => {
4694
4700
  setTimeout(() => handleDownload(index), index * 100);
4695
4701
  });
4696
4702
  }, [nodeData.outputImages, handleDownload]);
@@ -4745,13 +4751,13 @@ function ImageGridSplitNodeComponent(props) {
4745
4751
  gridTemplateColumns: `repeat(${nodeData.gridCols}, 1fr)`,
4746
4752
  gridTemplateRows: `repeat(${nodeData.gridRows}, 1fr)`
4747
4753
  },
4748
- children: Array.from({ length: totalCells }).map((_, i) => /* @__PURE__ */ jsx(
4754
+ children: Array.from({ length: totalCells }).map((_2, i3) => /* @__PURE__ */ jsx(
4749
4755
  "div",
4750
4756
  {
4751
4757
  className: "bg-[var(--primary)]/20 text-[8px] flex items-center justify-center text-[var(--primary)]",
4752
- children: i + 1
4758
+ children: i3 + 1
4753
4759
  },
4754
- i
4760
+ i3
4755
4761
  ))
4756
4762
  }
4757
4763
  )
@@ -4783,7 +4789,7 @@ function ImageGridSplitNodeComponent(props) {
4783
4789
  onValueChange: handleFormatChange,
4784
4790
  children: [
4785
4791
  /* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
4786
- /* @__PURE__ */ jsx(SelectContent, { children: OUTPUT_FORMATS.map((f) => /* @__PURE__ */ jsx(SelectItem, { value: f.value, children: f.label }, f.value)) })
4792
+ /* @__PURE__ */ jsx(SelectContent, { children: OUTPUT_FORMATS.map((f3) => /* @__PURE__ */ jsx(SelectItem, { value: f3.value, children: f3.label }, f3.value)) })
4787
4793
  ]
4788
4794
  }
4789
4795
  )
@@ -4853,8 +4859,8 @@ function ImageGridSplitNodeComponent(props) {
4853
4859
  {
4854
4860
  variant: "ghost",
4855
4861
  size: "icon-sm",
4856
- onClick: (e) => {
4857
- e.stopPropagation();
4862
+ onClick: (e3) => {
4863
+ e3.stopPropagation();
4858
4864
  handleDownload(index);
4859
4865
  },
4860
4866
  className: "h-6 w-6 bg-white/20 hover:bg-white/30",
@@ -4933,7 +4939,7 @@ function OutputGalleryNodeComponent(props) {
4933
4939
  const executionImages = [...nodeData.images || []];
4934
4940
  const connectedImages = [];
4935
4941
  edges.filter((edge) => edge.target === id).forEach((edge) => {
4936
- const sourceNode = nodes.find((n) => n.id === edge.source);
4942
+ const sourceNode = nodes.find((n2) => n2.id === edge.source);
4937
4943
  if (!sourceNode) return;
4938
4944
  const sourceData = sourceNode.data;
4939
4945
  const images = sourceData.outputImages;
@@ -4999,7 +5005,7 @@ function OutputGalleryNodeComponent(props) {
4999
5005
  canvas.height = img.naturalHeight;
5000
5006
  const ctx = canvas.getContext("2d");
5001
5007
  ctx?.drawImage(img, 0, 0);
5002
- canvas.toBlob((b) => resolve(b || blob), "image/png");
5008
+ canvas.toBlob((b2) => resolve(b2 || blob), "image/png");
5003
5009
  };
5004
5010
  img.onerror = () => resolve(blob);
5005
5011
  img.src = image;
@@ -5012,8 +5018,8 @@ function OutputGalleryNodeComponent(props) {
5012
5018
  }, [lightboxIndex]);
5013
5019
  useEffect(() => {
5014
5020
  if (!isLightboxOpen) return;
5015
- const handleKeyDown = (e) => {
5016
- switch (e.key) {
5021
+ const handleKeyDown = (e3) => {
5022
+ switch (e3.key) {
5017
5023
  case "Escape":
5018
5024
  closeLightbox();
5019
5025
  break;
@@ -5051,12 +5057,12 @@ function OutputGalleryNodeComponent(props) {
5051
5057
  {
5052
5058
  className: "fixed inset-0 bg-black/90 z-[100] flex items-center justify-center p-8",
5053
5059
  onClick: closeLightbox,
5054
- onContextMenu: (e) => e.stopPropagation(),
5060
+ onContextMenu: (e3) => e3.stopPropagation(),
5055
5061
  children: /* @__PURE__ */ jsxs(
5056
5062
  "div",
5057
5063
  {
5058
5064
  className: "relative max-w-full max-h-full",
5059
- onClick: (e) => e.stopPropagation(),
5065
+ onClick: (e3) => e3.stopPropagation(),
5060
5066
  children: [
5061
5067
  /* @__PURE__ */ jsx(
5062
5068
  "img",
@@ -5169,8 +5175,8 @@ function ReframeNodeComponent(props) {
5169
5175
  [id, updateNodeData]
5170
5176
  );
5171
5177
  const handlePromptChange = useCallback(
5172
- (e) => {
5173
- updateNodeData(id, { prompt: e.target.value });
5178
+ (e3) => {
5179
+ updateNodeData(id, { prompt: e3.target.value });
5174
5180
  },
5175
5181
  [id, updateNodeData]
5176
5182
  );
@@ -5339,8 +5345,8 @@ function ResizeNodeComponent(props) {
5339
5345
  [id, updateNodeData]
5340
5346
  );
5341
5347
  const handlePromptChange = useCallback(
5342
- (e) => {
5343
- updateNodeData(id, { prompt: e.target.value });
5348
+ (e3) => {
5349
+ updateNodeData(id, { prompt: e3.target.value });
5344
5350
  },
5345
5351
  [id, updateNodeData]
5346
5352
  );
@@ -5489,8 +5495,8 @@ function SubtitleNodeComponent(props) {
5489
5495
  [id, updateNodeData]
5490
5496
  );
5491
5497
  const handleFontColorChange = useCallback(
5492
- (e) => {
5493
- updateNodeData(id, { fontColor: e.target.value });
5498
+ (e3) => {
5499
+ updateNodeData(id, { fontColor: e3.target.value });
5494
5500
  },
5495
5501
  [id, updateNodeData]
5496
5502
  );
@@ -6162,7 +6168,7 @@ function VideoStitchNodeComponent(props) {
6162
6168
  "Input Videos: ",
6163
6169
  inputVideos.length
6164
6170
  ] }),
6165
- inputVideos.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex gap-1 flex-wrap", children: inputVideos.map((_, index) => /* @__PURE__ */ jsx(
6171
+ inputVideos.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex gap-1 flex-wrap", children: inputVideos.map((_2, index) => /* @__PURE__ */ jsx(
6166
6172
  "div",
6167
6173
  {
6168
6174
  className: "w-6 h-6 bg-[var(--primary)]/20 rounded text-xs flex items-center justify-center text-[var(--primary)]",
@@ -6180,7 +6186,7 @@ function VideoStitchNodeComponent(props) {
6180
6186
  onValueChange: handleTransitionChange,
6181
6187
  children: [
6182
6188
  /* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
6183
- /* @__PURE__ */ jsx(SelectContent, { children: TRANSITIONS.map((t) => /* @__PURE__ */ jsx(SelectItem, { value: t.value, children: t.label }, t.value)) })
6189
+ /* @__PURE__ */ jsx(SelectContent, { children: TRANSITIONS.map((t3) => /* @__PURE__ */ jsx(SelectItem, { value: t3.value, children: t3.label }, t3.value)) })
6184
6190
  ]
6185
6191
  }
6186
6192
  )
@@ -6318,15 +6324,15 @@ function VideoTrimNodeComponent(props) {
6318
6324
  const openNodeDetailModal = useUIStore((state) => state.openNodeDetailModal);
6319
6325
  const hasRequiredInputs = !!nodeData.inputVideo;
6320
6326
  const handleStartTimeChange = useCallback(
6321
- (e) => {
6322
- const value = parseTime(e.target.value);
6327
+ (e3) => {
6328
+ const value = parseTime(e3.target.value);
6323
6329
  updateNodeData(id, { startTime: value });
6324
6330
  },
6325
6331
  [id, updateNodeData]
6326
6332
  );
6327
6333
  const handleEndTimeChange = useCallback(
6328
- (e) => {
6329
- const value = parseTime(e.target.value);
6334
+ (e3) => {
6335
+ const value = parseTime(e3.target.value);
6330
6336
  updateNodeData(id, { endTime: value });
6331
6337
  },
6332
6338
  [id, updateNodeData]
@@ -6507,5 +6513,5 @@ var nodeTypes = {
6507
6513
  };
6508
6514
 
6509
6515
  export { AnimationNode, AnnotationNode, AudioInputNode, BaseNode, DownloadNode, ImageCompareNode, ImageGenNode, ImageGridSplitNode, ImageInputNode, LLMNode, LipSyncNode, MotionControlNode, NodeDetailModal, OutputGalleryNode, OutputNode, PromptConstructorNode, PromptNode, ReframeNode, ResizeNode, SubtitleNode, TextToSpeechNode, TranscribeNode, UpscaleNode, VideoFrameExtractNode, VideoGenNode, VideoInputNode, VideoStitchNode, VideoTrimNode, VoiceChangeNode, WorkflowInputNode, WorkflowOutputNode, WorkflowRefNode, nodeTypes, setWorkflowRefApi };
6510
- //# sourceMappingURL=chunk-72UIUFXH.mjs.map
6511
- //# sourceMappingURL=chunk-72UIUFXH.mjs.map
6516
+ //# sourceMappingURL=chunk-55JFUNLR.mjs.map
6517
+ //# sourceMappingURL=chunk-55JFUNLR.mjs.map