@teamflojo/floimg-studio-ui 0.10.2 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1132 -1074
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { create as
|
|
5
|
-
import { useQuery as
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import { memo as de, useRef as re, useCallback as $, useState as E, useEffect as U, useMemo as Z, useContext as qe, useLayoutEffect as pt, createContext as Ge, useDeferredValue as ht, useId as Ce } from "react";
|
|
3
|
+
import ft, { Handle as D, Position as O, applyNodeChanges as gt, applyEdgeChanges as xt, MarkerType as bt, Background as vt, BackgroundVariant as kt, Controls as wt, MiniMap as yt, useReactFlow as Je, ReactFlowProvider as Nt } from "reactflow";
|
|
4
|
+
import { create as Ye } from "zustand";
|
|
5
|
+
import { useQuery as Ne } from "@tanstack/react-query";
|
|
6
|
+
function zt(t, o) {
|
|
7
7
|
let n;
|
|
8
8
|
try {
|
|
9
9
|
n = t();
|
|
@@ -20,12 +20,12 @@ function Nt(t, o) {
|
|
|
20
20
|
removeItem: (a) => n.removeItem(a)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Ee = (t) => (o) => {
|
|
24
24
|
try {
|
|
25
25
|
const n = t(o);
|
|
26
26
|
return n instanceof Promise ? n : {
|
|
27
27
|
then(r) {
|
|
28
|
-
return
|
|
28
|
+
return Ee(r)(n);
|
|
29
29
|
},
|
|
30
30
|
catch(r) {
|
|
31
31
|
return this;
|
|
@@ -37,17 +37,17 @@ const Se = (t) => (o) => {
|
|
|
37
37
|
return this;
|
|
38
38
|
},
|
|
39
39
|
catch(r) {
|
|
40
|
-
return
|
|
40
|
+
return Ee(r)(n);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, Ct = (t, o) => (n, r, a) => {
|
|
45
45
|
let i = {
|
|
46
|
-
storage:
|
|
46
|
+
storage: zt(() => localStorage),
|
|
47
47
|
partialize: (x) => x,
|
|
48
48
|
version: 0,
|
|
49
|
-
merge: (x,
|
|
50
|
-
...
|
|
49
|
+
merge: (x, w) => ({
|
|
50
|
+
...w,
|
|
51
51
|
...x
|
|
52
52
|
}),
|
|
53
53
|
...o
|
|
@@ -71,7 +71,7 @@ const Se = (t) => (o) => {
|
|
|
71
71
|
version: i.version
|
|
72
72
|
});
|
|
73
73
|
}, s = a.setState;
|
|
74
|
-
a.setState = (x,
|
|
74
|
+
a.setState = (x, w) => (s(x, w), u());
|
|
75
75
|
const h = t(
|
|
76
76
|
(...x) => (n(...x), u()),
|
|
77
77
|
r,
|
|
@@ -80,22 +80,22 @@ const Se = (t) => (o) => {
|
|
|
80
80
|
a.getInitialState = () => h;
|
|
81
81
|
let f;
|
|
82
82
|
const v = () => {
|
|
83
|
-
var x,
|
|
83
|
+
var x, w;
|
|
84
84
|
if (!m) return;
|
|
85
85
|
d = !1, p.forEach((b) => {
|
|
86
|
-
var
|
|
87
|
-
return b((
|
|
86
|
+
var C;
|
|
87
|
+
return b((C = r()) != null ? C : h);
|
|
88
88
|
});
|
|
89
|
-
const
|
|
90
|
-
return
|
|
89
|
+
const I = ((w = i.onRehydrateStorage) == null ? void 0 : w.call(i, (x = r()) != null ? x : h)) || void 0;
|
|
90
|
+
return Ee(m.getItem.bind(m))(i.name).then((b) => {
|
|
91
91
|
if (b)
|
|
92
92
|
if (typeof b.version == "number" && b.version !== i.version) {
|
|
93
93
|
if (i.migrate) {
|
|
94
|
-
const
|
|
94
|
+
const C = i.migrate(
|
|
95
95
|
b.state,
|
|
96
96
|
b.version
|
|
97
97
|
);
|
|
98
|
-
return
|
|
98
|
+
return C instanceof Promise ? C.then((N) => [!0, N]) : [!0, C];
|
|
99
99
|
}
|
|
100
100
|
console.error(
|
|
101
101
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
@@ -104,17 +104,17 @@ const Se = (t) => (o) => {
|
|
|
104
104
|
return [!1, b.state];
|
|
105
105
|
return [!1, void 0];
|
|
106
106
|
}).then((b) => {
|
|
107
|
-
var
|
|
108
|
-
const [N,
|
|
107
|
+
var C;
|
|
108
|
+
const [N, k] = b;
|
|
109
109
|
if (f = i.merge(
|
|
110
|
-
|
|
111
|
-
(
|
|
110
|
+
k,
|
|
111
|
+
(C = r()) != null ? C : h
|
|
112
112
|
), n(f, !0), N)
|
|
113
113
|
return u();
|
|
114
114
|
}).then(() => {
|
|
115
|
-
|
|
115
|
+
I == null || I(f, void 0), f = r(), d = !0, c.forEach((b) => b(f));
|
|
116
116
|
}).catch((b) => {
|
|
117
|
-
|
|
117
|
+
I == null || I(void 0, b);
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
120
|
return a.persist = {
|
|
@@ -137,8 +137,8 @@ const Se = (t) => (o) => {
|
|
|
137
137
|
c.delete(x);
|
|
138
138
|
})
|
|
139
139
|
}, i.skipHydration || v(), f || h;
|
|
140
|
-
},
|
|
141
|
-
function
|
|
140
|
+
}, Qe = Ct;
|
|
141
|
+
function It(t, o) {
|
|
142
142
|
var r;
|
|
143
143
|
const n = /* @__PURE__ */ new Map();
|
|
144
144
|
for (const a of t)
|
|
@@ -147,7 +147,7 @@ function Ct(t, o) {
|
|
|
147
147
|
(r = n.get(a.target)) == null || r.add(a.source);
|
|
148
148
|
return n;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function St(t, o) {
|
|
151
151
|
const n = /* @__PURE__ */ new Map();
|
|
152
152
|
for (const c of t)
|
|
153
153
|
if (c.type === "fanout") {
|
|
@@ -157,7 +157,7 @@ function It(t, o) {
|
|
|
157
157
|
mode: m.mode || "count"
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
const r =
|
|
160
|
+
const r = It(t, o), a = /* @__PURE__ */ new Set(), i = [];
|
|
161
161
|
for (; i.length < t.length; ) {
|
|
162
162
|
const c = t.filter((m) => {
|
|
163
163
|
if (a.has(m.id))
|
|
@@ -178,15 +178,15 @@ function It(t, o) {
|
|
|
178
178
|
const m = i[c], u = m.id;
|
|
179
179
|
if (d.set(m.id, u), m.type !== "input") {
|
|
180
180
|
if (m.type === "generator") {
|
|
181
|
-
const s = m.data, h = { ...s.params }, f = o.find((
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
h._promptFromVar = `${N}_${
|
|
181
|
+
const s = m.data, h = { ...s.params }, f = o.find((C) => C.target === m.id && C.targetHandle === "text"), v = f ? d.get(f.source) : void 0, x = f == null ? void 0 : f.sourceHandle, w = x == null ? void 0 : x.match(/^out\[(\d+)\]$/);
|
|
182
|
+
if (w && f && n.has(f.source) && f) {
|
|
183
|
+
const C = parseInt(w[1], 10), N = d.get(f.source);
|
|
184
|
+
h._promptFromVar = `${N}_${C}`;
|
|
185
185
|
} else v && (h._promptFromVar = v, x != null && x.startsWith("output.") && (h._promptFromProperty = x.slice(7)));
|
|
186
|
-
const b = o.filter((
|
|
186
|
+
const b = o.filter((C) => C.target === m.id && C.targetHandle === "references");
|
|
187
187
|
if (b.length > 0) {
|
|
188
|
-
const
|
|
189
|
-
|
|
188
|
+
const C = b.map((N) => d.get(N.source)).filter((N) => N !== void 0);
|
|
189
|
+
C.length > 0 && (h._referenceImageVars = C);
|
|
190
190
|
}
|
|
191
191
|
p.push({
|
|
192
192
|
kind: "generate",
|
|
@@ -198,29 +198,29 @@ function It(t, o) {
|
|
|
198
198
|
const s = m.data, h = s.operation === "composite", f = o.find((N) => N.target !== m.id ? !1 : h ? N.targetHandle === "base" || N.targetHandle === "image" || !N.targetHandle : N.targetHandle === "image" || !N.targetHandle), v = f ? d.get(f.source) : void 0;
|
|
199
199
|
if (!v)
|
|
200
200
|
throw new Error("Transform node requires an input image connection");
|
|
201
|
-
const x = o.find((N) => N.target === m.id && N.targetHandle === "text"),
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
const N =
|
|
201
|
+
const x = o.find((N) => N.target === m.id && N.targetHandle === "text"), w = x ? d.get(x.source) : void 0, I = x == null ? void 0 : x.sourceHandle, b = { ...s.params };
|
|
202
|
+
w && (b._promptFromVar = w, I != null && I.startsWith("output.") && (b._promptFromProperty = I.slice(7)));
|
|
203
|
+
const C = o.filter((N) => N.target === m.id && N.targetHandle === "references");
|
|
204
|
+
if (C.length > 0) {
|
|
205
|
+
const N = C.map((k) => d.get(k.source)).filter((k) => k !== void 0);
|
|
206
206
|
N.length > 0 && (b._referenceImageVars = N);
|
|
207
207
|
}
|
|
208
208
|
if (h) {
|
|
209
|
-
const N = o.filter((
|
|
210
|
-
var
|
|
211
|
-
return
|
|
212
|
-
}).sort((
|
|
213
|
-
var _,
|
|
214
|
-
const
|
|
215
|
-
return
|
|
209
|
+
const N = o.filter((k) => {
|
|
210
|
+
var z;
|
|
211
|
+
return k.target === m.id && ((z = k.targetHandle) == null ? void 0 : z.startsWith("overlays["));
|
|
212
|
+
}).sort((k, z) => {
|
|
213
|
+
var _, M, R, B;
|
|
214
|
+
const S = parseInt(((M = (_ = k.targetHandle) == null ? void 0 : _.match(/\[(\d+)\]/)) == null ? void 0 : M[1]) || "0", 10), g = parseInt(((B = (R = z.targetHandle) == null ? void 0 : R.match(/\[(\d+)\]/)) == null ? void 0 : B[1]) || "0", 10);
|
|
215
|
+
return S - g;
|
|
216
216
|
});
|
|
217
217
|
if (N.length > 0) {
|
|
218
|
-
const
|
|
219
|
-
var _,
|
|
220
|
-
const
|
|
221
|
-
return
|
|
222
|
-
}).filter((
|
|
223
|
-
|
|
218
|
+
const k = N.map((z) => {
|
|
219
|
+
var _, M;
|
|
220
|
+
const S = d.get(z.source), g = parseInt(((M = (_ = z.targetHandle) == null ? void 0 : _.match(/\[(\d+)\]/)) == null ? void 0 : M[1]) || "0", 10);
|
|
221
|
+
return S ? { varName: S, index: g } : null;
|
|
222
|
+
}).filter((z) => z !== null);
|
|
223
|
+
k.length > 0 && (b._overlayImageVars = k);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
p.push({
|
|
@@ -242,15 +242,15 @@ function It(t, o) {
|
|
|
242
242
|
provider: s.provider
|
|
243
243
|
});
|
|
244
244
|
} else if (m.type === "vision") {
|
|
245
|
-
const s = m.data, h = o.find((
|
|
245
|
+
const s = m.data, h = o.find((I) => I.target === m.id && (I.targetHandle === "image" || !I.targetHandle)), f = h ? d.get(h.source) : void 0;
|
|
246
246
|
if (!f)
|
|
247
247
|
throw new Error("Vision node requires an input image connection");
|
|
248
|
-
const v = o.find((
|
|
249
|
-
x && (
|
|
248
|
+
const v = o.find((I) => I.target === m.id && I.targetHandle === "context"), x = v ? d.get(v.source) : void 0, w = { ...s.params };
|
|
249
|
+
x && (w._contextFromVar = x), p.push({
|
|
250
250
|
kind: "vision",
|
|
251
251
|
provider: s.providerName,
|
|
252
252
|
in: f,
|
|
253
|
-
params:
|
|
253
|
+
params: w,
|
|
254
254
|
out: u
|
|
255
255
|
});
|
|
256
256
|
} else if (m.type === "text") {
|
|
@@ -263,7 +263,7 @@ function It(t, o) {
|
|
|
263
263
|
out: u
|
|
264
264
|
});
|
|
265
265
|
} else if (m.type === "fanout") {
|
|
266
|
-
const s = m.data, h = o.find((
|
|
266
|
+
const s = m.data, h = o.find((w) => w.target === m.id), f = h ? d.get(h.source) : void 0, v = s.count || 3, x = Array.from({ length: v }, (w, I) => `${u}_${I}`);
|
|
267
267
|
p.push({
|
|
268
268
|
kind: "fan-out",
|
|
269
269
|
in: f || "",
|
|
@@ -282,12 +282,12 @@ function It(t, o) {
|
|
|
282
282
|
out: u
|
|
283
283
|
});
|
|
284
284
|
} else if (m.type === "router") {
|
|
285
|
-
const s = m.data, h = o.find((
|
|
285
|
+
const s = m.data, h = o.find((I) => I.target === m.id && I.targetHandle === "candidates"), f = o.find((I) => I.target === m.id && I.targetHandle === "selection"), v = h ? d.get(h.source) : void 0, x = f ? d.get(f.source) : void 0, w = s.selectionType === "value" ? "property" : s.selectionType || "index";
|
|
286
286
|
p.push({
|
|
287
287
|
kind: "router",
|
|
288
288
|
in: v || "",
|
|
289
289
|
selectionIn: x || "",
|
|
290
|
-
selectionType:
|
|
290
|
+
selectionType: w,
|
|
291
291
|
selectionProperty: s.selectionProperty || "winner",
|
|
292
292
|
out: u
|
|
293
293
|
});
|
|
@@ -302,8 +302,8 @@ function It(t, o) {
|
|
|
302
302
|
nodeToVar: d
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
const
|
|
306
|
-
async function
|
|
305
|
+
const Q = "/api";
|
|
306
|
+
async function ae(t, o) {
|
|
307
307
|
const n = await fetch(t, {
|
|
308
308
|
...o,
|
|
309
309
|
headers: {
|
|
@@ -317,28 +317,28 @@ async function X(t, o) {
|
|
|
317
317
|
}
|
|
318
318
|
return n.json();
|
|
319
319
|
}
|
|
320
|
-
async function St() {
|
|
321
|
-
return X(`${G}/nodes/generators`);
|
|
322
|
-
}
|
|
323
320
|
async function Lt() {
|
|
324
|
-
return
|
|
321
|
+
return ae(`${Q}/nodes/generators`);
|
|
325
322
|
}
|
|
326
323
|
async function _t() {
|
|
327
|
-
return
|
|
324
|
+
return ae(`${Q}/nodes/transforms`);
|
|
325
|
+
}
|
|
326
|
+
async function Mt() {
|
|
327
|
+
return ae(`${Q}/nodes/text`);
|
|
328
328
|
}
|
|
329
329
|
async function Wt() {
|
|
330
|
-
return
|
|
330
|
+
return ae(`${Q}/nodes/vision`);
|
|
331
331
|
}
|
|
332
|
-
async function
|
|
333
|
-
return
|
|
332
|
+
async function Et(t, o) {
|
|
333
|
+
return ae(`${Q}/export/yaml`, {
|
|
334
334
|
method: "POST",
|
|
335
335
|
body: JSON.stringify({ nodes: t, edges: o })
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
async function
|
|
338
|
+
async function Tt(t) {
|
|
339
339
|
const o = new FormData();
|
|
340
340
|
o.append("file", t);
|
|
341
|
-
const n = await fetch(`${
|
|
341
|
+
const n = await fetch(`${Q}/uploads`, {
|
|
342
342
|
method: "POST",
|
|
343
343
|
body: o
|
|
344
344
|
});
|
|
@@ -348,41 +348,41 @@ async function Et(t) {
|
|
|
348
348
|
}
|
|
349
349
|
return n.json();
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
352
|
-
return
|
|
351
|
+
async function jt() {
|
|
352
|
+
return ae(`${Q}/uploads`);
|
|
353
353
|
}
|
|
354
|
-
async function
|
|
355
|
-
const o = await fetch(`${
|
|
354
|
+
async function $t(t) {
|
|
355
|
+
const o = await fetch(`${Q}/uploads/${t}`, {
|
|
356
356
|
method: "DELETE"
|
|
357
357
|
});
|
|
358
358
|
if (!o.ok)
|
|
359
359
|
throw new Error(`Failed to delete upload: ${o.status}`);
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
return `${
|
|
361
|
+
function Ze(t) {
|
|
362
|
+
return `${Q}/uploads/${t}/blob`;
|
|
363
363
|
}
|
|
364
|
-
async function
|
|
365
|
-
return
|
|
364
|
+
async function At(t) {
|
|
365
|
+
return ae(`${Q}/import`, {
|
|
366
366
|
method: "POST",
|
|
367
367
|
body: JSON.stringify({ yaml: t })
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
async function
|
|
371
|
-
return
|
|
370
|
+
async function Rt(t) {
|
|
371
|
+
return ae(`${Q}/import/validate`, {
|
|
372
372
|
method: "POST",
|
|
373
373
|
body: JSON.stringify({ yaml: t })
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
|
-
async function
|
|
377
|
-
return
|
|
376
|
+
async function Pt(t, o) {
|
|
377
|
+
return ae(`${Q}/validate`, {
|
|
378
378
|
method: "POST",
|
|
379
379
|
body: JSON.stringify({ nodes: t, edges: o })
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
async function
|
|
383
|
-
return
|
|
382
|
+
async function Dt() {
|
|
383
|
+
return ae(`${Q}/generate/status`);
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Xe(t, o, n) {
|
|
386
386
|
const r = new AbortController();
|
|
387
387
|
return (async () => {
|
|
388
388
|
var a;
|
|
@@ -405,7 +405,7 @@ function Ge(t, o, n) {
|
|
|
405
405
|
for (; ; ) {
|
|
406
406
|
const { done: m, value: u } = await d.read();
|
|
407
407
|
if (m) {
|
|
408
|
-
c.trim() &&
|
|
408
|
+
c.trim() && Bt(c, n);
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
c += p.decode(u, { stream: !0 });
|
|
@@ -414,7 +414,7 @@ function Ge(t, o, n) {
|
|
|
414
414
|
`);
|
|
415
415
|
c = s.pop() || "";
|
|
416
416
|
for (const h of s)
|
|
417
|
-
h.trim() &&
|
|
417
|
+
h.trim() && Ot(h, n);
|
|
418
418
|
}
|
|
419
419
|
n.onClose();
|
|
420
420
|
} catch (i) {
|
|
@@ -428,7 +428,7 @@ function Ge(t, o, n) {
|
|
|
428
428
|
abort: () => r.abort()
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Ot(t, o) {
|
|
432
432
|
const n = t.split(`
|
|
433
433
|
`);
|
|
434
434
|
let r = "";
|
|
@@ -447,7 +447,7 @@ function Dt(t, o) {
|
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Bt(t, o) {
|
|
451
451
|
const n = t.split(`
|
|
452
452
|
`);
|
|
453
453
|
let r = "";
|
|
@@ -466,7 +466,7 @@ function Ot(t, o) {
|
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const
|
|
469
|
+
const Vt = [
|
|
470
470
|
// Workflow
|
|
471
471
|
"save",
|
|
472
472
|
"execute",
|
|
@@ -493,7 +493,7 @@ const Bt = [
|
|
|
493
493
|
// User-assignable (no default)
|
|
494
494
|
"cancelExecution",
|
|
495
495
|
"focusSearch"
|
|
496
|
-
],
|
|
496
|
+
], ke = [
|
|
497
497
|
// Workflow shortcuts
|
|
498
498
|
{
|
|
499
499
|
action: "save",
|
|
@@ -670,29 +670,29 @@ const Bt = [
|
|
|
670
670
|
customizable: !0
|
|
671
671
|
}
|
|
672
672
|
];
|
|
673
|
-
function
|
|
673
|
+
function Ut() {
|
|
674
674
|
const t = {};
|
|
675
|
-
for (const o of
|
|
675
|
+
for (const o of ke)
|
|
676
676
|
t[o.action] = o.defaultBinding;
|
|
677
677
|
return t;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Ht() {
|
|
680
680
|
const t = {
|
|
681
681
|
workflow: [],
|
|
682
682
|
editing: [],
|
|
683
683
|
canvas: [],
|
|
684
684
|
ui: []
|
|
685
685
|
};
|
|
686
|
-
for (const o of
|
|
686
|
+
for (const o of ke)
|
|
687
687
|
t[o.category].push(o);
|
|
688
688
|
return t;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
690
|
+
const et = {
|
|
691
691
|
workflow: "Workflow",
|
|
692
692
|
editing: "Editing",
|
|
693
693
|
canvas: "Canvas",
|
|
694
694
|
ui: "Interface"
|
|
695
|
-
},
|
|
695
|
+
}, Ft = [
|
|
696
696
|
"mod+w",
|
|
697
697
|
// Close tab
|
|
698
698
|
"mod+t",
|
|
@@ -725,27 +725,27 @@ const Je = {
|
|
|
725
725
|
// DevTools
|
|
726
726
|
"alt+f4"
|
|
727
727
|
// Close window (Windows)
|
|
728
|
-
],
|
|
728
|
+
], Kt = [
|
|
729
729
|
"delete",
|
|
730
730
|
// Delete selected
|
|
731
731
|
"backspace"
|
|
732
732
|
// Delete selected
|
|
733
733
|
];
|
|
734
|
-
function
|
|
734
|
+
function qt(t) {
|
|
735
735
|
const o = t.toLowerCase().replace(/\s+/g, "");
|
|
736
|
-
return
|
|
736
|
+
return Ft.includes(o);
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return t.toLowerCase().replace(/\s+/g, "").split(",").some((r) =>
|
|
738
|
+
function Gt(t) {
|
|
739
|
+
return t.toLowerCase().replace(/\s+/g, "").split(",").some((r) => Kt.includes(r));
|
|
740
740
|
}
|
|
741
|
-
function
|
|
742
|
-
if (
|
|
741
|
+
function Jt(t, o, n) {
|
|
742
|
+
if (qt(t))
|
|
743
743
|
return {
|
|
744
744
|
hasConflict: !0,
|
|
745
745
|
conflictType: "browser",
|
|
746
746
|
message: "This shortcut is reserved by the browser and cannot be used"
|
|
747
747
|
};
|
|
748
|
-
if (
|
|
748
|
+
if (Gt(t))
|
|
749
749
|
return {
|
|
750
750
|
hasConflict: !0,
|
|
751
751
|
conflictType: "reactflow",
|
|
@@ -758,7 +758,7 @@ function Gt(t, o, n) {
|
|
|
758
758
|
for (const m of p)
|
|
759
759
|
for (const u of c)
|
|
760
760
|
if (m === u) {
|
|
761
|
-
const s =
|
|
761
|
+
const s = ke.find((h) => h.action === a);
|
|
762
762
|
return {
|
|
763
763
|
hasConflict: !0,
|
|
764
764
|
conflictType: "internal",
|
|
@@ -769,7 +769,7 @@ function Gt(t, o, n) {
|
|
|
769
769
|
}
|
|
770
770
|
return { hasConflict: !1 };
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Yt(t) {
|
|
773
773
|
if (!t || t.trim() === "") return !1;
|
|
774
774
|
const o = t.toLowerCase().split("+"), n = ["mod", "ctrl", "control", "alt", "option", "shift", "meta", "cmd", "command"], r = o.filter((i) => !n.includes(i));
|
|
775
775
|
if (r.length === 0) return !1;
|
|
@@ -778,8 +778,8 @@ function Jt(t) {
|
|
|
778
778
|
if (!a.test(i)) return !1;
|
|
779
779
|
return !0;
|
|
780
780
|
}
|
|
781
|
-
const
|
|
782
|
-
function
|
|
781
|
+
const De = "http://localhost:11434", Oe = "http://localhost:1234";
|
|
782
|
+
function Qt(t) {
|
|
783
783
|
const o = {
|
|
784
784
|
shortcuts: {},
|
|
785
785
|
enabled: !0
|
|
@@ -790,7 +790,7 @@ function Yt(t) {
|
|
|
790
790
|
if (n.shortcuts && typeof n.shortcuts == "object") {
|
|
791
791
|
const i = n.shortcuts;
|
|
792
792
|
for (const [d, p] of Object.entries(i)) {
|
|
793
|
-
if (!
|
|
793
|
+
if (!Vt.includes(d)) {
|
|
794
794
|
console.warn(`[Settings] Removing invalid shortcut action: ${d}`);
|
|
795
795
|
continue;
|
|
796
796
|
}
|
|
@@ -798,7 +798,7 @@ function Yt(t) {
|
|
|
798
798
|
console.warn(`[Settings] Removing invalid binding for ${d}: ${p}`);
|
|
799
799
|
continue;
|
|
800
800
|
}
|
|
801
|
-
if (typeof p == "string" && !
|
|
801
|
+
if (typeof p == "string" && !Yt(p)) {
|
|
802
802
|
console.warn(`[Settings] Removing invalid binding format for ${d}: ${p}`);
|
|
803
803
|
continue;
|
|
804
804
|
}
|
|
@@ -810,16 +810,16 @@ function Yt(t) {
|
|
|
810
810
|
enabled: r
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const A = Ye()(
|
|
814
|
+
Qe(
|
|
815
815
|
(t, o) => ({
|
|
816
816
|
ai: {
|
|
817
817
|
ollama: {
|
|
818
|
-
baseUrl:
|
|
818
|
+
baseUrl: De,
|
|
819
819
|
enabled: !1
|
|
820
820
|
},
|
|
821
821
|
lmstudio: {
|
|
822
|
-
baseUrl:
|
|
822
|
+
baseUrl: Oe,
|
|
823
823
|
enabled: !1
|
|
824
824
|
}
|
|
825
825
|
},
|
|
@@ -882,12 +882,12 @@ const $ = Fe()(
|
|
|
882
882
|
}));
|
|
883
883
|
},
|
|
884
884
|
isShortcutConflicting: (n, r) => {
|
|
885
|
-
const { keyboard: a } = o(), i =
|
|
885
|
+
const { keyboard: a } = o(), i = Ut(), d = {};
|
|
886
886
|
for (const [c, m] of Object.entries(i)) {
|
|
887
887
|
const u = a.shortcuts[c];
|
|
888
888
|
u !== void 0 ? d[c] = u : m && (d[c] = m);
|
|
889
889
|
}
|
|
890
|
-
const p =
|
|
890
|
+
const p = Jt(n, d, r);
|
|
891
891
|
return p.hasConflict ? p.message ?? "Conflict detected" : null;
|
|
892
892
|
},
|
|
893
893
|
// Modal controls
|
|
@@ -915,7 +915,7 @@ const $ = Fe()(
|
|
|
915
915
|
getConfiguredProviders: () => {
|
|
916
916
|
var a, i, d, p, c, m, u;
|
|
917
917
|
const { ai: n } = o(), r = {};
|
|
918
|
-
return (a = n.openai) != null && a.enabled && n.openai.apiKey && (r.openai = { apiKey: n.openai.apiKey }), (i = n.anthropic) != null && i.enabled && n.anthropic.apiKey && (r.anthropic = { apiKey: n.anthropic.apiKey }), (d = n.gemini) != null && d.enabled && n.gemini.apiKey && (r.gemini = { apiKey: n.gemini.apiKey }), (p = n.grok) != null && p.enabled && n.grok.apiKey && (r.grok = { apiKey: n.grok.apiKey }), (c = n.openrouter) != null && c.enabled && n.openrouter.apiKey && (r.openrouter = { apiKey: n.openrouter.apiKey }), (m = n.ollama) != null && m.enabled && (r.ollama = { baseUrl: n.ollama.baseUrl ||
|
|
918
|
+
return (a = n.openai) != null && a.enabled && n.openai.apiKey && (r.openai = { apiKey: n.openai.apiKey }), (i = n.anthropic) != null && i.enabled && n.anthropic.apiKey && (r.anthropic = { apiKey: n.anthropic.apiKey }), (d = n.gemini) != null && d.enabled && n.gemini.apiKey && (r.gemini = { apiKey: n.gemini.apiKey }), (p = n.grok) != null && p.enabled && n.grok.apiKey && (r.grok = { apiKey: n.grok.apiKey }), (c = n.openrouter) != null && c.enabled && n.openrouter.apiKey && (r.openrouter = { apiKey: n.openrouter.apiKey }), (m = n.ollama) != null && m.enabled && (r.ollama = { baseUrl: n.ollama.baseUrl || De }), (u = n.lmstudio) != null && u.enabled && (r.lmstudio = { baseUrl: n.lmstudio.baseUrl || Oe }), r;
|
|
919
919
|
}
|
|
920
920
|
}),
|
|
921
921
|
{
|
|
@@ -931,22 +931,22 @@ const $ = Fe()(
|
|
|
931
931
|
return {
|
|
932
932
|
...o,
|
|
933
933
|
ai: (n == null ? void 0 : n.ai) ?? o.ai,
|
|
934
|
-
keyboard:
|
|
934
|
+
keyboard: Qt(n == null ? void 0 : n.keyboard)
|
|
935
935
|
};
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
)
|
|
939
939
|
);
|
|
940
|
-
let
|
|
941
|
-
function
|
|
942
|
-
return `node_${++
|
|
940
|
+
let we = null, xe = null, Zt = 0;
|
|
941
|
+
function be() {
|
|
942
|
+
return `node_${++Zt}`;
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function Be() {
|
|
945
945
|
const t = Date.now(), o = Math.random().toString(36).substring(2, 8);
|
|
946
946
|
return `wf_${t}_${o}`;
|
|
947
947
|
}
|
|
948
|
-
const y =
|
|
949
|
-
|
|
948
|
+
const y = Ye()(
|
|
949
|
+
Qe(
|
|
950
950
|
(t, o) => {
|
|
951
951
|
const n = (r) => {
|
|
952
952
|
if (r.type === "generator") {
|
|
@@ -1035,7 +1035,7 @@ const y = Fe()(
|
|
|
1035
1035
|
},
|
|
1036
1036
|
loadTemplate: (r) => {
|
|
1037
1037
|
const a = /* @__PURE__ */ new Map(), i = r.workflow.nodes.map((p) => {
|
|
1038
|
-
const c =
|
|
1038
|
+
const c = be();
|
|
1039
1039
|
return a.set(p.id, c), {
|
|
1040
1040
|
id: c,
|
|
1041
1041
|
type: p.type,
|
|
@@ -1101,12 +1101,12 @@ const y = Fe()(
|
|
|
1101
1101
|
setVisionProviders: (r) => t({ visionProviders: r }),
|
|
1102
1102
|
addNode: (r, a) => {
|
|
1103
1103
|
var c, m, u;
|
|
1104
|
-
const i =
|
|
1104
|
+
const i = be();
|
|
1105
1105
|
let d;
|
|
1106
1106
|
if (r.type === "generator")
|
|
1107
1107
|
d = {
|
|
1108
1108
|
generatorName: r.name,
|
|
1109
|
-
params:
|
|
1109
|
+
params: ze(r),
|
|
1110
1110
|
isAI: r.isAI,
|
|
1111
1111
|
// Track if this is an AI generator (can accept text input)
|
|
1112
1112
|
acceptsReferenceImages: r.acceptsReferenceImages,
|
|
@@ -1119,7 +1119,7 @@ const y = Fe()(
|
|
|
1119
1119
|
// Track which provider this transform belongs to
|
|
1120
1120
|
isAI: r.isAI,
|
|
1121
1121
|
// Track if this is an AI transform (can accept text input)
|
|
1122
|
-
params:
|
|
1122
|
+
params: ze(r),
|
|
1123
1123
|
acceptsReferenceImages: r.acceptsReferenceImages,
|
|
1124
1124
|
maxReferenceImages: r.maxReferenceImages
|
|
1125
1125
|
};
|
|
@@ -1134,14 +1134,14 @@ const y = Fe()(
|
|
|
1134
1134
|
providerName: r.name,
|
|
1135
1135
|
providerLabel: r.label,
|
|
1136
1136
|
// Human-readable label (e.g., "Gemini Vision")
|
|
1137
|
-
params:
|
|
1137
|
+
params: ze(r)
|
|
1138
1138
|
};
|
|
1139
1139
|
else if (r.type === "text")
|
|
1140
1140
|
d = {
|
|
1141
1141
|
providerName: r.name,
|
|
1142
1142
|
providerLabel: r.label,
|
|
1143
1143
|
// Human-readable label (e.g., "Gemini Text")
|
|
1144
|
-
params:
|
|
1144
|
+
params: ze(r)
|
|
1145
1145
|
};
|
|
1146
1146
|
else {
|
|
1147
1147
|
const s = ((c = r.params) == null ? void 0 : c.properties) || {}, h = ((m = s.provider) == null ? void 0 : m.default) || "filesystem";
|
|
@@ -1177,7 +1177,7 @@ const y = Fe()(
|
|
|
1177
1177
|
duplicateNode: (r) => {
|
|
1178
1178
|
const a = o(), i = a.nodes.find((c) => c.id === r);
|
|
1179
1179
|
if (!i) return;
|
|
1180
|
-
const d =
|
|
1180
|
+
const d = be(), p = {
|
|
1181
1181
|
...i,
|
|
1182
1182
|
id: d,
|
|
1183
1183
|
position: {
|
|
@@ -1230,7 +1230,7 @@ const y = Fe()(
|
|
|
1230
1230
|
targetHandle: p.targetHandle ?? void 0
|
|
1231
1231
|
}));
|
|
1232
1232
|
try {
|
|
1233
|
-
return (await
|
|
1233
|
+
return (await Pt(i, d)).issues;
|
|
1234
1234
|
} catch (p) {
|
|
1235
1235
|
return console.warn("Pre-flight validation failed:", p), [];
|
|
1236
1236
|
}
|
|
@@ -1265,16 +1265,16 @@ const y = Fe()(
|
|
|
1265
1265
|
target: h.target,
|
|
1266
1266
|
sourceHandle: h.sourceHandle ?? void 0,
|
|
1267
1267
|
targetHandle: h.targetHandle ?? void 0
|
|
1268
|
-
})), { pipeline: p, nodeToVar: c } =
|
|
1268
|
+
})), { pipeline: p, nodeToVar: c } = St(i, d), m = {};
|
|
1269
1269
|
for (const h of i)
|
|
1270
1270
|
if (h.type === "input") {
|
|
1271
1271
|
const f = h.data, v = c.get(h.id);
|
|
1272
1272
|
f.uploadId && v && (m[v] = f.uploadId);
|
|
1273
1273
|
}
|
|
1274
|
-
const u =
|
|
1274
|
+
const u = A.getState().getConfiguredProviders(), s = {};
|
|
1275
1275
|
for (const h of r)
|
|
1276
1276
|
s[h.id] = "pending";
|
|
1277
|
-
return
|
|
1277
|
+
return xe = Date.now(), t({
|
|
1278
1278
|
execution: {
|
|
1279
1279
|
status: "running",
|
|
1280
1280
|
imageIds: [],
|
|
@@ -1292,7 +1292,7 @@ const y = Fe()(
|
|
|
1292
1292
|
retryable: void 0
|
|
1293
1293
|
}
|
|
1294
1294
|
}), new Promise((h, f) => {
|
|
1295
|
-
|
|
1295
|
+
we = Xe(
|
|
1296
1296
|
"/api/execute/stream",
|
|
1297
1297
|
{
|
|
1298
1298
|
steps: p.steps,
|
|
@@ -1304,100 +1304,100 @@ const y = Fe()(
|
|
|
1304
1304
|
onMessage: (v) => {
|
|
1305
1305
|
const x = o();
|
|
1306
1306
|
if (v.type, v.type === "execution.step") {
|
|
1307
|
-
const
|
|
1307
|
+
const w = v.data, I = {
|
|
1308
1308
|
...x.execution.nodeStatus,
|
|
1309
|
-
[
|
|
1310
|
-
}, b = x.execution.nodeTiming[
|
|
1311
|
-
let
|
|
1312
|
-
if (
|
|
1313
|
-
|
|
1314
|
-
else if (
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1309
|
+
[w.id]: w.status
|
|
1310
|
+
}, b = x.execution.nodeTiming[w.id] || {};
|
|
1311
|
+
let C = { ...x.execution.nodeTiming };
|
|
1312
|
+
if (w.status === "running")
|
|
1313
|
+
C[w.id] = { startTime: Date.now() };
|
|
1314
|
+
else if (w.status === "completed" || w.status === "error") {
|
|
1315
|
+
const z = b.startTime || Date.now();
|
|
1316
|
+
C[w.id] = {
|
|
1317
1317
|
...b,
|
|
1318
|
-
duration: Date.now() -
|
|
1318
|
+
duration: Date.now() - z
|
|
1319
1319
|
};
|
|
1320
1320
|
}
|
|
1321
|
-
const N =
|
|
1321
|
+
const N = w.preview ? { ...x.execution.previews, [w.id]: w.preview } : x.execution.previews, k = w.dataType && w.content ? {
|
|
1322
1322
|
...x.execution.dataOutputs,
|
|
1323
|
-
[
|
|
1324
|
-
dataType:
|
|
1325
|
-
content:
|
|
1326
|
-
parsed:
|
|
1323
|
+
[w.id]: {
|
|
1324
|
+
dataType: w.dataType,
|
|
1325
|
+
content: w.content,
|
|
1326
|
+
parsed: w.parsed
|
|
1327
1327
|
}
|
|
1328
1328
|
} : x.execution.dataOutputs;
|
|
1329
1329
|
t({
|
|
1330
1330
|
execution: {
|
|
1331
1331
|
...x.execution,
|
|
1332
|
-
nodeStatus:
|
|
1333
|
-
nodeTiming:
|
|
1332
|
+
nodeStatus: I,
|
|
1333
|
+
nodeTiming: C,
|
|
1334
1334
|
previews: N,
|
|
1335
|
-
dataOutputs:
|
|
1335
|
+
dataOutputs: k
|
|
1336
1336
|
}
|
|
1337
1337
|
});
|
|
1338
1338
|
}
|
|
1339
1339
|
if (v.type === "execution.completed") {
|
|
1340
|
-
const
|
|
1341
|
-
for (const N of Object.keys(
|
|
1342
|
-
(
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1340
|
+
const w = { ...x.execution.nodeStatus };
|
|
1341
|
+
for (const N of Object.keys(w))
|
|
1342
|
+
(w[N] === "pending" || w[N] === "running") && (w[N] = "completed");
|
|
1343
|
+
const I = xe ? Date.now() - xe : 0;
|
|
1344
|
+
xe = null;
|
|
1345
1345
|
const b = Object.entries(
|
|
1346
1346
|
x.execution.previews
|
|
1347
|
-
).map(([N,
|
|
1348
|
-
const
|
|
1347
|
+
).map(([N, k]) => {
|
|
1348
|
+
const z = x.nodes.find((_) => _.id === N), S = z == null ? void 0 : z.data;
|
|
1349
1349
|
let g = "Unknown Node";
|
|
1350
|
-
return
|
|
1350
|
+
return S && "generatorName" in S ? g = S.generatorName : S && "operation" in S ? g = S.operation : z != null && z.type && (g = z.type.charAt(0).toUpperCase() + z.type.slice(1)), {
|
|
1351
1351
|
nodeId: N,
|
|
1352
1352
|
nodeName: g,
|
|
1353
|
-
preview:
|
|
1353
|
+
preview: k
|
|
1354
1354
|
};
|
|
1355
|
-
}),
|
|
1355
|
+
}), C = {
|
|
1356
1356
|
id: `run_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`,
|
|
1357
1357
|
timestamp: Date.now(),
|
|
1358
1358
|
status: "completed",
|
|
1359
|
-
duration:
|
|
1359
|
+
duration: I,
|
|
1360
1360
|
nodeCount: x.nodes.length,
|
|
1361
1361
|
outputs: b
|
|
1362
1362
|
};
|
|
1363
|
-
o().addExecutionRun(
|
|
1363
|
+
o().addExecutionRun(C), t({
|
|
1364
1364
|
execution: {
|
|
1365
1365
|
...x.execution,
|
|
1366
1366
|
status: "completed",
|
|
1367
1367
|
imageIds: v.data.imageIds,
|
|
1368
1368
|
imageUrls: v.data.imageUrls,
|
|
1369
|
-
nodeStatus:
|
|
1369
|
+
nodeStatus: w
|
|
1370
1370
|
}
|
|
1371
1371
|
}), h();
|
|
1372
1372
|
}
|
|
1373
1373
|
if (v.type === "execution.error") {
|
|
1374
|
-
const
|
|
1375
|
-
v.data.id && (
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1374
|
+
const w = { ...x.execution.nodeStatus };
|
|
1375
|
+
v.data.id && (w[v.data.id] = "error");
|
|
1376
|
+
const I = xe ? Date.now() - xe : 0;
|
|
1377
|
+
xe = null;
|
|
1378
1378
|
const b = Object.entries(
|
|
1379
1379
|
x.execution.previews
|
|
1380
|
-
).map(([
|
|
1381
|
-
const
|
|
1380
|
+
).map(([k, z]) => {
|
|
1381
|
+
const S = x.nodes.find((M) => M.id === k), g = S == null ? void 0 : S.data;
|
|
1382
1382
|
let _ = "Unknown Node";
|
|
1383
|
-
return g && "generatorName" in g ? _ = g.generatorName : g && "operation" in g ? _ = g.operation :
|
|
1384
|
-
}),
|
|
1383
|
+
return g && "generatorName" in g ? _ = g.generatorName : g && "operation" in g ? _ = g.operation : S != null && S.type && (_ = S.type.charAt(0).toUpperCase() + S.type.slice(1)), { nodeId: k, nodeName: _, preview: z };
|
|
1384
|
+
}), C = {
|
|
1385
1385
|
id: `run_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`,
|
|
1386
1386
|
timestamp: Date.now(),
|
|
1387
1387
|
status: "error",
|
|
1388
|
-
duration:
|
|
1388
|
+
duration: I,
|
|
1389
1389
|
nodeCount: x.nodes.length,
|
|
1390
1390
|
outputs: b,
|
|
1391
1391
|
error: v.data.error,
|
|
1392
1392
|
errorNodeId: v.data.id
|
|
1393
1393
|
};
|
|
1394
|
-
o().addExecutionRun(
|
|
1394
|
+
o().addExecutionRun(C);
|
|
1395
1395
|
const N = v.data.id || x.selectedNodeId;
|
|
1396
1396
|
t({
|
|
1397
1397
|
execution: {
|
|
1398
1398
|
...x.execution,
|
|
1399
1399
|
status: "error",
|
|
1400
|
-
nodeStatus:
|
|
1400
|
+
nodeStatus: w,
|
|
1401
1401
|
error: v.data.error,
|
|
1402
1402
|
errorNodeId: v.data.id,
|
|
1403
1403
|
// Structured error metadata from backend
|
|
@@ -1413,20 +1413,20 @@ const y = Fe()(
|
|
|
1413
1413
|
}
|
|
1414
1414
|
},
|
|
1415
1415
|
onError: (v) => {
|
|
1416
|
-
const x = o(),
|
|
1417
|
-
for (const
|
|
1418
|
-
|
|
1416
|
+
const x = o(), w = {};
|
|
1417
|
+
for (const I of Object.keys(x.execution.nodeStatus))
|
|
1418
|
+
w[I] = "error";
|
|
1419
1419
|
t({
|
|
1420
1420
|
execution: {
|
|
1421
1421
|
...x.execution,
|
|
1422
1422
|
status: "error",
|
|
1423
|
-
nodeStatus:
|
|
1423
|
+
nodeStatus: w,
|
|
1424
1424
|
error: v.message
|
|
1425
1425
|
}
|
|
1426
1426
|
}), f(v);
|
|
1427
1427
|
},
|
|
1428
1428
|
onClose: () => {
|
|
1429
|
-
|
|
1429
|
+
we = null;
|
|
1430
1430
|
const v = o();
|
|
1431
1431
|
v.execution.status === "running" && (t({
|
|
1432
1432
|
execution: {
|
|
@@ -1441,7 +1441,7 @@ const y = Fe()(
|
|
|
1441
1441
|
});
|
|
1442
1442
|
},
|
|
1443
1443
|
cancelExecution: () => {
|
|
1444
|
-
|
|
1444
|
+
we && (we.abort(), we = null), t({
|
|
1445
1445
|
execution: {
|
|
1446
1446
|
status: "idle",
|
|
1447
1447
|
imageIds: [],
|
|
@@ -1466,11 +1466,11 @@ const y = Fe()(
|
|
|
1466
1466
|
sourceHandle: c.sourceHandle ?? void 0,
|
|
1467
1467
|
targetHandle: c.targetHandle ?? void 0
|
|
1468
1468
|
}));
|
|
1469
|
-
return (await
|
|
1469
|
+
return (await Et(i, d)).yaml;
|
|
1470
1470
|
},
|
|
1471
1471
|
importFromYaml: (r, a, i) => {
|
|
1472
1472
|
const d = /* @__PURE__ */ new Map(), p = r.map((m) => {
|
|
1473
|
-
const u =
|
|
1473
|
+
const u = be();
|
|
1474
1474
|
return d.set(m.id, u), {
|
|
1475
1475
|
id: u,
|
|
1476
1476
|
type: m.type,
|
|
@@ -1551,7 +1551,7 @@ const y = Fe()(
|
|
|
1551
1551
|
hasUnsavedChanges: !1
|
|
1552
1552
|
}), d;
|
|
1553
1553
|
} else {
|
|
1554
|
-
const s =
|
|
1554
|
+
const s = Be(), h = {
|
|
1555
1555
|
id: s,
|
|
1556
1556
|
name: r || p,
|
|
1557
1557
|
nodes: a,
|
|
@@ -1635,7 +1635,7 @@ const y = Fe()(
|
|
|
1635
1635
|
duplicateWorkflow: (r) => {
|
|
1636
1636
|
const { savedWorkflows: a } = o(), i = a.find((m) => m.id === r);
|
|
1637
1637
|
if (!i) return "";
|
|
1638
|
-
const d = Date.now(), p =
|
|
1638
|
+
const d = Date.now(), p = Be(), c = {
|
|
1639
1639
|
...i,
|
|
1640
1640
|
id: p,
|
|
1641
1641
|
name: `${i.name} (Copy)`,
|
|
@@ -1645,44 +1645,44 @@ const y = Fe()(
|
|
|
1645
1645
|
return t({ savedWorkflows: [...a, c] }), p;
|
|
1646
1646
|
},
|
|
1647
1647
|
loadGeneratedWorkflow: (r) => {
|
|
1648
|
-
var
|
|
1648
|
+
var w, I;
|
|
1649
1649
|
const a = /* @__PURE__ */ new Map(), i = 300, d = 180, p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
|
|
1650
1650
|
for (const b of r.nodes)
|
|
1651
1651
|
p.set(b.id, []), c.set(b.id, []);
|
|
1652
1652
|
for (const b of r.edges)
|
|
1653
|
-
(
|
|
1653
|
+
(w = p.get(b.target)) == null || w.push(b.source), (I = c.get(b.source)) == null || I.push(b.target);
|
|
1654
1654
|
const m = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set();
|
|
1655
1655
|
function s(b) {
|
|
1656
1656
|
if (m.has(b)) return m.get(b);
|
|
1657
1657
|
if (u.has(b)) return 0;
|
|
1658
1658
|
u.add(b);
|
|
1659
|
-
const
|
|
1660
|
-
if (
|
|
1659
|
+
const C = p.get(b) || [];
|
|
1660
|
+
if (C.length === 0)
|
|
1661
1661
|
return m.set(b, 0), 0;
|
|
1662
|
-
const
|
|
1663
|
-
return m.set(b,
|
|
1662
|
+
const k = Math.max(...C.map(s)) + 1;
|
|
1663
|
+
return m.set(b, k), k;
|
|
1664
1664
|
}
|
|
1665
1665
|
for (const b of r.nodes)
|
|
1666
1666
|
s(b.id);
|
|
1667
1667
|
const h = /* @__PURE__ */ new Map();
|
|
1668
1668
|
for (const b of r.nodes) {
|
|
1669
|
-
const
|
|
1670
|
-
h.has(
|
|
1669
|
+
const C = m.get(b.id) || 0;
|
|
1670
|
+
h.has(C) || h.set(C, []), h.get(C).push(b.id);
|
|
1671
1671
|
}
|
|
1672
1672
|
const f = /* @__PURE__ */ new Map();
|
|
1673
|
-
for (const [b,
|
|
1674
|
-
const N =
|
|
1675
|
-
|
|
1676
|
-
f.set(
|
|
1673
|
+
for (const [b, C] of h) {
|
|
1674
|
+
const N = C.length * d, k = 100 + (N > d ? -N / 4 : 0);
|
|
1675
|
+
C.forEach((z, S) => {
|
|
1676
|
+
f.set(z, {
|
|
1677
1677
|
x: 100 + b * i,
|
|
1678
|
-
y:
|
|
1678
|
+
y: k + S * d
|
|
1679
1679
|
});
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
1682
|
const v = r.nodes.map((b) => {
|
|
1683
|
-
const
|
|
1684
|
-
a.set(b.id,
|
|
1685
|
-
const N = b.nodeType.split(":"),
|
|
1683
|
+
const C = be();
|
|
1684
|
+
a.set(b.id, C);
|
|
1685
|
+
const N = b.nodeType.split(":"), k = f.get(b.id) || { x: 100, y: 100 };
|
|
1686
1686
|
if (N[0] === "flow") {
|
|
1687
1687
|
const g = N[1];
|
|
1688
1688
|
let _;
|
|
@@ -1699,17 +1699,17 @@ const y = Fe()(
|
|
|
1699
1699
|
outputCount: 1,
|
|
1700
1700
|
contextProperty: b.parameters.contextProperty
|
|
1701
1701
|
}, {
|
|
1702
|
-
id:
|
|
1702
|
+
id: C,
|
|
1703
1703
|
type: g,
|
|
1704
|
-
position:
|
|
1704
|
+
position: k,
|
|
1705
1705
|
data: _
|
|
1706
1706
|
};
|
|
1707
1707
|
}
|
|
1708
|
-
const
|
|
1709
|
-
let
|
|
1710
|
-
if (
|
|
1711
|
-
const g = N.slice(1).join(":"), _ = o().generators.find((
|
|
1712
|
-
|
|
1708
|
+
const z = N[0];
|
|
1709
|
+
let S;
|
|
1710
|
+
if (z === "generator") {
|
|
1711
|
+
const g = N.slice(1).join(":"), _ = o().generators.find((M) => M.name === g);
|
|
1712
|
+
S = {
|
|
1713
1713
|
generatorName: g,
|
|
1714
1714
|
params: b.parameters,
|
|
1715
1715
|
isAI: (_ == null ? void 0 : _.isAI) ?? !0,
|
|
@@ -1717,63 +1717,63 @@ const y = Fe()(
|
|
|
1717
1717
|
acceptsReferenceImages: _ == null ? void 0 : _.acceptsReferenceImages,
|
|
1718
1718
|
maxReferenceImages: _ == null ? void 0 : _.maxReferenceImages
|
|
1719
1719
|
};
|
|
1720
|
-
} else if (
|
|
1721
|
-
const g = N[1], _ = N.slice(2).join(":"),
|
|
1720
|
+
} else if (z === "transform") {
|
|
1721
|
+
const g = N[1], _ = N.slice(2).join(":"), M = o().transforms.find(
|
|
1722
1722
|
(R) => R.providerName === g && R.name === _
|
|
1723
1723
|
);
|
|
1724
|
-
|
|
1724
|
+
S = {
|
|
1725
1725
|
operation: _,
|
|
1726
1726
|
providerName: g,
|
|
1727
1727
|
params: b.parameters,
|
|
1728
|
-
isAI:
|
|
1729
|
-
acceptsReferenceImages:
|
|
1730
|
-
maxReferenceImages:
|
|
1728
|
+
isAI: M == null ? void 0 : M.isAI,
|
|
1729
|
+
acceptsReferenceImages: M == null ? void 0 : M.acceptsReferenceImages,
|
|
1730
|
+
maxReferenceImages: M == null ? void 0 : M.maxReferenceImages
|
|
1731
1731
|
};
|
|
1732
|
-
} else if (
|
|
1733
|
-
|
|
1732
|
+
} else if (z === "input")
|
|
1733
|
+
S = {
|
|
1734
1734
|
uploadId: void 0,
|
|
1735
1735
|
filename: void 0,
|
|
1736
1736
|
mime: void 0
|
|
1737
1737
|
};
|
|
1738
|
-
else if (
|
|
1739
|
-
|
|
1738
|
+
else if (z === "vision")
|
|
1739
|
+
S = {
|
|
1740
1740
|
providerName: N.slice(1).join(":"),
|
|
1741
1741
|
params: b.parameters
|
|
1742
1742
|
};
|
|
1743
|
-
else if (
|
|
1744
|
-
const g = N.slice(1).join(":"), _ = b.parameters.jsonSchema,
|
|
1743
|
+
else if (z === "text") {
|
|
1744
|
+
const g = N.slice(1).join(":"), _ = b.parameters.jsonSchema, M = _ != null && _.properties ? {
|
|
1745
1745
|
type: "object",
|
|
1746
1746
|
properties: Object.fromEntries(
|
|
1747
|
-
Object.entries(_.properties).map(([R,
|
|
1747
|
+
Object.entries(_.properties).map(([R, B]) => [
|
|
1748
1748
|
R,
|
|
1749
1749
|
{
|
|
1750
|
-
type:
|
|
1751
|
-
description:
|
|
1750
|
+
type: B.type || "string",
|
|
1751
|
+
description: B.description
|
|
1752
1752
|
}
|
|
1753
1753
|
])
|
|
1754
1754
|
)
|
|
1755
1755
|
} : void 0;
|
|
1756
|
-
|
|
1756
|
+
S = {
|
|
1757
1757
|
providerName: g,
|
|
1758
1758
|
params: b.parameters,
|
|
1759
|
-
outputSchema:
|
|
1759
|
+
outputSchema: M
|
|
1760
1760
|
};
|
|
1761
1761
|
} else
|
|
1762
|
-
|
|
1762
|
+
S = {
|
|
1763
1763
|
destination: b.parameters.destination || "./output/image.png",
|
|
1764
1764
|
provider: b.parameters.provider || "filesystem"
|
|
1765
1765
|
};
|
|
1766
1766
|
return {
|
|
1767
|
-
id:
|
|
1768
|
-
type:
|
|
1769
|
-
position:
|
|
1770
|
-
data:
|
|
1767
|
+
id: C,
|
|
1768
|
+
type: z,
|
|
1769
|
+
position: k,
|
|
1770
|
+
data: S
|
|
1771
1771
|
};
|
|
1772
1772
|
}), x = r.edges.map((b) => {
|
|
1773
|
-
const
|
|
1773
|
+
const C = a.get(b.source) || b.source, N = a.get(b.target) || b.target, k = [b.sourceHandle, b.targetHandle].filter(Boolean).join("_");
|
|
1774
1774
|
return {
|
|
1775
|
-
id:
|
|
1776
|
-
source:
|
|
1775
|
+
id: k ? `edge_${C}_${N}_${k}` : `edge_${C}_${N}`,
|
|
1776
|
+
source: C,
|
|
1777
1777
|
target: N,
|
|
1778
1778
|
sourceHandle: b.sourceHandle ?? void 0,
|
|
1779
1779
|
targetHandle: b.targetHandle ?? void 0
|
|
@@ -1802,7 +1802,7 @@ const y = Fe()(
|
|
|
1802
1802
|
},
|
|
1803
1803
|
loadRemixImage: (r) => {
|
|
1804
1804
|
const i = {
|
|
1805
|
-
id:
|
|
1805
|
+
id: be(),
|
|
1806
1806
|
type: "input",
|
|
1807
1807
|
position: { x: 200, y: 200 },
|
|
1808
1808
|
data: {
|
|
@@ -1833,7 +1833,7 @@ const y = Fe()(
|
|
|
1833
1833
|
},
|
|
1834
1834
|
loadFromWorkflowJson: (r, a) => {
|
|
1835
1835
|
const i = /* @__PURE__ */ new Map(), d = r.nodes.map((c) => {
|
|
1836
|
-
const m =
|
|
1836
|
+
const m = be();
|
|
1837
1837
|
return i.set(c.id, m), {
|
|
1838
1838
|
id: m,
|
|
1839
1839
|
type: c.type,
|
|
@@ -1883,7 +1883,7 @@ const y = Fe()(
|
|
|
1883
1883
|
}
|
|
1884
1884
|
)
|
|
1885
1885
|
);
|
|
1886
|
-
function
|
|
1886
|
+
function ze(t) {
|
|
1887
1887
|
var n;
|
|
1888
1888
|
const o = {};
|
|
1889
1889
|
if ((n = t.params) != null && n.properties)
|
|
@@ -1891,17 +1891,17 @@ function ve(t) {
|
|
|
1891
1891
|
a.default !== void 0 && (o[r] = a.default);
|
|
1892
1892
|
return o;
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function ce(t) {
|
|
1895
1895
|
return t === "pending" ? "floimg-node--pending" : t === "running" ? "floimg-node--running" : t === "completed" ? "floimg-node--completed" : t === "error" ? "floimg-node--error" : "";
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function _e(t) {
|
|
1898
1898
|
if (t < 1e3) return `${t}ms`;
|
|
1899
1899
|
const o = t / 1e3;
|
|
1900
1900
|
if (o < 60) return `${o.toFixed(1)}s`;
|
|
1901
1901
|
const n = Math.floor(o / 60), r = Math.round(o % 60);
|
|
1902
1902
|
return `${n}m ${r}s`;
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1904
|
+
function me({ nodeId: t }) {
|
|
1905
1905
|
const o = y((i) => i.execution.nodeStatus[t]), n = y((i) => i.execution.nodeTiming[t]), [r, a] = E(0);
|
|
1906
1906
|
if (U(() => {
|
|
1907
1907
|
if (o !== "running" || !(n != null && n.startTime))
|
|
@@ -1912,21 +1912,21 @@ function ie({ nodeId: t }) {
|
|
|
1912
1912
|
}, 100);
|
|
1913
1913
|
return () => clearInterval(i);
|
|
1914
1914
|
}, [o, n == null ? void 0 : n.startTime]), o === "running" && (n != null && n.startTime))
|
|
1915
|
-
return /* @__PURE__ */ e("div", { className: "floimg-node__timing floimg-node__timing--running", title: "Running...", children:
|
|
1915
|
+
return /* @__PURE__ */ e("div", { className: "floimg-node__timing floimg-node__timing--running", title: "Running...", children: _e(r) });
|
|
1916
1916
|
if ((o === "completed" || o === "error") && (n != null && n.duration)) {
|
|
1917
1917
|
const i = n.duration > 5e3;
|
|
1918
1918
|
return /* @__PURE__ */ e(
|
|
1919
1919
|
"div",
|
|
1920
1920
|
{
|
|
1921
1921
|
className: `floimg-node__timing ${i ? "floimg-node__timing--slow" : ""}`,
|
|
1922
|
-
title: `Completed in ${
|
|
1923
|
-
children:
|
|
1922
|
+
title: `Completed in ${_e(n.duration)}`,
|
|
1923
|
+
children: _e(n.duration)
|
|
1924
1924
|
}
|
|
1925
1925
|
);
|
|
1926
1926
|
}
|
|
1927
1927
|
return null;
|
|
1928
1928
|
}
|
|
1929
|
-
function
|
|
1929
|
+
function Ae({ nodeId: t, color: o }) {
|
|
1930
1930
|
const n = y((a) => a.previewVisible[t] !== !1), r = y((a) => a.togglePreview);
|
|
1931
1931
|
return /* @__PURE__ */ e(
|
|
1932
1932
|
"button",
|
|
@@ -1956,7 +1956,7 @@ function Me({ nodeId: t, color: o }) {
|
|
|
1956
1956
|
}
|
|
1957
1957
|
);
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function ue({ nodeId: t }) {
|
|
1960
1960
|
const o = y((i) => i.execution.nodeStatus[t]), n = y((i) => i.execution.errorNodeId), r = y((i) => i.execution.error);
|
|
1961
1961
|
return o !== "error" ? null : /* @__PURE__ */ e("div", { className: "floimg-node__error-badge", title: (n === t ? r : "Execution failed") || "Execution failed", children: /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
1962
1962
|
"path",
|
|
@@ -1967,32 +1967,32 @@ function se({ nodeId: t }) {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
) }) });
|
|
1969
1969
|
}
|
|
1970
|
-
const
|
|
1970
|
+
const Xt = de(function({
|
|
1971
1971
|
id: o,
|
|
1972
1972
|
data: n,
|
|
1973
1973
|
selected: r
|
|
1974
1974
|
}) {
|
|
1975
|
-
const a = y((u) => u.execution.previews[o]), i = y((u) => u.execution.nodeStatus[o]), d = y((u) => u.previewVisible[o] !== !1), p =
|
|
1975
|
+
const a = y((u) => u.execution.previews[o]), i = y((u) => u.execution.nodeStatus[o]), d = y((u) => u.previewVisible[o] !== !1), p = ce(i), c = n.isAI, m = n.acceptsReferenceImages;
|
|
1976
1976
|
return /* @__PURE__ */ l(
|
|
1977
1977
|
"div",
|
|
1978
1978
|
{
|
|
1979
1979
|
className: `floimg-node floimg-node--generator relative min-w-[190px] overflow-hidden ${r ? "selected" : ""} ${p}`,
|
|
1980
1980
|
children: [
|
|
1981
1981
|
c && /* @__PURE__ */ e(
|
|
1982
|
-
|
|
1982
|
+
D,
|
|
1983
1983
|
{
|
|
1984
1984
|
type: "target",
|
|
1985
|
-
position:
|
|
1985
|
+
position: O.Top,
|
|
1986
1986
|
id: "text",
|
|
1987
1987
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800",
|
|
1988
1988
|
title: "Text input (optional prompt from text/vision node)"
|
|
1989
1989
|
}
|
|
1990
1990
|
),
|
|
1991
1991
|
m && /* @__PURE__ */ e(
|
|
1992
|
-
|
|
1992
|
+
D,
|
|
1993
1993
|
{
|
|
1994
1994
|
type: "target",
|
|
1995
|
-
position:
|
|
1995
|
+
position: O.Left,
|
|
1996
1996
|
id: "references",
|
|
1997
1997
|
className: "!w-3 !h-3 !bg-violet-500 !border-2 !border-white dark:!border-zinc-800",
|
|
1998
1998
|
style: { top: "50%" },
|
|
@@ -2000,13 +2000,13 @@ const Zt = oe(function({
|
|
|
2000
2000
|
}
|
|
2001
2001
|
),
|
|
2002
2002
|
a && d && /* @__PURE__ */ e("div", { className: "floimg-node__preview", children: /* @__PURE__ */ e("img", { src: a, alt: "Preview", className: "w-full h-20 object-contain rounded-md" }) }),
|
|
2003
|
-
/* @__PURE__ */ e(
|
|
2004
|
-
/* @__PURE__ */ e(
|
|
2003
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2004
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2005
2005
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2006
2006
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-blue-500/10", children: /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full bg-blue-500" }) }),
|
|
2007
2007
|
/* @__PURE__ */ e("span", { className: "floimg-node__title text-blue-600 dark:text-blue-400", children: n.generatorName }),
|
|
2008
2008
|
/* @__PURE__ */ e(
|
|
2009
|
-
|
|
2009
|
+
Ae,
|
|
2010
2010
|
{
|
|
2011
2011
|
nodeId: o,
|
|
2012
2012
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
@@ -2032,59 +2032,59 @@ const Zt = oe(function({
|
|
|
2032
2032
|
] }, u)) })
|
|
2033
2033
|
] }),
|
|
2034
2034
|
/* @__PURE__ */ e(
|
|
2035
|
-
|
|
2035
|
+
D,
|
|
2036
2036
|
{
|
|
2037
2037
|
type: "source",
|
|
2038
|
-
position:
|
|
2038
|
+
position: O.Right,
|
|
2039
2039
|
className: "!w-3 !h-3 !bg-blue-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2040
2040
|
}
|
|
2041
2041
|
)
|
|
2042
2042
|
]
|
|
2043
2043
|
}
|
|
2044
2044
|
);
|
|
2045
|
-
}),
|
|
2045
|
+
}), er = de(function({
|
|
2046
2046
|
id: o,
|
|
2047
2047
|
data: n,
|
|
2048
2048
|
selected: r
|
|
2049
2049
|
}) {
|
|
2050
|
-
const a = y((s) => s.execution.previews[o]), i = y((s) => s.execution.nodeStatus[o]), d = y((s) => s.previewVisible[o] !== !1), p =
|
|
2050
|
+
const a = y((s) => s.execution.previews[o]), i = y((s) => s.execution.nodeStatus[o]), d = y((s) => s.previewVisible[o] !== !1), p = ce(i), c = n.isAI, m = n.acceptsReferenceImages;
|
|
2051
2051
|
return /* @__PURE__ */ l(
|
|
2052
2052
|
"div",
|
|
2053
2053
|
{
|
|
2054
2054
|
className: `floimg-node ${c ? "floimg-node--ai-transform" : "floimg-node--transform"} relative min-w-[190px] overflow-hidden ${r ? "selected" : ""} ${p}`,
|
|
2055
2055
|
children: [
|
|
2056
2056
|
c && /* @__PURE__ */ e(
|
|
2057
|
-
|
|
2057
|
+
D,
|
|
2058
2058
|
{
|
|
2059
2059
|
type: "target",
|
|
2060
|
-
position:
|
|
2060
|
+
position: O.Top,
|
|
2061
2061
|
id: "text",
|
|
2062
2062
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2063
2063
|
title: "Text input (optional prompt from text/vision node)"
|
|
2064
2064
|
}
|
|
2065
2065
|
),
|
|
2066
2066
|
/* @__PURE__ */ e(
|
|
2067
|
-
|
|
2067
|
+
D,
|
|
2068
2068
|
{
|
|
2069
2069
|
type: "target",
|
|
2070
|
-
position:
|
|
2070
|
+
position: O.Left,
|
|
2071
2071
|
id: "image",
|
|
2072
2072
|
className: "!w-3 !h-3 !bg-teal-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2073
2073
|
}
|
|
2074
2074
|
),
|
|
2075
2075
|
m && /* @__PURE__ */ e(
|
|
2076
|
-
|
|
2076
|
+
D,
|
|
2077
2077
|
{
|
|
2078
2078
|
type: "target",
|
|
2079
|
-
position:
|
|
2079
|
+
position: O.Bottom,
|
|
2080
2080
|
id: "references",
|
|
2081
2081
|
className: "!w-3 !h-3 !bg-violet-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2082
2082
|
title: `Reference images (up to ${n.maxReferenceImages || 13})`
|
|
2083
2083
|
}
|
|
2084
2084
|
),
|
|
2085
2085
|
a && d && /* @__PURE__ */ e("div", { className: "floimg-node__preview", children: /* @__PURE__ */ e("img", { src: a, alt: "Preview", className: "w-full h-20 object-contain rounded-md" }) }),
|
|
2086
|
-
/* @__PURE__ */ e(
|
|
2087
|
-
/* @__PURE__ */ e(
|
|
2086
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2087
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2088
2088
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2089
2089
|
/* @__PURE__ */ e("div", { className: `floimg-node__icon ${c ? "bg-indigo-500/10" : "bg-teal-500/10"}`, children: c ? /* @__PURE__ */ l("svg", { className: "w-2.5 h-2.5 text-indigo-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
2090
2090
|
/* @__PURE__ */ e("path", { d: "M13 7H7v6h6V7z" }),
|
|
@@ -2105,7 +2105,7 @@ const Zt = oe(function({
|
|
|
2105
2105
|
}
|
|
2106
2106
|
),
|
|
2107
2107
|
/* @__PURE__ */ e(
|
|
2108
|
-
|
|
2108
|
+
Ae,
|
|
2109
2109
|
{
|
|
2110
2110
|
nodeId: o,
|
|
2111
2111
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
@@ -2131,33 +2131,33 @@ const Zt = oe(function({
|
|
|
2131
2131
|
] }, s)) })
|
|
2132
2132
|
] }),
|
|
2133
2133
|
/* @__PURE__ */ e(
|
|
2134
|
-
|
|
2134
|
+
D,
|
|
2135
2135
|
{
|
|
2136
2136
|
type: "source",
|
|
2137
|
-
position:
|
|
2137
|
+
position: O.Right,
|
|
2138
2138
|
className: `!w-3 !h-3 ${c ? "!bg-indigo-500" : "!bg-teal-500"} !border-2 !border-white dark:!border-zinc-800`
|
|
2139
2139
|
}
|
|
2140
2140
|
)
|
|
2141
2141
|
]
|
|
2142
2142
|
}
|
|
2143
2143
|
);
|
|
2144
|
-
}),
|
|
2145
|
-
const a = y((d) => d.execution.nodeStatus[o]), i =
|
|
2144
|
+
}), tr = de(function({ id: o, data: n, selected: r }) {
|
|
2145
|
+
const a = y((d) => d.execution.nodeStatus[o]), i = ce(a);
|
|
2146
2146
|
return /* @__PURE__ */ l(
|
|
2147
2147
|
"div",
|
|
2148
2148
|
{
|
|
2149
2149
|
className: `floimg-node floimg-node--save relative min-w-[190px] ${r ? "selected" : ""} ${i}`,
|
|
2150
2150
|
children: [
|
|
2151
2151
|
/* @__PURE__ */ e(
|
|
2152
|
-
|
|
2152
|
+
D,
|
|
2153
2153
|
{
|
|
2154
2154
|
type: "target",
|
|
2155
|
-
position:
|
|
2155
|
+
position: O.Left,
|
|
2156
2156
|
className: "!w-3 !h-3 !bg-emerald-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2157
2157
|
}
|
|
2158
2158
|
),
|
|
2159
|
-
/* @__PURE__ */ e(
|
|
2160
|
-
/* @__PURE__ */ e(
|
|
2159
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2160
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2161
2161
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2162
2162
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-emerald-500/10", children: /* @__PURE__ */ e(
|
|
2163
2163
|
"svg",
|
|
@@ -2175,38 +2175,38 @@ const Zt = oe(function({
|
|
|
2175
2175
|
]
|
|
2176
2176
|
}
|
|
2177
2177
|
);
|
|
2178
|
-
}),
|
|
2179
|
-
const a = y((x) => x.execution.previews[o]), i = y((x) => x.execution.nodeStatus[o]), d = y((x) => x.previewVisible[o] !== !1), p = y((x) => x.updateNodeData), c =
|
|
2178
|
+
}), rr = de(function({ id: o, data: n, selected: r }) {
|
|
2179
|
+
const a = y((x) => x.execution.previews[o]), i = y((x) => x.execution.nodeStatus[o]), d = y((x) => x.previewVisible[o] !== !1), p = y((x) => x.updateNodeData), c = re(null), m = ce(i), u = $(
|
|
2180
2180
|
async (x) => {
|
|
2181
2181
|
try {
|
|
2182
|
-
const
|
|
2182
|
+
const w = await Tt(x);
|
|
2183
2183
|
p(o, {
|
|
2184
|
-
uploadId:
|
|
2185
|
-
filename:
|
|
2186
|
-
mime:
|
|
2184
|
+
uploadId: w.id,
|
|
2185
|
+
filename: w.filename,
|
|
2186
|
+
mime: w.mime
|
|
2187
2187
|
});
|
|
2188
|
-
} catch (
|
|
2189
|
-
console.error("Upload failed:",
|
|
2188
|
+
} catch (w) {
|
|
2189
|
+
console.error("Upload failed:", w);
|
|
2190
2190
|
}
|
|
2191
2191
|
},
|
|
2192
2192
|
[o, p]
|
|
2193
|
-
), s =
|
|
2193
|
+
), s = $(
|
|
2194
2194
|
(x) => {
|
|
2195
2195
|
x.preventDefault(), x.stopPropagation();
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2196
|
+
const w = x.dataTransfer.files[0];
|
|
2197
|
+
w && w.type.startsWith("image/") && u(w);
|
|
2198
2198
|
},
|
|
2199
2199
|
[u]
|
|
2200
|
-
), h =
|
|
2200
|
+
), h = $((x) => {
|
|
2201
2201
|
x.preventDefault(), x.stopPropagation();
|
|
2202
|
-
}, []), f =
|
|
2202
|
+
}, []), f = $(
|
|
2203
2203
|
(x) => {
|
|
2204
|
-
var
|
|
2205
|
-
const
|
|
2206
|
-
|
|
2204
|
+
var I;
|
|
2205
|
+
const w = (I = x.target.files) == null ? void 0 : I[0];
|
|
2206
|
+
w && u(w);
|
|
2207
2207
|
},
|
|
2208
2208
|
[u]
|
|
2209
|
-
), v = a || (n.uploadId ?
|
|
2209
|
+
), v = a || (n.uploadId ? Ze(n.uploadId) : null);
|
|
2210
2210
|
return /* @__PURE__ */ l(
|
|
2211
2211
|
"div",
|
|
2212
2212
|
{
|
|
@@ -2218,9 +2218,9 @@ const Zt = oe(function({
|
|
|
2218
2218
|
"div",
|
|
2219
2219
|
{
|
|
2220
2220
|
className: "h-20 flex items-center justify-center cursor-pointer bg-amber-50/50 dark:bg-amber-900/20 hover:bg-amber-100/50 dark:hover:bg-amber-900/30 transition-colors border-b border-amber-100/50 dark:border-amber-800/30",
|
|
2221
|
-
onClick: () => {
|
|
2222
|
-
var
|
|
2223
|
-
|
|
2221
|
+
onClick: (x) => {
|
|
2222
|
+
var w;
|
|
2223
|
+
x.stopPropagation(), (w = c.current) == null || w.click();
|
|
2224
2224
|
},
|
|
2225
2225
|
children: /* @__PURE__ */ l("div", { className: "text-center text-amber-500 dark:text-amber-400", children: [
|
|
2226
2226
|
/* @__PURE__ */ e(
|
|
@@ -2255,8 +2255,8 @@ const Zt = oe(function({
|
|
|
2255
2255
|
onChange: f
|
|
2256
2256
|
}
|
|
2257
2257
|
),
|
|
2258
|
-
/* @__PURE__ */ e(
|
|
2259
|
-
/* @__PURE__ */ e(
|
|
2258
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2259
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2260
2260
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2261
2261
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-amber-500/10", children: /* @__PURE__ */ e(
|
|
2262
2262
|
"svg",
|
|
@@ -2278,7 +2278,7 @@ const Zt = oe(function({
|
|
|
2278
2278
|
) }),
|
|
2279
2279
|
/* @__PURE__ */ e("span", { className: "floimg-node__title text-amber-600 dark:text-amber-400", children: "Input" }),
|
|
2280
2280
|
/* @__PURE__ */ e(
|
|
2281
|
-
|
|
2281
|
+
Ae,
|
|
2282
2282
|
{
|
|
2283
2283
|
nodeId: o,
|
|
2284
2284
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
@@ -2287,17 +2287,17 @@ const Zt = oe(function({
|
|
|
2287
2287
|
] }),
|
|
2288
2288
|
/* @__PURE__ */ e("div", { className: "floimg-node__content", children: /* @__PURE__ */ e("div", { className: "floimg-node__param truncate", children: n.filename || "No image selected" }) }),
|
|
2289
2289
|
/* @__PURE__ */ e(
|
|
2290
|
-
|
|
2290
|
+
D,
|
|
2291
2291
|
{
|
|
2292
2292
|
type: "source",
|
|
2293
|
-
position:
|
|
2293
|
+
position: O.Right,
|
|
2294
2294
|
className: "!w-3 !h-3 !bg-amber-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2295
2295
|
}
|
|
2296
2296
|
)
|
|
2297
2297
|
]
|
|
2298
2298
|
}
|
|
2299
2299
|
);
|
|
2300
|
-
}),
|
|
2300
|
+
}), nr = de(function({
|
|
2301
2301
|
id: o,
|
|
2302
2302
|
data: n,
|
|
2303
2303
|
selected: r
|
|
@@ -2306,27 +2306,27 @@ const Zt = oe(function({
|
|
|
2306
2306
|
const a = y((f) => f.execution.nodeStatus[o]), i = y((f) => {
|
|
2307
2307
|
var v;
|
|
2308
2308
|
return (v = f.execution.dataOutputs) == null ? void 0 : v[o];
|
|
2309
|
-
}), d = y((f) => f.openOutputInspector), p =
|
|
2309
|
+
}), d = y((f) => f.openOutputInspector), p = ce(a), c = (u = n.outputSchema) != null && u.properties ? Object.entries(n.outputSchema.properties) : [], m = c.length > 0;
|
|
2310
2310
|
return /* @__PURE__ */ l(
|
|
2311
2311
|
"div",
|
|
2312
2312
|
{
|
|
2313
2313
|
className: `floimg-node floimg-node--vision relative min-w-[190px] overflow-hidden ${r ? "selected" : ""} ${p}`,
|
|
2314
2314
|
children: [
|
|
2315
2315
|
/* @__PURE__ */ e(
|
|
2316
|
-
|
|
2316
|
+
D,
|
|
2317
2317
|
{
|
|
2318
2318
|
type: "target",
|
|
2319
|
-
position:
|
|
2319
|
+
position: O.Top,
|
|
2320
2320
|
id: "context",
|
|
2321
2321
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2322
2322
|
title: "Context input (optional - from text/vision node for evaluation context)"
|
|
2323
2323
|
}
|
|
2324
2324
|
),
|
|
2325
2325
|
/* @__PURE__ */ e(
|
|
2326
|
-
|
|
2326
|
+
D,
|
|
2327
2327
|
{
|
|
2328
2328
|
type: "target",
|
|
2329
|
-
position:
|
|
2329
|
+
position: O.Left,
|
|
2330
2330
|
id: "image",
|
|
2331
2331
|
className: "!w-3 !h-3 !bg-cyan-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2332
2332
|
title: "Image input"
|
|
@@ -2348,8 +2348,8 @@ const Zt = oe(function({
|
|
|
2348
2348
|
}
|
|
2349
2349
|
)
|
|
2350
2350
|
] }),
|
|
2351
|
-
/* @__PURE__ */ e(
|
|
2352
|
-
/* @__PURE__ */ e(
|
|
2351
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2352
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2353
2353
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2354
2354
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-cyan-500/10", children: /* @__PURE__ */ l("svg", { className: "w-2.5 h-2.5 text-cyan-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
2355
2355
|
/* @__PURE__ */ e("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }),
|
|
@@ -2389,12 +2389,12 @@ const Zt = oe(function({
|
|
|
2389
2389
|
] })
|
|
2390
2390
|
] })
|
|
2391
2391
|
] }),
|
|
2392
|
-
m ? /* @__PURE__ */ l(
|
|
2392
|
+
m ? /* @__PURE__ */ l(X, { children: [
|
|
2393
2393
|
/* @__PURE__ */ e(
|
|
2394
|
-
|
|
2394
|
+
D,
|
|
2395
2395
|
{
|
|
2396
2396
|
type: "source",
|
|
2397
|
-
position:
|
|
2397
|
+
position: O.Right,
|
|
2398
2398
|
id: "output",
|
|
2399
2399
|
className: "!w-3 !h-3 !bg-cyan-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2400
2400
|
style: { top: "50%" },
|
|
@@ -2402,10 +2402,10 @@ const Zt = oe(function({
|
|
|
2402
2402
|
}
|
|
2403
2403
|
),
|
|
2404
2404
|
c.map(([f, v], x) => /* @__PURE__ */ e(
|
|
2405
|
-
|
|
2405
|
+
D,
|
|
2406
2406
|
{
|
|
2407
2407
|
type: "source",
|
|
2408
|
-
position:
|
|
2408
|
+
position: O.Right,
|
|
2409
2409
|
id: `output.${f}`,
|
|
2410
2410
|
className: "!w-2.5 !h-2.5 !bg-cyan-400 !border-2 !border-white dark:!border-zinc-800",
|
|
2411
2411
|
style: {
|
|
@@ -2416,32 +2416,32 @@ const Zt = oe(function({
|
|
|
2416
2416
|
f
|
|
2417
2417
|
))
|
|
2418
2418
|
] }) : /* @__PURE__ */ e(
|
|
2419
|
-
|
|
2419
|
+
D,
|
|
2420
2420
|
{
|
|
2421
2421
|
type: "source",
|
|
2422
|
-
position:
|
|
2422
|
+
position: O.Right,
|
|
2423
2423
|
className: "!w-3 !h-3 !bg-cyan-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2424
2424
|
}
|
|
2425
2425
|
)
|
|
2426
2426
|
]
|
|
2427
2427
|
}
|
|
2428
2428
|
);
|
|
2429
|
-
}),
|
|
2429
|
+
}), or = de(function({ id: o, data: n, selected: r }) {
|
|
2430
2430
|
var u, s, h;
|
|
2431
2431
|
const a = y((f) => f.execution.nodeStatus[o]), i = y((f) => {
|
|
2432
2432
|
var v;
|
|
2433
2433
|
return (v = f.execution.dataOutputs) == null ? void 0 : v[o];
|
|
2434
|
-
}), d = y((f) => f.openOutputInspector), p =
|
|
2434
|
+
}), d = y((f) => f.openOutputInspector), p = ce(a), c = (u = n.outputSchema) != null && u.properties ? Object.entries(n.outputSchema.properties) : [], m = c.length > 0;
|
|
2435
2435
|
return /* @__PURE__ */ l(
|
|
2436
2436
|
"div",
|
|
2437
2437
|
{
|
|
2438
2438
|
className: `floimg-node floimg-node--text relative min-w-[190px] overflow-hidden ${r ? "selected" : ""} ${p}`,
|
|
2439
2439
|
children: [
|
|
2440
2440
|
/* @__PURE__ */ e(
|
|
2441
|
-
|
|
2441
|
+
D,
|
|
2442
2442
|
{
|
|
2443
2443
|
type: "target",
|
|
2444
|
-
position:
|
|
2444
|
+
position: O.Left,
|
|
2445
2445
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2446
2446
|
}
|
|
2447
2447
|
),
|
|
@@ -2461,8 +2461,8 @@ const Zt = oe(function({
|
|
|
2461
2461
|
}
|
|
2462
2462
|
)
|
|
2463
2463
|
] }),
|
|
2464
|
-
/* @__PURE__ */ e(
|
|
2465
|
-
/* @__PURE__ */ e(
|
|
2464
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2465
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2466
2466
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2467
2467
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-pink-500/10", children: /* @__PURE__ */ e("svg", { className: "w-2.5 h-2.5 text-pink-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
2468
2468
|
"path",
|
|
@@ -2499,12 +2499,12 @@ const Zt = oe(function({
|
|
|
2499
2499
|
] })
|
|
2500
2500
|
] })
|
|
2501
2501
|
] }),
|
|
2502
|
-
m ? /* @__PURE__ */ l(
|
|
2502
|
+
m ? /* @__PURE__ */ l(X, { children: [
|
|
2503
2503
|
/* @__PURE__ */ e(
|
|
2504
|
-
|
|
2504
|
+
D,
|
|
2505
2505
|
{
|
|
2506
2506
|
type: "source",
|
|
2507
|
-
position:
|
|
2507
|
+
position: O.Right,
|
|
2508
2508
|
id: "output",
|
|
2509
2509
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2510
2510
|
style: { top: "50%" },
|
|
@@ -2512,10 +2512,10 @@ const Zt = oe(function({
|
|
|
2512
2512
|
}
|
|
2513
2513
|
),
|
|
2514
2514
|
c.map(([f, v], x) => /* @__PURE__ */ e(
|
|
2515
|
-
|
|
2515
|
+
D,
|
|
2516
2516
|
{
|
|
2517
2517
|
type: "source",
|
|
2518
|
-
position:
|
|
2518
|
+
position: O.Right,
|
|
2519
2519
|
id: `output.${f}`,
|
|
2520
2520
|
className: "!w-2.5 !h-2.5 !bg-pink-400 !border-2 !border-white dark:!border-zinc-800",
|
|
2521
2521
|
style: {
|
|
@@ -2526,39 +2526,39 @@ const Zt = oe(function({
|
|
|
2526
2526
|
f
|
|
2527
2527
|
))
|
|
2528
2528
|
] }) : /* @__PURE__ */ e(
|
|
2529
|
-
|
|
2529
|
+
D,
|
|
2530
2530
|
{
|
|
2531
2531
|
type: "source",
|
|
2532
|
-
position:
|
|
2532
|
+
position: O.Right,
|
|
2533
2533
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800"
|
|
2534
2534
|
}
|
|
2535
2535
|
)
|
|
2536
2536
|
]
|
|
2537
2537
|
}
|
|
2538
2538
|
);
|
|
2539
|
-
}),
|
|
2539
|
+
}), ar = de(function({
|
|
2540
2540
|
id: o,
|
|
2541
2541
|
data: n,
|
|
2542
2542
|
selected: r
|
|
2543
2543
|
}) {
|
|
2544
|
-
const a = y((p) => p.execution.nodeStatus[o]), i =
|
|
2544
|
+
const a = y((p) => p.execution.nodeStatus[o]), i = ce(a), d = n.mode === "count" && n.count || 3;
|
|
2545
2545
|
return /* @__PURE__ */ l(
|
|
2546
2546
|
"div",
|
|
2547
2547
|
{
|
|
2548
2548
|
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${i}`,
|
|
2549
2549
|
children: [
|
|
2550
2550
|
/* @__PURE__ */ e(
|
|
2551
|
-
|
|
2551
|
+
D,
|
|
2552
2552
|
{
|
|
2553
2553
|
type: "target",
|
|
2554
|
-
position:
|
|
2554
|
+
position: O.Left,
|
|
2555
2555
|
id: "input",
|
|
2556
2556
|
className: "!w-3 !h-3 !bg-orange-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2557
2557
|
style: { top: "50%" }
|
|
2558
2558
|
}
|
|
2559
2559
|
),
|
|
2560
|
-
/* @__PURE__ */ e(
|
|
2561
|
-
/* @__PURE__ */ e(
|
|
2560
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2561
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2562
2562
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2563
2563
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-orange-500/10", children: /* @__PURE__ */ e(
|
|
2564
2564
|
"svg",
|
|
@@ -2593,10 +2593,10 @@ const Zt = oe(function({
|
|
|
2593
2593
|
" copies"
|
|
2594
2594
|
] }) }) }),
|
|
2595
2595
|
Array.from({ length: d }).map((p, c) => /* @__PURE__ */ e(
|
|
2596
|
-
|
|
2596
|
+
D,
|
|
2597
2597
|
{
|
|
2598
2598
|
type: "source",
|
|
2599
|
-
position:
|
|
2599
|
+
position: O.Right,
|
|
2600
2600
|
id: `out[${c}]`,
|
|
2601
2601
|
className: "!w-2.5 !h-2.5 !bg-orange-400 !border-2 !border-white dark:!border-zinc-800",
|
|
2602
2602
|
style: {
|
|
@@ -2609,22 +2609,22 @@ const Zt = oe(function({
|
|
|
2609
2609
|
]
|
|
2610
2610
|
}
|
|
2611
2611
|
);
|
|
2612
|
-
}),
|
|
2612
|
+
}), ir = de(function({
|
|
2613
2613
|
id: o,
|
|
2614
2614
|
data: n,
|
|
2615
2615
|
selected: r
|
|
2616
2616
|
}) {
|
|
2617
|
-
const a = y((p) => p.execution.nodeStatus[o]), i =
|
|
2617
|
+
const a = y((p) => p.execution.nodeStatus[o]), i = ce(a), d = n.expectedInputs || 3;
|
|
2618
2618
|
return /* @__PURE__ */ l(
|
|
2619
2619
|
"div",
|
|
2620
2620
|
{
|
|
2621
2621
|
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${i}`,
|
|
2622
2622
|
children: [
|
|
2623
2623
|
Array.from({ length: d }).map((p, c) => /* @__PURE__ */ e(
|
|
2624
|
-
|
|
2624
|
+
D,
|
|
2625
2625
|
{
|
|
2626
2626
|
type: "target",
|
|
2627
|
-
position:
|
|
2627
|
+
position: O.Left,
|
|
2628
2628
|
id: `in[${c}]`,
|
|
2629
2629
|
className: "!w-2.5 !h-2.5 !bg-orange-400 !border-2 !border-white dark:!border-zinc-800",
|
|
2630
2630
|
style: {
|
|
@@ -2634,8 +2634,8 @@ const Zt = oe(function({
|
|
|
2634
2634
|
},
|
|
2635
2635
|
c
|
|
2636
2636
|
)),
|
|
2637
|
-
/* @__PURE__ */ e(
|
|
2638
|
-
/* @__PURE__ */ e(
|
|
2637
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2638
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2639
2639
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2640
2640
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-orange-500/10", children: /* @__PURE__ */ e(
|
|
2641
2641
|
"svg",
|
|
@@ -2663,10 +2663,10 @@ const Zt = oe(function({
|
|
|
2663
2663
|
] }),
|
|
2664
2664
|
/* @__PURE__ */ e("div", { className: "floimg-node__content", children: /* @__PURE__ */ e("div", { className: "floimg-node__param", children: n.waitMode === "all" ? "Wait for all" : "Use available" }) }),
|
|
2665
2665
|
/* @__PURE__ */ e(
|
|
2666
|
-
|
|
2666
|
+
D,
|
|
2667
2667
|
{
|
|
2668
2668
|
type: "source",
|
|
2669
|
-
position:
|
|
2669
|
+
position: O.Right,
|
|
2670
2670
|
id: "output",
|
|
2671
2671
|
className: "!w-3 !h-3 !bg-orange-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2672
2672
|
style: { top: "50%" }
|
|
@@ -2675,22 +2675,22 @@ const Zt = oe(function({
|
|
|
2675
2675
|
]
|
|
2676
2676
|
}
|
|
2677
2677
|
);
|
|
2678
|
-
}),
|
|
2678
|
+
}), sr = de(function({
|
|
2679
2679
|
id: o,
|
|
2680
2680
|
data: n,
|
|
2681
2681
|
selected: r
|
|
2682
2682
|
}) {
|
|
2683
|
-
const a = y((p) => p.execution.nodeStatus[o]), i =
|
|
2683
|
+
const a = y((p) => p.execution.nodeStatus[o]), i = ce(a), d = !!n.contextProperty;
|
|
2684
2684
|
return /* @__PURE__ */ l(
|
|
2685
2685
|
"div",
|
|
2686
2686
|
{
|
|
2687
2687
|
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${i}`,
|
|
2688
2688
|
children: [
|
|
2689
2689
|
/* @__PURE__ */ e(
|
|
2690
|
-
|
|
2690
|
+
D,
|
|
2691
2691
|
{
|
|
2692
2692
|
type: "target",
|
|
2693
|
-
position:
|
|
2693
|
+
position: O.Left,
|
|
2694
2694
|
id: "candidates",
|
|
2695
2695
|
className: "!w-3 !h-3 !bg-amber-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2696
2696
|
style: { top: "35%" },
|
|
@@ -2698,18 +2698,18 @@ const Zt = oe(function({
|
|
|
2698
2698
|
}
|
|
2699
2699
|
),
|
|
2700
2700
|
/* @__PURE__ */ e(
|
|
2701
|
-
|
|
2701
|
+
D,
|
|
2702
2702
|
{
|
|
2703
2703
|
type: "target",
|
|
2704
|
-
position:
|
|
2704
|
+
position: O.Left,
|
|
2705
2705
|
id: "selection",
|
|
2706
2706
|
className: "!w-3 !h-3 !bg-cyan-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2707
2707
|
style: { top: "65%" },
|
|
2708
2708
|
title: "Selection (from vision/text)"
|
|
2709
2709
|
}
|
|
2710
2710
|
),
|
|
2711
|
-
/* @__PURE__ */ e(
|
|
2712
|
-
/* @__PURE__ */ e(
|
|
2711
|
+
/* @__PURE__ */ e(ue, { nodeId: o }),
|
|
2712
|
+
/* @__PURE__ */ e(me, { nodeId: o }),
|
|
2713
2713
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2714
2714
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-amber-500/10", children: /* @__PURE__ */ e(
|
|
2715
2715
|
"svg",
|
|
@@ -2749,10 +2749,10 @@ const Zt = oe(function({
|
|
|
2749
2749
|
] }) })
|
|
2750
2750
|
] }),
|
|
2751
2751
|
/* @__PURE__ */ e(
|
|
2752
|
-
|
|
2752
|
+
D,
|
|
2753
2753
|
{
|
|
2754
2754
|
type: "source",
|
|
2755
|
-
position:
|
|
2755
|
+
position: O.Right,
|
|
2756
2756
|
id: "winner",
|
|
2757
2757
|
className: "!w-3 !h-3 !bg-amber-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2758
2758
|
style: { top: d ? "35%" : "50%" },
|
|
@@ -2760,10 +2760,10 @@ const Zt = oe(function({
|
|
|
2760
2760
|
}
|
|
2761
2761
|
),
|
|
2762
2762
|
d && /* @__PURE__ */ e(
|
|
2763
|
-
|
|
2763
|
+
D,
|
|
2764
2764
|
{
|
|
2765
2765
|
type: "source",
|
|
2766
|
-
position:
|
|
2766
|
+
position: O.Right,
|
|
2767
2767
|
id: "context",
|
|
2768
2768
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800",
|
|
2769
2769
|
style: { top: "65%" },
|
|
@@ -2773,22 +2773,22 @@ const Zt = oe(function({
|
|
|
2773
2773
|
]
|
|
2774
2774
|
}
|
|
2775
2775
|
);
|
|
2776
|
-
}),
|
|
2777
|
-
generator:
|
|
2778
|
-
transform:
|
|
2779
|
-
save:
|
|
2780
|
-
input:
|
|
2781
|
-
vision:
|
|
2782
|
-
text:
|
|
2776
|
+
}), lr = {
|
|
2777
|
+
generator: Xt,
|
|
2778
|
+
transform: er,
|
|
2779
|
+
save: tr,
|
|
2780
|
+
input: rr,
|
|
2781
|
+
vision: nr,
|
|
2782
|
+
text: or,
|
|
2783
2783
|
// Iterative workflow nodes
|
|
2784
|
-
fanout:
|
|
2785
|
-
collect:
|
|
2786
|
-
router:
|
|
2787
|
-
},
|
|
2784
|
+
fanout: ar,
|
|
2785
|
+
collect: ir,
|
|
2786
|
+
router: sr
|
|
2787
|
+
}, dr = {
|
|
2788
2788
|
type: "smoothstep",
|
|
2789
2789
|
animated: !1,
|
|
2790
2790
|
markerEnd: {
|
|
2791
|
-
type:
|
|
2791
|
+
type: bt.ArrowClosed,
|
|
2792
2792
|
color: "#71717a",
|
|
2793
2793
|
width: 18,
|
|
2794
2794
|
height: 18
|
|
@@ -2801,56 +2801,56 @@ const Zt = oe(function({
|
|
|
2801
2801
|
// Make edges easier to select
|
|
2802
2802
|
interactionWidth: 20
|
|
2803
2803
|
};
|
|
2804
|
-
function
|
|
2805
|
-
const t = y((f) => f.nodes), o = y((f) => f.edges), n = y((f) => f.setNodes), r = y((f) => f.setEdges), a = y((f) => f.addEdge), i = y((f) => f.setSelectedNode), d =
|
|
2804
|
+
function cr() {
|
|
2805
|
+
const t = y((f) => f.nodes), o = y((f) => f.edges), n = y((f) => f.setNodes), r = y((f) => f.setEdges), a = y((f) => f.addEdge), i = y((f) => f.setSelectedNode), d = Z(() => lr, []), p = $(
|
|
2806
2806
|
(f) => {
|
|
2807
|
-
const { source: v, target: x, targetHandle:
|
|
2807
|
+
const { source: v, target: x, targetHandle: w } = f;
|
|
2808
2808
|
if (!v || !x) return !1;
|
|
2809
|
-
const
|
|
2810
|
-
if (!
|
|
2809
|
+
const I = t.find((C) => C.id === v), b = t.find((C) => C.id === x);
|
|
2810
|
+
if (!I || !b || I.type === "save") return !1;
|
|
2811
2811
|
if (b.type === "generator") {
|
|
2812
|
-
const
|
|
2813
|
-
return !!(
|
|
2812
|
+
const C = b.data;
|
|
2813
|
+
return !!(w === "text" && C.isAI || w === "references" && C.acceptsReferenceImages);
|
|
2814
2814
|
}
|
|
2815
2815
|
return !(b.type === "input" || v === x);
|
|
2816
2816
|
},
|
|
2817
2817
|
[t]
|
|
2818
|
-
), c =
|
|
2818
|
+
), c = $(
|
|
2819
2819
|
(f) => {
|
|
2820
|
-
n(
|
|
2820
|
+
n(gt(f, t));
|
|
2821
2821
|
},
|
|
2822
2822
|
[t, n]
|
|
2823
|
-
), m =
|
|
2823
|
+
), m = $(
|
|
2824
2824
|
(f) => {
|
|
2825
|
-
r(
|
|
2825
|
+
r(xt(f, o));
|
|
2826
2826
|
},
|
|
2827
2827
|
[o, r]
|
|
2828
|
-
), u =
|
|
2828
|
+
), u = $(
|
|
2829
2829
|
(f) => {
|
|
2830
2830
|
if (!(f.targetHandle === "references")) {
|
|
2831
|
-
const x = o.filter((
|
|
2832
|
-
if (
|
|
2833
|
-
const
|
|
2834
|
-
return
|
|
2831
|
+
const x = o.filter((w) => {
|
|
2832
|
+
if (w.target !== f.target) return !1;
|
|
2833
|
+
const I = w.targetHandle || null, b = f.targetHandle || null;
|
|
2834
|
+
return I === b || (f.targetHandle === "text" || f.targetHandle === "image") && !w.targetHandle || !f.targetHandle && w.targetHandle === "image";
|
|
2835
2835
|
});
|
|
2836
2836
|
if (x.length > 0) {
|
|
2837
|
-
const
|
|
2838
|
-
r(o.filter((
|
|
2837
|
+
const w = new Set(x.map((I) => I.id));
|
|
2838
|
+
r(o.filter((I) => !w.has(I.id)));
|
|
2839
2839
|
}
|
|
2840
2840
|
}
|
|
2841
2841
|
a(f);
|
|
2842
2842
|
},
|
|
2843
2843
|
[a, o, r]
|
|
2844
|
-
), s =
|
|
2844
|
+
), s = $(
|
|
2845
2845
|
(f, v) => {
|
|
2846
2846
|
i(v.id);
|
|
2847
2847
|
},
|
|
2848
2848
|
[i]
|
|
2849
|
-
), h =
|
|
2849
|
+
), h = $(() => {
|
|
2850
2850
|
i(null);
|
|
2851
2851
|
}, [i]);
|
|
2852
2852
|
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ l(
|
|
2853
|
-
|
|
2853
|
+
ft,
|
|
2854
2854
|
{
|
|
2855
2855
|
nodes: t,
|
|
2856
2856
|
edges: o,
|
|
@@ -2860,7 +2860,7 @@ function dr() {
|
|
|
2860
2860
|
onNodeClick: s,
|
|
2861
2861
|
onPaneClick: h,
|
|
2862
2862
|
nodeTypes: d,
|
|
2863
|
-
defaultEdgeOptions:
|
|
2863
|
+
defaultEdgeOptions: dr,
|
|
2864
2864
|
isValidConnection: p,
|
|
2865
2865
|
nodesDraggable: !0,
|
|
2866
2866
|
nodesConnectable: !0,
|
|
@@ -2872,10 +2872,10 @@ function dr() {
|
|
|
2872
2872
|
snapToGrid: !0,
|
|
2873
2873
|
snapGrid: [15, 15],
|
|
2874
2874
|
children: [
|
|
2875
|
-
/* @__PURE__ */ e(
|
|
2875
|
+
/* @__PURE__ */ e(vt, { variant: kt.Dots, gap: 20, size: 1.5 }),
|
|
2876
2876
|
/* @__PURE__ */ e(wt, { showInteractive: !1 }),
|
|
2877
2877
|
/* @__PURE__ */ e(
|
|
2878
|
-
|
|
2878
|
+
yt,
|
|
2879
2879
|
{
|
|
2880
2880
|
nodeStrokeWidth: 2,
|
|
2881
2881
|
nodeColor: "#71717a",
|
|
@@ -2888,11 +2888,11 @@ function dr() {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
) });
|
|
2890
2890
|
}
|
|
2891
|
-
function
|
|
2891
|
+
function mr({ onSelect: t }) {
|
|
2892
2892
|
const [o, n] = E([]), [r, a] = E(!0), [i, d] = E(null), p = async () => {
|
|
2893
2893
|
try {
|
|
2894
2894
|
a(!0);
|
|
2895
|
-
const u = await
|
|
2895
|
+
const u = await jt();
|
|
2896
2896
|
n(u), d(null);
|
|
2897
2897
|
} catch (u) {
|
|
2898
2898
|
d(u instanceof Error ? u.message : "Failed to load uploads");
|
|
@@ -2906,7 +2906,7 @@ function cr({ onSelect: t }) {
|
|
|
2906
2906
|
const c = async (u, s) => {
|
|
2907
2907
|
if (s.stopPropagation(), !!confirm("Delete this upload?"))
|
|
2908
2908
|
try {
|
|
2909
|
-
await
|
|
2909
|
+
await $t(u), n((h) => h.filter((f) => f.id !== u));
|
|
2910
2910
|
} catch (h) {
|
|
2911
2911
|
console.error("Failed to delete:", h);
|
|
2912
2912
|
}
|
|
@@ -2930,7 +2930,7 @@ function cr({ onSelect: t }) {
|
|
|
2930
2930
|
/* @__PURE__ */ e(
|
|
2931
2931
|
"img",
|
|
2932
2932
|
{
|
|
2933
|
-
src:
|
|
2933
|
+
src: Ze(u.id),
|
|
2934
2934
|
alt: u.filename,
|
|
2935
2935
|
className: "w-full h-20 object-cover"
|
|
2936
2936
|
}
|
|
@@ -2950,7 +2950,7 @@ function cr({ onSelect: t }) {
|
|
|
2950
2950
|
u.id
|
|
2951
2951
|
)) }) });
|
|
2952
2952
|
}
|
|
2953
|
-
function
|
|
2953
|
+
function se({
|
|
2954
2954
|
definition: t,
|
|
2955
2955
|
colorVariant: o,
|
|
2956
2956
|
onDragStart: n,
|
|
@@ -2998,17 +2998,17 @@ function re({
|
|
|
2998
2998
|
}
|
|
2999
2999
|
);
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3002
|
-
const t = y((g) => g.setGenerators), o = y((g) => g.setTransforms), n = y((g) => g.setTextProviders), r = y((g) => g.setVisionProviders), a = y((g) => g.generators), i = y((g) => g.transforms), d = y((g) => g.textProviders), p = y((g) => g.visionProviders), c = y((g) => g.addNode), [m, u] = E(!1), { data: s } =
|
|
3001
|
+
function ur() {
|
|
3002
|
+
const t = y((g) => g.setGenerators), o = y((g) => g.setTransforms), n = y((g) => g.setTextProviders), r = y((g) => g.setVisionProviders), a = y((g) => g.generators), i = y((g) => g.transforms), d = y((g) => g.textProviders), p = y((g) => g.visionProviders), c = y((g) => g.addNode), [m, u] = E(!1), { data: s } = Ne({
|
|
3003
3003
|
queryKey: ["generators"],
|
|
3004
|
-
queryFn: St
|
|
3005
|
-
}), { data: h } = be({
|
|
3006
|
-
queryKey: ["transforms"],
|
|
3007
3004
|
queryFn: Lt
|
|
3008
|
-
}), { data:
|
|
3009
|
-
queryKey: ["
|
|
3005
|
+
}), { data: h } = Ne({
|
|
3006
|
+
queryKey: ["transforms"],
|
|
3010
3007
|
queryFn: _t
|
|
3011
|
-
}), { data:
|
|
3008
|
+
}), { data: f } = Ne({
|
|
3009
|
+
queryKey: ["textProviders"],
|
|
3010
|
+
queryFn: Mt
|
|
3011
|
+
}), { data: v } = Ne({
|
|
3012
3012
|
queryKey: ["visionProviders"],
|
|
3013
3013
|
queryFn: Wt
|
|
3014
3014
|
});
|
|
@@ -3023,9 +3023,9 @@ function mr() {
|
|
|
3023
3023
|
}, [v, r]);
|
|
3024
3024
|
const x = (g, _) => {
|
|
3025
3025
|
g.dataTransfer.setData("application/json", JSON.stringify(_)), g.dataTransfer.effectAllowed = "move";
|
|
3026
|
-
},
|
|
3026
|
+
}, w = (g) => {
|
|
3027
3027
|
c(g, { x: 250, y: 150 + Math.random() * 100 });
|
|
3028
|
-
},
|
|
3028
|
+
}, I = {
|
|
3029
3029
|
id: "input:upload",
|
|
3030
3030
|
type: "input",
|
|
3031
3031
|
name: "upload",
|
|
@@ -3057,7 +3057,7 @@ function mr() {
|
|
|
3057
3057
|
}
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
},
|
|
3060
|
+
}, C = {
|
|
3061
3061
|
id: "fanout:default",
|
|
3062
3062
|
type: "fanout",
|
|
3063
3063
|
name: "fanout",
|
|
@@ -3116,7 +3116,7 @@ function mr() {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
3118
3118
|
}
|
|
3119
|
-
},
|
|
3119
|
+
}, k = {
|
|
3120
3120
|
id: "router:default",
|
|
3121
3121
|
type: "router",
|
|
3122
3122
|
name: "router",
|
|
@@ -3154,16 +3154,16 @@ function mr() {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
},
|
|
3157
|
+
}, z = a.reduce(
|
|
3158
3158
|
(g, _) => {
|
|
3159
|
-
const
|
|
3160
|
-
return g[
|
|
3159
|
+
const M = _.category || "Other";
|
|
3160
|
+
return g[M] || (g[M] = []), g[M].push(_), g;
|
|
3161
3161
|
},
|
|
3162
3162
|
{}
|
|
3163
|
-
),
|
|
3163
|
+
), S = i.reduce(
|
|
3164
3164
|
(g, _) => {
|
|
3165
|
-
const
|
|
3166
|
-
return g[
|
|
3165
|
+
const M = _.category || "Other";
|
|
3166
|
+
return g[M] || (g[M] = []), g[M].push(_), g;
|
|
3167
3167
|
},
|
|
3168
3168
|
{}
|
|
3169
3169
|
);
|
|
@@ -3186,57 +3186,57 @@ function mr() {
|
|
|
3186
3186
|
)
|
|
3187
3187
|
] }),
|
|
3188
3188
|
/* @__PURE__ */ e(
|
|
3189
|
-
|
|
3189
|
+
se,
|
|
3190
3190
|
{
|
|
3191
|
-
definition:
|
|
3191
|
+
definition: I,
|
|
3192
3192
|
colorVariant: "amber",
|
|
3193
3193
|
onDragStart: x,
|
|
3194
|
-
onDoubleClick:
|
|
3194
|
+
onDoubleClick: w
|
|
3195
3195
|
}
|
|
3196
3196
|
),
|
|
3197
|
-
m && /* @__PURE__ */ e("div", { className: "mt-2 border border-amber-200 dark:border-amber-700 rounded bg-white dark:bg-zinc-900 max-h-64 overflow-y-auto", children: /* @__PURE__ */ e(
|
|
3197
|
+
m && /* @__PURE__ */ e("div", { className: "mt-2 border border-amber-200 dark:border-amber-700 rounded bg-white dark:bg-zinc-900 max-h-64 overflow-y-auto", children: /* @__PURE__ */ e(mr, {}) })
|
|
3198
3198
|
] }),
|
|
3199
3199
|
/* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3200
3200
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-blue-600 dark:!text-blue-400", children: "Generators" }),
|
|
3201
|
-
Object.entries(
|
|
3201
|
+
Object.entries(z).map(([g, _]) => /* @__PURE__ */ l("div", { className: "mb-3", children: [
|
|
3202
3202
|
/* @__PURE__ */ e("div", { className: "floimg-sidebar__category", children: g }),
|
|
3203
|
-
_.map((
|
|
3204
|
-
|
|
3203
|
+
_.map((M) => /* @__PURE__ */ e(
|
|
3204
|
+
se,
|
|
3205
3205
|
{
|
|
3206
|
-
definition:
|
|
3206
|
+
definition: M,
|
|
3207
3207
|
colorVariant: "blue",
|
|
3208
3208
|
onDragStart: x,
|
|
3209
|
-
onDoubleClick:
|
|
3209
|
+
onDoubleClick: w
|
|
3210
3210
|
},
|
|
3211
|
-
|
|
3211
|
+
M.id
|
|
3212
3212
|
))
|
|
3213
3213
|
] }, g))
|
|
3214
3214
|
] }),
|
|
3215
3215
|
/* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3216
3216
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-teal-600 dark:!text-teal-400", children: "Transforms" }),
|
|
3217
|
-
Object.entries(
|
|
3217
|
+
Object.entries(S).map(([g, _]) => /* @__PURE__ */ l("div", { className: "mb-3", children: [
|
|
3218
3218
|
/* @__PURE__ */ e("div", { className: "floimg-sidebar__category", children: g }),
|
|
3219
|
-
_.map((
|
|
3220
|
-
|
|
3219
|
+
_.map((M) => /* @__PURE__ */ e(
|
|
3220
|
+
se,
|
|
3221
3221
|
{
|
|
3222
|
-
definition:
|
|
3222
|
+
definition: M,
|
|
3223
3223
|
colorVariant: "teal",
|
|
3224
3224
|
onDragStart: x,
|
|
3225
|
-
onDoubleClick:
|
|
3225
|
+
onDoubleClick: w
|
|
3226
3226
|
},
|
|
3227
|
-
|
|
3227
|
+
M.id
|
|
3228
3228
|
))
|
|
3229
3229
|
] }, g))
|
|
3230
3230
|
] }),
|
|
3231
3231
|
d.length > 0 && /* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3232
3232
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-pink-600 dark:!text-pink-400", children: "AI Text" }),
|
|
3233
3233
|
d.map((g) => /* @__PURE__ */ e(
|
|
3234
|
-
|
|
3234
|
+
se,
|
|
3235
3235
|
{
|
|
3236
3236
|
definition: g,
|
|
3237
3237
|
colorVariant: "pink",
|
|
3238
3238
|
onDragStart: x,
|
|
3239
|
-
onDoubleClick:
|
|
3239
|
+
onDoubleClick: w
|
|
3240
3240
|
},
|
|
3241
3241
|
g.id
|
|
3242
3242
|
))
|
|
@@ -3244,12 +3244,12 @@ function mr() {
|
|
|
3244
3244
|
p.length > 0 && /* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3245
3245
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-cyan-600 dark:!text-cyan-400", children: "AI Vision" }),
|
|
3246
3246
|
p.map((g) => /* @__PURE__ */ e(
|
|
3247
|
-
|
|
3247
|
+
se,
|
|
3248
3248
|
{
|
|
3249
3249
|
definition: g,
|
|
3250
3250
|
colorVariant: "cyan",
|
|
3251
3251
|
onDragStart: x,
|
|
3252
|
-
onDoubleClick:
|
|
3252
|
+
onDoubleClick: w
|
|
3253
3253
|
},
|
|
3254
3254
|
g.id
|
|
3255
3255
|
))
|
|
@@ -3257,80 +3257,80 @@ function mr() {
|
|
|
3257
3257
|
/* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3258
3258
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-orange-600 dark:!text-orange-400", children: "Flow Control" }),
|
|
3259
3259
|
/* @__PURE__ */ e(
|
|
3260
|
-
|
|
3260
|
+
se,
|
|
3261
3261
|
{
|
|
3262
|
-
definition:
|
|
3262
|
+
definition: C,
|
|
3263
3263
|
colorVariant: "orange",
|
|
3264
3264
|
onDragStart: x,
|
|
3265
|
-
onDoubleClick:
|
|
3265
|
+
onDoubleClick: w
|
|
3266
3266
|
}
|
|
3267
3267
|
),
|
|
3268
3268
|
/* @__PURE__ */ e(
|
|
3269
|
-
|
|
3269
|
+
se,
|
|
3270
3270
|
{
|
|
3271
3271
|
definition: N,
|
|
3272
3272
|
colorVariant: "orange",
|
|
3273
3273
|
onDragStart: x,
|
|
3274
|
-
onDoubleClick:
|
|
3274
|
+
onDoubleClick: w
|
|
3275
3275
|
}
|
|
3276
3276
|
),
|
|
3277
3277
|
/* @__PURE__ */ e(
|
|
3278
|
-
|
|
3278
|
+
se,
|
|
3279
3279
|
{
|
|
3280
|
-
definition:
|
|
3280
|
+
definition: k,
|
|
3281
3281
|
colorVariant: "amber",
|
|
3282
3282
|
onDragStart: x,
|
|
3283
|
-
onDoubleClick:
|
|
3283
|
+
onDoubleClick: w
|
|
3284
3284
|
}
|
|
3285
3285
|
)
|
|
3286
3286
|
] }),
|
|
3287
3287
|
/* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
3288
3288
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-emerald-600 dark:!text-emerald-400", children: "Output" }),
|
|
3289
3289
|
/* @__PURE__ */ e(
|
|
3290
|
-
|
|
3290
|
+
se,
|
|
3291
3291
|
{
|
|
3292
3292
|
definition: b,
|
|
3293
3293
|
colorVariant: "emerald",
|
|
3294
3294
|
onDragStart: x,
|
|
3295
|
-
onDoubleClick:
|
|
3295
|
+
onDoubleClick: w
|
|
3296
3296
|
}
|
|
3297
3297
|
)
|
|
3298
3298
|
] })
|
|
3299
3299
|
] }),
|
|
3300
3300
|
/* @__PURE__ */ e("div", { className: "px-4 py-2 mt-auto border-t border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ l("div", { className: "text-xs text-gray-400 dark:text-zinc-500", children: [
|
|
3301
3301
|
"FloImg Studio v",
|
|
3302
|
-
"0.10.
|
|
3302
|
+
"0.10.4",
|
|
3303
3303
|
!1
|
|
3304
3304
|
] }) })
|
|
3305
3305
|
] });
|
|
3306
3306
|
}
|
|
3307
|
-
function
|
|
3308
|
-
var
|
|
3309
|
-
const t = y((
|
|
3307
|
+
function pr() {
|
|
3308
|
+
var w, I, b, C, N;
|
|
3309
|
+
const t = y((k) => k.selectedNodeId), o = y((k) => k.nodes), n = y((k) => k.generators), r = y((k) => k.transforms), a = y((k) => k.textProviders), i = y((k) => k.visionProviders), d = y((k) => k.updateNodeData), p = y((k) => k.deleteNode), c = y((k) => k.execution), m = o.find((k) => k.id === t), u = ((w = c.validationIssues) == null ? void 0 : w.filter((k) => k.nodeId === t)) || [];
|
|
3310
3310
|
if (!m)
|
|
3311
3311
|
return null;
|
|
3312
3312
|
let s, h = "";
|
|
3313
3313
|
if (m.type === "generator") {
|
|
3314
|
-
const
|
|
3315
|
-
s = (
|
|
3314
|
+
const k = m.data, z = n.find((S) => S.name === k.generatorName);
|
|
3315
|
+
s = (I = z == null ? void 0 : z.params) == null ? void 0 : I.properties, h = (z == null ? void 0 : z.label) || k.generatorName;
|
|
3316
3316
|
} else if (m.type === "transform") {
|
|
3317
|
-
const
|
|
3318
|
-
s = (b =
|
|
3317
|
+
const k = m.data, z = r.find((S) => S.name === k.operation);
|
|
3318
|
+
s = (b = z == null ? void 0 : z.params) == null ? void 0 : b.properties, h = (z == null ? void 0 : z.label) || k.operation;
|
|
3319
3319
|
} else if (m.type === "save") {
|
|
3320
|
-
const
|
|
3321
|
-
h =
|
|
3320
|
+
const z = m.data.provider === "cloud";
|
|
3321
|
+
h = z ? "Save to FloImg Cloud" : "Save", s = {
|
|
3322
3322
|
destination: {
|
|
3323
3323
|
type: "string",
|
|
3324
|
-
title:
|
|
3325
|
-
description:
|
|
3324
|
+
title: z ? "Filename" : "Destination",
|
|
3325
|
+
description: z ? "Filename for cloud storage" : "File path to save the image"
|
|
3326
3326
|
}
|
|
3327
3327
|
};
|
|
3328
3328
|
} else if (m.type === "text") {
|
|
3329
|
-
const
|
|
3330
|
-
s = (
|
|
3329
|
+
const k = m.data, z = a.find((S) => S.name === k.providerName);
|
|
3330
|
+
s = (C = z == null ? void 0 : z.params) == null ? void 0 : C.properties, h = (z == null ? void 0 : z.label) || k.providerName;
|
|
3331
3331
|
} else if (m.type === "vision") {
|
|
3332
|
-
const
|
|
3333
|
-
s = (N =
|
|
3332
|
+
const k = m.data, z = i.find((S) => S.name === k.providerName);
|
|
3333
|
+
s = (N = z == null ? void 0 : z.params) == null ? void 0 : N.properties, h = (z == null ? void 0 : z.label) || k.providerName;
|
|
3334
3334
|
} else m.type === "fanout" ? (h = "Fan-Out", s = {
|
|
3335
3335
|
mode: {
|
|
3336
3336
|
type: "string",
|
|
@@ -3389,63 +3389,63 @@ function ur() {
|
|
|
3389
3389
|
description: "Optional property to pass through (e.g., 'refinement')"
|
|
3390
3390
|
}
|
|
3391
3391
|
});
|
|
3392
|
-
const f = (
|
|
3392
|
+
const f = (k, z) => {
|
|
3393
3393
|
if (m.type === "generator") {
|
|
3394
|
-
const
|
|
3394
|
+
const S = m.data;
|
|
3395
3395
|
d(m.id, {
|
|
3396
|
-
params: { ...
|
|
3396
|
+
params: { ...S.params, [k]: z }
|
|
3397
3397
|
});
|
|
3398
3398
|
} else if (m.type === "transform") {
|
|
3399
|
-
const
|
|
3399
|
+
const S = m.data;
|
|
3400
3400
|
d(m.id, {
|
|
3401
|
-
params: { ...
|
|
3401
|
+
params: { ...S.params, [k]: z }
|
|
3402
3402
|
});
|
|
3403
3403
|
} else if (m.type === "save")
|
|
3404
|
-
d(m.id, { [
|
|
3404
|
+
d(m.id, { [k]: z });
|
|
3405
3405
|
else if (m.type === "text") {
|
|
3406
|
-
const
|
|
3406
|
+
const S = m.data;
|
|
3407
3407
|
d(m.id, {
|
|
3408
|
-
params: { ...
|
|
3408
|
+
params: { ...S.params, [k]: z }
|
|
3409
3409
|
});
|
|
3410
3410
|
} else if (m.type === "vision") {
|
|
3411
|
-
const
|
|
3411
|
+
const S = m.data;
|
|
3412
3412
|
d(m.id, {
|
|
3413
|
-
params: { ...
|
|
3413
|
+
params: { ...S.params, [k]: z }
|
|
3414
3414
|
});
|
|
3415
|
-
} else (m.type === "fanout" || m.type === "collect" || m.type === "router") && d(m.id, { [
|
|
3416
|
-
}, v = (
|
|
3415
|
+
} else (m.type === "fanout" || m.type === "collect" || m.type === "router") && d(m.id, { [k]: z });
|
|
3416
|
+
}, v = (k) => {
|
|
3417
3417
|
if (m.type === "generator")
|
|
3418
|
-
return m.data.params[
|
|
3418
|
+
return m.data.params[k];
|
|
3419
3419
|
if (m.type === "transform")
|
|
3420
|
-
return m.data.params[
|
|
3420
|
+
return m.data.params[k];
|
|
3421
3421
|
if (m.type === "save")
|
|
3422
|
-
return m.data[
|
|
3422
|
+
return m.data[k];
|
|
3423
3423
|
if (m.type === "text")
|
|
3424
|
-
return m.data.params[
|
|
3424
|
+
return m.data.params[k];
|
|
3425
3425
|
if (m.type === "vision")
|
|
3426
|
-
return m.data.params[
|
|
3426
|
+
return m.data.params[k];
|
|
3427
3427
|
if (m.type === "fanout")
|
|
3428
|
-
return m.data[
|
|
3428
|
+
return m.data[k];
|
|
3429
3429
|
if (m.type === "collect")
|
|
3430
|
-
return m.data[
|
|
3430
|
+
return m.data[k];
|
|
3431
3431
|
if (m.type === "router")
|
|
3432
|
-
return m.data[
|
|
3433
|
-
}, x = (
|
|
3432
|
+
return m.data[k];
|
|
3433
|
+
}, x = (k, z) => {
|
|
3434
3434
|
if (m.type === "generator" && m.data.generatorName === "shapes") {
|
|
3435
|
-
const
|
|
3436
|
-
if (
|
|
3437
|
-
if (
|
|
3438
|
-
if (
|
|
3439
|
-
if (
|
|
3440
|
-
if (
|
|
3435
|
+
const S = v("shapeType") || "rectangle", g = v("fillType") || "solid";
|
|
3436
|
+
if (k === "sides") return S === "polygon";
|
|
3437
|
+
if (k === "points" || k === "innerRadius") return S === "star";
|
|
3438
|
+
if (k === "cornerRadius") return S === "rectangle";
|
|
3439
|
+
if (k === "fillColor") return g === "solid";
|
|
3440
|
+
if (k === "gradientType" || k === "gradientColor1" || k === "gradientColor2" || k === "gradientAngle")
|
|
3441
3441
|
return g === "gradient";
|
|
3442
|
-
if (
|
|
3442
|
+
if (k === "patternType" || k === "patternColor" || k === "patternBackground" || k === "patternScale")
|
|
3443
3443
|
return g === "pattern";
|
|
3444
3444
|
}
|
|
3445
3445
|
if (m.type === "fanout") {
|
|
3446
|
-
const
|
|
3447
|
-
if (
|
|
3448
|
-
if (
|
|
3446
|
+
const S = m.data.mode || "count";
|
|
3447
|
+
if (k === "count") return S === "count";
|
|
3448
|
+
if (k === "arrayProperty") return S === "array";
|
|
3449
3449
|
}
|
|
3450
3450
|
return !0;
|
|
3451
3451
|
};
|
|
@@ -3454,19 +3454,19 @@ function ur() {
|
|
|
3454
3454
|
/* @__PURE__ */ e("h2", { className: "floimg-inspector__title", children: h }),
|
|
3455
3455
|
/* @__PURE__ */ e("button", { onClick: () => p(m.id), className: "floimg-inspector__delete", children: "Delete" })
|
|
3456
3456
|
] }),
|
|
3457
|
-
u.length > 0 && /* @__PURE__ */ e(
|
|
3458
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children: s && Object.entries(s).filter(([
|
|
3459
|
-
|
|
3457
|
+
u.length > 0 && /* @__PURE__ */ e(gr, { issues: u }),
|
|
3458
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: s && Object.entries(s).filter(([k, z]) => x(k)).map(([k, z]) => /* @__PURE__ */ e(
|
|
3459
|
+
hr,
|
|
3460
3460
|
{
|
|
3461
|
-
name:
|
|
3462
|
-
field:
|
|
3463
|
-
value: v(
|
|
3464
|
-
onChange: (
|
|
3461
|
+
name: k,
|
|
3462
|
+
field: z,
|
|
3463
|
+
value: v(k),
|
|
3464
|
+
onChange: (S) => f(k, S)
|
|
3465
3465
|
},
|
|
3466
|
-
|
|
3466
|
+
k
|
|
3467
3467
|
)) }),
|
|
3468
3468
|
(m.type === "text" || m.type === "vision") && /* @__PURE__ */ e(
|
|
3469
|
-
|
|
3469
|
+
fr,
|
|
3470
3470
|
{
|
|
3471
3471
|
nodeId: m.id,
|
|
3472
3472
|
outputSchema: m.data.outputSchema,
|
|
@@ -3475,7 +3475,7 @@ function ur() {
|
|
|
3475
3475
|
)
|
|
3476
3476
|
] }) });
|
|
3477
3477
|
}
|
|
3478
|
-
function
|
|
3478
|
+
function hr({ name: t, field: o, value: n, onChange: r }) {
|
|
3479
3479
|
const a = o.title || t;
|
|
3480
3480
|
return o.enum ? /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3481
3481
|
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: a }),
|
|
@@ -3578,7 +3578,7 @@ function pr({ name: t, field: o, value: n, onChange: r }) {
|
|
|
3578
3578
|
o.description && /* @__PURE__ */ e("p", { className: "floimg-field__hint", children: o.description })
|
|
3579
3579
|
] });
|
|
3580
3580
|
}
|
|
3581
|
-
function
|
|
3581
|
+
function fr({ nodeId: t, outputSchema: o, updateNodeData: n }) {
|
|
3582
3582
|
const [r, a] = E(""), i = (o == null ? void 0 : o.properties) || {}, d = Object.entries(i), p = () => {
|
|
3583
3583
|
if (!r.trim()) return;
|
|
3584
3584
|
const s = {
|
|
@@ -3702,7 +3702,7 @@ function hr({ nodeId: t, outputSchema: o, updateNodeData: n }) {
|
|
|
3702
3702
|
d.length > 0 && /* @__PURE__ */ e("p", { className: "mt-3 text-xs text-gray-500 dark:text-zinc-500", children: "Connect from the small pink handles on the right of the node to route individual properties." })
|
|
3703
3703
|
] });
|
|
3704
3704
|
}
|
|
3705
|
-
function
|
|
3705
|
+
function gr({ issues: t }) {
|
|
3706
3706
|
const o = t.filter((r) => r.severity === "error"), n = t.filter((r) => r.severity === "warning");
|
|
3707
3707
|
return /* @__PURE__ */ l("div", { className: "mb-4 space-y-2", children: [
|
|
3708
3708
|
o.map((r, a) => /* @__PURE__ */ e(
|
|
@@ -3782,7 +3782,7 @@ function fr({ issues: t }) {
|
|
|
3782
3782
|
))
|
|
3783
3783
|
] });
|
|
3784
3784
|
}
|
|
3785
|
-
const
|
|
3785
|
+
const tt = ["shift", "alt", "meta", "mod", "ctrl", "control"], xr = {
|
|
3786
3786
|
esc: "escape",
|
|
3787
3787
|
return: "enter",
|
|
3788
3788
|
left: "arrowleft",
|
|
@@ -3800,18 +3800,18 @@ const Ye = ["shift", "alt", "meta", "mod", "ctrl", "control"], gr = {
|
|
|
3800
3800
|
ControlLeft: "ctrl",
|
|
3801
3801
|
ControlRight: "ctrl"
|
|
3802
3802
|
};
|
|
3803
|
-
function
|
|
3804
|
-
return (
|
|
3803
|
+
function fe(t) {
|
|
3804
|
+
return (xr[t.trim()] || t.trim()).toLowerCase().replace(/key|digit|numpad/, "");
|
|
3805
3805
|
}
|
|
3806
|
-
function
|
|
3807
|
-
return
|
|
3806
|
+
function rt(t) {
|
|
3807
|
+
return tt.includes(t);
|
|
3808
3808
|
}
|
|
3809
|
-
function
|
|
3809
|
+
function Me(t, o = ",") {
|
|
3810
3810
|
return t.toLowerCase().split(o);
|
|
3811
3811
|
}
|
|
3812
|
-
function
|
|
3812
|
+
function We(t, o = "+", n = ">", r = !1, a) {
|
|
3813
3813
|
let i = [], d = !1;
|
|
3814
|
-
t = t.trim(), t.includes(n) ? (d = !0, i = t.toLocaleLowerCase().split(n).map((m) =>
|
|
3814
|
+
t = t.trim(), t.includes(n) ? (d = !0, i = t.toLocaleLowerCase().split(n).map((m) => fe(m))) : i = t.toLocaleLowerCase().split(o).map((m) => fe(m));
|
|
3815
3815
|
const p = {
|
|
3816
3816
|
alt: i.includes("alt"),
|
|
3817
3817
|
ctrl: i.includes("ctrl") || i.includes("control"),
|
|
@@ -3819,7 +3819,7 @@ function Ie(t, o = "+", n = ">", r = !1, a) {
|
|
|
3819
3819
|
meta: i.includes("meta"),
|
|
3820
3820
|
mod: i.includes("mod"),
|
|
3821
3821
|
useKey: r
|
|
3822
|
-
}, c = i.filter((m) => !
|
|
3822
|
+
}, c = i.filter((m) => !tt.includes(m));
|
|
3823
3823
|
return {
|
|
3824
3824
|
...p,
|
|
3825
3825
|
keys: c,
|
|
@@ -3829,35 +3829,35 @@ function Ie(t, o = "+", n = ">", r = !1, a) {
|
|
|
3829
3829
|
};
|
|
3830
3830
|
}
|
|
3831
3831
|
typeof document < "u" && (document.addEventListener("keydown", (t) => {
|
|
3832
|
-
t.code !== void 0 &&
|
|
3832
|
+
t.code !== void 0 && nt([fe(t.code)]);
|
|
3833
3833
|
}), document.addEventListener("keyup", (t) => {
|
|
3834
|
-
t.code !== void 0 &&
|
|
3834
|
+
t.code !== void 0 && ot([fe(t.code)]);
|
|
3835
3835
|
})), typeof window < "u" && (window.addEventListener("blur", () => {
|
|
3836
|
-
|
|
3836
|
+
le.clear();
|
|
3837
3837
|
}), window.addEventListener("contextmenu", () => {
|
|
3838
3838
|
setTimeout(() => {
|
|
3839
|
-
|
|
3839
|
+
le.clear();
|
|
3840
3840
|
}, 0);
|
|
3841
3841
|
}));
|
|
3842
|
-
const
|
|
3843
|
-
function
|
|
3842
|
+
const le = /* @__PURE__ */ new Set();
|
|
3843
|
+
function Re(t) {
|
|
3844
3844
|
return Array.isArray(t);
|
|
3845
3845
|
}
|
|
3846
|
-
function
|
|
3847
|
-
return (
|
|
3846
|
+
function br(t, o = ",") {
|
|
3847
|
+
return (Re(t) ? t : t.split(o)).every((n) => le.has(n.trim().toLowerCase()));
|
|
3848
3848
|
}
|
|
3849
|
-
function
|
|
3849
|
+
function nt(t) {
|
|
3850
3850
|
const o = Array.isArray(t) ? t : [t];
|
|
3851
|
-
|
|
3851
|
+
le.has("meta") && le.forEach((n) => !rt(n) && le.delete(n.toLowerCase())), o.forEach((n) => le.add(n.toLowerCase()));
|
|
3852
3852
|
}
|
|
3853
|
-
function
|
|
3853
|
+
function ot(t) {
|
|
3854
3854
|
const o = Array.isArray(t) ? t : [t];
|
|
3855
|
-
t === "meta" ?
|
|
3855
|
+
t === "meta" ? le.clear() : o.forEach((n) => le.delete(n.toLowerCase()));
|
|
3856
3856
|
}
|
|
3857
|
-
function
|
|
3857
|
+
function vr(t, o, n) {
|
|
3858
3858
|
(typeof n == "function" && n(t, o) || n === !0) && t.preventDefault();
|
|
3859
3859
|
}
|
|
3860
|
-
function
|
|
3860
|
+
function kr(t, o, n) {
|
|
3861
3861
|
return typeof n == "function" ? n(t, o) : n === !0 || n === void 0;
|
|
3862
3862
|
}
|
|
3863
3863
|
const wr = [
|
|
@@ -3874,44 +3874,44 @@ const wr = [
|
|
|
3874
3874
|
"radio",
|
|
3875
3875
|
"textbox"
|
|
3876
3876
|
];
|
|
3877
|
-
function
|
|
3878
|
-
return
|
|
3877
|
+
function yr(t) {
|
|
3878
|
+
return at(t, wr);
|
|
3879
3879
|
}
|
|
3880
|
-
function
|
|
3880
|
+
function at(t, o = !1) {
|
|
3881
3881
|
const { target: n, composed: r } = t;
|
|
3882
3882
|
let a, i;
|
|
3883
|
-
return
|
|
3883
|
+
return Nr(n) && r ? (a = t.composedPath()[0] && t.composedPath()[0].tagName, i = t.composedPath()[0] && t.composedPath()[0].role) : (a = n && n.tagName, i = n && n.role), Re(o) ? !!(a && o && o.some((d) => d.toLowerCase() === a.toLowerCase() || d === i)) : !!(a && o && o);
|
|
3884
3884
|
}
|
|
3885
|
-
function
|
|
3885
|
+
function Nr(t) {
|
|
3886
3886
|
return !!t.tagName && !t.tagName.startsWith("-") && t.tagName.includes("-");
|
|
3887
3887
|
}
|
|
3888
|
-
function
|
|
3888
|
+
function zr(t, o) {
|
|
3889
3889
|
return t.length === 0 && o ? (console.warn(
|
|
3890
3890
|
'A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'
|
|
3891
3891
|
), !0) : o ? t.some((n) => o.includes(n)) || t.includes("*") : !0;
|
|
3892
3892
|
}
|
|
3893
|
-
const
|
|
3894
|
-
const { alt: r, meta: a, mod: i, shift: d, ctrl: p, keys: c, useKey: m } = o, { code: u, key: s, ctrlKey: h, metaKey: f, shiftKey: v, altKey: x } = t,
|
|
3893
|
+
const Cr = (t, o, n = !1) => {
|
|
3894
|
+
const { alt: r, meta: a, mod: i, shift: d, ctrl: p, keys: c, useKey: m } = o, { code: u, key: s, ctrlKey: h, metaKey: f, shiftKey: v, altKey: x } = t, w = fe(u);
|
|
3895
3895
|
if (m && (c == null ? void 0 : c.length) === 1 && c.includes(s))
|
|
3896
3896
|
return !0;
|
|
3897
|
-
if (!(c != null && c.includes(
|
|
3897
|
+
if (!(c != null && c.includes(w)) && !["ctrl", "control", "unknown", "meta", "alt", "shift", "os"].includes(w))
|
|
3898
3898
|
return !1;
|
|
3899
3899
|
if (!n) {
|
|
3900
|
-
if (r !== x &&
|
|
3900
|
+
if (r !== x && w !== "alt" || d !== v && w !== "shift")
|
|
3901
3901
|
return !1;
|
|
3902
3902
|
if (i) {
|
|
3903
3903
|
if (!f && !h)
|
|
3904
3904
|
return !1;
|
|
3905
|
-
} else if (a !== f &&
|
|
3905
|
+
} else if (a !== f && w !== "meta" && w !== "os" || p !== h && w !== "ctrl" && w !== "control")
|
|
3906
3906
|
return !1;
|
|
3907
3907
|
}
|
|
3908
|
-
return c && c.length === 1 && c.includes(
|
|
3909
|
-
},
|
|
3910
|
-
function
|
|
3908
|
+
return c && c.length === 1 && c.includes(w) ? !0 : c ? br(c) : !c;
|
|
3909
|
+
}, Ir = Ge(void 0), Sr = () => qe(Ir);
|
|
3910
|
+
function it(t, o) {
|
|
3911
3911
|
return t && o && typeof t == "object" && typeof o == "object" ? Object.keys(t).length === Object.keys(o).length && // @ts-expect-error TS7053
|
|
3912
|
-
Object.keys(t).reduce((n, r) => n &&
|
|
3912
|
+
Object.keys(t).reduce((n, r) => n && it(t[r], o[r]), !0) : t === o;
|
|
3913
3913
|
}
|
|
3914
|
-
const
|
|
3914
|
+
const Lr = Ge({
|
|
3915
3915
|
hotkeys: [],
|
|
3916
3916
|
activeScopes: [],
|
|
3917
3917
|
// This array has to be empty instead of containing '*' as default, to check if the provider is set or not
|
|
@@ -3921,42 +3921,42 @@ const Sr = Ue({
|
|
|
3921
3921
|
},
|
|
3922
3922
|
disableScope: () => {
|
|
3923
3923
|
}
|
|
3924
|
-
}),
|
|
3925
|
-
function
|
|
3926
|
-
const o =
|
|
3927
|
-
return
|
|
3924
|
+
}), _r = () => qe(Lr);
|
|
3925
|
+
function Mr(t) {
|
|
3926
|
+
const o = re(void 0);
|
|
3927
|
+
return it(o.current, t) || (o.current = t), o.current;
|
|
3928
3928
|
}
|
|
3929
|
-
const
|
|
3929
|
+
const Ve = (t) => {
|
|
3930
3930
|
t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation();
|
|
3931
|
-
}, Wr = typeof window < "u" ?
|
|
3932
|
-
function
|
|
3933
|
-
const a =
|
|
3931
|
+
}, Wr = typeof window < "u" ? pt : U;
|
|
3932
|
+
function Er(t, o, n, r) {
|
|
3933
|
+
const a = re(null), i = re(!1), d = Array.isArray(n) ? Array.isArray(r) ? void 0 : r : n, p = Re(t) ? t.join(d == null ? void 0 : d.delimiter) : t, c = Array.isArray(n) ? n : Array.isArray(r) ? r : void 0, m = $(o, c ?? []), u = re(m);
|
|
3934
3934
|
c ? u.current = m : u.current = o;
|
|
3935
|
-
const s =
|
|
3935
|
+
const s = Mr(d), { activeScopes: h } = _r(), f = Sr();
|
|
3936
3936
|
return Wr(() => {
|
|
3937
|
-
if ((s == null ? void 0 : s.enabled) === !1 || !
|
|
3937
|
+
if ((s == null ? void 0 : s.enabled) === !1 || !zr(h, s == null ? void 0 : s.scopes))
|
|
3938
3938
|
return;
|
|
3939
3939
|
let v = [], x;
|
|
3940
|
-
const
|
|
3941
|
-
var
|
|
3942
|
-
if (!(
|
|
3940
|
+
const w = (N, k = !1) => {
|
|
3941
|
+
var z;
|
|
3942
|
+
if (!(yr(N) && !at(N, s == null ? void 0 : s.enableOnFormTags))) {
|
|
3943
3943
|
if (a.current !== null) {
|
|
3944
|
-
const
|
|
3945
|
-
if ((
|
|
3946
|
-
|
|
3944
|
+
const S = a.current.getRootNode();
|
|
3945
|
+
if ((S instanceof Document || S instanceof ShadowRoot) && S.activeElement !== a.current && !a.current.contains(S.activeElement)) {
|
|
3946
|
+
Ve(N);
|
|
3947
3947
|
return;
|
|
3948
3948
|
}
|
|
3949
3949
|
}
|
|
3950
|
-
(
|
|
3951
|
-
var _,
|
|
3952
|
-
if (
|
|
3950
|
+
(z = N.target) != null && z.isContentEditable && !(s != null && s.enableOnContentEditable) || Me(p, s == null ? void 0 : s.delimiter).forEach((S) => {
|
|
3951
|
+
var _, M, R, B;
|
|
3952
|
+
if (S.includes((s == null ? void 0 : s.splitKey) ?? "+") && S.includes((s == null ? void 0 : s.sequenceSplitKey) ?? ">")) {
|
|
3953
3953
|
console.warn(
|
|
3954
|
-
`Hotkey ${
|
|
3954
|
+
`Hotkey ${S} contains both ${(s == null ? void 0 : s.splitKey) ?? "+"} and ${(s == null ? void 0 : s.sequenceSplitKey) ?? ">"} which is not supported.`
|
|
3955
3955
|
);
|
|
3956
3956
|
return;
|
|
3957
3957
|
}
|
|
3958
|
-
const g =
|
|
3959
|
-
|
|
3958
|
+
const g = We(
|
|
3959
|
+
S,
|
|
3960
3960
|
s == null ? void 0 : s.splitKey,
|
|
3961
3961
|
s == null ? void 0 : s.sequenceSplitKey,
|
|
3962
3962
|
s == null ? void 0 : s.useKey,
|
|
@@ -3966,35 +3966,35 @@ function Mr(t, o, n, r) {
|
|
|
3966
3966
|
x = setTimeout(() => {
|
|
3967
3967
|
v = [];
|
|
3968
3968
|
}, (s == null ? void 0 : s.sequenceTimeoutMs) ?? 1e3);
|
|
3969
|
-
const
|
|
3970
|
-
if (
|
|
3969
|
+
const H = g.useKey ? N.key : fe(N.code);
|
|
3970
|
+
if (rt(H.toLowerCase()))
|
|
3971
3971
|
return;
|
|
3972
|
-
v.push(
|
|
3973
|
-
const
|
|
3974
|
-
if (
|
|
3972
|
+
v.push(H);
|
|
3973
|
+
const ee = (_ = g.keys) == null ? void 0 : _[v.length - 1];
|
|
3974
|
+
if (H !== ee) {
|
|
3975
3975
|
v = [], x && clearTimeout(x);
|
|
3976
3976
|
return;
|
|
3977
3977
|
}
|
|
3978
|
-
v.length === ((
|
|
3979
|
-
} else if (
|
|
3980
|
-
if ((
|
|
3978
|
+
v.length === ((M = g.keys) == null ? void 0 : M.length) && (u.current(N, g), x && clearTimeout(x), v = []);
|
|
3979
|
+
} else if (Cr(N, g, s == null ? void 0 : s.ignoreModifiers) || (R = g.keys) != null && R.includes("*")) {
|
|
3980
|
+
if ((B = s == null ? void 0 : s.ignoreEventWhen) != null && B.call(s, N) || k && i.current)
|
|
3981
3981
|
return;
|
|
3982
|
-
if (
|
|
3983
|
-
|
|
3982
|
+
if (vr(N, g, s == null ? void 0 : s.preventDefault), !kr(N, g, s == null ? void 0 : s.enabled)) {
|
|
3983
|
+
Ve(N);
|
|
3984
3984
|
return;
|
|
3985
3985
|
}
|
|
3986
|
-
u.current(N, g),
|
|
3986
|
+
u.current(N, g), k || (i.current = !0);
|
|
3987
3987
|
}
|
|
3988
3988
|
});
|
|
3989
3989
|
}
|
|
3990
|
-
},
|
|
3991
|
-
N.code !== void 0 && (
|
|
3990
|
+
}, I = (N) => {
|
|
3991
|
+
N.code !== void 0 && (nt(fe(N.code)), ((s == null ? void 0 : s.keydown) === void 0 && (s == null ? void 0 : s.keyup) !== !0 || s != null && s.keydown) && w(N));
|
|
3992
3992
|
}, b = (N) => {
|
|
3993
|
-
N.code !== void 0 && (
|
|
3994
|
-
},
|
|
3995
|
-
return
|
|
3993
|
+
N.code !== void 0 && (ot(fe(N.code)), i.current = !1, s != null && s.keyup && w(N, !0));
|
|
3994
|
+
}, C = a.current || (d == null ? void 0 : d.document) || document;
|
|
3995
|
+
return C.addEventListener("keyup", b, d == null ? void 0 : d.eventListenerOptions), C.addEventListener("keydown", I, d == null ? void 0 : d.eventListenerOptions), f && Me(p, s == null ? void 0 : s.delimiter).forEach(
|
|
3996
3996
|
(N) => f.addHotkey(
|
|
3997
|
-
|
|
3997
|
+
We(
|
|
3998
3998
|
N,
|
|
3999
3999
|
s == null ? void 0 : s.splitKey,
|
|
4000
4000
|
s == null ? void 0 : s.sequenceSplitKey,
|
|
@@ -4003,9 +4003,9 @@ function Mr(t, o, n, r) {
|
|
|
4003
4003
|
)
|
|
4004
4004
|
)
|
|
4005
4005
|
), () => {
|
|
4006
|
-
|
|
4006
|
+
C.removeEventListener("keyup", b, d == null ? void 0 : d.eventListenerOptions), C.removeEventListener("keydown", I, d == null ? void 0 : d.eventListenerOptions), f && Me(p, s == null ? void 0 : s.delimiter).forEach(
|
|
4007
4007
|
(N) => f.removeHotkey(
|
|
4008
|
-
|
|
4008
|
+
We(
|
|
4009
4009
|
N,
|
|
4010
4010
|
s == null ? void 0 : s.splitKey,
|
|
4011
4011
|
s == null ? void 0 : s.sequenceSplitKey,
|
|
@@ -4017,112 +4017,112 @@ function Mr(t, o, n, r) {
|
|
|
4017
4017
|
};
|
|
4018
4018
|
}, [p, s, h]), a;
|
|
4019
4019
|
}
|
|
4020
|
-
const
|
|
4020
|
+
const Tr = {
|
|
4021
4021
|
enableOnFormTags: !1,
|
|
4022
4022
|
preventDefault: !0
|
|
4023
4023
|
};
|
|
4024
|
-
function
|
|
4024
|
+
function st(t) {
|
|
4025
4025
|
var r;
|
|
4026
|
-
const o =
|
|
4026
|
+
const o = A((a) => a.keyboard), n = ke.find((a) => a.action === t);
|
|
4027
4027
|
return n ? ((r = o == null ? void 0 : o.shortcuts) == null ? void 0 : r[t]) !== void 0 ? o.shortcuts[t] ?? null : n.defaultBinding : null;
|
|
4028
4028
|
}
|
|
4029
4029
|
function F(t, o, n = {}) {
|
|
4030
|
-
const r =
|
|
4030
|
+
const r = st(t), a = A((i) => {
|
|
4031
4031
|
var d;
|
|
4032
4032
|
return ((d = i.keyboard) == null ? void 0 : d.enabled) ?? !0;
|
|
4033
4033
|
});
|
|
4034
|
-
|
|
4034
|
+
Er(
|
|
4035
4035
|
r || "",
|
|
4036
4036
|
o,
|
|
4037
4037
|
{
|
|
4038
|
-
...
|
|
4038
|
+
...Tr,
|
|
4039
4039
|
...n,
|
|
4040
4040
|
enabled: a && !!r
|
|
4041
4041
|
},
|
|
4042
4042
|
[o, r, a]
|
|
4043
4043
|
);
|
|
4044
4044
|
}
|
|
4045
|
-
function
|
|
4046
|
-
const { onToggleAIChat: o } = t, n =
|
|
4045
|
+
function jr(t = {}) {
|
|
4046
|
+
const { onToggleAIChat: o } = t, n = Je(), r = y((j) => j.nodes), a = y((j) => j.selectedNodeId), i = y((j) => j.execution), d = y((j) => j.hasUnsavedChanges), p = y((j) => j.saveWorkflow), c = y((j) => j.execute), m = y((j) => j.cancelExecution), u = y((j) => j.duplicateNode), s = y((j) => j.setSelectedNode), h = y((j) => j.toggleLibrary), f = y((j) => j.newWorkflow), v = A((j) => j.openSettings), x = A((j) => j.openShortcutsModal), w = A((j) => j.openCommandPalette), I = A((j) => j.closeCommandPalette), b = A((j) => j.closeShortcutsModal), C = A((j) => j.closeSettings), N = A((j) => j.showCommandPalette), k = A((j) => j.openExport), z = A((j) => j.openImport), S = A((j) => j.requestNewWorkflow), g = $(() => {
|
|
4047
4047
|
r.length !== 0 && p();
|
|
4048
|
-
}, [r.length, p]), _ =
|
|
4048
|
+
}, [r.length, p]), _ = $(() => {
|
|
4049
4049
|
r.length === 0 || i.status === "running" || c();
|
|
4050
|
-
}, [r.length, i.status, c]),
|
|
4051
|
-
|
|
4052
|
-
}, [
|
|
4053
|
-
r.length !== 0 && (
|
|
4054
|
-
}, [r.length,
|
|
4055
|
-
|
|
4056
|
-
}, [
|
|
4050
|
+
}, [r.length, i.status, c]), M = $(() => {
|
|
4051
|
+
S(d, f);
|
|
4052
|
+
}, [S, d, f]), R = $(() => {
|
|
4053
|
+
r.length !== 0 && (k == null || k());
|
|
4054
|
+
}, [r.length, k]), B = $(() => {
|
|
4055
|
+
z == null || z();
|
|
4056
|
+
}, [z]), H = $(() => {
|
|
4057
4057
|
i.status === "running" && m();
|
|
4058
|
-
}, [i.status, m]),
|
|
4058
|
+
}, [i.status, m]), ee = $(() => {
|
|
4059
4059
|
a && u(a);
|
|
4060
|
-
}, [a, u]),
|
|
4060
|
+
}, [a, u]), te = $(() => {
|
|
4061
4061
|
n == null || n.setNodes(
|
|
4062
|
-
(
|
|
4063
|
-
...
|
|
4062
|
+
(j) => j.map((he) => ({
|
|
4063
|
+
...he,
|
|
4064
4064
|
selected: !0
|
|
4065
4065
|
}))
|
|
4066
4066
|
);
|
|
4067
|
-
}, [n]),
|
|
4068
|
-
|
|
4069
|
-
(
|
|
4070
|
-
...
|
|
4067
|
+
}, [n]), ne = $(() => {
|
|
4068
|
+
I == null || I(), b == null || b(), C == null || C(), s(null), n == null || n.setNodes(
|
|
4069
|
+
(j) => j.map((he) => ({
|
|
4070
|
+
...he,
|
|
4071
4071
|
selected: !1
|
|
4072
4072
|
}))
|
|
4073
4073
|
);
|
|
4074
|
-
}, [s, n,
|
|
4074
|
+
}, [s, n, I, b, C]), oe = $(() => {
|
|
4075
4075
|
n == null || n.zoomIn();
|
|
4076
|
-
}, [n]),
|
|
4076
|
+
}, [n]), L = $(() => {
|
|
4077
4077
|
n == null || n.zoomOut();
|
|
4078
|
-
}, [n]),
|
|
4078
|
+
}, [n]), P = $(() => {
|
|
4079
4079
|
n == null || n.fitView({ padding: 0.2 });
|
|
4080
|
-
}, [n]),
|
|
4081
|
-
N ?
|
|
4082
|
-
}, [N,
|
|
4080
|
+
}, [n]), V = $(() => {
|
|
4081
|
+
N ? I == null || I() : w == null || w();
|
|
4082
|
+
}, [N, w, I]), K = $(() => {
|
|
4083
4083
|
x == null || x();
|
|
4084
|
-
}, [x]),
|
|
4084
|
+
}, [x]), q = $(() => {
|
|
4085
4085
|
o == null || o();
|
|
4086
|
-
}, [o]),
|
|
4086
|
+
}, [o]), J = $(() => {
|
|
4087
4087
|
h();
|
|
4088
|
-
}, [h]),
|
|
4088
|
+
}, [h]), pe = $(() => {
|
|
4089
4089
|
v();
|
|
4090
4090
|
}, [v]);
|
|
4091
|
-
return F("save", g), F("execute", _), F("newWorkflow",
|
|
4091
|
+
return F("save", g), F("execute", _), F("newWorkflow", M), F("exportWorkflow", R), F("importWorkflow", B), F("cancelExecution", H), F("duplicate", ee), F("selectAll", te), F("deselect", ne), F("zoomIn", oe), F("zoomOut", L), F("zoomFit", P), F("commandPalette", V), F("showShortcuts", K), F("toggleAIChat", q), F("toggleLibrary", J), F("settings", pe), {
|
|
4092
4092
|
handleSave: g,
|
|
4093
4093
|
handleExecute: _,
|
|
4094
|
-
handleNewWorkflow:
|
|
4094
|
+
handleNewWorkflow: M,
|
|
4095
4095
|
handleExport: R,
|
|
4096
|
-
handleImport:
|
|
4097
|
-
handleDuplicate:
|
|
4098
|
-
handleSelectAll:
|
|
4099
|
-
handleDeselect:
|
|
4100
|
-
handleZoomIn:
|
|
4101
|
-
handleZoomOut:
|
|
4102
|
-
handleZoomFit:
|
|
4103
|
-
handleCommandPalette:
|
|
4104
|
-
handleShowShortcuts:
|
|
4105
|
-
handleToggleAIChat:
|
|
4106
|
-
handleToggleLibrary:
|
|
4107
|
-
handleSettings:
|
|
4096
|
+
handleImport: B,
|
|
4097
|
+
handleDuplicate: ee,
|
|
4098
|
+
handleSelectAll: te,
|
|
4099
|
+
handleDeselect: ne,
|
|
4100
|
+
handleZoomIn: oe,
|
|
4101
|
+
handleZoomOut: L,
|
|
4102
|
+
handleZoomFit: P,
|
|
4103
|
+
handleCommandPalette: V,
|
|
4104
|
+
handleShowShortcuts: K,
|
|
4105
|
+
handleToggleAIChat: q,
|
|
4106
|
+
handleToggleLibrary: J,
|
|
4107
|
+
handleSettings: pe
|
|
4108
4108
|
};
|
|
4109
4109
|
}
|
|
4110
|
-
function
|
|
4111
|
-
return
|
|
4110
|
+
function $r(t) {
|
|
4111
|
+
return st(t);
|
|
4112
4112
|
}
|
|
4113
|
-
function
|
|
4113
|
+
function Se() {
|
|
4114
4114
|
return typeof navigator > "u" ? !1 : navigator.platform.toLowerCase().includes("mac");
|
|
4115
4115
|
}
|
|
4116
|
-
function
|
|
4117
|
-
return
|
|
4116
|
+
function lt() {
|
|
4117
|
+
return Se() ? "⌘" : "Ctrl";
|
|
4118
4118
|
}
|
|
4119
|
-
function
|
|
4120
|
-
return
|
|
4119
|
+
function dt() {
|
|
4120
|
+
return Se() ? "⌥" : "Alt";
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function ct() {
|
|
4123
4123
|
return "⇧";
|
|
4124
4124
|
}
|
|
4125
|
-
const
|
|
4125
|
+
const Ie = {
|
|
4126
4126
|
enter: "⏎",
|
|
4127
4127
|
return: "⏎",
|
|
4128
4128
|
escape: "Esc",
|
|
@@ -4141,21 +4141,21 @@ const ke = {
|
|
|
4141
4141
|
plus: "+",
|
|
4142
4142
|
period: "."
|
|
4143
4143
|
};
|
|
4144
|
-
function
|
|
4144
|
+
function Ar(t) {
|
|
4145
4145
|
if (!t) return "";
|
|
4146
4146
|
const o = t.toLowerCase().split("+"), n = [];
|
|
4147
4147
|
for (const r of o)
|
|
4148
|
-
r === "mod" ? n.push(
|
|
4148
|
+
r === "mod" ? n.push(lt()) : r === "ctrl" || r === "control" ? n.push(Se() ? "⌃" : "Ctrl") : r === "alt" || r === "option" ? n.push(dt()) : r === "shift" ? n.push(ct()) : r === "meta" || r === "cmd" || r === "command" ? n.push("⌘") : Ie[r] ? n.push(Ie[r]) : n.push(r.toUpperCase());
|
|
4149
4149
|
return n.join("");
|
|
4150
4150
|
}
|
|
4151
|
-
function
|
|
4151
|
+
function Rr(t) {
|
|
4152
4152
|
if (!t) return [];
|
|
4153
4153
|
const o = t.toLowerCase().split("+"), n = [];
|
|
4154
4154
|
for (const r of o)
|
|
4155
|
-
r === "mod" ? n.push(
|
|
4155
|
+
r === "mod" ? n.push(lt()) : r === "ctrl" || r === "control" ? n.push(Se() ? "⌃" : "Ctrl") : r === "alt" || r === "option" ? n.push(dt()) : r === "shift" ? n.push(ct()) : r === "meta" || r === "cmd" || r === "command" ? n.push("⌘") : Ie[r] ? n.push(Ie[r]) : n.push(r.toUpperCase());
|
|
4156
4156
|
return n;
|
|
4157
4157
|
}
|
|
4158
|
-
function
|
|
4158
|
+
function Pr(t, o) {
|
|
4159
4159
|
const n = new Map(t.map((p) => [p.id, p])), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
4160
4160
|
for (const p of t)
|
|
4161
4161
|
r.set(p.id, 0), a.set(p.id, []);
|
|
@@ -4178,21 +4178,21 @@ function Rr(t, o) {
|
|
|
4178
4178
|
}
|
|
4179
4179
|
return d;
|
|
4180
4180
|
}
|
|
4181
|
-
function
|
|
4181
|
+
function Dr(t) {
|
|
4182
4182
|
const o = t.type || "node", n = t.id.replace(/[^a-zA-Z0-9]/g, "_");
|
|
4183
4183
|
return `${o}_${n}`;
|
|
4184
4184
|
}
|
|
4185
|
-
function
|
|
4185
|
+
function ye(t) {
|
|
4186
4186
|
return typeof t == "string" ? t.includes(`
|
|
4187
4187
|
`) ? "`" + t.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(t) : JSON.stringify(t, null, 2);
|
|
4188
4188
|
}
|
|
4189
|
-
function
|
|
4189
|
+
function Or(t, o, n) {
|
|
4190
4190
|
const r = n.get(t.id), a = [], i = o.find((p) => p.target === t.id), d = i ? n.get(i.source) : null;
|
|
4191
4191
|
switch (t.type) {
|
|
4192
4192
|
case "generator": {
|
|
4193
4193
|
const p = t.data;
|
|
4194
4194
|
a.push(p.generatorName);
|
|
4195
|
-
const c = p.params || {}, m = Object.entries(c).filter(([, u]) => u !== void 0 && u !== "").map(([u, s]) => ` ${u}: ${
|
|
4195
|
+
const c = p.params || {}, m = Object.entries(c).filter(([, u]) => u !== void 0 && u !== "").map(([u, s]) => ` ${u}: ${ye(s)}`).join(`,
|
|
4196
4196
|
`);
|
|
4197
4197
|
return {
|
|
4198
4198
|
code: `// Generate image using ${p.generatorName}
|
|
@@ -4209,7 +4209,7 @@ const ${r} = await flo.loadImage("./input.png");`,
|
|
|
4209
4209
|
imports: []
|
|
4210
4210
|
};
|
|
4211
4211
|
case "transform": {
|
|
4212
|
-
const p = t.data, c = p.params || {}, m = Object.entries(c).filter(([, s]) => s !== void 0 && s !== "").map(([s, h]) => `${s}: ${
|
|
4212
|
+
const p = t.data, c = p.params || {}, m = Object.entries(c).filter(([, s]) => s !== void 0 && s !== "").map(([s, h]) => `${s}: ${ye(h)}`).join(", "), u = d || "image";
|
|
4213
4213
|
return {
|
|
4214
4214
|
code: `// Apply ${p.operation} transform
|
|
4215
4215
|
const ${r} = await flo.transform(${u}, "${p.operation}"${m ? `, { ${m} }` : ""});`,
|
|
@@ -4219,7 +4219,7 @@ const ${r} = await flo.transform(${u}, "${p.operation}"${m ? `, { ${m} }` : ""})
|
|
|
4219
4219
|
case "vision": {
|
|
4220
4220
|
const p = t.data;
|
|
4221
4221
|
a.push(p.providerName);
|
|
4222
|
-
const c = p.params || {}, m = d || "image", u = Object.entries(c).filter(([, s]) => s !== void 0 && s !== "").map(([s, h]) => ` ${s}: ${
|
|
4222
|
+
const c = p.params || {}, m = d || "image", u = Object.entries(c).filter(([, s]) => s !== void 0 && s !== "").map(([s, h]) => ` ${s}: ${ye(h)}`).join(`,
|
|
4223
4223
|
`);
|
|
4224
4224
|
return {
|
|
4225
4225
|
code: `// Analyze image with ${p.providerName}
|
|
@@ -4232,7 +4232,7 @@ ${u}
|
|
|
4232
4232
|
case "text": {
|
|
4233
4233
|
const p = t.data;
|
|
4234
4234
|
a.push(p.providerName);
|
|
4235
|
-
const c = p.params || {}, m = Object.entries(c).filter(([, u]) => u !== void 0 && u !== "").map(([u, s]) => ` ${u}: ${
|
|
4235
|
+
const c = p.params || {}, m = Object.entries(c).filter(([, u]) => u !== void 0 && u !== "").map(([u, s]) => ` ${u}: ${ye(s)}`).join(`,
|
|
4236
4236
|
`);
|
|
4237
4237
|
return {
|
|
4238
4238
|
code: `// Generate text with ${p.providerName}
|
|
@@ -4246,7 +4246,7 @@ ${m}
|
|
|
4246
4246
|
const p = t.data;
|
|
4247
4247
|
return {
|
|
4248
4248
|
code: `// Save result
|
|
4249
|
-
await flo.save(${d || "result"}, ${
|
|
4249
|
+
await flo.save(${d || "result"}, ${ye(p.destination)});`,
|
|
4250
4250
|
imports: []
|
|
4251
4251
|
};
|
|
4252
4252
|
}
|
|
@@ -4257,16 +4257,16 @@ await flo.save(${d || "result"}, ${xe(p.destination)});`,
|
|
|
4257
4257
|
};
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
4260
|
-
function
|
|
4260
|
+
function Br(t, o) {
|
|
4261
4261
|
if (t.length === 0)
|
|
4262
4262
|
return `// Empty workflow
|
|
4263
4263
|
// Add nodes to your canvas to generate code`;
|
|
4264
|
-
const n =
|
|
4264
|
+
const n = Pr(t, o), r = /* @__PURE__ */ new Map();
|
|
4265
4265
|
for (const m of n)
|
|
4266
|
-
r.set(m.id,
|
|
4266
|
+
r.set(m.id, Dr(m));
|
|
4267
4267
|
const a = /* @__PURE__ */ new Set(), i = [];
|
|
4268
4268
|
for (const m of n) {
|
|
4269
|
-
const { code: u, imports: s } =
|
|
4269
|
+
const { code: u, imports: s } = Or(m, o, r);
|
|
4270
4270
|
i.push(u);
|
|
4271
4271
|
for (const h of s)
|
|
4272
4272
|
a.add(h);
|
|
@@ -4297,15 +4297,15 @@ runWorkflow().catch(console.error);
|
|
|
4297
4297
|
`) + `
|
|
4298
4298
|
` + c;
|
|
4299
4299
|
}
|
|
4300
|
-
function
|
|
4301
|
-
const [r, a] = E(""), [i, d] = E(!1), [p, c] = E(null), [m, u] = E(!1), s =
|
|
4300
|
+
function Vr({ isOpen: t, onClose: o, onImport: n }) {
|
|
4301
|
+
const [r, a] = E(""), [i, d] = E(!1), [p, c] = E(null), [m, u] = E(!1), s = $(async () => {
|
|
4302
4302
|
if (!r.trim()) {
|
|
4303
4303
|
c({ message: "Please enter or paste YAML content" });
|
|
4304
4304
|
return;
|
|
4305
4305
|
}
|
|
4306
4306
|
d(!0), c(null);
|
|
4307
4307
|
try {
|
|
4308
|
-
const b = await
|
|
4308
|
+
const b = await At(r);
|
|
4309
4309
|
b.success ? (n(b.nodes, b.edges, b.name), a(""), o()) : c({
|
|
4310
4310
|
message: b.error || "Import failed",
|
|
4311
4311
|
line: b.line,
|
|
@@ -4316,47 +4316,47 @@ function Br({ isOpen: t, onClose: o, onImport: n }) {
|
|
|
4316
4316
|
} finally {
|
|
4317
4317
|
d(!1);
|
|
4318
4318
|
}
|
|
4319
|
-
}, [r, n, o]), h =
|
|
4319
|
+
}, [r, n, o]), h = $(async () => {
|
|
4320
4320
|
if (!r.trim()) {
|
|
4321
4321
|
c({ message: "Please enter or paste YAML content" });
|
|
4322
4322
|
return;
|
|
4323
4323
|
}
|
|
4324
4324
|
d(!0), c(null);
|
|
4325
4325
|
try {
|
|
4326
|
-
const b = await
|
|
4326
|
+
const b = await Rt(r);
|
|
4327
4327
|
b.valid ? (c(null), c({ message: "Valid YAML!" }), setTimeout(() => c(null), 2e3)) : b.errors.length > 0 && c(b.errors[0]);
|
|
4328
4328
|
} catch (b) {
|
|
4329
4329
|
c({ message: b instanceof Error ? b.message : "Validation failed" });
|
|
4330
4330
|
} finally {
|
|
4331
4331
|
d(!1);
|
|
4332
4332
|
}
|
|
4333
|
-
}, [r]), f =
|
|
4333
|
+
}, [r]), f = $(async (b) => {
|
|
4334
4334
|
if (!b.name.endsWith(".yaml") && !b.name.endsWith(".yml")) {
|
|
4335
4335
|
c({ message: "Please upload a .yaml or .yml file" });
|
|
4336
4336
|
return;
|
|
4337
4337
|
}
|
|
4338
4338
|
try {
|
|
4339
|
-
const
|
|
4340
|
-
a(
|
|
4339
|
+
const C = await b.text();
|
|
4340
|
+
a(C), c(null);
|
|
4341
4341
|
} catch {
|
|
4342
4342
|
c({ message: "Failed to read file" });
|
|
4343
4343
|
}
|
|
4344
|
-
}, []), v =
|
|
4344
|
+
}, []), v = $((b) => {
|
|
4345
4345
|
b.preventDefault(), u(!0);
|
|
4346
|
-
}, []), x =
|
|
4346
|
+
}, []), x = $((b) => {
|
|
4347
4347
|
b.preventDefault(), u(!1);
|
|
4348
|
-
}, []),
|
|
4348
|
+
}, []), w = $(
|
|
4349
4349
|
(b) => {
|
|
4350
4350
|
b.preventDefault(), u(!1);
|
|
4351
|
-
const
|
|
4352
|
-
|
|
4351
|
+
const C = b.dataTransfer.files[0];
|
|
4352
|
+
C && f(C);
|
|
4353
4353
|
},
|
|
4354
4354
|
[f]
|
|
4355
|
-
),
|
|
4355
|
+
), I = $(
|
|
4356
4356
|
(b) => {
|
|
4357
4357
|
var N;
|
|
4358
|
-
const
|
|
4359
|
-
|
|
4358
|
+
const C = (N = b.target.files) == null ? void 0 : N[0];
|
|
4359
|
+
C && f(C);
|
|
4360
4360
|
},
|
|
4361
4361
|
[f]
|
|
4362
4362
|
);
|
|
@@ -4387,7 +4387,7 @@ function Br({ isOpen: t, onClose: o, onImport: n }) {
|
|
|
4387
4387
|
{
|
|
4388
4388
|
onDragOver: v,
|
|
4389
4389
|
onDragLeave: x,
|
|
4390
|
-
onDrop:
|
|
4390
|
+
onDrop: w,
|
|
4391
4391
|
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${m ? "border-teal-500 bg-teal-50 dark:bg-teal-900/20" : "border-gray-300 dark:border-zinc-600"}`,
|
|
4392
4392
|
children: [
|
|
4393
4393
|
/* @__PURE__ */ e(
|
|
@@ -4395,7 +4395,7 @@ function Br({ isOpen: t, onClose: o, onImport: n }) {
|
|
|
4395
4395
|
{
|
|
4396
4396
|
type: "file",
|
|
4397
4397
|
accept: ".yaml,.yml",
|
|
4398
|
-
onChange:
|
|
4398
|
+
onChange: I,
|
|
4399
4399
|
className: "hidden",
|
|
4400
4400
|
id: "yaml-file-input"
|
|
4401
4401
|
}
|
|
@@ -4528,7 +4528,7 @@ steps:
|
|
|
4528
4528
|
] })
|
|
4529
4529
|
] }) }) : null;
|
|
4530
4530
|
}
|
|
4531
|
-
const
|
|
4531
|
+
const Ur = {
|
|
4532
4532
|
// Prompt/input errors
|
|
4533
4533
|
MISSING_PROMPT_SOURCE: {
|
|
4534
4534
|
title: "Missing Prompt",
|
|
@@ -4595,14 +4595,14 @@ const Vr = {
|
|
|
4595
4595
|
suggestedFix: "Add at least one generator or input node."
|
|
4596
4596
|
}
|
|
4597
4597
|
};
|
|
4598
|
-
function
|
|
4599
|
-
return
|
|
4598
|
+
function Hr(t) {
|
|
4599
|
+
return Ur[t] || {
|
|
4600
4600
|
title: "Validation Error",
|
|
4601
4601
|
description: "There's an issue with this node's configuration.",
|
|
4602
4602
|
suggestedFix: "Review the node settings and connections."
|
|
4603
4603
|
};
|
|
4604
4604
|
}
|
|
4605
|
-
function
|
|
4605
|
+
function Fr(t) {
|
|
4606
4606
|
return t === "error" ? {
|
|
4607
4607
|
bg: "bg-red-50 dark:bg-red-900/20",
|
|
4608
4608
|
border: "border-red-200 dark:border-red-800",
|
|
@@ -4615,7 +4615,7 @@ function Hr(t) {
|
|
|
4615
4615
|
icon: "text-amber-500"
|
|
4616
4616
|
};
|
|
4617
4617
|
}
|
|
4618
|
-
function
|
|
4618
|
+
function Kr({ issues: t, onClose: o, onExecuteAnyway: n }) {
|
|
4619
4619
|
const r = y((c) => c.setSelectedNode), a = t.filter((c) => c.severity === "error"), i = t.filter((c) => c.severity === "warning"), d = a.length > 0;
|
|
4620
4620
|
U(() => {
|
|
4621
4621
|
const c = (m) => {
|
|
@@ -4676,8 +4676,8 @@ function Fr({ issues: t, onClose: o, onExecuteAnyway: n }) {
|
|
|
4676
4676
|
)
|
|
4677
4677
|
] }),
|
|
4678
4678
|
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto p-4 space-y-3", children: [
|
|
4679
|
-
a.map((c, m) => /* @__PURE__ */ e(
|
|
4680
|
-
i.map((c, m) => /* @__PURE__ */ e(
|
|
4679
|
+
a.map((c, m) => /* @__PURE__ */ e(Ue, { issue: c, onSelectNode: p }, `error-${m}`)),
|
|
4680
|
+
i.map((c, m) => /* @__PURE__ */ e(Ue, { issue: c, onSelectNode: p }, `warning-${m}`))
|
|
4681
4681
|
] }),
|
|
4682
4682
|
/* @__PURE__ */ l("div", { className: "flex justify-end gap-3 px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
4683
4683
|
/* @__PURE__ */ e(
|
|
@@ -4699,8 +4699,8 @@ function Fr({ issues: t, onClose: o, onExecuteAnyway: n }) {
|
|
|
4699
4699
|
] })
|
|
4700
4700
|
] }) });
|
|
4701
4701
|
}
|
|
4702
|
-
function
|
|
4703
|
-
const n =
|
|
4702
|
+
function Ue({ issue: t, onSelectNode: o }) {
|
|
4703
|
+
const n = Hr(t.code), r = Fr(t.severity);
|
|
4704
4704
|
return /* @__PURE__ */ e("div", { className: `p-3 rounded-lg border ${r.bg} ${r.border}`, children: /* @__PURE__ */ l("div", { className: "flex items-start gap-3", children: [
|
|
4705
4705
|
/* @__PURE__ */ e(
|
|
4706
4706
|
"svg",
|
|
@@ -4744,7 +4744,7 @@ function Pe({ issue: t, onSelectNode: o }) {
|
|
|
4744
4744
|
)
|
|
4745
4745
|
] }) });
|
|
4746
4746
|
}
|
|
4747
|
-
function
|
|
4747
|
+
function qr({
|
|
4748
4748
|
brandingSlot: t,
|
|
4749
4749
|
beforeActionsSlot: o,
|
|
4750
4750
|
afterActionsSlot: n,
|
|
@@ -4752,39 +4752,39 @@ function Kr({
|
|
|
4752
4752
|
hideAttribution: a = !1,
|
|
4753
4753
|
hideWorkflowLibrary: i = !1
|
|
4754
4754
|
} = {}) {
|
|
4755
|
-
const d = y((
|
|
4755
|
+
const d = y((W) => W.execution), p = y((W) => W.execute), c = y((W) => W.executeWithValidation), m = y((W) => W.cancelExecution), u = y((W) => W.exportToYaml), s = y((W) => W.importFromYaml), h = y((W) => W.nodes), f = y((W) => W.edges), v = A((W) => W.openSettings), x = y((W) => W.preflightValidation), w = y((W) => W.hideValidationPanel), I = y((W) => W.activeWorkflowName), b = y((W) => W.hasUnsavedChanges), C = y((W) => W.saveWorkflow), N = y((W) => W.toggleLibrary), k = y((W) => W.setActiveWorkflowName), z = $r("save"), [S, g] = E(!1), [_, M] = E(!1), [R, B] = E("yaml"), [H, ee] = E(""), [te, ne] = E(""), [oe, L] = E(null), [P, V] = E(!1), [K, q] = E("");
|
|
4756
4756
|
U(() => {
|
|
4757
|
-
const
|
|
4758
|
-
|
|
4757
|
+
const W = () => {
|
|
4758
|
+
L("New workflow created"), setTimeout(() => L(null), 2e3);
|
|
4759
4759
|
};
|
|
4760
|
-
return window.addEventListener("new-workflow-created",
|
|
4760
|
+
return window.addEventListener("new-workflow-created", W), () => window.removeEventListener("new-workflow-created", W);
|
|
4761
4761
|
}, []);
|
|
4762
|
-
const
|
|
4763
|
-
h.length !== 0 && (
|
|
4764
|
-
}, [h.length,
|
|
4765
|
-
|
|
4766
|
-
},
|
|
4767
|
-
const
|
|
4768
|
-
|
|
4769
|
-
},
|
|
4762
|
+
const J = $(() => {
|
|
4763
|
+
h.length !== 0 && (C(), L("Saved!"), setTimeout(() => L(null), 2e3));
|
|
4764
|
+
}, [h.length, C]), pe = () => {
|
|
4765
|
+
q(I), V(!0);
|
|
4766
|
+
}, j = () => {
|
|
4767
|
+
const W = K.trim();
|
|
4768
|
+
W && W !== I && k(W), V(!1);
|
|
4769
|
+
}, he = async () => {
|
|
4770
4770
|
await c();
|
|
4771
|
-
},
|
|
4772
|
-
|
|
4773
|
-
},
|
|
4774
|
-
const
|
|
4775
|
-
|
|
4776
|
-
const
|
|
4777
|
-
|
|
4778
|
-
},
|
|
4779
|
-
const
|
|
4780
|
-
navigator.clipboard.writeText(
|
|
4781
|
-
},
|
|
4782
|
-
(
|
|
4783
|
-
s(
|
|
4771
|
+
}, T = async () => {
|
|
4772
|
+
w(), await p();
|
|
4773
|
+
}, G = async () => {
|
|
4774
|
+
const W = await u();
|
|
4775
|
+
ee(W);
|
|
4776
|
+
const ge = Br(h, f);
|
|
4777
|
+
ne(ge), g(!0);
|
|
4778
|
+
}, Y = () => {
|
|
4779
|
+
const W = R === "yaml" ? H : te;
|
|
4780
|
+
navigator.clipboard.writeText(W);
|
|
4781
|
+
}, ie = $(
|
|
4782
|
+
(W, ge, Le) => {
|
|
4783
|
+
s(W, ge, Le), L("Workflow imported!"), setTimeout(() => L(null), 2e3);
|
|
4784
4784
|
},
|
|
4785
4785
|
[s]
|
|
4786
4786
|
);
|
|
4787
|
-
return /* @__PURE__ */ l(
|
|
4787
|
+
return /* @__PURE__ */ l(X, { children: [
|
|
4788
4788
|
/* @__PURE__ */ l("div", { className: "floimg-toolbar h-14 flex items-center justify-between px-4", children: [
|
|
4789
4789
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
4790
4790
|
!i && /* @__PURE__ */ e("button", { onClick: N, className: "floimg-toolbar__btn", title: "My Workflows", children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -4811,15 +4811,15 @@ function Kr({
|
|
|
4811
4811
|
)
|
|
4812
4812
|
] }),
|
|
4813
4813
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4814
|
-
|
|
4814
|
+
P ? /* @__PURE__ */ e(
|
|
4815
4815
|
"input",
|
|
4816
4816
|
{
|
|
4817
4817
|
type: "text",
|
|
4818
|
-
value:
|
|
4819
|
-
onChange: (
|
|
4820
|
-
onBlur:
|
|
4821
|
-
onKeyDown: (
|
|
4822
|
-
|
|
4818
|
+
value: K,
|
|
4819
|
+
onChange: (W) => q(W.target.value),
|
|
4820
|
+
onBlur: j,
|
|
4821
|
+
onKeyDown: (W) => {
|
|
4822
|
+
W.key === "Enter" && j(), W.key === "Escape" && (q(I), V(!1));
|
|
4823
4823
|
},
|
|
4824
4824
|
className: "w-48 px-2 py-1 text-sm font-medium bg-white dark:bg-zinc-900 border border-teal-500 rounded focus:outline-none focus:ring-1 focus:ring-teal-500 text-gray-900 dark:text-zinc-100",
|
|
4825
4825
|
autoFocus: !0
|
|
@@ -4827,14 +4827,14 @@ function Kr({
|
|
|
4827
4827
|
) : /* @__PURE__ */ e(
|
|
4828
4828
|
"button",
|
|
4829
4829
|
{
|
|
4830
|
-
onClick:
|
|
4830
|
+
onClick: pe,
|
|
4831
4831
|
className: "text-sm text-gray-700 dark:text-zinc-300 font-medium hover:text-gray-900 dark:hover:text-zinc-100 rounded px-2 py-1 -mx-2 hover:bg-gray-100 dark:hover:bg-zinc-700 transition-colors",
|
|
4832
4832
|
title: "Click to rename",
|
|
4833
|
-
children:
|
|
4833
|
+
children: I
|
|
4834
4834
|
}
|
|
4835
4835
|
),
|
|
4836
4836
|
b && /* @__PURE__ */ e("span", { className: "text-xs text-amber-600 dark:text-amber-400", children: "(unsaved)" }),
|
|
4837
|
-
|
|
4837
|
+
oe && /* @__PURE__ */ e("span", { className: "text-xs text-green-600 dark:text-green-400", children: oe })
|
|
4838
4838
|
] }),
|
|
4839
4839
|
/* @__PURE__ */ l("span", { className: "text-sm text-gray-500 dark:text-zinc-400", children: [
|
|
4840
4840
|
h.length,
|
|
@@ -4867,10 +4867,10 @@ function Kr({
|
|
|
4867
4867
|
/* @__PURE__ */ e(
|
|
4868
4868
|
"button",
|
|
4869
4869
|
{
|
|
4870
|
-
onClick:
|
|
4870
|
+
onClick: J,
|
|
4871
4871
|
disabled: h.length === 0,
|
|
4872
4872
|
className: "floimg-toolbar__btn disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4873
|
-
title: `Save Workflow${
|
|
4873
|
+
title: `Save Workflow${z ? ` (${Ar(z)})` : ""}`,
|
|
4874
4874
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
4875
4875
|
"path",
|
|
4876
4876
|
{
|
|
@@ -4882,11 +4882,11 @@ function Kr({
|
|
|
4882
4882
|
) })
|
|
4883
4883
|
}
|
|
4884
4884
|
),
|
|
4885
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
4885
|
+
/* @__PURE__ */ e("button", { onClick: () => M(!0), className: "floimg-toolbar__btn-secondary", children: "Import" }),
|
|
4886
4886
|
/* @__PURE__ */ e(
|
|
4887
4887
|
"button",
|
|
4888
4888
|
{
|
|
4889
|
-
onClick:
|
|
4889
|
+
onClick: G,
|
|
4890
4890
|
disabled: h.length === 0,
|
|
4891
4891
|
className: "floimg-toolbar__btn-secondary disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4892
4892
|
children: "Export"
|
|
@@ -4913,7 +4913,7 @@ function Kr({
|
|
|
4913
4913
|
) : /* @__PURE__ */ l(
|
|
4914
4914
|
"button",
|
|
4915
4915
|
{
|
|
4916
|
-
onClick:
|
|
4916
|
+
onClick: he,
|
|
4917
4917
|
disabled: h.length === 0,
|
|
4918
4918
|
className: "floimg-toolbar__btn-primary disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
|
|
4919
4919
|
children: [
|
|
@@ -4949,7 +4949,7 @@ function Kr({
|
|
|
4949
4949
|
"Error: ",
|
|
4950
4950
|
d.error
|
|
4951
4951
|
] }) }),
|
|
4952
|
-
|
|
4952
|
+
S && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] flex flex-col", children: [
|
|
4953
4953
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
4954
4954
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
4955
4955
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Export Workflow" }),
|
|
@@ -4957,7 +4957,7 @@ function Kr({
|
|
|
4957
4957
|
/* @__PURE__ */ e(
|
|
4958
4958
|
"button",
|
|
4959
4959
|
{
|
|
4960
|
-
onClick: () =>
|
|
4960
|
+
onClick: () => B("yaml"),
|
|
4961
4961
|
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${R === "yaml" ? "bg-white dark:bg-zinc-600 text-gray-900 dark:text-white shadow-sm" : "text-gray-600 dark:text-zinc-400 hover:text-gray-900 dark:hover:text-white"}`,
|
|
4962
4962
|
children: "YAML"
|
|
4963
4963
|
}
|
|
@@ -4965,7 +4965,7 @@ function Kr({
|
|
|
4965
4965
|
/* @__PURE__ */ e(
|
|
4966
4966
|
"button",
|
|
4967
4967
|
{
|
|
4968
|
-
onClick: () =>
|
|
4968
|
+
onClick: () => B("javascript"),
|
|
4969
4969
|
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${R === "javascript" ? "bg-white dark:bg-zinc-600 text-gray-900 dark:text-white shadow-sm" : "text-gray-600 dark:text-zinc-400 hover:text-gray-900 dark:hover:text-white"}`,
|
|
4970
4970
|
children: "JavaScript"
|
|
4971
4971
|
}
|
|
@@ -4989,14 +4989,14 @@ function Kr({
|
|
|
4989
4989
|
}
|
|
4990
4990
|
)
|
|
4991
4991
|
] }),
|
|
4992
|
-
/* @__PURE__ */ e("div", { className: "p-4 overflow-auto flex-1", children: /* @__PURE__ */ e("pre", { className: "bg-gray-100 dark:bg-zinc-900 p-4 rounded text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-zinc-200", children: R === "yaml" ?
|
|
4992
|
+
/* @__PURE__ */ e("div", { className: "p-4 overflow-auto flex-1", children: /* @__PURE__ */ e("pre", { className: "bg-gray-100 dark:bg-zinc-900 p-4 rounded text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-zinc-200", children: R === "yaml" ? H : te }) }),
|
|
4993
4993
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
4994
4994
|
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: R === "yaml" ? "Use with floimg CLI: floimg run workflow.yaml" : "Run with Node.js or Bun" }),
|
|
4995
4995
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
4996
4996
|
/* @__PURE__ */ e(
|
|
4997
4997
|
"button",
|
|
4998
4998
|
{
|
|
4999
|
-
onClick:
|
|
4999
|
+
onClick: Y,
|
|
5000
5000
|
className: "px-4 py-2 text-sm font-medium text-gray-700 dark:text-zinc-200 bg-white dark:bg-zinc-700 border border-gray-300 dark:border-zinc-600 rounded-md hover:bg-gray-50 dark:hover:bg-zinc-600",
|
|
5001
5001
|
children: "Copy to Clipboard"
|
|
5002
5002
|
}
|
|
@@ -5013,24 +5013,24 @@ function Kr({
|
|
|
5013
5013
|
] })
|
|
5014
5014
|
] }) }),
|
|
5015
5015
|
/* @__PURE__ */ e(
|
|
5016
|
-
|
|
5016
|
+
Vr,
|
|
5017
5017
|
{
|
|
5018
5018
|
isOpen: _,
|
|
5019
|
-
onClose: () =>
|
|
5020
|
-
onImport:
|
|
5019
|
+
onClose: () => M(!1),
|
|
5020
|
+
onImport: ie
|
|
5021
5021
|
}
|
|
5022
5022
|
),
|
|
5023
5023
|
x.show && /* @__PURE__ */ e(
|
|
5024
|
-
|
|
5024
|
+
Kr,
|
|
5025
5025
|
{
|
|
5026
5026
|
issues: x.issues,
|
|
5027
|
-
onClose:
|
|
5028
|
-
onExecuteAnyway:
|
|
5027
|
+
onClose: w,
|
|
5028
|
+
onExecuteAnyway: T
|
|
5029
5029
|
}
|
|
5030
5030
|
)
|
|
5031
5031
|
] });
|
|
5032
5032
|
}
|
|
5033
|
-
function
|
|
5033
|
+
function Gr({ run: t, onClose: o }) {
|
|
5034
5034
|
const [n, r] = E(null), a = t.status === "error";
|
|
5035
5035
|
U(() => {
|
|
5036
5036
|
const u = (s) => {
|
|
@@ -5038,7 +5038,7 @@ function qr({ run: t, onClose: o }) {
|
|
|
5038
5038
|
};
|
|
5039
5039
|
return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
|
|
5040
5040
|
}, [o]);
|
|
5041
|
-
const i =
|
|
5041
|
+
const i = $(
|
|
5042
5042
|
(u) => {
|
|
5043
5043
|
u.target === u.currentTarget && o();
|
|
5044
5044
|
},
|
|
@@ -5252,7 +5252,7 @@ function qr({ run: t, onClose: o }) {
|
|
|
5252
5252
|
{
|
|
5253
5253
|
onClick: () => c(u.nodeId, u.preview),
|
|
5254
5254
|
className: "flex-1 px-3 py-1.5 text-xs font-medium bg-zinc-100 dark:bg-zinc-700 text-zinc-700 dark:text-zinc-300 rounded hover:bg-zinc-200 dark:hover:bg-zinc-600 transition-colors flex items-center justify-center gap-1.5",
|
|
5255
|
-
children: n === u.nodeId ? /* @__PURE__ */ l(
|
|
5255
|
+
children: n === u.nodeId ? /* @__PURE__ */ l(X, { children: [
|
|
5256
5256
|
/* @__PURE__ */ e(
|
|
5257
5257
|
"svg",
|
|
5258
5258
|
{
|
|
@@ -5272,7 +5272,7 @@ function qr({ run: t, onClose: o }) {
|
|
|
5272
5272
|
}
|
|
5273
5273
|
),
|
|
5274
5274
|
"Copied!"
|
|
5275
|
-
] }) : /* @__PURE__ */ l(
|
|
5275
|
+
] }) : /* @__PURE__ */ l(X, { children: [
|
|
5276
5276
|
/* @__PURE__ */ e(
|
|
5277
5277
|
"svg",
|
|
5278
5278
|
{
|
|
@@ -5328,8 +5328,8 @@ function qr({ run: t, onClose: o }) {
|
|
|
5328
5328
|
}
|
|
5329
5329
|
);
|
|
5330
5330
|
}
|
|
5331
|
-
function
|
|
5332
|
-
const [n, r] = E(0), a =
|
|
5331
|
+
function Jr({ runs: t, onClose: o }) {
|
|
5332
|
+
const [n, r] = E(0), a = Z(() => Math.max(...t.map((c) => c.outputs.length)), [t]), i = Z(
|
|
5333
5333
|
() => t.map((c) => c.outputs[n]),
|
|
5334
5334
|
[t, n]
|
|
5335
5335
|
), d = (c) => c < 1e3 ? `${c}ms` : `${(c / 1e3).toFixed(1)}s`, p = (c) => new Date(c).toLocaleTimeString(void 0, {
|
|
@@ -5456,7 +5456,7 @@ function Gr({ runs: t, onClose: o }) {
|
|
|
5456
5456
|
] })
|
|
5457
5457
|
] });
|
|
5458
5458
|
}
|
|
5459
|
-
async function
|
|
5459
|
+
async function Te(t) {
|
|
5460
5460
|
const o = (await import("./jszip.min-D499iiji.js").then((i) => i.j)).default, n = new o(), r = {
|
|
5461
5461
|
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5462
5462
|
runCount: t.length,
|
|
@@ -5480,7 +5480,7 @@ async function Le(t) {
|
|
|
5480
5480
|
timestampFormatted: new Date(i.timestamp).toISOString(),
|
|
5481
5481
|
status: i.status,
|
|
5482
5482
|
duration: i.duration,
|
|
5483
|
-
durationFormatted:
|
|
5483
|
+
durationFormatted: Zr(i.duration),
|
|
5484
5484
|
nodeCount: i.nodeCount,
|
|
5485
5485
|
error: i.error,
|
|
5486
5486
|
errorNodeId: i.errorNodeId,
|
|
@@ -5492,27 +5492,27 @@ async function Le(t) {
|
|
|
5492
5492
|
};
|
|
5493
5493
|
d.file("metadata.json", JSON.stringify(p, null, 2));
|
|
5494
5494
|
for (let c = 0; c < i.outputs.length; c++) {
|
|
5495
|
-
const m = i.outputs[c], u = await
|
|
5495
|
+
const m = i.outputs[c], u = await Yr(m.preview);
|
|
5496
5496
|
if (u) {
|
|
5497
|
-
const s =
|
|
5497
|
+
const s = Qr(u.type);
|
|
5498
5498
|
d.file(`output-${c + 1}-${m.nodeName}.${s}`, u);
|
|
5499
5499
|
}
|
|
5500
5500
|
}
|
|
5501
5501
|
}
|
|
5502
5502
|
const a = await n.generateAsync({ type: "blob" });
|
|
5503
|
-
|
|
5503
|
+
en(a, `floimg-history-${Xr(/* @__PURE__ */ new Date())}.zip`);
|
|
5504
5504
|
}
|
|
5505
|
-
async function
|
|
5506
|
-
return
|
|
5505
|
+
async function He(t) {
|
|
5506
|
+
return Te([t]);
|
|
5507
5507
|
}
|
|
5508
|
-
async function
|
|
5508
|
+
async function Yr(t) {
|
|
5509
5509
|
try {
|
|
5510
5510
|
return (await fetch(t)).blob();
|
|
5511
5511
|
} catch {
|
|
5512
5512
|
return null;
|
|
5513
5513
|
}
|
|
5514
5514
|
}
|
|
5515
|
-
function
|
|
5515
|
+
function Qr(t) {
|
|
5516
5516
|
return {
|
|
5517
5517
|
"image/png": "png",
|
|
5518
5518
|
"image/jpeg": "jpg",
|
|
@@ -5520,46 +5520,46 @@ function Yr(t) {
|
|
|
5520
5520
|
"image/gif": "gif"
|
|
5521
5521
|
}[t] || "png";
|
|
5522
5522
|
}
|
|
5523
|
-
function
|
|
5523
|
+
function Zr(t) {
|
|
5524
5524
|
if (t < 1e3) return `${t}ms`;
|
|
5525
5525
|
const o = t / 1e3;
|
|
5526
5526
|
if (o < 60) return `${o.toFixed(1)}s`;
|
|
5527
5527
|
const n = Math.floor(o / 60), r = Math.round(o % 60);
|
|
5528
5528
|
return `${n}m ${r}s`;
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5530
|
+
function Xr(t) {
|
|
5531
5531
|
return t.toISOString().split("T")[0];
|
|
5532
5532
|
}
|
|
5533
|
-
function
|
|
5533
|
+
function en(t, o) {
|
|
5534
5534
|
const n = URL.createObjectURL(t), r = document.createElement("a");
|
|
5535
5535
|
r.href = n, r.download = o, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
5536
5536
|
}
|
|
5537
|
-
function
|
|
5538
|
-
const r = y((g) => g.executionHistory), a = y((g) => g.clearHistory), i = y((g) => g.pinnedRunIds), d = y((g) => g.togglePinRun), [p, c] = E(null), [m, u] = E(!1), [s, h] = E([]), [f, v] = E(!1), { pinnedRuns: x, unpinnedRuns:
|
|
5537
|
+
function tn({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
5538
|
+
const r = y((g) => g.executionHistory), a = y((g) => g.clearHistory), i = y((g) => g.pinnedRunIds), d = y((g) => g.togglePinRun), [p, c] = E(null), [m, u] = E(!1), [s, h] = E([]), [f, v] = E(!1), { pinnedRuns: x, unpinnedRuns: w } = Z(() => {
|
|
5539
5539
|
const g = [], _ = [];
|
|
5540
|
-
for (const
|
|
5541
|
-
i.includes(
|
|
5540
|
+
for (const M of r)
|
|
5541
|
+
i.includes(M.id) ? g.push(M) : _.push(M);
|
|
5542
5542
|
return { pinnedRuns: g, unpinnedRuns: _ };
|
|
5543
|
-
}, [r, i]),
|
|
5543
|
+
}, [r, i]), I = Z(
|
|
5544
5544
|
() => r.filter((g) => s.includes(g.id)),
|
|
5545
5545
|
[r, s]
|
|
5546
5546
|
), b = (g) => {
|
|
5547
|
-
h((_) => _.includes(g) ? _.filter((
|
|
5548
|
-
},
|
|
5547
|
+
h((_) => _.includes(g) ? _.filter((M) => M !== g) : _.length >= 4 ? _ : [..._, g]);
|
|
5548
|
+
}, C = () => {
|
|
5549
5549
|
u(!1), h([]);
|
|
5550
|
-
}, [N,
|
|
5551
|
-
|
|
5550
|
+
}, [N, k] = E(!1), z = async () => {
|
|
5551
|
+
k(!0);
|
|
5552
5552
|
try {
|
|
5553
|
-
await
|
|
5553
|
+
await Te(r);
|
|
5554
5554
|
} finally {
|
|
5555
|
-
|
|
5555
|
+
k(!1);
|
|
5556
5556
|
}
|
|
5557
|
-
},
|
|
5558
|
-
|
|
5557
|
+
}, S = async () => {
|
|
5558
|
+
k(!0);
|
|
5559
5559
|
try {
|
|
5560
|
-
await
|
|
5560
|
+
await Te(x);
|
|
5561
5561
|
} finally {
|
|
5562
|
-
|
|
5562
|
+
k(!1);
|
|
5563
5563
|
}
|
|
5564
5564
|
};
|
|
5565
5565
|
return r.length === 0 ? /* @__PURE__ */ l("div", { className: "p-8 text-center text-zinc-500 dark:text-zinc-400", children: [
|
|
@@ -5607,11 +5607,11 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5607
5607
|
] }),
|
|
5608
5608
|
/* @__PURE__ */ e("p", { className: "text-xs text-zinc-500", children: m ? `Select runs to compare (${s.length}/4)` : "Past workflow runs" })
|
|
5609
5609
|
] }),
|
|
5610
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: m ? /* @__PURE__ */ l(
|
|
5610
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: m ? /* @__PURE__ */ l(X, { children: [
|
|
5611
5611
|
/* @__PURE__ */ e(
|
|
5612
5612
|
"button",
|
|
5613
5613
|
{
|
|
5614
|
-
onClick:
|
|
5614
|
+
onClick: C,
|
|
5615
5615
|
className: "text-sm text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300",
|
|
5616
5616
|
children: "Cancel"
|
|
5617
5617
|
}
|
|
@@ -5629,7 +5629,7 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5629
5629
|
]
|
|
5630
5630
|
}
|
|
5631
5631
|
)
|
|
5632
|
-
] }) : /* @__PURE__ */ l(
|
|
5632
|
+
] }) : /* @__PURE__ */ l(X, { children: [
|
|
5633
5633
|
r.length >= 2 && /* @__PURE__ */ e(
|
|
5634
5634
|
"button",
|
|
5635
5635
|
{
|
|
@@ -5641,7 +5641,7 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5641
5641
|
x.length > 0 && /* @__PURE__ */ e(
|
|
5642
5642
|
"button",
|
|
5643
5643
|
{
|
|
5644
|
-
onClick:
|
|
5644
|
+
onClick: S,
|
|
5645
5645
|
disabled: N,
|
|
5646
5646
|
className: "text-sm text-zinc-500 hover:text-teal-600 dark:hover:text-teal-400 disabled:opacity-50",
|
|
5647
5647
|
children: N ? "Exporting..." : "Export Pinned"
|
|
@@ -5650,7 +5650,7 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5650
5650
|
/* @__PURE__ */ e(
|
|
5651
5651
|
"button",
|
|
5652
5652
|
{
|
|
5653
|
-
onClick:
|
|
5653
|
+
onClick: z,
|
|
5654
5654
|
disabled: N,
|
|
5655
5655
|
className: "text-sm text-zinc-500 hover:text-teal-600 dark:hover:text-teal-400 disabled:opacity-50",
|
|
5656
5656
|
children: N ? "Exporting..." : "Export All"
|
|
@@ -5676,7 +5676,7 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5676
5676
|
] })
|
|
5677
5677
|
] }),
|
|
5678
5678
|
/* @__PURE__ */ e("div", { className: "space-y-3", children: x.map((g) => /* @__PURE__ */ e(
|
|
5679
|
-
|
|
5679
|
+
Fe,
|
|
5680
5680
|
{
|
|
5681
5681
|
run: g,
|
|
5682
5682
|
onShare: n,
|
|
@@ -5686,13 +5686,13 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5686
5686
|
onToggleSelect: () => b(g.id),
|
|
5687
5687
|
isPinned: !0,
|
|
5688
5688
|
onTogglePin: () => d(g.id),
|
|
5689
|
-
onExport: () =>
|
|
5689
|
+
onExport: () => He(g)
|
|
5690
5690
|
},
|
|
5691
5691
|
g.id
|
|
5692
5692
|
)) })
|
|
5693
5693
|
] }),
|
|
5694
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
5695
|
-
|
|
5694
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: w.map((g) => /* @__PURE__ */ e(
|
|
5695
|
+
Fe,
|
|
5696
5696
|
{
|
|
5697
5697
|
run: g,
|
|
5698
5698
|
onShare: n,
|
|
@@ -5702,23 +5702,23 @@ function en({ isGuest: t = !1, signUpUrl: o, onShare: n }) {
|
|
|
5702
5702
|
onToggleSelect: () => b(g.id),
|
|
5703
5703
|
isPinned: !1,
|
|
5704
5704
|
onTogglePin: () => d(g.id),
|
|
5705
|
-
onExport: () =>
|
|
5705
|
+
onExport: () => He(g)
|
|
5706
5706
|
},
|
|
5707
5707
|
g.id
|
|
5708
5708
|
)) }),
|
|
5709
|
-
p && /* @__PURE__ */ e(
|
|
5710
|
-
f &&
|
|
5711
|
-
|
|
5709
|
+
p && /* @__PURE__ */ e(Gr, { run: p, onClose: () => c(null) }),
|
|
5710
|
+
f && I.length >= 2 && /* @__PURE__ */ e(
|
|
5711
|
+
Jr,
|
|
5712
5712
|
{
|
|
5713
|
-
runs:
|
|
5713
|
+
runs: I,
|
|
5714
5714
|
onClose: () => {
|
|
5715
|
-
v(!1),
|
|
5715
|
+
v(!1), C();
|
|
5716
5716
|
}
|
|
5717
5717
|
}
|
|
5718
5718
|
)
|
|
5719
5719
|
] });
|
|
5720
5720
|
}
|
|
5721
|
-
function
|
|
5721
|
+
function Fe({
|
|
5722
5722
|
run: t,
|
|
5723
5723
|
onShare: o,
|
|
5724
5724
|
onClick: n,
|
|
@@ -5729,7 +5729,7 @@ function Oe({
|
|
|
5729
5729
|
onTogglePin: p,
|
|
5730
5730
|
onExport: c
|
|
5731
5731
|
}) {
|
|
5732
|
-
const m = t.status === "error", u =
|
|
5732
|
+
const m = t.status === "error", u = Z(() => new Date(t.timestamp).toLocaleTimeString(void 0, {
|
|
5733
5733
|
hour: "numeric",
|
|
5734
5734
|
minute: "2-digit"
|
|
5735
5735
|
}), [t.timestamp]), s = (f) => f < 1e3 ? `${f}ms` : `${(f / 1e3).toFixed(1)}s`;
|
|
@@ -5885,7 +5885,7 @@ function Oe({
|
|
|
5885
5885
|
}
|
|
5886
5886
|
);
|
|
5887
5887
|
}
|
|
5888
|
-
const
|
|
5888
|
+
const je = [
|
|
5889
5889
|
{
|
|
5890
5890
|
id: "revenue-chart",
|
|
5891
5891
|
name: "Revenue Dashboard",
|
|
@@ -6328,8 +6328,8 @@ const _e = [
|
|
|
6328
6328
|
]
|
|
6329
6329
|
}
|
|
6330
6330
|
}
|
|
6331
|
-
],
|
|
6332
|
-
async function
|
|
6331
|
+
], rn = "https://api.floimg.com";
|
|
6332
|
+
async function nn(t) {
|
|
6333
6333
|
const o = "floimg-templates-cache";
|
|
6334
6334
|
try {
|
|
6335
6335
|
const n = await fetch(`${t}/api/templates`);
|
|
@@ -6349,23 +6349,23 @@ async function rn(t) {
|
|
|
6349
6349
|
return JSON.parse(n);
|
|
6350
6350
|
} catch {
|
|
6351
6351
|
}
|
|
6352
|
-
return
|
|
6352
|
+
return je;
|
|
6353
6353
|
}
|
|
6354
6354
|
}
|
|
6355
|
-
function
|
|
6356
|
-
const [n, r] = E(null), [a, i] = E(""), { data: d =
|
|
6355
|
+
function on({ onSelect: t, apiUrl: o = rn }) {
|
|
6356
|
+
const [n, r] = E(null), [a, i] = E(""), { data: d = je, isLoading: p } = Ne({
|
|
6357
6357
|
queryKey: ["templates", o],
|
|
6358
|
-
queryFn: () =>
|
|
6358
|
+
queryFn: () => nn(o),
|
|
6359
6359
|
staleTime: 5 * 60 * 1e3,
|
|
6360
6360
|
// 5 minutes
|
|
6361
6361
|
gcTime: 30 * 60 * 1e3,
|
|
6362
6362
|
// 30 minutes (formerly cacheTime)
|
|
6363
|
-
placeholderData:
|
|
6363
|
+
placeholderData: je,
|
|
6364
6364
|
retry: 1
|
|
6365
|
-
}), c =
|
|
6365
|
+
}), c = Z(() => {
|
|
6366
6366
|
const u = new Set(d.map((s) => s.category));
|
|
6367
6367
|
return Array.from(u).sort();
|
|
6368
|
-
}, [d]), m =
|
|
6368
|
+
}, [d]), m = Z(() => {
|
|
6369
6369
|
let u = d;
|
|
6370
6370
|
if (n && (u = u.filter((s) => s.category === n)), a) {
|
|
6371
6371
|
const s = a.toLowerCase();
|
|
@@ -6416,7 +6416,7 @@ function nn({ onSelect: t, apiUrl: o = tn }) {
|
|
|
6416
6416
|
] }),
|
|
6417
6417
|
p && d.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-12 text-gray-500 dark:text-zinc-400", children: "Loading templates..." }),
|
|
6418
6418
|
m.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-12 text-gray-500 dark:text-zinc-400", children: "No templates found matching your criteria." }) : /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: m.map((u) => /* @__PURE__ */ e(
|
|
6419
|
-
|
|
6419
|
+
an,
|
|
6420
6420
|
{
|
|
6421
6421
|
template: u,
|
|
6422
6422
|
onSelect: () => t(u.id)
|
|
@@ -6425,7 +6425,7 @@ function nn({ onSelect: t, apiUrl: o = tn }) {
|
|
|
6425
6425
|
)) })
|
|
6426
6426
|
] });
|
|
6427
6427
|
}
|
|
6428
|
-
function
|
|
6428
|
+
function an({ template: t, onSelect: o }) {
|
|
6429
6429
|
const n = t.nodeCount || t.workflow.nodes.length, r = t.workflow.edges.length, a = {
|
|
6430
6430
|
quickchart: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
6431
6431
|
mermaid: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-300",
|
|
@@ -6535,7 +6535,7 @@ function on({ template: t, onSelect: o }) {
|
|
|
6535
6535
|
] })
|
|
6536
6536
|
] });
|
|
6537
6537
|
}
|
|
6538
|
-
function
|
|
6538
|
+
function sn({
|
|
6539
6539
|
workflow: t,
|
|
6540
6540
|
isActive: o,
|
|
6541
6541
|
onLoad: n,
|
|
@@ -6546,8 +6546,8 @@ function an({
|
|
|
6546
6546
|
const [d, p] = E(!1), [c, m] = E(t.name), [u, s] = E(!1), h = () => {
|
|
6547
6547
|
c.trim() && c !== t.name && a(c.trim()), p(!1);
|
|
6548
6548
|
}, f = (v) => {
|
|
6549
|
-
const x = new Date(v),
|
|
6550
|
-
return b < 1 ? "Just now" : b < 60 ? `${b}m ago` :
|
|
6549
|
+
const x = new Date(v), I = (/* @__PURE__ */ new Date()).getTime() - x.getTime(), b = Math.floor(I / 6e4), C = Math.floor(I / 36e5), N = Math.floor(I / 864e5);
|
|
6550
|
+
return b < 1 ? "Just now" : b < 60 ? `${b}m ago` : C < 24 ? `${C}h ago` : N < 7 ? `${N}d ago` : x.toLocaleDateString();
|
|
6551
6551
|
};
|
|
6552
6552
|
return /* @__PURE__ */ l(
|
|
6553
6553
|
"div",
|
|
@@ -6588,7 +6588,7 @@ function an({
|
|
|
6588
6588
|
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })
|
|
6589
6589
|
}
|
|
6590
6590
|
),
|
|
6591
|
-
u && /* @__PURE__ */ l(
|
|
6591
|
+
u && /* @__PURE__ */ l(X, { children: [
|
|
6592
6592
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => s(!1) }),
|
|
6593
6593
|
/* @__PURE__ */ l("div", { className: "absolute right-0 top-full mt-1 w-36 bg-white dark:bg-zinc-800 rounded-lg shadow-lg border border-zinc-200 dark:border-zinc-700 py-1 z-20", children: [
|
|
6594
6594
|
/* @__PURE__ */ e(
|
|
@@ -6630,11 +6630,11 @@ function an({
|
|
|
6630
6630
|
}
|
|
6631
6631
|
);
|
|
6632
6632
|
}
|
|
6633
|
-
function
|
|
6633
|
+
function ln() {
|
|
6634
6634
|
const t = y((u) => u.showLibrary), o = y((u) => u.toggleLibrary), n = y((u) => u.savedWorkflows), r = y((u) => u.activeWorkflowId), a = y((u) => u.loadWorkflow), i = y((u) => u.deleteWorkflow), d = y((u) => u.renameWorkflow), p = y((u) => u.duplicateWorkflow), c = y((u) => u.newWorkflow);
|
|
6635
6635
|
if (!t) return null;
|
|
6636
6636
|
const m = [...n].sort((u, s) => s.updatedAt - u.updatedAt);
|
|
6637
|
-
return /* @__PURE__ */ l(
|
|
6637
|
+
return /* @__PURE__ */ l(X, { children: [
|
|
6638
6638
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: o }),
|
|
6639
6639
|
/* @__PURE__ */ l("div", { className: "fixed left-0 top-0 bottom-0 w-80 bg-zinc-50 dark:bg-zinc-900 border-r border-zinc-200 dark:border-zinc-700 z-50 flex flex-col shadow-xl", children: [
|
|
6640
6640
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
|
|
@@ -6699,7 +6699,7 @@ function sn() {
|
|
|
6699
6699
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
|
|
6700
6700
|
/* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 dark:text-zinc-500 mt-1", children: "Build a workflow and save it to see it here" })
|
|
6701
6701
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: m.map((u) => /* @__PURE__ */ e(
|
|
6702
|
-
|
|
6702
|
+
sn,
|
|
6703
6703
|
{
|
|
6704
6704
|
workflow: u,
|
|
6705
6705
|
isActive: u.id === r,
|
|
@@ -6721,7 +6721,7 @@ function sn() {
|
|
|
6721
6721
|
] })
|
|
6722
6722
|
] });
|
|
6723
6723
|
}
|
|
6724
|
-
const
|
|
6724
|
+
const dn = [
|
|
6725
6725
|
{
|
|
6726
6726
|
id: "openai",
|
|
6727
6727
|
name: "OpenAI",
|
|
@@ -6757,7 +6757,7 @@ const ln = [
|
|
|
6757
6757
|
placeholder: "sk-or-...",
|
|
6758
6758
|
docsUrl: "https://openrouter.ai/keys"
|
|
6759
6759
|
}
|
|
6760
|
-
],
|
|
6760
|
+
], cn = [
|
|
6761
6761
|
{
|
|
6762
6762
|
id: "ollama",
|
|
6763
6763
|
name: "Ollama",
|
|
@@ -6773,8 +6773,8 @@ const ln = [
|
|
|
6773
6773
|
docsUrl: "https://lmstudio.ai"
|
|
6774
6774
|
}
|
|
6775
6775
|
];
|
|
6776
|
-
function
|
|
6777
|
-
const o =
|
|
6776
|
+
function mn({ provider: t }) {
|
|
6777
|
+
const o = A((h) => h.ai), n = A((h) => h.setAIProvider), r = o[t.id], a = (r == null ? void 0 : r.enabled) ?? !1, i = (r == null ? void 0 : r.apiKey) ?? "", [d, p] = E(i), [c, m] = E(!1), u = () => {
|
|
6778
6778
|
n(t.id, {
|
|
6779
6779
|
apiKey: d,
|
|
6780
6780
|
enabled: !a
|
|
@@ -6854,8 +6854,8 @@ function cn({ provider: t }) {
|
|
|
6854
6854
|
) })
|
|
6855
6855
|
] });
|
|
6856
6856
|
}
|
|
6857
|
-
function
|
|
6858
|
-
const o =
|
|
6857
|
+
function un({ provider: t }) {
|
|
6858
|
+
const o = A((u) => u.ai), n = A((u) => u.setAIProvider), r = o[t.id], a = (r == null ? void 0 : r.enabled) ?? !1, i = (r == null ? void 0 : r.baseUrl) ?? t.defaultUrl, [d, p] = E(i), c = () => {
|
|
6859
6859
|
n(t.id, {
|
|
6860
6860
|
baseUrl: d,
|
|
6861
6861
|
enabled: !a
|
|
@@ -6909,8 +6909,8 @@ function mn({ provider: t }) {
|
|
|
6909
6909
|
) })
|
|
6910
6910
|
] });
|
|
6911
6911
|
}
|
|
6912
|
-
function
|
|
6913
|
-
const t =
|
|
6912
|
+
function pn() {
|
|
6913
|
+
const t = A((n) => n.showSettings), o = A((n) => n.closeSettings);
|
|
6914
6914
|
return t ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl max-w-xl w-full mx-4 max-h-[85vh] flex flex-col", children: [
|
|
6915
6915
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
6916
6916
|
/* @__PURE__ */ l("div", { children: [
|
|
@@ -6937,11 +6937,11 @@ function un() {
|
|
|
6937
6937
|
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
|
|
6938
6938
|
/* @__PURE__ */ l("section", { children: [
|
|
6939
6939
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Cloud Providers" }),
|
|
6940
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
6940
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: dn.map((n) => /* @__PURE__ */ e(mn, { provider: n }, n.id)) })
|
|
6941
6941
|
] }),
|
|
6942
6942
|
/* @__PURE__ */ l("section", { children: [
|
|
6943
6943
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
|
|
6944
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
6944
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: cn.map((n) => /* @__PURE__ */ e(un, { provider: n }, n.id)) })
|
|
6945
6945
|
] }),
|
|
6946
6946
|
/* @__PURE__ */ e("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: /* @__PURE__ */ l("div", { className: "flex items-start gap-3", children: [
|
|
6947
6947
|
/* @__PURE__ */ e(
|
|
@@ -6978,90 +6978,101 @@ function un() {
|
|
|
6978
6978
|
) })
|
|
6979
6979
|
] }) }) : null;
|
|
6980
6980
|
}
|
|
6981
|
-
let
|
|
6982
|
-
function
|
|
6981
|
+
let ve = null;
|
|
6982
|
+
function hn(t) {
|
|
6983
6983
|
return t.includes("Unknown node type") ? "invalid_node_type" : t.includes("rate limit") || t.includes("429") || t.includes("quota") ? "rate_limit" : t.includes("network") || t.includes("Failed to fetch") || t.includes("timeout") || t.includes("ECONNREFUSED") ? "network" : t.includes("generate") || t.includes("Gemini") || t.includes("workflow") ? "generation_error" : "unknown";
|
|
6984
6984
|
}
|
|
6985
|
-
function
|
|
6985
|
+
function fn(t) {
|
|
6986
6986
|
return t.startsWith("generator:") || t.startsWith("transform:stability") || t.startsWith("transform:openai") || t.startsWith("transform:replicate") || t.startsWith("vision:") || t.startsWith("text:");
|
|
6987
6987
|
}
|
|
6988
|
-
function
|
|
6988
|
+
function gn({
|
|
6989
6989
|
isOpen: t,
|
|
6990
6990
|
onClose: o,
|
|
6991
6991
|
onApplyWorkflow: n,
|
|
6992
6992
|
onGenerationSuccess: r,
|
|
6993
6993
|
onGenerationFailed: a
|
|
6994
6994
|
}) {
|
|
6995
|
-
|
|
6995
|
+
var j, he;
|
|
6996
|
+
const [i, d] = E([]), [p, c] = E(""), [m, u] = E(!1), [s, h] = E(null), [f, v] = E(""), [x, w] = E(null), [I, b] = E(null), [C, N] = E(""), [k, z] = E(), [S, g] = E(!1), [_, M] = E(), [R, B] = E([]), [H, ee] = E(""), [te, ne] = E(!1), oe = re(null), L = re(null), P = re(null);
|
|
6996
6997
|
U(() => {
|
|
6997
|
-
|
|
6998
|
-
|
|
6998
|
+
function T(G) {
|
|
6999
|
+
P.current && !P.current.contains(G.target) && ne(!1);
|
|
7000
|
+
}
|
|
7001
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
7002
|
+
}, []), U(() => {
|
|
7003
|
+
t && I === null && Dt().then((T) => {
|
|
7004
|
+
var G;
|
|
7005
|
+
if (b(T.available), N(T.message), z(T.reason), g(T.isCloudDeployment ?? !1), M(T.supportUrl), T.availableModels) {
|
|
7006
|
+
B(T.availableModels);
|
|
7007
|
+
const Y = T.availableModels.find((ie) => ie.isDefault);
|
|
7008
|
+
ee((Y == null ? void 0 : Y.id) || ((G = T.availableModels[0]) == null ? void 0 : G.id) || "");
|
|
7009
|
+
}
|
|
6999
7010
|
}).catch(() => {
|
|
7000
|
-
b(!1), N("Failed to check AI availability"),
|
|
7011
|
+
b(!1), N("Failed to check AI availability"), z("service_unavailable");
|
|
7001
7012
|
});
|
|
7002
|
-
}, [t,
|
|
7003
|
-
t &&
|
|
7013
|
+
}, [t, I]), U(() => {
|
|
7014
|
+
t && L.current && L.current.focus();
|
|
7004
7015
|
}, [t]), U(() => {
|
|
7005
|
-
var
|
|
7006
|
-
(
|
|
7016
|
+
var T;
|
|
7017
|
+
(T = oe.current) == null || T.scrollIntoView({ behavior: "smooth" });
|
|
7007
7018
|
}, [i]);
|
|
7008
|
-
const
|
|
7019
|
+
const V = $(() => {
|
|
7009
7020
|
if (!p.trim() || m) return;
|
|
7010
|
-
const
|
|
7021
|
+
const T = {
|
|
7011
7022
|
role: "user",
|
|
7012
7023
|
content: p.trim(),
|
|
7013
7024
|
timestamp: Date.now()
|
|
7014
7025
|
};
|
|
7015
|
-
d((
|
|
7016
|
-
let
|
|
7017
|
-
const
|
|
7018
|
-
|
|
7026
|
+
d((W) => [...W, T]), c(""), u(!0), w(null), h(null), v("");
|
|
7027
|
+
let G;
|
|
7028
|
+
const Y = T.content.length, ie = i.length > 0;
|
|
7029
|
+
ve = Xe(
|
|
7019
7030
|
"/api/generate/workflow/stream",
|
|
7020
|
-
{ prompt:
|
|
7031
|
+
{ prompt: T.content, history: i, model: H },
|
|
7021
7032
|
{
|
|
7022
|
-
onMessage: (
|
|
7023
|
-
if (
|
|
7024
|
-
const
|
|
7033
|
+
onMessage: (W) => {
|
|
7034
|
+
if (W.type, W.type === "generation.progress" && (h(W.data.phase), v(W.data.message)), W.type === "generation.completed" && (G = W.data, r)) {
|
|
7035
|
+
const ge = W.data.nodes.length, Le = W.data.nodes.some((ut) => fn(ut.nodeType));
|
|
7025
7036
|
r({
|
|
7026
|
-
nodeCount:
|
|
7027
|
-
hasAINodes:
|
|
7028
|
-
promptLength:
|
|
7029
|
-
isConversation:
|
|
7037
|
+
nodeCount: ge,
|
|
7038
|
+
hasAINodes: Le,
|
|
7039
|
+
promptLength: Y,
|
|
7040
|
+
isConversation: ie
|
|
7030
7041
|
});
|
|
7031
7042
|
}
|
|
7032
|
-
|
|
7033
|
-
errorType:
|
|
7034
|
-
promptLength:
|
|
7035
|
-
isConversation:
|
|
7043
|
+
W.type === "generation.error" && (w(W.data.error), a && a({
|
|
7044
|
+
errorType: hn(W.data.error),
|
|
7045
|
+
promptLength: Y,
|
|
7046
|
+
isConversation: ie
|
|
7036
7047
|
}));
|
|
7037
7048
|
},
|
|
7038
|
-
onError: (
|
|
7039
|
-
|
|
7049
|
+
onError: (W) => {
|
|
7050
|
+
ve = null, w(W.message || "Failed to generate workflow"), u(!1), h(null), a && a({
|
|
7040
7051
|
errorType: "network",
|
|
7041
|
-
promptLength:
|
|
7042
|
-
isConversation:
|
|
7052
|
+
promptLength: Y,
|
|
7053
|
+
isConversation: ie
|
|
7043
7054
|
});
|
|
7044
7055
|
},
|
|
7045
7056
|
onClose: () => {
|
|
7046
|
-
|
|
7047
|
-
const
|
|
7057
|
+
ve = null;
|
|
7058
|
+
const W = {
|
|
7048
7059
|
role: "assistant",
|
|
7049
|
-
content:
|
|
7050
|
-
workflow:
|
|
7060
|
+
content: G ? "I've created a workflow based on your description. Click 'Apply to Canvas' to use it." : "I couldn't generate a workflow. Please try a different description.",
|
|
7061
|
+
workflow: G,
|
|
7051
7062
|
timestamp: Date.now()
|
|
7052
7063
|
};
|
|
7053
|
-
d((
|
|
7064
|
+
d((ge) => [...ge, W]), u(!1), h(null), v("");
|
|
7054
7065
|
}
|
|
7055
7066
|
}
|
|
7056
7067
|
);
|
|
7057
|
-
}, [p, m, i, r, a]),
|
|
7058
|
-
|
|
7059
|
-
}, []),
|
|
7060
|
-
|
|
7061
|
-
},
|
|
7062
|
-
n(
|
|
7063
|
-
},
|
|
7064
|
-
d([]),
|
|
7068
|
+
}, [p, m, i, H, r, a]), K = $(() => {
|
|
7069
|
+
ve && (ve.abort(), ve = null), u(!1), h(null), v("");
|
|
7070
|
+
}, []), q = (T) => {
|
|
7071
|
+
T.key === "Enter" && !T.shiftKey && (T.preventDefault(), V());
|
|
7072
|
+
}, J = (T) => {
|
|
7073
|
+
n(T), o();
|
|
7074
|
+
}, pe = () => {
|
|
7075
|
+
d([]), w(null);
|
|
7065
7076
|
};
|
|
7066
7077
|
return t ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-2xl mx-4 h-[80vh] flex flex-col", children: [
|
|
7067
7078
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
@@ -7087,13 +7098,60 @@ function fn({
|
|
|
7087
7098
|
),
|
|
7088
7099
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "AI Workflow Generator" })
|
|
7089
7100
|
] }),
|
|
7090
|
-
/* @__PURE__ */
|
|
7101
|
+
R.length > 1 ? /* @__PURE__ */ l("div", { className: "relative", ref: P, children: [
|
|
7102
|
+
/* @__PURE__ */ l(
|
|
7103
|
+
"button",
|
|
7104
|
+
{
|
|
7105
|
+
onClick: () => ne(!te),
|
|
7106
|
+
className: "flex items-center gap-1.5 text-xs bg-teal-100 dark:bg-teal-900 text-teal-700 dark:text-teal-300 px-2 py-1 rounded hover:bg-teal-200 dark:hover:bg-teal-800 transition-colors",
|
|
7107
|
+
disabled: m,
|
|
7108
|
+
children: [
|
|
7109
|
+
/* @__PURE__ */ e("span", { children: ((j = R.find((T) => T.id === H)) == null ? void 0 : j.name) || "Select Model" }),
|
|
7110
|
+
/* @__PURE__ */ e(
|
|
7111
|
+
"svg",
|
|
7112
|
+
{
|
|
7113
|
+
className: `h-3 w-3 transition-transform ${te ? "rotate-180" : ""}`,
|
|
7114
|
+
fill: "none",
|
|
7115
|
+
viewBox: "0 0 24 24",
|
|
7116
|
+
stroke: "currentColor",
|
|
7117
|
+
children: /* @__PURE__ */ e(
|
|
7118
|
+
"path",
|
|
7119
|
+
{
|
|
7120
|
+
strokeLinecap: "round",
|
|
7121
|
+
strokeLinejoin: "round",
|
|
7122
|
+
strokeWidth: 2,
|
|
7123
|
+
d: "M19 9l-7 7-7-7"
|
|
7124
|
+
}
|
|
7125
|
+
)
|
|
7126
|
+
}
|
|
7127
|
+
)
|
|
7128
|
+
]
|
|
7129
|
+
}
|
|
7130
|
+
),
|
|
7131
|
+
te && /* @__PURE__ */ e("div", { className: "absolute top-full left-0 mt-1 w-56 bg-white dark:bg-zinc-800 rounded-lg shadow-lg border border-gray-200 dark:border-zinc-700 py-1 z-10", children: R.map((T) => /* @__PURE__ */ l(
|
|
7132
|
+
"button",
|
|
7133
|
+
{
|
|
7134
|
+
onClick: () => {
|
|
7135
|
+
ee(T.id), ne(!1);
|
|
7136
|
+
},
|
|
7137
|
+
className: `w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-zinc-700 ${H === T.id ? "bg-teal-50 dark:bg-teal-900/30" : ""}`,
|
|
7138
|
+
children: [
|
|
7139
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
7140
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-gray-900 dark:text-white", children: T.name }),
|
|
7141
|
+
T.isDefault && /* @__PURE__ */ e("span", { className: "text-xs text-teal-600 dark:text-teal-400", children: "Default" })
|
|
7142
|
+
] }),
|
|
7143
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-zinc-400 mt-0.5", children: T.description })
|
|
7144
|
+
]
|
|
7145
|
+
},
|
|
7146
|
+
T.id
|
|
7147
|
+
)) })
|
|
7148
|
+
] }) : /* @__PURE__ */ e("span", { className: "text-xs bg-teal-100 dark:bg-teal-900 text-teal-700 dark:text-teal-300 px-2 py-0.5 rounded", children: ((he = R[0]) == null ? void 0 : he.name) || "Gemini" })
|
|
7091
7149
|
] }),
|
|
7092
7150
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
7093
7151
|
i.length > 0 && /* @__PURE__ */ e(
|
|
7094
7152
|
"button",
|
|
7095
7153
|
{
|
|
7096
|
-
onClick:
|
|
7154
|
+
onClick: pe,
|
|
7097
7155
|
className: "p-2 text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded",
|
|
7098
7156
|
title: "New Chat",
|
|
7099
7157
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -7126,8 +7184,8 @@ function fn({
|
|
|
7126
7184
|
] })
|
|
7127
7185
|
] }),
|
|
7128
7186
|
/* @__PURE__ */ l("div", { className: "flex-1 overflow-auto p-4 space-y-4", children: [
|
|
7129
|
-
|
|
7130
|
-
|
|
7187
|
+
I === !1 && /* @__PURE__ */ e("div", { className: "bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4", children: /* @__PURE__ */ l("div", { className: "flex items-start gap-3", children: [
|
|
7188
|
+
k === "tier_limit" ? /* @__PURE__ */ e(
|
|
7131
7189
|
"svg",
|
|
7132
7190
|
{
|
|
7133
7191
|
className: "h-5 w-5 text-amber-600 dark:text-amber-400 mt-0.5",
|
|
@@ -7163,10 +7221,10 @@ function fn({
|
|
|
7163
7221
|
}
|
|
7164
7222
|
),
|
|
7165
7223
|
/* @__PURE__ */ l("div", { children: [
|
|
7166
|
-
/* @__PURE__ */ e("p", { className: "font-medium text-amber-800 dark:text-amber-200", children:
|
|
7167
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-amber-700 dark:text-amber-300 mt-1", children:
|
|
7224
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: k === "tier_limit" ? "AI Workflow Generation Not Available" : "AI Generation Not Available" }),
|
|
7225
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-amber-700 dark:text-amber-300 mt-1", children: C }),
|
|
7168
7226
|
/* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row gap-2 mt-3", children: [
|
|
7169
|
-
|
|
7227
|
+
k === "tier_limit" && /* @__PURE__ */ e(
|
|
7170
7228
|
"a",
|
|
7171
7229
|
{
|
|
7172
7230
|
href: "/pricing",
|
|
@@ -7174,7 +7232,7 @@ function fn({
|
|
|
7174
7232
|
children: "View Plans"
|
|
7175
7233
|
}
|
|
7176
7234
|
),
|
|
7177
|
-
|
|
7235
|
+
k === "service_unavailable" && _ && /* @__PURE__ */ e(
|
|
7178
7236
|
"a",
|
|
7179
7237
|
{
|
|
7180
7238
|
href: _,
|
|
@@ -7182,7 +7240,7 @@ function fn({
|
|
|
7182
7240
|
children: "Contact Support"
|
|
7183
7241
|
}
|
|
7184
7242
|
),
|
|
7185
|
-
|
|
7243
|
+
k === "not_configured" && !S && /* @__PURE__ */ e(
|
|
7186
7244
|
"a",
|
|
7187
7245
|
{
|
|
7188
7246
|
href: "https://floimg.com/docs/studio/ai-workflows",
|
|
@@ -7195,7 +7253,7 @@ function fn({
|
|
|
7195
7253
|
] })
|
|
7196
7254
|
] })
|
|
7197
7255
|
] }) }),
|
|
7198
|
-
i.length === 0 &&
|
|
7256
|
+
i.length === 0 && I !== !1 && /* @__PURE__ */ l("div", { className: "text-center py-8", children: [
|
|
7199
7257
|
/* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-teal-100 dark:bg-teal-900/50 rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
7200
7258
|
"svg",
|
|
7201
7259
|
{
|
|
@@ -7222,62 +7280,62 @@ function fn({
|
|
|
7222
7280
|
"Generate an image with Gemini, then use it as a reference to create a variation with different lighting",
|
|
7223
7281
|
"Create a product mockup: generate a minimalist logo, then composite it onto a t-shirt image",
|
|
7224
7282
|
"Build an AI art pipeline: generate a base image, apply artistic style transfer, then upscale to 4K"
|
|
7225
|
-
].map((
|
|
7283
|
+
].map((T, G) => /* @__PURE__ */ l(
|
|
7226
7284
|
"button",
|
|
7227
7285
|
{
|
|
7228
|
-
onClick: () => c(
|
|
7286
|
+
onClick: () => c(T),
|
|
7229
7287
|
className: "block w-full text-left text-sm px-4 py-2 bg-gray-100 dark:bg-zinc-700 hover:bg-gray-200 dark:hover:bg-zinc-600 rounded-lg text-gray-700 dark:text-zinc-300 transition-colors",
|
|
7230
7288
|
children: [
|
|
7231
7289
|
'"',
|
|
7232
|
-
|
|
7290
|
+
T,
|
|
7233
7291
|
'"'
|
|
7234
7292
|
]
|
|
7235
7293
|
},
|
|
7236
|
-
|
|
7294
|
+
G
|
|
7237
7295
|
)) })
|
|
7238
7296
|
] }),
|
|
7239
|
-
i.map((
|
|
7297
|
+
i.map((T, G) => /* @__PURE__ */ e(
|
|
7240
7298
|
"div",
|
|
7241
7299
|
{
|
|
7242
|
-
className: `flex ${
|
|
7300
|
+
className: `flex ${T.role === "user" ? "justify-end" : "justify-start"}`,
|
|
7243
7301
|
children: /* @__PURE__ */ l(
|
|
7244
7302
|
"div",
|
|
7245
7303
|
{
|
|
7246
|
-
className: `max-w-[80%] rounded-lg px-4 py-3 ${
|
|
7304
|
+
className: `max-w-[80%] rounded-lg px-4 py-3 ${T.role === "user" ? "bg-teal-600 text-white" : "bg-gray-100 dark:bg-zinc-700 text-gray-900 dark:text-white"}`,
|
|
7247
7305
|
children: [
|
|
7248
|
-
/* @__PURE__ */ e("p", { className: "text-sm whitespace-pre-wrap", children:
|
|
7249
|
-
|
|
7306
|
+
/* @__PURE__ */ e("p", { className: "text-sm whitespace-pre-wrap", children: T.content }),
|
|
7307
|
+
T.role === "assistant" && T.workflow && /* @__PURE__ */ l("div", { className: "mt-3 pt-3 border-t border-gray-200 dark:border-zinc-600", children: [
|
|
7250
7308
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between mb-2", children: [
|
|
7251
7309
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-500 dark:text-zinc-400", children: "Generated Workflow" }),
|
|
7252
7310
|
/* @__PURE__ */ e(
|
|
7253
7311
|
"button",
|
|
7254
7312
|
{
|
|
7255
|
-
onClick: () =>
|
|
7313
|
+
onClick: () => J(T.workflow),
|
|
7256
7314
|
className: "text-xs px-3 py-1 bg-teal-600 hover:bg-teal-700 text-white rounded transition-colors",
|
|
7257
7315
|
children: "Apply to Canvas"
|
|
7258
7316
|
}
|
|
7259
7317
|
)
|
|
7260
7318
|
] }),
|
|
7261
7319
|
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 rounded p-2 text-xs", children: /* @__PURE__ */ l("div", { className: "space-y-1", children: [
|
|
7262
|
-
|
|
7320
|
+
T.workflow.nodes.map((Y, ie) => /* @__PURE__ */ l(
|
|
7263
7321
|
"div",
|
|
7264
7322
|
{
|
|
7265
7323
|
className: "flex items-center gap-2 text-gray-600 dark:text-zinc-300",
|
|
7266
7324
|
children: [
|
|
7267
|
-
/* @__PURE__ */ e("span", { className: "font-mono bg-gray-100 dark:bg-zinc-700 px-1.5 py-0.5 rounded", children:
|
|
7268
|
-
|
|
7325
|
+
/* @__PURE__ */ e("span", { className: "font-mono bg-gray-100 dark:bg-zinc-700 px-1.5 py-0.5 rounded", children: Y.nodeType.split(":").pop() }),
|
|
7326
|
+
Y.label && /* @__PURE__ */ l("span", { className: "text-gray-400", children: [
|
|
7269
7327
|
"(",
|
|
7270
|
-
|
|
7328
|
+
Y.label,
|
|
7271
7329
|
")"
|
|
7272
7330
|
] })
|
|
7273
7331
|
]
|
|
7274
7332
|
},
|
|
7275
|
-
|
|
7333
|
+
ie
|
|
7276
7334
|
)),
|
|
7277
|
-
|
|
7278
|
-
|
|
7335
|
+
T.workflow.edges.length > 0 && /* @__PURE__ */ l("div", { className: "text-gray-400 dark:text-zinc-500 pt-1", children: [
|
|
7336
|
+
T.workflow.edges.length,
|
|
7279
7337
|
" connection",
|
|
7280
|
-
|
|
7338
|
+
T.workflow.edges.length !== 1 ? "s" : ""
|
|
7281
7339
|
] })
|
|
7282
7340
|
] }) })
|
|
7283
7341
|
] })
|
|
@@ -7285,7 +7343,7 @@ function fn({
|
|
|
7285
7343
|
}
|
|
7286
7344
|
)
|
|
7287
7345
|
},
|
|
7288
|
-
|
|
7346
|
+
G
|
|
7289
7347
|
)),
|
|
7290
7348
|
m && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ l("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: [
|
|
7291
7349
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
@@ -7384,7 +7442,7 @@ function fn({
|
|
|
7384
7442
|
/* @__PURE__ */ e(
|
|
7385
7443
|
"button",
|
|
7386
7444
|
{
|
|
7387
|
-
onClick:
|
|
7445
|
+
onClick: K,
|
|
7388
7446
|
className: "ml-2 px-2 py-1 text-xs font-medium text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/30 rounded transition-colors",
|
|
7389
7447
|
title: "Cancel generation",
|
|
7390
7448
|
children: "Cancel"
|
|
@@ -7419,19 +7477,19 @@ function fn({
|
|
|
7419
7477
|
] })
|
|
7420
7478
|
] }) }),
|
|
7421
7479
|
x && /* @__PURE__ */ e("div", { className: "bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg p-3", children: /* @__PURE__ */ e("p", { className: "text-sm text-red-700 dark:text-red-300", children: x }) }),
|
|
7422
|
-
/* @__PURE__ */ e("div", { ref:
|
|
7480
|
+
/* @__PURE__ */ e("div", { ref: oe })
|
|
7423
7481
|
] }),
|
|
7424
7482
|
/* @__PURE__ */ l("div", { className: "border-t border-gray-200 dark:border-zinc-700 p-4", children: [
|
|
7425
7483
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
7426
7484
|
/* @__PURE__ */ e(
|
|
7427
7485
|
"textarea",
|
|
7428
7486
|
{
|
|
7429
|
-
ref:
|
|
7487
|
+
ref: L,
|
|
7430
7488
|
value: p,
|
|
7431
|
-
onChange: (
|
|
7432
|
-
onKeyDown:
|
|
7433
|
-
placeholder:
|
|
7434
|
-
disabled: m ||
|
|
7489
|
+
onChange: (T) => c(T.target.value),
|
|
7490
|
+
onKeyDown: q,
|
|
7491
|
+
placeholder: I === !1 ? "AI generation not available" : "Describe what workflow you want to create...",
|
|
7492
|
+
disabled: m || I === !1,
|
|
7435
7493
|
rows: 2,
|
|
7436
7494
|
className: "flex-1 resize-none rounded-lg border border-gray-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 px-4 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-zinc-500 focus:border-teal-500 focus:outline-none focus:ring-1 focus:ring-teal-500 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
7437
7495
|
}
|
|
@@ -7439,8 +7497,8 @@ function fn({
|
|
|
7439
7497
|
/* @__PURE__ */ e(
|
|
7440
7498
|
"button",
|
|
7441
7499
|
{
|
|
7442
|
-
onClick:
|
|
7443
|
-
disabled: !p.trim() || m ||
|
|
7500
|
+
onClick: V,
|
|
7501
|
+
disabled: !p.trim() || m || I === !1,
|
|
7444
7502
|
className: "self-end px-4 py-2 bg-teal-600 hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-lg transition-colors",
|
|
7445
7503
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7446
7504
|
"path",
|
|
@@ -7458,9 +7516,9 @@ function fn({
|
|
|
7458
7516
|
] })
|
|
7459
7517
|
] }) }) : null;
|
|
7460
7518
|
}
|
|
7461
|
-
const
|
|
7462
|
-
function
|
|
7463
|
-
const [a, i] = E("formatted"), [d, p] = E(!1), c =
|
|
7519
|
+
const xn = 20, bn = 500, vn = 1e5;
|
|
7520
|
+
function kn({ isOpen: t, onClose: o, nodeLabel: n, output: r }) {
|
|
7521
|
+
const [a, i] = E("formatted"), [d, p] = E(!1), c = $(() => {
|
|
7464
7522
|
const u = a === "formatted" && r.parsed ? JSON.stringify(r.parsed, null, 2) : r.content;
|
|
7465
7523
|
navigator.clipboard.writeText(u).then(() => {
|
|
7466
7524
|
p(!0), setTimeout(() => p(!1), 2e3);
|
|
@@ -7534,7 +7592,7 @@ function vn({ isOpen: t, onClose: o, nodeLabel: n, output: r }) {
|
|
|
7534
7592
|
)
|
|
7535
7593
|
] })
|
|
7536
7594
|
] }),
|
|
7537
|
-
r.content.length >
|
|
7595
|
+
r.content.length > vn && /* @__PURE__ */ l("div", { className: "px-4 py-2 bg-amber-50 dark:bg-amber-900/20 border-b border-amber-200 dark:border-amber-800 flex items-center gap-2", children: [
|
|
7538
7596
|
/* @__PURE__ */ e(
|
|
7539
7597
|
"svg",
|
|
7540
7598
|
{
|
|
@@ -7570,7 +7628,7 @@ function vn({ isOpen: t, onClose: o, nodeLabel: n, output: r }) {
|
|
|
7570
7628
|
{
|
|
7571
7629
|
onClick: c,
|
|
7572
7630
|
className: "flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/30 rounded-lg transition-colors",
|
|
7573
|
-
children: d ? /* @__PURE__ */ l(
|
|
7631
|
+
children: d ? /* @__PURE__ */ l(X, { children: [
|
|
7574
7632
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7575
7633
|
"path",
|
|
7576
7634
|
{
|
|
@@ -7581,7 +7639,7 @@ function vn({ isOpen: t, onClose: o, nodeLabel: n, output: r }) {
|
|
|
7581
7639
|
}
|
|
7582
7640
|
) }),
|
|
7583
7641
|
"Copied!"
|
|
7584
|
-
] }) : /* @__PURE__ */ l(
|
|
7642
|
+
] }) : /* @__PURE__ */ l(X, { children: [
|
|
7585
7643
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7586
7644
|
"path",
|
|
7587
7645
|
{
|
|
@@ -7599,9 +7657,9 @@ function vn({ isOpen: t, onClose: o, nodeLabel: n, output: r }) {
|
|
|
7599
7657
|
] }) });
|
|
7600
7658
|
}
|
|
7601
7659
|
function wn({ data: t }) {
|
|
7602
|
-
return /* @__PURE__ */ e("div", { className: "font-mono text-sm", children: /* @__PURE__ */ e(
|
|
7660
|
+
return /* @__PURE__ */ e("div", { className: "font-mono text-sm", children: /* @__PURE__ */ e($e, { value: t, depth: 0, maxDepth: xn }) });
|
|
7603
7661
|
}
|
|
7604
|
-
function
|
|
7662
|
+
function $e({ value: t, depth: o, keyName: n, maxDepth: r }) {
|
|
7605
7663
|
const a = o * 16;
|
|
7606
7664
|
if (o >= r)
|
|
7607
7665
|
return /* @__PURE__ */ l("div", { style: { marginLeft: a }, className: "py-0.5", children: [
|
|
@@ -7660,7 +7718,7 @@ function We({ value: t, depth: o, keyName: n, maxDepth: r }) {
|
|
|
7660
7718
|
] });
|
|
7661
7719
|
}
|
|
7662
7720
|
if (Array.isArray(t)) {
|
|
7663
|
-
const i = t.slice(0,
|
|
7721
|
+
const i = t.slice(0, bn), d = t.length - i.length;
|
|
7664
7722
|
return /* @__PURE__ */ l("div", { style: { marginLeft: a }, children: [
|
|
7665
7723
|
n && /* @__PURE__ */ l("div", { className: "py-0.5", children: [
|
|
7666
7724
|
/* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
@@ -7676,7 +7734,7 @@ function We({ value: t, depth: o, keyName: n, maxDepth: r }) {
|
|
|
7676
7734
|
] })
|
|
7677
7735
|
] }),
|
|
7678
7736
|
!n && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "[" }),
|
|
7679
|
-
i.map((p, c) => /* @__PURE__ */ e(
|
|
7737
|
+
i.map((p, c) => /* @__PURE__ */ e($e, { value: p, depth: o + 1, maxDepth: r }, c)),
|
|
7680
7738
|
d > 0 && /* @__PURE__ */ l("div", { style: { marginLeft: (o + 1) * 16 }, className: "py-0.5 text-zinc-500 italic", children: [
|
|
7681
7739
|
"...and ",
|
|
7682
7740
|
d,
|
|
@@ -7698,15 +7756,15 @@ function We({ value: t, depth: o, keyName: n, maxDepth: r }) {
|
|
|
7698
7756
|
/* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "{" })
|
|
7699
7757
|
] }),
|
|
7700
7758
|
!n && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "{" }),
|
|
7701
|
-
i.map(([d, p]) => /* @__PURE__ */ e(
|
|
7759
|
+
i.map(([d, p]) => /* @__PURE__ */ e($e, { value: p, depth: o + 1, keyName: d, maxDepth: r }, d)),
|
|
7702
7760
|
/* @__PURE__ */ e("div", { style: { marginLeft: n ? 0 : a }, className: "py-0.5", children: /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "}" }) })
|
|
7703
7761
|
] });
|
|
7704
7762
|
}
|
|
7705
7763
|
return null;
|
|
7706
7764
|
}
|
|
7707
|
-
function
|
|
7765
|
+
function mt({ binding: t, className: o = "", size: n = "md" }) {
|
|
7708
7766
|
if (!t) return null;
|
|
7709
|
-
const r =
|
|
7767
|
+
const r = Rr(t);
|
|
7710
7768
|
if (r.length === 0) return null;
|
|
7711
7769
|
const a = {
|
|
7712
7770
|
sm: "px-1 py-0.5 text-[10px] min-w-[16px]",
|
|
@@ -7730,7 +7788,7 @@ function it({ binding: t, className: o = "", size: n = "md" }) {
|
|
|
7730
7788
|
d
|
|
7731
7789
|
)) });
|
|
7732
7790
|
}
|
|
7733
|
-
const
|
|
7791
|
+
const yn = [
|
|
7734
7792
|
"a[href]",
|
|
7735
7793
|
"button:not([disabled])",
|
|
7736
7794
|
"input:not([disabled])",
|
|
@@ -7738,9 +7796,9 @@ const kn = [
|
|
|
7738
7796
|
"textarea:not([disabled])",
|
|
7739
7797
|
'[tabindex]:not([tabindex="-1"])'
|
|
7740
7798
|
].join(", ");
|
|
7741
|
-
function
|
|
7742
|
-
const o =
|
|
7743
|
-
o.current.querySelectorAll(
|
|
7799
|
+
function Pe(t) {
|
|
7800
|
+
const o = re(null), n = re(null), r = $(() => o.current ? Array.from(
|
|
7801
|
+
o.current.querySelectorAll(yn)
|
|
7744
7802
|
).filter((a) => a.offsetParent !== null) : [], []);
|
|
7745
7803
|
return U(() => {
|
|
7746
7804
|
if (!t) return;
|
|
@@ -7769,7 +7827,7 @@ function Te(t) {
|
|
|
7769
7827
|
};
|
|
7770
7828
|
}, [t, r]), o;
|
|
7771
7829
|
}
|
|
7772
|
-
function
|
|
7830
|
+
function Nn(t, o, n, r) {
|
|
7773
7831
|
switch (t.id) {
|
|
7774
7832
|
case "save":
|
|
7775
7833
|
case "exportWorkflow":
|
|
@@ -7782,21 +7840,21 @@ function yn(t, o, n, r) {
|
|
|
7782
7840
|
return null;
|
|
7783
7841
|
}
|
|
7784
7842
|
}
|
|
7785
|
-
function
|
|
7786
|
-
const o =
|
|
7787
|
-
(
|
|
7788
|
-
var
|
|
7789
|
-
const
|
|
7790
|
-
return
|
|
7843
|
+
function zn({ onToggleAIChat: t }) {
|
|
7844
|
+
const o = A((L) => L.showCommandPalette), n = A((L) => L.closeCommandPalette), r = A((L) => L.keyboard), [a, i] = E(""), d = ht(a), [p, c] = E(0), m = Ce(), u = Pe(o), s = re(null), h = y((L) => L.nodes), f = y((L) => L.selectedNodeId), v = y((L) => L.execution), x = y((L) => L.saveWorkflow), w = y((L) => L.execute), I = y((L) => L.duplicateNode), b = y((L) => L.toggleLibrary), C = y((L) => L.newWorkflow), N = A((L) => L.openSettings), k = A((L) => L.openShortcutsModal), z = A((L) => L.openExport), S = A((L) => L.openImport), g = A((L) => L.requestNewWorkflow), _ = y((L) => L.hasUnsavedChanges), M = $(
|
|
7845
|
+
(L) => {
|
|
7846
|
+
var V;
|
|
7847
|
+
const P = ke.find((K) => K.action === L);
|
|
7848
|
+
return P ? ((V = r == null ? void 0 : r.shortcuts) == null ? void 0 : V[L]) !== void 0 ? r.shortcuts[L] ?? null : P.defaultBinding : null;
|
|
7791
7849
|
},
|
|
7792
7850
|
[r]
|
|
7793
|
-
), R =
|
|
7851
|
+
), R = Z(() => [
|
|
7794
7852
|
// Workflow commands
|
|
7795
7853
|
{
|
|
7796
7854
|
id: "save",
|
|
7797
7855
|
name: "Save Workflow",
|
|
7798
7856
|
category: "workflow",
|
|
7799
|
-
shortcut:
|
|
7857
|
+
shortcut: M("save") ?? void 0,
|
|
7800
7858
|
action: () => {
|
|
7801
7859
|
h.length > 0 && x();
|
|
7802
7860
|
},
|
|
@@ -7807,9 +7865,9 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7807
7865
|
id: "execute",
|
|
7808
7866
|
name: "Execute Workflow",
|
|
7809
7867
|
category: "workflow",
|
|
7810
|
-
shortcut:
|
|
7868
|
+
shortcut: M("execute") ?? void 0,
|
|
7811
7869
|
action: () => {
|
|
7812
|
-
h.length > 0 && v.status !== "running" &&
|
|
7870
|
+
h.length > 0 && v.status !== "running" && w();
|
|
7813
7871
|
},
|
|
7814
7872
|
enabled: () => h.length > 0 && v.status !== "running",
|
|
7815
7873
|
keywords: ["run", "execute", "start"]
|
|
@@ -7818,9 +7876,9 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7818
7876
|
id: "newWorkflow",
|
|
7819
7877
|
name: "New Workflow",
|
|
7820
7878
|
category: "workflow",
|
|
7821
|
-
shortcut:
|
|
7879
|
+
shortcut: M("newWorkflow") ?? void 0,
|
|
7822
7880
|
action: () => {
|
|
7823
|
-
n == null || n(), g(_,
|
|
7881
|
+
n == null || n(), g(_, C);
|
|
7824
7882
|
},
|
|
7825
7883
|
keywords: ["new", "create", "blank"]
|
|
7826
7884
|
},
|
|
@@ -7828,9 +7886,9 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7828
7886
|
id: "exportWorkflow",
|
|
7829
7887
|
name: "Export Workflow",
|
|
7830
7888
|
category: "workflow",
|
|
7831
|
-
shortcut:
|
|
7889
|
+
shortcut: M("exportWorkflow") ?? void 0,
|
|
7832
7890
|
action: () => {
|
|
7833
|
-
h.length > 0 && (
|
|
7891
|
+
h.length > 0 && (z == null || z());
|
|
7834
7892
|
},
|
|
7835
7893
|
enabled: () => h.length > 0,
|
|
7836
7894
|
keywords: ["export", "download", "yaml", "javascript"]
|
|
@@ -7839,8 +7897,8 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7839
7897
|
id: "importWorkflow",
|
|
7840
7898
|
name: "Import Workflow",
|
|
7841
7899
|
category: "workflow",
|
|
7842
|
-
shortcut:
|
|
7843
|
-
action: () =>
|
|
7900
|
+
shortcut: M("importWorkflow") ?? void 0,
|
|
7901
|
+
action: () => S == null ? void 0 : S(),
|
|
7844
7902
|
keywords: ["import", "upload", "load"]
|
|
7845
7903
|
},
|
|
7846
7904
|
// Editing commands
|
|
@@ -7848,9 +7906,9 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7848
7906
|
id: "duplicate",
|
|
7849
7907
|
name: "Duplicate Node",
|
|
7850
7908
|
category: "editing",
|
|
7851
|
-
shortcut:
|
|
7909
|
+
shortcut: M("duplicate") ?? void 0,
|
|
7852
7910
|
action: () => {
|
|
7853
|
-
f &&
|
|
7911
|
+
f && I(f);
|
|
7854
7912
|
},
|
|
7855
7913
|
enabled: () => !!f,
|
|
7856
7914
|
keywords: ["duplicate", "copy", "clone"]
|
|
@@ -7860,7 +7918,7 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7860
7918
|
id: "toggleLibrary",
|
|
7861
7919
|
name: "Toggle Workflow Library",
|
|
7862
7920
|
category: "ui",
|
|
7863
|
-
shortcut:
|
|
7921
|
+
shortcut: M("toggleLibrary") ?? void 0,
|
|
7864
7922
|
action: () => b(),
|
|
7865
7923
|
keywords: ["library", "workflows", "saved"]
|
|
7866
7924
|
},
|
|
@@ -7868,7 +7926,7 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7868
7926
|
id: "toggleAIChat",
|
|
7869
7927
|
name: "Toggle AI Chat",
|
|
7870
7928
|
category: "ui",
|
|
7871
|
-
shortcut:
|
|
7929
|
+
shortcut: M("toggleAIChat") ?? void 0,
|
|
7872
7930
|
action: () => t == null ? void 0 : t(),
|
|
7873
7931
|
keywords: ["ai", "chat", "generate", "assistant"]
|
|
7874
7932
|
},
|
|
@@ -7876,7 +7934,7 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7876
7934
|
id: "settings",
|
|
7877
7935
|
name: "Open Settings",
|
|
7878
7936
|
category: "ui",
|
|
7879
|
-
shortcut:
|
|
7937
|
+
shortcut: M("settings") ?? void 0,
|
|
7880
7938
|
action: () => N(),
|
|
7881
7939
|
keywords: ["settings", "preferences", "api", "keys"]
|
|
7882
7940
|
},
|
|
@@ -7884,8 +7942,8 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7884
7942
|
id: "showShortcuts",
|
|
7885
7943
|
name: "Show Keyboard Shortcuts",
|
|
7886
7944
|
category: "ui",
|
|
7887
|
-
shortcut:
|
|
7888
|
-
action: () =>
|
|
7945
|
+
shortcut: M("showShortcuts") ?? void 0,
|
|
7946
|
+
action: () => k == null ? void 0 : k(),
|
|
7889
7947
|
keywords: ["shortcuts", "keyboard", "hotkeys", "help"]
|
|
7890
7948
|
}
|
|
7891
7949
|
], [
|
|
@@ -7894,87 +7952,87 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
7894
7952
|
v.status,
|
|
7895
7953
|
_,
|
|
7896
7954
|
x,
|
|
7897
|
-
|
|
7955
|
+
w,
|
|
7956
|
+
C,
|
|
7898
7957
|
I,
|
|
7899
|
-
S,
|
|
7900
7958
|
b,
|
|
7901
7959
|
N,
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7960
|
+
k,
|
|
7961
|
+
z,
|
|
7962
|
+
S,
|
|
7905
7963
|
t,
|
|
7906
|
-
|
|
7964
|
+
M,
|
|
7907
7965
|
n,
|
|
7908
7966
|
g
|
|
7909
|
-
]),
|
|
7967
|
+
]), B = Z(() => {
|
|
7910
7968
|
if (!d.trim()) return R;
|
|
7911
|
-
const
|
|
7912
|
-
return R.filter((
|
|
7913
|
-
var
|
|
7914
|
-
const
|
|
7915
|
-
return
|
|
7969
|
+
const L = d.toLowerCase();
|
|
7970
|
+
return R.filter((P) => {
|
|
7971
|
+
var q;
|
|
7972
|
+
const V = P.name.toLowerCase().includes(L), K = (q = P.keywords) == null ? void 0 : q.some((J) => J.toLowerCase().includes(L));
|
|
7973
|
+
return V || K;
|
|
7916
7974
|
});
|
|
7917
|
-
}, [R, d]),
|
|
7918
|
-
const
|
|
7975
|
+
}, [R, d]), H = Z(() => {
|
|
7976
|
+
const L = {
|
|
7919
7977
|
workflow: [],
|
|
7920
7978
|
editing: [],
|
|
7921
7979
|
canvas: [],
|
|
7922
7980
|
ui: [],
|
|
7923
7981
|
nodes: []
|
|
7924
7982
|
};
|
|
7925
|
-
for (const
|
|
7926
|
-
|
|
7927
|
-
return
|
|
7928
|
-
}, [
|
|
7983
|
+
for (const P of B)
|
|
7984
|
+
L[P.category].push(P);
|
|
7985
|
+
return L;
|
|
7986
|
+
}, [B]);
|
|
7929
7987
|
U(() => {
|
|
7930
7988
|
c(0);
|
|
7931
7989
|
}, [d]), U(() => {
|
|
7932
7990
|
o && (i(""), c(0));
|
|
7933
7991
|
}, [o]);
|
|
7934
|
-
const
|
|
7935
|
-
(
|
|
7936
|
-
if (
|
|
7992
|
+
const ee = $(
|
|
7993
|
+
(L) => {
|
|
7994
|
+
if (L.key === "Escape") {
|
|
7937
7995
|
n == null || n();
|
|
7938
7996
|
return;
|
|
7939
7997
|
}
|
|
7940
|
-
if (
|
|
7941
|
-
|
|
7998
|
+
if (L.key === "ArrowDown") {
|
|
7999
|
+
L.preventDefault(), c((P) => Math.min(P + 1, B.length - 1));
|
|
7942
8000
|
return;
|
|
7943
8001
|
}
|
|
7944
|
-
if (
|
|
7945
|
-
|
|
8002
|
+
if (L.key === "ArrowUp") {
|
|
8003
|
+
L.preventDefault(), c((P) => Math.max(P - 1, 0));
|
|
7946
8004
|
return;
|
|
7947
8005
|
}
|
|
7948
|
-
if (
|
|
7949
|
-
|
|
7950
|
-
const
|
|
7951
|
-
|
|
8006
|
+
if (L.key === "Enter") {
|
|
8007
|
+
L.preventDefault();
|
|
8008
|
+
const P = B[p];
|
|
8009
|
+
P && (!P.enabled || P.enabled()) && (P.action(), n == null || n());
|
|
7952
8010
|
return;
|
|
7953
8011
|
}
|
|
7954
8012
|
},
|
|
7955
|
-
[
|
|
8013
|
+
[B, p, n]
|
|
7956
8014
|
);
|
|
7957
8015
|
if (U(() => {
|
|
7958
8016
|
if (s.current) {
|
|
7959
|
-
const
|
|
7960
|
-
|
|
8017
|
+
const L = s.current.querySelector(`[data-index="${p}"]`);
|
|
8018
|
+
L && L.scrollIntoView({ block: "nearest" });
|
|
7961
8019
|
}
|
|
7962
8020
|
}, [p]), !o) return null;
|
|
7963
|
-
const
|
|
8021
|
+
const te = [
|
|
7964
8022
|
"workflow",
|
|
7965
8023
|
"editing",
|
|
7966
8024
|
"ui",
|
|
7967
8025
|
"canvas",
|
|
7968
8026
|
"nodes"
|
|
7969
8027
|
];
|
|
7970
|
-
let
|
|
7971
|
-
const
|
|
8028
|
+
let ne = 0;
|
|
8029
|
+
const oe = () => ne++;
|
|
7972
8030
|
return /* @__PURE__ */ e(
|
|
7973
8031
|
"div",
|
|
7974
8032
|
{
|
|
7975
8033
|
className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh] bg-black/50",
|
|
7976
|
-
onClick: (
|
|
7977
|
-
|
|
8034
|
+
onClick: (L) => {
|
|
8035
|
+
L.target === L.currentTarget && (n == null || n());
|
|
7978
8036
|
},
|
|
7979
8037
|
children: /* @__PURE__ */ l(
|
|
7980
8038
|
"div",
|
|
@@ -8012,8 +8070,8 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
8012
8070
|
type: "text",
|
|
8013
8071
|
placeholder: "Type a command or search...",
|
|
8014
8072
|
value: a,
|
|
8015
|
-
onChange: (
|
|
8016
|
-
onKeyDown:
|
|
8073
|
+
onChange: (L) => i(L.target.value),
|
|
8074
|
+
onKeyDown: ee,
|
|
8017
8075
|
"aria-label": "Search commands",
|
|
8018
8076
|
autoFocus: !0,
|
|
8019
8077
|
className: "flex-1 bg-transparent text-zinc-900 dark:text-zinc-100 placeholder-zinc-500 focus:outline-none text-sm"
|
|
@@ -8021,41 +8079,41 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
8021
8079
|
),
|
|
8022
8080
|
/* @__PURE__ */ e("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-zinc-100 dark:bg-zinc-700 text-zinc-500 border border-zinc-200 dark:border-zinc-600 rounded", children: "Esc" })
|
|
8023
8081
|
] }),
|
|
8024
|
-
/* @__PURE__ */ e("div", { ref: s, className: "max-h-80 overflow-y-auto py-2", children:
|
|
8025
|
-
const
|
|
8026
|
-
return
|
|
8027
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider", children:
|
|
8028
|
-
|
|
8029
|
-
const
|
|
8082
|
+
/* @__PURE__ */ e("div", { ref: s, className: "max-h-80 overflow-y-auto py-2", children: B.length === 0 ? /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-zinc-500 dark:text-zinc-400 text-sm", children: "No commands found" }) : te.map((L) => {
|
|
8083
|
+
const P = H[L];
|
|
8084
|
+
return P.length === 0 ? null : /* @__PURE__ */ l("div", { className: "mb-2", children: [
|
|
8085
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider", children: et[L] || L }),
|
|
8086
|
+
P.map((V) => {
|
|
8087
|
+
const K = oe(), q = K === p, J = !V.enabled || V.enabled(), pe = J ? null : Nn(V, h, f, v.status);
|
|
8030
8088
|
return /* @__PURE__ */ l(
|
|
8031
8089
|
"button",
|
|
8032
8090
|
{
|
|
8033
|
-
"data-index":
|
|
8091
|
+
"data-index": K,
|
|
8034
8092
|
onClick: () => {
|
|
8035
|
-
|
|
8093
|
+
J && (V.action(), n == null || n());
|
|
8036
8094
|
},
|
|
8037
|
-
disabled: !
|
|
8038
|
-
title:
|
|
8095
|
+
disabled: !J,
|
|
8096
|
+
title: pe ?? void 0,
|
|
8039
8097
|
className: `
|
|
8040
8098
|
w-full flex items-center justify-between px-4 py-2 text-left
|
|
8041
|
-
${
|
|
8042
|
-
${
|
|
8099
|
+
${q ? "bg-teal-50 dark:bg-teal-900/30" : "hover:bg-zinc-50 dark:hover:bg-zinc-700/50"}
|
|
8100
|
+
${J ? "cursor-pointer" : "opacity-50 cursor-not-allowed"}
|
|
8043
8101
|
`,
|
|
8044
8102
|
children: [
|
|
8045
8103
|
/* @__PURE__ */ e(
|
|
8046
8104
|
"span",
|
|
8047
8105
|
{
|
|
8048
|
-
className: `text-sm ${
|
|
8049
|
-
children:
|
|
8106
|
+
className: `text-sm ${q ? "text-teal-700 dark:text-teal-300" : "text-zinc-800 dark:text-zinc-200"}`,
|
|
8107
|
+
children: V.name
|
|
8050
8108
|
}
|
|
8051
8109
|
),
|
|
8052
|
-
|
|
8110
|
+
V.shortcut && /* @__PURE__ */ e(mt, { binding: V.shortcut, size: "sm" })
|
|
8053
8111
|
]
|
|
8054
8112
|
},
|
|
8055
|
-
|
|
8113
|
+
V.id
|
|
8056
8114
|
);
|
|
8057
8115
|
})
|
|
8058
|
-
] },
|
|
8116
|
+
] }, L);
|
|
8059
8117
|
}) }),
|
|
8060
8118
|
/* @__PURE__ */ e("div", { className: "px-4 py-2 border-t border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-4 text-xs text-zinc-500 dark:text-zinc-400", children: [
|
|
8061
8119
|
/* @__PURE__ */ l("span", { className: "flex items-center gap-1", children: [
|
|
@@ -8078,13 +8136,13 @@ function Nn({ onToggleAIChat: t }) {
|
|
|
8078
8136
|
}
|
|
8079
8137
|
);
|
|
8080
8138
|
}
|
|
8081
|
-
function
|
|
8082
|
-
const t =
|
|
8139
|
+
function Cn() {
|
|
8140
|
+
const t = A((u) => u.showShortcutsModal), o = A((u) => u.closeShortcutsModal), n = A((u) => u.keyboard), [r, a] = E(""), i = Ce(), d = Pe(t), p = (u) => {
|
|
8083
8141
|
var h;
|
|
8084
|
-
const s =
|
|
8142
|
+
const s = ke.find((f) => f.action === u);
|
|
8085
8143
|
return s ? ((h = n == null ? void 0 : n.shortcuts) == null ? void 0 : h[u]) !== void 0 ? n.shortcuts[u] ?? null : s.defaultBinding : null;
|
|
8086
|
-
}, c =
|
|
8087
|
-
const u =
|
|
8144
|
+
}, c = Z(() => {
|
|
8145
|
+
const u = Ht();
|
|
8088
8146
|
if (r.trim()) {
|
|
8089
8147
|
const s = r.toLowerCase(), h = {
|
|
8090
8148
|
workflow: [],
|
|
@@ -8161,7 +8219,7 @@ function zn() {
|
|
|
8161
8219
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-2", children: ["workflow", "editing", "canvas", "ui"].map((u) => {
|
|
8162
8220
|
const s = c[u];
|
|
8163
8221
|
return s.length === 0 ? null : /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
8164
|
-
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2", children:
|
|
8222
|
+
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2", children: et[u] }),
|
|
8165
8223
|
/* @__PURE__ */ e("div", { className: "space-y-1", children: s.map((h) => {
|
|
8166
8224
|
const f = p(h.action);
|
|
8167
8225
|
return /* @__PURE__ */ l(
|
|
@@ -8173,7 +8231,7 @@ function zn() {
|
|
|
8173
8231
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-200", children: h.name }),
|
|
8174
8232
|
/* @__PURE__ */ e("div", { className: "text-xs text-zinc-500 dark:text-zinc-400 truncate", children: h.description })
|
|
8175
8233
|
] }),
|
|
8176
|
-
/* @__PURE__ */ e("div", { className: "ml-4 flex-shrink-0", children: f ? /* @__PURE__ */ e(
|
|
8234
|
+
/* @__PURE__ */ e("div", { className: "ml-4 flex-shrink-0", children: f ? /* @__PURE__ */ e(mt, { binding: f, size: "sm" }) : /* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 dark:text-zinc-500", children: "Not set" }) })
|
|
8177
8235
|
]
|
|
8178
8236
|
},
|
|
8179
8237
|
h.action
|
|
@@ -8198,7 +8256,7 @@ function zn() {
|
|
|
8198
8256
|
}
|
|
8199
8257
|
) : null;
|
|
8200
8258
|
}
|
|
8201
|
-
function
|
|
8259
|
+
function In({
|
|
8202
8260
|
isOpen: t,
|
|
8203
8261
|
title: o,
|
|
8204
8262
|
message: n,
|
|
@@ -8208,7 +8266,7 @@ function Cn({
|
|
|
8208
8266
|
onCancel: d,
|
|
8209
8267
|
destructive: p = !1
|
|
8210
8268
|
}) {
|
|
8211
|
-
const c =
|
|
8269
|
+
const c = Ce(), m = Ce(), u = Pe(t), s = $(
|
|
8212
8270
|
(h) => {
|
|
8213
8271
|
h.key === "Escape" && d();
|
|
8214
8272
|
},
|
|
@@ -8265,12 +8323,12 @@ function Cn({
|
|
|
8265
8323
|
}
|
|
8266
8324
|
) : null;
|
|
8267
8325
|
}
|
|
8268
|
-
const
|
|
8269
|
-
function
|
|
8270
|
-
return
|
|
8326
|
+
const Ke = "https://api.floimg.com";
|
|
8327
|
+
function Sn({ onToggleAIChat: t }) {
|
|
8328
|
+
return jr({ onToggleAIChat: t }), null;
|
|
8271
8329
|
}
|
|
8272
|
-
function
|
|
8273
|
-
const { screenToFlowPosition: t } =
|
|
8330
|
+
function Ln() {
|
|
8331
|
+
const { screenToFlowPosition: t } = Je(), o = y((a) => a.addNode), n = $(
|
|
8274
8332
|
(a) => {
|
|
8275
8333
|
a.preventDefault();
|
|
8276
8334
|
const i = a.dataTransfer.getData("application/json");
|
|
@@ -8286,26 +8344,26 @@ function Sn() {
|
|
|
8286
8344
|
}
|
|
8287
8345
|
},
|
|
8288
8346
|
[o, t]
|
|
8289
|
-
), r =
|
|
8347
|
+
), r = $((a) => {
|
|
8290
8348
|
a.preventDefault(), a.dataTransfer.dropEffect = "move";
|
|
8291
8349
|
}, []);
|
|
8292
|
-
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: n, onDragOver: r, children: /* @__PURE__ */ e(
|
|
8350
|
+
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: n, onDragOver: r, children: /* @__PURE__ */ e(cr, {}) });
|
|
8293
8351
|
}
|
|
8294
|
-
function
|
|
8295
|
-
const [t, o] = E("editor"), [n, r] = E(!1), a = y((g) => g.loadTemplate), i = y((g) => g.loadGeneratedWorkflow), d = y((g) => g.loadRemixImage), p = y((g) => g.inspectedNodeId), c = y((g) => g.execution.dataOutputs), m = y((g) => g.closeOutputInspector), u = y((g) => g.nodes), s = y((g) => g.selectedNodeId), h = y((g) => g.unseenRunCount), f = y((g) => g.hasUnseenErrors), v = y((g) => g.markRunsAsSeen), x = p ? u.find((g) => g.id === p) : null,
|
|
8352
|
+
function jn() {
|
|
8353
|
+
const [t, o] = E("editor"), [n, r] = E(!1), a = y((g) => g.loadTemplate), i = y((g) => g.loadGeneratedWorkflow), d = y((g) => g.loadRemixImage), p = y((g) => g.inspectedNodeId), c = y((g) => g.execution.dataOutputs), m = y((g) => g.closeOutputInspector), u = y((g) => g.nodes), s = y((g) => g.selectedNodeId), h = y((g) => g.unseenRunCount), f = y((g) => g.hasUnseenErrors), v = y((g) => g.markRunsAsSeen), x = p ? u.find((g) => g.id === p) : null, w = p ? c[p] : null;
|
|
8296
8354
|
U(() => {
|
|
8297
|
-
const g = new URLSearchParams(window.location.search), _ = g.get("template"),
|
|
8355
|
+
const g = new URLSearchParams(window.location.search), _ = g.get("template"), M = g.get("remixImage");
|
|
8298
8356
|
_ ? (async () => {
|
|
8299
8357
|
try {
|
|
8300
|
-
const R = await fetch(`${
|
|
8358
|
+
const R = await fetch(`${Ke}/api/templates/${_}`);
|
|
8301
8359
|
if (R.ok) {
|
|
8302
|
-
const
|
|
8303
|
-
a(
|
|
8360
|
+
const H = (await R.json()).template;
|
|
8361
|
+
a(H);
|
|
8304
8362
|
}
|
|
8305
8363
|
} catch {
|
|
8306
8364
|
}
|
|
8307
8365
|
window.history.replaceState({}, "", window.location.pathname);
|
|
8308
|
-
})() :
|
|
8366
|
+
})() : M && (d(M), window.history.replaceState({}, "", window.location.pathname));
|
|
8309
8367
|
}, [a, d]), U(() => {
|
|
8310
8368
|
const g = () => {
|
|
8311
8369
|
o("editor");
|
|
@@ -8314,10 +8372,10 @@ function Tn() {
|
|
|
8314
8372
|
window.removeEventListener("workflow-loaded", g);
|
|
8315
8373
|
};
|
|
8316
8374
|
}, []);
|
|
8317
|
-
const
|
|
8375
|
+
const I = $(
|
|
8318
8376
|
async (g) => {
|
|
8319
8377
|
try {
|
|
8320
|
-
const _ = await fetch(`${
|
|
8378
|
+
const _ = await fetch(`${Ke}/api/templates/${g}`);
|
|
8321
8379
|
if (_.ok) {
|
|
8322
8380
|
const R = (await _.json()).template;
|
|
8323
8381
|
a(R), o("editor");
|
|
@@ -8326,55 +8384,55 @@ function Tn() {
|
|
|
8326
8384
|
}
|
|
8327
8385
|
},
|
|
8328
8386
|
[a]
|
|
8329
|
-
), b =
|
|
8387
|
+
), b = $(
|
|
8330
8388
|
(g) => {
|
|
8331
8389
|
i(g), o("editor");
|
|
8332
8390
|
},
|
|
8333
8391
|
[i]
|
|
8334
|
-
),
|
|
8392
|
+
), C = $(() => {
|
|
8335
8393
|
r((g) => !g);
|
|
8336
|
-
}, []), N =
|
|
8394
|
+
}, []), N = $(() => {
|
|
8337
8395
|
o("history"), v();
|
|
8338
|
-
}, [v]),
|
|
8339
|
-
return /* @__PURE__ */ l(
|
|
8340
|
-
/* @__PURE__ */ e(
|
|
8341
|
-
/* @__PURE__ */ e(
|
|
8342
|
-
/* @__PURE__ */ e(
|
|
8396
|
+
}, [v]), k = A((g) => g.showNewWorkflowConfirm), z = A((g) => g.confirmNewWorkflow), S = A((g) => g.cancelNewWorkflow);
|
|
8397
|
+
return /* @__PURE__ */ l(Nt, { children: [
|
|
8398
|
+
/* @__PURE__ */ e(Sn, { onToggleAIChat: C }),
|
|
8399
|
+
/* @__PURE__ */ e(zn, { onToggleAIChat: C }),
|
|
8400
|
+
/* @__PURE__ */ e(Cn, {}),
|
|
8343
8401
|
/* @__PURE__ */ e(
|
|
8344
|
-
|
|
8402
|
+
In,
|
|
8345
8403
|
{
|
|
8346
|
-
isOpen:
|
|
8404
|
+
isOpen: k,
|
|
8347
8405
|
title: "Unsaved Changes",
|
|
8348
8406
|
message: "You have unsaved changes. Creating a new workflow will discard them. Are you sure you want to continue?",
|
|
8349
8407
|
confirmText: "Create New",
|
|
8350
8408
|
cancelText: "Keep Editing",
|
|
8351
|
-
onConfirm:
|
|
8352
|
-
onCancel:
|
|
8409
|
+
onConfirm: z,
|
|
8410
|
+
onCancel: S,
|
|
8353
8411
|
destructive: !0
|
|
8354
8412
|
}
|
|
8355
8413
|
),
|
|
8356
|
-
/* @__PURE__ */ e(
|
|
8414
|
+
/* @__PURE__ */ e(pn, {}),
|
|
8357
8415
|
/* @__PURE__ */ e(
|
|
8358
|
-
|
|
8416
|
+
gn,
|
|
8359
8417
|
{
|
|
8360
8418
|
isOpen: n,
|
|
8361
8419
|
onClose: () => r(!1),
|
|
8362
8420
|
onApplyWorkflow: b
|
|
8363
8421
|
}
|
|
8364
8422
|
),
|
|
8365
|
-
x &&
|
|
8366
|
-
|
|
8423
|
+
x && w && /* @__PURE__ */ e(
|
|
8424
|
+
kn,
|
|
8367
8425
|
{
|
|
8368
8426
|
isOpen: !0,
|
|
8369
8427
|
onClose: m,
|
|
8370
8428
|
nodeId: p,
|
|
8371
8429
|
nodeLabel: x.data.providerLabel || x.type || "Node",
|
|
8372
|
-
output:
|
|
8430
|
+
output: w
|
|
8373
8431
|
}
|
|
8374
8432
|
),
|
|
8375
|
-
/* @__PURE__ */ e(
|
|
8433
|
+
/* @__PURE__ */ e(ln, {}),
|
|
8376
8434
|
/* @__PURE__ */ l("div", { className: "floimg-studio h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
|
|
8377
|
-
/* @__PURE__ */ e(
|
|
8435
|
+
/* @__PURE__ */ e(qr, {}),
|
|
8378
8436
|
/* @__PURE__ */ e("div", { className: "floimg-tabs", children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
8379
8437
|
/* @__PURE__ */ l("div", { className: "flex", children: [
|
|
8380
8438
|
/* @__PURE__ */ e(
|
|
@@ -8425,37 +8483,37 @@ function Tn() {
|
|
|
8425
8483
|
] })
|
|
8426
8484
|
] }) }),
|
|
8427
8485
|
/* @__PURE__ */ l("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
8428
|
-
t === "editor" && /* @__PURE__ */ l(
|
|
8429
|
-
/* @__PURE__ */ e(
|
|
8430
|
-
/* @__PURE__ */ e(
|
|
8431
|
-
s && /* @__PURE__ */ e(
|
|
8486
|
+
t === "editor" && /* @__PURE__ */ l(X, { children: [
|
|
8487
|
+
/* @__PURE__ */ e(ur, {}),
|
|
8488
|
+
/* @__PURE__ */ e(Ln, {}),
|
|
8489
|
+
s && /* @__PURE__ */ e(pr, {})
|
|
8432
8490
|
] }),
|
|
8433
|
-
t === "history" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
8434
|
-
t === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
8491
|
+
t === "history" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(tn, {}) }),
|
|
8492
|
+
t === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(on, { onSelect: I }) })
|
|
8435
8493
|
] })
|
|
8436
8494
|
] })
|
|
8437
8495
|
] });
|
|
8438
8496
|
}
|
|
8439
8497
|
export {
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8498
|
+
gn as AIChat,
|
|
8499
|
+
pn as AISettings,
|
|
8500
|
+
jn as App,
|
|
8501
|
+
et as CATEGORY_NAMES,
|
|
8502
|
+
zn as CommandPalette,
|
|
8503
|
+
tn as ExecutionHistory,
|
|
8504
|
+
Gr as ExecutionResultsModal,
|
|
8505
|
+
Cn as KeyboardShortcutsModal,
|
|
8506
|
+
pr as NodeInspector,
|
|
8507
|
+
ur as NodePalette,
|
|
8508
|
+
se as NodePaletteItem,
|
|
8509
|
+
ke as SHORTCUT_DEFINITIONS,
|
|
8510
|
+
on as TemplateGallery,
|
|
8511
|
+
qr as Toolbar,
|
|
8512
|
+
mr as UploadGallery,
|
|
8513
|
+
cr as WorkflowEditor,
|
|
8514
|
+
ln as WorkflowLibrary,
|
|
8515
|
+
jr as useKeyboardShortcuts,
|
|
8516
|
+
A as useSettingsStore,
|
|
8459
8517
|
y as useWorkflowStore
|
|
8460
8518
|
};
|
|
8461
8519
|
//# sourceMappingURL=index.js.map
|