@teamflojo/floimg-studio-ui 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsxs as n, jsx as e, Fragment as B } from "react/jsx-runtime";
2
- import { memo as G, useRef as te, useCallback as W, useState as C, useEffect as U, useMemo as ie } from "react";
3
- import Ne, { Handle as P, Position as $, applyNodeChanges as ze, applyEdgeChanges as Ce, MarkerType as Ie, Background as Se, Controls as Le, MiniMap as We, ReactFlowProvider as Ae, useReactFlow as Pe } from "reactflow";
4
- import { create as ue } from "zustand";
5
- import { useQuery as K } from "@tanstack/react-query";
6
- function $e(r, l) {
1
+ import { jsxs as n, jsx as e, Fragment as q } from "react/jsx-runtime";
2
+ import { memo as G, useRef as te, useCallback as L, useState as C, useEffect as U, useMemo as de } from "react";
3
+ import Ce, { Handle as P, Position as M, applyNodeChanges as Ie, applyEdgeChanges as Se, MarkerType as Ae, Background as Le, Controls as We, MiniMap as Pe, ReactFlowProvider as Me, useReactFlow as De } from "reactflow";
4
+ import { create as he } from "zustand";
5
+ import { useQuery as _ } from "@tanstack/react-query";
6
+ function Te(r, d) {
7
7
  let t;
8
8
  try {
9
9
  t = r();
@@ -11,18 +11,18 @@ function $e(r, l) {
11
11
  return;
12
12
  }
13
13
  return {
14
- getItem: (i) => {
15
- var s;
16
- const p = (a) => a === null ? null : JSON.parse(a, void 0), d = (s = t.getItem(i)) != null ? s : null;
17
- return d instanceof Promise ? d.then(p) : p(d);
14
+ getItem: (s) => {
15
+ var i;
16
+ const p = (a) => a === null ? null : JSON.parse(a, void 0), l = (i = t.getItem(s)) != null ? i : null;
17
+ return l instanceof Promise ? l.then(p) : p(l);
18
18
  },
19
- setItem: (i, s) => t.setItem(i, JSON.stringify(s, void 0)),
20
- removeItem: (i) => t.removeItem(i)
19
+ setItem: (s, i) => t.setItem(s, JSON.stringify(i, void 0)),
20
+ removeItem: (s) => t.removeItem(s)
21
21
  };
22
22
  }
23
- const re = (r) => (l) => {
23
+ const re = (r) => (d) => {
24
24
  try {
25
- const t = r(l);
25
+ const t = r(d);
26
26
  return t instanceof Promise ? t : {
27
27
  then(o) {
28
28
  return re(o)(t);
@@ -41,61 +41,61 @@ const re = (r) => (l) => {
41
41
  }
42
42
  };
43
43
  }
44
- }, je = (r, l) => (t, o, i) => {
45
- let s = {
46
- storage: $e(() => localStorage),
47
- partialize: (v) => v,
44
+ }, je = (r, d) => (t, o, s) => {
45
+ let i = {
46
+ storage: Te(() => localStorage),
47
+ partialize: (y) => y,
48
48
  version: 0,
49
- merge: (v, w) => ({
49
+ merge: (y, w) => ({
50
50
  ...w,
51
- ...v
51
+ ...y
52
52
  }),
53
- ...l
53
+ ...d
54
54
  }, p = !1;
55
- const d = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
56
- let m = s.storage;
55
+ const l = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
56
+ let m = i.storage;
57
57
  if (!m)
58
58
  return r(
59
- (...v) => {
59
+ (...y) => {
60
60
  console.warn(
61
- `[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`
62
- ), t(...v);
61
+ `[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`
62
+ ), t(...y);
63
63
  },
64
64
  o,
65
- i
65
+ s
66
66
  );
67
67
  const c = () => {
68
- const v = s.partialize({ ...o() });
69
- return m.setItem(s.name, {
70
- state: v,
71
- version: s.version
68
+ const y = i.partialize({ ...o() });
69
+ return m.setItem(i.name, {
70
+ state: y,
71
+ version: i.version
72
72
  });
73
- }, u = i.setState;
74
- i.setState = (v, w) => (u(v, w), c());
73
+ }, u = s.setState;
74
+ s.setState = (y, w) => (u(y, w), c());
75
75
  const h = r(
76
- (...v) => (t(...v), c()),
76
+ (...y) => (t(...y), c()),
77
77
  o,
78
- i
78
+ s
79
79
  );
80
- i.getInitialState = () => h;
80
+ s.getInitialState = () => h;
81
81
  let b;
82
- const y = () => {
83
- var v, w;
82
+ const v = () => {
83
+ var y, w;
84
84
  if (!m) return;
85
- p = !1, d.forEach((g) => {
85
+ p = !1, l.forEach((g) => {
86
86
  var N;
87
87
  return g((N = o()) != null ? N : h);
88
88
  });
89
- const x = ((w = s.onRehydrateStorage) == null ? void 0 : w.call(s, (v = o()) != null ? v : h)) || void 0;
90
- return re(m.getItem.bind(m))(s.name).then((g) => {
89
+ const f = ((w = i.onRehydrateStorage) == null ? void 0 : w.call(i, (y = o()) != null ? y : h)) || void 0;
90
+ return re(m.getItem.bind(m))(i.name).then((g) => {
91
91
  if (g)
92
- if (typeof g.version == "number" && g.version !== s.version) {
93
- if (s.migrate) {
94
- const N = s.migrate(
92
+ if (typeof g.version == "number" && g.version !== i.version) {
93
+ if (i.migrate) {
94
+ const N = i.migrate(
95
95
  g.state,
96
96
  g.version
97
97
  );
98
- return N instanceof Promise ? N.then((A) => [!0, A]) : [!0, N];
98
+ return N instanceof Promise ? N.then((W) => [!0, W]) : [!0, N];
99
99
  }
100
100
  console.error(
101
101
  "State loaded from storage couldn't be migrated since no migrate function was provided"
@@ -105,45 +105,45 @@ const re = (r) => (l) => {
105
105
  return [!1, void 0];
106
106
  }).then((g) => {
107
107
  var N;
108
- const [A, k] = g;
109
- if (b = s.merge(
108
+ const [W, k] = g;
109
+ if (b = i.merge(
110
110
  k,
111
111
  (N = o()) != null ? N : h
112
- ), t(b, !0), A)
112
+ ), t(b, !0), W)
113
113
  return c();
114
114
  }).then(() => {
115
- x == null || x(b, void 0), b = o(), p = !0, a.forEach((g) => g(b));
115
+ f == null || f(b, void 0), b = o(), p = !0, a.forEach((g) => g(b));
116
116
  }).catch((g) => {
117
- x == null || x(void 0, g);
117
+ f == null || f(void 0, g);
118
118
  });
119
119
  };
120
- return i.persist = {
121
- setOptions: (v) => {
122
- s = {
123
- ...s,
124
- ...v
125
- }, v.storage && (m = v.storage);
120
+ return s.persist = {
121
+ setOptions: (y) => {
122
+ i = {
123
+ ...i,
124
+ ...y
125
+ }, y.storage && (m = y.storage);
126
126
  },
127
127
  clearStorage: () => {
128
- m == null || m.removeItem(s.name);
128
+ m == null || m.removeItem(i.name);
129
129
  },
130
- getOptions: () => s,
131
- rehydrate: () => y(),
130
+ getOptions: () => i,
131
+ rehydrate: () => v(),
132
132
  hasHydrated: () => p,
133
- onHydrate: (v) => (d.add(v), () => {
134
- d.delete(v);
133
+ onHydrate: (y) => (l.add(y), () => {
134
+ l.delete(y);
135
135
  }),
136
- onFinishHydration: (v) => (a.add(v), () => {
137
- a.delete(v);
136
+ onFinishHydration: (y) => (a.add(y), () => {
137
+ a.delete(y);
138
138
  })
139
- }, s.skipHydration || y(), b || h;
140
- }, ge = je, j = "/api";
141
- async function T(r, l) {
139
+ }, i.skipHydration || v(), b || h;
140
+ }, fe = je, D = "/api";
141
+ async function $(r, d) {
142
142
  const t = await fetch(r, {
143
- ...l,
143
+ ...d,
144
144
  headers: {
145
145
  "Content-Type": "application/json",
146
- ...l == null ? void 0 : l.headers
146
+ ...d == null ? void 0 : d.headers
147
147
  }
148
148
  });
149
149
  if (!t.ok) {
@@ -152,49 +152,49 @@ async function T(r, l) {
152
152
  }
153
153
  return t.json();
154
154
  }
155
- async function Me() {
156
- return T(`${j}/nodes/generators`);
155
+ async function $e() {
156
+ return $(`${D}/nodes/generators`);
157
157
  }
158
- async function De() {
159
- return T(`${j}/nodes/transforms`);
158
+ async function Ue() {
159
+ return $(`${D}/nodes/transforms`);
160
160
  }
161
- async function Te() {
162
- return T(`${j}/nodes/text`);
161
+ async function Re() {
162
+ return $(`${D}/nodes/text`);
163
163
  }
164
- async function Ue() {
165
- return T(`${j}/nodes/vision`);
164
+ async function Oe() {
165
+ return $(`${D}/nodes/vision`);
166
166
  }
167
- async function Oe(r, l, t) {
168
- return T(`${j}/execute/sync`, {
167
+ async function Ee(r, d, t) {
168
+ return $(`${D}/execute/sync`, {
169
169
  method: "POST",
170
- body: JSON.stringify({ nodes: r, edges: l, aiProviders: t })
170
+ body: JSON.stringify({ nodes: r, edges: d, aiProviders: t })
171
171
  });
172
172
  }
173
- async function Re(r, l) {
174
- return T(`${j}/export/yaml`, {
173
+ async function qe(r, d) {
174
+ return $(`${D}/export/yaml`, {
175
175
  method: "POST",
176
- body: JSON.stringify({ nodes: r, edges: l })
176
+ body: JSON.stringify({ nodes: r, edges: d })
177
177
  });
178
178
  }
179
- async function Ee() {
180
- return T(`${j}/images`);
179
+ async function Be() {
180
+ return $(`${D}/images`);
181
181
  }
182
182
  function le(r) {
183
- return `${j}/images/${r}/blob`;
183
+ return `${D}/images/${r}/blob`;
184
184
  }
185
- async function Be(r) {
185
+ async function Ge(r) {
186
186
  try {
187
- return await T(`${j}/images/${r}/workflow`);
187
+ return await $(`${D}/images/${r}/workflow`);
188
188
  } catch {
189
189
  return null;
190
190
  }
191
191
  }
192
- async function Ve(r) {
193
- const l = new FormData();
194
- l.append("file", r);
195
- const t = await fetch(`${j}/uploads`, {
192
+ async function Fe(r) {
193
+ const d = new FormData();
194
+ d.append("file", r);
195
+ const t = await fetch(`${D}/uploads`, {
196
196
  method: "POST",
197
- body: l
197
+ body: d
198
198
  });
199
199
  if (!t.ok) {
200
200
  const o = await t.json().catch(() => ({ error: "Upload failed" }));
@@ -202,74 +202,74 @@ async function Ve(r) {
202
202
  }
203
203
  return t.json();
204
204
  }
205
- async function Ge() {
206
- return T(`${j}/uploads`);
205
+ async function Ve() {
206
+ return $(`${D}/uploads`);
207
207
  }
208
- async function Fe(r) {
209
- const l = await fetch(`${j}/uploads/${r}`, {
208
+ async function He(r) {
209
+ const d = await fetch(`${D}/uploads/${r}`, {
210
210
  method: "DELETE"
211
211
  });
212
- if (!l.ok)
213
- throw new Error(`Failed to delete upload: ${l.status}`);
212
+ if (!d.ok)
213
+ throw new Error(`Failed to delete upload: ${d.status}`);
214
214
  }
215
- function he(r) {
216
- return `${j}/uploads/${r}/blob`;
215
+ function be(r) {
216
+ return `${D}/uploads/${r}/blob`;
217
217
  }
218
- async function He(r) {
219
- return T(`${j}/import`, {
218
+ async function _e(r) {
219
+ return $(`${D}/import`, {
220
220
  method: "POST",
221
221
  body: JSON.stringify({ yaml: r })
222
222
  });
223
223
  }
224
- async function _e(r) {
225
- return T(`${j}/import/validate`, {
224
+ async function Ke(r) {
225
+ return $(`${D}/import/validate`, {
226
226
  method: "POST",
227
227
  body: JSON.stringify({ yaml: r })
228
228
  });
229
229
  }
230
- async function Ke(r) {
231
- return T(`${j}/generate/workflow`, {
230
+ async function Qe(r) {
231
+ return $(`${D}/generate/workflow`, {
232
232
  method: "POST",
233
233
  body: JSON.stringify(r)
234
234
  });
235
235
  }
236
- async function qe() {
237
- return T(`${j}/generate/status`);
236
+ async function Je() {
237
+ return $(`${D}/generate/status`);
238
238
  }
239
- const de = "http://localhost:11434", ce = "http://localhost:1234", V = ue()(
240
- ge(
241
- (r, l) => ({
239
+ const ce = "http://localhost:11434", me = "http://localhost:1234", B = he()(
240
+ fe(
241
+ (r, d) => ({
242
242
  ai: {
243
243
  ollama: {
244
- baseUrl: de,
244
+ baseUrl: ce,
245
245
  enabled: !1
246
246
  },
247
247
  lmstudio: {
248
- baseUrl: ce,
248
+ baseUrl: me,
249
249
  enabled: !1
250
250
  }
251
251
  },
252
252
  showSettings: !1,
253
253
  setAIProvider: (t, o) => {
254
- r((i) => ({
254
+ r((s) => ({
255
255
  ai: {
256
- ...i.ai,
256
+ ...s.ai,
257
257
  [t]: o
258
258
  }
259
259
  }));
260
260
  },
261
261
  clearAIProvider: (t) => {
262
262
  r((o) => {
263
- const i = { ...o.ai };
264
- return delete i[t], { ai: i };
263
+ const s = { ...o.ai };
264
+ return delete s[t], { ai: s };
265
265
  });
266
266
  },
267
267
  openSettings: () => r({ showSettings: !0 }),
268
268
  closeSettings: () => r({ showSettings: !1 }),
269
269
  getConfiguredProviders: () => {
270
- var i, s, p, d, a, m, c;
271
- const { ai: t } = l(), o = {};
272
- return (i = t.openai) != null && i.enabled && t.openai.apiKey && (o.openai = { apiKey: t.openai.apiKey }), (s = t.anthropic) != null && s.enabled && t.anthropic.apiKey && (o.anthropic = { apiKey: t.anthropic.apiKey }), (p = t.gemini) != null && p.enabled && t.gemini.apiKey && (o.gemini = { apiKey: t.gemini.apiKey }), (d = t.grok) != null && d.enabled && t.grok.apiKey && (o.grok = { apiKey: t.grok.apiKey }), (a = t.openrouter) != null && a.enabled && t.openrouter.apiKey && (o.openrouter = { apiKey: t.openrouter.apiKey }), (m = t.ollama) != null && m.enabled && (o.ollama = { baseUrl: t.ollama.baseUrl || de }), (c = t.lmstudio) != null && c.enabled && (o.lmstudio = { baseUrl: t.lmstudio.baseUrl || ce }), o;
270
+ var s, i, p, l, a, m, c;
271
+ const { ai: t } = d(), o = {};
272
+ return (s = t.openai) != null && s.enabled && t.openai.apiKey && (o.openai = { apiKey: t.openai.apiKey }), (i = t.anthropic) != null && i.enabled && t.anthropic.apiKey && (o.anthropic = { apiKey: t.anthropic.apiKey }), (p = t.gemini) != null && p.enabled && t.gemini.apiKey && (o.gemini = { apiKey: t.gemini.apiKey }), (l = t.grok) != null && l.enabled && t.grok.apiKey && (o.grok = { apiKey: t.grok.apiKey }), (a = t.openrouter) != null && a.enabled && t.openrouter.apiKey && (o.openrouter = { apiKey: t.openrouter.apiKey }), (m = t.ollama) != null && m.enabled && (o.ollama = { baseUrl: t.ollama.baseUrl || ce }), (c = t.lmstudio) != null && c.enabled && (o.lmstudio = { baseUrl: t.lmstudio.baseUrl || me }), o;
273
273
  }
274
274
  }),
275
275
  {
@@ -279,17 +279,17 @@ const de = "http://localhost:11434", ce = "http://localhost:1234", V = ue()(
279
279
  }
280
280
  )
281
281
  );
282
- let Je = 0;
283
- function H() {
284
- return `node_${++Je}`;
282
+ let Ye = 0;
283
+ function V() {
284
+ return `node_${++Ye}`;
285
285
  }
286
- function me() {
287
- const r = Date.now(), l = Math.random().toString(36).substring(2, 8);
288
- return `wf_${r}_${l}`;
286
+ function pe() {
287
+ const r = Date.now(), d = Math.random().toString(36).substring(2, 8);
288
+ return `wf_${r}_${d}`;
289
289
  }
290
- const f = ue()(
291
- ge(
292
- (r, l) => ({
290
+ const x = he()(
291
+ fe(
292
+ (r, d) => ({
293
293
  nodes: [],
294
294
  edges: [],
295
295
  selectedNodeId: null,
@@ -314,25 +314,25 @@ const f = ue()(
314
314
  nodeStatus: {}
315
315
  },
316
316
  loadTemplate: (t) => {
317
- const o = /* @__PURE__ */ new Map(), i = t.workflow.nodes.map((p) => {
318
- const d = H();
319
- return o.set(p.id, d), {
320
- id: d,
317
+ const o = /* @__PURE__ */ new Map(), s = t.workflow.nodes.map((p) => {
318
+ const l = V();
319
+ return o.set(p.id, l), {
320
+ id: l,
321
321
  type: p.type,
322
322
  position: p.position,
323
323
  data: p.data
324
324
  };
325
- }), s = t.workflow.edges.map((p) => {
326
- const d = o.get(p.source) || p.source, a = o.get(p.target) || p.target;
325
+ }), i = t.workflow.edges.map((p) => {
326
+ const l = o.get(p.source) || p.source, a = o.get(p.target) || p.target;
327
327
  return {
328
- id: `edge_${d}_${a}`,
329
- source: d,
328
+ id: `edge_${l}_${a}`,
329
+ source: l,
330
330
  target: a
331
331
  };
332
332
  });
333
333
  r({
334
- nodes: i,
335
- edges: s,
334
+ nodes: s,
335
+ edges: i,
336
336
  selectedNodeId: null,
337
337
  currentTemplateId: t.id,
338
338
  previewVisible: {},
@@ -377,104 +377,104 @@ const f = ue()(
377
377
  setTextProviders: (t) => r({ textProviders: t }),
378
378
  setVisionProviders: (t) => r({ visionProviders: t }),
379
379
  addNode: (t, o) => {
380
- var d, a, m;
381
- const i = H();
382
- let s;
380
+ var l, a, m;
381
+ const s = V();
382
+ let i;
383
383
  if (t.type === "generator")
384
- s = {
384
+ i = {
385
385
  generatorName: t.name,
386
- params: Q(t),
386
+ params: J(t),
387
387
  isAI: t.isAI,
388
388
  // Track if this is an AI generator (can accept text input)
389
389
  acceptsReferenceImages: t.acceptsReferenceImages,
390
390
  maxReferenceImages: t.maxReferenceImages
391
391
  };
392
392
  else if (t.type === "transform")
393
- s = {
393
+ i = {
394
394
  operation: t.name,
395
395
  providerName: t.providerName,
396
396
  // Track which provider this transform belongs to
397
397
  isAI: t.isAI,
398
398
  // Track if this is an AI transform (can accept text input)
399
- params: Q(t),
399
+ params: J(t),
400
400
  acceptsReferenceImages: t.acceptsReferenceImages,
401
401
  maxReferenceImages: t.maxReferenceImages
402
402
  };
403
403
  else if (t.type === "input")
404
- s = {
404
+ i = {
405
405
  uploadId: void 0,
406
406
  filename: void 0,
407
407
  mime: void 0
408
408
  };
409
409
  else if (t.type === "vision")
410
- s = {
410
+ i = {
411
411
  providerName: t.name,
412
412
  providerLabel: t.label,
413
413
  // Human-readable label (e.g., "Gemini Vision")
414
- params: Q(t)
414
+ params: J(t)
415
415
  };
416
416
  else if (t.type === "text")
417
- s = {
417
+ i = {
418
418
  providerName: t.name,
419
419
  providerLabel: t.label,
420
420
  // Human-readable label (e.g., "Gemini Text")
421
- params: Q(t)
421
+ params: J(t)
422
422
  };
423
423
  else {
424
- const c = ((d = t.params) == null ? void 0 : d.properties) || {}, u = ((a = c.provider) == null ? void 0 : a.default) || "filesystem";
425
- s = {
424
+ const c = ((l = t.params) == null ? void 0 : l.properties) || {}, u = ((a = c.provider) == null ? void 0 : a.default) || "filesystem";
425
+ i = {
426
426
  destination: ((m = c.destination) == null ? void 0 : m.default) || "./output/image.png",
427
427
  provider: u
428
428
  };
429
429
  }
430
430
  const p = {
431
- id: i,
431
+ id: s,
432
432
  type: t.type,
433
433
  position: o,
434
- data: s
434
+ data: i
435
435
  };
436
436
  r((c) => ({
437
437
  nodes: [...c.nodes, p]
438
438
  }));
439
439
  },
440
440
  updateNodeData: (t, o) => {
441
- r((i) => ({
442
- nodes: i.nodes.map(
443
- (s) => s.id === t ? { ...s, data: { ...s.data, ...o } } : s
441
+ r((s) => ({
442
+ nodes: s.nodes.map(
443
+ (i) => i.id === t ? { ...i, data: { ...i.data, ...o } } : i
444
444
  )
445
445
  }));
446
446
  },
447
447
  deleteNode: (t) => {
448
448
  r((o) => ({
449
- nodes: o.nodes.filter((i) => i.id !== t),
450
- edges: o.edges.filter((i) => i.source !== t && i.target !== t),
449
+ nodes: o.nodes.filter((s) => s.id !== t),
450
+ edges: o.edges.filter((s) => s.source !== t && s.target !== t),
451
451
  selectedNodeId: o.selectedNodeId === t ? null : o.selectedNodeId
452
452
  }));
453
453
  },
454
454
  duplicateNode: (t) => {
455
- const o = l(), i = o.nodes.find((d) => d.id === t);
456
- if (!i) return;
457
- const s = H(), p = {
458
- ...i,
459
- id: s,
455
+ const o = d(), s = o.nodes.find((l) => l.id === t);
456
+ if (!s) return;
457
+ const i = V(), p = {
458
+ ...s,
459
+ id: i,
460
460
  position: {
461
- x: i.position.x + 50,
462
- y: i.position.y + 50
461
+ x: s.position.x + 50,
462
+ y: s.position.y + 50
463
463
  },
464
- data: JSON.parse(JSON.stringify(i.data)),
464
+ data: JSON.parse(JSON.stringify(s.data)),
465
465
  // Deep clone
466
466
  selected: !1
467
467
  };
468
468
  r({
469
469
  nodes: [...o.nodes, p],
470
- selectedNodeId: s
470
+ selectedNodeId: i
471
471
  // Select the new node
472
472
  });
473
473
  },
474
474
  setNodes: (t) => r({ nodes: t }),
475
475
  addEdge: (t) => {
476
476
  if (!t.source || !t.target) return;
477
- const o = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"), s = {
477
+ const o = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"), i = {
478
478
  id: o ? `edge_${t.source}_${t.target}_${o}` : `edge_${t.source}_${t.target}`,
479
479
  source: t.source,
480
480
  target: t.target,
@@ -482,31 +482,31 @@ const f = ue()(
482
482
  targetHandle: t.targetHandle ?? void 0
483
483
  };
484
484
  r((p) => ({
485
- edges: [...p.edges, s]
485
+ edges: [...p.edges, i]
486
486
  }));
487
487
  },
488
488
  deleteEdge: (t) => {
489
489
  r((o) => ({
490
- edges: o.edges.filter((i) => i.id !== t)
490
+ edges: o.edges.filter((s) => s.id !== t)
491
491
  }));
492
492
  },
493
493
  setEdges: (t) => r({ edges: t }),
494
494
  setSelectedNode: (t) => r({ selectedNodeId: t }),
495
495
  execute: async () => {
496
- const { nodes: t, edges: o } = l(), i = t.map((a) => ({
496
+ const { nodes: t, edges: o } = d(), s = t.map((a) => ({
497
497
  id: a.id,
498
498
  type: a.type,
499
499
  position: a.position,
500
500
  data: a.data
501
- })), s = o.map((a) => ({
501
+ })), i = o.map((a) => ({
502
502
  id: a.id,
503
503
  source: a.source,
504
504
  target: a.target,
505
505
  sourceHandle: a.sourceHandle ?? void 0,
506
506
  targetHandle: a.targetHandle ?? void 0
507
- })), p = V.getState().getConfiguredProviders(), d = {};
507
+ })), p = B.getState().getConfiguredProviders(), l = {};
508
508
  for (const a of t)
509
- d[a.id] = "running";
509
+ l[a.id] = "running";
510
510
  r({
511
511
  execution: {
512
512
  status: "running",
@@ -514,11 +514,11 @@ const f = ue()(
514
514
  imageUrls: [],
515
515
  previews: {},
516
516
  dataOutputs: {},
517
- nodeStatus: d
517
+ nodeStatus: l
518
518
  }
519
519
  });
520
520
  try {
521
- const a = await Oe(i, s, p), m = {};
521
+ const a = await Ee(s, i, p), m = {};
522
522
  for (const c of t)
523
523
  m[c.id] = a.status === "completed" ? "completed" : "error";
524
524
  a.status === "completed" ? r({
@@ -559,31 +559,31 @@ const f = ue()(
559
559
  }
560
560
  },
561
561
  exportToYaml: async () => {
562
- const { nodes: t, edges: o } = l(), i = t.map((d) => ({
563
- id: d.id,
564
- type: d.type,
565
- position: d.position,
566
- data: d.data
567
- })), s = o.map((d) => ({
568
- id: d.id,
569
- source: d.source,
570
- target: d.target,
571
- sourceHandle: d.sourceHandle ?? void 0,
572
- targetHandle: d.targetHandle ?? void 0
562
+ const { nodes: t, edges: o } = d(), s = t.map((l) => ({
563
+ id: l.id,
564
+ type: l.type,
565
+ position: l.position,
566
+ data: l.data
567
+ })), i = o.map((l) => ({
568
+ id: l.id,
569
+ source: l.source,
570
+ target: l.target,
571
+ sourceHandle: l.sourceHandle ?? void 0,
572
+ targetHandle: l.targetHandle ?? void 0
573
573
  }));
574
- return (await Re(i, s)).yaml;
574
+ return (await qe(s, i)).yaml;
575
575
  },
576
- importFromYaml: (t, o, i) => {
577
- const s = /* @__PURE__ */ new Map(), p = t.map((a) => {
578
- const m = H();
579
- return s.set(a.id, m), {
576
+ importFromYaml: (t, o, s) => {
577
+ const i = /* @__PURE__ */ new Map(), p = t.map((a) => {
578
+ const m = V();
579
+ return i.set(a.id, m), {
580
580
  id: m,
581
581
  type: a.type,
582
582
  position: a.position,
583
583
  data: a.data
584
584
  };
585
- }), d = o.map((a) => {
586
- const m = s.get(a.source) || a.source, c = s.get(a.target) || a.target;
585
+ }), l = o.map((a) => {
586
+ const m = i.get(a.source) || a.source, c = i.get(a.target) || a.target;
587
587
  return {
588
588
  id: `edge_${m}_${c}`,
589
589
  source: m,
@@ -592,12 +592,12 @@ const f = ue()(
592
592
  });
593
593
  r({
594
594
  nodes: p,
595
- edges: d,
595
+ edges: l,
596
596
  selectedNodeId: null,
597
597
  currentTemplateId: null,
598
598
  previewVisible: {},
599
599
  activeWorkflowId: null,
600
- activeWorkflowName: i || "Imported Workflow",
600
+ activeWorkflowName: s || "Imported Workflow",
601
601
  hasUnsavedChanges: !0,
602
602
  execution: {
603
603
  status: "idle",
@@ -636,33 +636,33 @@ const f = ue()(
636
636
  saveWorkflow: (t) => {
637
637
  const {
638
638
  nodes: o,
639
- edges: i,
640
- activeWorkflowId: s,
639
+ edges: s,
640
+ activeWorkflowId: i,
641
641
  activeWorkflowName: p,
642
- savedWorkflows: d,
642
+ savedWorkflows: l,
643
643
  currentTemplateId: a
644
- } = l(), m = Date.now();
645
- if (s) {
646
- const c = d.map(
647
- (u) => u.id === s ? { ...u, name: t || p, nodes: o, edges: i, updatedAt: m } : u
644
+ } = d(), m = Date.now();
645
+ if (i) {
646
+ const c = l.map(
647
+ (u) => u.id === i ? { ...u, name: t || p, nodes: o, edges: s, updatedAt: m } : u
648
648
  );
649
649
  return r({
650
650
  savedWorkflows: c,
651
651
  activeWorkflowName: t || p,
652
652
  hasUnsavedChanges: !1
653
- }), s;
653
+ }), i;
654
654
  } else {
655
- const c = me(), u = {
655
+ const c = pe(), u = {
656
656
  id: c,
657
657
  name: t || p,
658
658
  nodes: o,
659
- edges: i,
659
+ edges: s,
660
660
  createdAt: m,
661
661
  updatedAt: m,
662
662
  templateId: a || void 0
663
663
  };
664
664
  return r({
665
- savedWorkflows: [...d, u],
665
+ savedWorkflows: [...l, u],
666
666
  activeWorkflowId: c,
667
667
  activeWorkflowName: t || p,
668
668
  hasUnsavedChanges: !1
@@ -670,15 +670,15 @@ const f = ue()(
670
670
  }
671
671
  },
672
672
  loadWorkflow: (t) => {
673
- const { savedWorkflows: o } = l(), i = o.find((s) => s.id === t);
674
- i && r({
675
- nodes: i.nodes,
676
- edges: i.edges,
673
+ const { savedWorkflows: o } = d(), s = o.find((i) => i.id === t);
674
+ s && r({
675
+ nodes: s.nodes,
676
+ edges: s.edges,
677
677
  selectedNodeId: null,
678
- currentTemplateId: i.templateId || null,
678
+ currentTemplateId: s.templateId || null,
679
679
  previewVisible: {},
680
680
  activeWorkflowId: t,
681
- activeWorkflowName: i.name,
681
+ activeWorkflowName: s.name,
682
682
  hasUnsavedChanges: !1,
683
683
  execution: {
684
684
  status: "idle",
@@ -691,9 +691,9 @@ const f = ue()(
691
691
  });
692
692
  },
693
693
  deleteWorkflow: (t) => {
694
- const { savedWorkflows: o, activeWorkflowId: i } = l(), s = o.filter((p) => p.id !== t);
695
- r(i === t ? {
696
- savedWorkflows: s,
694
+ const { savedWorkflows: o, activeWorkflowId: s } = d(), i = o.filter((p) => p.id !== t);
695
+ r(s === t ? {
696
+ savedWorkflows: i,
697
697
  nodes: [],
698
698
  edges: [],
699
699
  selectedNodeId: null,
@@ -710,40 +710,40 @@ const f = ue()(
710
710
  dataOutputs: {},
711
711
  nodeStatus: {}
712
712
  }
713
- } : { savedWorkflows: s });
713
+ } : { savedWorkflows: i });
714
714
  },
715
715
  renameWorkflow: (t, o) => {
716
- const { savedWorkflows: i, activeWorkflowId: s } = l(), p = i.map(
717
- (d) => d.id === t ? { ...d, name: o, updatedAt: Date.now() } : d
716
+ const { savedWorkflows: s, activeWorkflowId: i } = d(), p = s.map(
717
+ (l) => l.id === t ? { ...l, name: o, updatedAt: Date.now() } : l
718
718
  );
719
719
  r({
720
720
  savedWorkflows: p,
721
- ...s === t ? { activeWorkflowName: o } : {}
721
+ ...i === t ? { activeWorkflowName: o } : {}
722
722
  });
723
723
  },
724
724
  duplicateWorkflow: (t) => {
725
- const { savedWorkflows: o } = l(), i = o.find((a) => a.id === t);
726
- if (!i) return "";
727
- const s = Date.now(), p = me(), d = {
728
- ...i,
725
+ const { savedWorkflows: o } = d(), s = o.find((a) => a.id === t);
726
+ if (!s) return "";
727
+ const i = Date.now(), p = pe(), l = {
728
+ ...s,
729
729
  id: p,
730
- name: `${i.name} (Copy)`,
731
- createdAt: s,
732
- updatedAt: s
730
+ name: `${s.name} (Copy)`,
731
+ createdAt: i,
732
+ updatedAt: i
733
733
  };
734
- return r({ savedWorkflows: [...o, d] }), p;
734
+ return r({ savedWorkflows: [...o, l] }), p;
735
735
  },
736
736
  loadGeneratedWorkflow: (t) => {
737
- const o = /* @__PURE__ */ new Map(), i = 250, s = 150, p = 3, d = t.nodes.map((m, c) => {
738
- const u = H();
737
+ const o = /* @__PURE__ */ new Map(), s = 250, i = 150, p = 3, l = t.nodes.map((m, c) => {
738
+ const u = V();
739
739
  o.set(m.id, u);
740
- const h = m.nodeType.split(":"), b = h[0], y = Math.floor(c / p), w = {
741
- x: 100 + c % p * i,
742
- y: 100 + y * s
740
+ const h = m.nodeType.split(":"), b = h[0], v = Math.floor(c / p), w = {
741
+ x: 100 + c % p * s,
742
+ y: 100 + v * i
743
743
  };
744
- let x;
744
+ let f;
745
745
  if (b === "generator")
746
- x = {
746
+ f = {
747
747
  generatorName: h.slice(1).join(":"),
748
748
  params: m.parameters,
749
749
  isAI: !0
@@ -751,42 +751,42 @@ const f = ue()(
751
751
  };
752
752
  else if (b === "transform") {
753
753
  const g = h[1];
754
- x = {
754
+ f = {
755
755
  operation: h.slice(2).join(":"),
756
756
  providerName: g,
757
757
  params: m.parameters
758
758
  };
759
759
  } else if (b === "input")
760
- x = {
760
+ f = {
761
761
  uploadId: void 0,
762
762
  filename: void 0,
763
763
  mime: void 0
764
764
  };
765
765
  else if (b === "vision")
766
- x = {
766
+ f = {
767
767
  providerName: h.slice(1).join(":"),
768
768
  params: m.parameters
769
769
  };
770
770
  else if (b === "text") {
771
- const g = h.slice(1).join(":"), N = m.parameters.jsonSchema, A = N != null && N.properties ? {
771
+ const g = h.slice(1).join(":"), N = m.parameters.jsonSchema, W = N != null && N.properties ? {
772
772
  type: "object",
773
773
  properties: Object.fromEntries(
774
- Object.entries(N.properties).map(([k, L]) => [
774
+ Object.entries(N.properties).map(([k, A]) => [
775
775
  k,
776
776
  {
777
- type: L.type || "string",
778
- description: L.description
777
+ type: A.type || "string",
778
+ description: A.description
779
779
  }
780
780
  ])
781
781
  )
782
782
  } : void 0;
783
- x = {
783
+ f = {
784
784
  providerName: g,
785
785
  params: m.parameters,
786
- outputSchema: A
786
+ outputSchema: W
787
787
  };
788
788
  } else
789
- x = {
789
+ f = {
790
790
  destination: m.parameters.destination || "./output/image.png",
791
791
  provider: m.parameters.provider || "filesystem"
792
792
  };
@@ -794,7 +794,7 @@ const f = ue()(
794
794
  id: u,
795
795
  type: b,
796
796
  position: w,
797
- data: x
797
+ data: f
798
798
  };
799
799
  }), a = t.edges.map((m) => {
800
800
  const c = o.get(m.source) || m.source, u = o.get(m.target) || m.target, h = [m.sourceHandle, m.targetHandle].filter(Boolean).join("_");
@@ -807,7 +807,7 @@ const f = ue()(
807
807
  };
808
808
  });
809
809
  r({
810
- nodes: d,
810
+ nodes: l,
811
811
  edges: a,
812
812
  selectedNodeId: null,
813
813
  currentTemplateId: null,
@@ -835,28 +835,28 @@ const f = ue()(
835
835
  }
836
836
  )
837
837
  );
838
- function Q(r) {
838
+ function J(r) {
839
839
  var t;
840
- const l = {};
840
+ const d = {};
841
841
  if ((t = r.params) != null && t.properties)
842
- for (const [o, i] of Object.entries(r.params.properties))
843
- i.default !== void 0 && (l[o] = i.default);
844
- return l;
842
+ for (const [o, s] of Object.entries(r.params.properties))
843
+ s.default !== void 0 && (d[o] = s.default);
844
+ return d;
845
845
  }
846
846
  function F(r) {
847
847
  return r === "running" ? "border-yellow-400 animate-pulse" : r === "completed" ? "border-green-500" : r === "error" ? "border-red-500" : "";
848
848
  }
849
- function ae({ nodeId: r, color: l }) {
850
- const t = f((i) => i.previewVisible[r] !== !1), o = f((i) => i.togglePreview);
849
+ function ae({ nodeId: r, color: d }) {
850
+ const t = x((s) => s.previewVisible[r] !== !1), o = x((s) => s.togglePreview);
851
851
  return /* @__PURE__ */ e(
852
852
  "button",
853
853
  {
854
- onClick: (i) => {
855
- i.stopPropagation(), o(r);
854
+ onClick: (s) => {
855
+ s.stopPropagation(), o(r);
856
856
  },
857
857
  className: `ml-auto p-1 rounded hover:bg-gray-200 dark:hover:bg-zinc-600 transition-colors ${t ? "opacity-100" : "opacity-40"}`,
858
858
  title: t ? "Hide preview" : "Show preview",
859
- children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${l}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: t ? /* @__PURE__ */ e(
859
+ children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${d}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: t ? /* @__PURE__ */ e(
860
860
  "path",
861
861
  {
862
862
  strokeLinecap: "round",
@@ -876,12 +876,12 @@ function ae({ nodeId: r, color: l }) {
876
876
  }
877
877
  );
878
878
  }
879
- const Qe = G(function({
880
- id: l,
879
+ const Xe = G(function({
880
+ id: d,
881
881
  data: t,
882
882
  selected: o
883
883
  }) {
884
- const i = f((u) => u.execution.previews[l]), s = f((u) => u.execution.nodeStatus[l]), p = f((u) => u.previewVisible[l] !== !1), a = F(s) || (o ? "border-blue-500" : "border-blue-200"), m = t.isAI, c = t.acceptsReferenceImages;
884
+ const s = x((u) => u.execution.previews[d]), i = x((u) => u.execution.nodeStatus[d]), p = x((u) => u.previewVisible[d] !== !1), a = F(i) || (o ? "border-blue-500" : "border-blue-200"), m = t.isAI, c = t.acceptsReferenceImages;
885
885
  return /* @__PURE__ */ n(
886
886
  "div",
887
887
  {
@@ -891,7 +891,7 @@ const Qe = G(function({
891
891
  P,
892
892
  {
893
893
  type: "target",
894
- position: $.Top,
894
+ position: M.Top,
895
895
  id: "text",
896
896
  className: "w-3 h-3 !bg-pink-500",
897
897
  title: "Text input (optional prompt from text/vision node)"
@@ -901,19 +901,19 @@ const Qe = G(function({
901
901
  P,
902
902
  {
903
903
  type: "target",
904
- position: $.Left,
904
+ position: M.Left,
905
905
  id: "references",
906
906
  className: "w-3 h-3 !bg-violet-500",
907
907
  style: { top: "50%" },
908
908
  title: `Reference images (up to ${t.maxReferenceImages || 14})`
909
909
  }
910
910
  ),
911
- i && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-24 object-contain" }) }),
911
+ s && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: s, alt: "Preview", className: "w-full h-24 object-contain" }) }),
912
912
  /* @__PURE__ */ n("div", { className: "px-4 py-3", children: [
913
913
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
914
914
  /* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-blue-500" }),
915
915
  /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-blue-700 dark:text-blue-400", children: t.generatorName }),
916
- /* @__PURE__ */ e(ae, { nodeId: l, color: "text-blue-500 dark:text-blue-400" })
916
+ /* @__PURE__ */ e(ae, { nodeId: d, color: "text-blue-500 dark:text-blue-400" })
917
917
  ] }),
918
918
  m && /* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 mb-1", children: "↑ Connect text node for dynamic prompt" }),
919
919
  c && /* @__PURE__ */ e("div", { className: "text-[10px] text-violet-500 dark:text-violet-400 mb-1", children: "← Connect reference images" }),
@@ -923,16 +923,16 @@ const Qe = G(function({
923
923
  String(h).slice(0, 20)
924
924
  ] }, u)) })
925
925
  ] }),
926
- /* @__PURE__ */ e(P, { type: "source", position: $.Right, className: "w-3 h-3 !bg-blue-500" })
926
+ /* @__PURE__ */ e(P, { type: "source", position: M.Right, className: "w-3 h-3 !bg-blue-500" })
927
927
  ]
928
928
  }
929
929
  );
930
- }), Ye = G(function({
931
- id: l,
930
+ }), Ze = G(function({
931
+ id: d,
932
932
  data: t,
933
933
  selected: o
934
934
  }) {
935
- const i = f((u) => u.execution.previews[l]), s = f((u) => u.execution.nodeStatus[l]), p = f((u) => u.previewVisible[l] !== !1), a = F(s) || (o ? "border-teal-500" : "border-teal-200"), m = t.isAI, c = t.acceptsReferenceImages;
935
+ const s = x((u) => u.execution.previews[d]), i = x((u) => u.execution.nodeStatus[d]), p = x((u) => u.previewVisible[d] !== !1), a = F(i) || (o ? "border-teal-500" : "border-teal-200"), m = t.isAI, c = t.acceptsReferenceImages;
936
936
  return /* @__PURE__ */ n(
937
937
  "div",
938
938
  {
@@ -942,24 +942,24 @@ const Qe = G(function({
942
942
  P,
943
943
  {
944
944
  type: "target",
945
- position: $.Top,
945
+ position: M.Top,
946
946
  id: "text",
947
947
  className: "w-3 h-3 !bg-pink-500",
948
948
  title: "Text input (optional prompt from text/vision node)"
949
949
  }
950
950
  ),
951
- /* @__PURE__ */ e(P, { type: "target", position: $.Left, id: "image", className: "w-3 h-3 !bg-teal-500" }),
951
+ /* @__PURE__ */ e(P, { type: "target", position: M.Left, id: "image", className: "w-3 h-3 !bg-teal-500" }),
952
952
  c && /* @__PURE__ */ e(
953
953
  P,
954
954
  {
955
955
  type: "target",
956
- position: $.Bottom,
956
+ position: M.Bottom,
957
957
  id: "references",
958
958
  className: "w-3 h-3 !bg-violet-500",
959
959
  title: `Reference images (up to ${t.maxReferenceImages || 13})`
960
960
  }
961
961
  ),
962
- i && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-24 object-contain" }) }),
962
+ s && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: s, alt: "Preview", className: "w-full h-24 object-contain" }) }),
963
963
  /* @__PURE__ */ n("div", { className: "px-4 py-3", children: [
964
964
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
965
965
  m ? /* @__PURE__ */ n("svg", { className: "w-3 h-3 text-purple-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
@@ -983,7 +983,7 @@ const Qe = G(function({
983
983
  /* @__PURE__ */ e(
984
984
  ae,
985
985
  {
986
- nodeId: l,
986
+ nodeId: d,
987
987
  color: m ? "text-purple-500 dark:text-purple-400" : "text-teal-500 dark:text-teal-400"
988
988
  }
989
989
  )
@@ -996,18 +996,18 @@ const Qe = G(function({
996
996
  String(h).slice(0, 20)
997
997
  ] }, u)) })
998
998
  ] }),
999
- /* @__PURE__ */ e(P, { type: "source", position: $.Right, className: "w-3 h-3 !bg-teal-500" })
999
+ /* @__PURE__ */ e(P, { type: "source", position: M.Right, className: "w-3 h-3 !bg-teal-500" })
1000
1000
  ]
1001
1001
  }
1002
1002
  );
1003
- }), Xe = G(function({ id: l, data: t, selected: o }) {
1004
- const i = f((d) => d.execution.nodeStatus[l]), p = F(i) || (o ? "border-green-500" : "border-green-200");
1003
+ }), et = G(function({ id: d, data: t, selected: o }) {
1004
+ const s = x((l) => l.execution.nodeStatus[d]), p = F(s) || (o ? "border-green-500" : "border-green-200");
1005
1005
  return /* @__PURE__ */ n(
1006
1006
  "div",
1007
1007
  {
1008
1008
  className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${p}`,
1009
1009
  children: [
1010
- /* @__PURE__ */ e(P, { type: "target", position: $.Left, className: "w-3 h-3 !bg-green-500" }),
1010
+ /* @__PURE__ */ e(P, { type: "target", position: M.Left, className: "w-3 h-3 !bg-green-500" }),
1011
1011
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
1012
1012
  /* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-green-500" }),
1013
1013
  /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-green-700 dark:text-green-400", children: "Save" })
@@ -1016,38 +1016,38 @@ const Qe = G(function({
1016
1016
  ]
1017
1017
  }
1018
1018
  );
1019
- }), Ze = G(function({ id: l, data: t, selected: o }) {
1020
- const i = f((w) => w.execution.previews[l]), s = f((w) => w.execution.nodeStatus[l]), p = f((w) => w.previewVisible[l] !== !1), d = f((w) => w.updateNodeData), a = te(null), c = F(s) || (o ? "border-amber-500" : "border-amber-200"), u = W(
1019
+ }), tt = G(function({ id: d, data: t, selected: o }) {
1020
+ const s = x((w) => w.execution.previews[d]), i = x((w) => w.execution.nodeStatus[d]), p = x((w) => w.previewVisible[d] !== !1), l = x((w) => w.updateNodeData), a = te(null), c = F(i) || (o ? "border-amber-500" : "border-amber-200"), u = L(
1021
1021
  async (w) => {
1022
1022
  try {
1023
- const x = await Ve(w);
1024
- d(l, {
1025
- uploadId: x.id,
1026
- filename: x.filename,
1027
- mime: x.mime
1023
+ const f = await Fe(w);
1024
+ l(d, {
1025
+ uploadId: f.id,
1026
+ filename: f.filename,
1027
+ mime: f.mime
1028
1028
  });
1029
- } catch (x) {
1030
- console.error("Upload failed:", x);
1029
+ } catch (f) {
1030
+ console.error("Upload failed:", f);
1031
1031
  }
1032
1032
  },
1033
- [l, d]
1034
- ), h = W(
1033
+ [d, l]
1034
+ ), h = L(
1035
1035
  (w) => {
1036
1036
  w.preventDefault(), w.stopPropagation();
1037
- const x = w.dataTransfer.files[0];
1038
- x && x.type.startsWith("image/") && u(x);
1037
+ const f = w.dataTransfer.files[0];
1038
+ f && f.type.startsWith("image/") && u(f);
1039
1039
  },
1040
1040
  [u]
1041
- ), b = W((w) => {
1041
+ ), b = L((w) => {
1042
1042
  w.preventDefault(), w.stopPropagation();
1043
- }, []), y = W(
1043
+ }, []), v = L(
1044
1044
  (w) => {
1045
1045
  var g;
1046
- const x = (g = w.target.files) == null ? void 0 : g[0];
1047
- x && u(x);
1046
+ const f = (g = w.target.files) == null ? void 0 : g[0];
1047
+ f && u(f);
1048
1048
  },
1049
1049
  [u]
1050
- ), v = i || (t.uploadId ? he(t.uploadId) : null);
1050
+ ), y = s || (t.uploadId ? be(t.uploadId) : null);
1051
1051
  return /* @__PURE__ */ n(
1052
1052
  "div",
1053
1053
  {
@@ -1055,7 +1055,7 @@ const Qe = G(function({
1055
1055
  onDrop: h,
1056
1056
  onDragOver: b,
1057
1057
  children: [
1058
- v && p ? /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: v, alt: "Uploaded", className: "w-full h-24 object-contain" }) }) : v ? null : /* @__PURE__ */ e(
1058
+ y && p ? /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: y, alt: "Uploaded", className: "w-full h-24 object-contain" }) }) : y ? null : /* @__PURE__ */ e(
1059
1059
  "div",
1060
1060
  {
1061
1061
  className: "bg-amber-50 dark:bg-amber-900/30 border-b border-amber-100 dark:border-amber-800 h-24 flex items-center justify-center cursor-pointer hover:bg-amber-100 dark:hover:bg-amber-900/50 transition-colors",
@@ -1076,40 +1076,40 @@ const Qe = G(function({
1076
1076
  type: "file",
1077
1077
  accept: "image/*",
1078
1078
  className: "hidden",
1079
- onChange: y
1079
+ onChange: v
1080
1080
  }
1081
1081
  ),
1082
1082
  /* @__PURE__ */ n("div", { className: "px-4 py-3", children: [
1083
1083
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
1084
1084
  /* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-amber-500" }),
1085
1085
  /* @__PURE__ */ e("span", { className: "font-semibold text-sm text-amber-700 dark:text-amber-400", children: "Input" }),
1086
- /* @__PURE__ */ e(ae, { nodeId: l, color: "text-amber-500 dark:text-amber-400" })
1086
+ /* @__PURE__ */ e(ae, { nodeId: d, color: "text-amber-500 dark:text-amber-400" })
1087
1087
  ] }),
1088
1088
  /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: t.filename || "No image selected" })
1089
1089
  ] }),
1090
- /* @__PURE__ */ e(P, { type: "source", position: $.Right, className: "w-3 h-3 !bg-amber-500" })
1090
+ /* @__PURE__ */ e(P, { type: "source", position: M.Right, className: "w-3 h-3 !bg-amber-500" })
1091
1091
  ]
1092
1092
  }
1093
1093
  );
1094
- }), et = G(function({
1095
- id: l,
1094
+ }), rt = G(function({
1095
+ id: d,
1096
1096
  data: t,
1097
1097
  selected: o
1098
1098
  }) {
1099
1099
  var c, u, h;
1100
- const i = f((b) => b.execution.nodeStatus[l]), s = f((b) => {
1101
- var y;
1102
- return (y = b.execution.dataOutputs) == null ? void 0 : y[l];
1103
- }), d = F(i) || (o ? "border-cyan-500" : "border-cyan-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
1100
+ const s = x((b) => b.execution.nodeStatus[d]), i = x((b) => {
1101
+ var v;
1102
+ return (v = b.execution.dataOutputs) == null ? void 0 : v[d];
1103
+ }), l = F(s) || (o ? "border-cyan-500" : "border-cyan-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
1104
1104
  return /* @__PURE__ */ n(
1105
1105
  "div",
1106
1106
  {
1107
- className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${d}`,
1107
+ className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${l}`,
1108
1108
  children: [
1109
- /* @__PURE__ */ e(P, { type: "target", position: $.Left, className: "w-3 h-3 !bg-cyan-500" }),
1110
- s && /* @__PURE__ */ e("div", { className: "bg-cyan-50 dark:bg-cyan-900/30 border-b border-cyan-100 dark:border-cyan-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ n("pre", { className: "text-xs text-cyan-800 dark:text-cyan-200 whitespace-pre-wrap", children: [
1111
- (u = s.content) == null ? void 0 : u.slice(0, 200),
1112
- (((h = s.content) == null ? void 0 : h.length) || 0) > 200 && "..."
1109
+ /* @__PURE__ */ e(P, { type: "target", position: M.Left, className: "w-3 h-3 !bg-cyan-500" }),
1110
+ i && /* @__PURE__ */ e("div", { className: "bg-cyan-50 dark:bg-cyan-900/30 border-b border-cyan-100 dark:border-cyan-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ n("pre", { className: "text-xs text-cyan-800 dark:text-cyan-200 whitespace-pre-wrap", children: [
1111
+ (u = i.content) == null ? void 0 : u.slice(0, 200),
1112
+ (((h = i.content) == null ? void 0 : h.length) || 0) > 200 && "..."
1113
1113
  ] }) }),
1114
1114
  /* @__PURE__ */ n("div", { className: "px-4 py-3", children: [
1115
1115
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
@@ -1145,51 +1145,51 @@ const Qe = G(function({
1145
1145
  ))
1146
1146
  ] })
1147
1147
  ] }),
1148
- m ? /* @__PURE__ */ n(B, { children: [
1148
+ m ? /* @__PURE__ */ n(q, { children: [
1149
1149
  /* @__PURE__ */ e(
1150
1150
  P,
1151
1151
  {
1152
1152
  type: "source",
1153
- position: $.Right,
1153
+ position: M.Right,
1154
1154
  id: "output",
1155
1155
  className: "w-3 h-3 !bg-cyan-500",
1156
1156
  style: { top: "50%" },
1157
1157
  title: "Full JSON output"
1158
1158
  }
1159
1159
  ),
1160
- a.map(([b, y], v) => /* @__PURE__ */ e(
1160
+ a.map(([b, v], y) => /* @__PURE__ */ e(
1161
1161
  P,
1162
1162
  {
1163
1163
  type: "source",
1164
- position: $.Right,
1164
+ position: M.Right,
1165
1165
  id: `output.${b}`,
1166
1166
  className: "w-2.5 h-2.5 !bg-cyan-400",
1167
1167
  style: {
1168
- top: `${70 + v * 14}%`
1168
+ top: `${70 + y * 14}%`
1169
1169
  },
1170
- title: `${b}: ${y.description || y.type}`
1170
+ title: `${b}: ${v.description || v.type}`
1171
1171
  },
1172
1172
  b
1173
1173
  ))
1174
- ] }) : /* @__PURE__ */ e(P, { type: "source", position: $.Right, className: "w-3 h-3 !bg-cyan-500" })
1174
+ ] }) : /* @__PURE__ */ e(P, { type: "source", position: M.Right, className: "w-3 h-3 !bg-cyan-500" })
1175
1175
  ]
1176
1176
  }
1177
1177
  );
1178
- }), tt = G(function({ id: l, data: t, selected: o }) {
1178
+ }), at = G(function({ id: d, data: t, selected: o }) {
1179
1179
  var c, u, h;
1180
- const i = f((b) => b.execution.nodeStatus[l]), s = f((b) => {
1181
- var y;
1182
- return (y = b.execution.dataOutputs) == null ? void 0 : y[l];
1183
- }), d = F(i) || (o ? "border-pink-500" : "border-pink-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
1180
+ const s = x((b) => b.execution.nodeStatus[d]), i = x((b) => {
1181
+ var v;
1182
+ return (v = b.execution.dataOutputs) == null ? void 0 : v[d];
1183
+ }), l = F(s) || (o ? "border-pink-500" : "border-pink-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
1184
1184
  return /* @__PURE__ */ n(
1185
1185
  "div",
1186
1186
  {
1187
- className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${d}`,
1187
+ className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${l}`,
1188
1188
  children: [
1189
- /* @__PURE__ */ e(P, { type: "target", position: $.Left, className: "w-3 h-3 !bg-pink-500" }),
1190
- s && /* @__PURE__ */ e("div", { className: "bg-pink-50 dark:bg-pink-900/30 border-b border-pink-100 dark:border-pink-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ n("pre", { className: "text-xs text-pink-800 dark:text-pink-200 whitespace-pre-wrap", children: [
1191
- (u = s.content) == null ? void 0 : u.slice(0, 200),
1192
- (((h = s.content) == null ? void 0 : h.length) || 0) > 200 && "..."
1189
+ /* @__PURE__ */ e(P, { type: "target", position: M.Left, className: "w-3 h-3 !bg-pink-500" }),
1190
+ i && /* @__PURE__ */ e("div", { className: "bg-pink-50 dark:bg-pink-900/30 border-b border-pink-100 dark:border-pink-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ n("pre", { className: "text-xs text-pink-800 dark:text-pink-200 whitespace-pre-wrap", children: [
1191
+ (u = i.content) == null ? void 0 : u.slice(0, 200),
1192
+ (((h = i.content) == null ? void 0 : h.length) || 0) > 200 && "..."
1193
1193
  ] }) }),
1194
1194
  /* @__PURE__ */ n("div", { className: "px-4 py-3", children: [
1195
1195
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-2", children: [
@@ -1222,48 +1222,48 @@ const Qe = G(function({
1222
1222
  ))
1223
1223
  ] })
1224
1224
  ] }),
1225
- m ? /* @__PURE__ */ n(B, { children: [
1225
+ m ? /* @__PURE__ */ n(q, { children: [
1226
1226
  /* @__PURE__ */ e(
1227
1227
  P,
1228
1228
  {
1229
1229
  type: "source",
1230
- position: $.Right,
1230
+ position: M.Right,
1231
1231
  id: "output",
1232
1232
  className: "w-3 h-3 !bg-pink-500",
1233
1233
  style: { top: "50%" },
1234
1234
  title: "Full JSON output"
1235
1235
  }
1236
1236
  ),
1237
- a.map(([b, y], v) => /* @__PURE__ */ e(
1237
+ a.map(([b, v], y) => /* @__PURE__ */ e(
1238
1238
  P,
1239
1239
  {
1240
1240
  type: "source",
1241
- position: $.Right,
1241
+ position: M.Right,
1242
1242
  id: `output.${b}`,
1243
1243
  className: "w-2.5 h-2.5 !bg-pink-400",
1244
1244
  style: {
1245
- top: `${70 + v * 14}%`
1245
+ top: `${70 + y * 14}%`
1246
1246
  },
1247
- title: `${b}: ${y.description || y.type}`
1247
+ title: `${b}: ${v.description || v.type}`
1248
1248
  },
1249
1249
  b
1250
1250
  ))
1251
- ] }) : /* @__PURE__ */ e(P, { type: "source", position: $.Right, className: "w-3 h-3 !bg-pink-500" })
1251
+ ] }) : /* @__PURE__ */ e(P, { type: "source", position: M.Right, className: "w-3 h-3 !bg-pink-500" })
1252
1252
  ]
1253
1253
  }
1254
1254
  );
1255
- }), rt = {
1256
- generator: Qe,
1257
- transform: Ye,
1258
- save: Xe,
1259
- input: Ze,
1260
- vision: et,
1261
- text: tt
1262
- }, at = {
1255
+ }), ot = {
1256
+ generator: Xe,
1257
+ transform: Ze,
1258
+ save: et,
1259
+ input: tt,
1260
+ vision: rt,
1261
+ text: at
1262
+ }, nt = {
1263
1263
  type: "smoothstep",
1264
1264
  animated: !1,
1265
1265
  markerEnd: {
1266
- type: Ie.ArrowClosed,
1266
+ type: Ae.ArrowClosed,
1267
1267
  color: "#64748b",
1268
1268
  width: 20,
1269
1269
  height: 20
@@ -1273,52 +1273,52 @@ const Qe = G(function({
1273
1273
  strokeWidth: 2
1274
1274
  }
1275
1275
  };
1276
- function ot() {
1277
- const r = f((h) => h.nodes), l = f((h) => h.edges), t = f((h) => h.setNodes), o = f((h) => h.setEdges), i = f((h) => h.addEdge), s = f((h) => h.setSelectedNode), p = W(
1276
+ function it() {
1277
+ const r = x((h) => h.nodes), d = x((h) => h.edges), t = x((h) => h.setNodes), o = x((h) => h.setEdges), s = x((h) => h.addEdge), i = x((h) => h.setSelectedNode), p = L(
1278
1278
  (h) => {
1279
- const { source: b, target: y } = h;
1280
- if (!b || !y) return !1;
1281
- const v = r.find((g) => g.id === b), w = r.find((g) => g.id === y);
1282
- return !(!v || !w || v.type === "save" || w.type === "generator" || w.type === "input" || l.find(
1283
- (g) => g.target === y && g.targetHandle === h.targetHandle
1284
- ) || b === y);
1279
+ const { source: b, target: v } = h;
1280
+ if (!b || !v) return !1;
1281
+ const y = r.find((g) => g.id === b), w = r.find((g) => g.id === v);
1282
+ return !(!y || !w || y.type === "save" || w.type === "generator" || w.type === "input" || d.find(
1283
+ (g) => g.target === v && g.targetHandle === h.targetHandle
1284
+ ) || b === v);
1285
1285
  },
1286
- [r, l]
1287
- ), d = W(
1286
+ [r, d]
1287
+ ), l = L(
1288
1288
  (h) => {
1289
- t(ze(h, r));
1289
+ t(Ie(h, r));
1290
1290
  },
1291
1291
  [r, t]
1292
- ), a = W(
1292
+ ), a = L(
1293
1293
  (h) => {
1294
- o(Ce(h, l));
1294
+ o(Se(h, d));
1295
1295
  },
1296
- [l, o]
1297
- ), m = W(
1296
+ [d, o]
1297
+ ), m = L(
1298
1298
  (h) => {
1299
- i(h);
1299
+ s(h);
1300
1300
  },
1301
- [i]
1302
- ), c = W(
1301
+ [s]
1302
+ ), c = L(
1303
1303
  (h, b) => {
1304
- s(b.id);
1304
+ i(b.id);
1305
1305
  },
1306
- [s]
1307
- ), u = W(() => {
1308
- s(null);
1309
- }, [s]);
1306
+ [i]
1307
+ ), u = L(() => {
1308
+ i(null);
1309
+ }, [i]);
1310
1310
  return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ n(
1311
- Ne,
1311
+ Ce,
1312
1312
  {
1313
1313
  nodes: r,
1314
- edges: l,
1315
- onNodesChange: d,
1314
+ edges: d,
1315
+ onNodesChange: l,
1316
1316
  onEdgesChange: a,
1317
1317
  onConnect: m,
1318
1318
  onNodeClick: c,
1319
1319
  onPaneClick: u,
1320
- nodeTypes: rt,
1321
- defaultEdgeOptions: at,
1320
+ nodeTypes: ot,
1321
+ defaultEdgeOptions: nt,
1322
1322
  isValidConnection: p,
1323
1323
  nodesDraggable: !0,
1324
1324
  nodesConnectable: !0,
@@ -1328,47 +1328,47 @@ function ot() {
1328
1328
  snapToGrid: !0,
1329
1329
  snapGrid: [15, 15],
1330
1330
  children: [
1331
- /* @__PURE__ */ e(Se, {}),
1332
1331
  /* @__PURE__ */ e(Le, {}),
1333
- /* @__PURE__ */ e(We, { nodeStrokeWidth: 3, zoomable: !0, pannable: !0 })
1332
+ /* @__PURE__ */ e(We, {}),
1333
+ /* @__PURE__ */ e(Pe, { nodeStrokeWidth: 3, zoomable: !0, pannable: !0 })
1334
1334
  ]
1335
1335
  }
1336
1336
  ) });
1337
1337
  }
1338
- function nt({ onSelect: r }) {
1339
- const [l, t] = C([]), [o, i] = C(!0), [s, p] = C(null), d = async () => {
1338
+ function st({ onSelect: r }) {
1339
+ const [d, t] = C([]), [o, s] = C(!0), [i, p] = C(null), l = async () => {
1340
1340
  try {
1341
- i(!0);
1342
- const c = await Ge();
1341
+ s(!0);
1342
+ const c = await Ve();
1343
1343
  t(c), p(null);
1344
1344
  } catch (c) {
1345
1345
  p(c instanceof Error ? c.message : "Failed to load uploads");
1346
1346
  } finally {
1347
- i(!1);
1347
+ s(!1);
1348
1348
  }
1349
1349
  };
1350
1350
  U(() => {
1351
- d();
1351
+ l();
1352
1352
  }, []);
1353
1353
  const a = async (c, u) => {
1354
1354
  if (u.stopPropagation(), !!confirm("Delete this upload?"))
1355
1355
  try {
1356
- await Fe(c), t((h) => h.filter((b) => b.id !== c));
1356
+ await He(c), t((h) => h.filter((b) => b.id !== c));
1357
1357
  } catch (h) {
1358
1358
  console.error("Failed to delete:", h);
1359
1359
  }
1360
1360
  }, m = (c) => c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(1)} KB` : `${(c / (1024 * 1024)).toFixed(1)} MB`;
1361
- return o ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : s ? /* @__PURE__ */ n("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
1362
- s,
1361
+ return o ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : i ? /* @__PURE__ */ n("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
1362
+ i,
1363
1363
  /* @__PURE__ */ e(
1364
1364
  "button",
1365
1365
  {
1366
- onClick: d,
1366
+ onClick: l,
1367
1367
  className: "ml-2 text-teal-500 dark:text-teal-400 hover:underline",
1368
1368
  children: "Retry"
1369
1369
  }
1370
1370
  )
1371
- ] }) : l.length === 0 ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "No uploads yet. Drag an image onto an Input node to upload." }) : /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: l.map((c) => /* @__PURE__ */ n(
1371
+ ] }) : d.length === 0 ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "No uploads yet. Drag an image onto an Input node to upload." }) : /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: d.map((c) => /* @__PURE__ */ n(
1372
1372
  "div",
1373
1373
  {
1374
1374
  className: "relative group rounded border border-gray-200 dark:border-zinc-700 overflow-hidden cursor-pointer hover:border-amber-400 dark:hover:border-amber-500 transition-colors",
@@ -1377,7 +1377,7 @@ function nt({ onSelect: r }) {
1377
1377
  /* @__PURE__ */ e(
1378
1378
  "img",
1379
1379
  {
1380
- src: he(c.id),
1380
+ src: be(c.id),
1381
1381
  alt: c.filename,
1382
1382
  className: "w-full h-20 object-cover"
1383
1383
  }
@@ -1397,34 +1397,34 @@ function nt({ onSelect: r }) {
1397
1397
  c.id
1398
1398
  )) }) });
1399
1399
  }
1400
- function st() {
1401
- const r = f((k) => k.setGenerators), l = f((k) => k.setTransforms), t = f((k) => k.setTextProviders), o = f((k) => k.setVisionProviders), i = f((k) => k.generators), s = f((k) => k.transforms), p = f((k) => k.textProviders), d = f((k) => k.visionProviders), a = f((k) => k.addNode), [m, c] = C(!1), { data: u } = K({
1400
+ function dt() {
1401
+ const r = x((k) => k.setGenerators), d = x((k) => k.setTransforms), t = x((k) => k.setTextProviders), o = x((k) => k.setVisionProviders), s = x((k) => k.generators), i = x((k) => k.transforms), p = x((k) => k.textProviders), l = x((k) => k.visionProviders), a = x((k) => k.addNode), [m, c] = C(!1), { data: u } = _({
1402
1402
  queryKey: ["generators"],
1403
- queryFn: Me
1404
- }), { data: h } = K({
1403
+ queryFn: $e
1404
+ }), { data: h } = _({
1405
1405
  queryKey: ["transforms"],
1406
- queryFn: De
1407
- }), { data: b } = K({
1406
+ queryFn: Ue
1407
+ }), { data: b } = _({
1408
1408
  queryKey: ["textProviders"],
1409
- queryFn: Te
1410
- }), { data: y } = K({
1409
+ queryFn: Re
1410
+ }), { data: v } = _({
1411
1411
  queryKey: ["visionProviders"],
1412
- queryFn: Ue
1412
+ queryFn: Oe
1413
1413
  });
1414
1414
  U(() => {
1415
1415
  u && r(u);
1416
1416
  }, [u, r]), U(() => {
1417
- h && l(h);
1418
- }, [h, l]), U(() => {
1417
+ h && d(h);
1418
+ }, [h, d]), U(() => {
1419
1419
  b && t(b);
1420
1420
  }, [b, t]), U(() => {
1421
- y && o(y);
1422
- }, [y, o]);
1423
- const v = (k, L) => {
1424
- k.dataTransfer.setData("application/json", JSON.stringify(L)), k.dataTransfer.effectAllowed = "move";
1421
+ v && o(v);
1422
+ }, [v, o]);
1423
+ const y = (k, A) => {
1424
+ k.dataTransfer.setData("application/json", JSON.stringify(A)), k.dataTransfer.effectAllowed = "move";
1425
1425
  }, w = (k) => {
1426
1426
  a(k, { x: 250, y: 150 + Math.random() * 100 });
1427
- }, x = {
1427
+ }, f = {
1428
1428
  id: "input:upload",
1429
1429
  type: "input",
1430
1430
  name: "upload",
@@ -1456,16 +1456,16 @@ function st() {
1456
1456
  }
1457
1457
  }
1458
1458
  }
1459
- }, N = i.reduce(
1460
- (k, L) => {
1461
- const S = L.category || "Other";
1462
- return k[S] || (k[S] = []), k[S].push(L), k;
1459
+ }, N = s.reduce(
1460
+ (k, A) => {
1461
+ const S = A.category || "Other";
1462
+ return k[S] || (k[S] = []), k[S].push(A), k;
1463
1463
  },
1464
1464
  {}
1465
- ), A = s.reduce(
1466
- (k, L) => {
1467
- const S = L.category || "Other";
1468
- return k[S] || (k[S] = []), k[S].push(L), k;
1465
+ ), W = i.reduce(
1466
+ (k, A) => {
1467
+ const S = A.category || "Other";
1468
+ return k[S] || (k[S] = []), k[S].push(A), k;
1469
1469
  },
1470
1470
  {}
1471
1471
  );
@@ -1490,8 +1490,8 @@ function st() {
1490
1490
  "div",
1491
1491
  {
1492
1492
  draggable: !0,
1493
- onDragStart: (k) => v(k, x),
1494
- onDoubleClick: () => w(x),
1493
+ onDragStart: (k) => y(k, f),
1494
+ onDoubleClick: () => w(f),
1495
1495
  className: "px-3 py-2 bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-700 rounded cursor-grab active:cursor-grabbing hover:bg-amber-100 dark:hover:bg-amber-900/50 transition-colors",
1496
1496
  children: [
1497
1497
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-amber-700 dark:text-amber-300", children: "Upload Image" }),
@@ -1499,17 +1499,17 @@ function st() {
1499
1499
  ]
1500
1500
  }
1501
1501
  ),
1502
- 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(nt, {}) })
1502
+ 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(st, {}) })
1503
1503
  ] }),
1504
1504
  /* @__PURE__ */ n("div", { className: "mb-6", children: [
1505
1505
  /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide mb-2", children: "Generators" }),
1506
- Object.entries(N).map(([k, L]) => /* @__PURE__ */ n("div", { className: "mb-3", children: [
1506
+ Object.entries(N).map(([k, A]) => /* @__PURE__ */ n("div", { className: "mb-3", children: [
1507
1507
  /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: k }),
1508
- L.map((S) => /* @__PURE__ */ n(
1508
+ A.map((S) => /* @__PURE__ */ n(
1509
1509
  "div",
1510
1510
  {
1511
1511
  draggable: !0,
1512
- onDragStart: (R) => v(R, S),
1512
+ onDragStart: (O) => y(O, S),
1513
1513
  onDoubleClick: () => w(S),
1514
1514
  className: "px-3 py-2 bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-colors",
1515
1515
  children: [
@@ -1523,13 +1523,13 @@ function st() {
1523
1523
  ] }),
1524
1524
  /* @__PURE__ */ n("div", { className: "mb-6", children: [
1525
1525
  /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-teal-600 dark:text-teal-400 uppercase tracking-wide mb-2", children: "Transforms" }),
1526
- Object.entries(A).map(([k, L]) => /* @__PURE__ */ n("div", { className: "mb-3", children: [
1526
+ Object.entries(W).map(([k, A]) => /* @__PURE__ */ n("div", { className: "mb-3", children: [
1527
1527
  /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: k }),
1528
- L.map((S) => /* @__PURE__ */ n(
1528
+ A.map((S) => /* @__PURE__ */ n(
1529
1529
  "div",
1530
1530
  {
1531
1531
  draggable: !0,
1532
- onDragStart: (R) => v(R, S),
1532
+ onDragStart: (O) => y(O, S),
1533
1533
  onDoubleClick: () => w(S),
1534
1534
  className: "px-3 py-2 bg-teal-50 dark:bg-teal-900/30 border border-teal-200 dark:border-teal-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-teal-100 dark:hover:bg-teal-900/50 transition-colors",
1535
1535
  children: [
@@ -1547,7 +1547,7 @@ function st() {
1547
1547
  "div",
1548
1548
  {
1549
1549
  draggable: !0,
1550
- onDragStart: (L) => v(L, k),
1550
+ onDragStart: (A) => y(A, k),
1551
1551
  onDoubleClick: () => w(k),
1552
1552
  className: "px-3 py-2 bg-pink-50 dark:bg-pink-900/30 border border-pink-200 dark:border-pink-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-pink-100 dark:hover:bg-pink-900/50 transition-colors",
1553
1553
  children: [
@@ -1558,13 +1558,13 @@ function st() {
1558
1558
  k.id
1559
1559
  ))
1560
1560
  ] }),
1561
- d.length > 0 && /* @__PURE__ */ n("div", { className: "mb-6", children: [
1561
+ l.length > 0 && /* @__PURE__ */ n("div", { className: "mb-6", children: [
1562
1562
  /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-cyan-600 dark:text-cyan-400 uppercase tracking-wide mb-2", children: "AI Vision" }),
1563
- d.map((k) => /* @__PURE__ */ n(
1563
+ l.map((k) => /* @__PURE__ */ n(
1564
1564
  "div",
1565
1565
  {
1566
1566
  draggable: !0,
1567
- onDragStart: (L) => v(L, k),
1567
+ onDragStart: (A) => y(A, k),
1568
1568
  onDoubleClick: () => w(k),
1569
1569
  className: "px-3 py-2 bg-cyan-50 dark:bg-cyan-900/30 border border-cyan-200 dark:border-cyan-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-cyan-100 dark:hover:bg-cyan-900/50 transition-colors",
1570
1570
  children: [
@@ -1581,7 +1581,7 @@ function st() {
1581
1581
  "div",
1582
1582
  {
1583
1583
  draggable: !0,
1584
- onDragStart: (k) => v(k, g),
1584
+ onDragStart: (k) => y(k, g),
1585
1585
  onDoubleClick: () => w(g),
1586
1586
  className: "px-3 py-2 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 rounded cursor-grab active:cursor-grabbing hover:bg-green-100 dark:hover:bg-green-900/50 transition-colors",
1587
1587
  children: [
@@ -1593,18 +1593,18 @@ function st() {
1593
1593
  ] })
1594
1594
  ] }) });
1595
1595
  }
1596
- function it() {
1597
- var b, y, v, w;
1598
- const r = f((x) => x.selectedNodeId), l = f((x) => x.nodes), t = f((x) => x.generators), o = f((x) => x.transforms), i = f((x) => x.textProviders), s = f((x) => x.visionProviders), p = f((x) => x.updateNodeData), d = f((x) => x.deleteNode), a = l.find((x) => x.id === r);
1596
+ function lt() {
1597
+ var b, v, y, w;
1598
+ const r = x((f) => f.selectedNodeId), d = x((f) => f.nodes), t = x((f) => f.generators), o = x((f) => f.transforms), s = x((f) => f.textProviders), i = x((f) => f.visionProviders), p = x((f) => f.updateNodeData), l = x((f) => f.deleteNode), a = d.find((f) => f.id === r);
1599
1599
  if (!a)
1600
1600
  return /* @__PURE__ */ e("div", { className: "w-80 bg-gray-50 dark:bg-zinc-800 border-l border-gray-200 dark:border-zinc-700 p-4", children: /* @__PURE__ */ e("div", { className: "text-gray-500 dark:text-zinc-400 text-sm", children: "Select a node to edit its properties" }) });
1601
1601
  let m, c = "";
1602
1602
  if (a.type === "generator") {
1603
- const x = a.data, g = t.find((N) => N.name === x.generatorName);
1604
- m = (b = g == null ? void 0 : g.params) == null ? void 0 : b.properties, c = (g == null ? void 0 : g.label) || x.generatorName;
1603
+ const f = a.data, g = t.find((N) => N.name === f.generatorName);
1604
+ m = (b = g == null ? void 0 : g.params) == null ? void 0 : b.properties, c = (g == null ? void 0 : g.label) || f.generatorName;
1605
1605
  } else if (a.type === "transform") {
1606
- const x = a.data, g = o.find((N) => N.name === x.operation);
1607
- m = (y = g == null ? void 0 : g.params) == null ? void 0 : y.properties, c = (g == null ? void 0 : g.label) || x.operation;
1606
+ const f = a.data, g = o.find((N) => N.name === f.operation);
1607
+ m = (v = g == null ? void 0 : g.params) == null ? void 0 : v.properties, c = (g == null ? void 0 : g.label) || f.operation;
1608
1608
  } else if (a.type === "save") {
1609
1609
  const g = a.data.provider === "floimg-cloud";
1610
1610
  c = g ? "Save to FloImg Cloud" : "Save", m = {
@@ -1615,47 +1615,47 @@ function it() {
1615
1615
  }
1616
1616
  };
1617
1617
  } else if (a.type === "text") {
1618
- const x = a.data, g = i.find((N) => N.name === x.providerName);
1619
- m = (v = g == null ? void 0 : g.params) == null ? void 0 : v.properties, c = (g == null ? void 0 : g.label) || x.providerName;
1618
+ const f = a.data, g = s.find((N) => N.name === f.providerName);
1619
+ m = (y = g == null ? void 0 : g.params) == null ? void 0 : y.properties, c = (g == null ? void 0 : g.label) || f.providerName;
1620
1620
  } else if (a.type === "vision") {
1621
- const x = a.data, g = s.find((N) => N.name === x.providerName);
1622
- m = (w = g == null ? void 0 : g.params) == null ? void 0 : w.properties, c = (g == null ? void 0 : g.label) || x.providerName;
1621
+ const f = a.data, g = i.find((N) => N.name === f.providerName);
1622
+ m = (w = g == null ? void 0 : g.params) == null ? void 0 : w.properties, c = (g == null ? void 0 : g.label) || f.providerName;
1623
1623
  }
1624
- const u = (x, g) => {
1624
+ const u = (f, g) => {
1625
1625
  if (a.type === "generator") {
1626
1626
  const N = a.data;
1627
1627
  p(a.id, {
1628
- params: { ...N.params, [x]: g }
1628
+ params: { ...N.params, [f]: g }
1629
1629
  });
1630
1630
  } else if (a.type === "transform") {
1631
1631
  const N = a.data;
1632
1632
  p(a.id, {
1633
- params: { ...N.params, [x]: g }
1633
+ params: { ...N.params, [f]: g }
1634
1634
  });
1635
1635
  } else if (a.type === "save")
1636
- p(a.id, { [x]: g });
1636
+ p(a.id, { [f]: g });
1637
1637
  else if (a.type === "text") {
1638
1638
  const N = a.data;
1639
1639
  p(a.id, {
1640
- params: { ...N.params, [x]: g }
1640
+ params: { ...N.params, [f]: g }
1641
1641
  });
1642
1642
  } else if (a.type === "vision") {
1643
1643
  const N = a.data;
1644
1644
  p(a.id, {
1645
- params: { ...N.params, [x]: g }
1645
+ params: { ...N.params, [f]: g }
1646
1646
  });
1647
1647
  }
1648
- }, h = (x) => {
1648
+ }, h = (f) => {
1649
1649
  if (a.type === "generator")
1650
- return a.data.params[x];
1650
+ return a.data.params[f];
1651
1651
  if (a.type === "transform")
1652
- return a.data.params[x];
1652
+ return a.data.params[f];
1653
1653
  if (a.type === "save")
1654
- return a.data[x];
1654
+ return a.data[f];
1655
1655
  if (a.type === "text")
1656
- return a.data.params[x];
1656
+ return a.data.params[f];
1657
1657
  if (a.type === "vision")
1658
- return a.data.params[x];
1658
+ return a.data.params[f];
1659
1659
  };
1660
1660
  return /* @__PURE__ */ e("div", { className: "w-80 bg-gray-50 dark:bg-zinc-800 border-l border-gray-200 dark:border-zinc-700 overflow-y-auto", children: /* @__PURE__ */ n("div", { className: "p-4", children: [
1661
1661
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
@@ -1663,24 +1663,24 @@ function it() {
1663
1663
  /* @__PURE__ */ e(
1664
1664
  "button",
1665
1665
  {
1666
- onClick: () => d(a.id),
1666
+ onClick: () => l(a.id),
1667
1667
  className: "text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm",
1668
1668
  children: "Delete"
1669
1669
  }
1670
1670
  )
1671
1671
  ] }),
1672
- /* @__PURE__ */ e("div", { className: "space-y-4", children: m && Object.entries(m).map(([x, g]) => /* @__PURE__ */ e(
1673
- lt,
1672
+ /* @__PURE__ */ e("div", { className: "space-y-4", children: m && Object.entries(m).map(([f, g]) => /* @__PURE__ */ e(
1673
+ ct,
1674
1674
  {
1675
- name: x,
1675
+ name: f,
1676
1676
  field: g,
1677
- value: h(x),
1678
- onChange: (N) => u(x, N)
1677
+ value: h(f),
1678
+ onChange: (N) => u(f, N)
1679
1679
  },
1680
- x
1680
+ f
1681
1681
  )) }),
1682
1682
  (a.type === "text" || a.type === "vision") && /* @__PURE__ */ e(
1683
- dt,
1683
+ mt,
1684
1684
  {
1685
1685
  nodeId: a.id,
1686
1686
  outputSchema: a.data.outputSchema,
@@ -1689,38 +1689,38 @@ function it() {
1689
1689
  )
1690
1690
  ] }) });
1691
1691
  }
1692
- function lt({ name: r, field: l, value: t, onChange: o }) {
1693
- const i = l.title || r, s = "w-full px-3 py-2 border border-gray-300 dark:border-zinc-600 rounded-md shadow-sm focus:ring-teal-500 focus:border-teal-500 bg-white dark:bg-zinc-900 text-gray-900 dark:text-zinc-100";
1694
- return l.enum ? /* @__PURE__ */ n("div", { children: [
1695
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
1692
+ function ct({ name: r, field: d, value: t, onChange: o }) {
1693
+ const s = d.title || r, i = "w-full px-3 py-2 border border-gray-300 dark:border-zinc-600 rounded-md shadow-sm focus:ring-teal-500 focus:border-teal-500 bg-white dark:bg-zinc-900 text-gray-900 dark:text-zinc-100";
1694
+ return d.enum ? /* @__PURE__ */ n("div", { children: [
1695
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
1696
1696
  /* @__PURE__ */ n(
1697
1697
  "select",
1698
1698
  {
1699
1699
  value: String(t || ""),
1700
1700
  onChange: (p) => o(p.target.value),
1701
- className: s,
1701
+ className: i,
1702
1702
  children: [
1703
1703
  /* @__PURE__ */ e("option", { value: "", children: "Select..." }),
1704
- l.enum.map((p) => /* @__PURE__ */ e("option", { value: p, children: p }, p))
1704
+ d.enum.map((p) => /* @__PURE__ */ e("option", { value: p, children: p }, p))
1705
1705
  ]
1706
1706
  }
1707
1707
  ),
1708
- l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
1709
- ] }) : l.type === "number" ? /* @__PURE__ */ n("div", { children: [
1710
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
1708
+ d.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: d.description })
1709
+ ] }) : d.type === "number" ? /* @__PURE__ */ n("div", { children: [
1710
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
1711
1711
  /* @__PURE__ */ e(
1712
1712
  "input",
1713
1713
  {
1714
1714
  type: "number",
1715
1715
  value: t !== void 0 ? Number(t) : "",
1716
1716
  onChange: (p) => o(Number(p.target.value)),
1717
- min: l.minimum,
1718
- max: l.maximum,
1719
- className: s
1717
+ min: d.minimum,
1718
+ max: d.maximum,
1719
+ className: i
1720
1720
  }
1721
1721
  ),
1722
- l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
1723
- ] }) : l.type === "boolean" ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1722
+ d.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: d.description })
1723
+ ] }) : d.type === "boolean" ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1724
1724
  /* @__PURE__ */ e(
1725
1725
  "input",
1726
1726
  {
@@ -1730,9 +1730,9 @@ function lt({ name: r, field: l, value: t, onChange: o }) {
1730
1730
  className: "h-4 w-4 text-teal-600 focus:ring-teal-500 border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-900"
1731
1731
  }
1732
1732
  ),
1733
- /* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: i })
1733
+ /* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: s })
1734
1734
  ] }) : r.toLowerCase().includes("color") && typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ n("div", { children: [
1735
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
1735
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
1736
1736
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
1737
1737
  /* @__PURE__ */ e(
1738
1738
  "input",
@@ -1749,12 +1749,12 @@ function lt({ name: r, field: l, value: t, onChange: o }) {
1749
1749
  type: "text",
1750
1750
  value: String(t || ""),
1751
1751
  onChange: (p) => o(p.target.value),
1752
- className: s + " flex-1"
1752
+ className: i + " flex-1"
1753
1753
  }
1754
1754
  )
1755
1755
  ] })
1756
- ] }) : l.type === "object" ? /* @__PURE__ */ n("div", { children: [
1757
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
1756
+ ] }) : d.type === "object" ? /* @__PURE__ */ n("div", { children: [
1757
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
1758
1758
  /* @__PURE__ */ e(
1759
1759
  "textarea",
1760
1760
  {
@@ -1766,19 +1766,19 @@ function lt({ name: r, field: l, value: t, onChange: o }) {
1766
1766
  }
1767
1767
  },
1768
1768
  rows: 4,
1769
- className: s + " font-mono text-xs"
1769
+ className: i + " font-mono text-xs"
1770
1770
  }
1771
1771
  ),
1772
- l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
1772
+ d.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: d.description })
1773
1773
  ] }) : /* @__PURE__ */ n("div", { children: [
1774
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
1774
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
1775
1775
  r === "prompt" || r === "code" || r === "text" ? /* @__PURE__ */ e(
1776
1776
  "textarea",
1777
1777
  {
1778
1778
  value: String(t || ""),
1779
1779
  onChange: (p) => o(p.target.value),
1780
1780
  rows: 3,
1781
- className: s
1781
+ className: i
1782
1782
  }
1783
1783
  ) : /* @__PURE__ */ e(
1784
1784
  "input",
@@ -1786,25 +1786,25 @@ function lt({ name: r, field: l, value: t, onChange: o }) {
1786
1786
  type: "text",
1787
1787
  value: String(t || ""),
1788
1788
  onChange: (p) => o(p.target.value),
1789
- className: s
1789
+ className: i
1790
1790
  }
1791
1791
  ),
1792
- l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
1792
+ d.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: d.description })
1793
1793
  ] });
1794
1794
  }
1795
- function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1796
- const [o, i] = C(""), s = (l == null ? void 0 : l.properties) || {}, p = Object.entries(s), d = () => {
1795
+ function mt({ nodeId: r, outputSchema: d, updateNodeData: t }) {
1796
+ const [o, s] = C(""), i = (d == null ? void 0 : d.properties) || {}, p = Object.entries(i), l = () => {
1797
1797
  if (!o.trim()) return;
1798
1798
  const u = {
1799
1799
  type: "object",
1800
1800
  properties: {
1801
- ...s,
1801
+ ...i,
1802
1802
  [o.trim()]: { type: "string" }
1803
1803
  }
1804
1804
  };
1805
- t(r, { outputSchema: u }), i("");
1805
+ t(r, { outputSchema: u }), s("");
1806
1806
  }, a = (u) => {
1807
- const h = { ...s };
1807
+ const h = { ...i };
1808
1808
  delete h[u], Object.keys(h).length === 0 ? t(r, { outputSchema: void 0 }) : t(r, {
1809
1809
  outputSchema: { type: "object", properties: h }
1810
1810
  });
@@ -1813,8 +1813,8 @@ function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1813
1813
  outputSchema: {
1814
1814
  type: "object",
1815
1815
  properties: {
1816
- ...s,
1817
- [u]: { ...s[u], type: h }
1816
+ ...i,
1817
+ [u]: { ...i[u], type: h }
1818
1818
  }
1819
1819
  }
1820
1820
  });
@@ -1823,8 +1823,8 @@ function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1823
1823
  outputSchema: {
1824
1824
  type: "object",
1825
1825
  properties: {
1826
- ...s,
1827
- [u]: { ...s[u], description: h || void 0 }
1826
+ ...i,
1827
+ [u]: { ...i[u], description: h || void 0 }
1828
1828
  }
1829
1829
  }
1830
1830
  });
@@ -1897,8 +1897,8 @@ function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1897
1897
  {
1898
1898
  type: "text",
1899
1899
  value: o,
1900
- onChange: (u) => i(u.target.value),
1901
- onKeyDown: (u) => u.key === "Enter" && d(),
1900
+ onChange: (u) => s(u.target.value),
1901
+ onKeyDown: (u) => u.key === "Enter" && l(),
1902
1902
  placeholder: "Property name...",
1903
1903
  className: "flex-1 px-2 py-1.5 text-sm border border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-900 text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500"
1904
1904
  }
@@ -1906,7 +1906,7 @@ function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1906
1906
  /* @__PURE__ */ e(
1907
1907
  "button",
1908
1908
  {
1909
- onClick: d,
1909
+ onClick: l,
1910
1910
  disabled: !o.trim(),
1911
1911
  className: "px-3 py-1.5 text-sm font-medium text-white bg-pink-500 rounded hover:bg-pink-600 disabled:opacity-50 disabled:cursor-not-allowed",
1912
1912
  children: "Add"
@@ -1916,51 +1916,51 @@ function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
1916
1916
  p.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." })
1917
1917
  ] });
1918
1918
  }
1919
- function ct(r, l) {
1920
- const t = new Map(r.map((d) => [d.id, d])), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1921
- for (const d of r)
1922
- o.set(d.id, 0), i.set(d.id, []);
1923
- for (const d of l) {
1924
- const a = i.get(d.source) || [];
1925
- a.push(d.target), i.set(d.source, a), o.set(d.target, (o.get(d.target) || 0) + 1);
1919
+ function pt(r, d) {
1920
+ const t = new Map(r.map((l) => [l.id, l])), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1921
+ for (const l of r)
1922
+ o.set(l.id, 0), s.set(l.id, []);
1923
+ for (const l of d) {
1924
+ const a = s.get(l.source) || [];
1925
+ a.push(l.target), s.set(l.source, a), o.set(l.target, (o.get(l.target) || 0) + 1);
1926
1926
  }
1927
- const s = [];
1928
- for (const [d, a] of o)
1929
- a === 0 && s.push(d);
1927
+ const i = [];
1928
+ for (const [l, a] of o)
1929
+ a === 0 && i.push(l);
1930
1930
  const p = [];
1931
- for (; s.length > 0; ) {
1932
- const d = s.shift(), a = t.get(d);
1931
+ for (; i.length > 0; ) {
1932
+ const l = i.shift(), a = t.get(l);
1933
1933
  a && p.push(a);
1934
- const m = i.get(d) || [];
1934
+ const m = s.get(l) || [];
1935
1935
  for (const c of m) {
1936
1936
  const u = (o.get(c) || 1) - 1;
1937
- o.set(c, u), u === 0 && s.push(c);
1937
+ o.set(c, u), u === 0 && i.push(c);
1938
1938
  }
1939
1939
  }
1940
1940
  return p;
1941
1941
  }
1942
- function mt(r) {
1943
- const l = r.type || "node", t = r.id.replace(/[^a-zA-Z0-9]/g, "_");
1944
- return `${l}_${t}`;
1942
+ function ut(r) {
1943
+ const d = r.type || "node", t = r.id.replace(/[^a-zA-Z0-9]/g, "_");
1944
+ return `${d}_${t}`;
1945
1945
  }
1946
- function _(r) {
1946
+ function H(r) {
1947
1947
  return typeof r == "string" ? r.includes(`
1948
1948
  `) ? "`" + r.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(r) : JSON.stringify(r, null, 2);
1949
1949
  }
1950
- function pt(r, l, t) {
1951
- const o = t.get(r.id), i = [], s = l.find((d) => d.target === r.id), p = s ? t.get(s.source) : null;
1950
+ function gt(r, d, t) {
1951
+ const o = t.get(r.id), s = [], i = d.find((l) => l.target === r.id), p = i ? t.get(i.source) : null;
1952
1952
  switch (r.type) {
1953
1953
  case "generator": {
1954
- const d = r.data;
1955
- i.push(d.generatorName);
1956
- const a = d.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${_(u)}`).join(`,
1954
+ const l = r.data;
1955
+ s.push(l.generatorName);
1956
+ const a = l.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${H(u)}`).join(`,
1957
1957
  `);
1958
1958
  return {
1959
- code: `// Generate image using ${d.generatorName}
1960
- const ${o} = await ${d.generatorName}({
1959
+ code: `// Generate image using ${l.generatorName}
1960
+ const ${o} = await ${l.generatorName}({
1961
1961
  ${m}
1962
1962
  });`,
1963
- imports: i
1963
+ imports: s
1964
1964
  };
1965
1965
  }
1966
1966
  case "input":
@@ -1970,44 +1970,44 @@ const ${o} = await flo.loadImage("./input.png");`,
1970
1970
  imports: []
1971
1971
  };
1972
1972
  case "transform": {
1973
- const d = r.data, a = d.params || {}, m = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => `${u}: ${_(h)}`).join(", "), c = p || "image";
1973
+ const l = r.data, a = l.params || {}, m = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => `${u}: ${H(h)}`).join(", "), c = p || "image";
1974
1974
  return {
1975
- code: `// Apply ${d.operation} transform
1976
- const ${o} = await flo.transform(${c}, "${d.operation}"${m ? `, { ${m} }` : ""});`,
1975
+ code: `// Apply ${l.operation} transform
1976
+ const ${o} = await flo.transform(${c}, "${l.operation}"${m ? `, { ${m} }` : ""});`,
1977
1977
  imports: []
1978
1978
  };
1979
1979
  }
1980
1980
  case "vision": {
1981
- const d = r.data;
1982
- i.push(d.providerName);
1983
- const a = d.params || {}, m = p || "image", c = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => ` ${u}: ${_(h)}`).join(`,
1981
+ const l = r.data;
1982
+ s.push(l.providerName);
1983
+ const a = l.params || {}, m = p || "image", c = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => ` ${u}: ${H(h)}`).join(`,
1984
1984
  `);
1985
1985
  return {
1986
- code: `// Analyze image with ${d.providerName}
1987
- const ${o} = await ${d.providerName}.analyze(${m}, {
1986
+ code: `// Analyze image with ${l.providerName}
1987
+ const ${o} = await ${l.providerName}.analyze(${m}, {
1988
1988
  ${c}
1989
1989
  });`,
1990
- imports: i
1990
+ imports: s
1991
1991
  };
1992
1992
  }
1993
1993
  case "text": {
1994
- const d = r.data;
1995
- i.push(d.providerName);
1996
- const a = d.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${_(u)}`).join(`,
1994
+ const l = r.data;
1995
+ s.push(l.providerName);
1996
+ const a = l.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${H(u)}`).join(`,
1997
1997
  `);
1998
1998
  return {
1999
- code: `// Generate text with ${d.providerName}
2000
- const ${o} = await ${d.providerName}.generate({
1999
+ code: `// Generate text with ${l.providerName}
2000
+ const ${o} = await ${l.providerName}.generate({
2001
2001
  ${m}
2002
2002
  });`,
2003
- imports: i
2003
+ imports: s
2004
2004
  };
2005
2005
  }
2006
2006
  case "save": {
2007
- const d = r.data;
2007
+ const l = r.data;
2008
2008
  return {
2009
2009
  code: `// Save result
2010
- await flo.save(${p || "result"}, ${_(d.destination)});`,
2010
+ await flo.save(${p || "result"}, ${H(l.destination)});`,
2011
2011
  imports: []
2012
2012
  };
2013
2013
  }
@@ -2018,23 +2018,23 @@ await flo.save(${p || "result"}, ${_(d.destination)});`,
2018
2018
  };
2019
2019
  }
2020
2020
  }
2021
- function ut(r, l) {
2021
+ function ht(r, d) {
2022
2022
  if (r.length === 0)
2023
2023
  return `// Empty workflow
2024
2024
  // Add nodes to your canvas to generate code`;
2025
- const t = ct(r, l), o = /* @__PURE__ */ new Map();
2025
+ const t = pt(r, d), o = /* @__PURE__ */ new Map();
2026
2026
  for (const m of t)
2027
- o.set(m.id, mt(m));
2028
- const i = /* @__PURE__ */ new Set(), s = [];
2027
+ o.set(m.id, ut(m));
2028
+ const s = /* @__PURE__ */ new Set(), i = [];
2029
2029
  for (const m of t) {
2030
- const { code: c, imports: u } = pt(m, l, o);
2031
- s.push(c);
2030
+ const { code: c, imports: u } = gt(m, d, o);
2031
+ i.push(c);
2032
2032
  for (const h of u)
2033
- i.add(h);
2033
+ s.add(h);
2034
2034
  }
2035
2035
  const p = [];
2036
- i.size > 0 && p.push(`import { ${Array.from(i).join(", ")} } from "@teamflojo/floimg";`), p.push('import * as flo from "@teamflojo/floimg";');
2037
- const d = `/**
2036
+ s.size > 0 && p.push(`import { ${Array.from(s).join(", ")} } from "@teamflojo/floimg";`), p.push('import * as flo from "@teamflojo/floimg";');
2037
+ const l = `/**
2038
2038
  * FloImg Workflow
2039
2039
  * Generated by FloImg Studio
2040
2040
  * https://floimg.com
@@ -2042,7 +2042,7 @@ function ut(r, l) {
2042
2042
 
2043
2043
  `, a = `
2044
2044
  async function runWorkflow() {
2045
- ${s.map(
2045
+ ${i.map(
2046
2046
  (m) => m.split(`
2047
2047
  `).map((c) => " " + c).join(`
2048
2048
  `)
@@ -2054,20 +2054,20 @@ ${s.map(
2054
2054
  // Run the workflow
2055
2055
  runWorkflow().catch(console.error);
2056
2056
  `;
2057
- return d + p.join(`
2057
+ return l + p.join(`
2058
2058
  `) + `
2059
2059
  ` + a;
2060
2060
  }
2061
- function gt({ isOpen: r, onClose: l, onImport: t }) {
2062
- const [o, i] = C(""), [s, p] = C(!1), [d, a] = C(null), [m, c] = C(!1), u = W(async () => {
2061
+ function ft({ isOpen: r, onClose: d, onImport: t }) {
2062
+ const [o, s] = C(""), [i, p] = C(!1), [l, a] = C(null), [m, c] = C(!1), u = L(async () => {
2063
2063
  if (!o.trim()) {
2064
2064
  a({ message: "Please enter or paste YAML content" });
2065
2065
  return;
2066
2066
  }
2067
2067
  p(!0), a(null);
2068
2068
  try {
2069
- const g = await He(o);
2070
- g.success ? (t(g.nodes, g.edges, g.name), i(""), l()) : a({
2069
+ const g = await _e(o);
2070
+ g.success ? (t(g.nodes, g.edges, g.name), s(""), d()) : a({
2071
2071
  message: g.error || "Import failed",
2072
2072
  line: g.line,
2073
2073
  column: g.column
@@ -2077,46 +2077,46 @@ function gt({ isOpen: r, onClose: l, onImport: t }) {
2077
2077
  } finally {
2078
2078
  p(!1);
2079
2079
  }
2080
- }, [o, t, l]), h = W(async () => {
2080
+ }, [o, t, d]), h = L(async () => {
2081
2081
  if (!o.trim()) {
2082
2082
  a({ message: "Please enter or paste YAML content" });
2083
2083
  return;
2084
2084
  }
2085
2085
  p(!0), a(null);
2086
2086
  try {
2087
- const g = await _e(o);
2087
+ const g = await Ke(o);
2088
2088
  g.valid ? (a(null), a({ message: "Valid YAML!" }), setTimeout(() => a(null), 2e3)) : g.errors.length > 0 && a(g.errors[0]);
2089
2089
  } catch (g) {
2090
2090
  a({ message: g instanceof Error ? g.message : "Validation failed" });
2091
2091
  } finally {
2092
2092
  p(!1);
2093
2093
  }
2094
- }, [o]), b = W(async (g) => {
2094
+ }, [o]), b = L(async (g) => {
2095
2095
  if (!g.name.endsWith(".yaml") && !g.name.endsWith(".yml")) {
2096
2096
  a({ message: "Please upload a .yaml or .yml file" });
2097
2097
  return;
2098
2098
  }
2099
2099
  try {
2100
2100
  const N = await g.text();
2101
- i(N), a(null);
2101
+ s(N), a(null);
2102
2102
  } catch {
2103
2103
  a({ message: "Failed to read file" });
2104
2104
  }
2105
- }, []), y = W((g) => {
2105
+ }, []), v = L((g) => {
2106
2106
  g.preventDefault(), c(!0);
2107
- }, []), v = W((g) => {
2107
+ }, []), y = L((g) => {
2108
2108
  g.preventDefault(), c(!1);
2109
- }, []), w = W(
2109
+ }, []), w = L(
2110
2110
  (g) => {
2111
2111
  g.preventDefault(), c(!1);
2112
2112
  const N = g.dataTransfer.files[0];
2113
2113
  N && b(N);
2114
2114
  },
2115
2115
  [b]
2116
- ), x = W(
2116
+ ), f = L(
2117
2117
  (g) => {
2118
- var A;
2119
- const N = (A = g.target.files) == null ? void 0 : A[0];
2118
+ var W;
2119
+ const N = (W = g.target.files) == null ? void 0 : W[0];
2120
2120
  N && b(N);
2121
2121
  },
2122
2122
  [b]
@@ -2127,7 +2127,7 @@ function gt({ isOpen: r, onClose: l, onImport: t }) {
2127
2127
  /* @__PURE__ */ e(
2128
2128
  "button",
2129
2129
  {
2130
- onClick: l,
2130
+ onClick: d,
2131
2131
  className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
2132
2132
  children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
2133
2133
  "path",
@@ -2146,8 +2146,8 @@ function gt({ isOpen: r, onClose: l, onImport: t }) {
2146
2146
  /* @__PURE__ */ n(
2147
2147
  "div",
2148
2148
  {
2149
- onDragOver: y,
2150
- onDragLeave: v,
2149
+ onDragOver: v,
2150
+ onDragLeave: y,
2151
2151
  onDrop: w,
2152
2152
  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"}`,
2153
2153
  children: [
@@ -2156,7 +2156,7 @@ function gt({ isOpen: r, onClose: l, onImport: t }) {
2156
2156
  {
2157
2157
  type: "file",
2158
2158
  accept: ".yaml,.yml",
2159
- onChange: x,
2159
+ onChange: f,
2160
2160
  className: "hidden",
2161
2161
  id: "yaml-file-input"
2162
2162
  }
@@ -2201,7 +2201,7 @@ function gt({ isOpen: r, onClose: l, onImport: t }) {
2201
2201
  {
2202
2202
  value: o,
2203
2203
  onChange: (g) => {
2204
- i(g.target.value), a(null);
2204
+ s(g.target.value), a(null);
2205
2205
  },
2206
2206
  placeholder: `name: My Workflow
2207
2207
  steps:
@@ -2225,16 +2225,16 @@ steps:
2225
2225
  className: "w-full h-64 p-3 font-mono text-sm bg-gray-100 dark:bg-zinc-900 border border-gray-300 dark:border-zinc-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 text-gray-800 dark:text-zinc-200"
2226
2226
  }
2227
2227
  ),
2228
- d && /* @__PURE__ */ n(
2228
+ l && /* @__PURE__ */ n(
2229
2229
  "div",
2230
2230
  {
2231
- className: `mt-4 p-3 rounded-lg text-sm ${d.message === "Valid YAML!" ? "bg-green-50 dark:bg-green-900/30 text-green-700 dark:text-green-400" : "bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-400"}`,
2231
+ className: `mt-4 p-3 rounded-lg text-sm ${l.message === "Valid YAML!" ? "bg-green-50 dark:bg-green-900/30 text-green-700 dark:text-green-400" : "bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-400"}`,
2232
2232
  children: [
2233
- /* @__PURE__ */ e("span", { className: "font-medium", children: d.message }),
2234
- d.line && /* @__PURE__ */ n("span", { className: "ml-2 text-xs", children: [
2233
+ /* @__PURE__ */ e("span", { className: "font-medium", children: l.message }),
2234
+ l.line && /* @__PURE__ */ n("span", { className: "ml-2 text-xs", children: [
2235
2235
  "(line ",
2236
- d.line,
2237
- d.column ? `, column ${d.column}` : "",
2236
+ l.line,
2237
+ l.column ? `, column ${l.column}` : "",
2238
2238
  ")"
2239
2239
  ] })
2240
2240
  ]
@@ -2248,7 +2248,7 @@ steps:
2248
2248
  "button",
2249
2249
  {
2250
2250
  onClick: h,
2251
- disabled: s || !o.trim(),
2251
+ disabled: i || !o.trim(),
2252
2252
  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 disabled:opacity-50 disabled:cursor-not-allowed",
2253
2253
  children: "Validate"
2254
2254
  }
@@ -2257,10 +2257,10 @@ steps:
2257
2257
  "button",
2258
2258
  {
2259
2259
  onClick: u,
2260
- disabled: s || !o.trim(),
2260
+ disabled: i || !o.trim(),
2261
2261
  className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
2262
2262
  children: [
2263
- s && /* @__PURE__ */ n("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
2263
+ i && /* @__PURE__ */ n("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
2264
2264
  /* @__PURE__ */ e(
2265
2265
  "circle",
2266
2266
  {
@@ -2289,59 +2289,59 @@ steps:
2289
2289
  ] })
2290
2290
  ] }) }) : null;
2291
2291
  }
2292
- function ht({
2292
+ function bt({
2293
2293
  brandingSlot: r,
2294
- beforeActionsSlot: l,
2294
+ beforeActionsSlot: d,
2295
2295
  afterActionsSlot: t,
2296
2296
  hideAttribution: o = !1,
2297
- hideWorkflowLibrary: i = !1
2297
+ hideWorkflowLibrary: s = !1
2298
2298
  } = {}) {
2299
- const s = f((z) => z.execution), p = f((z) => z.execute), d = f((z) => z.exportToYaml), a = f((z) => z.importFromYaml), m = f((z) => z.nodes), c = f((z) => z.edges), u = V((z) => z.openSettings), h = f((z) => z.activeWorkflowName), b = f((z) => z.hasUnsavedChanges), y = f((z) => z.saveWorkflow), v = f((z) => z.toggleLibrary), w = f((z) => z.setActiveWorkflowName), x = f((z) => z.selectedNodeId), g = f((z) => z.duplicateNode), [N, A] = C(!1), [k, L] = C(!1), [S, R] = C("yaml"), [J, Y] = C(""), [I, M] = C(""), [E, O] = C(null), [xe, X] = C(!1), [oe, Z] = C("");
2299
+ const i = x((z) => z.execution), p = x((z) => z.execute), l = x((z) => z.exportToYaml), a = x((z) => z.importFromYaml), m = x((z) => z.nodes), c = x((z) => z.edges), u = B((z) => z.openSettings), h = x((z) => z.activeWorkflowName), b = x((z) => z.hasUnsavedChanges), v = x((z) => z.saveWorkflow), y = x((z) => z.toggleLibrary), w = x((z) => z.setActiveWorkflowName), f = x((z) => z.selectedNodeId), g = x((z) => z.duplicateNode), [N, W] = C(!1), [k, A] = C(!1), [S, O] = C("yaml"), [Q, Y] = C(""), [I, T] = C(""), [E, R] = C(null), [xe, X] = C(!1), [ne, Z] = C("");
2300
2300
  U(() => {
2301
2301
  const z = () => {
2302
- O("New workflow created"), setTimeout(() => O(null), 2e3);
2302
+ R("New workflow created"), setTimeout(() => R(null), 2e3);
2303
2303
  };
2304
2304
  return window.addEventListener("new-workflow-created", z), () => window.removeEventListener("new-workflow-created", z);
2305
2305
  }, []);
2306
- const ee = W(() => {
2307
- m.length !== 0 && (y(), O("Saved!"), setTimeout(() => O(null), 2e3));
2308
- }, [m.length, y]), be = () => {
2306
+ const ee = L(() => {
2307
+ m.length !== 0 && (v(), R("Saved!"), setTimeout(() => R(null), 2e3));
2308
+ }, [m.length, v]), ke = () => {
2309
2309
  Z(h), X(!0);
2310
- }, ne = () => {
2311
- const z = oe.trim();
2310
+ }, ie = () => {
2311
+ const z = ne.trim();
2312
2312
  z && z !== h && w(z), X(!1);
2313
- }, se = W(() => {
2314
- x && g(x);
2315
- }, [x, g]);
2313
+ }, se = L(() => {
2314
+ f && g(f);
2315
+ }, [f, g]);
2316
2316
  U(() => {
2317
- function z(D) {
2318
- (D.metaKey || D.ctrlKey) && D.key === "s" && (D.preventDefault(), ee()), (D.metaKey || D.ctrlKey) && D.key === "d" && (D.preventDefault(), se());
2317
+ function z(j) {
2318
+ (j.metaKey || j.ctrlKey) && j.key === "s" && (j.preventDefault(), ee()), (j.metaKey || j.ctrlKey) && j.key === "d" && (j.preventDefault(), se());
2319
2319
  }
2320
2320
  return document.addEventListener("keydown", z), () => document.removeEventListener("keydown", z);
2321
2321
  }, [ee, se]);
2322
- const fe = async () => {
2322
+ const ye = async () => {
2323
2323
  await p();
2324
- }, ke = async () => {
2325
- const z = await d();
2324
+ }, ve = async () => {
2325
+ const z = await l();
2326
2326
  Y(z);
2327
- const D = ut(m, c);
2328
- M(D), A(!0);
2329
- }, ve = () => {
2330
- const z = S === "yaml" ? J : I;
2327
+ const j = ht(m, c);
2328
+ T(j), W(!0);
2329
+ }, we = () => {
2330
+ const z = S === "yaml" ? Q : I;
2331
2331
  navigator.clipboard.writeText(z);
2332
- }, ye = W(
2333
- (z, D, we) => {
2334
- a(z, D, we), O("Workflow imported!"), setTimeout(() => O(null), 2e3);
2332
+ }, Ne = L(
2333
+ (z, j, ze) => {
2334
+ a(z, j, ze), R("Workflow imported!"), setTimeout(() => R(null), 2e3);
2335
2335
  },
2336
2336
  [a]
2337
2337
  );
2338
- return /* @__PURE__ */ n(B, { children: [
2338
+ return /* @__PURE__ */ n(q, { children: [
2339
2339
  /* @__PURE__ */ n("div", { className: "h-14 bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700 flex items-center justify-between px-4", children: [
2340
2340
  /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
2341
- !i && /* @__PURE__ */ e(
2341
+ !s && /* @__PURE__ */ e(
2342
2342
  "button",
2343
2343
  {
2344
- onClick: v,
2344
+ onClick: y,
2345
2345
  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-md",
2346
2346
  title: "My Workflows",
2347
2347
  children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
@@ -2374,11 +2374,11 @@ function ht({
2374
2374
  "input",
2375
2375
  {
2376
2376
  type: "text",
2377
- value: oe,
2377
+ value: ne,
2378
2378
  onChange: (z) => Z(z.target.value),
2379
- onBlur: ne,
2379
+ onBlur: ie,
2380
2380
  onKeyDown: (z) => {
2381
- z.key === "Enter" && ne(), z.key === "Escape" && (Z(h), X(!1));
2381
+ z.key === "Enter" && ie(), z.key === "Escape" && (Z(h), X(!1));
2382
2382
  },
2383
2383
  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",
2384
2384
  autoFocus: !0
@@ -2386,7 +2386,7 @@ function ht({
2386
2386
  ) : /* @__PURE__ */ e(
2387
2387
  "button",
2388
2388
  {
2389
- onClick: be,
2389
+ onClick: ke,
2390
2390
  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",
2391
2391
  title: "Click to rename",
2392
2392
  children: h
@@ -2402,7 +2402,7 @@ function ht({
2402
2402
  ] })
2403
2403
  ] }),
2404
2404
  /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
2405
- l,
2405
+ d,
2406
2406
  /* @__PURE__ */ e(
2407
2407
  "button",
2408
2408
  {
@@ -2452,7 +2452,7 @@ function ht({
2452
2452
  /* @__PURE__ */ e(
2453
2453
  "button",
2454
2454
  {
2455
- onClick: () => L(!0),
2455
+ onClick: () => A(!0),
2456
2456
  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",
2457
2457
  children: "Import"
2458
2458
  }
@@ -2460,7 +2460,7 @@ function ht({
2460
2460
  /* @__PURE__ */ e(
2461
2461
  "button",
2462
2462
  {
2463
- onClick: ke,
2463
+ onClick: ve,
2464
2464
  disabled: m.length === 0,
2465
2465
  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 disabled:opacity-50 disabled:cursor-not-allowed",
2466
2466
  children: "Export"
@@ -2469,10 +2469,10 @@ function ht({
2469
2469
  /* @__PURE__ */ e(
2470
2470
  "button",
2471
2471
  {
2472
- onClick: fe,
2473
- disabled: m.length === 0 || s.status === "running",
2472
+ onClick: ye,
2473
+ disabled: m.length === 0 || i.status === "running",
2474
2474
  className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
2475
- children: s.status === "running" ? /* @__PURE__ */ n(B, { children: [
2475
+ children: i.status === "running" ? /* @__PURE__ */ n(q, { children: [
2476
2476
  /* @__PURE__ */ n("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
2477
2477
  /* @__PURE__ */ e(
2478
2478
  "circle",
@@ -2495,7 +2495,7 @@ function ht({
2495
2495
  )
2496
2496
  ] }),
2497
2497
  "Running..."
2498
- ] }) : /* @__PURE__ */ n(B, { children: [
2498
+ ] }) : /* @__PURE__ */ n(q, { children: [
2499
2499
  /* @__PURE__ */ n("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
2500
2500
  /* @__PURE__ */ e(
2501
2501
  "path",
@@ -2523,25 +2523,25 @@ function ht({
2523
2523
  t
2524
2524
  ] })
2525
2525
  ] }),
2526
- s.status === "completed" && s.imageIds.length > 0 && /* @__PURE__ */ e("div", { className: "bg-green-50 dark:bg-green-900/30 border-b border-green-200 dark:border-green-800 px-4 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
2526
+ i.status === "completed" && i.imageIds.length > 0 && /* @__PURE__ */ e("div", { className: "bg-green-50 dark:bg-green-900/30 border-b border-green-200 dark:border-green-800 px-4 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
2527
2527
  /* @__PURE__ */ n("span", { className: "text-green-700 dark:text-green-400 font-medium", children: [
2528
2528
  "Generated ",
2529
- s.imageIds.length,
2529
+ i.imageIds.length,
2530
2530
  " image",
2531
- s.imageIds.length !== 1 ? "s" : ""
2531
+ i.imageIds.length !== 1 ? "s" : ""
2532
2532
  ] }),
2533
- /* @__PURE__ */ e("div", { className: "flex gap-2", children: s.imageUrls.slice(0, 4).map((z, D) => /* @__PURE__ */ e("a", { href: z, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ e(
2533
+ /* @__PURE__ */ e("div", { className: "flex gap-2", children: i.imageUrls.slice(0, 4).map((z, j) => /* @__PURE__ */ e("a", { href: z, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ e(
2534
2534
  "img",
2535
2535
  {
2536
2536
  src: z,
2537
2537
  alt: "Generated",
2538
2538
  className: "h-12 w-12 object-cover rounded border border-green-300 dark:border-green-700"
2539
2539
  }
2540
- ) }, D)) })
2540
+ ) }, j)) })
2541
2541
  ] }) }),
2542
- s.status === "error" && /* @__PURE__ */ e("div", { className: "bg-red-50 dark:bg-red-900/30 border-b border-red-200 dark:border-red-800 px-4 py-3", children: /* @__PURE__ */ n("span", { className: "text-red-700 dark:text-red-400", children: [
2542
+ i.status === "error" && /* @__PURE__ */ e("div", { className: "bg-red-50 dark:bg-red-900/30 border-b border-red-200 dark:border-red-800 px-4 py-3", children: /* @__PURE__ */ n("span", { className: "text-red-700 dark:text-red-400", children: [
2543
2543
  "Error: ",
2544
- s.error
2544
+ i.error
2545
2545
  ] }) }),
2546
2546
  N && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ n("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: [
2547
2547
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
@@ -2551,7 +2551,7 @@ function ht({
2551
2551
  /* @__PURE__ */ e(
2552
2552
  "button",
2553
2553
  {
2554
- onClick: () => R("yaml"),
2554
+ onClick: () => O("yaml"),
2555
2555
  className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${S === "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"}`,
2556
2556
  children: "YAML"
2557
2557
  }
@@ -2559,7 +2559,7 @@ function ht({
2559
2559
  /* @__PURE__ */ e(
2560
2560
  "button",
2561
2561
  {
2562
- onClick: () => R("javascript"),
2562
+ onClick: () => O("javascript"),
2563
2563
  className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${S === "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"}`,
2564
2564
  children: "JavaScript"
2565
2565
  }
@@ -2569,7 +2569,7 @@ function ht({
2569
2569
  /* @__PURE__ */ e(
2570
2570
  "button",
2571
2571
  {
2572
- onClick: () => A(!1),
2572
+ onClick: () => W(!1),
2573
2573
  className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
2574
2574
  children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
2575
2575
  "path",
@@ -2583,14 +2583,14 @@ function ht({
2583
2583
  }
2584
2584
  )
2585
2585
  ] }),
2586
- /* @__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: S === "yaml" ? J : I }) }),
2586
+ /* @__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: S === "yaml" ? Q : I }) }),
2587
2587
  /* @__PURE__ */ n("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
2588
2588
  /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: S === "yaml" ? "Use with floimg CLI: floimg run workflow.yaml" : "Run with Node.js or Bun" }),
2589
2589
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
2590
2590
  /* @__PURE__ */ e(
2591
2591
  "button",
2592
2592
  {
2593
- onClick: ve,
2593
+ onClick: we,
2594
2594
  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",
2595
2595
  children: "Copy to Clipboard"
2596
2596
  }
@@ -2598,7 +2598,7 @@ function ht({
2598
2598
  /* @__PURE__ */ e(
2599
2599
  "button",
2600
2600
  {
2601
- onClick: () => A(!1),
2601
+ onClick: () => W(!1),
2602
2602
  className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
2603
2603
  children: "Close"
2604
2604
  }
@@ -2607,36 +2607,36 @@ function ht({
2607
2607
  ] })
2608
2608
  ] }) }),
2609
2609
  /* @__PURE__ */ e(
2610
- gt,
2610
+ ft,
2611
2611
  {
2612
2612
  isOpen: k,
2613
- onClose: () => L(!1),
2614
- onImport: ye
2613
+ onClose: () => A(!1),
2614
+ onImport: Ne
2615
2615
  }
2616
2616
  )
2617
2617
  ] });
2618
2618
  }
2619
2619
  function xt() {
2620
- const r = f((a) => a.loadTemplate), [l, t] = C(null), {
2620
+ const r = x((a) => a.loadTemplate), [d, t] = C(null), {
2621
2621
  data: o,
2622
- isLoading: i,
2623
- error: s,
2622
+ isLoading: s,
2623
+ error: i,
2624
2624
  refetch: p
2625
- } = K({
2625
+ } = _({
2626
2626
  queryKey: ["images"],
2627
- queryFn: Ee,
2627
+ queryFn: Be,
2628
2628
  refetchInterval: 5e3
2629
2629
  // Auto-refresh every 5 seconds
2630
- }), d = async (a) => {
2630
+ }), l = async (a) => {
2631
2631
  t(a);
2632
2632
  try {
2633
- const m = await Be(a);
2633
+ const m = await Ge(a);
2634
2634
  if (m != null && m.workflow) {
2635
2635
  const c = {
2636
2636
  id: `image-${a}`,
2637
2637
  name: `Workflow from ${a}`,
2638
2638
  description: "Loaded from gallery image",
2639
- category: "Gallery",
2639
+ category: "Utilities",
2640
2640
  generator: "unknown",
2641
2641
  workflow: {
2642
2642
  nodes: m.workflow.nodes,
@@ -2652,9 +2652,9 @@ function xt() {
2652
2652
  t(null);
2653
2653
  }
2654
2654
  };
2655
- return i ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: "Loading images..." }) : s ? /* @__PURE__ */ n("div", { className: "p-8 text-center text-red-500 dark:text-red-400", children: [
2655
+ return s ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: "Loading images..." }) : i ? /* @__PURE__ */ n("div", { className: "p-8 text-center text-red-500 dark:text-red-400", children: [
2656
2656
  "Error loading images: ",
2657
- s instanceof Error ? s.message : "Unknown error"
2657
+ i instanceof Error ? i.message : "Unknown error"
2658
2658
  ] }) : !o || o.length === 0 ? /* @__PURE__ */ n("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: [
2659
2659
  /* @__PURE__ */ e("div", { className: "text-lg mb-2", children: "No images yet" }),
2660
2660
  /* @__PURE__ */ e("div", { className: "text-sm", children: "Create a workflow and click Execute to generate images" })
@@ -2678,18 +2678,18 @@ function xt() {
2678
2678
  )
2679
2679
  ] }),
2680
2680
  /* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: o.map((a) => /* @__PURE__ */ e(
2681
- bt,
2681
+ kt,
2682
2682
  {
2683
2683
  image: a,
2684
- onLoadWorkflow: () => d(a.id),
2685
- isLoading: l === a.id
2684
+ onLoadWorkflow: () => l(a.id),
2685
+ isLoading: d === a.id
2686
2686
  },
2687
2687
  a.id
2688
2688
  )) })
2689
2689
  ] });
2690
2690
  }
2691
- function bt({ image: r, onLoadWorkflow: l, isLoading: t }) {
2692
- const o = (s) => new Date(s).toLocaleString(), i = (s) => s < 1024 ? `${s} B` : s < 1048576 ? `${(s / 1024).toFixed(1)} KB` : `${(s / 1048576).toFixed(1)} MB`;
2691
+ function kt({ image: r, onLoadWorkflow: d, isLoading: t }) {
2692
+ const o = (i) => new Date(i).toLocaleString(), s = (i) => i < 1024 ? `${i} B` : i < 1048576 ? `${(i / 1024).toFixed(1)} KB` : `${(i / 1048576).toFixed(1)} MB`;
2693
2693
  return /* @__PURE__ */ n("div", { className: "bg-white dark:bg-zinc-800 rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden shadow-sm hover:shadow-md transition-shadow group", children: [
2694
2694
  /* @__PURE__ */ n("div", { className: "relative", children: [
2695
2695
  /* @__PURE__ */ e(
@@ -2713,8 +2713,8 @@ function bt({ image: r, onLoadWorkflow: l, isLoading: t }) {
2713
2713
  /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center", children: /* @__PURE__ */ e(
2714
2714
  "button",
2715
2715
  {
2716
- onClick: (s) => {
2717
- s.preventDefault(), l();
2716
+ onClick: (i) => {
2717
+ i.preventDefault(), d();
2718
2718
  },
2719
2719
  disabled: t,
2720
2720
  className: "px-3 py-1.5 bg-teal-600 text-white text-sm rounded-lg hover:bg-teal-700 disabled:opacity-50",
@@ -2727,19 +2727,45 @@ function bt({ image: r, onLoadWorkflow: l, isLoading: t }) {
2727
2727
  /* @__PURE__ */ n("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mt-1", children: [
2728
2728
  r.mime,
2729
2729
  " • ",
2730
- i(r.size)
2730
+ s(r.size)
2731
2731
  ] }),
2732
2732
  /* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-zinc-500 mt-1", children: o(r.createdAt) })
2733
2733
  ] })
2734
2734
  ] });
2735
2735
  }
2736
- const ft = {
2737
- id: "sales-dashboard",
2738
- name: "Sales Dashboard",
2739
- description: "Quarterly revenue bar chart with gradient styling",
2740
- category: "Charts",
2736
+ const yt = {
2737
+ id: "revenue-chart",
2738
+ name: "Revenue Dashboard",
2739
+ description: "Quarterly revenue visualization with gradient bars",
2740
+ category: "Data Viz",
2741
2741
  generator: "quickchart",
2742
- tags: ["bar", "sales", "revenue", "quarterly"],
2742
+ tags: ["bar", "revenue", "quarterly", "dashboard", "sales"],
2743
+ capabilities: {
2744
+ studioCompatible: !0,
2745
+ claudeCodeReady: !0
2746
+ },
2747
+ icon: "chart",
2748
+ preview: {
2749
+ imageUrl: "/showcase/data-viz/quarterly-revenue.png"
2750
+ },
2751
+ codeExample: `const chart = await floimg.generate({
2752
+ generator: 'quickchart',
2753
+ params: {
2754
+ type: 'bar',
2755
+ data: {
2756
+ labels: ['Q1', 'Q2', 'Q3', 'Q4'],
2757
+ datasets: [{
2758
+ label: 'Revenue ($M)',
2759
+ data: [12, 19, 8, 15]
2760
+ }]
2761
+ }
2762
+ }
2763
+ });`,
2764
+ seo: {
2765
+ title: "Revenue Dashboard Chart Template",
2766
+ description: "Generate professional quarterly revenue bar charts with gradient styling",
2767
+ keywords: ["revenue chart", "bar chart", "quarterly report", "dashboard"]
2768
+ },
2743
2769
  workflow: {
2744
2770
  nodes: [
2745
2771
  {
@@ -2783,13 +2809,26 @@ const ft = {
2783
2809
  ],
2784
2810
  edges: []
2785
2811
  }
2786
- }, kt = {
2787
- id: "user-growth",
2788
- name: "User Growth Line Chart",
2789
- description: "Monthly user growth with smooth bezier curves",
2790
- category: "Charts",
2812
+ }, vt = {
2813
+ id: "monthly-users",
2814
+ name: "User Growth Chart",
2815
+ description: "Track monthly user growth with smooth line chart",
2816
+ category: "Data Viz",
2791
2817
  generator: "quickchart",
2792
- tags: ["line", "growth", "users", "monthly"],
2818
+ tags: ["line", "growth", "users", "monthly", "analytics"],
2819
+ capabilities: {
2820
+ studioCompatible: !0,
2821
+ claudeCodeReady: !0
2822
+ },
2823
+ icon: "chart",
2824
+ preview: {
2825
+ imageUrl: "/showcase/data-viz/monthly-users.png"
2826
+ },
2827
+ seo: {
2828
+ title: "User Growth Chart Template",
2829
+ description: "Visualize monthly user growth with smooth bezier curves",
2830
+ keywords: ["user growth", "line chart", "analytics", "monthly stats"]
2831
+ },
2793
2832
  workflow: {
2794
2833
  nodes: [
2795
2834
  {
@@ -2831,13 +2870,138 @@ const ft = {
2831
2870
  ],
2832
2871
  edges: []
2833
2872
  }
2834
- }, vt = {
2873
+ }, wt = {
2874
+ id: "framework-usage",
2875
+ name: "Framework Usage Stats",
2876
+ description: "Compare framework popularity with horizontal bar chart",
2877
+ category: "Data Viz",
2878
+ generator: "quickchart",
2879
+ tags: ["bar", "comparison", "stats", "horizontal", "frameworks"],
2880
+ capabilities: {
2881
+ studioCompatible: !0,
2882
+ claudeCodeReady: !0
2883
+ },
2884
+ icon: "chart",
2885
+ preview: {
2886
+ imageUrl: "/showcase/data-viz/framework-usage.png"
2887
+ },
2888
+ workflow: {
2889
+ nodes: [
2890
+ {
2891
+ id: "gen-1",
2892
+ type: "generator",
2893
+ position: { x: 100, y: 100 },
2894
+ data: {
2895
+ generatorName: "quickchart",
2896
+ params: {
2897
+ chart: {
2898
+ type: "horizontalBar",
2899
+ data: {
2900
+ labels: ["React", "Vue", "Angular", "Svelte", "Solid"],
2901
+ datasets: [
2902
+ {
2903
+ label: "Usage %",
2904
+ data: [42, 18, 15, 8, 4],
2905
+ backgroundColor: [
2906
+ "rgba(97, 218, 251, 0.8)",
2907
+ "rgba(65, 184, 131, 0.8)",
2908
+ "rgba(221, 0, 49, 0.8)",
2909
+ "rgba(255, 62, 0, 0.8)",
2910
+ "rgba(68, 107, 158, 0.8)"
2911
+ ]
2912
+ }
2913
+ ]
2914
+ },
2915
+ options: {
2916
+ plugins: {
2917
+ title: {
2918
+ display: !0,
2919
+ text: "Frontend Framework Usage 2024"
2920
+ }
2921
+ }
2922
+ }
2923
+ },
2924
+ width: 600,
2925
+ height: 400
2926
+ }
2927
+ }
2928
+ }
2929
+ ],
2930
+ edges: []
2931
+ }
2932
+ }, Nt = {
2933
+ id: "traffic-breakdown",
2934
+ name: "Traffic by Device",
2935
+ description: "Doughnut chart showing traffic sources by device type",
2936
+ category: "Data Viz",
2937
+ generator: "quickchart",
2938
+ tags: ["doughnut", "traffic", "analytics", "pie", "devices"],
2939
+ capabilities: {
2940
+ studioCompatible: !0,
2941
+ claudeCodeReady: !0
2942
+ },
2943
+ icon: "chart",
2944
+ preview: {
2945
+ imageUrl: "/showcase/data-viz/traffic-by-device.png"
2946
+ },
2947
+ workflow: {
2948
+ nodes: [
2949
+ {
2950
+ id: "gen-1",
2951
+ type: "generator",
2952
+ position: { x: 100, y: 100 },
2953
+ data: {
2954
+ generatorName: "quickchart",
2955
+ params: {
2956
+ chart: {
2957
+ type: "doughnut",
2958
+ data: {
2959
+ labels: ["Desktop", "Mobile", "Tablet"],
2960
+ datasets: [
2961
+ {
2962
+ data: [55, 35, 10],
2963
+ backgroundColor: [
2964
+ "rgba(99, 102, 241, 0.8)",
2965
+ "rgba(34, 197, 94, 0.8)",
2966
+ "rgba(249, 115, 22, 0.8)"
2967
+ ]
2968
+ }
2969
+ ]
2970
+ },
2971
+ options: {
2972
+ plugins: {
2973
+ title: {
2974
+ display: !0,
2975
+ text: "Traffic by Device Type"
2976
+ }
2977
+ }
2978
+ }
2979
+ },
2980
+ width: 400,
2981
+ height: 400
2982
+ }
2983
+ }
2984
+ }
2985
+ ],
2986
+ edges: []
2987
+ }
2988
+ }, zt = {
2835
2989
  id: "api-flow",
2836
2990
  name: "API Request Flow",
2837
2991
  description: "Sequence diagram showing API authentication flow",
2838
- category: "Diagrams",
2992
+ category: "Data Viz",
2839
2993
  generator: "mermaid",
2840
- tags: ["sequence", "api", "authentication", "flow"],
2994
+ tags: ["sequence", "api", "authentication", "diagram", "flow"],
2995
+ capabilities: {
2996
+ studioCompatible: !0,
2997
+ claudeCodeReady: !0
2998
+ },
2999
+ icon: "diagram",
3000
+ seo: {
3001
+ title: "API Flow Diagram Template",
3002
+ description: "Generate sequence diagrams for API authentication flows",
3003
+ keywords: ["api diagram", "sequence diagram", "authentication flow"]
3004
+ },
2841
3005
  workflow: {
2842
3006
  nodes: [
2843
3007
  {
@@ -2873,13 +3037,23 @@ const ft = {
2873
3037
  ],
2874
3038
  edges: []
2875
3039
  }
2876
- }, yt = {
3040
+ }, Ct = {
2877
3041
  id: "system-architecture",
2878
3042
  name: "System Architecture",
2879
3043
  description: "Microservices architecture diagram",
2880
- category: "Diagrams",
3044
+ category: "Data Viz",
2881
3045
  generator: "mermaid",
2882
- tags: ["architecture", "microservices", "system", "flowchart"],
3046
+ tags: ["architecture", "microservices", "flowchart", "system", "infrastructure"],
3047
+ capabilities: {
3048
+ studioCompatible: !0,
3049
+ claudeCodeReady: !0
3050
+ },
3051
+ icon: "diagram",
3052
+ seo: {
3053
+ title: "System Architecture Diagram Template",
3054
+ description: "Generate microservices architecture diagrams with Mermaid",
3055
+ keywords: ["architecture diagram", "microservices", "system design"]
3056
+ },
2883
3057
  workflow: {
2884
3058
  nodes: [
2885
3059
  {
@@ -2931,13 +3105,18 @@ const ft = {
2931
3105
  ],
2932
3106
  edges: []
2933
3107
  }
2934
- }, wt = {
3108
+ }, It = {
2935
3109
  id: "git-workflow",
2936
3110
  name: "Git Branch Workflow",
2937
3111
  description: "Git branching strategy with feature and release branches",
2938
- category: "Diagrams",
3112
+ category: "Data Viz",
2939
3113
  generator: "mermaid",
2940
- tags: ["git", "branching", "workflow", "development"],
3114
+ tags: ["git", "branching", "workflow", "development", "version-control"],
3115
+ capabilities: {
3116
+ studioCompatible: !0,
3117
+ claudeCodeReady: !0
3118
+ },
3119
+ icon: "diagram",
2941
3120
  workflow: {
2942
3121
  nodes: [
2943
3122
  {
@@ -2974,139 +3153,925 @@ const ft = {
2974
3153
  ],
2975
3154
  edges: []
2976
3155
  }
2977
- }, Nt = {
2978
- id: "website-qr",
2979
- name: "Website QR Code",
2980
- description: "QR code linking to your website with custom styling",
2981
- category: "QR Codes",
2982
- generator: "qr",
2983
- tags: ["qr", "website", "link", "url"],
3156
+ }, St = [
3157
+ yt,
3158
+ vt,
3159
+ wt,
3160
+ Nt,
3161
+ zt,
3162
+ Ct,
3163
+ It
3164
+ ], At = {
3165
+ id: "ai-product-shot",
3166
+ name: "AI Product Photography",
3167
+ description: "Generate professional product images with AI-controlled lighting and backgrounds",
3168
+ category: "AI Workflows",
3169
+ generator: "openai",
3170
+ tags: ["product", "ecommerce", "photography", "dall-e", "ai"],
3171
+ requiresCloud: !0,
3172
+ requiresAuth: !0,
3173
+ usesAI: !0,
3174
+ aiCreditsNeeded: 1,
3175
+ capabilities: {
3176
+ studioCompatible: !0
3177
+ },
3178
+ icon: "sparkles",
3179
+ valueProp: "Professional product photos in seconds",
3180
+ preview: {
3181
+ imageUrl: "/showcase/ai-generation/product-headphones.png"
3182
+ },
3183
+ codeExample: `const image = await floimg.generate({
3184
+ generator: 'openai',
3185
+ params: {
3186
+ prompt: 'Professional product photo of headphones on white background',
3187
+ size: '1024x1024'
3188
+ }
3189
+ });`,
3190
+ seo: {
3191
+ title: "AI Product Photography Template",
3192
+ description: "Generate professional product photos with AI-controlled lighting and backgrounds",
3193
+ keywords: ["product photography", "ai generation", "ecommerce", "dall-e"]
3194
+ },
2984
3195
  workflow: {
2985
3196
  nodes: [
2986
3197
  {
2987
- id: "gen-1",
3198
+ id: "gen-ai",
2988
3199
  type: "generator",
2989
- position: { x: 100, y: 100 },
3200
+ position: { x: 100, y: 150 },
2990
3201
  data: {
2991
- generatorName: "qr",
3202
+ generatorName: "openai",
2992
3203
  params: {
2993
- data: "https://floimg.com",
2994
- size: 400,
2995
- margin: 2,
2996
- dark: "#4f46e5",
2997
- light: "#ffffff",
2998
- errorCorrectionLevel: "M"
3204
+ prompt: "Professional product photo of modern wireless headphones on a clean white background, studio lighting, high-end commercial photography style",
3205
+ model: "dall-e-3",
3206
+ size: "1024x1024",
3207
+ quality: "hd"
2999
3208
  }
3000
3209
  }
3001
3210
  }
3002
3211
  ],
3003
3212
  edges: []
3004
3213
  }
3005
- }, zt = {
3006
- id: "wifi-qr",
3007
- name: "WiFi QR Code",
3008
- description: "Scannable QR code for WiFi network access",
3009
- category: "QR Codes",
3010
- generator: "qr",
3011
- tags: ["qr", "wifi", "network", "guest"],
3214
+ }, Lt = {
3215
+ id: "ai-hero-image",
3216
+ name: "AI Hero Image",
3217
+ description: "Create stunning hero images for websites and landing pages",
3218
+ category: "AI Workflows",
3219
+ generator: "openai",
3220
+ tags: ["hero", "landing-page", "marketing", "dall-e", "ai"],
3221
+ requiresCloud: !0,
3222
+ requiresAuth: !0,
3223
+ usesAI: !0,
3224
+ aiCreditsNeeded: 1,
3225
+ capabilities: {
3226
+ studioCompatible: !0
3227
+ },
3228
+ icon: "sparkles",
3229
+ valueProp: "Stunning hero images for your landing page",
3230
+ preview: {
3231
+ imageUrl: "/showcase/ai-generation/futuristic-city.png"
3232
+ },
3233
+ codeExample: `const image = await floimg.generate({
3234
+ generator: 'openai',
3235
+ params: {
3236
+ prompt: 'Futuristic city skyline at sunset, cinematic lighting',
3237
+ size: '1792x1024'
3238
+ }
3239
+ });`,
3240
+ seo: {
3241
+ title: "AI Hero Image Generator",
3242
+ description: "Generate stunning hero images for websites and landing pages with AI",
3243
+ keywords: ["hero image", "landing page", "ai generation", "website design"]
3244
+ },
3012
3245
  workflow: {
3013
3246
  nodes: [
3014
3247
  {
3015
- id: "gen-1",
3248
+ id: "gen-ai",
3016
3249
  type: "generator",
3017
- position: { x: 100, y: 100 },
3250
+ position: { x: 100, y: 150 },
3018
3251
  data: {
3019
- generatorName: "qr",
3252
+ generatorName: "openai",
3020
3253
  params: {
3021
- data: "WIFI:T:WPA;S:GuestNetwork;P:welcome123;;",
3022
- size: 400,
3023
- margin: 2,
3024
- dark: "#059669",
3025
- light: "#ffffff",
3026
- errorCorrectionLevel: "H"
3254
+ prompt: "Futuristic city skyline at golden hour sunset, cinematic wide angle, volumetric lighting, sci-fi architecture, dramatic clouds, professional photography",
3255
+ model: "dall-e-3",
3256
+ size: "1792x1024",
3257
+ quality: "hd"
3027
3258
  }
3028
3259
  }
3029
3260
  }
3030
3261
  ],
3031
3262
  edges: []
3032
3263
  }
3033
- }, Ct = {
3034
- id: "chart-watermark",
3035
- name: "Chart with Watermark",
3036
- description: "Bar chart with company watermark and rounded corners",
3037
- category: "Pipelines",
3038
- generator: "quickchart",
3039
- tags: ["chart", "watermark", "branded", "pipeline"],
3264
+ }, Wt = {
3265
+ id: "ai-mascot",
3266
+ name: "AI Mascot Generator",
3267
+ description: "Design unique mascots and characters for your brand",
3268
+ category: "AI Workflows",
3269
+ generator: "openai",
3270
+ tags: ["mascot", "character", "branding", "dall-e", "ai"],
3271
+ requiresCloud: !0,
3272
+ requiresAuth: !0,
3273
+ usesAI: !0,
3274
+ aiCreditsNeeded: 1,
3275
+ capabilities: {
3276
+ studioCompatible: !0
3277
+ },
3278
+ icon: "sparkles",
3279
+ valueProp: "Unique mascots for your brand",
3280
+ preview: {
3281
+ imageUrl: "/showcase/ai-generation/robot-mascot.png"
3282
+ },
3283
+ seo: {
3284
+ title: "AI Mascot Generator",
3285
+ description: "Create unique brand mascots and characters with AI",
3286
+ keywords: ["mascot design", "character design", "branding", "ai generation"]
3287
+ },
3040
3288
  workflow: {
3041
3289
  nodes: [
3042
3290
  {
3043
- id: "gen-1",
3291
+ id: "gen-ai",
3044
3292
  type: "generator",
3045
- position: { x: 100, y: 100 },
3293
+ position: { x: 100, y: 150 },
3046
3294
  data: {
3047
- generatorName: "quickchart",
3295
+ generatorName: "openai",
3048
3296
  params: {
3049
- chart: {
3050
- type: "bar",
3051
- data: {
3052
- labels: ["Mon", "Tue", "Wed", "Thu", "Fri"],
3053
- datasets: [
3054
- {
3055
- label: "Sales",
3056
- data: [45, 62, 38, 71, 55],
3057
- backgroundColor: "rgba(99, 102, 241, 0.8)"
3058
- }
3059
- ]
3060
- }
3061
- },
3062
- width: 600,
3063
- height: 400
3297
+ prompt: "Friendly robot mascot character, modern flat design style, vibrant teal and purple colors, simple geometric shapes, suitable for tech company branding, white background",
3298
+ model: "dall-e-3",
3299
+ size: "1024x1024",
3300
+ quality: "hd"
3301
+ }
3302
+ }
3303
+ }
3304
+ ],
3305
+ edges: []
3306
+ }
3307
+ }, Pt = {
3308
+ id: "cloud-ai-logo-brand",
3309
+ name: "AI Logo to Brand Kit",
3310
+ description: "Generate a logo with AI, then create production-ready brand assets",
3311
+ category: "AI Workflows",
3312
+ generator: "openai",
3313
+ tags: ["ai", "logo", "branding", "dall-e", "pipeline"],
3314
+ requiresCloud: !0,
3315
+ requiresAuth: !0,
3316
+ usesAI: !0,
3317
+ aiCreditsNeeded: 1,
3318
+ capabilities: {
3319
+ studioCompatible: !0,
3320
+ pipeline: !0
3321
+ },
3322
+ icon: "sparkles",
3323
+ valueProp: "From idea to brand kit in seconds",
3324
+ seo: {
3325
+ title: "AI Logo to Brand Kit",
3326
+ description: "Generate a logo with AI and create production-ready brand assets",
3327
+ keywords: ["logo design", "brand kit", "ai generation", "branding"]
3328
+ },
3329
+ workflow: {
3330
+ nodes: [
3331
+ {
3332
+ id: "gen-ai",
3333
+ type: "generator",
3334
+ position: { x: 100, y: 150 },
3335
+ data: {
3336
+ generatorName: "openai",
3337
+ params: {
3338
+ prompt: "A modern minimalist logo for a tech startup called 'Nexus', clean geometric lines, professional, suitable for business cards and websites, white background",
3339
+ model: "dall-e-3",
3340
+ size: "1024x1024",
3341
+ quality: "standard"
3064
3342
  }
3065
3343
  }
3066
3344
  },
3067
3345
  {
3068
- id: "transform-1",
3346
+ id: "transform-bg",
3069
3347
  type: "transform",
3070
- position: { x: 400, y: 100 },
3348
+ position: { x: 400, y: 150 },
3349
+ data: {
3350
+ operation: "removeBackground",
3351
+ params: {}
3352
+ }
3353
+ },
3354
+ {
3355
+ id: "transform-watermark",
3356
+ type: "transform",
3357
+ position: { x: 700, y: 150 },
3071
3358
  data: {
3072
3359
  operation: "addCaption",
3073
3360
  params: {
3074
- text: "floimg.com",
3361
+ text: "Nexus Inc.",
3075
3362
  position: "bottom-right",
3076
3363
  fontSize: 14,
3077
- color: "#9ca3af",
3078
- padding: 10
3364
+ color: "#6B7280",
3365
+ padding: 16
3079
3366
  }
3080
3367
  }
3368
+ }
3369
+ ],
3370
+ edges: [
3371
+ { id: "e1", source: "gen-ai", target: "transform-bg" },
3372
+ { id: "e2", source: "transform-bg", target: "transform-watermark" }
3373
+ ]
3374
+ }
3375
+ }, Mt = {
3376
+ id: "cloud-product-enhance",
3377
+ name: "Product Photo Enhancement",
3378
+ description: "Remove background and add professional product labeling",
3379
+ category: "AI Workflows",
3380
+ generator: "input",
3381
+ tags: ["product", "ecommerce", "background-removal", "pipeline"],
3382
+ requiresCloud: !0,
3383
+ requiresAuth: !0,
3384
+ usesAI: !1,
3385
+ // Uses AI transforms but not AI generation
3386
+ aiCreditsNeeded: 0,
3387
+ capabilities: {
3388
+ studioCompatible: !0,
3389
+ pipeline: !0
3390
+ },
3391
+ icon: "image",
3392
+ valueProp: "E-commerce ready in one click",
3393
+ workflow: {
3394
+ nodes: [
3395
+ {
3396
+ id: "input-1",
3397
+ type: "input",
3398
+ position: { x: 100, y: 150 },
3399
+ data: {}
3081
3400
  },
3082
3401
  {
3083
- id: "transform-2",
3402
+ id: "transform-bg",
3084
3403
  type: "transform",
3085
- position: { x: 700, y: 100 },
3404
+ position: { x: 400, y: 150 },
3086
3405
  data: {
3087
- operation: "roundCorners",
3406
+ operation: "removeBackground",
3407
+ params: {}
3408
+ }
3409
+ },
3410
+ {
3411
+ id: "transform-caption",
3412
+ type: "transform",
3413
+ position: { x: 700, y: 150 },
3414
+ data: {
3415
+ operation: "addCaption",
3088
3416
  params: {
3089
- radius: 16
3417
+ text: "Premium Quality",
3418
+ position: "bottom-center",
3419
+ fontSize: 24,
3420
+ color: "#18181B",
3421
+ padding: 20
3090
3422
  }
3091
3423
  }
3092
3424
  }
3093
3425
  ],
3094
3426
  edges: [
3095
- { id: "e1", source: "gen-1", target: "transform-1" },
3096
- { id: "e2", source: "transform-1", target: "transform-2" }
3427
+ { id: "e1", source: "input-1", target: "transform-bg" },
3428
+ { id: "e2", source: "transform-bg", target: "transform-caption" }
3097
3429
  ]
3098
3430
  }
3099
- }, It = {
3100
- id: "diagram-webp",
3101
- name: "Diagram to WebP",
3102
- description: "Mermaid diagram converted to optimized WebP format",
3103
- category: "Pipelines",
3104
- generator: "mermaid",
3105
- tags: ["mermaid", "webp", "optimize", "pipeline"],
3431
+ }, Dt = {
3432
+ id: "cloud-ai-social",
3433
+ name: "AI Art to Social Post",
3434
+ description: "Generate creative AI art, optimize for social media",
3435
+ category: "AI Workflows",
3436
+ generator: "openai",
3437
+ tags: ["ai", "art", "social-media", "dall-e", "pipeline"],
3438
+ requiresCloud: !0,
3439
+ requiresAuth: !0,
3440
+ usesAI: !0,
3441
+ aiCreditsNeeded: 1,
3442
+ capabilities: {
3443
+ studioCompatible: !0,
3444
+ pipeline: !0
3445
+ },
3446
+ icon: "share",
3447
+ valueProp: "Creative content for your feed",
3106
3448
  workflow: {
3107
3449
  nodes: [
3108
3450
  {
3109
- id: "gen-1",
3451
+ id: "gen-ai",
3452
+ type: "generator",
3453
+ position: { x: 100, y: 150 },
3454
+ data: {
3455
+ generatorName: "openai",
3456
+ params: {
3457
+ prompt: "Abstract colorful digital art with flowing gradients, trending on artstation, vibrant neon colors, perfect for social media",
3458
+ model: "dall-e-3",
3459
+ size: "1024x1024",
3460
+ style: "vivid"
3461
+ }
3462
+ }
3463
+ },
3464
+ {
3465
+ id: "transform-corners",
3466
+ type: "transform",
3467
+ position: { x: 400, y: 100 },
3468
+ data: {
3469
+ operation: "roundCorners",
3470
+ params: {
3471
+ radius: 24
3472
+ }
3473
+ }
3474
+ },
3475
+ {
3476
+ id: "transform-caption",
3477
+ type: "transform",
3478
+ position: { x: 700, y: 100 },
3479
+ data: {
3480
+ operation: "addCaption",
3481
+ params: {
3482
+ text: "@floimg",
3483
+ position: "bottom-right",
3484
+ fontSize: 18,
3485
+ color: "#FFFFFF",
3486
+ padding: 16
3487
+ }
3488
+ }
3489
+ },
3490
+ {
3491
+ id: "transform-webp",
3492
+ type: "transform",
3493
+ position: { x: 1e3, y: 100 },
3494
+ data: {
3495
+ operation: "convert",
3496
+ params: {
3497
+ to: "image/webp",
3498
+ quality: 85
3499
+ }
3500
+ }
3501
+ }
3502
+ ],
3503
+ edges: [
3504
+ { id: "e1", source: "gen-ai", target: "transform-corners" },
3505
+ { id: "e2", source: "transform-corners", target: "transform-caption" },
3506
+ { id: "e3", source: "transform-caption", target: "transform-webp" }
3507
+ ]
3508
+ }
3509
+ }, Tt = [
3510
+ At,
3511
+ Lt,
3512
+ Wt,
3513
+ Pt,
3514
+ Mt,
3515
+ Dt
3516
+ ], jt = {
3517
+ id: "social-media-kit",
3518
+ name: "Social Media Kit",
3519
+ description: "Generate optimized images for all social platforms from one source",
3520
+ category: "Marketing",
3521
+ generator: "pipeline",
3522
+ tags: ["social", "og-image", "twitter", "instagram", "resize"],
3523
+ capabilities: {
3524
+ studioCompatible: !0,
3525
+ claudeCodeReady: !0,
3526
+ pipeline: !0
3527
+ },
3528
+ icon: "share",
3529
+ preview: {
3530
+ imageUrl: "/showcase/pipelines/output/og-image.png"
3531
+ },
3532
+ codeExample: `// One source -> all platforms
3533
+ const socialKit = await floimg.pipeline(heroImage, [
3534
+ { op: 'resize', params: { width: 1200, height: 630 }, save: 'og-image.png' },
3535
+ { op: 'resize', params: { width: 800, height: 418 }, save: 'twitter-card.png' },
3536
+ { op: 'resize', params: { width: 1080, height: 1080 }, save: 'instagram.png' },
3537
+ ]);`,
3538
+ seo: {
3539
+ title: "Social Media Kit Generator",
3540
+ description: "Generate optimized images for all social platforms from one source image",
3541
+ keywords: [
3542
+ "social media",
3543
+ "og image",
3544
+ "twitter card",
3545
+ "instagram",
3546
+ "image resize"
3547
+ ]
3548
+ },
3549
+ workflow: {
3550
+ nodes: [
3551
+ {
3552
+ id: "input-1",
3553
+ type: "input",
3554
+ position: { x: 100, y: 200 },
3555
+ data: {}
3556
+ },
3557
+ {
3558
+ id: "transform-og",
3559
+ type: "transform",
3560
+ position: { x: 400, y: 100 },
3561
+ data: {
3562
+ operation: "resize",
3563
+ params: {
3564
+ width: 1200,
3565
+ height: 630,
3566
+ fit: "cover"
3567
+ }
3568
+ }
3569
+ },
3570
+ {
3571
+ id: "transform-twitter",
3572
+ type: "transform",
3573
+ position: { x: 400, y: 200 },
3574
+ data: {
3575
+ operation: "resize",
3576
+ params: {
3577
+ width: 800,
3578
+ height: 418,
3579
+ fit: "cover"
3580
+ }
3581
+ }
3582
+ },
3583
+ {
3584
+ id: "transform-instagram",
3585
+ type: "transform",
3586
+ position: { x: 400, y: 300 },
3587
+ data: {
3588
+ operation: "resize",
3589
+ params: {
3590
+ width: 1080,
3591
+ height: 1080,
3592
+ fit: "cover"
3593
+ }
3594
+ }
3595
+ }
3596
+ ],
3597
+ edges: [
3598
+ { id: "e1", source: "input-1", target: "transform-og" },
3599
+ { id: "e2", source: "input-1", target: "transform-twitter" },
3600
+ { id: "e3", source: "input-1", target: "transform-instagram" }
3601
+ ]
3602
+ }
3603
+ }, $t = {
3604
+ id: "avatar-pipeline",
3605
+ name: "Avatar Processing",
3606
+ description: "Generate consistent avatar sizes with circular crop and optimization",
3607
+ category: "Marketing",
3608
+ generator: "pipeline",
3609
+ tags: ["avatar", "profile", "resize", "crop", "user"],
3610
+ capabilities: {
3611
+ studioCompatible: !0,
3612
+ claudeCodeReady: !0,
3613
+ pipeline: !0
3614
+ },
3615
+ icon: "image",
3616
+ preview: {
3617
+ imageUrl: "/showcase/pipelines/output/avatar-128.png"
3618
+ },
3619
+ codeExample: `const avatars = await floimg.pipeline(photo, [
3620
+ { op: 'crop', params: { shape: 'circle' } },
3621
+ { op: 'resize', params: { width: 256 }, save: 'avatar-256.png' },
3622
+ { op: 'resize', params: { width: 128 }, save: 'avatar-128.png' },
3623
+ { op: 'resize', params: { width: 64 }, save: 'avatar-64.png' },
3624
+ ]);`,
3625
+ seo: {
3626
+ title: "Avatar Processing Pipeline",
3627
+ description: "Generate consistent avatar sizes with circular crop and optimization",
3628
+ keywords: ["avatar", "profile picture", "image resize", "circular crop"]
3629
+ },
3630
+ workflow: {
3631
+ nodes: [
3632
+ {
3633
+ id: "input-1",
3634
+ type: "input",
3635
+ position: { x: 100, y: 200 },
3636
+ data: {}
3637
+ },
3638
+ {
3639
+ id: "transform-crop",
3640
+ type: "transform",
3641
+ position: { x: 350, y: 200 },
3642
+ data: {
3643
+ operation: "crop",
3644
+ params: {
3645
+ shape: "circle"
3646
+ }
3647
+ }
3648
+ },
3649
+ {
3650
+ id: "transform-256",
3651
+ type: "transform",
3652
+ position: { x: 600, y: 100 },
3653
+ data: {
3654
+ operation: "resize",
3655
+ params: {
3656
+ width: 256,
3657
+ height: 256
3658
+ }
3659
+ }
3660
+ },
3661
+ {
3662
+ id: "transform-128",
3663
+ type: "transform",
3664
+ position: { x: 600, y: 200 },
3665
+ data: {
3666
+ operation: "resize",
3667
+ params: {
3668
+ width: 128,
3669
+ height: 128
3670
+ }
3671
+ }
3672
+ },
3673
+ {
3674
+ id: "transform-64",
3675
+ type: "transform",
3676
+ position: { x: 600, y: 300 },
3677
+ data: {
3678
+ operation: "resize",
3679
+ params: {
3680
+ width: 64,
3681
+ height: 64
3682
+ }
3683
+ }
3684
+ }
3685
+ ],
3686
+ edges: [
3687
+ { id: "e1", source: "input-1", target: "transform-crop" },
3688
+ { id: "e2", source: "transform-crop", target: "transform-256" },
3689
+ { id: "e3", source: "transform-crop", target: "transform-128" },
3690
+ { id: "e4", source: "transform-crop", target: "transform-64" }
3691
+ ]
3692
+ }
3693
+ }, Ut = {
3694
+ id: "watermark-branding",
3695
+ name: "Branded Watermark",
3696
+ description: "Add your logo watermark to images automatically",
3697
+ category: "Marketing",
3698
+ generator: "pipeline",
3699
+ tags: ["watermark", "branding", "logo", "protection", "copyright"],
3700
+ capabilities: {
3701
+ studioCompatible: !0,
3702
+ claudeCodeReady: !0,
3703
+ pipeline: !0
3704
+ },
3705
+ icon: "image",
3706
+ preview: {
3707
+ imageUrl: "/showcase/pipelines/output/watermark-branded.png"
3708
+ },
3709
+ seo: {
3710
+ title: "Branded Watermark Template",
3711
+ description: "Add professional watermarks to protect and brand your images",
3712
+ keywords: ["watermark", "branding", "image protection", "logo overlay"]
3713
+ },
3714
+ workflow: {
3715
+ nodes: [
3716
+ {
3717
+ id: "gen-1",
3718
+ type: "generator",
3719
+ position: { x: 100, y: 100 },
3720
+ data: {
3721
+ generatorName: "quickchart",
3722
+ params: {
3723
+ chart: {
3724
+ type: "bar",
3725
+ data: {
3726
+ labels: ["Mon", "Tue", "Wed", "Thu", "Fri"],
3727
+ datasets: [
3728
+ {
3729
+ label: "Sales",
3730
+ data: [45, 62, 38, 71, 55],
3731
+ backgroundColor: "rgba(99, 102, 241, 0.8)"
3732
+ }
3733
+ ]
3734
+ }
3735
+ },
3736
+ width: 600,
3737
+ height: 400
3738
+ }
3739
+ }
3740
+ },
3741
+ {
3742
+ id: "transform-1",
3743
+ type: "transform",
3744
+ position: { x: 400, y: 100 },
3745
+ data: {
3746
+ operation: "addCaption",
3747
+ params: {
3748
+ text: "floimg.com",
3749
+ position: "bottom-right",
3750
+ fontSize: 14,
3751
+ color: "#9ca3af",
3752
+ padding: 10
3753
+ }
3754
+ }
3755
+ },
3756
+ {
3757
+ id: "transform-2",
3758
+ type: "transform",
3759
+ position: { x: 700, y: 100 },
3760
+ data: {
3761
+ operation: "roundCorners",
3762
+ params: {
3763
+ radius: 16
3764
+ }
3765
+ }
3766
+ }
3767
+ ],
3768
+ edges: [
3769
+ { id: "e1", source: "gen-1", target: "transform-1" },
3770
+ { id: "e2", source: "transform-1", target: "transform-2" }
3771
+ ]
3772
+ }
3773
+ }, Rt = {
3774
+ id: "filter-showcase",
3775
+ name: "Image Filters",
3776
+ description: "Apply artistic filters: vintage, dramatic, vibrant, and more",
3777
+ category: "Marketing",
3778
+ generator: "pipeline",
3779
+ tags: ["filter", "vintage", "effects", "artistic", "photo"],
3780
+ capabilities: {
3781
+ studioCompatible: !0,
3782
+ claudeCodeReady: !0,
3783
+ pipeline: !0
3784
+ },
3785
+ icon: "image",
3786
+ preview: {
3787
+ imageUrl: "/showcase/pipelines/output/filter-vintage.png"
3788
+ },
3789
+ seo: {
3790
+ title: "Image Filter Effects",
3791
+ description: "Apply artistic filters like vintage, dramatic, and vibrant effects",
3792
+ keywords: ["image filter", "photo effects", "vintage filter", "artistic"]
3793
+ },
3794
+ workflow: {
3795
+ nodes: [
3796
+ {
3797
+ id: "input-1",
3798
+ type: "input",
3799
+ position: { x: 100, y: 200 },
3800
+ data: {}
3801
+ },
3802
+ {
3803
+ id: "transform-vintage",
3804
+ type: "transform",
3805
+ position: { x: 400, y: 100 },
3806
+ data: {
3807
+ operation: "adjustColors",
3808
+ params: {
3809
+ saturation: 0.7,
3810
+ brightness: 0.9,
3811
+ sepia: 0.3
3812
+ }
3813
+ }
3814
+ },
3815
+ {
3816
+ id: "transform-vibrant",
3817
+ type: "transform",
3818
+ position: { x: 400, y: 200 },
3819
+ data: {
3820
+ operation: "adjustColors",
3821
+ params: {
3822
+ saturation: 1.4,
3823
+ contrast: 1.2
3824
+ }
3825
+ }
3826
+ },
3827
+ {
3828
+ id: "transform-dramatic",
3829
+ type: "transform",
3830
+ position: { x: 400, y: 300 },
3831
+ data: {
3832
+ operation: "adjustColors",
3833
+ params: {
3834
+ contrast: 1.5,
3835
+ brightness: 0.8,
3836
+ saturation: 0.9
3837
+ }
3838
+ }
3839
+ }
3840
+ ],
3841
+ edges: [
3842
+ { id: "e1", source: "input-1", target: "transform-vintage" },
3843
+ { id: "e2", source: "input-1", target: "transform-vibrant" },
3844
+ { id: "e3", source: "input-1", target: "transform-dramatic" }
3845
+ ]
3846
+ }
3847
+ }, Ot = [
3848
+ jt,
3849
+ $t,
3850
+ Ut,
3851
+ Rt
3852
+ ], Et = {
3853
+ id: "branded-qr",
3854
+ name: "Branded QR Code",
3855
+ description: "QR code with custom colors and styling to match your brand",
3856
+ category: "Utilities",
3857
+ generator: "qr",
3858
+ tags: ["qr", "branded", "link", "custom", "url"],
3859
+ capabilities: {
3860
+ studioCompatible: !0,
3861
+ claudeCodeReady: !0
3862
+ },
3863
+ icon: "qr",
3864
+ preview: {
3865
+ imageUrl: "/showcase/qr-codes/qr-brand.png"
3866
+ },
3867
+ codeExample: `const qr = await floimg.generate({
3868
+ generator: 'qr',
3869
+ params: {
3870
+ data: 'https://floimg.com',
3871
+ color: '#0d9488',
3872
+ backgroundColor: '#ffffff',
3873
+ margin: 2
3874
+ }
3875
+ });`,
3876
+ seo: {
3877
+ title: "Branded QR Code Generator",
3878
+ description: "Generate QR codes with custom colors to match your brand identity",
3879
+ keywords: ["qr code", "branded qr", "custom qr", "marketing"]
3880
+ },
3881
+ workflow: {
3882
+ nodes: [
3883
+ {
3884
+ id: "gen-1",
3885
+ type: "generator",
3886
+ position: { x: 100, y: 100 },
3887
+ data: {
3888
+ generatorName: "qr",
3889
+ params: {
3890
+ data: "https://floimg.com",
3891
+ size: 400,
3892
+ margin: 2,
3893
+ dark: "#0d9488",
3894
+ light: "#ffffff",
3895
+ errorCorrectionLevel: "M"
3896
+ }
3897
+ }
3898
+ }
3899
+ ],
3900
+ edges: []
3901
+ }
3902
+ }, qt = {
3903
+ id: "dark-qr",
3904
+ name: "Dark Mode QR",
3905
+ description: "QR code optimized for dark backgrounds",
3906
+ category: "Utilities",
3907
+ generator: "qr",
3908
+ tags: ["qr", "dark-mode", "link", "inverted"],
3909
+ capabilities: {
3910
+ studioCompatible: !0,
3911
+ claudeCodeReady: !0
3912
+ },
3913
+ icon: "qr",
3914
+ preview: {
3915
+ imageUrl: "/showcase/qr-codes/qr-dark.png"
3916
+ },
3917
+ seo: {
3918
+ title: "Dark Mode QR Code",
3919
+ description: "QR codes optimized for dark backgrounds and dark mode UIs",
3920
+ keywords: ["qr code", "dark mode", "inverted qr", "night mode"]
3921
+ },
3922
+ workflow: {
3923
+ nodes: [
3924
+ {
3925
+ id: "gen-1",
3926
+ type: "generator",
3927
+ position: { x: 100, y: 100 },
3928
+ data: {
3929
+ generatorName: "qr",
3930
+ params: {
3931
+ data: "https://floimg.com",
3932
+ size: 400,
3933
+ margin: 2,
3934
+ dark: "#ffffff",
3935
+ light: "#18181b",
3936
+ errorCorrectionLevel: "M"
3937
+ }
3938
+ }
3939
+ }
3940
+ ],
3941
+ edges: []
3942
+ }
3943
+ }, Bt = {
3944
+ id: "wifi-qr",
3945
+ name: "WiFi QR Code",
3946
+ description: "Scannable QR code for WiFi network access",
3947
+ category: "Utilities",
3948
+ generator: "qr",
3949
+ tags: ["qr", "wifi", "network", "guest", "access"],
3950
+ capabilities: {
3951
+ studioCompatible: !0,
3952
+ claudeCodeReady: !0
3953
+ },
3954
+ icon: "qr",
3955
+ seo: {
3956
+ title: "WiFi QR Code Generator",
3957
+ description: "Generate scannable QR codes for easy WiFi network access sharing",
3958
+ keywords: ["wifi qr", "network access", "guest wifi", "qr code"]
3959
+ },
3960
+ workflow: {
3961
+ nodes: [
3962
+ {
3963
+ id: "gen-1",
3964
+ type: "generator",
3965
+ position: { x: 100, y: 100 },
3966
+ data: {
3967
+ generatorName: "qr",
3968
+ params: {
3969
+ data: "WIFI:T:WPA;S:GuestNetwork;P:welcome123;;",
3970
+ size: 400,
3971
+ margin: 2,
3972
+ dark: "#059669",
3973
+ light: "#ffffff",
3974
+ errorCorrectionLevel: "H"
3975
+ }
3976
+ }
3977
+ }
3978
+ ],
3979
+ edges: []
3980
+ }
3981
+ }, Gt = {
3982
+ id: "thumbnail-generator",
3983
+ name: "Thumbnail Generator",
3984
+ description: "Create multiple thumbnail sizes with automatic optimization",
3985
+ category: "Utilities",
3986
+ generator: "pipeline",
3987
+ tags: ["thumbnail", "resize", "optimize", "batch", "responsive"],
3988
+ capabilities: {
3989
+ studioCompatible: !0,
3990
+ claudeCodeReady: !0,
3991
+ pipeline: !0
3992
+ },
3993
+ icon: "image",
3994
+ preview: {
3995
+ imageUrl: "/showcase/pipelines/output/thumb-200.png"
3996
+ },
3997
+ seo: {
3998
+ title: "Thumbnail Generator",
3999
+ description: "Generate multiple thumbnail sizes with automatic optimization",
4000
+ keywords: ["thumbnail", "image resize", "responsive images", "optimization"]
4001
+ },
4002
+ workflow: {
4003
+ nodes: [
4004
+ {
4005
+ id: "input-1",
4006
+ type: "input",
4007
+ position: { x: 100, y: 200 },
4008
+ data: {}
4009
+ },
4010
+ {
4011
+ id: "transform-800",
4012
+ type: "transform",
4013
+ position: { x: 400, y: 100 },
4014
+ data: {
4015
+ operation: "resize",
4016
+ params: {
4017
+ width: 800,
4018
+ fit: "inside"
4019
+ }
4020
+ }
4021
+ },
4022
+ {
4023
+ id: "transform-400",
4024
+ type: "transform",
4025
+ position: { x: 400, y: 200 },
4026
+ data: {
4027
+ operation: "resize",
4028
+ params: {
4029
+ width: 400,
4030
+ fit: "inside"
4031
+ }
4032
+ }
4033
+ },
4034
+ {
4035
+ id: "transform-200",
4036
+ type: "transform",
4037
+ position: { x: 400, y: 300 },
4038
+ data: {
4039
+ operation: "resize",
4040
+ params: {
4041
+ width: 200,
4042
+ fit: "inside"
4043
+ }
4044
+ }
4045
+ }
4046
+ ],
4047
+ edges: [
4048
+ { id: "e1", source: "input-1", target: "transform-800" },
4049
+ { id: "e2", source: "input-1", target: "transform-400" },
4050
+ { id: "e3", source: "input-1", target: "transform-200" }
4051
+ ]
4052
+ }
4053
+ }, Ft = {
4054
+ id: "diagram-webp",
4055
+ name: "Diagram to WebP",
4056
+ description: "Mermaid diagram converted to optimized WebP format",
4057
+ category: "Utilities",
4058
+ generator: "mermaid",
4059
+ tags: ["mermaid", "webp", "optimize", "pipeline", "conversion"],
4060
+ capabilities: {
4061
+ studioCompatible: !0,
4062
+ claudeCodeReady: !0,
4063
+ pipeline: !0
4064
+ },
4065
+ icon: "diagram",
4066
+ seo: {
4067
+ title: "Diagram to WebP Converter",
4068
+ description: "Convert Mermaid diagrams to optimized WebP format",
4069
+ keywords: ["mermaid diagram", "webp conversion", "image optimization"]
4070
+ },
4071
+ workflow: {
4072
+ nodes: [
4073
+ {
4074
+ id: "gen-1",
3110
4075
  type: "generator",
3111
4076
  position: { x: 100, y: 100 },
3112
4077
  data: {
@@ -3137,54 +4102,70 @@ const ft = {
3137
4102
  ],
3138
4103
  edges: [{ id: "e1", source: "gen-1", target: "transform-1" }]
3139
4104
  }
3140
- }, q = [
3141
- // Charts
3142
- ft,
3143
- kt,
3144
- // Diagrams
3145
- vt,
3146
- yt,
3147
- wt,
3148
- // QR Codes
3149
- Nt,
3150
- zt,
3151
- // Pipelines
3152
- Ct,
3153
- It
3154
- ];
3155
- function St() {
3156
- const r = new Set(q.map((l) => l.category));
3157
- return Array.from(r).sort();
4105
+ }, Vt = [
4106
+ Et,
4107
+ qt,
4108
+ Bt,
4109
+ Gt,
4110
+ Ft
4111
+ ], oe = [
4112
+ ...St,
4113
+ ...Tt,
4114
+ ...Ot,
4115
+ ...Vt
4116
+ ], K = oe.filter((r) => !r.requiresCloud);
4117
+ oe.filter((r) => r.requiresCloud);
4118
+ function ue(r) {
4119
+ return oe.find((d) => d.id === r);
3158
4120
  }
3159
- function Ft(r) {
3160
- return q.filter((l) => l.category === r);
4121
+ function cr(r) {
4122
+ return K.find((d) => d.id === r);
3161
4123
  }
3162
- function pe(r) {
3163
- return q.find((l) => l.id === r);
4124
+ function Ht() {
4125
+ const r = new Set(K.map((d) => d.category));
4126
+ return Array.from(r);
3164
4127
  }
3165
- function Ht(r) {
3166
- const l = r.toLowerCase();
3167
- return q.filter(
3168
- (t) => {
3169
- var o;
3170
- return t.name.toLowerCase().includes(l) || t.description.toLowerCase().includes(l) || t.category.toLowerCase().includes(l) || t.generator.toLowerCase().includes(l) || ((o = t.tags) == null ? void 0 : o.some((i) => i.toLowerCase().includes(l)));
3171
- }
3172
- );
4128
+ function mr(r) {
4129
+ return K.filter((d) => d.category === r);
3173
4130
  }
3174
- function Lt({ onSelect: r }) {
3175
- const [l, t] = C(null), [o, i] = C(""), s = ie(() => St(), []), p = ie(() => {
3176
- let d = q;
3177
- if (l && (d = d.filter((a) => a.category === l)), o) {
4131
+ function pr(r) {
4132
+ const d = r.toLowerCase();
4133
+ return K.filter((t) => {
4134
+ var o;
4135
+ return t.name.toLowerCase().includes(d) || t.description.toLowerCase().includes(d) || t.category.toLowerCase().includes(d) || t.generator.toLowerCase().includes(d) || ((o = t.tags) == null ? void 0 : o.some((s) => s.toLowerCase().includes(d)));
4136
+ });
4137
+ }
4138
+ const _t = {
4139
+ // Chart templates
4140
+ "sales-dashboard": "revenue-chart",
4141
+ "user-growth": "monthly-users",
4142
+ // QR templates
4143
+ "website-qr": "branded-qr",
4144
+ // Pipeline templates
4145
+ "chart-watermark": "watermark-branding"
4146
+ };
4147
+ function ge(r) {
4148
+ const d = ue(r);
4149
+ if (d)
4150
+ return d;
4151
+ const t = _t[r];
4152
+ if (t)
4153
+ return ue(t);
4154
+ }
4155
+ function Kt({ onSelect: r }) {
4156
+ const [d, t] = C(null), [o, s] = C(""), i = de(() => Ht(), []), p = de(() => {
4157
+ let l = K;
4158
+ if (d && (l = l.filter((a) => a.category === d)), o) {
3178
4159
  const a = o.toLowerCase();
3179
- d = d.filter(
4160
+ l = l.filter(
3180
4161
  (m) => {
3181
4162
  var c;
3182
4163
  return m.name.toLowerCase().includes(a) || m.description.toLowerCase().includes(a) || m.generator.toLowerCase().includes(a) || ((c = m.tags) == null ? void 0 : c.some((u) => u.toLowerCase().includes(a)));
3183
4164
  }
3184
4165
  );
3185
4166
  }
3186
- return d;
3187
- }, [l, o]);
4167
+ return l;
4168
+ }, [d, o]);
3188
4169
  return /* @__PURE__ */ n("div", { className: "p-6", children: [
3189
4170
  /* @__PURE__ */ n("div", { className: "mb-6", children: [
3190
4171
  /* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: "Templates" }),
@@ -3197,7 +4178,7 @@ function Lt({ onSelect: r }) {
3197
4178
  type: "text",
3198
4179
  placeholder: "Search templates...",
3199
4180
  value: o,
3200
- onChange: (d) => i(d.target.value),
4181
+ onChange: (l) => s(l.target.value),
3201
4182
  className: "px-4 py-2 border border-gray-300 dark:border-zinc-600 rounded-lg bg-white dark:bg-zinc-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-teal-500 focus:border-transparent w-64"
3202
4183
  }
3203
4184
  ),
@@ -3206,33 +4187,33 @@ function Lt({ onSelect: r }) {
3206
4187
  "button",
3207
4188
  {
3208
4189
  onClick: () => t(null),
3209
- className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${l === null ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
4190
+ className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${d === null ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
3210
4191
  children: "All"
3211
4192
  }
3212
4193
  ),
3213
- s.map((d) => /* @__PURE__ */ e(
4194
+ i.map((l) => /* @__PURE__ */ e(
3214
4195
  "button",
3215
4196
  {
3216
- onClick: () => t(d),
3217
- className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${l === d ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
3218
- children: d
4197
+ onClick: () => t(l),
4198
+ className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${d === l ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
4199
+ children: l
3219
4200
  },
3220
- d
4201
+ l
3221
4202
  ))
3222
4203
  ] })
3223
4204
  ] }),
3224
- p.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: p.map((d) => /* @__PURE__ */ e(
3225
- Wt,
4205
+ p.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: p.map((l) => /* @__PURE__ */ e(
4206
+ Qt,
3226
4207
  {
3227
- template: d,
3228
- onSelect: () => r(d.id)
4208
+ template: l,
4209
+ onSelect: () => r(l.id)
3229
4210
  },
3230
- d.id
4211
+ l.id
3231
4212
  )) })
3232
4213
  ] });
3233
4214
  }
3234
- function Wt({ template: r, onSelect: l }) {
3235
- const t = r.workflow.nodes.length, o = r.workflow.edges.length, i = {
4215
+ function Qt({ template: r, onSelect: d }) {
4216
+ const t = r.workflow.nodes.length, o = r.workflow.edges.length, s = {
3236
4217
  quickchart: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
3237
4218
  mermaid: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-300",
3238
4219
  qr: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",
@@ -3273,7 +4254,7 @@ function Wt({ template: r, onSelect: l }) {
3273
4254
  /* @__PURE__ */ e(
3274
4255
  "span",
3275
4256
  {
3276
- className: `px-2 py-0.5 rounded text-xs font-medium ${i[r.generator] || "bg-gray-100 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300"}`,
4257
+ className: `px-2 py-0.5 rounded text-xs font-medium ${s[r.generator] || "bg-gray-100 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300"}`,
3277
4258
  children: r.generator
3278
4259
  }
3279
4260
  )
@@ -3309,18 +4290,18 @@ function Wt({ template: r, onSelect: l }) {
3309
4290
  o !== 1 ? "s" : ""
3310
4291
  ] })
3311
4292
  ] }),
3312
- r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((s) => /* @__PURE__ */ e(
4293
+ r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((i) => /* @__PURE__ */ e(
3313
4294
  "span",
3314
4295
  {
3315
4296
  className: "px-2 py-0.5 bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-zinc-400 rounded text-xs",
3316
- children: s
4297
+ children: i
3317
4298
  },
3318
- s
4299
+ i
3319
4300
  )) }),
3320
4301
  /* @__PURE__ */ e(
3321
4302
  "button",
3322
4303
  {
3323
- onClick: l,
4304
+ onClick: d,
3324
4305
  className: "w-full py-2 px-4 bg-teal-600 hover:bg-teal-700 text-white rounded-lg font-medium transition-colors",
3325
4306
  children: "Use Template"
3326
4307
  }
@@ -3328,24 +4309,24 @@ function Wt({ template: r, onSelect: l }) {
3328
4309
  ] })
3329
4310
  ] });
3330
4311
  }
3331
- function At({
4312
+ function Jt({
3332
4313
  workflow: r,
3333
- isActive: l,
4314
+ isActive: d,
3334
4315
  onLoad: t,
3335
4316
  onDelete: o,
3336
- onRename: i,
3337
- onDuplicate: s
4317
+ onRename: s,
4318
+ onDuplicate: i
3338
4319
  }) {
3339
- const [p, d] = C(!1), [a, m] = C(r.name), [c, u] = C(!1), h = () => {
3340
- a.trim() && a !== r.name && i(a.trim()), d(!1);
3341
- }, b = (y) => {
3342
- const v = new Date(y), x = (/* @__PURE__ */ new Date()).getTime() - v.getTime(), g = Math.floor(x / 6e4), N = Math.floor(x / 36e5), A = Math.floor(x / 864e5);
3343
- return g < 1 ? "Just now" : g < 60 ? `${g}m ago` : N < 24 ? `${N}h ago` : A < 7 ? `${A}d ago` : v.toLocaleDateString();
4320
+ const [p, l] = C(!1), [a, m] = C(r.name), [c, u] = C(!1), h = () => {
4321
+ a.trim() && a !== r.name && s(a.trim()), l(!1);
4322
+ }, b = (v) => {
4323
+ const y = new Date(v), f = (/* @__PURE__ */ new Date()).getTime() - y.getTime(), g = Math.floor(f / 6e4), N = Math.floor(f / 36e5), W = Math.floor(f / 864e5);
4324
+ return g < 1 ? "Just now" : g < 60 ? `${g}m ago` : N < 24 ? `${N}h ago` : W < 7 ? `${W}d ago` : y.toLocaleDateString();
3344
4325
  };
3345
4326
  return /* @__PURE__ */ n(
3346
4327
  "div",
3347
4328
  {
3348
- className: `group relative p-3 rounded-lg border transition-colors ${l ? "bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800" : "bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 hover:border-zinc-300 dark:hover:border-zinc-600"}`,
4329
+ className: `group relative p-3 rounded-lg border transition-colors ${d ? "bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800" : "bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 hover:border-zinc-300 dark:hover:border-zinc-600"}`,
3349
4330
  children: [
3350
4331
  /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-2", children: [
3351
4332
  /* @__PURE__ */ n("button", { onClick: t, className: "flex-1 text-left min-w-0", children: [
@@ -3354,14 +4335,14 @@ function At({
3354
4335
  {
3355
4336
  type: "text",
3356
4337
  value: a,
3357
- onChange: (y) => m(y.target.value),
4338
+ onChange: (v) => m(v.target.value),
3358
4339
  onBlur: h,
3359
- onKeyDown: (y) => {
3360
- y.key === "Enter" && h(), y.key === "Escape" && (m(r.name), d(!1));
4340
+ onKeyDown: (v) => {
4341
+ v.key === "Enter" && h(), v.key === "Escape" && (m(r.name), l(!1));
3361
4342
  },
3362
4343
  className: "w-full px-1 py-0.5 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",
3363
4344
  autoFocus: !0,
3364
- onClick: (y) => y.stopPropagation()
4345
+ onClick: (v) => v.stopPropagation()
3365
4346
  }
3366
4347
  ) : /* @__PURE__ */ e("span", { className: "block text-sm font-medium text-zinc-900 dark:text-zinc-100 truncate", children: r.name }),
3367
4348
  /* @__PURE__ */ n("span", { className: "block text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: [
@@ -3374,21 +4355,21 @@ function At({
3374
4355
  /* @__PURE__ */ e(
3375
4356
  "button",
3376
4357
  {
3377
- onClick: (y) => {
3378
- y.stopPropagation(), u(!c);
4358
+ onClick: (v) => {
4359
+ v.stopPropagation(), u(!c);
3379
4360
  },
3380
4361
  className: "p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded opacity-0 group-hover:opacity-100 transition-opacity",
3381
4362
  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" }) })
3382
4363
  }
3383
4364
  ),
3384
- c && /* @__PURE__ */ n(B, { children: [
4365
+ c && /* @__PURE__ */ n(q, { children: [
3385
4366
  /* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => u(!1) }),
3386
4367
  /* @__PURE__ */ n("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: [
3387
4368
  /* @__PURE__ */ e(
3388
4369
  "button",
3389
4370
  {
3390
- onClick: (y) => {
3391
- y.stopPropagation(), d(!0), u(!1);
4371
+ onClick: (v) => {
4372
+ v.stopPropagation(), l(!0), u(!1);
3392
4373
  },
3393
4374
  className: "w-full px-3 py-1.5 text-left text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700",
3394
4375
  children: "Rename"
@@ -3397,8 +4378,8 @@ function At({
3397
4378
  /* @__PURE__ */ e(
3398
4379
  "button",
3399
4380
  {
3400
- onClick: (y) => {
3401
- y.stopPropagation(), s(), u(!1);
4381
+ onClick: (v) => {
4382
+ v.stopPropagation(), i(), u(!1);
3402
4383
  },
3403
4384
  className: "w-full px-3 py-1.5 text-left text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700",
3404
4385
  children: "Duplicate"
@@ -3407,8 +4388,8 @@ function At({
3407
4388
  /* @__PURE__ */ e(
3408
4389
  "button",
3409
4390
  {
3410
- onClick: (y) => {
3411
- y.stopPropagation(), window.confirm("Delete this workflow?") && o(), u(!1);
4391
+ onClick: (v) => {
4392
+ v.stopPropagation(), window.confirm("Delete this workflow?") && o(), u(!1);
3412
4393
  },
3413
4394
  className: "w-full px-3 py-1.5 text-left text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700",
3414
4395
  children: "Delete"
@@ -3418,24 +4399,24 @@ function At({
3418
4399
  ] })
3419
4400
  ] })
3420
4401
  ] }),
3421
- l && /* @__PURE__ */ e("span", { className: "absolute top-2 right-2 w-2 h-2 bg-teal-500 rounded-full" })
4402
+ d && /* @__PURE__ */ e("span", { className: "absolute top-2 right-2 w-2 h-2 bg-teal-500 rounded-full" })
3422
4403
  ]
3423
4404
  }
3424
4405
  );
3425
4406
  }
3426
- function Pt() {
3427
- const r = f((c) => c.showLibrary), l = f((c) => c.toggleLibrary), t = f((c) => c.savedWorkflows), o = f((c) => c.activeWorkflowId), i = f((c) => c.loadWorkflow), s = f((c) => c.deleteWorkflow), p = f((c) => c.renameWorkflow), d = f((c) => c.duplicateWorkflow), a = f((c) => c.newWorkflow);
4407
+ function Yt() {
4408
+ const r = x((c) => c.showLibrary), d = x((c) => c.toggleLibrary), t = x((c) => c.savedWorkflows), o = x((c) => c.activeWorkflowId), s = x((c) => c.loadWorkflow), i = x((c) => c.deleteWorkflow), p = x((c) => c.renameWorkflow), l = x((c) => c.duplicateWorkflow), a = x((c) => c.newWorkflow);
3428
4409
  if (!r) return null;
3429
4410
  const m = [...t].sort((c, u) => u.updatedAt - c.updatedAt);
3430
- return /* @__PURE__ */ n(B, { children: [
3431
- /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: l }),
4411
+ return /* @__PURE__ */ n(q, { children: [
4412
+ /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: d }),
3432
4413
  /* @__PURE__ */ n("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: [
3433
4414
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
3434
4415
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Workflows" }),
3435
4416
  /* @__PURE__ */ e(
3436
4417
  "button",
3437
4418
  {
3438
- onClick: l,
4419
+ onClick: d,
3439
4420
  className: "p-1 text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 rounded",
3440
4421
  children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
3441
4422
  "path",
@@ -3453,7 +4434,7 @@ function Pt() {
3453
4434
  "button",
3454
4435
  {
3455
4436
  onClick: () => {
3456
- a(), l(), window.dispatchEvent(new window.CustomEvent("new-workflow-created"));
4437
+ a(), d(), window.dispatchEvent(new window.CustomEvent("new-workflow-created"));
3457
4438
  },
3458
4439
  className: "w-full flex items-center justify-center gap-2 px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors",
3459
4440
  children: [
@@ -3492,16 +4473,16 @@ function Pt() {
3492
4473
  /* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
3493
4474
  /* @__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" })
3494
4475
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: m.map((c) => /* @__PURE__ */ e(
3495
- At,
4476
+ Jt,
3496
4477
  {
3497
4478
  workflow: c,
3498
4479
  isActive: c.id === o,
3499
4480
  onLoad: () => {
3500
- i(c.id), l();
4481
+ s(c.id), d();
3501
4482
  },
3502
- onDelete: () => s(c.id),
4483
+ onDelete: () => i(c.id),
3503
4484
  onRename: (u) => p(c.id, u),
3504
- onDuplicate: () => d(c.id)
4485
+ onDuplicate: () => l(c.id)
3505
4486
  },
3506
4487
  c.id
3507
4488
  )) }) }),
@@ -3514,7 +4495,7 @@ function Pt() {
3514
4495
  ] })
3515
4496
  ] });
3516
4497
  }
3517
- const $t = [
4498
+ const Xt = [
3518
4499
  {
3519
4500
  id: "openai",
3520
4501
  name: "OpenAI",
@@ -3550,7 +4531,7 @@ const $t = [
3550
4531
  placeholder: "sk-or-...",
3551
4532
  docsUrl: "https://openrouter.ai/keys"
3552
4533
  }
3553
- ], jt = [
4534
+ ], Zt = [
3554
4535
  {
3555
4536
  id: "ollama",
3556
4537
  name: "Ollama",
@@ -3566,16 +4547,16 @@ const $t = [
3566
4547
  docsUrl: "https://lmstudio.ai"
3567
4548
  }
3568
4549
  ];
3569
- function Mt({ provider: r }) {
3570
- const l = V((h) => h.ai), t = V((h) => h.setAIProvider), o = l[r.id], i = (o == null ? void 0 : o.enabled) ?? !1, s = (o == null ? void 0 : o.apiKey) ?? "", [p, d] = C(s), [a, m] = C(!1), c = () => {
4550
+ function er({ provider: r }) {
4551
+ const d = B((h) => h.ai), t = B((h) => h.setAIProvider), o = d[r.id], s = (o == null ? void 0 : o.enabled) ?? !1, i = (o == null ? void 0 : o.apiKey) ?? "", [p, l] = C(i), [a, m] = C(!1), c = () => {
3571
4552
  t(r.id, {
3572
4553
  apiKey: p,
3573
- enabled: !i
4554
+ enabled: !s
3574
4555
  });
3575
4556
  }, u = (h) => {
3576
- d(h), t(r.id, {
4557
+ l(h), t(r.id, {
3577
4558
  apiKey: h,
3578
- enabled: i
4559
+ enabled: s
3579
4560
  });
3580
4561
  };
3581
4562
  return /* @__PURE__ */ n("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
@@ -3636,27 +4617,27 @@ function Mt({ provider: r }) {
3636
4617
  "button",
3637
4618
  {
3638
4619
  onClick: c,
3639
- className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
4620
+ className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
3640
4621
  children: /* @__PURE__ */ e(
3641
4622
  "span",
3642
4623
  {
3643
- className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
4624
+ className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${s ? "translate-x-6" : "translate-x-1"}`
3644
4625
  }
3645
4626
  )
3646
4627
  }
3647
4628
  ) })
3648
4629
  ] });
3649
4630
  }
3650
- function Dt({ provider: r }) {
3651
- const l = V((c) => c.ai), t = V((c) => c.setAIProvider), o = l[r.id], i = (o == null ? void 0 : o.enabled) ?? !1, s = (o == null ? void 0 : o.baseUrl) ?? r.defaultUrl, [p, d] = C(s), a = () => {
4631
+ function tr({ provider: r }) {
4632
+ const d = B((c) => c.ai), t = B((c) => c.setAIProvider), o = d[r.id], s = (o == null ? void 0 : o.enabled) ?? !1, i = (o == null ? void 0 : o.baseUrl) ?? r.defaultUrl, [p, l] = C(i), a = () => {
3652
4633
  t(r.id, {
3653
4634
  baseUrl: p,
3654
- enabled: !i
4635
+ enabled: !s
3655
4636
  });
3656
4637
  }, m = (c) => {
3657
- d(c), t(r.id, {
4638
+ l(c), t(r.id, {
3658
4639
  baseUrl: c,
3659
- enabled: i
4640
+ enabled: s
3660
4641
  });
3661
4642
  };
3662
4643
  return /* @__PURE__ */ n("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
@@ -3691,19 +4672,19 @@ function Dt({ provider: r }) {
3691
4672
  "button",
3692
4673
  {
3693
4674
  onClick: a,
3694
- className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
4675
+ className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
3695
4676
  children: /* @__PURE__ */ e(
3696
4677
  "span",
3697
4678
  {
3698
- className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
4679
+ className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${s ? "translate-x-6" : "translate-x-1"}`
3699
4680
  }
3700
4681
  )
3701
4682
  }
3702
4683
  ) })
3703
4684
  ] });
3704
4685
  }
3705
- function Tt() {
3706
- const r = V((t) => t.showSettings), l = V((t) => t.closeSettings);
4686
+ function rr() {
4687
+ const r = B((t) => t.showSettings), d = B((t) => t.closeSettings);
3707
4688
  return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ n("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: [
3708
4689
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
3709
4690
  /* @__PURE__ */ n("div", { children: [
@@ -3713,7 +4694,7 @@ function Tt() {
3713
4694
  /* @__PURE__ */ e(
3714
4695
  "button",
3715
4696
  {
3716
- onClick: l,
4697
+ onClick: d,
3717
4698
  className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
3718
4699
  children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
3719
4700
  "path",
@@ -3730,11 +4711,11 @@ function Tt() {
3730
4711
  /* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
3731
4712
  /* @__PURE__ */ n("section", { children: [
3732
4713
  /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Cloud Providers" }),
3733
- /* @__PURE__ */ e("div", { className: "space-y-3", children: $t.map((t) => /* @__PURE__ */ e(Mt, { provider: t }, t.id)) })
4714
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: Xt.map((t) => /* @__PURE__ */ e(er, { provider: t }, t.id)) })
3734
4715
  ] }),
3735
4716
  /* @__PURE__ */ n("section", { children: [
3736
4717
  /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
3737
- /* @__PURE__ */ e("div", { className: "space-y-3", children: jt.map((t) => /* @__PURE__ */ e(Dt, { provider: t }, t.id)) })
4718
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: Zt.map((t) => /* @__PURE__ */ e(tr, { provider: t }, t.id)) })
3738
4719
  ] }),
3739
4720
  /* @__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__ */ n("div", { className: "flex items-start gap-3", children: [
3740
4721
  /* @__PURE__ */ e(
@@ -3764,57 +4745,57 @@ function Tt() {
3764
4745
  /* @__PURE__ */ e("div", { className: "flex justify-end px-6 py-4 border-t border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e(
3765
4746
  "button",
3766
4747
  {
3767
- onClick: l,
4748
+ onClick: d,
3768
4749
  className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
3769
4750
  children: "Done"
3770
4751
  }
3771
4752
  ) })
3772
4753
  ] }) }) : null;
3773
4754
  }
3774
- function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3775
- const [o, i] = C([]), [s, p] = C(""), [d, a] = C(!1), [m, c] = C(null), [u, h] = C(null), [b, y] = C(""), [v, w] = C(), [x, g] = C(!1), [N, A] = C(), k = te(null), L = te(null);
4755
+ function ar({ isOpen: r, onClose: d, onApplyWorkflow: t }) {
4756
+ const [o, s] = C([]), [i, p] = C(""), [l, a] = C(!1), [m, c] = C(null), [u, h] = C(null), [b, v] = C(""), [y, w] = C(), [f, g] = C(!1), [N, W] = C(), k = te(null), A = te(null);
3776
4757
  U(() => {
3777
- r && u === null && qe().then((I) => {
3778
- h(I.available), y(I.message), w(I.reason), g(I.isCloudDeployment ?? !1), A(I.supportUrl);
4758
+ r && u === null && Je().then((I) => {
4759
+ h(I.available), v(I.message), w(I.reason), g(I.isCloudDeployment ?? !1), W(I.supportUrl);
3779
4760
  }).catch(() => {
3780
- h(!1), y("Failed to check AI availability"), w("service_unavailable");
4761
+ h(!1), v("Failed to check AI availability"), w("service_unavailable");
3781
4762
  });
3782
4763
  }, [r, u]), U(() => {
3783
- r && L.current && L.current.focus();
4764
+ r && A.current && A.current.focus();
3784
4765
  }, [r]), U(() => {
3785
4766
  var I;
3786
4767
  (I = k.current) == null || I.scrollIntoView({ behavior: "smooth" });
3787
4768
  }, [o]);
3788
- const S = W(async () => {
3789
- if (!s.trim() || d) return;
4769
+ const S = L(async () => {
4770
+ if (!i.trim() || l) return;
3790
4771
  const I = {
3791
4772
  role: "user",
3792
- content: s.trim(),
4773
+ content: i.trim(),
3793
4774
  timestamp: Date.now()
3794
4775
  };
3795
- i((M) => [...M, I]), p(""), a(!0), c(null);
4776
+ s((T) => [...T, I]), p(""), a(!0), c(null);
3796
4777
  try {
3797
- const M = await Ke({
4778
+ const T = await Qe({
3798
4779
  prompt: I.content,
3799
4780
  history: o
3800
4781
  }), E = {
3801
4782
  role: "assistant",
3802
- content: M.message,
3803
- workflow: M.workflow,
4783
+ content: T.message,
4784
+ workflow: T.workflow,
3804
4785
  timestamp: Date.now()
3805
4786
  };
3806
- i((O) => [...O, E]), !M.success && M.error && c(M.error);
3807
- } catch (M) {
3808
- c(M instanceof Error ? M.message : "Failed to generate workflow");
4787
+ s((R) => [...R, E]), !T.success && T.error && c(T.error);
4788
+ } catch (T) {
4789
+ c(T instanceof Error ? T.message : "Failed to generate workflow");
3809
4790
  } finally {
3810
4791
  a(!1);
3811
4792
  }
3812
- }, [s, d, o]), R = (I) => {
4793
+ }, [i, l, o]), O = (I) => {
3813
4794
  I.key === "Enter" && !I.shiftKey && (I.preventDefault(), S());
3814
- }, J = (I) => {
3815
- t(I), l();
4795
+ }, Q = (I) => {
4796
+ t(I), d();
3816
4797
  }, Y = () => {
3817
- i([]), c(null);
4798
+ s([]), c(null);
3818
4799
  };
3819
4800
  return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ n("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: [
3820
4801
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
@@ -3863,7 +4844,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3863
4844
  /* @__PURE__ */ e(
3864
4845
  "button",
3865
4846
  {
3866
- onClick: l,
4847
+ onClick: d,
3867
4848
  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",
3868
4849
  children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
3869
4850
  "path",
@@ -3880,7 +4861,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3880
4861
  ] }),
3881
4862
  /* @__PURE__ */ n("div", { className: "flex-1 overflow-auto p-4 space-y-4", children: [
3882
4863
  u === !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__ */ n("div", { className: "flex items-start gap-3", children: [
3883
- v === "tier_limit" ? /* @__PURE__ */ e(
4864
+ y === "tier_limit" ? /* @__PURE__ */ e(
3884
4865
  "svg",
3885
4866
  {
3886
4867
  className: "h-5 w-5 text-amber-600 dark:text-amber-400 mt-0.5",
@@ -3916,10 +4897,10 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3916
4897
  }
3917
4898
  ),
3918
4899
  /* @__PURE__ */ n("div", { children: [
3919
- /* @__PURE__ */ e("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: v === "tier_limit" ? "AI Workflow Generation Not Available" : "AI Generation Not Available" }),
4900
+ /* @__PURE__ */ e("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: y === "tier_limit" ? "AI Workflow Generation Not Available" : "AI Generation Not Available" }),
3920
4901
  /* @__PURE__ */ e("p", { className: "text-sm text-amber-700 dark:text-amber-300 mt-1", children: b }),
3921
4902
  /* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row gap-2 mt-3", children: [
3922
- v === "tier_limit" && /* @__PURE__ */ e(
4903
+ y === "tier_limit" && /* @__PURE__ */ e(
3923
4904
  "a",
3924
4905
  {
3925
4906
  href: "/pricing",
@@ -3927,7 +4908,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3927
4908
  children: "View Plans"
3928
4909
  }
3929
4910
  ),
3930
- v === "service_unavailable" && N && /* @__PURE__ */ e(
4911
+ y === "service_unavailable" && N && /* @__PURE__ */ e(
3931
4912
  "a",
3932
4913
  {
3933
4914
  href: N,
@@ -3935,7 +4916,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3935
4916
  children: "Contact Support"
3936
4917
  }
3937
4918
  ),
3938
- v === "not_configured" && !x && /* @__PURE__ */ e(
4919
+ y === "not_configured" && !f && /* @__PURE__ */ e(
3939
4920
  "a",
3940
4921
  {
3941
4922
  href: "https://floimg.com/docs/studio/ai-workflows",
@@ -3975,7 +4956,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3975
4956
  "Generate an image with Gemini, then use it as a reference to create a variation with different lighting",
3976
4957
  "Create a product mockup: generate a minimalist logo, then composite it onto a t-shirt image",
3977
4958
  "Build an AI art pipeline: generate a base image, apply artistic style transfer, then upscale to 4K"
3978
- ].map((I, M) => /* @__PURE__ */ n(
4959
+ ].map((I, T) => /* @__PURE__ */ n(
3979
4960
  "button",
3980
4961
  {
3981
4962
  onClick: () => p(I),
@@ -3986,10 +4967,10 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
3986
4967
  '"'
3987
4968
  ]
3988
4969
  },
3989
- M
4970
+ T
3990
4971
  )) })
3991
4972
  ] }),
3992
- o.map((I, M) => /* @__PURE__ */ e(
4973
+ o.map((I, T) => /* @__PURE__ */ e(
3993
4974
  "div",
3994
4975
  {
3995
4976
  className: `flex ${I.role === "user" ? "justify-end" : "justify-start"}`,
@@ -4005,14 +4986,14 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4005
4986
  /* @__PURE__ */ e(
4006
4987
  "button",
4007
4988
  {
4008
- onClick: () => J(I.workflow),
4989
+ onClick: () => Q(I.workflow),
4009
4990
  className: "text-xs px-3 py-1 bg-teal-600 hover:bg-teal-700 text-white rounded transition-colors",
4010
4991
  children: "Apply to Canvas"
4011
4992
  }
4012
4993
  )
4013
4994
  ] }),
4014
4995
  /* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 rounded p-2 text-xs", children: /* @__PURE__ */ n("div", { className: "space-y-1", children: [
4015
- I.workflow.nodes.map((E, O) => /* @__PURE__ */ n(
4996
+ I.workflow.nodes.map((E, R) => /* @__PURE__ */ n(
4016
4997
  "div",
4017
4998
  {
4018
4999
  className: "flex items-center gap-2 text-gray-600 dark:text-zinc-300",
@@ -4025,7 +5006,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4025
5006
  ] })
4026
5007
  ]
4027
5008
  },
4028
- O
5009
+ R
4029
5010
  )),
4030
5011
  I.workflow.edges.length > 0 && /* @__PURE__ */ n("div", { className: "text-gray-400 dark:text-zinc-500 pt-1", children: [
4031
5012
  I.workflow.edges.length,
@@ -4038,9 +5019,9 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4038
5019
  }
4039
5020
  )
4040
5021
  },
4041
- M
5022
+ T
4042
5023
  )),
4043
- d && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
5024
+ l && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
4044
5025
  /* @__PURE__ */ n("div", { className: "flex space-x-1", children: [
4045
5026
  /* @__PURE__ */ e("div", { className: "w-2 h-2 bg-gray-400 dark:bg-zinc-500 rounded-full animate-bounce" }),
4046
5027
  /* @__PURE__ */ e(
@@ -4068,12 +5049,12 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4068
5049
  /* @__PURE__ */ e(
4069
5050
  "textarea",
4070
5051
  {
4071
- ref: L,
4072
- value: s,
5052
+ ref: A,
5053
+ value: i,
4073
5054
  onChange: (I) => p(I.target.value),
4074
- onKeyDown: R,
5055
+ onKeyDown: O,
4075
5056
  placeholder: u === !1 ? "AI generation not available" : "Describe what workflow you want to create...",
4076
- disabled: d || u === !1,
5057
+ disabled: l || u === !1,
4077
5058
  rows: 2,
4078
5059
  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"
4079
5060
  }
@@ -4082,7 +5063,7 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4082
5063
  "button",
4083
5064
  {
4084
5065
  onClick: S,
4085
- disabled: !s.trim() || d || u === !1,
5066
+ disabled: !i.trim() || l || u === !1,
4086
5067
  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",
4087
5068
  children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
4088
5069
  "path",
@@ -4100,75 +5081,75 @@ function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
4100
5081
  ] })
4101
5082
  ] }) }) : null;
4102
5083
  }
4103
- function Ot() {
4104
- const { screenToFlowPosition: r } = Pe(), l = f((i) => i.addNode), t = W(
4105
- (i) => {
4106
- i.preventDefault();
4107
- const s = i.dataTransfer.getData("application/json");
4108
- if (s)
5084
+ function or() {
5085
+ const { screenToFlowPosition: r } = De(), d = x((s) => s.addNode), t = L(
5086
+ (s) => {
5087
+ s.preventDefault();
5088
+ const i = s.dataTransfer.getData("application/json");
5089
+ if (i)
4109
5090
  try {
4110
- const p = JSON.parse(s), d = r({
4111
- x: i.clientX,
4112
- y: i.clientY
5091
+ const p = JSON.parse(i), l = r({
5092
+ x: s.clientX,
5093
+ y: s.clientY
4113
5094
  });
4114
- l(p, d);
5095
+ d(p, l);
4115
5096
  } catch (p) {
4116
5097
  console.error("Failed to parse dropped node:", p);
4117
5098
  }
4118
5099
  },
4119
- [l, r]
4120
- ), o = W((i) => {
4121
- i.preventDefault(), i.dataTransfer.dropEffect = "move";
5100
+ [d, r]
5101
+ ), o = L((s) => {
5102
+ s.preventDefault(), s.dataTransfer.dropEffect = "move";
4122
5103
  }, []);
4123
- return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: t, onDragOver: o, children: /* @__PURE__ */ e(ot, {}) });
5104
+ return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: t, onDragOver: o, children: /* @__PURE__ */ e(it, {}) });
4124
5105
  }
4125
- function _t() {
4126
- const [r, l] = C("editor"), [t, o] = C(!1), i = f((a) => a.loadTemplate), s = f((a) => a.loadGeneratedWorkflow);
5106
+ function ur() {
5107
+ const [r, d] = C("editor"), [t, o] = C(!1), s = x((a) => a.loadTemplate), i = x((a) => a.loadGeneratedWorkflow);
4127
5108
  U(() => {
4128
5109
  const m = new URLSearchParams(window.location.search).get("template");
4129
5110
  if (m) {
4130
- const c = pe(m);
4131
- c && (i(c), window.history.replaceState({}, "", window.location.pathname));
5111
+ const c = ge(m);
5112
+ c && (s(c), window.history.replaceState({}, "", window.location.pathname));
4132
5113
  }
4133
- }, [i]), U(() => {
5114
+ }, [s]), U(() => {
4134
5115
  const a = () => {
4135
- l("editor");
5116
+ d("editor");
4136
5117
  };
4137
5118
  return window.addEventListener("workflow-loaded", a), () => {
4138
5119
  window.removeEventListener("workflow-loaded", a);
4139
5120
  };
4140
5121
  }, []);
4141
- const p = W(
5122
+ const p = L(
4142
5123
  (a) => {
4143
- const m = pe(a);
4144
- m && (i(m), l("editor"));
5124
+ const m = ge(a);
5125
+ m && (s(m), d("editor"));
4145
5126
  },
4146
- [i]
4147
- ), d = W(
5127
+ [s]
5128
+ ), l = L(
4148
5129
  (a) => {
4149
- s(a), l("editor");
5130
+ i(a), d("editor");
4150
5131
  },
4151
- [s]
5132
+ [i]
4152
5133
  );
4153
- return /* @__PURE__ */ n(Ae, { children: [
4154
- /* @__PURE__ */ e(Tt, {}),
5134
+ return /* @__PURE__ */ n(Me, { children: [
5135
+ /* @__PURE__ */ e(rr, {}),
4155
5136
  /* @__PURE__ */ e(
4156
- Ut,
5137
+ ar,
4157
5138
  {
4158
5139
  isOpen: t,
4159
5140
  onClose: () => o(!1),
4160
- onApplyWorkflow: d
5141
+ onApplyWorkflow: l
4161
5142
  }
4162
5143
  ),
4163
- /* @__PURE__ */ e(Pt, {}),
5144
+ /* @__PURE__ */ e(Yt, {}),
4164
5145
  /* @__PURE__ */ n("div", { className: "h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
4165
- /* @__PURE__ */ e(ht, {}),
5146
+ /* @__PURE__ */ e(bt, {}),
4166
5147
  /* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
4167
5148
  /* @__PURE__ */ n("div", { className: "flex", children: [
4168
5149
  /* @__PURE__ */ e(
4169
5150
  "button",
4170
5151
  {
4171
- onClick: () => l("editor"),
5152
+ onClick: () => d("editor"),
4172
5153
  className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "editor" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
4173
5154
  children: "Editor"
4174
5155
  }
@@ -4176,7 +5157,7 @@ function _t() {
4176
5157
  /* @__PURE__ */ e(
4177
5158
  "button",
4178
5159
  {
4179
- onClick: () => l("gallery"),
5160
+ onClick: () => d("gallery"),
4180
5161
  className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "gallery" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
4181
5162
  children: "Images"
4182
5163
  }
@@ -4184,7 +5165,7 @@ function _t() {
4184
5165
  /* @__PURE__ */ e(
4185
5166
  "button",
4186
5167
  {
4187
- onClick: () => l("templates"),
5168
+ onClick: () => d("templates"),
4188
5169
  className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "templates" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
4189
5170
  children: "Templates"
4190
5171
  }
@@ -4211,34 +5192,35 @@ function _t() {
4211
5192
  )
4212
5193
  ] }) }),
4213
5194
  /* @__PURE__ */ n("div", { className: "flex-1 flex overflow-hidden", children: [
4214
- r === "editor" && /* @__PURE__ */ n(B, { children: [
4215
- /* @__PURE__ */ e(st, {}),
4216
- /* @__PURE__ */ e(Ot, {}),
4217
- /* @__PURE__ */ e(it, {})
5195
+ r === "editor" && /* @__PURE__ */ n(q, { children: [
5196
+ /* @__PURE__ */ e(dt, {}),
5197
+ /* @__PURE__ */ e(or, {}),
5198
+ /* @__PURE__ */ e(lt, {})
4218
5199
  ] }),
4219
5200
  r === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(xt, {}) }),
4220
- r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(Lt, { onSelect: p }) })
5201
+ r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(Kt, { onSelect: p }) })
4221
5202
  ] })
4222
5203
  ] })
4223
5204
  ] });
4224
5205
  }
4225
5206
  export {
4226
- Ut as AIChat,
4227
- Tt as AISettings,
4228
- _t as App,
5207
+ ar as AIChat,
5208
+ rr as AISettings,
5209
+ ur as App,
4229
5210
  xt as Gallery,
4230
- it as NodeInspector,
4231
- st as NodePalette,
4232
- Lt as TemplateGallery,
4233
- ht as Toolbar,
4234
- nt as UploadGallery,
4235
- ot as WorkflowEditor,
4236
- Pt as WorkflowLibrary,
4237
- St as getCategories,
4238
- pe as getTemplateById,
4239
- Ft as getTemplatesByCategory,
4240
- Ht as searchTemplates,
4241
- q as templates,
4242
- f as useWorkflowStore
5211
+ lt as NodeInspector,
5212
+ dt as NodePalette,
5213
+ Kt as TemplateGallery,
5214
+ bt as Toolbar,
5215
+ st as UploadGallery,
5216
+ it as WorkflowEditor,
5217
+ Yt as WorkflowLibrary,
5218
+ Ht as getCategories,
5219
+ cr as getTemplateById,
5220
+ mr as getTemplatesByCategory,
5221
+ ge as resolveTemplate,
5222
+ pr as searchTemplates,
5223
+ K as templates,
5224
+ x as useWorkflowStore
4243
5225
  };
4244
5226
  //# sourceMappingURL=index.js.map