@babsey/code-graph 0.0.13 → 0.0.15

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.
@@ -1,11 +1,11 @@
1
- import { AbstractNode as Le, NodeInterface as Ge, ButtonInterfaceComponent as Ue, CheckboxInterfaceComponent as je, IntegerInterfaceComponent as Re, NumberInterfaceComponent as Pe, SelectInterfaceComponent as De, SliderInterfaceComponent as Ae, TextInputInterfaceComponent as ge, TextareaInputInterfaceComponent as He, NodeInterfaceType as P, BaklavaInterfaceTypes as Fe, setType as j, allowMultipleConnections as Y, IntegerInterface as We, TextInputInterface as Xe, displayInSidebar as Ye, sortTopologically as Je, useViewModel as F, useTemporaryConnection as qe, Components as ve, useGraph as K, GRAPH_NODE_TYPE_PREFIX as J, useTransform as Qe, useNodeCategories as Ze, BaklavaEditor as Ke, DEFAULT_TOOLBAR_COMMANDS as et, useBaklava as tt, DependencyEngine as st, applyResult as nt } from "baklavajs";
2
- import { ButtonInterfaceComponent as cn, CheckboxInterfaceComponent as pn, IntegerInterfaceComponent as hn, NumberInterfaceComponent as vn, SelectInterfaceComponent as mn, SliderInterfaceComponent as fn, TextInputInterfaceComponent as gn, TextareaInputInterfaceComponent as bn } from "baklavajs";
3
- import be from "mustache";
4
- import { reactive as R, defineComponent as G, createElementBlock as l, openBlock as i, toDisplayString as L, markRaw as T, ref as $, computed as f, onMounted as ee, onUpdated as _e, normalizeClass as U, createCommentVNode as N, createElementVNode as r, unref as _, renderSlot as q, createStaticVNode as te, onBeforeUnmount as ot, normalizeStyle as se, withModifiers as D, createBlock as V, withDirectives as ne, Fragment as E, createTextVNode as at, createVNode as S, withKeys as Q, vModelText as oe, renderList as A, nextTick as it, toRef as ye, resolveDynamicComponent as lt, inject as rt, Transition as dt, withCtx as X, onUnmounted as ut, normalizeProps as ct, guardReactiveProps as pt, mergeProps as ht } from "vue";
5
- import vt from "toposort";
6
- import { v4 as mt } from "uuid";
7
- import { usePointer as ft } from "@vueuse/core";
8
- class gt extends Le {
1
+ import { AbstractNode as De, sortTopologically as Ce, NodeInterface as Pe, displayInSidebar as ke, NodeInterfaceType as D, BaklavaInterfaceTypes as Ae, CheckboxInterfaceComponent as He, setType as L, IntegerInterfaceComponent as Fe, NumberInterfaceComponent as We, SelectInterfaceComponent as Xe, SliderInterfaceComponent as Ye, TextInputInterfaceComponent as qe, TextareaInputInterfaceComponent as Je, allowMultipleConnections as Y, IntegerInterface as Qe, TextInputInterface as Ze, useViewModel as F, useTemporaryConnection as Ke, Components as be, useGraph as K, GRAPH_NODE_TYPE_PREFIX as q, useTransform as et, useNodeCategories as tt, BaklavaEditor as st, DEFAULT_TOOLBAR_COMMANDS as nt, useBaklava as ot, DependencyEngine as at, applyResult as it } from "baklavajs";
2
+ import { CheckboxInterfaceComponent as vn, IntegerInterfaceComponent as mn, NumberInterfaceComponent as fn, SelectInterfaceComponent as gn, SliderInterfaceComponent as bn, TextInputInterfaceComponent as _n, TextareaInputInterfaceComponent as yn } from "baklavajs";
3
+ import xe from "mustache";
4
+ import { reactive as G, defineComponent as j, createElementBlock as r, openBlock as i, toDisplayString as E, markRaw as z, ref as O, computed as b, onMounted as ee, onUpdated as Ne, normalizeClass as U, createCommentVNode as I, createElementVNode as d, unref as k, renderSlot as J, createStaticVNode as te, onBeforeUnmount as rt, normalizeStyle as se, withModifiers as P, createBlock as V, withDirectives as ne, Fragment as $, createTextVNode as dt, createVNode as T, withKeys as Q, vModelText as oe, renderList as A, nextTick as lt, toRef as Ie, resolveDynamicComponent as ut, inject as ct, Transition as pt, withCtx as X, onUnmounted as ht, normalizeProps as vt, guardReactiveProps as mt, mergeProps as ft } from "vue";
5
+ import gt from "toposort";
6
+ import { v4 as bt } from "uuid";
7
+ import { usePointer as _t } from "@vueuse/core";
8
+ class yt extends De {
9
9
  state;
10
10
  code;
11
11
  isCodeNode = !0;
@@ -13,7 +13,7 @@ class gt extends Le {
13
13
  inputs = {};
14
14
  outputs = {};
15
15
  constructor() {
16
- super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state = R({
16
+ super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state = G({
17
17
  codeTemplate: "",
18
18
  hidden: !1,
19
19
  integrated: !1,
@@ -22,12 +22,21 @@ class gt extends Le {
22
22
  variableName: ""
23
23
  });
24
24
  }
25
+ get codeNodeInputs() {
26
+ return Object.fromEntries(Object.entries(this.inputs).filter(([e, t]) => t.type != "node"));
27
+ }
25
28
  get idx() {
26
29
  return this.code?.codeNodes.filter((e) => !e.state.integrated).indexOf(this) ?? -1;
27
30
  }
28
31
  get idxByVariableNames() {
29
32
  return this.code?.getNodesBySameVariableNames(this.state.variableName).indexOf(this) ?? -1;
30
33
  }
34
+ get optionalInputs() {
35
+ return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(([e, t]) => t.optional));
36
+ }
37
+ get requiredInputs() {
38
+ return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(([e, t]) => !t.optional));
39
+ }
31
40
  get script() {
32
41
  return this.state.script;
33
42
  }
@@ -45,11 +54,11 @@ class gt extends Le {
45
54
  getConnectedNodes(e) {
46
55
  let t = [];
47
56
  if (e !== "inputs") {
48
- const s = this.graph?.connections.filter((n) => n.from.name !== "_node").filter((n) => n.from.nodeId === this.id).map((n) => n.to.nodeId);
57
+ const s = this.graph?.connections.filter((o) => o.from.name !== "_node").filter((o) => o.from.nodeId === this.id).map((o) => o.to.nodeId);
49
58
  s && (t = t.concat(s));
50
59
  }
51
60
  if (e !== "outputs") {
52
- const s = this.graph?.connections.filter((n) => n.from.name !== "_node").filter((n) => n.to.nodeId === this.id).map((n) => n.from.nodeId);
61
+ const s = this.graph?.connections.filter((o) => o.from.name !== "_node").filter((o) => o.to.nodeId === this.id).map((o) => o.from.nodeId);
53
62
  s && (t = t.concat(s));
54
63
  }
55
64
  return !t || t.length == 0 ? [] : t.map((s) => this.graph?.findNodeById(s));
@@ -65,21 +74,29 @@ class gt extends Le {
65
74
  const e = {};
66
75
  Object.keys(this.inputs).forEach((s) => {
67
76
  if (s === "_node") return;
68
- const n = this.inputs[s], a = n.isString ? `'${n.value}'` : n.value;
69
- n && n.state && (e[s] = n.state.script.length > 0 ? n.state.script : a);
77
+ const o = this.inputs[s], a = _e(o);
78
+ o && o.state && (e[s] = o.state.script.length > 0 ? o.state.script : a);
70
79
  });
71
80
  const t = {};
72
81
  Object.keys(this.outputs).forEach((s) => {
73
82
  if (s === "_node") return;
74
- const n = this.outputs[s], a = n.isString ? `'${n.value}'` : n.value;
75
- n && n.state && (t[s] = a);
76
- }), this.state.script = be.render(this.state.codeTemplate, { inputs: e, outputs: t }), this.outputs.code && (this.outputs.code.state.script = this.state.script);
83
+ const o = this.outputs[s], a = _e(o);
84
+ o && o.state && (t[s] = a);
85
+ }), this.state.script = xe.render(this.state.codeTemplate, { inputs: e, outputs: t }), this.outputs.code && (this.outputs.code.state.script = this.state.script);
86
+ }
87
+ updateCodeNodeInputInterfaces() {
88
+ if (!this.graph) return;
89
+ const { connectionsFromNode: e } = Ce(this.graph);
90
+ e.has(this) && e.get(this).forEach((t) => {
91
+ const s = this.graph?.findNodeById(t.from.nodeId);
92
+ s && (s.renderCode(), t.from.isCodeNode && t.to.isCodeNode && (t.to.state.script = t.from.script));
93
+ });
77
94
  }
78
95
  updateOutputVariableName() {
79
96
  this.outputs.code && (this.outputs.code.name = this.variableName);
80
97
  }
81
98
  }
82
- class we extends gt {
99
+ class Me extends yt {
83
100
  /**
84
101
  * The default implementation does nothing.
85
102
  * Overwrite this method to do calculation.
@@ -89,11 +106,11 @@ class we extends gt {
89
106
  */
90
107
  calculate;
91
108
  load(e) {
92
- super.load(e), xe(this.graph, e);
109
+ super.load(e), Oe(this.graph, e);
93
110
  }
94
111
  save() {
95
112
  const e = super.save();
96
- return bt(this.graph, e), e;
113
+ return wt(this.graph, e), e;
97
114
  }
98
115
  updateModules(e) {
99
116
  if (e)
@@ -104,46 +121,75 @@ class we extends gt {
104
121
  }
105
122
  }
106
123
  }
107
- const xe = (o, e) => {
108
- if (!o) return;
109
- const t = o.findNodeById(e.id);
124
+ const Ys = (n) => {
125
+ const e = [], t = Object.keys(n);
126
+ return t.forEach((s) => {
127
+ if (n[s]?.hidden) return;
128
+ const a = e.length < t.indexOf(s) ? `${s}=` : "";
129
+ e.push(`${a}{{& inputs.${s} }}`);
130
+ }), e;
131
+ }, Oe = (n, e) => {
132
+ if (!n) return;
133
+ const t = n.findNodeById(e.id);
110
134
  if (!t || t.subgraph) return;
111
135
  const s = t;
112
- s.state && (s.state.integrated = e.integrated, s.state.modules = e.modules, s.state.props = e.props), Object.entries(e.inputs).forEach(([n, a]) => {
113
- n !== "_node" && s.inputs[n] && (s.inputs[n].hidden = a.hidden);
114
- }), Object.entries(e.outputs).forEach(([n, a]) => {
115
- n !== "_node" && s.outputs[n] && (s.outputs[n].hidden = a.hidden);
136
+ s.state && (s.state.integrated = e.integrated, s.state.modules = e.modules, s.state.props = e.props), Object.entries(e.inputs).forEach(([o, a]) => {
137
+ o !== "_node" && s.inputs[o] && (s.inputs[o].hidden = a.hidden);
138
+ }), Object.entries(e.outputs).forEach(([o, a]) => {
139
+ o !== "_node" && s.outputs[o] && (s.outputs[o].hidden = a.hidden);
116
140
  });
117
- }, bt = (o, e) => {
118
- if (!o) return;
119
- const t = o.findNodeById(e.id);
141
+ }, wt = (n, e) => {
142
+ if (!n) return;
143
+ const t = n.findNodeById(e.id);
120
144
  if (!t || t.subgraph) return;
121
145
  const s = t;
122
- s.state && (e.integrated = s.state.integrated, e.modules = s.state.modules), Object.entries(e.inputs).forEach(([n, a]) => {
123
- n !== "_node" && s.inputs[n] && (a.hidden = s.inputs[n].hidden);
124
- }), Object.entries(e.outputs).forEach(([n, a]) => {
125
- n !== "_node" && s.outputs[n] && (a.hidden = s.outputs[n].hidden);
146
+ s.state && (e.integrated = s.state.integrated, e.modules = s.state.modules), Object.entries(e.inputs).forEach(([o, a]) => {
147
+ o !== "_node" && s.inputs[o] && (a.hidden = s.inputs[o].hidden);
148
+ }), Object.entries(e.outputs).forEach(([o, a]) => {
149
+ o !== "_node" && s.outputs[o] && (a.hidden = s.outputs[o].hidden);
126
150
  });
127
- }, _t = ["title"], ae = /* @__PURE__ */ G({
151
+ }, _e = (n) => {
152
+ let e;
153
+ if (n.value == null) return "None";
154
+ switch (n.type) {
155
+ case "boolean":
156
+ e = n.value ? "True" : "False";
157
+ break;
158
+ case "string":
159
+ e = `'${n.value}'`;
160
+ break;
161
+ case void 0:
162
+ e = "None";
163
+ break;
164
+ default:
165
+ e = `${n.value}`;
166
+ }
167
+ return e;
168
+ }, Ct = ["title"], ae = /* @__PURE__ */ j({
128
169
  __name: "CodeNodeInterface",
129
170
  props: {
130
171
  intf: {}
131
172
  },
132
- setup(o) {
133
- return (e, t) => (i(), l("div", {
173
+ setup(n) {
174
+ return (e, t) => (i(), r("div", {
134
175
  title: e.intf.state?.script
135
- }, L(e.intf.name), 9, _t));
176
+ }, E(e.intf.name), 9, Ct));
136
177
  }
137
178
  });
138
- class M extends Ge {
139
- optional = !1;
179
+ class R extends Pe {
180
+ isCodeNode = !0;
140
181
  code;
141
182
  state;
183
+ type = null;
142
184
  constructor(e, t) {
143
- super(e, t), this.setComponent(T(ae)), this.state = R({
185
+ super(e, t), this.setComponent(z(ae)), this.state = G({
186
+ optional: !1,
144
187
  script: ""
145
188
  });
146
189
  }
190
+ get optional() {
191
+ return this.state.optional;
192
+ }
147
193
  get shortId() {
148
194
  return this.id.slice(0, 6);
149
195
  }
@@ -155,123 +201,114 @@ class M extends Ge {
155
201
  // if (this.name !== '_node') this.setHidden(false);
156
202
  // }
157
203
  }
158
- class Fs extends M {
159
- component = T(Ue);
160
- callback;
204
+ const qs = (n, e) => {
205
+ n.state.optional = e, n.setHidden(!0);
206
+ };
207
+ class ie extends R {
208
+ constructor(e = "", t) {
209
+ super(e, t), this.setComponent(z(ae)), this.use(ke, !0);
210
+ }
211
+ }
212
+ const $e = new D("boolean"), kt = new D("dict"), xt = new D("list"), H = new D("node"), re = new D("number"), de = new D("string"), Js = (n) => {
213
+ new Ae(n.editor, { viewPlugin: n }).addTypes($e, kt, xt, H, re, de);
214
+ };
215
+ class Qs extends ie {
161
216
  constructor(e, t) {
162
- super(e, void 0), this.callback = t, this.setPort(!1);
217
+ super(e, t), this.setComponent(z(He)), this.use(L, $e);
163
218
  }
164
219
  }
165
- class Ws extends M {
166
- component = T(je);
220
+ class Nt extends R {
221
+ isCodeNodeOutput = !0;
222
+ constructor(e = "", t = "") {
223
+ super(e, t), this.setComponent(z(ae));
224
+ }
225
+ get script() {
226
+ return this.name.length > 0 ? this.name : this.state.script;
227
+ }
167
228
  }
168
- class ie extends M {
229
+ class le extends ie {
169
230
  min;
170
231
  max;
171
- constructor(e, t, s, n) {
172
- super(e, t), this.min = s, this.max = n;
232
+ constructor(e, t, s, o) {
233
+ super(e, t), this.min = s, this.max = o, this.use(L, re);
173
234
  }
174
235
  validate(e) {
175
236
  return (this.min === void 0 || e >= this.min) && (this.max === void 0 || e <= this.max);
176
237
  }
177
238
  }
178
- class Xs extends ie {
179
- component = T(Re);
239
+ class Zs extends le {
240
+ component = z(Fe);
180
241
  validate(e) {
181
242
  return Number.isInteger(e) && super.validate(e);
182
243
  }
183
244
  }
184
- class Ys extends M {
185
- isCodeInput = !0;
186
- constructor(e = "", t) {
187
- super(e, t), this.setComponent(T(ae));
188
- }
245
+ class Ks extends le {
246
+ component = z(We);
189
247
  }
190
- class yt extends M {
191
- isCodeOutput = !0;
192
- constructor(e = "", t = "") {
193
- super(e, t), this.setComponent(T(ae));
194
- }
195
- get script() {
196
- return this.state.script;
197
- }
198
- get value() {
199
- return super.value;
200
- }
201
- set value(e) {
202
- super.value = e, this.state.script = this.name.length > 0 ? this.name : this.value;
248
+ class ue extends ie {
249
+ constructor(e, t) {
250
+ super(e, t), this.use(L, de);
203
251
  }
204
252
  }
205
- class Js extends ie {
206
- component = T(Pe);
207
- }
208
- class qs extends M {
209
- component = T(De);
253
+ class en extends ue {
254
+ component = z(Xe);
210
255
  items;
211
256
  constructor(e, t, s) {
212
257
  super(e, t), this.items = s;
213
258
  }
214
259
  }
215
- class Qs extends ie {
216
- component = T(Ae);
260
+ class tn extends le {
261
+ component = z(Ye);
217
262
  min;
218
263
  max;
219
- constructor(e, t, s, n) {
220
- super(e, t, s, n), this.min = s, this.max = n;
221
- }
222
- }
223
- class Zs extends M {
224
- component = T(ge);
225
- constructor(e, t) {
226
- super(e, t), this.setPort(!1);
264
+ constructor(e, t, s, o) {
265
+ super(e, t, s, o), this.min = s, this.max = o;
227
266
  }
228
267
  }
229
- class Ks extends M {
230
- isString = !0;
231
- component = T(ge);
268
+ class sn extends ue {
269
+ component = z(qe);
232
270
  }
233
- class en extends M {
234
- component = T(He);
271
+ class nn extends ue {
272
+ component = z(Je);
235
273
  }
236
- const wt = new P("boolean"), xt = new P("dict"), kt = new P("list"), H = new P("node"), ke = new P("number"), Ce = new P("string"), tn = (o) => {
237
- new Fe(o.editor, { viewPlugin: o }).addTypes(Ce, H, ke, wt, xt, kt);
238
- };
239
- function sn(o) {
240
- return class extends we {
241
- type = o.type;
274
+ function on(n) {
275
+ return class extends Me {
276
+ type = n.type;
242
277
  inputs = {};
243
278
  outputs = {};
244
279
  constructor() {
245
- super(), this._title = o.title ?? o.type, this.updateModules(o.modules), o.variableName && (this.state.variableName = o.variableName), o.codeTemplate && (this.codeTemplate = o.codeTemplate), this.addInput(
280
+ super(), this._title = n.title ?? n.type, this.updateModules(n.modules), n.variableName && (this.state.variableName = n.variableName), n.codeTemplate && (this.codeTemplate = n.codeTemplate), this.addInput(
246
281
  "_node",
247
- new M("", []).use(j, H).use(Y).setHidden(!0)
282
+ new R("", []).use(L, H).use(Y).setHidden(!0)
248
283
  ), this.addOutput(
249
284
  "_node",
250
- new M("", []).use(j, H).use(Y).setHidden(!0)
251
- ), this.executeFactory("input", o.inputs), this.executeFactory("output", o.outputs), o.onCreate?.call(this);
285
+ new R("", []).use(L, H).use(Y).setHidden(!0)
286
+ ), this.executeFactory("input", n.inputs), this.executeFactory("output", n.outputs), n.onCreate?.call(this);
252
287
  }
253
- calculate = o.calculate ? (e, t) => ({
254
- ...o.calculate.call(this, e, t),
255
- _node: null
256
- }) : void 0;
288
+ // public calculate = definition.calculate
289
+ // ? (inputs: I, globalValues: CalculationContext) => ({
290
+ // ...definition.calculate!.call(this, inputs, globalValues),
291
+ // _node: null,
292
+ // })
293
+ // : undefined
257
294
  onPlaced() {
258
- o.onPlaced?.call(this);
295
+ n.onPlaced?.call(this);
259
296
  }
260
297
  onDestroy() {
261
- o.onDestroy?.call(this);
298
+ n.onDestroy?.call(this);
262
299
  }
263
300
  onCodeUpdate() {
264
- o.onCodeUpdate?.call(this);
301
+ n.onCodeUpdate?.call(this);
265
302
  }
266
303
  executeFactory(e, t) {
267
304
  Object.keys(t || {}).forEach((s) => {
268
- const n = t[s]();
269
- e === "input" ? this.addInput(s, n) : this.addOutput(s, n);
305
+ const o = t[s]();
306
+ e === "input" ? this.addInput(s, o) : this.addOutput(s, o);
270
307
  });
271
308
  }
272
309
  };
273
310
  }
274
- class Ct extends we {
311
+ class It extends Me {
275
312
  /**
276
313
  * The default implementation does nothing.
277
314
  * Overwrite this method to do calculation.
@@ -281,37 +318,34 @@ class Ct extends we {
281
318
  */
282
319
  calculate;
283
320
  }
284
- function nn(o) {
285
- return class extends Ct {
286
- type = o.type;
321
+ function an(n) {
322
+ return class extends It {
323
+ type = n.type;
287
324
  inputs = {};
288
325
  outputs = {};
289
326
  calculate;
290
327
  preventUpdate = !1;
291
- staticInputKeys = Object.keys(o.inputs ?? {});
292
- staticOutputKeys = Object.keys(o.outputs ?? {});
328
+ staticInputKeys = Object.keys(n.inputs ?? {});
329
+ staticOutputKeys = Object.keys(n.outputs ?? {});
293
330
  constructor() {
294
- super(), this._title = o.title ?? o.type, this.updateModules(o.modules), o.codeTemplate && (this.codeTemplate = o.codeTemplate), o.variableName && (this.state.variableName = o.variableName), this.addInput(
331
+ super(), this._title = n.title ?? n.type, this.updateModules(n.modules), n.codeTemplate && (this.codeTemplate = n.codeTemplate), n.variableName && (this.state.variableName = n.variableName), this.addInput(
295
332
  "_node",
296
- new M("", []).use(j, H).use(Y).setHidden(!0)
333
+ new R("", []).use(L, H).use(Y).setHidden(!0)
297
334
  ), this.addOutput(
298
335
  "_node",
299
- new M("", []).use(j, H).use(Y).setHidden(!0)
300
- ), this.staticInputKeys.push("_node"), this.staticOutputKeys.push("_node"), this.executeFactory("input", o.inputs), this.executeFactory("output", o.outputs), o.calculate && (this.calculate = (e, t) => ({
301
- ...o.calculate?.call(this, e, t),
302
- _node: null
303
- })), o.onCreate?.call(this);
336
+ new R("", []).use(L, H).use(Y).setHidden(!0)
337
+ ), this.staticInputKeys.push("_node"), this.staticOutputKeys.push("_node"), this.executeFactory("input", n.inputs), this.executeFactory("output", n.outputs), n.onCreate?.call(this);
304
338
  }
305
339
  onPlaced() {
306
340
  this.events.update.subscribe(this, (e) => {
307
341
  e && (e.type === "input" && this.staticInputKeys.includes(e.name) || e.type === "output" && this.staticOutputKeys.includes(e.name)) && this.onUpdate();
308
- }), this.onUpdate(), o.onPlaced?.call(this);
342
+ }), this.onUpdate(), n.onPlaced?.call(this);
309
343
  }
310
344
  onDestroy() {
311
- o.onDestroy?.call(this);
345
+ n.onDestroy?.call(this);
312
346
  }
313
347
  onCodeUpdate() {
314
- o.onCodeUpdate?.call(this);
348
+ n.onCodeUpdate?.call(this);
315
349
  }
316
350
  load(e) {
317
351
  this.preventUpdate = !0, this.hooks.beforeLoad.execute(e), this.id = e.id, this.title = e.title;
@@ -324,57 +358,57 @@ function nn(o) {
324
358
  if (!this.staticInputKeys.includes(t)) {
325
359
  if (!this.inputs[t]) {
326
360
  const s = e.inputs[t].value;
327
- let n;
328
- typeof s == "number" ? n = new We(t, s).use(j, ke) : n = new Xe(t, JSON.stringify(s)).use(j, Ce), n.use(Ye, !0), this.addInput(t, n);
361
+ let o;
362
+ typeof s == "number" ? o = new Qe(t, s).use(L, re) : o = new Ze(t, JSON.stringify(s)).use(L, de), o.use(ke, !0), this.addInput(t, o);
329
363
  }
330
364
  this.inputs[t] && (this.inputs[t].load(e.inputs[t]), this.inputs[t].nodeId = this.id);
331
365
  }
332
366
  for (const t of Object.keys(e.outputs))
333
367
  if (!this.staticOutputKeys.includes(t)) {
334
368
  if (!this.outputs[t]) {
335
- const s = new yt(t);
369
+ const s = new Nt(t);
336
370
  this.addOutput(t, s);
337
371
  }
338
372
  this.outputs[t] && (this.outputs[t].load(e.outputs[t]), this.outputs[t].nodeId = this.id);
339
373
  }
340
- xe(this.graph, e), this.preventUpdate = !1, this.events.loaded.emit(this);
374
+ Oe(this.graph, e), this.preventUpdate = !1, this.events.loaded.emit(this);
341
375
  }
342
376
  onUpdate() {
343
377
  if (this.preventUpdate) return;
344
378
  this.graph && this.graph.activeTransactions++;
345
- const e = this.getStaticValues(this.staticInputKeys, this.inputs), t = this.getStaticValues(this.staticOutputKeys, this.outputs), s = o.onUpdate.call(this, e, t);
379
+ const e = this.getStaticValues(this.staticInputKeys, this.inputs), t = this.getStaticValues(this.staticOutputKeys, this.outputs), s = n.onUpdate.call(this, e, t);
346
380
  this.updateInterfaces("input", s.inputs ?? {}, s.forceUpdateInputs ?? []), this.updateInterfaces("output", s.outputs ?? {}, s.forceUpdateOutputs ?? []), this.graph && this.graph.activeTransactions--;
347
381
  }
348
382
  getStaticValues(e, t) {
349
383
  const s = {};
350
- for (const n of e)
351
- s[n] = t[n].value;
384
+ for (const o of e)
385
+ s[o] = t[o].value;
352
386
  return s;
353
387
  }
354
388
  updateInterfaces(e, t, s) {
355
- const n = e === "input" ? this.staticInputKeys : this.staticOutputKeys, a = e === "input" ? this.inputs : this.outputs;
389
+ const o = e === "input" ? this.staticInputKeys : this.staticOutputKeys, a = e === "input" ? this.inputs : this.outputs;
356
390
  for (const u of Object.keys(a))
357
- n.includes(u) || t[u] && !s.includes(u) || (e === "input" ? this.removeInput(u) : this.removeOutput(u));
391
+ o.includes(u) || t[u] && !s.includes(u) || (e === "input" ? this.removeInput(u) : this.removeOutput(u));
358
392
  for (const u of Object.keys(t)) {
359
393
  if (a[u]) continue;
360
- const d = t[u]();
361
- e === "input" ? this.addInput(u, d) : this.addOutput(u, d);
394
+ const l = t[u]();
395
+ e === "input" ? this.addInput(u, l) : this.addOutput(u, l);
362
396
  }
363
397
  }
364
398
  executeFactory(e, t) {
365
399
  Object.keys(t || {}).forEach((s) => {
366
- const n = t[s]();
367
- e === "input" ? this.addInput(s, n) : this.addOutput(s, n);
400
+ const o = t[s]();
401
+ e === "input" ? this.addInput(s, o) : this.addOutput(s, o);
368
402
  });
369
403
  }
370
404
  };
371
405
  }
372
- class It {
406
+ class Mt {
373
407
  _id;
374
408
  _viewModel;
375
409
  _state;
376
410
  constructor(e) {
377
- this._id = mt(), this._viewModel = e, this._state = R({
411
+ this._id = bt(), this._viewModel = e, this._state = G({
378
412
  autosort: !1,
379
413
  modules: {},
380
414
  script: "",
@@ -457,7 +491,7 @@ class It {
457
491
  * Clear code graph.
458
492
  */
459
493
  clear() {
460
- this.nodes = [], this.connections = [];
494
+ this.state.modules = {}, this.nodes = [], this.connections = [], this.state.script = "";
461
495
  }
462
496
  findNodeById(e) {
463
497
  return this.graph.findNodeById(e);
@@ -519,7 +553,7 @@ class It {
519
553
  * Render code.
520
554
  */
521
555
  renderCode() {
522
- this.state.script = be.render(this.state.template || "", this);
556
+ this.state.script = xe.render(this.state.template || "", this);
523
557
  }
524
558
  /**
525
559
  * Save code graph.
@@ -536,11 +570,11 @@ class It {
536
570
  */
537
571
  saveNodeStates(e) {
538
572
  e.forEach((t, s) => {
539
- const n = this.nodes[s];
573
+ const o = this.nodes[s];
540
574
  Object.entries(t.inputs).forEach(([a]) => {
541
- t.inputs && n.inputs[a] && (t.inputs[a].hidden = n.inputs[a].hidden);
575
+ t.inputs && o.inputs[a] && (t.inputs[a].hidden = o.inputs[a].hidden);
542
576
  }), Object.entries(t.outputs).forEach(([a]) => {
543
- t.outputs && n.outputs[a] && (t.outputs[a].hidden = n.outputs[a].hidden);
577
+ t.outputs && o.outputs[a] && (t.outputs[a].hidden = o.outputs[a].hidden);
544
578
  });
545
579
  });
546
580
  }
@@ -555,11 +589,11 @@ class It {
555
589
  a.from.nodeId
556
590
  ]);
557
591
  let t = [...this.nodeIds];
558
- t.reverse(), t = vt.array(t, e), t.reverse();
592
+ t.reverse(), t = gt.array(t, e), t.reverse();
559
593
  const s = this.graph.nodes.map((a) => a.id).filter((a) => !t.includes(a));
560
594
  t = t.concat(s);
561
- const n = t.map((a) => this.findNodeById(a));
562
- n && (this.nodes = n);
595
+ const o = t.map((a) => this.findNodeById(a));
596
+ o && (this.nodes = o);
563
597
  } catch {
564
598
  console.warn("Failed to sort nodes.");
565
599
  }
@@ -568,65 +602,65 @@ class It {
568
602
  this.codeNodes.forEach((e) => e.updateOutputVariableName());
569
603
  }
570
604
  }
571
- const Z = (o) => {
605
+ const Z = (n) => {
572
606
  let e = [];
573
- return o.nodes.forEach((t) => {
607
+ return n.nodes.forEach((t) => {
574
608
  t.subgraph ? e = e.concat(Z(t.subgraph)) : t.isCodeNode && e.push(t);
575
609
  }), e;
576
- }, on = (o = 0, e = 100) => ({
577
- x: o * 420,
610
+ }, rn = (n = 0, e = 100) => ({
611
+ x: n * 420,
578
612
  y: e
579
- }), an = (o) => {
580
- const e = { ...o.position };
613
+ }), dn = (n) => {
614
+ const e = { ...n.position };
581
615
  return e.x -= 400, e.y += 50, e;
582
- }, Nt = (o) => {
583
- const { calculationOrder: e, connectionsFromNode: t } = Je(o);
616
+ }, ln = (n) => {
617
+ const { calculationOrder: e, connectionsFromNode: t } = Ce(n);
584
618
  e.forEach((s) => {
585
619
  if (!s.isCodeNode) return;
586
- const n = s;
587
- t.has(n) && t.get(n).forEach((a) => {
620
+ const o = s;
621
+ t.has(o) && t.get(o).forEach((a) => {
588
622
  a.to.state && a.from.script && (a.to.state.script = a.from.script);
589
623
  });
590
624
  });
591
- }, Mt = ["id"], Ot = { class: "align-middle" }, me = /* @__PURE__ */ G({
625
+ }, Ot = ["id"], $t = { class: "align-middle" }, ye = /* @__PURE__ */ j({
592
626
  __name: "CodeGraphNodeInterface",
593
627
  props: {
594
628
  node: {},
595
629
  intf: {}
596
630
  },
597
- setup(o) {
598
- const e = o, { viewModel: t } = F(), { hoveredOver: s, temporaryConnection: n } = qe(), a = $(null), u = f(() => e.intf.connectionCount > 0), d = f(() => ({
631
+ setup(n) {
632
+ const e = n, { viewModel: t } = F(), { hoveredOver: s, temporaryConnection: o } = Ke(), a = O(null), u = b(() => e.intf.connectionCount > 0), l = b(() => ({
599
633
  "--connected": u.value
600
- })), h = () => {
634
+ })), v = () => {
601
635
  s(e.intf);
602
- }, O = () => {
636
+ }, _ = () => {
603
637
  s(void 0);
604
- }, x = () => {
638
+ }, y = () => {
605
639
  a.value && t.value.hooks.renderInterface.execute({ intf: e.intf, el: a.value });
606
640
  };
607
- return ee(x), _e(x), (k, B) => (i(), l("div", {
608
- id: k.intf.id,
641
+ return ee(y), Ne(y), (x, B) => (i(), r("div", {
642
+ id: x.intf.id,
609
643
  ref_key: "el",
610
644
  ref: a,
611
- class: U(["baklava-node-interface", d.value])
645
+ class: U(["baklava-node-interface", l.value])
612
646
  }, [
613
- k.intf.port ? (i(), l("div", {
647
+ x.intf.port ? (i(), r("div", {
614
648
  key: 0,
615
- class: U(["__port", { "--selected": _(n)?.from === k.intf }]),
616
- onPointerover: h,
617
- onPointerout: O
618
- }, null, 34)) : N("", !0),
619
- r("span", Ot, [
620
- q(k.$slots, "default")
649
+ class: U(["__port", { "--selected": k(o)?.from === x.intf }]),
650
+ onPointerover: v,
651
+ onPointerout: _
652
+ }, null, 34)) : I("", !0),
653
+ d("span", $t, [
654
+ J(x.$slots, "default")
621
655
  ])
622
- ], 10, Mt));
656
+ ], 10, Ot));
623
657
  }
624
- }), z = (o, e) => {
625
- const t = o.__vccOpts || o;
626
- for (const [s, n] of e)
627
- t[s] = n;
658
+ }), S = (n, e) => {
659
+ const t = n.__vccOpts || n;
660
+ for (const [s, o] of e)
661
+ t[s] = o;
628
662
  return t;
629
- }, Tt = {}, $t = {
663
+ }, Tt = {}, Et = {
630
664
  xmlns: "http://www.w3.org/2000/svg",
631
665
  width: "24",
632
666
  height: "24",
@@ -634,17 +668,17 @@ const Z = (o) => {
634
668
  fill: "currentColor",
635
669
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"
636
670
  };
637
- function Et(o, e) {
638
- return i(), l("svg", $t, [...e[0] || (e[0] = [
639
- r("path", {
671
+ function zt(n, e) {
672
+ return i(), r("svg", Et, [...e[0] || (e[0] = [
673
+ d("path", {
640
674
  stroke: "none",
641
675
  d: "M0 0h24v24H0z",
642
676
  fill: "none"
643
677
  }, null, -1),
644
- r("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
678
+ d("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
645
679
  ])]);
646
680
  }
647
- const St = /* @__PURE__ */ z(Tt, [["render", Et]]), zt = {}, Bt = {
681
+ const St = /* @__PURE__ */ S(Tt, [["render", zt]]), Bt = {}, Lt = {
648
682
  xmlns: "http://www.w3.org/2000/svg",
649
683
  width: "24",
650
684
  height: "24",
@@ -652,17 +686,17 @@ const St = /* @__PURE__ */ z(Tt, [["render", Et]]), zt = {}, Bt = {
652
686
  fill: "currentColor",
653
687
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"
654
688
  };
655
- function Vt(o, e) {
656
- return i(), l("svg", Bt, [...e[0] || (e[0] = [
657
- r("path", {
689
+ function Vt(n, e) {
690
+ return i(), r("svg", Lt, [...e[0] || (e[0] = [
691
+ d("path", {
658
692
  stroke: "none",
659
693
  d: "M0 0h24v24H0z",
660
694
  fill: "none"
661
695
  }, null, -1),
662
- r("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
696
+ d("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
663
697
  ])]);
664
698
  }
665
- const Lt = /* @__PURE__ */ z(zt, [["render", Vt]]), Gt = {}, Ut = {
699
+ const jt = /* @__PURE__ */ S(Bt, [["render", Vt]]), Ut = {}, Gt = {
666
700
  xmlns: "http://www.w3.org/2000/svg",
667
701
  width: "24",
668
702
  height: "24",
@@ -670,17 +704,17 @@ const Lt = /* @__PURE__ */ z(zt, [["render", Vt]]), Gt = {}, Ut = {
670
704
  fill: "currentColor",
671
705
  class: "balkava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"
672
706
  };
673
- function jt(o, e) {
674
- return i(), l("svg", Ut, [...e[0] || (e[0] = [
675
- r("path", {
707
+ function Rt(n, e) {
708
+ return i(), r("svg", Gt, [...e[0] || (e[0] = [
709
+ d("path", {
676
710
  stroke: "none",
677
711
  d: "M0 0h24v24H0z",
678
712
  fill: "none"
679
713
  }, null, -1),
680
- r("path", { d: "M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z" }, null, -1)
714
+ d("path", { d: "M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z" }, null, -1)
681
715
  ])]);
682
716
  }
683
- const Rt = /* @__PURE__ */ z(Gt, [["render", jt]]), Pt = {}, Dt = {
717
+ const Dt = /* @__PURE__ */ S(Ut, [["render", Rt]]), Pt = {}, At = {
684
718
  xmlns: "http://www.w3.org/2000/svg",
685
719
  width: "24",
686
720
  height: "24",
@@ -688,17 +722,17 @@ const Rt = /* @__PURE__ */ z(Gt, [["render", jt]]), Pt = {}, Dt = {
688
722
  fill: "currentColor",
689
723
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"
690
724
  };
691
- function At(o, e) {
692
- return i(), l("svg", Dt, [...e[0] || (e[0] = [
693
- r("path", {
725
+ function Ht(n, e) {
726
+ return i(), r("svg", At, [...e[0] || (e[0] = [
727
+ d("path", {
694
728
  stroke: "none",
695
729
  d: "M0 0h24v24H0z",
696
730
  fill: "none"
697
731
  }, null, -1),
698
- r("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
732
+ d("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z" }, null, -1)
699
733
  ])]);
700
734
  }
701
- const Ht = /* @__PURE__ */ z(Pt, [["render", At]]), Ft = {}, Wt = {
735
+ const Ft = /* @__PURE__ */ S(Pt, [["render", Ht]]), Wt = {}, Xt = {
702
736
  xmlns: "http://www.w3.org/2000/svg",
703
737
  width: "24",
704
738
  height: "24",
@@ -706,17 +740,17 @@ const Ht = /* @__PURE__ */ z(Pt, [["render", At]]), Ft = {}, Wt = {
706
740
  fill: "currentColor",
707
741
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"
708
742
  };
709
- function Xt(o, e) {
710
- return i(), l("svg", Wt, [...e[0] || (e[0] = [
711
- r("path", {
743
+ function Yt(n, e) {
744
+ return i(), r("svg", Xt, [...e[0] || (e[0] = [
745
+ d("path", {
712
746
  stroke: "none",
713
747
  d: "M0 0h24v24H0z",
714
748
  fill: "none"
715
749
  }, null, -1),
716
- r("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
750
+ d("path", { d: "M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z" }, null, -1)
717
751
  ])]);
718
752
  }
719
- const Yt = /* @__PURE__ */ z(Ft, [["render", Xt]]), Jt = {}, qt = {
753
+ const qt = /* @__PURE__ */ S(Wt, [["render", Yt]]), Jt = {}, Qt = {
720
754
  xmlns: "http://www.w3.org/2000/svg",
721
755
  class: "baklava-icon",
722
756
  width: "24",
@@ -728,12 +762,12 @@ const Yt = /* @__PURE__ */ z(Ft, [["render", Xt]]), Jt = {}, qt = {
728
762
  "stroke-linecap": "round",
729
763
  "stroke-linejoin": "round"
730
764
  };
731
- function Qt(o, e) {
732
- return i(), l("svg", qt, [...e[0] || (e[0] = [
765
+ function Zt(n, e) {
766
+ return i(), r("svg", Qt, [...e[0] || (e[0] = [
733
767
  te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>', 8)
734
768
  ])]);
735
769
  }
736
- const Zt = /* @__PURE__ */ z(Jt, [["render", Qt]]), Kt = {}, es = {
770
+ const Kt = /* @__PURE__ */ S(Jt, [["render", Zt]]), es = {}, ts = {
737
771
  xmlns: "http://www.w3.org/2000/svg",
738
772
  class: "baklava-icon",
739
773
  width: "24",
@@ -745,12 +779,12 @@ const Zt = /* @__PURE__ */ z(Jt, [["render", Qt]]), Kt = {}, es = {
745
779
  "stroke-linecap": "round",
746
780
  "stroke-linejoin": "round"
747
781
  };
748
- function ts(o, e) {
749
- return i(), l("svg", es, [...e[0] || (e[0] = [
782
+ function ss(n, e) {
783
+ return i(), r("svg", ts, [...e[0] || (e[0] = [
750
784
  te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>', 9)
751
785
  ])]);
752
786
  }
753
- const ss = /* @__PURE__ */ z(Kt, [["render", ts]]), ns = {}, os = {
787
+ const ns = /* @__PURE__ */ S(es, [["render", ss]]), os = {}, as = {
754
788
  xmlns: "http://www.w3.org/2000/svg",
755
789
  class: "baklava-icon",
756
790
  width: "24",
@@ -762,12 +796,12 @@ const ss = /* @__PURE__ */ z(Kt, [["render", ts]]), ns = {}, os = {
762
796
  "stroke-linecap": "round",
763
797
  "stroke-linejoin": "round"
764
798
  };
765
- function as(o, e) {
766
- return i(), l("svg", os, [...e[0] || (e[0] = [
799
+ function is(n, e) {
800
+ return i(), r("svg", as, [...e[0] || (e[0] = [
767
801
  te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 3l18 18"></path><path d="M4 7h3m4 0h9"></path><path d="M10 11l0 6"></path><path d="M14 14l0 3"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l.077 -.923"></path><path d="M18.384 14.373l.616 -7.373"></path><path d="M9 5v-1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 8)
768
802
  ])]);
769
803
  }
770
- const is = /* @__PURE__ */ z(ns, [["render", as]]), ls = {}, rs = {
804
+ const rs = /* @__PURE__ */ S(os, [["render", is]]), ds = {}, ls = {
771
805
  xmlns: "http://www.w3.org/2000/svg",
772
806
  class: "baklava-icon",
773
807
  width: "16",
@@ -779,37 +813,37 @@ const is = /* @__PURE__ */ z(ns, [["render", as]]), ls = {}, rs = {
779
813
  "stroke-linecap": "round",
780
814
  "stroke-linejoin": "round"
781
815
  };
782
- function ds(o, e) {
783
- return i(), l("svg", rs, [...e[0] || (e[0] = [
784
- r("path", {
816
+ function us(n, e) {
817
+ return i(), r("svg", ls, [...e[0] || (e[0] = [
818
+ d("path", {
785
819
  stroke: "none",
786
820
  d: "M0 0h24v24H0z",
787
821
  fill: "none"
788
822
  }, null, -1),
789
- r("circle", {
823
+ d("circle", {
790
824
  cx: "12",
791
825
  cy: "12",
792
826
  r: "1"
793
827
  }, null, -1),
794
- r("circle", {
828
+ d("circle", {
795
829
  cx: "12",
796
830
  cy: "19",
797
831
  r: "1"
798
832
  }, null, -1),
799
- r("circle", {
833
+ d("circle", {
800
834
  cx: "12",
801
835
  cy: "5",
802
836
  r: "1"
803
837
  }, null, -1)
804
838
  ])]);
805
839
  }
806
- const us = /* @__PURE__ */ z(ls, [["render", ds]]), cs = ["id", "data-node-type"], ps = {
840
+ const cs = /* @__PURE__ */ S(ds, [["render", us]]), ps = ["id", "data-node-type"], hs = {
807
841
  class: "__title-label",
808
842
  style: { "flex-grow": "1" }
809
- }, hs = { key: 0 }, vs = {
843
+ }, vs = { key: 0 }, ms = {
810
844
  class: "__menu",
811
845
  style: { display: "flex" }
812
- }, ms = { class: "__outputs" }, fs = { key: 0 }, gs = ["id", "title"], bs = { class: "__inputs" }, _s = { key: 0 }, ys = ["id", "title"], ws = /* @__PURE__ */ G({
846
+ }, fs = { class: "__outputs" }, gs = { key: 0 }, bs = ["id", "title"], _s = { class: "__inputs" }, ys = { key: 0 }, ws = ["id", "title"], Cs = /* @__PURE__ */ j({
813
847
  __name: "CodeGraphNode",
814
848
  props: {
815
849
  node: {},
@@ -817,345 +851,347 @@ const us = /* @__PURE__ */ z(ls, [["render", ds]]), cs = ["id", "data-node-type"
817
851
  dragging: { type: Boolean }
818
852
  },
819
853
  emits: ["select", "start-drag", "update"],
820
- setup(o, { emit: e }) {
821
- const t = ve.ContextMenu, s = ve.NodeInterface, n = o, a = f(() => n.node), u = e, { viewModel: d } = F(), { graph: h, switchGraph: O } = K(), x = $(null), k = $(!1), B = $(""), y = $(null), m = $(!1);
822
- let g = 0, b = 0;
823
- const p = $(!1), w = f(() => {
854
+ setup(n, { emit: e }) {
855
+ const t = be.ContextMenu, s = be.NodeInterface, o = n, a = b(() => o.node), u = e, { viewModel: l } = F(), { graph: v, switchGraph: _ } = K(), y = O(null), x = O(!1), B = O(""), w = O(null), m = O(!1);
856
+ let f = 0, h = 0;
857
+ const p = O(!1), C = b(() => {
824
858
  const c = [
825
859
  { value: "edit", label: "Edit" },
826
860
  { value: "rename", label: "Rename" },
827
861
  { value: "delete", label: "Delete" }
828
862
  ];
829
- return n.node.type.startsWith(J) && c.push({ value: "editSubgraph", label: "Edit Subgraph" }), c;
830
- }), I = f(() => ({
831
- "--selected": n.selected,
832
- "--dragging": n.dragging,
833
- "--two-column": !!n.node.twoColumn,
863
+ return o.node.type.startsWith(q) && c.push({ value: "editSubgraph", label: "Edit Subgraph" }), c;
864
+ }), M = b(() => ({
865
+ "--selected": o.selected,
866
+ "--dragging": o.dragging,
867
+ "--two-column": !!o.node.twoColumn,
834
868
  "--hidden": a.value.state?.hidden
835
- })), Ie = f(() => ({
836
- "--reverse-y": n.node.reverseY ?? d.value.settings.nodes.reverseY
837
- })), Ne = f(() => ({
838
- top: `${n.node.position?.y ?? 0}px`,
839
- left: `${n.node.position?.x ?? 0}px`,
840
- "--width": `${n.node.width ?? d.value.settings.nodes.defaultWidth}px`
841
- })), Me = f(() => Object.values(n.node.inputs).filter((c) => !c.hidden)), Oe = f(() => Object.values(n.node.outputs).filter((c) => !c.hidden)), le = () => {
869
+ })), Te = b(() => ({
870
+ "--reverse-y": o.node.reverseY ?? l.value.settings.nodes.reverseY
871
+ })), Ee = b(() => ({
872
+ top: `${o.node.position?.y ?? 0}px`,
873
+ left: `${o.node.position?.x ?? 0}px`,
874
+ "--width": `${o.node.width ?? l.value.settings.nodes.defaultWidth}px`
875
+ })), ze = b(() => Object.values(o.node.inputs).filter((c) => !c.hidden)), Se = b(() => Object.values(o.node.outputs).filter((c) => !c.hidden)), ce = () => {
842
876
  u("select");
843
- }, Te = (c) => {
844
- n.selected || le(), u("start-drag", c);
845
- }, re = () => {
877
+ }, Be = (c) => {
878
+ o.selected || ce(), u("start-drag", c);
879
+ }, pe = () => {
846
880
  p.value = !0;
847
- }, $e = () => {
848
- const c = d.value.displayedGraph.sidebar;
881
+ }, Le = () => {
882
+ const c = l.value.displayedGraph.sidebar;
849
883
  c.nodeId = "", c.visible = !1;
850
- }, de = () => {
851
- const c = d.value.displayedGraph.sidebar;
852
- c.nodeId = n.node.id, c.visible = !0;
853
- }, Ee = () => {
854
- const c = d.value.displayedGraph.sidebar;
855
- c.nodeId = n.node.id;
856
- }, Se = async (c) => {
884
+ }, he = () => {
885
+ const c = l.value.displayedGraph.sidebar;
886
+ c.nodeId = o.node.id, c.visible = !0;
887
+ }, Ve = () => {
888
+ const c = l.value.displayedGraph.sidebar;
889
+ c.nodeId = o.node.id;
890
+ }, je = async (c) => {
857
891
  switch (c) {
858
892
  case "edit":
859
- de();
893
+ he();
860
894
  break;
861
895
  case "delete":
862
- h.value.removeNode(n.node);
896
+ v.value.removeNode(o.node);
863
897
  break;
864
898
  case "rename":
865
- B.value = n.node.title, k.value = !0, await it(), y.value?.focus();
899
+ B.value = o.node.title, x.value = !0, await lt(), w.value?.focus();
866
900
  break;
867
901
  case "editSubgraph":
868
- O(n.node.template);
902
+ _(o.node.template);
869
903
  break;
870
904
  }
871
- }, ue = () => {
872
- n.node.title = B.value, k.value = !1;
873
- }, ce = () => {
874
- x.value && d.value.hooks.renderNode.execute({ node: n.node, el: x.value });
875
- }, ze = (c) => {
876
- m.value = !0, g = n.node.width, b = c.clientX, c.preventDefault();
877
- }, pe = (c) => {
905
+ }, ve = () => {
906
+ o.node.title = B.value, x.value = !1;
907
+ }, me = () => {
908
+ y.value && l.value.hooks.renderNode.execute({ node: o.node, el: y.value });
909
+ }, Ue = (c) => {
910
+ m.value = !0, f = o.node.width, h = c.clientX, c.preventDefault();
911
+ }, fe = (c) => {
878
912
  if (!m.value) return;
879
- const C = c.clientX - b, v = g + C / h.value.scaling, Be = d.value.settings.nodes.minWidth, Ve = d.value.settings.nodes.maxWidth;
880
- n.node.width = Math.max(Be, Math.min(Ve, v));
881
- }, he = () => {
913
+ const N = c.clientX - h, g = f + N / v.value.scaling, Ge = l.value.settings.nodes.minWidth, Re = l.value.settings.nodes.maxWidth;
914
+ o.node.width = Math.max(Ge, Math.min(Re, g));
915
+ }, ge = () => {
882
916
  m.value = !1;
883
917
  };
884
918
  return ee(() => {
885
- ce(), window.addEventListener("mousemove", pe), window.addEventListener("mouseup", he);
886
- }), _e(ce), ot(() => {
887
- window.removeEventListener("mousemove", pe), window.removeEventListener("mouseup", he);
888
- }), (c, C) => (i(), l("div", {
919
+ me(), window.addEventListener("mousemove", fe), window.addEventListener("mouseup", ge);
920
+ }), Ne(me), rt(() => {
921
+ window.removeEventListener("mousemove", fe), window.removeEventListener("mouseup", ge);
922
+ }), (c, N) => (i(), r("div", {
889
923
  id: a.value.id,
890
924
  ref_key: "el",
891
- ref: x,
892
- class: U([I.value, "baklava-node"]),
925
+ ref: y,
926
+ class: U([M.value, "baklava-node"]),
893
927
  "data-node-type": a.value.type,
894
- style: se(Ne.value),
895
- onPointerdown: le
928
+ style: se(Ee.value),
929
+ onPointerdown: ce
896
930
  }, [
897
- _(d).settings.nodes.resizable ? (i(), l("div", {
931
+ k(l).settings.nodes.resizable ? (i(), r("div", {
898
932
  key: 0,
899
933
  class: "__resize-handle",
900
- onMousedown: ze
901
- }, null, 32)) : N("", !0),
902
- r("div", {
934
+ onMousedown: Ue
935
+ }, null, 32)) : I("", !0),
936
+ d("div", {
903
937
  class: "__title",
904
- onPointerdown: D(Te, ["self", "stop"]),
905
- onContextmenu: D(re, ["prevent"])
938
+ onPointerdown: P(Be, ["self", "stop"]),
939
+ onContextmenu: P(pe, ["prevent"])
906
940
  }, [
907
- a.value.inputs._node ? (i(), V(me, {
941
+ a.value.inputs._node ? (i(), V(ye, {
908
942
  key: 0,
909
943
  node: a.value,
910
944
  intf: a.value.inputs._node,
911
945
  class: "--input",
912
946
  "data-interface-type": "node",
913
947
  style: { "flex-grow": "0" }
914
- }, null, 8, ["node", "intf"])) : N("", !0),
915
- k.value ? ne((i(), l("input", {
948
+ }, null, 8, ["node", "intf"])) : I("", !0),
949
+ x.value ? ne((i(), r("input", {
916
950
  key: 2,
917
951
  ref_key: "renameInputEl",
918
- ref: y,
919
- "onUpdate:modelValue": C[1] || (C[1] = (v) => B.value = v),
952
+ ref: w,
953
+ "onUpdate:modelValue": N[1] || (N[1] = (g) => B.value = g),
920
954
  class: "baklava-input",
921
955
  placeholder: "Node Name",
922
956
  style: { "flex-grow": "1" },
923
957
  type: "text",
924
- onBlur: ue,
925
- onKeydown: Q(ue, ["enter"])
958
+ onBlur: ve,
959
+ onKeydown: Q(ve, ["enter"])
926
960
  }, null, 544)), [
927
961
  [oe, B.value]
928
- ]) : (i(), l(E, { key: 1 }, [
929
- r("div", ps, [
930
- a.value.idx > -1 ? (i(), l("span", hs, L(a.value.idx + 1) + " - ", 1)) : N("", !0),
931
- at(L(a.value.title) + " (" + L(a.value.shortId) + ") ", 1)
962
+ ]) : (i(), r($, { key: 1 }, [
963
+ d("div", hs, [
964
+ a.value.idx > -1 ? (i(), r("span", vs, E(a.value.idx + 1) + " - ", 1)) : I("", !0),
965
+ dt(E(a.value.title) + " (" + E(a.value.shortId) + ") ", 1)
932
966
  ]),
933
- r("div", vs, [
934
- a.value.subgraph ? N("", !0) : (i(), l(E, { key: 0 }, [
935
- !_(d).displayedGraph.sidebar.visible && _(d).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), V(_(Yt), {
967
+ d("div", ms, [
968
+ a.value.subgraph ? I("", !0) : (i(), r($, { key: 0 }, [
969
+ !k(l).displayedGraph.sidebar.visible && k(l).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), V(k(qt), {
936
970
  key: 0,
937
971
  class: "--clickable mx-1",
938
- onClick: de
939
- })) : _(d).displayedGraph.sidebar.visible && _(d).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), V(_(Rt), {
972
+ onClick: he
973
+ })) : k(l).displayedGraph.sidebar.visible && k(l).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), V(k(Dt), {
940
974
  key: 1,
941
975
  class: "--clickable mx-1",
942
- onClick: Ee
943
- })) : (i(), V(_(Ht), {
976
+ onClick: Ve
977
+ })) : (i(), V(k(Ft), {
944
978
  key: 2,
945
979
  class: "--clickable mx-1",
946
- onClick: $e
980
+ onClick: Le
947
981
  }))
948
982
  ], 64)),
949
- S(_(us), {
983
+ T(k(cs), {
950
984
  class: "--clickable mx-1",
951
- onClick: re
985
+ onClick: pe
952
986
  }),
953
- S(_(t), {
987
+ T(k(t), {
954
988
  modelValue: p.value,
955
- "onUpdate:modelValue": C[0] || (C[0] = (v) => p.value = v),
989
+ "onUpdate:modelValue": N[0] || (N[0] = (g) => p.value = g),
956
990
  x: 0,
957
991
  y: 0,
958
- items: w.value,
959
- onClick: Se
992
+ items: C.value,
993
+ onClick: je
960
994
  }, null, 8, ["modelValue", "items"])
961
995
  ])
962
996
  ], 64)),
963
- a.value.outputs._node ? (i(), V(me, {
997
+ a.value.outputs._node ? (i(), V(ye, {
964
998
  key: 3,
965
999
  node: a.value,
966
1000
  intf: a.value.outputs._node,
967
1001
  class: "--output",
968
1002
  "data-interface-type": "node"
969
- }, null, 8, ["node", "intf"])) : N("", !0)
1003
+ }, null, 8, ["node", "intf"])) : I("", !0)
970
1004
  ], 32),
971
- r("div", {
972
- class: U(["__content", Ie.value]),
973
- onKeydown: C[2] || (C[2] = Q(D(() => {
1005
+ d("div", {
1006
+ class: U(["__content", Te.value]),
1007
+ onKeydown: N[2] || (N[2] = Q(P(() => {
974
1008
  }, ["stop"]), ["delete"])),
975
- onContextmenu: C[3] || (C[3] = D(() => {
1009
+ onContextmenu: N[3] || (N[3] = P(() => {
976
1010
  }, ["prevent"]))
977
1011
  }, [
978
- r("div", ms, [
979
- (i(!0), l(E, null, A(Oe.value, (v) => (i(), l(E, {
980
- key: v.id
1012
+ d("div", fs, [
1013
+ (i(!0), r($, null, A(Se.value, (g) => (i(), r($, {
1014
+ key: g.id
981
1015
  }, [
982
- a.value.state?.hidden ? (i(), l("div", fs, [
983
- v.port ? (i(), l("div", {
1016
+ a.value.state?.hidden ? (i(), r("div", gs, [
1017
+ g.port ? (i(), r("div", {
984
1018
  key: 0,
985
- id: v.id,
986
- title: v.name,
1019
+ id: g.id,
1020
+ title: g.name,
987
1021
  class: "baklava-node-interface --output --connected"
988
- }, [...C[4] || (C[4] = [
989
- r("div", { class: "__port" }, null, -1)
990
- ])], 8, gs)) : N("", !0)
991
- ])) : q(c.$slots, "nodeInterface", {
1022
+ }, [...N[4] || (N[4] = [
1023
+ d("div", { class: "__port" }, null, -1)
1024
+ ])], 8, bs)) : I("", !0)
1025
+ ])) : J(c.$slots, "nodeInterface", {
992
1026
  key: 1,
993
1027
  type: "output",
994
1028
  node: a.value,
995
- intf: v
1029
+ intf: g
996
1030
  }, () => [
997
- S(_(s), {
1031
+ T(k(s), {
998
1032
  node: a.value,
999
- intf: v
1033
+ intf: g
1000
1034
  }, null, 8, ["node", "intf"])
1001
1035
  ])
1002
1036
  ], 64))), 128))
1003
1037
  ]),
1004
- r("div", bs, [
1005
- (i(!0), l(E, null, A(Me.value, (v) => (i(), l(E, {
1006
- key: v.id
1038
+ d("div", _s, [
1039
+ (i(!0), r($, null, A(ze.value, (g) => (i(), r($, {
1040
+ key: g.id
1007
1041
  }, [
1008
- a.value.state?.hidden ? (i(), l("div", _s, [
1009
- v.port ? (i(), l("div", {
1042
+ a.value.state?.hidden ? (i(), r("div", ys, [
1043
+ g.port ? (i(), r("div", {
1010
1044
  key: 0,
1011
- id: v.id,
1012
- title: v.name,
1045
+ id: g.id,
1046
+ title: g.name,
1013
1047
  class: "baklava-node-interface --input --connected"
1014
- }, [...C[5] || (C[5] = [
1015
- r("div", { class: "__port" }, null, -1)
1016
- ])], 8, ys)) : N("", !0)
1017
- ])) : q(c.$slots, "nodeInterface", {
1048
+ }, [...N[5] || (N[5] = [
1049
+ d("div", { class: "__port" }, null, -1)
1050
+ ])], 8, ws)) : I("", !0)
1051
+ ])) : J(c.$slots, "nodeInterface", {
1018
1052
  key: 1,
1019
1053
  node: a.value,
1020
- intf: v,
1054
+ intf: g,
1021
1055
  type: "input"
1022
1056
  }, () => [
1023
- S(_(s), {
1057
+ T(k(s), {
1024
1058
  node: a.value,
1025
- intf: v,
1026
- title: v.name
1059
+ intf: g,
1060
+ title: g.name
1027
1061
  }, null, 8, ["node", "intf", "title"])
1028
1062
  ])
1029
1063
  ], 64))), 128))
1030
1064
  ])
1031
1065
  ], 34)
1032
- ], 46, cs));
1066
+ ], 46, ps));
1033
1067
  }
1034
- }), xs = ["title"], ks = {
1068
+ }), ks = ["title"], xs = {
1035
1069
  key: 0,
1036
1070
  class: "__label"
1037
- }, Cs = /* @__PURE__ */ G({
1071
+ }, Ns = /* @__PURE__ */ j({
1038
1072
  __name: "Checkbox",
1039
1073
  props: {
1040
- modelValue: { type: Boolean },
1074
+ disabled: { type: Boolean },
1041
1075
  inversed: { type: Boolean },
1076
+ modelValue: { type: Boolean },
1042
1077
  name: {}
1043
1078
  },
1044
1079
  emits: ["update:modelValue"],
1045
- setup(o, { emit: e }) {
1080
+ setup(n, { emit: e }) {
1046
1081
  const t = e;
1047
- return (s, n) => (i(), l("div", {
1048
- class: U(["baklava-checkbox", { "--checked": s.inversed ? !s.modelValue : s.modelValue }]),
1082
+ return (s, o) => (i(), r("div", {
1083
+ class: U(["baklava-checkbox", { "--checked": s.inversed ? !s.modelValue : s.modelValue, "--disabled": s.disabled }]),
1049
1084
  title: s.name,
1050
- onClick: n[0] || (n[0] = (a) => t("update:modelValue", !s.modelValue))
1085
+ onClick: o[0] || (o[0] = (a) => t("update:modelValue", !s.modelValue))
1051
1086
  }, [
1052
- n[1] || (n[1] = r("div", { class: "__checkmark-container" }, [
1053
- r("svg", {
1087
+ o[1] || (o[1] = d("div", { class: "__checkmark-container" }, [
1088
+ d("svg", {
1054
1089
  xmlns: "http://www.w3.org/2000/svg",
1055
1090
  width: "18",
1056
1091
  height: "18",
1057
1092
  viewBox: "0 0 18 18"
1058
1093
  }, [
1059
- r("path", {
1094
+ d("path", {
1060
1095
  class: "__checkmark",
1061
1096
  d: "M 6 5 L 6 10 L 16 10",
1062
1097
  transform: "rotate(-45 10 10)"
1063
1098
  })
1064
1099
  ])
1065
1100
  ], -1)),
1066
- s.name ? (i(), l("div", ks, L(s.name), 1)) : N("", !0)
1067
- ], 10, xs));
1101
+ s.name ? (i(), r("div", xs, E(s.name), 1)) : I("", !0)
1102
+ ], 10, ks));
1068
1103
  }
1069
- }), Is = { class: "__header" }, Ns = { class: "__node-name" }, Ms = { style: { display: "flex" } }, Os = {
1104
+ }), Is = { class: "__header" }, Ms = { class: "__node-name" }, Os = { style: { display: "flex" } }, $s = {
1070
1105
  key: 1,
1071
1106
  class: "__interface"
1072
- }, Ts = /* @__PURE__ */ G({
1107
+ }, Ts = /* @__PURE__ */ j({
1073
1108
  __name: "CodeGraphSidebar",
1074
- setup(o) {
1075
- const { viewModel: e } = F(), { graph: t } = K(), s = $(null), n = ye(e.value.settings.sidebar, "width"), a = f(() => e.value.settings.sidebar.resizable);
1076
- let u = 0, d = 0;
1077
- const h = f(() => {
1078
- const b = t.value.sidebar.nodeId;
1079
- return t.value.nodes.find((p) => p.id === b);
1080
- }), O = f(() => h.value), x = f(() => ({
1081
- width: `${n.value}px`
1082
- })), k = f(() => h.value ? [...Object.values(h.value.inputs), ...Object.values(h.value.outputs)].filter((p) => p.displayInSidebar && p.component) : []), B = () => {
1109
+ setup(n) {
1110
+ const { viewModel: e } = F(), { graph: t } = K(), s = O(null), o = Ie(e.value.settings.sidebar, "width"), a = b(() => e.value.settings.sidebar.resizable);
1111
+ let u = 0, l = 0;
1112
+ const v = b(() => {
1113
+ const h = t.value.sidebar.nodeId;
1114
+ return t.value.nodes.find((p) => p.id === h);
1115
+ }), _ = b(() => v.value), y = b(() => ({
1116
+ width: `${o.value}px`
1117
+ })), x = b(() => _.value ? [...Object.values(_.value.inputs), ...Object.values(_.value.outputs)].filter((p) => p.displayInSidebar && p.component) : []), B = () => {
1083
1118
  t.value.sidebar.visible = !1;
1084
- }, y = () => {
1085
- h.value?.events.update.emit(null);
1086
- }, m = (b) => {
1087
- u = n.value, d = b.clientX, window.addEventListener("mousemove", g), window.addEventListener(
1119
+ }, w = () => {
1120
+ v.value?.events.update.emit(null);
1121
+ }, m = (h) => {
1122
+ u = o.value, l = h.clientX, window.addEventListener("mousemove", f), window.addEventListener(
1088
1123
  "mouseup",
1089
1124
  () => {
1090
- window.removeEventListener("mousemove", g);
1125
+ window.removeEventListener("mousemove", f);
1091
1126
  },
1092
1127
  { once: !0 }
1093
1128
  );
1094
- }, g = (b) => {
1095
- const p = s.value?.parentElement?.getBoundingClientRect().width ?? 500, w = b.clientX - d;
1096
- let I = u - w;
1097
- I < 300 ? I = 300 : I > 0.9 * p && (I = 0.9 * p), n.value = I;
1129
+ }, f = (h) => {
1130
+ const p = s.value?.parentElement?.getBoundingClientRect().width ?? 500, C = h.clientX - l;
1131
+ let M = u - C;
1132
+ M < 300 ? M = 300 : M > 0.9 * p && (M = 0.9 * p), o.value = M;
1098
1133
  };
1099
- return (b, p) => (i(), l("div", {
1134
+ return (h, p) => (i(), r("div", {
1100
1135
  ref_key: "el",
1101
1136
  ref: s,
1102
- class: U(["baklava-sidebar", { "--open": _(t).sidebar.visible }]),
1103
- style: se(x.value)
1137
+ class: U(["baklava-sidebar", { "--open": k(t).sidebar.visible }]),
1138
+ style: se(y.value)
1104
1139
  }, [
1105
- a.value ? (i(), l("div", {
1140
+ a.value ? (i(), r("div", {
1106
1141
  key: 0,
1107
1142
  class: "__resizer",
1108
1143
  onMousedown: m
1109
- }, null, 32)) : N("", !0),
1110
- r("div", Is, [
1111
- r("button", {
1144
+ }, null, 32)) : I("", !0),
1145
+ d("div", Is, [
1146
+ d("button", {
1112
1147
  tabindex: "-1",
1113
1148
  class: "__close",
1114
1149
  onClick: B
1115
1150
  }, "×"),
1116
- r("div", Ns, [
1117
- r("b", null, L(h.value ? h.value.title : ""), 1)
1151
+ d("div", Ms, [
1152
+ d("b", null, E(v.value ? v.value.title : ""), 1)
1118
1153
  ])
1119
1154
  ]),
1120
- (i(!0), l(E, null, A(k.value, (w) => (i(), l("div", {
1121
- key: w.id,
1155
+ (i(!0), r($, null, A(x.value, (C) => (i(), r("div", {
1156
+ key: C.id,
1122
1157
  class: "__interface"
1123
1158
  }, [
1124
- r("div", Ms, [
1125
- S(Cs, {
1126
- modelValue: w.hidden,
1159
+ d("div", Os, [
1160
+ T(Ns, {
1161
+ modelValue: C.hidden,
1127
1162
  "onUpdate:modelValue": [
1128
- (I) => w.hidden = I,
1129
- p[0] || (p[0] = () => h.value?.events.update.emit(null))
1163
+ (M) => C.hidden = M,
1164
+ p[0] || (p[0] = () => v.value?.events.update.emit(null))
1130
1165
  ],
1166
+ disabled: !C.optional,
1131
1167
  inversed: "",
1132
1168
  style: { "margin-right": "8px" }
1133
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
1134
- (i(), V(lt(w.component), {
1135
- modelValue: w.value,
1136
- "onUpdate:modelValue": (I) => w.value = I,
1137
- node: h.value,
1138
- intf: w,
1169
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
1170
+ (i(), V(ut(C.component), {
1171
+ modelValue: C.value,
1172
+ "onUpdate:modelValue": (M) => C.value = M,
1173
+ node: v.value,
1174
+ intf: C,
1139
1175
  style: { width: "100%" }
1140
1176
  }, null, 8, ["modelValue", "onUpdate:modelValue", "node", "intf"]))
1141
1177
  ])
1142
1178
  ]))), 128)),
1143
- O.value && O.value.state ? (i(), l("div", Os, [
1144
- p[2] || (p[2] = r("label", null, "Variable name", -1)),
1145
- ne(r("input", {
1146
- "onUpdate:modelValue": p[1] || (p[1] = (w) => O.value.state.variableName = w),
1179
+ _.value && _.value.state ? (i(), r("div", $s, [
1180
+ p[2] || (p[2] = d("label", null, "Variable name", -1)),
1181
+ ne(d("input", {
1182
+ "onUpdate:modelValue": p[1] || (p[1] = (C) => _.value.state.variableName = C),
1147
1183
  type: "text",
1148
1184
  class: "baklava-input",
1149
1185
  title: "Variable name",
1150
- onBlur: y,
1151
- onKeydown: Q(y, ["enter"])
1186
+ onBlur: w,
1187
+ onKeydown: Q(w, ["enter"])
1152
1188
  }, null, 544), [
1153
- [oe, O.value.state.variableName]
1189
+ [oe, _.value.state.variableName]
1154
1190
  ])
1155
- ])) : N("", !0)
1191
+ ])) : I("", !0)
1156
1192
  ], 6));
1157
1193
  }
1158
- }), $s = G({
1194
+ }), Es = j({
1159
1195
  props: {
1160
1196
  type: {
1161
1197
  type: String,
@@ -1166,174 +1202,187 @@ const us = /* @__PURE__ */ z(ls, [["render", ds]]), cs = ["id", "data-node-type"
1166
1202
  required: !0
1167
1203
  }
1168
1204
  },
1169
- setup(o) {
1170
- const { viewModel: e } = F(), { switchGraph: t } = K(), s = $(!1), n = f(() => o.type.startsWith(J));
1171
- return { showContextMenu: s, hasContextMenu: n, contextMenuItems: [
1205
+ setup(n) {
1206
+ const { viewModel: e } = F(), { switchGraph: t } = K(), s = O(!1), o = b(() => n.type.startsWith(q));
1207
+ return { showContextMenu: s, hasContextMenu: o, contextMenuItems: [
1172
1208
  { label: "Edit Subgraph", value: "editSubgraph" },
1173
1209
  { label: "Delete Subgraph", value: "deleteSubgraph" }
1174
1210
  ], openContextMenu: () => {
1175
1211
  s.value = !0;
1176
- }, onContextMenuClick: (h) => {
1177
- const O = o.type.substring(J.length), x = e.value.editor.graphTemplates.find((k) => k.id === O);
1178
- if (x)
1179
- switch (h) {
1212
+ }, onContextMenuClick: (v) => {
1213
+ const _ = n.type.substring(q.length), y = e.value.editor.graphTemplates.find((x) => x.id === _);
1214
+ if (y)
1215
+ switch (v) {
1180
1216
  case "editSubgraph":
1181
- t(x);
1217
+ t(y);
1182
1218
  break;
1183
1219
  case "deleteSubgraph":
1184
- e.value.editor.removeGraphTemplate(x);
1220
+ e.value.editor.removeGraphTemplate(y);
1185
1221
  break;
1186
1222
  }
1187
1223
  } };
1188
1224
  }
1189
- }), Es = ["data-node-type"], Ss = { class: "__title" }, zs = { class: "__title-label" };
1190
- function Bs(o, e, t, s, n, a) {
1191
- return i(), l("div", {
1225
+ }), zs = ["data-node-type"], Ss = { class: "__title" }, Bs = { class: "__title-label" };
1226
+ function Ls(n, e, t, s, o, a) {
1227
+ return i(), r("div", {
1192
1228
  class: "baklava-node --palette",
1193
- "data-node-type": o.type
1229
+ "data-node-type": n.type
1194
1230
  }, [
1195
- r("div", Ss, [
1196
- r("div", zs, L(o.title), 1)
1231
+ d("div", Ss, [
1232
+ d("div", Bs, E(n.title), 1)
1197
1233
  ])
1198
- ], 8, Es);
1234
+ ], 8, zs);
1199
1235
  }
1200
- const fe = /* @__PURE__ */ z($s, [["render", Bs]]), Vs = {
1236
+ const we = /* @__PURE__ */ S(Es, [["render", Ls]]), Vs = {
1201
1237
  class: "baklava-node --palette",
1202
- style: { "margin-top": "-20px", "margin-bottom": "30px" }
1203
- }, Ls = { key: 0 }, Gs = /* @__PURE__ */ G({
1238
+ style: { "margin-top": "-20px", "margin-bottom": "20px" }
1239
+ }, js = {
1240
+ key: 0,
1241
+ style: { display: "flex", "justify-content": "space-between" }
1242
+ }, Us = ["onClick"], Gs = {
1243
+ key: 0,
1244
+ style: { margin: "auto 0", "font-size": "12px" }
1245
+ }, Rs = /* @__PURE__ */ j({
1204
1246
  __name: "CodeNodePalette",
1205
- setup(o) {
1206
- const { viewModel: e } = F(), { x: t, y: s } = ft(), { transform: n } = Qe(), a = Ze(e), u = rt("editorEl"), d = $(""), h = $(null), O = (y) => d.value ? y.filter(
1207
- (m) => Object.values(m.nodeTypes).some(
1208
- (g) => g.title.toLowerCase().includes(d.value?.toLowerCase())
1247
+ setup(n) {
1248
+ const { viewModel: e } = F(), { x: t, y: s } = _t(), { transform: o } = et(), a = tt(e), u = ct("editorEl"), l = O(""), v = O(null), _ = () => l.value ? a.value.filter(
1249
+ (w) => w.name.toLowerCase().includes(l.value.toLowerCase()) || Object.values(w.nodeTypes).some(
1250
+ (m) => m.title.toLowerCase().includes(l.value.toLowerCase())
1209
1251
  )
1210
- ) : y, x = (y) => d.value ? Object.values(y).filter(
1211
- (m) => m.title.toLowerCase().includes(d.value?.toLowerCase())
1212
- ) : Object.values(y), k = f(() => {
1213
- if (!h.value || !u?.value) return {};
1214
- const { left: y, top: m } = u.value.getBoundingClientRect();
1252
+ ) : a.value, y = (w) => l.value ? Object.values(w).filter(
1253
+ (m) => m.category.toLowerCase().includes(l.value.toLowerCase()) || m.title.toLowerCase().includes(l.value.toLowerCase())
1254
+ ) : Object.values(w), x = b(() => {
1255
+ if (!v.value || !u?.value) return {};
1256
+ const { left: w, top: m } = u.value.getBoundingClientRect();
1215
1257
  return {
1216
1258
  top: `${s.value - m}px`,
1217
- left: `${t.value - y}px`
1259
+ left: `${t.value - w}px`
1218
1260
  };
1219
- }), B = (y, m) => {
1220
- h.value = {
1221
- type: y,
1261
+ }), B = (w, m) => {
1262
+ v.value = {
1263
+ type: w,
1222
1264
  nodeInformation: m
1223
1265
  };
1224
- const g = () => {
1225
- const b = R(new m.type());
1226
- e.value.displayedGraph.addNode(b);
1227
- const p = u.value.getBoundingClientRect(), [w, I] = n(t.value - p.left, s.value - p.top);
1228
- b.position.x = w, b.position.y = I, h.value = null, document.removeEventListener("pointerup", g);
1266
+ const f = () => {
1267
+ const h = G(new m.type());
1268
+ e.value.displayedGraph.addNode(h);
1269
+ const p = u.value.getBoundingClientRect(), [C, M] = o(t.value - p.left, s.value - p.top);
1270
+ h.position.x = C, h.position.y = M, v.value = null, document.removeEventListener("pointerup", f);
1229
1271
  };
1230
- document.addEventListener("pointerup", g);
1272
+ document.addEventListener("pointerup", f);
1231
1273
  };
1232
- return (y, m) => (i(), l(E, null, [
1233
- r("div", {
1234
- class: U(["baklava-node-palette", { "--open": _(e).settings.palette.enabled }]),
1235
- onContextmenu: m[1] || (m[1] = D(() => {
1274
+ return (w, m) => (i(), r($, null, [
1275
+ d("div", {
1276
+ class: U(["baklava-node-palette", { "--open": k(e).settings.palette.enabled }]),
1277
+ onContextmenu: m[1] || (m[1] = P(() => {
1236
1278
  }, ["stop", "prevent"]))
1237
1279
  }, [
1238
- r("div", Vs, [
1239
- ne(r("input", {
1240
- "onUpdate:modelValue": m[0] || (m[0] = (g) => d.value = g),
1280
+ d("div", Vs, [
1281
+ ne(d("input", {
1282
+ "onUpdate:modelValue": m[0] || (m[0] = (f) => l.value = f),
1241
1283
  type: "text",
1242
1284
  class: "baklava-input",
1243
- title: "Filter node types"
1244
- }, null, 512), [
1245
- [oe, d.value]
1285
+ title: "Filter nodes",
1286
+ onKeyup: _
1287
+ }, null, 544), [
1288
+ [oe, l.value]
1246
1289
  ])
1247
1290
  ]),
1248
- (i(!0), l(E, null, A(O(_(a)), (g) => (i(), l("section", {
1249
- key: g.name
1291
+ (i(!0), r($, null, A(_(), (f) => (i(), r("section", {
1292
+ key: f.name
1250
1293
  }, [
1251
- g.name !== "default" ? (i(), l("h3", Ls, L(g.name), 1)) : N("", !0),
1252
- (i(!0), l(E, null, A(x(g.nodeTypes), (b, p) => (i(), V(fe, {
1253
- key: p,
1254
- type: p,
1255
- title: b.title,
1256
- onPointerdown: (w) => B(p, b)
1294
+ f.name !== "default" ? (i(), r("h3", js, [
1295
+ d("div", {
1296
+ onClick: (h) => l.value = f.name,
1297
+ style: { cursor: "pointer" }
1298
+ }, E(f.name), 9, Us),
1299
+ y(f.nodeTypes).length < Object.values(f.nodeTypes).length ? (i(), r("div", Gs, " ( " + E(y(f.nodeTypes).length) + " / " + E(Object.values(f.nodeTypes).length) + " ) ", 1)) : I("", !0)
1300
+ ])) : I("", !0),
1301
+ (i(!0), r($, null, A(y(f.nodeTypes), (h) => (i(), V(we, {
1302
+ key: h.type,
1303
+ type: h.type,
1304
+ title: h.title,
1305
+ onPointerdown: (p) => B(h.type, h)
1257
1306
  }, null, 8, ["type", "title", "onPointerdown"]))), 128))
1258
1307
  ]))), 128))
1259
1308
  ], 34),
1260
- S(dt, { name: "fade" }, {
1309
+ T(pt, { name: "fade" }, {
1261
1310
  default: X(() => [
1262
- h.value ? (i(), l("div", {
1311
+ v.value ? (i(), r("div", {
1263
1312
  key: 0,
1264
1313
  class: "baklava-dragged-node",
1265
- style: se(k.value)
1314
+ style: se(x.value)
1266
1315
  }, [
1267
- S(fe, {
1268
- type: h.value.type,
1269
- title: h.value.nodeInformation.title
1316
+ T(we, {
1317
+ type: v.value.type,
1318
+ title: v.value.nodeInformation.title
1270
1319
  }, null, 8, ["type", "title"])
1271
- ], 4)) : N("", !0)
1320
+ ], 4)) : I("", !0)
1272
1321
  ]),
1273
1322
  _: 1
1274
1323
  })
1275
1324
  ], 64));
1276
1325
  }
1277
- }), ln = /* @__PURE__ */ G({
1326
+ }), un = /* @__PURE__ */ j({
1278
1327
  __name: "CodeGraphEditor",
1279
1328
  props: {
1280
1329
  viewModel: {}
1281
1330
  },
1282
- setup(o) {
1283
- const t = ye(o, "viewModel"), s = (n) => n.events.update.emit(null);
1331
+ setup(n) {
1332
+ const t = Ie(n, "viewModel"), s = (o) => o.events.update.emit(null);
1284
1333
  return ee(() => {
1285
1334
  t.value.subscribe(), t.value.engine.start();
1286
- }), ut(() => {
1335
+ }), ht(() => {
1287
1336
  t.value.unsubscribe(), t.value.engine.stop();
1288
- }), (n, a) => (i(), V(_(Ke), { "view-model": t.value }, {
1337
+ }), (o, a) => (i(), V(k(st), { "view-model": t.value }, {
1289
1338
  palette: X(() => [
1290
- S(Gs)
1339
+ T(Rs)
1291
1340
  ]),
1292
1341
  node: X((u) => [
1293
- S(ws, ht(u, {
1294
- onUpdate: (d) => s(u.node)
1342
+ T(Cs, ft(u, {
1343
+ onUpdate: (l) => s(u.node)
1295
1344
  }), null, 16, ["onUpdate"])
1296
1345
  ]),
1297
1346
  sidebar: X((u) => [
1298
- S(Ts, ct(pt(u)), null, 16)
1347
+ T(Ts, vt(mt(u)), null, 16)
1299
1348
  ]),
1300
1349
  _: 1
1301
1350
  }, 8, ["view-model"]));
1302
1351
  }
1303
- }), Us = (o) => {
1352
+ }), Ds = (n) => {
1304
1353
  const e = "TOGGLE_PALETTE";
1305
- o.commandHandler.registerCommand(e, {
1306
- execute: () => o.settings.palette.enabled = !o.settings.palette.enabled,
1354
+ n.commandHandler.registerCommand(e, {
1355
+ execute: () => n.settings.palette.enabled = !n.settings.palette.enabled,
1307
1356
  canExecute: () => !0
1308
1357
  });
1309
1358
  const t = "CLEAR_ALL";
1310
- o.commandHandler.registerCommand(t, {
1311
- execute: () => o.displayedGraph.nodes.forEach((n) => o.displayedGraph.removeNode(n)),
1312
- canExecute: () => o.displayedGraph.nodes.length > 0
1359
+ n.commandHandler.registerCommand(t, {
1360
+ execute: () => n.code.clear(),
1361
+ canExecute: () => n.displayedGraph.nodes.length > 0
1313
1362
  });
1314
1363
  const s = "TOGGLE_MINIMAP";
1315
- o.commandHandler.registerCommand(s, {
1316
- execute: () => o.settings.enableMinimap = !o.settings.enableMinimap,
1317
- canExecute: () => o.displayedGraph.nodes.length > 1
1318
- }), o.settings.toolbar.commands = [
1364
+ n.commandHandler.registerCommand(s, {
1365
+ execute: () => n.settings.enableMinimap = !n.settings.enableMinimap,
1366
+ canExecute: () => n.displayedGraph.nodes.length > 1
1367
+ }), n.settings.toolbar.commands = [
1319
1368
  {
1320
1369
  command: e,
1321
1370
  title: "Toggle palette",
1322
1371
  // Tooltip text
1323
- icon: f(() => o.settings.palette.enabled ? St : Lt)
1372
+ icon: b(() => n.settings.palette.enabled ? St : jt)
1324
1373
  },
1325
- ...et,
1374
+ ...nt,
1326
1375
  {
1327
1376
  command: t,
1328
1377
  title: "Clear all",
1329
1378
  // Tooltip text
1330
- icon: is
1379
+ icon: rs
1331
1380
  },
1332
1381
  {
1333
1382
  command: s,
1334
1383
  title: "Toggle minimap",
1335
1384
  // Tooltip text
1336
- icon: f(() => o.settings.enableMinimap ? ss : Zt)
1385
+ icon: b(() => n.settings.enableMinimap ? ns : Kt)
1337
1386
  }
1338
1387
  ];
1339
1388
  }, W = {
@@ -1351,22 +1400,26 @@ const fe = /* @__PURE__ */ z($s, [["render", Bs]]), Vs = {
1351
1400
  },
1352
1401
  displayValueOnHover: !1
1353
1402
  };
1354
- function rn(o) {
1355
- const e = tt(o?.existingEditor);
1356
- e.code = o?.code ? new o.code(e) : new It(e), Us(e);
1403
+ function cn(n) {
1404
+ const e = ot(n?.existingEditor);
1405
+ e.code = n?.code ? new n.code(e) : new Mt(e), Ds(e);
1357
1406
  const t = {};
1358
1407
  return Object.keys(W).forEach((s) => {
1359
1408
  t[s] = typeof W[s] == "object" ? { ...e.settings[s], ...W[s] } : W[s];
1360
- }), e.settings = R({ ...e.settings, ...t }), e.settings.nodes.defaultWidth = 350, e.state = R({
1409
+ }), e.settings = G({ ...e.settings, ...t }), e.settings.nodes.defaultWidth = 350, e.state = G({
1361
1410
  modules: {},
1362
1411
  token: null
1363
- }), e.engine = new st(e.editor), e.subscribe = () => {
1412
+ }), e.engine = new at(e.editor), e.subscribe = () => {
1364
1413
  e.state.token && e.unsubscribe();
1365
1414
  const s = Symbol();
1366
- e.displayedGraph.events.addNode.subscribe(s, (n) => n.code = e.code), e.engine.events.beforeRun.subscribe(s, () => {
1367
- e.engine.pause(), e.code && (e.code.onCodeUpdate(), e.code.sortNodes(), e.code.updateOutputVariableNames()), e.engine.resume();
1368
- }), e.engine.events.afterRun.subscribe(s, (n) => {
1369
- e.engine.pause(), nt(n, e.editor), Nt(e.displayedGraph), e.code && (e.code.renderNodeCodes(), e.code.renderCode()), e.engine.resume();
1415
+ e.displayedGraph.events.addNode.subscribe(s, (o) => o.code = e.code), e.engine.events.beforeRun.subscribe(s, () => {
1416
+ e.engine.pause(), e.code && (e.code.onCodeUpdate(), e.code.sortNodes()), e.engine.resume();
1417
+ }), e.engine.events.beforeNodeCalculation.subscribe(s, (o) => {
1418
+ e.engine.pause();
1419
+ const a = o.node;
1420
+ a.isCodeNode && (a.updateOutputVariableName(), a.updateCodeNodeInputInterfaces()), e.engine.resume();
1421
+ }), e.engine.events.afterRun.subscribe(s, (o) => {
1422
+ e.engine.pause(), it(o, e.editor), e.code && (e.code.renderNodeCodes(), e.code.renderCode()), e.engine.resume();
1370
1423
  }), e.state.token = s;
1371
1424
  }, e.unsubscribe = () => {
1372
1425
  if (!e.state.token) return;
@@ -1375,47 +1428,46 @@ function rn(o) {
1375
1428
  }, e;
1376
1429
  }
1377
1430
  export {
1378
- gt as AbstractCodeNode,
1379
- Fs as ButtonInterface,
1380
- cn as ButtonInterfaceComponent,
1381
- Ws as CheckboxInterface,
1382
- pn as CheckboxInterfaceComponent,
1383
- It as Code,
1384
- ln as CodeGraphEditor,
1385
- Ys as CodeInputInterface,
1386
- we as CodeNode,
1387
- M as CodeNodeInterface,
1388
- yt as CodeOutputInterface,
1431
+ yt as AbstractCodeNode,
1432
+ Qs as CheckboxInterface,
1433
+ vn as CheckboxInterfaceComponent,
1434
+ Mt as Code,
1435
+ un as CodeGraphEditor,
1436
+ Me as CodeNode,
1437
+ ie as CodeNodeInputInterface,
1438
+ R as CodeNodeInterface,
1439
+ Nt as CodeNodeOutputInterface,
1389
1440
  W as DEFAULT_SETTINGS,
1390
- Ct as DynamicCodeNode,
1391
- Xs as IntegerInterface,
1392
- hn as IntegerInterfaceComponent,
1393
- Js as NumberInterface,
1394
- vn as NumberInterfaceComponent,
1395
- qs as SelectInterface,
1396
- mn as SelectInterfaceComponent,
1397
- Qs as SliderInterface,
1398
- fn as SliderInterfaceComponent,
1399
- Ks as TextInputInterface,
1400
- gn as TextInputInterfaceComponent,
1401
- Zs as TextInterface,
1402
- en as TextareaInputInterface,
1403
- bn as TextareaInputInterfaceComponent,
1404
- tn as addDefaultInterfaceTypes,
1405
- Us as addToolbarCommands,
1406
- wt as booleanType,
1407
- sn as defineCodeNode,
1408
- nn as defineDynamicCodeNode,
1409
- xt as dictType,
1441
+ It as DynamicCodeNode,
1442
+ Zs as IntegerInterface,
1443
+ mn as IntegerInterfaceComponent,
1444
+ Ks as NumberInterface,
1445
+ fn as NumberInterfaceComponent,
1446
+ en as SelectInterface,
1447
+ gn as SelectInterfaceComponent,
1448
+ tn as SliderInterface,
1449
+ bn as SliderInterfaceComponent,
1450
+ sn as TextInputInterface,
1451
+ _n as TextInputInterfaceComponent,
1452
+ nn as TextareaInputInterface,
1453
+ yn as TextareaInputInterfaceComponent,
1454
+ Js as addDefaultInterfaceTypes,
1455
+ Ds as addToolbarCommands,
1456
+ $e as booleanType,
1457
+ on as defineCodeNode,
1458
+ an as defineDynamicCodeNode,
1459
+ kt as dictType,
1460
+ Ys as formatInputs,
1410
1461
  Z as getCodeNodes,
1411
- on as getPositionAtColumn,
1412
- an as getPositionBeforeNode,
1413
- kt as listType,
1414
- xe as loadNodeState,
1462
+ rn as getPositionAtColumn,
1463
+ dn as getPositionBeforeNode,
1464
+ xt as listType,
1465
+ Oe as loadNodeState,
1415
1466
  H as nodeType,
1416
- ke as numberType,
1417
- bt as saveNodeState,
1418
- Ce as stringType,
1419
- Nt as transferCodeScript,
1420
- rn as useCodeGraph
1467
+ re as numberType,
1468
+ wt as saveNodeState,
1469
+ qs as setOptional,
1470
+ de as stringType,
1471
+ ln as transferCodeScript,
1472
+ cn as useCodeGraph
1421
1473
  };