@nodish/core 0.3.0 → 0.3.1

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,33 +1,33 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useCssVars as b, vModelText as x, watch as ee, withCtx as S, withDirectives as C, withModifiers as w } from "vue";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useCssVars as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withModifiers as T } from "vue";
2
2
  import './index.css';//#region src/store/graph/pruneConnections.ts
3
- function T(e, t) {
3
+ function E(e, t) {
4
4
  e.graph.connections = e.graph.connections.filter((e) => !(e.from.node === t.id && !t.outputs[e.from.port] || e.to.node === t.id && !t.inputs[e.to.port]));
5
5
  }
6
6
  //#endregion
7
7
  //#region src/store/graph/dynamicPorts.ts
8
- function E(e, t) {
8
+ function D(e, t) {
9
9
  return e.resolvePorts ? e.resolvePorts(t) : {
10
10
  inputs: e.inputs,
11
11
  outputs: e.outputs
12
12
  };
13
13
  }
14
- function D(e) {
14
+ function O(e) {
15
15
  let t = {};
16
16
  for (let n of Object.values(e.inputs)) n.userOnly && (t[n.name] = n.value);
17
17
  return t;
18
18
  }
19
- function te(e) {
19
+ function ee(e) {
20
20
  let t = {};
21
21
  for (let n of Object.values(e.inputs)) n.userOnly && (t[n.name] = n.defaultValue);
22
22
  return t;
23
23
  }
24
- function O(e, t, n) {
24
+ function k(e, t, n) {
25
25
  let r = {};
26
26
  for (let t of Object.values(e)) r[t.name] = t;
27
27
  let i = {};
28
28
  for (let e of Object.values(t)) {
29
29
  let t = r[e.name];
30
- if (t) t.type = e.type, t.types = e.types, t.userOnly = e.userOnly, t.multi = e.multi, t.widgetId = e.widgetId, t.customProps = e.customProps, i[t.id] = t;
30
+ if (t) t.type = e.type, t.types = e.types, t.userOnly = e.userOnly, t.multi = e.multi, t.widgetId = e.widgetId, t.connectionOnly = e.connectionOnly, t.customProps = e.customProps, i[t.id] = t;
31
31
  else {
32
32
  let t = crypto.randomUUID();
33
33
  i[t] = {
@@ -40,21 +40,22 @@ function O(e, t, n) {
40
40
  userOnly: e.userOnly,
41
41
  multi: e.multi,
42
42
  widgetId: e.widgetId,
43
+ connectionOnly: e.connectionOnly,
43
44
  customProps: e.customProps
44
45
  };
45
46
  }
46
47
  }
47
48
  return i;
48
49
  }
49
- function k(e, t) {
50
+ function A(e, t) {
50
51
  let n = e.nodeTypes[t.typeId];
51
52
  if (!n?.resolvePorts) return;
52
- let r = E(n, D(t));
53
- t.inputs = O(t.inputs, r.inputs, "input"), t.outputs = O(t.outputs, r.outputs, "output"), T(e, t);
53
+ let r = D(n, O(t));
54
+ t.inputs = k(t.inputs, r.inputs, "input"), t.outputs = k(t.outputs, r.outputs, "output"), E(e, t);
54
55
  }
55
56
  //#endregion
56
57
  //#region src/store/graph/expandIO.ts
57
- function A(e) {
58
+ function j(e) {
58
59
  let t = {};
59
60
  for (let [n, r] of Object.entries(e ?? {})) t[n] = {
60
61
  name: n,
@@ -64,39 +65,39 @@ function A(e) {
64
65
  }
65
66
  //#endregion
66
67
  //#region src/store/model.ts
67
- var j = {
68
+ var M = {
68
69
  parameters: {},
69
70
  returns: {}
70
71
  };
71
72
  //#endregion
72
73
  //#region src/store/registry/defineNode.ts
73
- function M(e) {
74
+ function N(e) {
74
75
  return {
75
76
  typeId: e.typeId,
76
77
  displayName: e.displayName,
77
78
  color: e.color ?? "#3a3f4b",
78
79
  description: e.description ?? "",
79
80
  group: e.group ?? [],
80
- inputs: A(e.inputs),
81
- outputs: A(e.outputs),
81
+ inputs: j(e.inputs),
82
+ outputs: j(e.outputs),
82
83
  execute: e.execute,
83
84
  graph: e.graph,
84
85
  resolvePorts: e.resolvePorts ? (t) => {
85
86
  let n = e.resolvePorts(t);
86
87
  return {
87
- inputs: A(n.inputs),
88
- outputs: A(n.outputs)
88
+ inputs: j(n.inputs),
89
+ outputs: j(n.outputs)
89
90
  };
90
91
  } : void 0
91
92
  };
92
93
  }
93
94
  //#endregion
94
95
  //#region src/store/registry/index.ts
95
- function N(e, t) {
96
+ function te(e, t) {
96
97
  Object.assign(e.types, t);
97
98
  }
98
99
  function P(e, t) {
99
- for (let [n, r] of Object.entries(t)) e.nodeTypes[n] = M(r);
100
+ for (let [n, r] of Object.entries(t)) e.nodeTypes[n] = N(r);
100
101
  }
101
102
  function F(e, t) {
102
103
  e.extensions.includes(t.id) || e.extensions.push(t.id);
@@ -117,13 +118,14 @@ function I(e, t) {
117
118
  userOnly: r.userOnly,
118
119
  multi: r.multi,
119
120
  widgetId: r.widgetId,
121
+ connectionOnly: r.connectionOnly,
120
122
  customProps: r.customProps
121
123
  };
122
124
  }
123
125
  return n;
124
126
  }
125
127
  function L(e, t) {
126
- let { inputs: n, outputs: r } = E(e, te(e));
128
+ let { inputs: n, outputs: r } = D(e, ee(e));
127
129
  return {
128
130
  id: crypto.randomUUID(),
129
131
  typeId: e.typeId,
@@ -140,7 +142,7 @@ function R(e) {
140
142
  //#endregion
141
143
  //#region src/store/interface/graphInterface.ts
142
144
  var ne = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
143
- function z(e, t) {
145
+ function re(e, t) {
144
146
  let n = [], r = (t, r) => {
145
147
  let i = /* @__PURE__ */ new Set();
146
148
  for (let [a, o] of Object.entries(t ?? {})) ne.test(a) || n.push(`${r}: invalid port name "${a}"`), i.has(a) && n.push(`${r}: duplicate port name "${a}"`), i.add(a), e.types[o.type] || n.push(`${r}: unknown type "${o.type}" on port "${a}"`);
@@ -149,7 +151,7 @@ function z(e, t) {
149
151
  }
150
152
  //#endregion
151
153
  //#region src/store/nodes/io.ts
152
- var B = "io/input", V = "io/output", re = {
154
+ var z = "io/input", B = "io/output", ie = {
153
155
  input: {
154
156
  x: 40,
155
157
  y: 120
@@ -159,10 +161,10 @@ var B = "io/input", V = "io/output", re = {
159
161
  y: 130
160
162
  }
161
163
  };
162
- function ie(e = {}) {
164
+ function ae(e = {}) {
163
165
  return {
164
166
  input: {
165
- typeId: B,
167
+ typeId: z,
166
168
  displayName: "Input",
167
169
  color: "#7a5a3a",
168
170
  description: "Graph inputs (function parameters).",
@@ -170,7 +172,7 @@ function ie(e = {}) {
170
172
  outputs: e.parameters
171
173
  },
172
174
  output: {
173
- typeId: V,
175
+ typeId: B,
174
176
  displayName: "Output",
175
177
  color: "#7a3a5a",
176
178
  description: "Graph outputs (function return values).",
@@ -179,59 +181,59 @@ function ie(e = {}) {
179
181
  }
180
182
  };
181
183
  }
182
- function ae(e, t) {
184
+ function V(e, t) {
183
185
  e.graphInterface = t;
184
- let n = ie(t);
186
+ let n = ae(t);
185
187
  P(e, {
186
188
  [n.input.typeId]: n.input,
187
189
  [n.output.typeId]: n.output
188
190
  });
189
191
  }
190
192
  function oe(e) {
191
- let t = e.graph.nodes.filter((e) => e.typeId === B), n = e.graph.nodes.filter((e) => e.typeId === V);
193
+ let t = e.graph.nodes.filter((e) => e.typeId === z), n = e.graph.nodes.filter((e) => e.typeId === B);
192
194
  if (t.length !== 1 || n.length !== 1) throw Error(`graph must have exactly one Input and one Output node (found ${t.length} input, ${n.length} output)`);
193
195
  return {
194
196
  input: t[0],
195
197
  output: n[0]
196
198
  };
197
199
  }
198
- function se(e, t = re) {
199
- let n = e.graph.nodes.filter((e) => e.typeId === B), r = e.graph.nodes.filter((e) => e.typeId === V);
200
+ function se(e, t = ie) {
201
+ let n = e.graph.nodes.filter((e) => e.typeId === z), r = e.graph.nodes.filter((e) => e.typeId === B);
200
202
  if (n.length > 1 || r.length > 1) throw Error(`graph must have exactly one Input and one Output node (found ${n.length} input, ${r.length} output)`);
201
- let i = n[0], a = r[0], o = ie(e.graphInterface);
202
- return i || (i = L(M(o.input), t.input), e.graph.nodes.push(i)), a || (a = L(M(o.output), t.output), e.graph.nodes.push(a)), {
203
+ let i = n[0], a = r[0], o = ae(e.graphInterface);
204
+ return i || (i = L(N(o.input), t.input), e.graph.nodes.push(i)), a || (a = L(N(o.output), t.output), e.graph.nodes.push(a)), {
203
205
  input: i,
204
206
  output: a
205
207
  };
206
208
  }
207
- function H(e, t) {
208
- let n = z(e, t);
209
+ function ce(e, t) {
210
+ let n = re(e, t);
209
211
  if (n.length) return n;
210
- ae(e, t);
212
+ V(e, t);
211
213
  let { input: r, output: i } = oe(e);
212
- r.outputs = O(r.outputs, A(t.parameters), "output");
214
+ r.outputs = k(r.outputs, j(t.parameters), "output");
213
215
  for (let n of Object.values(r.outputs)) {
214
216
  let r = t.parameters?.[n.name];
215
217
  if (!r) continue;
216
218
  let i = e.types[r.type];
217
219
  r.defaultValue === void 0 ? i && !i.validate(n.value) && (n.value = i.defaultValue) : n.value = r.defaultValue;
218
220
  }
219
- return i.inputs = O(i.inputs, A(t.returns), "input"), T(e, r), T(e, i), [];
221
+ return i.inputs = k(i.inputs, j(t.returns), "input"), E(e, r), E(e, i), [];
220
222
  }
221
- function ce(e) {
222
- let t = [], n = e.graph.nodes.filter((e) => e.typeId === B).length, r = e.graph.nodes.filter((e) => e.typeId === V).length;
223
+ function le(e) {
224
+ let t = [], n = e.graph.nodes.filter((e) => e.typeId === z).length, r = e.graph.nodes.filter((e) => e.typeId === B).length;
223
225
  return n === 0 ? t.push("graph has no Input node") : n > 1 && t.push("graph has multiple Input nodes"), r === 0 ? t.push("graph has no Output node") : r > 1 && t.push("graph has multiple Output nodes"), t;
224
226
  }
225
227
  //#endregion
226
228
  //#region src/store/composite/index.ts
227
- var U = "composite/group", le = {
228
- typeId: U,
229
+ var H = "composite/group", ue = {
230
+ typeId: H,
229
231
  displayName: "Group",
230
232
  color: "#4a5a6a",
231
233
  description: "A nested subgraph with its own inputs and outputs.",
232
234
  group: ["Custom nodes"]
233
235
  };
234
- function W(e, t) {
236
+ function U(e, t) {
235
237
  let n = t.composite;
236
238
  if (!n) throw Error("node has no composite state");
237
239
  let r = {
@@ -243,23 +245,23 @@ function W(e, t) {
243
245
  registrationMeta: e.registrationMeta,
244
246
  loadPack: (t) => e.loadPack(t)
245
247
  };
246
- return ae(r, n.interface), r;
248
+ return V(r, n.interface), r;
247
249
  }
248
- function ue(e, t) {
249
- let n = t.composite?.interface ?? j;
250
- t.inputs = O(t.inputs, A(n.parameters), "input"), t.outputs = O(t.outputs, A(n.returns), "output"), T(e, t);
250
+ function de(e, t) {
251
+ let n = t.composite?.interface ?? M;
252
+ t.inputs = k(t.inputs, j(n.parameters), "input"), t.outputs = k(t.outputs, j(n.returns), "output"), E(e, t);
251
253
  }
252
- function de(e, t, n = {}) {
253
- let r = H(e, t);
254
+ function W(e, t, n = {}) {
255
+ let r = ce(e, t);
254
256
  if (r.length) return r;
255
257
  let i = n.ownerComposite;
256
- return i?.composite && n.parentMap ? (i.composite.interface = t, ue(n.parentMap, i)) : e.graphInterface = t, [];
258
+ return i?.composite && n.parentMap ? (i.composite.interface = t, de(n.parentMap, i)) : e.graphInterface = t, [];
257
259
  }
258
260
  function fe(e) {
259
261
  let t = {};
260
262
  return {
261
- inputs: O(t, A(e.parameters), "input"),
262
- outputs: O(t, A(e.returns), "output")
263
+ inputs: k(t, j(e.parameters), "input"),
264
+ outputs: k(t, j(e.returns), "output")
263
265
  };
264
266
  }
265
267
  function pe(e, t) {
@@ -275,17 +277,17 @@ function pe(e, t) {
275
277
  registrationMeta: e.registrationMeta,
276
278
  loadPack: (t) => e.loadPack(t)
277
279
  };
278
- return ae(n, n.graphInterface), se(n, re), {
280
+ return V(n, n.graphInterface), se(n, ie), {
279
281
  graph: R(n.graph),
280
282
  interface: R(n.graphInterface)
281
283
  };
282
284
  }
283
285
  function me(e, t) {
284
- e.nodeTypes["composite/group"] || P(e, { [U]: le });
285
- let n = R(j), r = pe(e, n), { inputs: i, outputs: a } = fe(n);
286
+ e.nodeTypes["composite/group"] || P(e, { [H]: ue });
287
+ let n = R(M), r = pe(e, n), { inputs: i, outputs: a } = fe(n);
286
288
  return {
287
289
  id: crypto.randomUUID(),
288
- typeId: U,
290
+ typeId: H,
289
291
  location: t,
290
292
  inputs: i,
291
293
  outputs: a,
@@ -296,22 +298,69 @@ function he(e) {
296
298
  return e.typeId === "composite/group" && !!e.composite;
297
299
  }
298
300
  //#endregion
301
+ //#region src/store/types/effectiveWidget.ts
302
+ function G(e, t) {
303
+ let n = e?.[t];
304
+ return typeof n == "number" ? n : void 0;
305
+ }
306
+ function ge(e, t) {
307
+ if (!(!e || e.id !== t.type)) return e;
308
+ }
309
+ function K(e, t) {
310
+ let n = t.widgetId ?? e.defaultWidget ?? "default";
311
+ return e.widgets?.[n] || (e.widgets?.default ? e.widgets.default : e.widget);
312
+ }
313
+ function _e(e, t) {
314
+ let n = ge(e, t), r = n ? K(n, t) : void 0, i = t.customProps;
315
+ if (!(!r && !i)) return r ? r.kind === "none" ? {
316
+ kind: "none",
317
+ rowHeight: G(i, "rowHeight") ?? r.rowHeight
318
+ } : r.kind === "number" ? {
319
+ kind: "number",
320
+ min: G(i, "min") ?? r.min,
321
+ max: G(i, "max") ?? r.max,
322
+ step: G(i, "step") ?? r.step,
323
+ rowHeight: G(i, "rowHeight") ?? r.rowHeight
324
+ } : r.kind === "text" ? {
325
+ kind: "text",
326
+ rows: G(i, "rows") ?? r.rows,
327
+ rowHeight: G(i, "rowHeight") ?? r.rowHeight
328
+ } : {
329
+ kind: "custom",
330
+ componentId: r.componentId,
331
+ rowHeight: G(i, "rowHeight") ?? r.rowHeight
332
+ } : i?.min !== void 0 || i?.max !== void 0 || G(i, "rowHeight") !== void 0 ? {
333
+ kind: "number",
334
+ min: G(i, "min"),
335
+ max: G(i, "max"),
336
+ step: G(i, "step"),
337
+ rowHeight: G(i, "rowHeight")
338
+ } : G(i, "rows") !== void 0 || G(i, "rowHeight") !== void 0 ? {
339
+ kind: "text",
340
+ rows: G(i, "rows"),
341
+ rowHeight: G(i, "rowHeight")
342
+ } : void 0;
343
+ }
344
+ function q(e, t) {
345
+ return e ? e.rowHeight === void 0 ? e.kind === "text" ? (e.rows ?? 1) * t : t : e.rowHeight : t;
346
+ }
347
+ //#endregion
299
348
  //#region src/store/graph/portTypes.ts
300
- function G(e) {
349
+ function ve(e) {
301
350
  return e.types ?? [e.type];
302
351
  }
303
- function ge(e) {
304
- return G(e).length > 1;
352
+ function ye(e) {
353
+ return ve(e).length > 1;
305
354
  }
306
- function K(e) {
307
- return ge(e);
355
+ function J(e, t) {
356
+ return !!(e.connectionOnly || ye(e) || t && _e(t, e)?.kind === "none");
308
357
  }
309
358
  //#endregion
310
359
  //#region src/store/graph/evaluate.ts
311
- function _e(e) {
360
+ function Y(e) {
312
361
  return e instanceof Error ? e.message : String(e);
313
362
  }
314
- function ve(e, t = {}) {
363
+ function be(e, t = {}) {
315
364
  let n = {};
316
365
  for (let t of e.graph.nodes) n[t.id] = t;
317
366
  let r = /* @__PURE__ */ new Map();
@@ -321,7 +370,7 @@ function ve(e, t = {}) {
321
370
  }
322
371
  let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = {};
323
372
  function s(e, t) {
324
- e.id in o || (o[e.id] = _e(t));
373
+ e.id in o || (o[e.id] = Y(t));
325
374
  }
326
375
  function c(e) {
327
376
  let t = n[e.node], r = t?.outputs[e.port];
@@ -333,7 +382,7 @@ function ve(e, t = {}) {
333
382
  let o = r.get(`${t.id}:${n.id}`) ?? [];
334
383
  if (n.multi) a[n.name] = o.map(c);
335
384
  else if (o.length) a[n.name] = c(o[0]);
336
- else if (K(n)) a[n.name] = void 0;
385
+ else if (J(n, e.types[n.type])) a[n.name] = void 0;
337
386
  else {
338
387
  let t = n.value;
339
388
  t === void 0 && i && (t = e.types[n.type]?.defaultValue);
@@ -353,7 +402,7 @@ function ve(e, t = {}) {
353
402
  o = {};
354
403
  for (let e of Object.values(n.outputs)) o[e.name] = e.name in t ? t[e.name] : e.value;
355
404
  } else if (he(n)) {
356
- let t = ve(W(e, n), l(n));
405
+ let t = be(U(e, n), l(n));
357
406
  for (let e of Object.values(t.errors)) {
358
407
  s(n, Error(e));
359
408
  break;
@@ -370,7 +419,7 @@ function ve(e, t = {}) {
370
419
  }
371
420
  return a.delete(n.id), i.set(n.id, o), o;
372
421
  }
373
- let d = e.graph.nodes.find((e) => e.typeId === V);
422
+ let d = e.graph.nodes.find((e) => e.typeId === B);
374
423
  return {
375
424
  values: d ? l(d, { useDefaults: !1 }) : {},
376
425
  errors: o
@@ -378,14 +427,14 @@ function ve(e, t = {}) {
378
427
  }
379
428
  //#endregion
380
429
  //#region src/store/graph/connect.ts
381
- function ye(e, t, n) {
430
+ function xe(e, t, n) {
382
431
  let r = e.types[n];
383
432
  return r && r.accepts ? r.accepts(t) : t === n;
384
433
  }
385
- function q(e, t, n) {
386
- return G(n).some((n) => ye(e, t, n));
434
+ function Se(e, t, n) {
435
+ return ve(n).some((n) => xe(e, t, n));
387
436
  }
388
- function be(e, t) {
437
+ function Ce(e, t) {
389
438
  let n = /* @__PURE__ */ new Map();
390
439
  for (let t of e.graph.connections) {
391
440
  let e = n.get(t.to.node) ?? [];
@@ -401,7 +450,7 @@ function be(e, t) {
401
450
  }
402
451
  return [...r];
403
452
  }
404
- function xe(e, t) {
453
+ function we(e, t) {
405
454
  let n = /* @__PURE__ */ new Map();
406
455
  for (let t of e.graph.connections) {
407
456
  let e = n.get(t.from.node) ?? [];
@@ -417,16 +466,16 @@ function xe(e, t) {
417
466
  }
418
467
  return [...r];
419
468
  }
420
- function J(e, t, n) {
421
- return xe(e, n.node).includes(t.node);
469
+ function Te(e, t, n) {
470
+ return we(e, n.node).includes(t.node);
422
471
  }
423
- function Se(e, t, n) {
472
+ function Ee(e, t, n) {
424
473
  if (t.node === n.node) return !1;
425
474
  let r = e.graph.nodes.find((e) => e.id === t.node), i = e.graph.nodes.find((e) => e.id === n.node), a = r?.outputs[t.port], o = i?.inputs[n.port];
426
- return !a || !o || o.userOnly || J(e, t, n) ? !1 : q(e, a.type, o);
475
+ return !a || !o || o.userOnly || Te(e, t, n) ? !1 : Se(e, a.type, o);
427
476
  }
428
- function Ce(e, t, n) {
429
- if (!Se(e, t, n)) return null;
477
+ function De(e, t, n) {
478
+ if (!Ee(e, t, n)) return null;
430
479
  let r = e.graph.connections.find((e) => e.from.node === t.node && e.from.port === t.port && e.to.node === n.node && e.to.port === n.port);
431
480
  if (r) return r;
432
481
  e.graph.nodes.find((e) => e.id === n.node)?.inputs[n.port]?.multi || (e.graph.connections = e.graph.connections.filter((e) => !(e.to.node === n.node && e.to.port === n.port)));
@@ -437,26 +486,106 @@ function Ce(e, t, n) {
437
486
  };
438
487
  return e.graph.connections.push(i), i;
439
488
  }
440
- function we(e, t) {
489
+ function Oe(e, t) {
441
490
  e.graph.connections = e.graph.connections.filter((e) => e.id !== t);
442
491
  }
443
492
  //#endregion
444
493
  //#region src/store/graph/removeNode.ts
445
- function Te(e, t) {
494
+ function ke(e, t) {
446
495
  let n = e.graph.nodes.find((e) => e.id === t);
447
496
  return n ? n.typeId !== "io/input" && n.typeId !== "io/output" : !1;
448
497
  }
449
- function Ee(e, t) {
450
- Te(e, t) && (e.graph.nodes = e.graph.nodes.filter((e) => e.id !== t), e.graph.connections = e.graph.connections.filter((e) => e.from.node !== t && e.to.node !== t));
498
+ function Ae(e, t) {
499
+ ke(e, t) && (e.graph.nodes = e.graph.nodes.filter((e) => e.id !== t), e.graph.connections = e.graph.connections.filter((e) => e.from.node !== t && e.to.node !== t));
500
+ }
501
+ //#endregion
502
+ //#region src/store/graph/duplicateSelection.ts
503
+ function je(e) {
504
+ return e.typeId !== "io/input" && e.typeId !== "io/output";
505
+ }
506
+ function Me(e, t) {
507
+ return `${e}:${t}`;
508
+ }
509
+ function Ne(e, t, n) {
510
+ let r = {};
511
+ for (let [i, a] of Object.entries(e)) {
512
+ let e = crypto.randomUUID();
513
+ n.set(Me(t, i), e), r[e] = {
514
+ ...a,
515
+ id: e
516
+ };
517
+ }
518
+ return r;
519
+ }
520
+ function Pe(e, t, n) {
521
+ return {
522
+ nodes: e.nodes.map((e) => Fe(e, t, n, null)),
523
+ connections: e.connections.map((e) => X(e, t, n))
524
+ };
525
+ }
526
+ function X(e, t, n) {
527
+ return {
528
+ id: crypto.randomUUID(),
529
+ from: {
530
+ node: t.get(e.from.node),
531
+ port: n.get(Me(e.from.node, e.from.port))
532
+ },
533
+ to: {
534
+ node: t.get(e.to.node),
535
+ port: n.get(Me(e.to.node, e.to.port))
536
+ }
537
+ };
538
+ }
539
+ function Fe(e, t, n, r) {
540
+ let i = e.id, a = crypto.randomUUID();
541
+ t.set(i, a);
542
+ let o = R(e), s = {
543
+ ...o,
544
+ id: a,
545
+ location: r ?? o.location,
546
+ inputs: Ne(o.inputs, i, n),
547
+ outputs: Ne(o.outputs, i, n),
548
+ z: void 0
549
+ };
550
+ return o.composite && (s.composite = {
551
+ interface: R(o.composite.interface),
552
+ graph: Pe(o.composite.graph, t, n)
553
+ }), s;
554
+ }
555
+ function Ie(e, t, n) {
556
+ let r = e.filter(je);
557
+ if (!r.length) return null;
558
+ let i = new Set(r.map((e) => e.id)), a = t.filter((e) => i.has(e.from.node) && i.has(e.to.node)), o = {};
559
+ return {
560
+ nodes: r.map((e) => (o[e.id] = {
561
+ x: e.location.x - n.x,
562
+ y: e.location.y - n.y
563
+ }, R(e))),
564
+ connections: R(a),
565
+ offsets: o
566
+ };
567
+ }
568
+ function Le(e, t, n) {
569
+ let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = t.nodes.map((e) => {
570
+ let a = t.offsets[e.id] ?? {
571
+ x: 0,
572
+ y: 0
573
+ };
574
+ return Fe(e, r, i, {
575
+ x: n.x + a.x,
576
+ y: n.y + a.y
577
+ });
578
+ }), o = t.connections.map((e) => X(e, r, i));
579
+ return e.graph.nodes.push(...a), e.graph.connections.push(...o), a.map((e) => e.id);
451
580
  }
452
581
  //#endregion
453
582
  //#region src/store/graph/stacking.ts
454
- function De(e) {
583
+ function Re(e) {
455
584
  let t = 0;
456
585
  for (let n of e.graph.nodes) t = Math.max(t, n.z ?? 0);
457
586
  return t;
458
587
  }
459
- function Oe(e) {
588
+ function ze(e) {
460
589
  e.graph.nodes.map((e, t) => ({
461
590
  n: e,
462
591
  i: t
@@ -464,21 +593,21 @@ function Oe(e) {
464
593
  e.n.z = t + 1;
465
594
  });
466
595
  }
467
- function ke(e) {
596
+ function Be(e) {
468
597
  if (e.graph.nodes.length === 0) return;
469
598
  let t = !1;
470
599
  for (let n of e.graph.nodes) n.z === void 0 && (n.z = Math.random(), t = !0);
471
- t && Oe(e);
600
+ t && ze(e);
472
601
  }
473
- function Ae(e, t) {
602
+ function Ve(e, t) {
474
603
  let n = e.graph.nodes.find((e) => e.id === t);
475
604
  if (!n) return;
476
- let r = De(e);
605
+ let r = Re(e);
477
606
  (n.z ?? 0) >= r || (n.z = r + 1);
478
607
  }
479
608
  //#endregion
480
609
  //#region src/store/composite/editContext.ts
481
- function je(e, t, n) {
610
+ function He(e, t, n) {
482
611
  let r = e;
483
612
  for (let i = 0; i <= n; i++) {
484
613
  let a = t[i];
@@ -487,23 +616,23 @@ function je(e, t, n) {
487
616
  if (!o) return null;
488
617
  if (i === n) return o;
489
618
  if (!o.composite) return null;
490
- r = W(e, o);
619
+ r = U(e, o);
491
620
  }
492
621
  return null;
493
622
  }
494
- function Me(e, t) {
495
- return t.length ? je(e, t, t.length - 1) : null;
623
+ function Ue(e, t) {
624
+ return t.length ? He(e, t, t.length - 1) : null;
496
625
  }
497
- function Ne(e, t) {
626
+ function We(e, t) {
498
627
  if (!t.length) return { activeMap: e };
499
628
  let n = e, r;
500
629
  for (let i = 0; i < t.length; i++) {
501
630
  let a = t[i];
502
631
  if (r = n.graph.nodes.find((e) => e.id === a.compositeNodeId), !r?.composite) return { activeMap: e };
503
- i < t.length - 1 && (n = W(e, r));
632
+ i < t.length - 1 && (n = U(e, r));
504
633
  }
505
634
  return {
506
- activeMap: W(e, r),
635
+ activeMap: U(e, r),
507
636
  interfaceOptions: {
508
637
  ownerComposite: r,
509
638
  parentMap: n
@@ -512,112 +641,68 @@ function Ne(e, t) {
512
641
  }
513
642
  //#endregion
514
643
  //#region src/store/interface/editor.ts
515
- function Pe(e, t) {
644
+ function Ge(e, t) {
516
645
  if (!t.length) return e.graphInterface;
517
- let n = Me(e, t);
646
+ let n = Ue(e, t);
518
647
  return n?.composite ? n.composite.interface : e.graphInterface;
519
648
  }
520
- function Fe(e, t, n) {
521
- let r = Pe(e, t);
649
+ function Ke(e, t, n) {
650
+ let r = Ge(e, t);
522
651
  n(r);
523
- let i = Ne(e, t);
524
- return de(i.activeMap, r, i.interfaceOptions ?? {});
652
+ let i = We(e, t);
653
+ return W(i.activeMap, r, i.interfaceOptions ?? {});
525
654
  }
526
655
  //#endregion
527
656
  //#region src/store/composite/guards.ts
528
- function Y(e, t, n) {
529
- for (let r of e.nodes) if (r.id === t || n && r.composite?.graph && Y(r.composite.graph, t, !0)) return !0;
657
+ function Z(e, t, n) {
658
+ for (let r of e.nodes) if (r.id === t || n && r.composite?.graph && Z(r.composite.graph, t, !0)) return !0;
530
659
  return !1;
531
660
  }
532
- function Ie(e) {
661
+ function qe(e) {
533
662
  return e.map((e) => e.compositeNodeId);
534
663
  }
535
- function Le(e, t) {
536
- let n = new Set(Ie(t)), r = Me(e, t);
664
+ function Je(e, t) {
665
+ let n = new Set(qe(t)), r = Ue(e, t);
537
666
  return r && n.add(r.id), n;
538
667
  }
539
- function Re(e, t, n) {
540
- for (let r of Le(e, t)) if (Y(n, r, !0)) return "A group cannot be placed inside itself";
668
+ function Ye(e, t, n) {
669
+ for (let r of Je(e, t)) if (Z(n, r, !0)) return "A group cannot be placed inside itself";
541
670
  return null;
542
671
  }
543
- function ze(e, t, n) {
672
+ function Xe(e, t, n) {
544
673
  if (!he(n)) return "Not a group node";
545
674
  if (t.some((e) => e.compositeNodeId === n.id)) return "Already editing this group";
546
- let r = Le(e, t);
675
+ let r = Je(e, t);
547
676
  if (r.add(n.id), n.composite?.graph) {
548
- for (let e of r) if (Y(n.composite.graph, e, !0)) return "Cannot open a group that contains an ancestor";
677
+ for (let e of r) if (Z(n.composite.graph, e, !0)) return "Cannot open a group that contains an ancestor";
549
678
  }
550
679
  return null;
551
680
  }
552
- function Be(e, t, n, r) {
681
+ function Ze(e, t, n, r) {
553
682
  if (!he(n) || !n.composite) return null;
554
- let i = Le(e, t);
683
+ let i = Je(e, t);
555
684
  if (i.has(n.id)) return "A group cannot be placed inside itself";
556
- for (let e of i) if (Y(r, e, !1)) return "A group cannot be placed inside itself";
685
+ for (let e of i) if (Z(r, e, !1)) return "A group cannot be placed inside itself";
557
686
  for (let r = 0; r < t.length; r++) {
558
- let i = je(e, t, r);
687
+ let i = He(e, t, r);
559
688
  if (i?.composite?.graph === n.composite.graph) return "A group cannot share the same interior as an ancestor";
560
689
  if (i && n.composite.graph === i.composite?.graph) return "A group cannot be placed inside itself";
561
690
  }
562
- if (Y(n.composite.graph, n.id, !0)) return "A group cannot contain itself";
563
- for (let e of i) if (Y(n.composite.graph, e, !0)) return "A group cannot contain an ancestor";
564
- let a = Me(e, t);
565
- return a?.composite && n.composite.graph === a.composite.graph ? "A group cannot be placed inside itself" : Re(e, t, r);
566
- }
567
- //#endregion
568
- //#region src/store/types/effectiveWidget.ts
569
- function X(e, t) {
570
- let n = e?.[t];
571
- return typeof n == "number" ? n : void 0;
572
- }
573
- function Z(e, t) {
574
- if (!(!e || e.id !== t.type)) return e;
575
- }
576
- function Ve(e, t) {
577
- let n = t.widgetId ?? e.defaultWidget ?? "default";
578
- return e.widgets?.[n] || (e.widgets?.default ? e.widgets.default : e.widget);
579
- }
580
- function He(e, t) {
581
- let n = Z(e, t), r = n ? Ve(n, t) : void 0, i = t.customProps;
582
- if (!(!r && !i)) return r ? r.kind === "number" ? {
583
- kind: "number",
584
- min: X(i, "min") ?? r.min,
585
- max: X(i, "max") ?? r.max,
586
- step: X(i, "step") ?? r.step,
587
- rowHeight: X(i, "rowHeight") ?? r.rowHeight
588
- } : r.kind === "text" ? {
589
- kind: "text",
590
- rows: X(i, "rows") ?? r.rows,
591
- rowHeight: X(i, "rowHeight") ?? r.rowHeight
592
- } : {
593
- kind: "custom",
594
- componentId: r.componentId,
595
- rowHeight: X(i, "rowHeight") ?? r.rowHeight
596
- } : i?.min !== void 0 || i?.max !== void 0 || X(i, "rowHeight") !== void 0 ? {
597
- kind: "number",
598
- min: X(i, "min"),
599
- max: X(i, "max"),
600
- step: X(i, "step"),
601
- rowHeight: X(i, "rowHeight")
602
- } : X(i, "rows") !== void 0 || X(i, "rowHeight") !== void 0 ? {
603
- kind: "text",
604
- rows: X(i, "rows"),
605
- rowHeight: X(i, "rowHeight")
606
- } : void 0;
607
- }
608
- function Ue(e, t) {
609
- return e ? e.rowHeight === void 0 ? e.kind === "text" ? (e.rows ?? 1) * t : t : e.rowHeight : t;
691
+ if (Z(n.composite.graph, n.id, !0)) return "A group cannot contain itself";
692
+ for (let e of i) if (Z(n.composite.graph, e, !0)) return "A group cannot contain an ancestor";
693
+ let a = Ue(e, t);
694
+ return a?.composite && n.composite.graph === a.composite.graph ? "A group cannot be placed inside itself" : Ye(e, t, r);
610
695
  }
611
696
  //#endregion
612
697
  //#region src/components/types/NumberWidget.vue?vue&type=script&setup=true&lang.ts
613
- var We = [
698
+ var Qe = [
614
699
  "value",
615
700
  "placeholder",
616
701
  "title",
617
702
  "min",
618
703
  "max",
619
704
  "step"
620
- ], Ge = /*@__PURE__*/ s({
705
+ ], $e = /*@__PURE__*/ s({
621
706
  __name: "NumberWidget",
622
707
  props: {
623
708
  port: {},
@@ -655,14 +740,14 @@ var We = [
655
740
  step: y(o).kind === "number" ? y(o).step : void 0,
656
741
  onInput: c,
657
742
  onChange: l,
658
- onPointerdown: n[0] ||= w(() => {}, ["stop"])
659
- }, null, 40, We));
743
+ onPointerdown: n[0] ||= T(() => {}, ["stop"])
744
+ }, null, 40, Qe));
660
745
  }
661
746
  }), Q = (e, t) => {
662
747
  let n = e.__vccOpts || e;
663
748
  for (let [e, r] of t) n[e] = r;
664
749
  return n;
665
- }, Ke = /*#__PURE__*/ Q(Ge, [["__scopeId", "data-v-4459e34d"]]), qe = ["title"], Je = /*#__PURE__*/ Q(/* @__PURE__ */ s({
750
+ }, et = /*#__PURE__*/ Q($e, [["__scopeId", "data-v-4459e34d"]]), tt = ["title"], nt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
666
751
  __name: "ReadonlyWidget",
667
752
  props: {
668
753
  port: {},
@@ -678,14 +763,14 @@ var We = [
678
763
  return (t, n) => (p(), i("span", {
679
764
  class: "field readonly",
680
765
  title: e.port.name
681
- }, v(r.value), 9, qe));
766
+ }, v(r.value), 9, tt));
682
767
  }
683
- }), [["__scopeId", "data-v-0d93d0ea"]]), Ye = [
768
+ }), [["__scopeId", "data-v-0d93d0ea"]]), rt = [
684
769
  "value",
685
770
  "placeholder",
686
771
  "title",
687
772
  "rows"
688
- ], Xe = [
773
+ ], it = [
689
774
  "value",
690
775
  "placeholder",
691
776
  "title"
@@ -719,8 +804,8 @@ var We = [
719
804
  rows: c.value,
720
805
  onInput: l,
721
806
  onChange: u,
722
- onPointerdown: n[0] ||= w(() => {}, ["stop"])
723
- }, null, 40, Ye)) : (p(), i("input", {
807
+ onPointerdown: n[0] ||= T(() => {}, ["stop"])
808
+ }, null, 40, rt)) : (p(), i("input", {
724
809
  key: 1,
725
810
  class: "field",
726
811
  type: "text",
@@ -729,39 +814,39 @@ var We = [
729
814
  title: e.port.name,
730
815
  onInput: l,
731
816
  onChange: u,
732
- onPointerdown: n[1] ||= w(() => {}, ["stop"])
733
- }, null, 40, Xe));
817
+ onPointerdown: n[1] ||= T(() => {}, ["stop"])
818
+ }, null, 40, it));
734
819
  }
735
- }), [["__scopeId", "data-v-bf7ff881"]]), Ze = /* @__PURE__ */ new Map(), Qe = /* @__PURE__ */ new Map(), $e = {
736
- number: Ke,
820
+ }), [["__scopeId", "data-v-bf7ff881"]]), at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = {
821
+ number: et,
737
822
  text: $,
738
823
  custom: $
739
824
  };
740
- function et(e) {
741
- let t = Ze.get(e);
742
- return t || (t = /* @__PURE__ */ new Map(), Ze.set(e, t)), t;
825
+ function ct(e) {
826
+ let t = at.get(e);
827
+ return t || (t = /* @__PURE__ */ new Map(), at.set(e, t)), t;
743
828
  }
744
- function tt(e, t) {
829
+ function lt(e, t) {
745
830
  return t?.widgetId ?? e?.defaultWidget ?? "default";
746
831
  }
747
- function nt(e, t, n) {
832
+ function ut(e, t, n) {
748
833
  if (typeof t == "string") {
749
- et(e).set(t, n);
834
+ ct(e).set(t, n);
750
835
  return;
751
836
  }
752
- et(e).set("default", t);
837
+ ct(e).set("default", t);
753
838
  }
754
- function rt(e, t) {
755
- Qe.set(e, t);
839
+ function dt(e, t) {
840
+ ot.set(e, t);
756
841
  }
757
- function it(e, t, n, r) {
758
- if (n === "readonly") return Je;
759
- let i = r?.type ?? e?.id, a = e && e.id === i ? e : void 0, o = tt(a, r), s = i ? Ze.get(i) : void 0;
760
- return s?.has(o) ? s.get(o) : s?.has("default") ? s.get("default") : t?.kind === "custom" ? Qe.get(t.componentId) ?? $ : t?.kind ? $e[t.kind] ?? $ : a?.widget?.kind === "custom" ? Qe.get(a.widget.componentId) ?? $ : a?.widget?.kind ? $e[a.widget.kind] ?? $ : $;
842
+ function ft(e, t, n, r) {
843
+ if (n === "readonly") return nt;
844
+ let i = r?.type ?? e?.id, a = e && e.id === i ? e : void 0, o = lt(a, r), s = i ? at.get(i) : void 0;
845
+ return s?.has(o) ? s.get(o) : s?.has("default") ? s.get("default") : t?.kind === "none" ? $ : t?.kind === "custom" ? ot.get(t.componentId) ?? $ : t?.kind === "number" || t?.kind === "text" ? st[t.kind] ?? $ : a?.widget?.kind === "custom" ? ot.get(a.widget.componentId) ?? $ : a?.widget?.kind && a.widget.kind !== "none" ? st[a.widget.kind] ?? $ : $;
761
846
  }
762
847
  //#endregion
763
848
  //#region src/components/types/PortValueWidget.vue
764
- var at = /*#__PURE__*/ Q(/* @__PURE__ */ s({
849
+ var pt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
765
850
  __name: "PortValueWidget",
766
851
  props: {
767
852
  port: {},
@@ -773,7 +858,7 @@ var at = /*#__PURE__*/ Q(/* @__PURE__ */ s({
773
858
  },
774
859
  emits: ["update:value", "commit"],
775
860
  setup(e, { emit: r }) {
776
- let i = e, a = r, o = t(() => He(i.typeDef, i.port)), s = t(() => it(i.typeDef, o.value, i.mode, i.port)), c = t(() => {
861
+ let i = e, a = r, o = t(() => _e(i.typeDef, i.port)), s = t(() => ft(i.typeDef, o.value, i.mode, i.port)), c = t(() => {
777
862
  let e = o.value, t = i.port.type, n = i.port.widgetId ?? "default";
778
863
  return i.mode === "readonly" ? `readonly:${t}` : e?.kind === "custom" ? `${t}:${n}:custom:${e.componentId}` : `${t}:${n}:${e?.kind ?? "text"}`;
779
864
  });
@@ -796,47 +881,47 @@ var at = /*#__PURE__*/ Q(/* @__PURE__ */ s({
796
881
  ]));
797
882
  }
798
883
  }), [["__scopeId", "data-v-b4dc9bc0"]]);
799
- function ot(e) {
884
+ function mt(e) {
800
885
  return Math.max(20, Math.min(240, e));
801
886
  }
802
- function st(e, t) {
887
+ function ht(e, t) {
803
888
  let n = e.customProps?.rowHeight;
804
- return ot(typeof n == "number" && n > 0 ? n : Ue(He(t, e), 20));
889
+ return mt(typeof n == "number" && n > 0 ? n : q(_e(t, e), 20));
805
890
  }
806
- function ct(e, t) {
891
+ function gt(e, t) {
807
892
  let n = 0;
808
- for (let r of e) n += st(r, t?.(r));
893
+ for (let r of e) n += ht(r, t?.(r));
809
894
  return n;
810
895
  }
811
- function lt(e) {
896
+ function _t(e) {
812
897
  return e.width ?? 100;
813
898
  }
814
- function ut(e, t) {
815
- let n = ct(Object.values(e.inputs), t), r = ct(Object.values(e.outputs), t);
899
+ function vt(e, t) {
900
+ let n = gt(Object.values(e.inputs), t), r = gt(Object.values(e.outputs), t);
816
901
  return 20 + Math.max(n, r);
817
902
  }
818
- function dt(e, t, n) {
903
+ function yt(e, t, n) {
819
904
  let r = 20;
820
905
  for (let i of e) {
821
- let e = st(i, n?.(i));
906
+ let e = ht(i, n?.(i));
822
907
  if (i.id === t) return r + e / 2;
823
908
  r += e;
824
909
  }
825
910
  return null;
826
911
  }
827
- function ft(e, t, n) {
828
- let r = dt(Object.values(e.inputs), t, n);
912
+ function bt(e, t, n) {
913
+ let r = yt(Object.values(e.inputs), t, n);
829
914
  if (r !== null) return {
830
915
  x: e.location.x,
831
916
  y: e.location.y + r
832
917
  };
833
- let i = dt(Object.values(e.outputs), t, n);
918
+ let i = yt(Object.values(e.outputs), t, n);
834
919
  return i === null ? null : {
835
- x: e.location.x + lt(e),
920
+ x: e.location.x + _t(e),
836
921
  y: e.location.y + i
837
922
  };
838
923
  }
839
- function pt(e, t) {
924
+ function xt(e, t) {
840
925
  let n = Math.max(40, Math.abs(t.x - e.x) * .5);
841
926
  return [{
842
927
  x: e.x + n,
@@ -846,12 +931,12 @@ function pt(e, t) {
846
931
  y: t.y
847
932
  }];
848
933
  }
849
- function mt(e, t) {
850
- let [n, r] = pt(e, t);
934
+ function St(e, t) {
935
+ let [n, r] = xt(e, t);
851
936
  return `M ${e.x} ${e.y} C ${n.x} ${n.y}, ${r.x} ${r.y}, ${t.x} ${t.y}`;
852
937
  }
853
- function ht(e, t, n = 16) {
854
- let [r, i] = pt(e, t), a = [];
938
+ function Ct(e, t, n = 16) {
939
+ let [r, i] = xt(e, t), a = [];
855
940
  for (let o = 0; o <= n; o++) {
856
941
  let s = o / n, c = 1 - s, l = c * c * c * e.x + 3 * c * c * s * r.x + 3 * c * s * s * i.x + s * s * s * t.x, u = c * c * c * e.y + 3 * c * c * s * r.y + 3 * c * s * s * i.y + s * s * s * t.y;
857
942
  a.push({
@@ -861,7 +946,7 @@ function ht(e, t, n = 16) {
861
946
  }
862
947
  return a;
863
948
  }
864
- function gt(e, t, n, r) {
949
+ function wt(e, t, n, r) {
865
950
  let i = t.x - e.x, a = t.y - e.y, o = r.x - n.x, s = r.y - n.y, c = i * s - a * o;
866
951
  if (c === 0) return !1;
867
952
  let l = n.x - e.x, u = n.y - e.y, d = (l * s - u * o) / c, f = (l * a - u * i) / c;
@@ -869,10 +954,10 @@ function gt(e, t, n, r) {
869
954
  }
870
955
  //#endregion
871
956
  //#region src/components/NodePort.vue?vue&type=script&setup=true&lang.ts
872
- var _t = ["title"], vt = {
957
+ var Tt = ["title"], Et = {
873
958
  key: 2,
874
959
  class: "label"
875
- }, yt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
960
+ }, Dt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
876
961
  __name: "NodePort",
877
962
  props: {
878
963
  port: {},
@@ -888,19 +973,19 @@ var _t = ["title"], vt = {
888
973
  },
889
974
  emits: ["connectStart", "valueChange"],
890
975
  setup(e, { emit: a }) {
891
- b((e) => ({ v4929e218: o }));
976
+ b((e) => ({ v3fd6b92b: o }));
892
977
  let o = "11px", s = e, c = a;
893
978
  function d(e) {
894
979
  e.button === 0 && c("connectStart", s.port, e);
895
980
  }
896
- let f = t(() => st(s.port, s.typeDef)), m = t(() => He(s.typeDef, s.port)), h = t(() => {
981
+ let f = t(() => ht(s.port, s.typeDef)), m = t(() => _e(s.typeDef, s.port)), h = t(() => {
897
982
  let e = s.typeDef?.label ?? s.port.type;
898
983
  return `${s.port.name} (${e})`;
899
- }), g = t(() => !K(s.port) && (s.widgetMode === "editable" || s.side === "in" && !!s.port.userOnly || s.widgetMode === "auto" && s.side === "in" && !s.connected && !s.port.multi)), _ = t(() => s.widgetMode === "readonly"), y = t(() => s.side === "in" && !s.port.userOnly), x = t(() => g.value || _.value), ee = t(() => _.value ? "readonly" : "editable");
900
- function S(e) {
984
+ }), g = t(() => !J(s.port, s.typeDef) && (s.widgetMode === "editable" || s.side === "in" && !!s.port.userOnly || s.widgetMode === "auto" && s.side === "in" && !s.connected && !s.port.multi)), _ = t(() => s.widgetMode === "readonly"), y = t(() => s.side === "in" && !s.port.userOnly), x = t(() => g.value || _.value), S = t(() => _.value ? "readonly" : "editable");
985
+ function C(e) {
901
986
  s.port.value = e, c("valueChange", s.port);
902
987
  }
903
- function C() {
988
+ function w() {
904
989
  s.typeDef?.coerce && (s.port.value = s.typeDef.coerce(s.port.value), c("valueChange", s.port));
905
990
  }
906
991
  return (t, a) => (p(), i("div", {
@@ -915,18 +1000,18 @@ var _t = ["title"], vt = {
915
1000
  class: l(["socket", { multi: e.port.multi }]),
916
1001
  style: u({ background: e.color }),
917
1002
  title: e.port.multi ? `${e.port.name} (accepts many)` : e.port.name,
918
- onPointerdown: w(d, ["stop"])
919
- }, null, 46, _t)) : r("", !0),
920
- x.value ? (p(), n(at, {
1003
+ onPointerdown: T(d, ["stop"])
1004
+ }, null, 46, Tt)) : r("", !0),
1005
+ x.value ? (p(), n(pt, {
921
1006
  key: `${e.port.id}-${e.port.type}`,
922
1007
  port: e.port,
923
1008
  "type-def": e.typeDef,
924
1009
  "effective-widget": m.value,
925
- mode: ee.value,
1010
+ mode: S.value,
926
1011
  "display-value": e.displayValue,
927
1012
  placeholder: h.value,
928
- "onUpdate:value": S,
929
- onCommit: C
1013
+ "onUpdate:value": C,
1014
+ onCommit: w
930
1015
  }, null, 8, [
931
1016
  "port",
932
1017
  "type-def",
@@ -934,22 +1019,22 @@ var _t = ["title"], vt = {
934
1019
  "mode",
935
1020
  "display-value",
936
1021
  "placeholder"
937
- ])) : (p(), i("span", vt, v(e.port.name), 1)),
1022
+ ])) : (p(), i("span", Et, v(e.port.name), 1)),
938
1023
  e.side === "out" ? (p(), i("span", {
939
1024
  key: 3,
940
1025
  class: "socket",
941
1026
  style: u({ background: e.color }),
942
- onPointerdown: w(d, ["stop"])
1027
+ onPointerdown: T(d, ["stop"])
943
1028
  }, null, 36)) : r("", !0)
944
1029
  ], 6));
945
1030
  }
946
- }), [["__scopeId", "data-v-cadec420"]]), bt = ["title"], xt = { class: "title" }, St = {
1031
+ }), [["__scopeId", "data-v-15071e28"]]), Ot = ["title"], kt = { class: "title" }, At = {
947
1032
  class: "grip",
948
1033
  title: "Drag"
949
- }, Ct = { class: "body" }, wt = {
1034
+ }, jt = { class: "body" }, Mt = {
950
1035
  key: 0,
951
1036
  class: "col input"
952
- }, Tt = 4, Et = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1037
+ }, Nt = 4, Pt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
953
1038
  __name: "GraphNode",
954
1039
  props: {
955
1040
  node: {},
@@ -985,26 +1070,26 @@ var _t = ["title"], vt = {
985
1070
  }, e, t);
986
1071
  }
987
1072
  function x(e) {
988
- e.userOnly && k(m.map, m.node);
1073
+ e.userOnly && A(m.map, m.node);
989
1074
  }
990
- function ee(e) {
1075
+ function S(e) {
991
1076
  e.stopPropagation(), he(m.node) && g("drillIn", m.node.id);
992
1077
  }
993
- function S(e) {
1078
+ function C(e) {
994
1079
  e.button === 0 && (e.stopPropagation(), g("select", m.node.id, e.shiftKey));
995
1080
  }
996
- let C = t(() => m.map.nodeTypes[m.node.typeId]), w = t(() => m.node.label || C.value?.displayName || m.node.typeId), T = t(() => m.node.color ?? C.value?.color ?? "#3a3f4b"), E = t(() => lt(m.node)), D = t(() => Object.values(m.node.inputs)), te = t(() => Object.values(m.node.outputs)), O = t(() => m.ioWidgets && m.node.typeId === "io/input"), A = t(() => {
1081
+ let w = t(() => m.map.nodeTypes[m.node.typeId]), T = t(() => m.node.label || w.value?.displayName || m.node.typeId), E = t(() => m.node.color ?? w.value?.color ?? "#3a3f4b"), D = t(() => _t(m.node)), O = t(() => Object.values(m.node.inputs)), ee = t(() => Object.values(m.node.outputs)), k = t(() => m.ioWidgets && m.node.typeId === "io/input"), j = t(() => {
997
1082
  let e = /* @__PURE__ */ new Set();
998
1083
  for (let t of m.map.graph.connections) t.to.node === m.node.id && e.add(t.to.port);
999
1084
  return e;
1000
1085
  });
1001
- function j(e) {
1086
+ function M(e) {
1002
1087
  return m.map.types[e]?.color ?? "#888";
1003
1088
  }
1004
- function M(e) {
1089
+ function N(e) {
1005
1090
  return m.map.types[e.type];
1006
1091
  }
1007
- let N = (e) => m.map.types[e.type], P = t(() => ut(m.node, N));
1092
+ let te = (e) => m.map.types[e.type], P = t(() => vt(m.node, te));
1008
1093
  function F(e) {
1009
1094
  return m.ioWidgets ? m.node.typeId === "io/input" && e === "out" ? "editable" : m.node.typeId === "io/output" && e === "in" ? "readonly" : "auto" : "auto";
1010
1095
  }
@@ -1024,7 +1109,7 @@ var _t = ["title"], vt = {
1024
1109
  function l(e) {
1025
1110
  if (!a) {
1026
1111
  let r = e.clientX - t, i = e.clientY - n;
1027
- if (Math.hypot(r, i) < Tt) return;
1112
+ if (Math.hypot(r, i) < Nt) return;
1028
1113
  a = !0, s();
1029
1114
  return;
1030
1115
  }
@@ -1045,36 +1130,36 @@ var _t = ["title"], vt = {
1045
1130
  style: u({
1046
1131
  left: o.node.location.x + "px",
1047
1132
  top: o.node.location.y + "px",
1048
- width: E.value + "px",
1133
+ width: D.value + "px",
1049
1134
  height: P.value + "px",
1050
1135
  zIndex: o.node.z ?? 0
1051
1136
  }),
1052
- onPointerdown: S
1137
+ onPointerdown: C
1053
1138
  }, [
1054
1139
  o.error ? (p(), i("div", {
1055
1140
  key: 0,
1056
1141
  class: "error-ring",
1057
1142
  title: o.error
1058
- }, null, 8, bt)) : r("", !0),
1143
+ }, null, 8, Ot)) : r("", !0),
1059
1144
  a("div", {
1060
1145
  class: "header",
1061
1146
  style: u({
1062
- background: T.value,
1147
+ background: E.value,
1063
1148
  height: y(20) + "px"
1064
1149
  }),
1065
1150
  onPointerdown: I,
1066
- onDblclick: ee
1067
- }, [a("span", xt, v(w.value), 1), a("div", St, [(p(), i(e, null, h(6, (e) => a("span", {
1151
+ onDblclick: S
1152
+ }, [a("span", kt, v(T.value), 1), a("div", At, [(p(), i(e, null, h(6, (e) => a("span", {
1068
1153
  key: e,
1069
1154
  class: "dot"
1070
1155
  })), 64))])], 36),
1071
- a("div", Ct, [D.value.length ? (p(), i("div", wt, [(p(!0), i(e, null, h(D.value, (e) => (p(), n(yt, {
1156
+ a("div", jt, [O.value.length ? (p(), i("div", Mt, [(p(!0), i(e, null, h(O.value, (e) => (p(), n(Dt, {
1072
1157
  key: e.id,
1073
1158
  port: e,
1074
- "type-def": M(e),
1075
- color: j(e.type),
1159
+ "type-def": N(e),
1160
+ color: M(e.type),
1076
1161
  side: "in",
1077
- connected: A.value.has(e.id),
1162
+ connected: j.value.has(e.id),
1078
1163
  "widget-mode": F("in"),
1079
1164
  "display-value": o.ioResults?.[e.name],
1080
1165
  onConnectStart: _,
@@ -1086,14 +1171,14 @@ var _t = ["title"], vt = {
1086
1171
  "connected",
1087
1172
  "widget-mode",
1088
1173
  "display-value"
1089
- ]))), 128))])) : r("", !0), te.value.length ? (p(), i("div", {
1174
+ ]))), 128))])) : r("", !0), ee.value.length ? (p(), i("div", {
1090
1175
  key: 1,
1091
- class: l(["col output", { wide: O.value }])
1092
- }, [(p(!0), i(e, null, h(te.value, (e) => (p(), n(yt, {
1176
+ class: l(["col output", { wide: k.value }])
1177
+ }, [(p(!0), i(e, null, h(ee.value, (e) => (p(), n(Dt, {
1093
1178
  key: `${e.id}-${e.type}`,
1094
1179
  port: e,
1095
- "type-def": M(e),
1096
- color: j(e.type),
1180
+ "type-def": N(e),
1181
+ color: M(e.type),
1097
1182
  side: "out",
1098
1183
  "widget-mode": F("out"),
1099
1184
  onConnectStart: _
@@ -1105,7 +1190,7 @@ var _t = ["title"], vt = {
1105
1190
  ]))), 128))], 2)) : r("", !0)])
1106
1191
  ], 38));
1107
1192
  }
1108
- }), [["__scopeId", "data-v-24b182cb"]]), Dt = { class: "wires" }, Ot = ["d"], kt = ["d"], At = ["d"], jt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1193
+ }), [["__scopeId", "data-v-24b182cb"]]), Ft = { class: "wires" }, It = ["d"], Lt = ["d"], Rt = ["d"], zt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1109
1194
  __name: "WireLayer",
1110
1195
  props: {
1111
1196
  map: {},
@@ -1120,30 +1205,30 @@ var _t = ["title"], vt = {
1120
1205
  }), c = t(() => a.map.graph.connections.map((e) => {
1121
1206
  let t = s.value[e.from.node], n = s.value[e.to.node];
1122
1207
  if (!t || !n) return null;
1123
- let r = ft(t, e.from.port, o), i = ft(n, e.to.port, o);
1208
+ let r = bt(t, e.from.port, o), i = bt(n, e.to.port, o);
1124
1209
  return !r || !i ? null : {
1125
1210
  id: e.id,
1126
- d: mt(r, i)
1211
+ d: St(r, i)
1127
1212
  };
1128
1213
  }).filter((e) => e !== null));
1129
- return (t, a) => (p(), i("svg", Dt, [
1214
+ return (t, a) => (p(), i("svg", Ft, [
1130
1215
  (p(!0), i(e, null, h(c.value, (e) => (p(), i("path", {
1131
1216
  key: e.id,
1132
1217
  d: e.d
1133
- }, null, 8, Ot))), 128)),
1218
+ }, null, 8, It))), 128)),
1134
1219
  n.pendingPath ? (p(), i("path", {
1135
1220
  key: 0,
1136
1221
  class: "pending",
1137
1222
  d: n.pendingPath
1138
- }, null, 8, kt)) : r("", !0),
1223
+ }, null, 8, Lt)) : r("", !0),
1139
1224
  n.slicePath ? (p(), i("path", {
1140
1225
  key: 1,
1141
1226
  class: "slice",
1142
1227
  d: n.slicePath
1143
- }, null, 8, At)) : r("", !0)
1228
+ }, null, 8, Rt)) : r("", !0)
1144
1229
  ]));
1145
1230
  }
1146
- }), [["__scopeId", "data-v-682ffd13"]]), Mt = { class: "inspector-section-header" }, Nt = { class: "inspector-section-title" }, Pt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1231
+ }), [["__scopeId", "data-v-682ffd13"]]), Bt = { class: "inspector-section-header" }, Vt = { class: "inspector-section-title" }, Ht = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1147
1232
  __name: "InspectorSection",
1148
1233
  props: {
1149
1234
  title: {},
@@ -1153,25 +1238,25 @@ var _t = ["title"], vt = {
1153
1238
  }
1154
1239
  },
1155
1240
  setup(e) {
1156
- return (t, n) => (p(), i("div", { class: l(["inspector-section", { divided: e.divided }]) }, [a("div", Mt, [a("span", Nt, v(e.title), 1), g(t.$slots, "actions", {}, void 0, !0)]), g(t.$slots, "default", {}, void 0, !0)], 2));
1241
+ return (t, n) => (p(), i("div", { class: l(["inspector-section", { divided: e.divided }]) }, [a("div", Bt, [a("span", Vt, v(e.title), 1), g(t.$slots, "actions", {}, void 0, !0)]), g(t.$slots, "default", {}, void 0, !0)], 2));
1157
1242
  }
1158
- }), [["__scopeId", "data-v-5e38007a"]]), Ft = {
1243
+ }), [["__scopeId", "data-v-5e38007a"]]), Ut = {
1159
1244
  key: 0,
1160
1245
  class: "iface-grid iface-head",
1161
1246
  "aria-hidden": "true"
1162
- }, It = {
1247
+ }, Wt = {
1163
1248
  key: 1,
1164
1249
  class: "iface-rows"
1165
- }, Lt = { class: "iface-grid iface-row" }, Rt = ["value", "onChange"], zt = ["value", "onChange"], Bt = ["value"], Vt = ["onClick"], Ht = {
1250
+ }, Gt = { class: "iface-grid iface-row" }, Kt = ["value", "onChange"], qt = ["value", "onChange"], Jt = ["value"], Yt = ["onClick"], Xt = {
1166
1251
  key: 0,
1167
1252
  class: "iface-default-row"
1168
- }, Ut = {
1253
+ }, Zt = {
1169
1254
  key: 2,
1170
1255
  class: "iface-empty"
1171
- }, Wt = {
1256
+ }, Qt = {
1172
1257
  key: 3,
1173
1258
  class: "iface-error"
1174
- }, Gt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1259
+ }, $t = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1175
1260
  __name: "GraphInterfacePanel",
1176
1261
  props: {
1177
1262
  graphInterface: {},
@@ -1205,9 +1290,9 @@ var _t = ["title"], vt = {
1205
1290
  for (let { name: t, spec: n } of g.value) e[t] = y(t, n);
1206
1291
  l.value = e;
1207
1292
  }
1208
- ee(() => s.revision, () => {
1293
+ S(() => s.revision, () => {
1209
1294
  c.value = "", b();
1210
- }), ee(f, b, { immediate: !0 });
1295
+ }), S(f, b, { immediate: !0 });
1211
1296
  function x(e) {
1212
1297
  c.value = "";
1213
1298
  try {
@@ -1217,7 +1302,7 @@ var _t = ["title"], vt = {
1217
1302
  c.value = e instanceof Error ? e.message : String(e);
1218
1303
  }
1219
1304
  }
1220
- function C(e, t) {
1305
+ function w(e, t) {
1221
1306
  return {
1222
1307
  id: `iface-default-${e}`,
1223
1308
  name: e,
@@ -1226,13 +1311,13 @@ var _t = ["title"], vt = {
1226
1311
  value: l.value[e] ?? y(e, t)
1227
1312
  };
1228
1313
  }
1229
- function T(e, t) {
1314
+ function E(e, t) {
1230
1315
  l.value = {
1231
1316
  ...l.value,
1232
1317
  [e]: t
1233
1318
  };
1234
1319
  }
1235
- function E(e) {
1320
+ function D(e) {
1236
1321
  if (!s.graphInterface.parameters?.[e]) return;
1237
1322
  let t = l.value[e];
1238
1323
  x((n) => {
@@ -1248,7 +1333,7 @@ var _t = ["title"], vt = {
1248
1333
  };
1249
1334
  });
1250
1335
  }
1251
- function D() {
1336
+ function O() {
1252
1337
  x((e) => {
1253
1338
  let t = f.value ? e.parameters : e.returns, n = new Set(Object.keys(t ?? {})), r = f.value ? "input" : "output";
1254
1339
  if (n.has(r)) {
@@ -1269,7 +1354,7 @@ var _t = ["title"], vt = {
1269
1354
  };
1270
1355
  });
1271
1356
  }
1272
- function te(e) {
1357
+ function ee(e) {
1273
1358
  x((t) => {
1274
1359
  if (f.value) {
1275
1360
  if (!t.parameters) return;
@@ -1282,7 +1367,7 @@ var _t = ["title"], vt = {
1282
1367
  }
1283
1368
  });
1284
1369
  }
1285
- function O(e, t) {
1370
+ function k(e, t) {
1286
1371
  if (!t || !ne.test(t)) {
1287
1372
  c.value = `Invalid port name "${t}"`;
1288
1373
  return;
@@ -1304,7 +1389,7 @@ var _t = ["title"], vt = {
1304
1389
  }
1305
1390
  });
1306
1391
  }
1307
- function k(e, t) {
1392
+ function A(e, t) {
1308
1393
  x((n) => {
1309
1394
  if (f.value) {
1310
1395
  let r = n.parameters?.[e];
@@ -1334,72 +1419,72 @@ var _t = ["title"], vt = {
1334
1419
  }
1335
1420
  });
1336
1421
  }
1337
- return (t, s) => (p(), n(Pt, { title: d.value }, {
1338
- actions: S(() => [a("button", {
1422
+ return (t, s) => (p(), n(Ht, { title: d.value }, {
1423
+ actions: C(() => [a("button", {
1339
1424
  class: "inspector-icon-btn",
1340
1425
  type: "button",
1341
1426
  title: "Add port",
1342
- onClick: w(D, ["stop", "prevent"])
1427
+ onClick: T(O, ["stop", "prevent"])
1343
1428
  }, " + ")]),
1344
- default: S(() => [
1345
- g.value.length ? (p(), i("div", Ft, [...s[0] ||= [
1429
+ default: C(() => [
1430
+ g.value.length ? (p(), i("div", Ut, [...s[0] ||= [
1346
1431
  a("span", null, "Name", -1),
1347
1432
  a("span", null, "Type", -1),
1348
1433
  a("span", null, null, -1)
1349
1434
  ]])) : r("", !0),
1350
- g.value.length ? (p(), i("div", It, [(p(!0), i(e, null, h(g.value, (t) => (p(), i("div", {
1435
+ g.value.length ? (p(), i("div", Wt, [(p(!0), i(e, null, h(g.value, (t) => (p(), i("div", {
1351
1436
  key: t.name,
1352
1437
  class: "iface-entry"
1353
- }, [a("div", Lt, [
1438
+ }, [a("div", Gt, [
1354
1439
  a("input", {
1355
1440
  class: "iface-field iface-name",
1356
1441
  type: "text",
1357
1442
  value: t.name,
1358
- onChange: (e) => O(t.name, e.target.value.trim())
1359
- }, null, 40, Rt),
1443
+ onChange: (e) => k(t.name, e.target.value.trim())
1444
+ }, null, 40, Kt),
1360
1445
  a("select", {
1361
1446
  class: "iface-field iface-select",
1362
1447
  value: t.spec.type,
1363
- onChange: (e) => k(t.name, e.target.value)
1448
+ onChange: (e) => A(t.name, e.target.value)
1364
1449
  }, [(p(!0), i(e, null, h(o.typeIds, (e) => (p(), i("option", {
1365
1450
  key: e,
1366
1451
  value: e
1367
- }, v(e), 9, Bt))), 128))], 40, zt),
1452
+ }, v(e), 9, Jt))), 128))], 40, qt),
1368
1453
  a("button", {
1369
1454
  class: "iface-remove",
1370
1455
  type: "button",
1371
1456
  title: "Remove port",
1372
- onClick: w((e) => te(t.name), ["stop", "prevent"])
1373
- }, " × ", 8, Vt)
1374
- ]), f.value ? (p(), i("div", Ht, [s[1] ||= a("span", { class: "iface-default-label" }, "Default", -1), (p(), n(at, {
1457
+ onClick: T((e) => ee(t.name), ["stop", "prevent"])
1458
+ }, " × ", 8, Yt)
1459
+ ]), f.value ? (p(), i("div", Xt, [s[1] ||= a("span", { class: "iface-default-label" }, "Default", -1), (p(), n(pt, {
1375
1460
  key: `${t.name}-${t.spec.type}`,
1376
1461
  class: "iface-default-widget",
1377
- port: C(t.name, t.spec),
1462
+ port: w(t.name, t.spec),
1378
1463
  "type-def": o.types[t.spec.type],
1379
1464
  mode: "editable",
1380
1465
  placeholder: t.name,
1381
- "onUpdate:value": (e) => T(t.name, e),
1382
- onCommit: (e) => E(t.name)
1466
+ "onUpdate:value": (e) => E(t.name, e),
1467
+ onCommit: (e) => D(t.name)
1383
1468
  }, null, 8, [
1384
1469
  "port",
1385
1470
  "type-def",
1386
1471
  "placeholder",
1387
1472
  "onUpdate:value",
1388
1473
  "onCommit"
1389
- ]))])) : r("", !0)]))), 128))])) : (p(), i("div", Ut, "No ports")),
1390
- u.value ? (p(), i("p", Wt, v(u.value), 1)) : r("", !0)
1474
+ ]))])) : r("", !0)]))), 128))])) : (p(), i("div", Zt, "No ports")),
1475
+ u.value ? (p(), i("p", Qt, v(u.value), 1)) : r("", !0)
1391
1476
  ]),
1392
1477
  _: 1
1393
1478
  }, 8, ["title"]));
1394
1479
  }
1395
- }), [["__scopeId", "data-v-8f895443"]]), Kt = {
1480
+ }), [["__scopeId", "data-v-8f895443"]]), en = {
1396
1481
  key: 0,
1397
1482
  class: "inspector-title static"
1398
- }, qt = [
1483
+ }, tn = [
1399
1484
  "value",
1400
1485
  "placeholder",
1401
1486
  "title"
1402
- ], Jt = { class: "inspector-header-actions" }, Yt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1487
+ ], nn = { class: "inspector-header-actions" }, rn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1403
1488
  __name: "InspectorPanel",
1404
1489
  props: {
1405
1490
  title: {},
@@ -1436,7 +1521,7 @@ var _t = ["title"], vt = {
1436
1521
  return (t, o) => (p(), i("div", { class: l(["inspector-panel", { fill: e.fill }]) }, [a("div", {
1437
1522
  class: "inspector-header",
1438
1523
  style: u({ background: e.headerColor })
1439
- }, [g(t.$slots, "title", {}, () => [e.staticTitle ? (p(), i("span", Kt, v(e.title), 1)) : (p(), i("input", {
1524
+ }, [g(t.$slots, "title", {}, () => [e.staticTitle ? (p(), i("span", en, v(e.title), 1)) : (p(), i("input", {
1440
1525
  key: 1,
1441
1526
  class: "inspector-title",
1442
1527
  type: "text",
@@ -1444,7 +1529,7 @@ var _t = ["title"], vt = {
1444
1529
  placeholder: e.titlePlaceholder,
1445
1530
  title: e.title,
1446
1531
  onInput: d
1447
- }, null, 40, qt))], !0), a("div", Jt, [g(t.$slots, "header-actions", {}, void 0, !0), e.showUp ? (p(), i("button", {
1532
+ }, null, 40, tn))], !0), a("div", nn, [g(t.$slots, "header-actions", {}, void 0, !0), e.showUp ? (p(), i("button", {
1448
1533
  key: 0,
1449
1534
  class: "inspector-icon-btn",
1450
1535
  type: "button",
@@ -1452,7 +1537,7 @@ var _t = ["title"], vt = {
1452
1537
  onClick: o[0] ||= (e) => n("up")
1453
1538
  }, " ↩ ")) : r("", !0)])], 4), a("div", { class: l(["inspector-body", { flush: e.flush }]) }, [g(t.$slots, "default", {}, void 0, !0)], 2)], 2));
1454
1539
  }
1455
- }), [["__scopeId", "data-v-78844099"]]), Xt = { class: "inspector-row" }, Zt = { class: "inspector-key" }, Qt = ["value"], $t = /* @__PURE__ */ s({
1540
+ }), [["__scopeId", "data-v-78844099"]]), an = { class: "inspector-row" }, on = { class: "inspector-key" }, sn = ["value"], cn = /* @__PURE__ */ s({
1456
1541
  __name: "InspectorColorField",
1457
1542
  props: {
1458
1543
  modelValue: {},
@@ -1464,20 +1549,20 @@ var _t = ["title"], vt = {
1464
1549
  function r(e) {
1465
1550
  n("update:modelValue", e.target.value);
1466
1551
  }
1467
- return (t, n) => (p(), i("label", Xt, [a("span", Zt, v(e.label), 1), a("input", {
1552
+ return (t, n) => (p(), i("label", an, [a("span", on, v(e.label), 1), a("input", {
1468
1553
  class: "inspector-swatch",
1469
1554
  type: "color",
1470
1555
  value: e.modelValue,
1471
1556
  onInput: r
1472
- }, null, 40, Qt)]));
1557
+ }, null, 40, sn)]));
1473
1558
  }
1474
- }), en = { class: "inspector-error" }, tn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1559
+ }), ln = { class: "inspector-error" }, un = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1475
1560
  __name: "InspectorError",
1476
1561
  props: { message: {} },
1477
1562
  setup(e) {
1478
- return (t, n) => (p(), i("p", en, v(e.message), 1));
1563
+ return (t, n) => (p(), i("p", ln, v(e.message), 1));
1479
1564
  }
1480
- }), [["__scopeId", "data-v-a863f513"]]), nn = { class: "inspector-row pair" }, rn = ["value"], an = ["value"], on = /* @__PURE__ */ s({
1565
+ }), [["__scopeId", "data-v-a863f513"]]), dn = { class: "inspector-row pair" }, fn = ["value"], pn = ["value"], mn = /* @__PURE__ */ s({
1481
1566
  __name: "InspectorPositionField",
1482
1567
  props: {
1483
1568
  x: {},
@@ -1489,23 +1574,23 @@ var _t = ["title"], vt = {
1489
1574
  function r(e) {
1490
1575
  return Number(e.target.value);
1491
1576
  }
1492
- return (t, o) => (p(), i("div", nn, [a("label", null, [o[2] ||= a("span", { class: "inspector-key" }, "X", -1), a("input", {
1577
+ return (t, o) => (p(), i("div", dn, [a("label", null, [o[2] ||= a("span", { class: "inspector-key" }, "X", -1), a("input", {
1493
1578
  class: "inspector-field",
1494
1579
  type: "number",
1495
1580
  value: e.x,
1496
1581
  onInput: o[0] ||= (e) => n("update:x", r(e))
1497
- }, null, 40, rn)]), a("label", null, [o[3] ||= a("span", { class: "inspector-key" }, "Y", -1), a("input", {
1582
+ }, null, 40, fn)]), a("label", null, [o[3] ||= a("span", { class: "inspector-key" }, "Y", -1), a("input", {
1498
1583
  class: "inspector-field",
1499
1584
  type: "number",
1500
1585
  value: e.y,
1501
1586
  onInput: o[1] ||= (e) => n("update:y", r(e))
1502
- }, null, 40, an)])]));
1587
+ }, null, 40, pn)])]));
1503
1588
  }
1504
- }), sn = { class: "inspector-row" }, cn = [
1589
+ }), hn = { class: "inspector-row" }, gn = [
1505
1590
  "min",
1506
1591
  "max",
1507
1592
  "value"
1508
- ], ln = { class: "inspector-slider-value" }, un = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1593
+ ], _n = { class: "inspector-slider-value" }, vn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1509
1594
  __name: "InspectorWidthField",
1510
1595
  props: {
1511
1596
  modelValue: {},
@@ -1519,7 +1604,7 @@ var _t = ["title"], vt = {
1519
1604
  function r(e) {
1520
1605
  n("update:modelValue", Number(e.target.value));
1521
1606
  }
1522
- return (t, n) => (p(), i("label", sn, [
1607
+ return (t, n) => (p(), i("label", hn, [
1523
1608
  n[0] ||= a("span", { class: "inspector-key" }, "Width", -1),
1524
1609
  a("input", {
1525
1610
  class: "inspector-slider",
@@ -1530,11 +1615,11 @@ var _t = ["title"], vt = {
1530
1615
  value: e.modelValue,
1531
1616
  style: u({ accentColor: e.accentColor }),
1532
1617
  onInput: r
1533
- }, null, 44, cn),
1534
- a("span", ln, v(e.modelValue), 1)
1618
+ }, null, 44, gn),
1619
+ a("span", _n, v(e.modelValue), 1)
1535
1620
  ]));
1536
1621
  }
1537
- }), [["__scopeId", "data-v-472135f4"]]), dn = "#3a3f4b", fn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1622
+ }), [["__scopeId", "data-v-472135f4"]]), yn = "#3a3f4b", bn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1538
1623
  __name: "NodePanel",
1539
1624
  props: {
1540
1625
  map: {},
@@ -1572,57 +1657,57 @@ var _t = ["title"], vt = {
1572
1657
  let t = l.value;
1573
1658
  t && (t.color = e);
1574
1659
  }
1575
- function ee(e) {
1660
+ function S(e) {
1576
1661
  let t = l.value;
1577
1662
  t && (t.width = e);
1578
1663
  }
1579
- function C(e) {
1664
+ function w(e) {
1580
1665
  let t = e - _.value;
1581
1666
  for (let e of a.nodes) e.location.x += t;
1582
1667
  }
1583
- function w(e) {
1668
+ function T(e) {
1584
1669
  let t = e - v.value;
1585
1670
  for (let e of a.nodes) e.location.y += t;
1586
1671
  }
1587
- return (t, i) => l.value ? (p(), n(Yt, {
1672
+ return (t, i) => l.value ? (p(), n(rn, {
1588
1673
  key: 0,
1589
1674
  class: "node-panel",
1590
1675
  title: m.value,
1591
1676
  "title-placeholder": f.value,
1592
- "header-color": dn,
1677
+ "header-color": yn,
1593
1678
  "static-title": c.value,
1594
1679
  "onUpdate:title": b
1595
1680
  }, {
1596
- default: S(() => [
1597
- c.value ? r("", !0) : (p(), n($t, {
1681
+ default: C(() => [
1682
+ c.value ? r("", !0) : (p(), n(cn, {
1598
1683
  key: 0,
1599
1684
  "model-value": h.value,
1600
1685
  "onUpdate:modelValue": x
1601
1686
  }, null, 8, ["model-value"])),
1602
- o(on, {
1687
+ o(mn, {
1603
1688
  x: _.value,
1604
1689
  y: v.value,
1605
- "onUpdate:x": C,
1606
- "onUpdate:y": w
1690
+ "onUpdate:x": w,
1691
+ "onUpdate:y": T
1607
1692
  }, null, 8, ["x", "y"]),
1608
- c.value ? r("", !0) : (p(), n(un, {
1693
+ c.value ? r("", !0) : (p(), n(vn, {
1609
1694
  key: 1,
1610
1695
  "model-value": g.value,
1611
1696
  min: y(60),
1612
1697
  max: y(320),
1613
1698
  "accent-color": h.value,
1614
- "onUpdate:modelValue": ee
1699
+ "onUpdate:modelValue": S
1615
1700
  }, null, 8, [
1616
1701
  "model-value",
1617
1702
  "min",
1618
1703
  "max",
1619
1704
  "accent-color"
1620
1705
  ])),
1621
- e.error && !c.value ? (p(), n(tn, {
1706
+ e.error && !c.value ? (p(), n(un, {
1622
1707
  key: 2,
1623
1708
  message: e.error
1624
1709
  }, null, 8, ["message"])) : r("", !0),
1625
- u.value ? (p(), n(Gt, {
1710
+ u.value ? (p(), n($t, {
1626
1711
  key: 3,
1627
1712
  "graph-interface": e.graphInterface,
1628
1713
  mode: u.value,
@@ -1648,7 +1733,7 @@ var _t = ["title"], vt = {
1648
1733
  "static-title"
1649
1734
  ])) : r("", !0);
1650
1735
  }
1651
- }), [["__scopeId", "data-v-51945220"]]), pn = { class: "inspector-row inspector-check" }, mn = { class: "inspector-key" }, hn = ["checked"], gn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1736
+ }), [["__scopeId", "data-v-51945220"]]), xn = { class: "inspector-row inspector-check" }, Sn = { class: "inspector-key" }, Cn = ["checked"], wn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1652
1737
  __name: "InspectorCheckboxField",
1653
1738
  props: {
1654
1739
  modelValue: { type: Boolean },
@@ -1660,13 +1745,13 @@ var _t = ["title"], vt = {
1660
1745
  function r(e) {
1661
1746
  n("update:modelValue", e.target.checked);
1662
1747
  }
1663
- return (t, n) => (p(), i("label", pn, [a("span", mn, v(e.label), 1), a("input", {
1748
+ return (t, n) => (p(), i("label", xn, [a("span", Sn, v(e.label), 1), a("input", {
1664
1749
  type: "checkbox",
1665
1750
  checked: e.modelValue,
1666
1751
  onChange: r
1667
- }, null, 40, hn)]));
1752
+ }, null, 40, Cn)]));
1668
1753
  }
1669
- }), [["__scopeId", "data-v-7b38cfa2"]]), _n = "#3a3f4b", vn = /* @__PURE__ */ s({
1754
+ }), [["__scopeId", "data-v-7b38cfa2"]]), Tn = "#3a3f4b", En = /* @__PURE__ */ s({
1670
1755
  __name: "GroupPanel",
1671
1756
  props: {
1672
1757
  composite: {},
@@ -1674,7 +1759,7 @@ var _t = ["title"], vt = {
1674
1759
  },
1675
1760
  emits: ["up", "update:ioWidgets"],
1676
1761
  setup(e, { emit: i }) {
1677
- let a = e, s = i, c = t(() => le.displayName), l = t(() => a.composite?.label || le.displayName), u = t(() => a.composite?.color ?? le.color ?? _n);
1762
+ let a = e, s = i, c = t(() => ue.displayName), l = t(() => a.composite?.label || ue.displayName), u = t(() => a.composite?.color ?? ue.color ?? Tn);
1678
1763
  function d(e) {
1679
1764
  let t = a.composite;
1680
1765
  t && (t.label = e);
@@ -1683,19 +1768,19 @@ var _t = ["title"], vt = {
1683
1768
  let t = a.composite;
1684
1769
  t && (t.color = e);
1685
1770
  }
1686
- return (t, i) => e.composite ? (p(), n(Yt, {
1771
+ return (t, i) => e.composite ? (p(), n(rn, {
1687
1772
  key: 0,
1688
1773
  title: l.value,
1689
1774
  "title-placeholder": c.value,
1690
- "header-color": _n,
1775
+ "header-color": Tn,
1691
1776
  "show-up": "",
1692
1777
  "onUpdate:title": d,
1693
1778
  onUp: i[1] ||= (e) => s("up")
1694
1779
  }, {
1695
- default: S(() => [o($t, {
1780
+ default: C(() => [o(cn, {
1696
1781
  "model-value": u.value,
1697
1782
  "onUpdate:modelValue": f
1698
- }, null, 8, ["model-value"]), o(gn, {
1783
+ }, null, 8, ["model-value"]), o(wn, {
1699
1784
  label: "IO test",
1700
1785
  "model-value": e.ioWidgets,
1701
1786
  "onUpdate:modelValue": i[0] ||= (e) => s("update:ioWidgets", e)
@@ -1706,7 +1791,7 @@ var _t = ["title"], vt = {
1706
1791
  });
1707
1792
  //#endregion
1708
1793
  //#region src/store/registry/groups.ts
1709
- function yn(e, t) {
1794
+ function Dn(e, t) {
1710
1795
  return {
1711
1796
  name: e,
1712
1797
  path: t,
@@ -1714,37 +1799,37 @@ function yn(e, t) {
1714
1799
  nodes: []
1715
1800
  };
1716
1801
  }
1717
- function bn(e, t) {
1718
- let n = yn("", []);
1802
+ function On(e, t) {
1803
+ let n = Dn("", []);
1719
1804
  for (let r of Object.values(e)) {
1720
1805
  if (t && !t(r)) continue;
1721
1806
  let e = n, i = [];
1722
1807
  for (let t of r.group ?? []) {
1723
1808
  i.push(t);
1724
1809
  let n = e.subgroups.find((e) => e.name === t);
1725
- n || (n = yn(t, [...i]), e.subgroups.push(n)), e = n;
1810
+ n || (n = Dn(t, [...i]), e.subgroups.push(n)), e = n;
1726
1811
  }
1727
1812
  e.nodes.push(r);
1728
1813
  }
1729
1814
  return n;
1730
1815
  }
1731
- function xn(e) {
1816
+ function kn(e) {
1732
1817
  e.subgroups.sort((e, t) => e.name.localeCompare(t.name)), e.nodes.sort((e, t) => e.displayName.localeCompare(t.displayName));
1733
- for (let t of e.subgroups) xn(t);
1818
+ for (let t of e.subgroups) kn(t);
1734
1819
  return e;
1735
1820
  }
1736
1821
  //#endregion
1737
1822
  //#region src/components/AddNodePanel.vue?vue&type=script&setup=true&lang.ts
1738
- var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn = ["title", "onClick"], En = { class: "name" }, Dn = { class: "path" }, On = {
1823
+ var An = ["title"], jn = { class: "picker-body" }, Mn = { class: "list" }, Nn = ["title", "onClick"], Pn = { class: "name" }, Fn = { class: "path" }, In = {
1739
1824
  key: 0,
1740
1825
  class: "path-sep"
1741
- }, kn = { class: "path-seg" }, An = {
1826
+ }, Ln = { class: "path-seg" }, Rn = {
1742
1827
  key: 0,
1743
1828
  class: "empty"
1744
- }, jn = ["onClick"], Mn = { class: "name" }, Nn = ["title", "onClick"], Pn = { class: "name" }, Fn = {
1829
+ }, zn = ["onClick"], Bn = { class: "name" }, Vn = ["title", "onClick"], Hn = { class: "name" }, Un = {
1745
1830
  key: 1,
1746
1831
  class: "empty"
1747
- }, In = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1832
+ }, Wn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1748
1833
  __name: "AddNodePanel",
1749
1834
  props: {
1750
1835
  map: {},
@@ -1761,125 +1846,125 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
1761
1846
  ae7fef7e: y,
1762
1847
  v113015c7: _
1763
1848
  }));
1764
- let c = n, f = s, g = "11px", _ = "6px", y = "20px", T = m(""), E = m(null);
1765
- d(() => E.value?.focus());
1766
- let D = (e) => e.typeId !== "io/input" && e.typeId !== "io/output" && e.typeId !== "composite/group", te = t(() => xn(bn(c.map.nodeTypes, D))), O = m([]), k = t(() => {
1767
- let e = te.value;
1768
- for (let t of O.value) {
1849
+ let c = n, f = s, g = "11px", _ = "6px", y = "20px", E = m(""), D = m(null);
1850
+ d(() => D.value?.focus());
1851
+ let O = (e) => e.typeId !== "io/input" && e.typeId !== "io/output" && e.typeId !== "composite/group", ee = t(() => kn(On(c.map.nodeTypes, O))), k = m([]), A = t(() => {
1852
+ let e = ee.value;
1853
+ for (let t of k.value) {
1769
1854
  let n = e.subgroups.find((e) => e.name === t);
1770
1855
  if (!n) break;
1771
1856
  e = n;
1772
1857
  }
1773
1858
  return e;
1774
- }), A = t(() => O.value.length ? O.value.join(" › ") : "Add Node"), j = t(() => O.value.length ? O.value : null);
1775
- function M(e) {
1859
+ }), j = t(() => k.value.length ? k.value.join(" › ") : "Add Node"), M = t(() => k.value.length ? k.value : null);
1860
+ function N(e) {
1776
1861
  return e.group ?? [];
1777
1862
  }
1778
- function N(e) {
1779
- O.value = [...O.value, e];
1863
+ function te(e) {
1864
+ k.value = [...k.value, e];
1780
1865
  }
1781
1866
  function P() {
1782
- O.value = O.value.slice(0, -1);
1867
+ k.value = k.value.slice(0, -1);
1783
1868
  }
1784
1869
  let F = t(() => {
1785
- let e = T.value.trim().toLowerCase();
1786
- return e ? Object.values(c.map.nodeTypes).filter(D).filter((t) => t.displayName.toLowerCase().includes(e)).sort((e, t) => e.displayName.localeCompare(t.displayName)) : null;
1870
+ let e = E.value.trim().toLowerCase();
1871
+ return e ? Object.values(c.map.nodeTypes).filter(O).filter((t) => t.displayName.toLowerCase().includes(e)).sort((e, t) => e.displayName.localeCompare(t.displayName)) : null;
1787
1872
  });
1788
1873
  function I(e) {
1789
1874
  f("select", e.typeId);
1790
1875
  }
1791
- let L = t(() => F.value ? F.value : k.value.nodes), R = m(0);
1792
- ee(L, () => {
1876
+ let L = t(() => F.value ? F.value : A.value.nodes), R = m(0);
1877
+ S(L, () => {
1793
1878
  R.value = 0;
1794
1879
  });
1795
1880
  function ne() {
1796
1881
  let e = L.value;
1797
1882
  e.length && I(e[R.value] ?? e[0]);
1798
1883
  }
1799
- function z(e) {
1884
+ function re(e) {
1800
1885
  let t = L.value;
1801
1886
  t.length && (e.key === "ArrowDown" ? (e.preventDefault(), R.value = (R.value + 1) % t.length) : e.key === "ArrowUp" ? (e.preventDefault(), R.value = (R.value - 1 + t.length) % t.length) : e.key === "Enter" && (e.preventDefault(), ne()));
1802
1887
  }
1803
- function B(e, t) {
1888
+ function z(e, t) {
1804
1889
  R.value = t, I(e);
1805
1890
  }
1806
- function V(e) {
1891
+ function B(e) {
1807
1892
  e.stopPropagation(), f("close");
1808
1893
  }
1809
1894
  return (t, s) => (p(), i("div", {
1810
1895
  class: "backdrop",
1811
- onPointerdown: V,
1812
- onContextmenu: s[4] ||= w(() => {}, ["prevent"])
1896
+ onPointerdown: B,
1897
+ onContextmenu: s[4] ||= T(() => {}, ["prevent"])
1813
1898
  }, [a("div", {
1814
1899
  class: "anchor",
1815
1900
  style: u({
1816
1901
  left: n.screen.x + "px",
1817
1902
  top: n.screen.y + "px"
1818
1903
  }),
1819
- onPointerdown: s[2] ||= w(() => {}, ["stop"]),
1820
- onContextmenu: s[3] ||= w(() => {}, ["prevent"])
1821
- }, [o(Yt, {
1904
+ onPointerdown: s[2] ||= T(() => {}, ["stop"]),
1905
+ onContextmenu: s[3] ||= T(() => {}, ["prevent"])
1906
+ }, [o(rn, {
1822
1907
  title: "Add Node",
1823
1908
  "static-title": "",
1824
1909
  fill: "",
1825
1910
  flush: ""
1826
1911
  }, {
1827
- title: S(() => [a("nav", {
1912
+ title: C(() => [a("nav", {
1828
1913
  class: "crumbs",
1829
- title: A.value
1830
- }, [a("span", { class: l(["crumb", { current: !j.value }]) }, " Add Node ", 2), j.value ? (p(!0), i(e, { key: 0 }, h(j.value, (t, n) => (p(), i(e, { key: `${n}-${t}` }, [s[5] ||= a("span", { class: "crumb-sep" }, "›", -1), a("span", { class: l(["crumb", { current: n === j.value.length - 1 }]) }, v(t), 3)], 64))), 128)) : r("", !0)], 8, Sn)]),
1831
- "header-actions": S(() => [a("button", {
1914
+ title: j.value
1915
+ }, [a("span", { class: l(["crumb", { current: !M.value }]) }, " Add Node ", 2), M.value ? (p(!0), i(e, { key: 0 }, h(M.value, (t, n) => (p(), i(e, { key: `${n}-${t}` }, [s[5] ||= a("span", { class: "crumb-sep" }, "›", -1), a("span", { class: l(["crumb", { current: n === M.value.length - 1 }]) }, v(t), 3)], 64))), 128)) : r("", !0)], 8, An)]),
1916
+ "header-actions": C(() => [a("button", {
1832
1917
  class: "inspector-icon-btn",
1833
1918
  type: "button",
1834
1919
  title: "Add composite",
1835
1920
  onClick: s[0] ||= (e) => f("addComposite")
1836
1921
  }, " + ")]),
1837
- default: S(() => [a("div", Cn, [C(a("input", {
1922
+ default: C(() => [a("div", jn, [w(a("input", {
1838
1923
  ref_key: "searchEl",
1839
- ref: E,
1840
- "onUpdate:modelValue": s[1] ||= (e) => T.value = e,
1924
+ ref: D,
1925
+ "onUpdate:modelValue": s[1] ||= (e) => E.value = e,
1841
1926
  class: "search",
1842
1927
  type: "text",
1843
1928
  placeholder: "Search nodes…",
1844
- onKeydown: z
1845
- }, null, 544), [[x, T.value]]), a("div", wn, [F.value ? (p(), i(e, { key: 0 }, [(p(!0), i(e, null, h(F.value, (t, n) => (p(), i("button", {
1929
+ onKeydown: re
1930
+ }, null, 544), [[x, E.value]]), a("div", Mn, [F.value ? (p(), i(e, { key: 0 }, [(p(!0), i(e, null, h(F.value, (t, n) => (p(), i("button", {
1846
1931
  key: t.typeId,
1847
1932
  class: l(["row node", { active: n === R.value }]),
1848
1933
  title: t.description,
1849
- onClick: (e) => B(t, n)
1934
+ onClick: (e) => z(t, n)
1850
1935
  }, [
1851
1936
  a("span", {
1852
1937
  class: "dot",
1853
1938
  style: u({ background: t.color })
1854
1939
  }, null, 4),
1855
- a("span", En, v(t.displayName), 1),
1856
- a("span", Dn, [(p(!0), i(e, null, h(M(t), (n, o) => (p(), i(e, { key: `${t.typeId}-${o}-${n}` }, [o > 0 ? (p(), i("span", On, "›")) : r("", !0), a("span", kn, v(n), 1)], 64))), 128))])
1857
- ], 10, Tn))), 128)), F.value.length ? r("", !0) : (p(), i("div", An, "No matches"))], 64)) : (p(), i(e, { key: 1 }, [
1858
- O.value.length ? (p(), i("button", {
1940
+ a("span", Pn, v(t.displayName), 1),
1941
+ a("span", Fn, [(p(!0), i(e, null, h(N(t), (n, o) => (p(), i(e, { key: `${t.typeId}-${o}-${n}` }, [o > 0 ? (p(), i("span", In, "›")) : r("", !0), a("span", Ln, v(n), 1)], 64))), 128))])
1942
+ ], 10, Nn))), 128)), F.value.length ? r("", !0) : (p(), i("div", Rn, "No matches"))], 64)) : (p(), i(e, { key: 1 }, [
1943
+ k.value.length ? (p(), i("button", {
1859
1944
  key: 0,
1860
1945
  class: "row up",
1861
1946
  onClick: P
1862
1947
  }, [...s[6] ||= [a("span", { class: "icon" }, "↩", -1), a("span", { class: "name" }, "..", -1)]])) : r("", !0),
1863
- (p(!0), i(e, null, h(k.value.subgroups, (e) => (p(), i("button", {
1948
+ (p(!0), i(e, null, h(A.value.subgroups, (e) => (p(), i("button", {
1864
1949
  key: e.name,
1865
1950
  class: "row folder",
1866
- onClick: (t) => N(e.name)
1867
- }, [a("span", Mn, v(e.name), 1), s[7] ||= a("span", { class: "chev" }, "›", -1)], 8, jn))), 128)),
1868
- (p(!0), i(e, null, h(k.value.nodes, (e, t) => (p(), i("button", {
1951
+ onClick: (t) => te(e.name)
1952
+ }, [a("span", Bn, v(e.name), 1), s[7] ||= a("span", { class: "chev" }, "›", -1)], 8, zn))), 128)),
1953
+ (p(!0), i(e, null, h(A.value.nodes, (e, t) => (p(), i("button", {
1869
1954
  key: e.typeId,
1870
1955
  class: l(["row node", { active: t === R.value }]),
1871
1956
  title: e.description,
1872
- onClick: (n) => B(e, t)
1957
+ onClick: (n) => z(e, t)
1873
1958
  }, [a("span", {
1874
1959
  class: "dot",
1875
1960
  style: u({ background: e.color })
1876
- }, null, 4), a("span", Pn, v(e.displayName), 1)], 10, Nn))), 128)),
1877
- !k.value.subgroups.length && !k.value.nodes.length ? (p(), i("div", Fn, " Empty ")) : r("", !0)
1961
+ }, null, 4), a("span", Hn, v(e.displayName), 1)], 10, Vn))), 128)),
1962
+ !A.value.subgroups.length && !A.value.nodes.length ? (p(), i("div", Un, " Empty ")) : r("", !0)
1878
1963
  ], 64))])])]),
1879
1964
  _: 1
1880
1965
  })], 36)], 32));
1881
1966
  }
1882
- }), [["__scopeId", "data-v-999f2b7d"]]), Ln = 4, Rn = .25, zn = 2, Bn = .001, Vn = 4, Hn = 120 * 1e3, Un = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1967
+ }), [["__scopeId", "data-v-999f2b7d"]]), Gn = 4, Kn = .25, qn = 2, Jn = .001, Yn = 4, Xn = 120 * 1e3, Zn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1883
1968
  __name: "NodeViewer",
1884
1969
  props: {
1885
1970
  map: {},
@@ -1892,67 +1977,70 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
1892
1977
  function g(e) {
1893
1978
  return b.value.types[e.type];
1894
1979
  }
1895
- let _ = s, v = m([]), y = t(() => Ne(_.map, v.value)), b = t(() => y.value.activeMap), x = t(() => Pe(_.map, v.value)), S = m(0), C = m(""), T = t(() => Me(_.map, v.value)), E = m(!1), D = t(() => v.value.length ? E.value : _.ioWidgets);
1896
- function te() {
1897
- v.value.length && (v.value = v.value.slice(0, -1), H(), K.value = null);
1980
+ let _ = s, v = m([]), y = t(() => We(_.map, v.value)), b = t(() => y.value.activeMap), x = t(() => Ge(_.map, v.value)), C = m(0), w = m(""), E = t(() => Ue(_.map, v.value)), D = m(!1), O = t(() => v.value.length ? D.value : _.ioWidgets);
1981
+ function ee() {
1982
+ v.value.length && (v.value = v.value.slice(0, -1), H(), q.value = null);
1898
1983
  }
1899
- function O(e) {
1900
- C.value = "";
1984
+ function k(e) {
1985
+ w.value = "";
1901
1986
  try {
1902
- let t = Fe(_.map, v.value, e);
1903
- return t.length ? (C.value = t[0] ?? "Unknown error", t) : (S.value++, []);
1987
+ let t = Ke(_.map, v.value, e);
1988
+ return t.length ? (w.value = t[0] ?? "Unknown error", t) : (C.value++, []);
1904
1989
  } catch (e) {
1905
- return C.value = e instanceof Error ? e.message : String(e), [C.value];
1990
+ return w.value = e instanceof Error ? e.message : String(e), [w.value];
1906
1991
  }
1907
1992
  }
1908
- function k(e) {
1993
+ function A(e) {
1909
1994
  let t = b.value.graph.nodes.find((t) => t.id === e);
1910
1995
  if (!t || !he(t)) return;
1911
- let n = ze(_.map, v.value, t);
1996
+ let n = Xe(_.map, v.value, t);
1912
1997
  if (n) {
1913
1998
  console.warn(`[Group] ${n}`);
1914
1999
  return;
1915
2000
  }
1916
- v.value.push({ compositeNodeId: e }), H(), K.value = null;
2001
+ v.value.push({ compositeNodeId: e }), H(), q.value = null;
1917
2002
  }
1918
- let A = t(() => ve(b.value)), j = t(() => D.value ? A.value.values : void 0), M = t(() => A.value.errors), N = m({});
1919
- ee(M, (e) => {
2003
+ let j = t(() => be(b.value)), M = t(() => O.value ? j.value.values : void 0), N = t(() => j.value.errors), te = m({});
2004
+ S(N, (e) => {
1920
2005
  for (let [t, n] of Object.entries(e)) {
1921
- if (N.value[t] === n) continue;
2006
+ if (te.value[t] === n) continue;
1922
2007
  let e = b.value.graph.nodes.find((e) => e.id === t), r = e ? b.value.nodeTypes[e.typeId] : void 0, i = e?.label || r?.displayName || e?.typeId || t;
1923
- console.error(`[${i}] ${n}`), N.value[t] = n;
2008
+ console.error(`[${i}] ${n}`), te.value[t] = n;
1924
2009
  }
1925
- for (let t of Object.keys(N.value)) t in e || delete N.value[t];
2010
+ for (let t of Object.keys(te.value)) t in e || delete te.value[t];
1926
2011
  });
1927
- let P = m(null), F = m(0), I = m(0), R = m(1), ne = m(!1), z = m([]), B = t(() => new Set(z.value)), V = t(() => b.value.graph.nodes.filter((e) => B.value.has(e.id))), re = t(() => V.value[0] ?? null), ie = t(() => re.value ? b.value.nodeTypes[re.value.typeId] ?? null : null);
1928
- function ae(e) {
1929
- z.value = [e], Ae(b.value, e);
2012
+ let P = m(null), F = m(0), I = m(0), R = m(1), ne = m(!1), re = m({
2013
+ x: 0,
2014
+ y: 0
2015
+ }), z = m(null), B = m([]), ie = t(() => new Set(B.value)), ae = t(() => b.value.graph.nodes.filter((e) => ie.value.has(e.id))), V = t(() => ae.value[0] ?? null), oe = t(() => V.value ? b.value.nodeTypes[V.value.typeId] ?? null : null);
2016
+ function se(e) {
2017
+ B.value = [e], Ve(b.value, e);
1930
2018
  }
1931
- function oe(e) {
1932
- z.value.indexOf(e) >= 0 ? z.value = z.value.filter((t) => t !== e) : (z.value = [...z.value, e], Ae(b.value, e));
2019
+ function ce(e) {
2020
+ B.value.indexOf(e) >= 0 ? B.value = B.value.filter((t) => t !== e) : (B.value = [...B.value, e], Ve(b.value, e));
1933
2021
  }
1934
- function se(e, t) {
2022
+ function le(e, t) {
1935
2023
  if (t) {
1936
- oe(e);
2024
+ ce(e);
1937
2025
  return;
1938
2026
  }
1939
- if (B.value.has(e) && z.value.length > 1) {
1940
- Ae(b.value, e);
2027
+ if (ie.value.has(e) && B.value.length > 1) {
2028
+ Ve(b.value, e);
1941
2029
  return;
1942
2030
  }
1943
- ae(e);
2031
+ se(e);
1944
2032
  }
1945
2033
  function H() {
1946
- z.value = [];
2034
+ B.value = [];
1947
2035
  }
1948
- function ce(e, t) {
2036
+ function ue(e, t) {
1949
2037
  let n = Math.min(e.x, t.x), r = Math.max(e.x, t.x), i = Math.min(e.y, t.y), a = Math.max(e.y, t.y);
1950
2038
  return b.value.graph.nodes.filter((e) => {
1951
- let t = lt(e), o = ut(e, g);
2039
+ let t = _t(e), o = vt(e, g);
1952
2040
  return e.location.x < r && e.location.x + t > n && e.location.y < a && e.location.y + o > i;
1953
2041
  }).map((e) => e.id);
1954
2042
  }
1955
- let U = m(null), le = t(() => {
2043
+ let U = m(null), de = t(() => {
1956
2044
  let e = U.value;
1957
2045
  if (!e) return null;
1958
2046
  let t = Math.min(e.start.x, e.cur.x), n = Math.min(e.start.y, e.cur.y);
@@ -1962,107 +2050,107 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
1962
2050
  width: `${Math.abs(e.cur.x - e.start.x)}px`,
1963
2051
  height: `${Math.abs(e.cur.y - e.start.y)}px`
1964
2052
  };
1965
- }), W = null, ue = !1;
1966
- function de(e) {
2053
+ }), W = null, fe = !1;
2054
+ function pe(e) {
1967
2055
  if (W) {
1968
- if (!ue) {
2056
+ if (!fe) {
1969
2057
  let t = e.clientX - W.clientX, n = e.clientY - W.clientY;
1970
- if (Math.hypot(t, n) < Ln) return;
1971
- ue = !0;
2058
+ if (Math.hypot(t, n) < Gn) return;
2059
+ fe = !0;
1972
2060
  }
1973
2061
  U.value = {
1974
2062
  start: W.world,
1975
- cur: G(e.clientX, e.clientY)
2063
+ cur: K(e.clientX, e.clientY)
1976
2064
  };
1977
2065
  }
1978
2066
  }
1979
- function fe() {
1980
- window.removeEventListener("pointermove", de), window.removeEventListener("pointerup", fe), ue && U.value ? z.value = ce(U.value.start, U.value.cur) : W && (H(), K.value = null), U.value = null, W = null, ue = !1;
2067
+ function G() {
2068
+ window.removeEventListener("pointermove", pe), window.removeEventListener("pointerup", G), fe && U.value ? B.value = ue(U.value.start, U.value.cur) : W && (H(), q.value = null), U.value = null, W = null, fe = !1;
1981
2069
  }
1982
- let pe = t(() => ({ transform: `translate(${F.value}px, ${I.value}px) scale(${R.value})` }));
1983
- function G(e, t) {
2070
+ let ge = t(() => ({ transform: `translate(${F.value}px, ${I.value}px) scale(${R.value})` }));
2071
+ function K(e, t) {
1984
2072
  let n = P.value?.getBoundingClientRect(), r = n?.left ?? 0, i = n?.top ?? 0;
1985
2073
  return {
1986
2074
  x: (e - r - F.value) / R.value,
1987
2075
  y: (t - i - I.value) / R.value
1988
2076
  };
1989
2077
  }
1990
- function ge(e, t) {
2078
+ function _e(e, t) {
1991
2079
  let n = P.value?.getBoundingClientRect();
1992
2080
  return {
1993
2081
  x: e - (n?.left ?? 0),
1994
2082
  y: t - (n?.top ?? 0)
1995
2083
  };
1996
2084
  }
1997
- let K = m(null);
1998
- function _e(e) {
2085
+ let q = m(null);
2086
+ function ve(e) {
1999
2087
  if (e === "composite/group") {
2000
2088
  ye();
2001
2089
  return;
2002
2090
  }
2003
2091
  let t = b.value.nodeTypes[e];
2004
2092
  if (t) {
2005
- let e = K.value?.world ?? {
2093
+ let e = q.value?.world ?? {
2006
2094
  x: 0,
2007
2095
  y: 0
2008
2096
  }, n = L(t, {
2009
2097
  x: e.x,
2010
2098
  y: e.y
2011
2099
  });
2012
- b.value.graph.nodes.push(n), ke(b.value), se(n.id, !1);
2100
+ b.value.graph.nodes.push(n), Be(b.value), le(n.id, !1);
2013
2101
  }
2014
- K.value = null;
2102
+ q.value = null;
2015
2103
  }
2016
2104
  function ye() {
2017
- let e = K.value?.world ?? {
2105
+ let e = q.value?.world ?? {
2018
2106
  x: 0,
2019
2107
  y: 0
2020
2108
  }, t = b.value.graph, n = me(_.map, {
2021
2109
  x: e.x,
2022
2110
  y: e.y
2023
- }), r = Be(_.map, v.value, n, t);
2111
+ }), r = Ze(_.map, v.value, n, t);
2024
2112
  if (r) {
2025
- console.warn(`[Group] ${r}`), K.value = null;
2113
+ console.warn(`[Group] ${r}`), q.value = null;
2026
2114
  return;
2027
2115
  }
2028
- t.nodes.push(n), ke(b.value), se(n.id, !1), K.value = null;
2116
+ t.nodes.push(n), Be(b.value), le(n.id, !1), q.value = null;
2029
2117
  }
2030
- let q = m(null), J = m(null), Se = m(null), De = t(() => {
2031
- let e = q.value, t = J.value;
2118
+ let J = m(null), Y = m(null), xe = m(null), Se = t(() => {
2119
+ let e = J.value, t = Y.value;
2032
2120
  if (!e || !t) return null;
2033
- let n = Le(t, e.dir === "output" ? "input" : "output", e.ref.node, Se.value);
2121
+ let n = Me(t, e.dir === "output" ? "input" : "output", e.ref.node, xe.value);
2034
2122
  if (!n) return null;
2035
2123
  let r = b.value.graph.nodes.find((e) => e.id === n.node);
2036
- return r ? ft(r, n.port, g) : null;
2037
- }), je = t(() => {
2038
- let e = q.value, t = J.value;
2124
+ return r ? bt(r, n.port, g) : null;
2125
+ }), Te = t(() => {
2126
+ let e = J.value, t = Y.value;
2039
2127
  if (!e || !t) return null;
2040
- let n = De.value ?? t;
2041
- return e.dir === "output" ? mt(e.pos, n) : mt(n, e.pos);
2128
+ let n = Se.value ?? t;
2129
+ return e.dir === "output" ? St(e.pos, n) : St(n, e.pos);
2042
2130
  });
2043
- function Y(e, t, n) {
2044
- let r = b.value.graph.nodes.find((t) => t.id === e.node), i = r ? ft(r, e.port, g) : null;
2045
- i && (q.value = {
2131
+ function Ee(e, t, n) {
2132
+ let r = b.value.graph.nodes.find((t) => t.id === e.node), i = r ? bt(r, e.port, g) : null;
2133
+ i && (J.value = {
2046
2134
  ref: e,
2047
2135
  dir: t.direction,
2048
2136
  pos: i
2049
- }, J.value = G(n.clientX, n.clientY), Se.value = new Set(t.direction === "output" ? be(b.value, e.node) : xe(b.value, e.node)), window.addEventListener("pointermove", Ie), window.addEventListener("pointerup", Re));
2137
+ }, Y.value = K(n.clientX, n.clientY), xe.value = new Set(t.direction === "output" ? Ce(b.value, e.node) : we(b.value, e.node)), window.addEventListener("pointermove", je), window.addEventListener("pointerup", Ne));
2050
2138
  }
2051
- function Ie(e) {
2052
- J.value = G(e.clientX, e.clientY);
2139
+ function je(e) {
2140
+ Y.value = K(e.clientX, e.clientY);
2053
2141
  }
2054
- function Le(e, t, n, r) {
2142
+ function Me(e, t, n, r) {
2055
2143
  let i = null, a = Infinity;
2056
2144
  for (let o of b.value.graph.nodes) {
2057
2145
  if (o.id === n || r?.has(o.id)) continue;
2058
- let s = o.location.x - 20, c = o.location.x + lt(o) + 20;
2146
+ let s = o.location.x - 20, c = o.location.x + _t(o) + 20;
2059
2147
  if (e.x < s || e.x > c) continue;
2060
2148
  let l = t === "input" ? o.inputs : o.outputs;
2061
2149
  for (let t of Object.values(l)) {
2062
2150
  if (t.userOnly) continue;
2063
- let n = g(t), r = ft(o, t.id, g);
2151
+ let n = g(t), r = bt(o, t.id, g);
2064
2152
  if (!r) continue;
2065
- let s = st(t, n) / 2;
2153
+ let s = ht(t, n) / 2;
2066
2154
  if (e.y < r.y - s || e.y > r.y + s) continue;
2067
2155
  let c = Math.hypot(r.x - e.x, r.y - e.y);
2068
2156
  c < a && (a = c, i = {
@@ -2073,90 +2161,110 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
2073
2161
  }
2074
2162
  return i;
2075
2163
  }
2076
- function Re() {
2077
- let e = q.value, t = J.value;
2164
+ function Ne() {
2165
+ let e = J.value, t = Y.value;
2078
2166
  if (e && t) {
2079
- let n = Le(t, e.dir === "output" ? "input" : "output", e.ref.node, Se.value);
2167
+ let n = Me(t, e.dir === "output" ? "input" : "output", e.ref.node, xe.value);
2080
2168
  if (n) {
2081
2169
  let t = e.dir === "output" ? e.ref : n, r = e.dir === "output" ? n : e.ref;
2082
- Ce(b.value, t, r);
2170
+ De(b.value, t, r);
2083
2171
  }
2084
2172
  }
2085
- q.value = null, J.value = null, Se.value = null, window.removeEventListener("pointermove", Ie), window.removeEventListener("pointerup", Re);
2173
+ J.value = null, Y.value = null, xe.value = null, window.removeEventListener("pointermove", je), window.removeEventListener("pointerup", Ne);
2086
2174
  }
2087
- let X = m([]), Z = null, Ve = !1, He = t(() => {
2088
- let e = X.value;
2175
+ let Pe = m([]), X = null, Fe = !1, Re = t(() => {
2176
+ let e = Pe.value;
2089
2177
  return e.length < 2 ? null : "M " + e.map((e) => `${e.x} ${e.y}`).join(" L ");
2090
2178
  });
2091
- function Ue(e) {
2179
+ function He(e) {
2092
2180
  e.preventDefault();
2093
2181
  let t = e.target;
2094
- Z = {
2182
+ X = {
2095
2183
  clientX: e.clientX,
2096
2184
  clientY: e.clientY,
2097
- world: G(e.clientX, e.clientY),
2098
- screen: ge(e.clientX, e.clientY),
2185
+ world: K(e.clientX, e.clientY),
2186
+ screen: _e(e.clientX, e.clientY),
2099
2187
  onBackground: !t?.closest(".node") && !t?.closest(".config-bar")
2100
- }, Ve = !1, X.value = [Z.world], window.addEventListener("pointermove", We), window.addEventListener("pointerup", Q);
2101
- }
2102
- function We(e) {
2103
- if (!Z) return;
2104
- if (!Ve) {
2105
- let t = e.clientX - Z.clientX, n = e.clientY - Z.clientY;
2106
- if (Math.hypot(t, n) < Vn) return;
2107
- Ve = !0;
2188
+ }, Fe = !1, Pe.value = [X.world], window.addEventListener("pointermove", Z), window.addEventListener("pointerup", Je);
2189
+ }
2190
+ function Z(e) {
2191
+ if (!X) return;
2192
+ if (!Fe) {
2193
+ let t = e.clientX - X.clientX, n = e.clientY - X.clientY;
2194
+ if (Math.hypot(t, n) < Yn) return;
2195
+ Fe = !0;
2108
2196
  }
2109
- let t = G(e.clientX, e.clientY), n = X.value, r = n[n.length - 1];
2110
- n.push(t), r && Ge(r, t);
2197
+ let t = K(e.clientX, e.clientY), n = Pe.value, r = n[n.length - 1];
2198
+ n.push(t), r && qe(r, t);
2111
2199
  }
2112
- function Ge(e, t) {
2200
+ function qe(e, t) {
2113
2201
  for (let n of [...b.value.graph.connections]) {
2114
2202
  let r = b.value.graph.nodes.find((e) => e.id === n.from.node), i = b.value.graph.nodes.find((e) => e.id === n.to.node);
2115
2203
  if (!r || !i) continue;
2116
- let a = ft(r, n.from.port, g), o = ft(i, n.to.port, g);
2204
+ let a = bt(r, n.from.port, g), o = bt(i, n.to.port, g);
2117
2205
  if (!a || !o) continue;
2118
- let s = ht(a, o);
2119
- for (let r = 0; r < s.length - 1; r++) if (gt(e, t, s[r], s[r + 1])) {
2120
- we(b.value, n.id);
2206
+ let s = Ct(a, o);
2207
+ for (let r = 0; r < s.length - 1; r++) if (wt(e, t, s[r], s[r + 1])) {
2208
+ Oe(b.value, n.id);
2121
2209
  break;
2122
2210
  }
2123
2211
  }
2124
2212
  }
2125
- function Q() {
2126
- window.removeEventListener("pointermove", We), window.removeEventListener("pointerup", Q);
2127
- let e = Z, t = Ve;
2128
- X.value = [], Z = null, Ve = !1, !t && e && e.onBackground && (K.value = {
2213
+ function Je() {
2214
+ window.removeEventListener("pointermove", Z), window.removeEventListener("pointerup", Je);
2215
+ let e = X, t = Fe;
2216
+ Pe.value = [], X = null, Fe = !1, !t && e && e.onBackground && (q.value = {
2129
2217
  screen: e.screen,
2130
2218
  world: e.world
2131
2219
  });
2132
2220
  }
2133
- function Ke() {
2221
+ function Ye() {
2134
2222
  F.value = 0, I.value = 0, R.value = 1;
2135
2223
  }
2136
- function qe() {
2137
- v.value = [], H(), K.value = null, S.value++;
2224
+ function Qe() {
2225
+ v.value = [], H(), q.value = null, C.value++;
2226
+ }
2227
+ c({ resetView: Qe });
2228
+ function $e(e) {
2229
+ let t = e.target;
2230
+ return t instanceof HTMLElement && !!t.closest("input, textarea, select");
2231
+ }
2232
+ function Q(e) {
2233
+ re.value = K(e.clientX, e.clientY);
2138
2234
  }
2139
- c({ resetView: qe });
2140
- function Je(e) {
2235
+ function et(e) {
2141
2236
  if (e.key === "Escape") {
2142
- K.value ? K.value = null : v.value.length ? te() : z.value.length ? H() : Ke();
2237
+ q.value ? q.value = null : v.value.length ? ee() : B.value.length ? H() : Ye();
2143
2238
  return;
2144
2239
  }
2145
- if (e.key !== "Delete" && e.key !== "Backspace") return;
2146
- let t = e.target;
2147
- if (!(t instanceof HTMLElement && t.closest("input, textarea, select")) && z.value.length) {
2148
- for (let e of z.value) Te(b.value, e) && Ee(b.value, e);
2240
+ let t = e.ctrlKey || e.metaKey;
2241
+ if (t && e.key === "c") {
2242
+ if ($e(e)) return;
2243
+ let t = Ie(ae.value, b.value.graph.connections, re.value);
2244
+ t && (z.value = t), e.preventDefault();
2245
+ return;
2246
+ }
2247
+ if (t && e.key === "v") {
2248
+ if ($e(e) || !z.value) return;
2249
+ let t = Le(b.value, z.value, re.value);
2250
+ Be(b.value);
2251
+ for (let e of t) Ve(b.value, e);
2252
+ B.value = t, e.preventDefault();
2253
+ return;
2254
+ }
2255
+ if (!(e.key !== "Delete" && e.key !== "Backspace") && !$e(e) && B.value.length) {
2256
+ for (let e of B.value) ke(b.value, e) && Ae(b.value, e);
2149
2257
  H(), e.preventDefault();
2150
2258
  }
2151
2259
  }
2152
- function Ye(e) {
2260
+ function tt(e) {
2153
2261
  e.preventDefault();
2154
2262
  let t = P.value;
2155
2263
  if (!t) return;
2156
- let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = (r - F.value) / R.value, o = (i - I.value) / R.value, s = Math.min(zn, Math.max(Rn, R.value * (1 - e.deltaY * Bn)));
2264
+ let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = (r - F.value) / R.value, o = (i - I.value) / R.value, s = Math.min(qn, Math.max(Kn, R.value * (1 - e.deltaY * Jn)));
2157
2265
  F.value = r - a * s, I.value = i - o * s, R.value = s;
2158
2266
  }
2159
- function Xe(e) {
2267
+ function nt(e) {
2160
2268
  let t = e.clientX, n = e.clientY, r = F.value, i = I.value;
2161
2269
  ne.value = !0;
2162
2270
  function a(e) {
@@ -2167,49 +2275,50 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
2167
2275
  }
2168
2276
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
2169
2277
  }
2170
- function $(e) {
2278
+ function rt(e) {
2171
2279
  e.button === 0 && (e.stopPropagation(), W = {
2172
2280
  clientX: e.clientX,
2173
2281
  clientY: e.clientY,
2174
- world: G(e.clientX, e.clientY)
2175
- }, ue = !1, window.addEventListener("pointermove", de), window.addEventListener("pointerup", fe));
2282
+ world: K(e.clientX, e.clientY)
2283
+ }, fe = !1, window.addEventListener("pointermove", pe), window.addEventListener("pointerup", G));
2176
2284
  }
2177
- function Ze(e) {
2178
- e.button === 1 ? (e.preventDefault(), Xe(e)) : e.button === 2 && Ue(e);
2285
+ function it(e) {
2286
+ e.button === 1 ? (e.preventDefault(), nt(e)) : e.button === 2 && He(e);
2179
2287
  }
2180
- let Qe;
2288
+ let $;
2181
2289
  return d(() => {
2182
- window.addEventListener("keydown", Je), ke(b.value), Qe = window.setInterval(() => Oe(b.value), Hn);
2290
+ window.addEventListener("keydown", et), Be(b.value), $ = window.setInterval(() => ze(b.value), Xn);
2183
2291
  }), f(() => {
2184
- window.removeEventListener("keydown", Je), Qe !== void 0 && window.clearInterval(Qe);
2292
+ window.removeEventListener("keydown", et), $ !== void 0 && window.clearInterval($);
2185
2293
  }), (t, s) => (p(), i("div", {
2186
2294
  ref_key: "viewerEl",
2187
2295
  ref: P,
2188
2296
  class: l(["viewer", { panning: ne.value }]),
2189
- onWheel: Ye,
2190
- onPointerdown: Ze,
2191
- onContextmenu: s[3] ||= w(() => {}, ["prevent"])
2297
+ onWheel: tt,
2298
+ onPointerdown: it,
2299
+ onPointermove: Q,
2300
+ onContextmenu: s[3] ||= T(() => {}, ["prevent"])
2192
2301
  }, [
2193
2302
  a("div", {
2194
2303
  class: "top-right-stack",
2195
- onPointerdown: s[1] ||= w(() => {}, ["stop"])
2196
- }, [v.value.length ? (p(), n(vn, {
2304
+ onPointerdown: s[1] ||= T(() => {}, ["stop"])
2305
+ }, [v.value.length ? (p(), n(En, {
2197
2306
  key: 0,
2198
- composite: T.value,
2199
- "io-widgets": E.value,
2200
- onUp: te,
2201
- "onUpdate:ioWidgets": s[0] ||= (e) => E.value = e
2202
- }, null, 8, ["composite", "io-widgets"])) : r("", !0), re.value ? (p(), n(fn, {
2307
+ composite: E.value,
2308
+ "io-widgets": D.value,
2309
+ onUp: ee,
2310
+ "onUpdate:ioWidgets": s[0] ||= (e) => D.value = e
2311
+ }, null, 8, ["composite", "io-widgets"])) : r("", !0), V.value ? (p(), n(bn, {
2203
2312
  key: 1,
2204
2313
  class: "stacked-panel",
2205
2314
  map: b.value,
2206
- nodes: V.value,
2207
- def: ie.value,
2315
+ nodes: ae.value,
2316
+ def: oe.value,
2208
2317
  "graph-interface": x.value,
2209
- "interface-revision": S.value,
2210
- "interface-commit-error": C.value,
2211
- "apply-interface-mutation": O,
2212
- error: V.value.length === 1 ? M.value[re.value.id] : void 0
2318
+ "interface-revision": C.value,
2319
+ "interface-commit-error": w.value,
2320
+ "apply-interface-mutation": k,
2321
+ error: ae.value.length === 1 ? N.value[V.value.id] : void 0
2213
2322
  }, null, 8, [
2214
2323
  "map",
2215
2324
  "nodes",
@@ -2221,39 +2330,39 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
2221
2330
  ])) : r("", !0)], 32),
2222
2331
  a("div", {
2223
2332
  class: "viewport",
2224
- style: u(pe.value)
2333
+ style: u(ge.value)
2225
2334
  }, [
2226
2335
  a("div", {
2227
2336
  class: "canvas-bg",
2228
- onPointerdown: $
2337
+ onPointerdown: rt
2229
2338
  }, null, 32),
2230
- o(jt, {
2339
+ o(zt, {
2231
2340
  map: b.value,
2232
- "pending-path": je.value,
2233
- "slice-path": He.value
2341
+ "pending-path": Te.value,
2342
+ "slice-path": Re.value
2234
2343
  }, null, 8, [
2235
2344
  "map",
2236
2345
  "pending-path",
2237
2346
  "slice-path"
2238
2347
  ]),
2239
- le.value ? (p(), i("div", {
2348
+ de.value ? (p(), i("div", {
2240
2349
  key: 0,
2241
2350
  class: "marquee",
2242
- style: u(le.value)
2351
+ style: u(de.value)
2243
2352
  }, null, 4)) : r("", !0),
2244
- (p(!0), i(e, null, h(b.value.graph.nodes, (e) => (p(), n(Et, {
2353
+ (p(!0), i(e, null, h(b.value.graph.nodes, (e) => (p(), n(Pt, {
2245
2354
  key: e.id,
2246
2355
  node: e,
2247
2356
  map: b.value,
2248
2357
  zoom: R.value,
2249
- "io-widgets": D.value,
2250
- "io-results": j.value,
2251
- selected: z.value.includes(e.id),
2252
- "selected-ids": B.value,
2253
- error: M.value[e.id],
2254
- onConnectStart: Y,
2255
- onSelect: se,
2256
- onDrillIn: k
2358
+ "io-widgets": O.value,
2359
+ "io-results": M.value,
2360
+ selected: B.value.includes(e.id),
2361
+ "selected-ids": ie.value,
2362
+ error: N.value[e.id],
2363
+ onConnectStart: Ee,
2364
+ onSelect: le,
2365
+ onDrillIn: A
2257
2366
  }, null, 8, [
2258
2367
  "node",
2259
2368
  "map",
@@ -2265,25 +2374,25 @@ var Sn = ["title"], Cn = { class: "picker-body" }, wn = { class: "list" }, Tn =
2265
2374
  "error"
2266
2375
  ]))), 128))
2267
2376
  ], 4),
2268
- K.value ? (p(), n(In, {
2377
+ q.value ? (p(), n(Wn, {
2269
2378
  key: 0,
2270
2379
  map: b.value,
2271
- screen: K.value.screen,
2272
- onSelect: _e,
2380
+ screen: q.value.screen,
2381
+ onSelect: ve,
2273
2382
  onAddComposite: ye,
2274
- onClose: s[2] ||= (e) => K.value = null
2383
+ onClose: s[2] ||= (e) => q.value = null
2275
2384
  }, null, 8, ["map", "screen"])) : r("", !0)
2276
2385
  ], 34));
2277
2386
  }
2278
- }), [["__scopeId", "data-v-ff1ea32f"]]);
2387
+ }), [["__scopeId", "data-v-0d57969f"]]);
2279
2388
  //#endregion
2280
2389
  //#region src/components/types/registerDefaultTypeWidgets.ts
2281
- function Wn() {
2282
- nt("number", Ke), nt("string", $);
2390
+ function Qn() {
2391
+ ut("number", et), ut("string", $);
2283
2392
  }
2284
2393
  //#endregion
2285
2394
  //#region src/store/graph/createNodeMap.ts
2286
- function Gn(e = {}) {
2395
+ function $n(e = {}) {
2287
2396
  let t = {
2288
2397
  graph: e.graph ?? {
2289
2398
  nodes: [],
@@ -2292,116 +2401,116 @@ function Gn(e = {}) {
2292
2401
  types: {},
2293
2402
  nodeTypes: {},
2294
2403
  extensions: e.extensions ? [...e.extensions] : [],
2295
- graphInterface: R(e.graphInterface ?? j),
2404
+ graphInterface: R(e.graphInterface ?? M),
2296
2405
  registrationMeta: {
2297
2406
  types: {},
2298
2407
  nodeTypes: {}
2299
2408
  },
2300
2409
  loadPack: () => []
2301
2410
  };
2302
- return e.types && N(t, e.types), e.nodeTypes && P(t, e.nodeTypes), ae(t, t.graphInterface), se(t), t;
2411
+ return e.types && te(t, e.types), e.nodeTypes && P(t, e.nodeTypes), V(t, t.graphInterface), se(t), t;
2303
2412
  }
2304
2413
  //#endregion
2305
2414
  //#region src/store/packs/installPack.ts
2306
- function Kn(e, t) {
2415
+ function er(e, t) {
2307
2416
  return t ?? e.priority ?? 0;
2308
2417
  }
2309
- function qn(e, t) {
2418
+ function tr(e, t) {
2310
2419
  return e.registrationMeta.types[t]?.priority ?? 0;
2311
2420
  }
2312
- function Jn(e, t) {
2421
+ function nr(e, t) {
2313
2422
  return e.registrationMeta.types[t]?.packId ?? "unknown";
2314
2423
  }
2315
- function Yn(e, t) {
2424
+ function rr(e, t) {
2316
2425
  return e.registrationMeta.nodeTypes[t]?.priority ?? 0;
2317
2426
  }
2318
- function Xn(e, t) {
2427
+ function ir(e, t) {
2319
2428
  return e.registrationMeta.nodeTypes[t]?.packId ?? "unknown";
2320
2429
  }
2321
- function Zn(e, t, n, r, i) {
2430
+ function ar(e, t, n, r, i) {
2322
2431
  if (!e.types[r]) return e.types[r] = i, e.registrationMeta.types[r] = {
2323
2432
  packId: t,
2324
2433
  priority: n
2325
2434
  }, null;
2326
- let a = qn(e, r);
2435
+ let a = tr(e, r);
2327
2436
  return n > a ? (e.types[r] = i, e.registrationMeta.types[r] = {
2328
2437
  packId: t,
2329
2438
  priority: n
2330
- }, null) : n < a ? null : `type "${r}" already registered by pack "${Jn(e, r)}" with priority ${a}`;
2439
+ }, null) : n < a ? null : `type "${r}" already registered by pack "${nr(e, r)}" with priority ${a}`;
2331
2440
  }
2332
- function Qn(e, t, n, r, i) {
2333
- if (!e.nodeTypes[r]) return e.nodeTypes[r] = M(i), e.registrationMeta.nodeTypes[r] = {
2441
+ function or(e, t, n, r, i) {
2442
+ if (!e.nodeTypes[r]) return e.nodeTypes[r] = N(i), e.registrationMeta.nodeTypes[r] = {
2334
2443
  packId: t,
2335
2444
  priority: n
2336
2445
  }, null;
2337
- let a = Yn(e, r);
2338
- return n > a ? (e.nodeTypes[r] = M(i), e.registrationMeta.nodeTypes[r] = {
2446
+ let a = rr(e, r);
2447
+ return n > a ? (e.nodeTypes[r] = N(i), e.registrationMeta.nodeTypes[r] = {
2339
2448
  packId: t,
2340
2449
  priority: n
2341
- }, null) : n < a ? null : `node type "${r}" already registered by pack "${Xn(e, r)}" with priority ${a}`;
2450
+ }, null) : n < a ? null : `node type "${r}" already registered by pack "${ir(e, r)}" with priority ${a}`;
2342
2451
  }
2343
- function $n(e, t, n) {
2452
+ function sr(e, t, n) {
2344
2453
  if (e.extensions.includes(t.id)) return [];
2345
2454
  let r = [];
2346
2455
  if (t.types) for (let [n, i] of Object.entries(t.types)) {
2347
- let a = Zn(e, t.id, Kn(t, i.priority), n, i);
2456
+ let a = ar(e, t.id, er(t, i.priority), n, i);
2348
2457
  a && r.push(a);
2349
2458
  }
2350
2459
  if (t.nodeTypes) for (let [n, i] of Object.entries(t.nodeTypes)) {
2351
- let a = Qn(e, t.id, Kn(t, i.priority), n, i);
2460
+ let a = or(e, t.id, er(t, i.priority), n, i);
2352
2461
  a && r.push(a);
2353
2462
  }
2354
2463
  return r.length ? r : (F(e, t), n && t.setup?.(n), []);
2355
2464
  }
2356
2465
  //#endregion
2357
2466
  //#region src/vue/attachLoadPack.ts
2358
- function er() {
2467
+ function cr() {
2359
2468
  return {
2360
- registerTypeWidget: nt,
2361
- registerComponentWidget: rt
2469
+ registerTypeWidget: ut,
2470
+ registerComponentWidget: dt
2362
2471
  };
2363
2472
  }
2364
- function tr(e) {
2365
- e.loadPack = (t) => $n(e, t, er());
2473
+ function lr(e) {
2474
+ e.loadPack = (t) => sr(e, t, cr());
2366
2475
  }
2367
2476
  //#endregion
2368
2477
  //#region src/vue/createNodeMap.ts
2369
- var nr = !1;
2370
- function rr(e = {}) {
2371
- nr ||= (Wn(), !0);
2372
- let t = Gn(e);
2373
- tr(t);
2478
+ var ur = !1;
2479
+ function dr(e = {}) {
2480
+ ur ||= (Qn(), !0);
2481
+ let t = $n(e);
2482
+ lr(t);
2374
2483
  for (let n of e.packs ?? []) t.loadPack(n);
2375
2484
  return t;
2376
2485
  }
2377
2486
  //#endregion
2378
2487
  //#region src/store/graph/validateGraphTypes.ts
2379
- function ir(e, t, n, r, i) {
2380
- for (let a of G(n)) e.types[a] || i.push(`node "${t.label ?? t.typeId}" (${t.id}): unknown ${r} port type "${a}" on port "${n.name}"`);
2488
+ function fr(e, t, n, r, i) {
2489
+ for (let a of ve(n)) e.types[a] || i.push(`node "${t.label ?? t.typeId}" (${t.id}): unknown ${r} port type "${a}" on port "${n.name}"`);
2381
2490
  }
2382
- function ar(e, t, n) {
2491
+ function pr(e, t, n) {
2383
2492
  e.nodeTypes[t.typeId] || n.push(`node "${t.label ?? t.id}": unknown typeId "${t.typeId}"`);
2384
- for (let r of Object.values(t.inputs)) ir(e, t, r, "input", n);
2385
- for (let r of Object.values(t.outputs)) ir(e, t, r, "output", n);
2386
- t.composite?.graph && or(e, t.composite.graph, n);
2493
+ for (let r of Object.values(t.inputs)) fr(e, t, r, "input", n);
2494
+ for (let r of Object.values(t.outputs)) fr(e, t, r, "output", n);
2495
+ t.composite?.graph && mr(e, t.composite.graph, n);
2387
2496
  }
2388
- function or(e, t, n = []) {
2389
- for (let r of t.nodes) ar(e, r, n);
2497
+ function mr(e, t, n = []) {
2498
+ for (let r of t.nodes) pr(e, r, n);
2390
2499
  return n;
2391
2500
  }
2392
2501
  //#endregion
2393
2502
  //#region src/store/graph/document.ts
2394
- function sr(e) {
2503
+ function hr(e) {
2395
2504
  return {
2396
2505
  graph: R(e.graph),
2397
2506
  interface: R(e.graphInterface),
2398
2507
  extensions: e.extensions.length ? [...e.extensions] : void 0
2399
2508
  };
2400
2509
  }
2401
- function cr(e) {
2402
- return sr(e);
2510
+ function gr(e) {
2511
+ return hr(e);
2403
2512
  }
2404
- function lr(e) {
2513
+ function _r(e) {
2405
2514
  let t;
2406
2515
  try {
2407
2516
  t = JSON.parse(e);
@@ -2417,26 +2526,26 @@ function lr(e) {
2417
2526
  if (n.extensions !== void 0 && (!Array.isArray(n.extensions) || n.extensions.some((e) => typeof e != "string"))) throw Error("extensions must be an array of strings");
2418
2527
  return n;
2419
2528
  }
2420
- function ur(e, t) {
2529
+ function vr(e, t) {
2421
2530
  return t?.length ? t.filter((t) => !e.extensions.includes(t)).map((e) => `missing pack "${e}" (call map.loadPack() before import)`) : [];
2422
2531
  }
2423
- function dr(e, t) {
2532
+ function yr(e, t) {
2424
2533
  let n = [];
2425
- return n.push(...ur(e, t.extensions)), n.push(...ce({
2534
+ return n.push(...vr(e, t.extensions)), n.push(...le({
2426
2535
  ...e,
2427
2536
  graph: t.graph
2428
- })), n.push(...z(e, t.interface)), n.push(...or(e, t.graph)), n;
2537
+ })), n.push(...re(e, t.interface)), n.push(...mr(e, t.graph)), n;
2429
2538
  }
2430
- function fr(e, t) {
2431
- let n = ur(e, t.extensions);
2432
- return n.length ? n : (e.graph = R(t.graph), e.graphInterface = R(t.interface), ae(e, e.graphInterface), se(e), n.push(...dr(e, t)), n);
2539
+ function br(e, t) {
2540
+ let n = vr(e, t.extensions);
2541
+ return n.length ? n : (e.graph = R(t.graph), e.graphInterface = R(t.interface), V(e, e.graphInterface), se(e), n.push(...yr(e, t)), n);
2433
2542
  }
2434
- function pr(e, t) {
2435
- return fr(e, t);
2543
+ function xr(e, t) {
2544
+ return br(e, t);
2436
2545
  }
2437
2546
  //#endregion
2438
2547
  //#region src/store/registry/defineType.ts
2439
- function mr(e) {
2548
+ function Sr(e) {
2440
2549
  if (e.widgets) {
2441
2550
  let t = Object.keys(e.widgets), n = e.defaultWidget ?? (t.length === 1 ? t[0] : "default");
2442
2551
  return {
@@ -2451,11 +2560,11 @@ function mr(e) {
2451
2560
  widget: e.widget
2452
2561
  } : {};
2453
2562
  }
2454
- function hr(e) {
2455
- let t = mr(e), n = t.widget, r = vr(n);
2563
+ function Cr(e) {
2564
+ let t = Sr(e), n = t.widget, r = Er(n);
2456
2565
  return {
2457
2566
  id: e.id,
2458
- label: e.label ?? gr(e.id),
2567
+ label: e.label ?? wr(e.id),
2459
2568
  color: e.color ?? "#888",
2460
2569
  validate: e.validate,
2461
2570
  accepts: e.accepts,
@@ -2467,14 +2576,14 @@ function hr(e) {
2467
2576
  coerce: e.coerce ?? r.coerce
2468
2577
  };
2469
2578
  }
2470
- function gr(e) {
2579
+ function wr(e) {
2471
2580
  return e.charAt(0).toUpperCase() + e.slice(1);
2472
2581
  }
2473
- function _r(e, t, n) {
2582
+ function Tr(e, t, n) {
2474
2583
  let r = Number(e);
2475
2584
  return Number.isNaN(r) && (r = 0), t !== void 0 && (r = Math.max(t, r)), n !== void 0 && (r = Math.min(n, r)), r;
2476
2585
  }
2477
- function vr(e) {
2586
+ function Er(e) {
2478
2587
  if (!e) return {
2479
2588
  parse: (e) => e,
2480
2589
  format: (e) => e == null ? "" : String(e)
@@ -2483,14 +2592,15 @@ function vr(e) {
2483
2592
  case "number": return {
2484
2593
  parse: (e) => Number(e),
2485
2594
  format: (e) => e == null ? "" : String(e),
2486
- coerce: (t) => _r(t, e.min, e.max)
2595
+ coerce: (t) => Tr(t, e.min, e.max)
2487
2596
  };
2488
2597
  case "text": return {
2489
2598
  parse: (e) => e,
2490
2599
  format: (e) => e == null ? "" : String(e)
2491
2600
  };
2492
2601
  case "custom": return { format: (e) => e == null ? "" : String(e) };
2602
+ case "none": return { format: (e) => e == null ? "" : String(e) };
2493
2603
  }
2494
2604
  }
2495
2605
  //#endregion
2496
- export { B as INPUT_TYPE, Un as NodeViewer, V as OUTPUT_TYPE, fr as applyDocument, ye as assignable, oe as boundaryNodes, rr as createNodeMap, hr as defineType, cr as exportGraph, pr as importGraph, L as instantiate, K as isConnectionOnly, ge as isUnionPort, lr as parseGraphDocument, q as portAccepts, G as portTypes, rt as registerComponentWidget, Wn as registerDefaultTypeWidgets, nt as registerTypeWidget, ve as runGraph, sr as serializeDocument, dr as validateDocument };
2606
+ export { z as INPUT_TYPE, Zn as NodeViewer, B as OUTPUT_TYPE, br as applyDocument, xe as assignable, oe as boundaryNodes, Ie as buildClipboard, dr as createNodeMap, Cr as defineType, gr as exportGraph, xr as importGraph, L as instantiate, J as isConnectionOnly, ye as isUnionPort, _r as parseGraphDocument, Le as pasteClipboard, Se as portAccepts, ve as portTypes, dt as registerComponentWidget, Qn as registerDefaultTypeWidgets, ut as registerTypeWidget, be as runGraph, hr as serializeDocument, yr as validateDocument };