@babsey/code-graph 0.1.1 → 0.1.3

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 We, sortTopologically as Ne, NodeInterface as Xe, displayInSidebar as $e, NodeInterfaceType as R, BaklavaInterfaceTypes as qe, CheckboxInterfaceComponent as Je, setType as z, IntegerInterfaceComponent as Ye, TextInputInterfaceComponent as Me, NumberInterfaceComponent as Qe, SelectInterfaceComponent as Ke, SliderInterfaceComponent as Ze, TextareaInputInterfaceComponent as et, allowMultipleConnections as K, IntegerInterface as tt, TextInputInterface as st, useViewModel as q, useTemporaryConnection as nt, Components as ke, useGraph as ae, GRAPH_NODE_TYPE_PREFIX as se, useTransform as ot, useNodeCategories as at, BaklavaEditor as it, DEFAULT_TOOLBAR_COMMANDS as rt, useBaklava as lt, DependencyEngine as dt, applyResult as ut } from "baklavajs";
1
+ import { AbstractNode as We, sortTopologically as Ne, NodeInterface as Xe, displayInSidebar as Me, NodeInterfaceType as R, BaklavaInterfaceTypes as qe, CheckboxInterfaceComponent as Je, setType as S, IntegerInterfaceComponent as Ye, TextInputInterfaceComponent as $e, NumberInterfaceComponent as Qe, SelectInterfaceComponent as Ke, SliderInterfaceComponent as Ze, TextareaInputInterfaceComponent as et, allowMultipleConnections as K, IntegerInterface as tt, TextInputInterface as st, useViewModel as q, useTemporaryConnection as nt, Components as ke, useGraph as ae, GRAPH_NODE_TYPE_PREFIX as se, useTransform as ot, useNodeCategories as at, BaklavaEditor as it, DEFAULT_TOOLBAR_COMMANDS as rt, useBaklava as lt, DependencyEngine as dt, applyResult as ut } from "baklavajs";
2
2
  import Z from "mustache";
3
- import { reactive as H, defineComponent as U, createElementBlock as l, openBlock as i, toDisplayString as j, markRaw as E, computed as b, createElementVNode as r, withDirectives as ee, vModelText as te, ref as V, onMounted as ie, onUpdated as Oe, normalizeClass as G, createCommentVNode as I, unref as _, renderSlot as W, createStaticVNode as J, onBeforeUnmount as ct, normalizeStyle as re, withModifiers as A, createBlock as O, Fragment as T, createTextVNode as pt, createVNode as S, withKeys as ne, renderList as P, nextTick as ht, toRef as Te, resolveDynamicComponent as we, inject as vt, Transition as mt, withCtx as F, onUnmounted as ft, normalizeProps as gt, guardReactiveProps as bt, mergeProps as yt } from "vue";
3
+ import { reactive as P, defineComponent as U, createElementBlock as r, openBlock as i, toDisplayString as j, markRaw as E, computed as b, createElementVNode as l, withDirectives as ee, vModelText as te, ref as B, onMounted as ie, onUpdated as Oe, normalizeClass as G, createCommentVNode as I, unref as _, renderSlot as W, createStaticVNode as J, onBeforeUnmount as ct, normalizeStyle as re, withModifiers as A, createBlock as O, Fragment as T, createTextVNode as pt, createVNode as z, withKeys as ne, renderList as D, nextTick as ht, toRef as Te, resolveDynamicComponent as Ce, inject as vt, Transition as mt, withCtx as F, onUnmounted as ft, normalizeProps as gt, guardReactiveProps as bt, mergeProps as yt } from "vue";
4
4
  import _t from "toposort";
5
5
  import { v4 as kt } from "uuid";
6
- import { usePointer as wt } from "@vueuse/core";
6
+ import { usePointer as Ct } from "@vueuse/core";
7
7
  Z.escape = (s) => s;
8
- class Ct extends We {
8
+ class wt extends We {
9
9
  state;
10
10
  code;
11
11
  isCodeNode = !0;
@@ -14,7 +14,7 @@ class Ct extends We {
14
14
  inputs = {};
15
15
  outputs = {};
16
16
  constructor() {
17
- super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state = H({
17
+ super(), this.initializeIo(), this.width = 400, this.twoColumn = !0, this.state = P({
18
18
  codeTemplate: "",
19
19
  hidden: !1,
20
20
  integrated: !1,
@@ -176,7 +176,7 @@ class Ct extends We {
176
176
  this.state.props = e;
177
177
  }
178
178
  }
179
- class Ee extends Ct {
179
+ class Ee extends wt {
180
180
  /**
181
181
  * The default implementation does nothing.
182
182
  * Overwrite this method to do calculation.
@@ -186,7 +186,7 @@ class Ee extends Ct {
186
186
  */
187
187
  calculate;
188
188
  load(e) {
189
- super.load(e), Be(this.graph, e);
189
+ super.load(e), Ve(this.graph, e);
190
190
  }
191
191
  save() {
192
192
  const e = super.save();
@@ -208,7 +208,7 @@ const xt = (s, e = !0) => {
208
208
  const d = e && t.length < n.indexOf(o) ? `${o}=` : "";
209
209
  t.push(`${d}{{ inputs.${o} }}`);
210
210
  }), t;
211
- }, Be = (s, e) => {
211
+ }, Ve = (s, e) => {
212
212
  if (!s) return;
213
213
  const t = s.findNodeById(e.id);
214
214
  if (!t || t.subgraph) return;
@@ -234,18 +234,18 @@ const xt = (s, e = !0) => {
234
234
  intf: {}
235
235
  },
236
236
  setup(s) {
237
- return (e, t) => (i(), l("div", {
237
+ return (e, t) => (i(), r("div", {
238
238
  title: s.intf.state?.script
239
239
  }, j(s.intf.name), 9, Nt));
240
240
  }
241
241
  });
242
- class D extends Xe {
242
+ class H extends Xe {
243
243
  isCodeNode = !0;
244
244
  code;
245
245
  state;
246
246
  type = null;
247
247
  constructor(e, t) {
248
- super(e, t), this.setComponent(E(le)), this.state = H({
248
+ super(e, t), this.setComponent(E(le)), this.state = P({
249
249
  optional: !1,
250
250
  script: ""
251
251
  });
@@ -264,12 +264,12 @@ class D extends Xe {
264
264
  }
265
265
  getValue = () => `${this.value ?? "None"}`;
266
266
  }
267
- const In = (s, e) => {
267
+ const yn = (s, e) => {
268
268
  s.state.optional = e, s.setHidden(e);
269
269
  };
270
- class Y extends D {
270
+ class Y extends H {
271
271
  constructor(e = "", t) {
272
- super(e, t), this.setComponent(E(le)), this.use($e, !0);
272
+ super(e, t), this.setComponent(E(le)), this.use(Me, !0);
273
273
  }
274
274
  set script(e) {
275
275
  if (this.state.script && this.allowMultipleConnections) {
@@ -285,16 +285,16 @@ class Y extends D {
285
285
  super.value = e, this.name !== "_node" && this.setHidden(!1);
286
286
  }
287
287
  }
288
- const Ve = new R("boolean"), $t = new R("dict"), ze = new R("list"), X = new R("node"), de = new R("number"), ue = new R("string"), Se = new R("tuple"), Nn = (s) => {
289
- new qe(s.editor, { viewPlugin: s }).addTypes(Ve, $t, ze, X, de, ue, Se);
288
+ const Be = new R("boolean"), Mt = new R("dict"), Se = new R("list"), X = new R("node"), de = new R("number"), ue = new R("string"), ze = new R("tuple"), _n = (s) => {
289
+ new qe(s.editor, { viewPlugin: s }).addTypes(Be, Mt, Se, X, de, ue, ze);
290
290
  };
291
- class $n extends Y {
291
+ class kn extends Y {
292
292
  constructor(e, t) {
293
- super(e, t), this.setComponent(E(Je)), this.use(z, Ve);
293
+ super(e, t), this.setComponent(E(Je)), this.use(S, Be);
294
294
  }
295
295
  getValue = () => this.value ? "True" : "False";
296
296
  }
297
- class Mt extends D {
297
+ class $t extends H {
298
298
  isCodeNodeOutput = !0;
299
299
  constructor(e = "", t = "") {
300
300
  super(e, t), this.setComponent(E(le));
@@ -307,41 +307,41 @@ class ce extends Y {
307
307
  min;
308
308
  max;
309
309
  constructor(e, t, n, o) {
310
- super(e, t), this.min = n, this.max = o, this.use(z, de);
310
+ super(e, t), this.min = n, this.max = o, this.use(S, de);
311
311
  }
312
312
  validate(e) {
313
313
  return (this.min === void 0 || e >= this.min) && (this.max === void 0 || e <= this.max);
314
314
  }
315
315
  }
316
- class Mn extends ce {
316
+ class Cn extends ce {
317
317
  component = E(Ye);
318
318
  validate(e) {
319
319
  return Number.isInteger(e) && super.validate(e);
320
320
  }
321
321
  }
322
- class On extends Y {
322
+ class wn extends Y {
323
323
  constructor(e = "", t = "") {
324
- super(e, t), this.setComponent(E(Me)), this.use(z, ze);
324
+ super(e, t), this.setComponent(E($e)), this.use(S, Se);
325
325
  }
326
326
  getValue = () => `[${this.value}]`;
327
327
  }
328
- class Tn extends ce {
328
+ class xn extends ce {
329
329
  component = E(Qe);
330
330
  }
331
331
  class pe extends Y {
332
332
  constructor(e, t) {
333
- super(e, t), this.use(z, ue);
333
+ super(e, t), this.use(S, ue);
334
334
  }
335
335
  getValue = () => `"${this.value}"`;
336
336
  }
337
- class En extends pe {
337
+ class In extends pe {
338
338
  component = E(Ke);
339
339
  items;
340
340
  constructor(e, t, n) {
341
341
  super(e, t), this.items = n;
342
342
  }
343
343
  }
344
- class Bn extends ce {
344
+ class Nn extends ce {
345
345
  component = E(Ze);
346
346
  min;
347
347
  max;
@@ -370,40 +370,40 @@ const Ot = U({
370
370
  }
371
371
  }) };
372
372
  }
373
- }), N = (s, e) => {
373
+ }), $ = (s, e) => {
374
374
  const t = s.__vccOpts || s;
375
375
  for (const [n, o] of e)
376
376
  t[n] = o;
377
377
  return t;
378
- }, Tt = { style: { position: "relative" } }, Et = { style: { "font-size": "12px", padding: "0 6px", position: "absolute", top: "-8px", "background-color": "var(--baklava-node-color-background)" } }, Bt = ["placeholder", "title"];
379
- function Vt(s, e, t, n, o, a) {
380
- return i(), l("div", Tt, [
381
- r("label", Et, j(s.intf.name), 1),
382
- ee(r("input", {
378
+ }, Tt = { style: { position: "relative" } }, Et = { style: { "font-size": "12px", padding: "0 6px", position: "absolute", top: "-8px", "background-color": "var(--baklava-node-color-background)" } }, Vt = ["placeholder", "title"];
379
+ function Bt(s, e, t, n, o, a) {
380
+ return i(), r("div", Tt, [
381
+ l("label", Et, j(s.intf.name), 1),
382
+ ee(l("input", {
383
383
  "onUpdate:modelValue": e[0] || (e[0] = (d) => s.v = d),
384
384
  type: "text",
385
385
  class: "baklava-input",
386
386
  placeholder: s.intf.name,
387
387
  title: s.intf.name
388
- }, null, 8, Bt), [
388
+ }, null, 8, Vt), [
389
389
  [te, s.v]
390
390
  ])
391
391
  ]);
392
392
  }
393
- const zt = /* @__PURE__ */ N(Ot, [["render", Vt]]);
394
- class Vn extends pe {
395
- component = E(zt);
393
+ const St = /* @__PURE__ */ $(Ot, [["render", Bt]]);
394
+ class Mn extends pe {
395
+ component = E(St);
396
396
  }
397
- class zn extends pe {
397
+ class $n extends pe {
398
398
  component = E(et);
399
399
  }
400
- class Sn extends Y {
400
+ class On extends Y {
401
401
  constructor(e = "", t = "") {
402
- super(e, t), this.setComponent(E(Me)), this.use(z, Se);
402
+ super(e, t), this.setComponent(E($e)), this.use(S, ze);
403
403
  }
404
404
  getValue = () => `(${this.value})`;
405
405
  }
406
- function jn(s) {
406
+ function Tn(s) {
407
407
  return class extends Ee {
408
408
  type = s.type;
409
409
  inputs = {};
@@ -411,10 +411,10 @@ function jn(s) {
411
411
  constructor() {
412
412
  super(), this._title = s.title ?? s.type, this.name = s.name ?? s.type, this.updateModules(s.modules), s.variableName && (this.state.variableName = s.variableName), s.codeTemplate && (this.codeTemplate = s.codeTemplate), this.addInput(
413
413
  "_node",
414
- new D("", []).use(z, X).use(K).setHidden(!0)
414
+ new H("", []).use(S, X).use(K).setHidden(!0)
415
415
  ), this.addOutput(
416
416
  "_node",
417
- new D("", []).use(z, X).use(K).setHidden(!0)
417
+ new H("", []).use(S, X).use(K).setHidden(!0)
418
418
  ), this.executeFactory("input", s.inputs), this.executeFactory("output", s.outputs), s.onCreate?.call(this);
419
419
  }
420
420
  // public calculate = definition.calculate
@@ -446,7 +446,7 @@ function jn(s) {
446
446
  }
447
447
  };
448
448
  }
449
- class St extends Ee {
449
+ class zt extends Ee {
450
450
  /**
451
451
  * The default implementation does nothing.
452
452
  * Overwrite this method to do calculation.
@@ -456,8 +456,8 @@ class St extends Ee {
456
456
  */
457
457
  calculate;
458
458
  }
459
- function Ln(s) {
460
- return class extends St {
459
+ function En(s) {
460
+ return class extends zt {
461
461
  type = s.type;
462
462
  inputs = {};
463
463
  outputs = {};
@@ -468,10 +468,10 @@ function Ln(s) {
468
468
  constructor() {
469
469
  super(), this._title = s.title ?? s.type, this.name = s.name ?? s.type, this.updateModules(s.modules), s.codeTemplate && (this.codeTemplate = s.codeTemplate), s.variableName && (this.state.variableName = s.variableName), this.addInput(
470
470
  "_node",
471
- new D("", []).use(z, X).use(K).setHidden(!0)
471
+ new H("", []).use(S, X).use(K).setHidden(!0)
472
472
  ), this.addOutput(
473
473
  "_node",
474
- new D("", []).use(z, X).use(K).setHidden(!0)
474
+ new H("", []).use(S, X).use(K).setHidden(!0)
475
475
  ), this.staticInputKeys.push("_node"), this.staticOutputKeys.push("_node"), this.executeFactory("input", s.inputs), this.executeFactory("output", s.outputs), s.onCreate?.call(this);
476
476
  }
477
477
  onPlaced() {
@@ -503,19 +503,19 @@ function Ln(s) {
503
503
  if (!this.inputs[t]) {
504
504
  const n = e.inputs[t].value;
505
505
  let o;
506
- typeof n == "number" ? o = new tt(t, n).use(z, de) : o = new st(t, JSON.stringify(n)).use(z, ue), o.use($e, !0), this.addInput(t, o);
506
+ typeof n == "number" ? o = new tt(t, n).use(S, de) : o = new st(t, JSON.stringify(n)).use(S, ue), o.use(Me, !0), this.addInput(t, o);
507
507
  }
508
508
  this.inputs[t] && (this.inputs[t].load(e.inputs[t]), this.inputs[t].nodeId = this.id);
509
509
  }
510
510
  for (const t of Object.keys(e.outputs))
511
511
  if (!this.staticOutputKeys.includes(t)) {
512
512
  if (!this.outputs[t]) {
513
- const n = new Mt(t);
513
+ const n = new $t(t);
514
514
  this.addOutput(t, n);
515
515
  }
516
516
  this.outputs[t] && (this.outputs[t].load(e.outputs[t]), this.outputs[t].nodeId = this.id);
517
517
  }
518
- Be(this.graph, e), this.preventUpdate = !1, this.events.loaded.emit(this);
518
+ Ve(this.graph, e), this.preventUpdate = !1, this.events.loaded.emit(this);
519
519
  }
520
520
  onUpdate() {
521
521
  if (this.preventUpdate) return;
@@ -556,7 +556,7 @@ class jt {
556
556
  _viewModel;
557
557
  _state;
558
558
  constructor(e) {
559
- this._id = kt(), this._viewModel = e, this._state = H({
559
+ this._id = kt(), this._viewModel = e, this._state = P({
560
560
  autosort: !1,
561
561
  lockCode: !1,
562
562
  modules: {},
@@ -780,13 +780,13 @@ const oe = (s) => {
780
780
  return s.nodes.forEach((t) => {
781
781
  t.subgraph ? e = e.concat(oe(t.subgraph)) : t.isCodeNode && e.push(t);
782
782
  }), e;
783
- }, Un = (s = 0, e = 100) => ({
783
+ }, Vn = (s = 0, e = 100) => ({
784
784
  x: s * 420,
785
785
  y: e
786
- }), Gn = (s) => {
786
+ }), Bn = (s) => {
787
787
  const e = { ...s.position };
788
788
  return e.x -= 440, e.y += 50, e;
789
- }, Rn = (s) => {
789
+ }, Sn = (s) => {
790
790
  const { calculationOrder: e, connectionsFromNode: t } = Ne(s);
791
791
  e.forEach((n) => {
792
792
  if (!n.isCodeNode) return;
@@ -795,62 +795,40 @@ const oe = (s) => {
795
795
  a.to.state && a.from.script && (a.to.state.script = a.from.script);
796
796
  });
797
797
  });
798
- }, Lt = ["id"], Ut = { class: "align-middle" }, Ce = /* @__PURE__ */ U({
798
+ }, Lt = ["id"], Ut = { class: "align-middle" }, we = /* @__PURE__ */ U({
799
799
  __name: "CodeGraphNodeInterface",
800
800
  props: {
801
801
  node: {},
802
802
  intf: {}
803
803
  },
804
804
  setup(s) {
805
- const e = s, { viewModel: t } = q(), { hoveredOver: n, temporaryConnection: o } = nt(), a = V(null), d = b(() => e.intf.connectionCount > 0), u = b(() => ({
805
+ const e = s, { viewModel: t } = q(), { hoveredOver: n, temporaryConnection: o } = nt(), a = B(null), d = b(() => e.intf.connectionCount > 0), u = b(() => ({
806
806
  "--connected": d.value
807
807
  })), v = () => {
808
808
  n(e.intf);
809
809
  }, k = () => {
810
810
  n(void 0);
811
- }, C = () => {
811
+ }, w = () => {
812
812
  a.value && t.value.hooks.renderInterface.execute({ intf: e.intf, el: a.value });
813
813
  };
814
- return ie(C), Oe(C), (B, L) => (i(), l("div", {
814
+ return ie(w), Oe(w), (V, L) => (i(), r("div", {
815
815
  id: s.intf.id,
816
816
  ref_key: "el",
817
817
  ref: a,
818
818
  class: G(["baklava-node-interface", u.value])
819
819
  }, [
820
- s.intf.port ? (i(), l("div", {
820
+ s.intf.port ? (i(), r("div", {
821
821
  key: 0,
822
822
  class: G(["__port", { "--selected": _(o)?.from === s.intf }]),
823
823
  onPointerover: v,
824
824
  onPointerout: k
825
825
  }, null, 34)) : I("", !0),
826
- r("span", Ut, [
827
- W(B.$slots, "default")
826
+ l("span", Ut, [
827
+ W(V.$slots, "default")
828
828
  ])
829
829
  ], 10, Lt));
830
830
  }
831
831
  }), Gt = {}, Rt = {
832
- xmlns: "http://www.w3.org/2000/svg",
833
- width: "24",
834
- height: "24",
835
- viewBox: "0 0 24 24",
836
- fill: "none",
837
- stroke: "currentColor",
838
- "stroke-width": "2",
839
- "stroke-linecap": "round",
840
- "stroke-linejoin": "round",
841
- class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"
842
- };
843
- function Ht(s, e) {
844
- return i(), l("svg", Rt, [...e[0] || (e[0] = [
845
- r("path", {
846
- stroke: "none",
847
- d: "M0 0h24v24H0z",
848
- fill: "none"
849
- }, null, -1),
850
- r("path", { d: "M5 12l5 5l10 -10" }, null, -1)
851
- ])]);
852
- }
853
- const Hn = /* @__PURE__ */ N(Gt, [["render", Ht]]), Pt = {}, Dt = {
854
832
  xmlns: "http://www.w3.org/2000/svg",
855
833
  width: "24",
856
834
  height: "24",
@@ -862,40 +840,17 @@ const Hn = /* @__PURE__ */ N(Gt, [["render", Ht]]), Pt = {}, Dt = {
862
840
  "stroke-linejoin": "round",
863
841
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"
864
842
  };
865
- function At(s, e) {
866
- return i(), l("svg", Dt, [...e[0] || (e[0] = [
867
- r("path", {
868
- stroke: "none",
869
- d: "M0 0h24v24H0z",
870
- fill: "none"
871
- }, null, -1),
872
- r("path", { d: "M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1)
873
- ])]);
874
- }
875
- const Ft = /* @__PURE__ */ N(Pt, [["render", At]]), Wt = {}, Xt = {
876
- xmlns: "http://www.w3.org/2000/svg",
877
- width: "24",
878
- height: "24",
879
- viewBox: "0 0 24 24",
880
- fill: "none",
881
- stroke: "currentColor",
882
- "stroke-width": "2",
883
- "stroke-linecap": "round",
884
- "stroke-linejoin": "round",
885
- class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"
886
- };
887
- function qt(s, e) {
888
- return i(), l("svg", Xt, [...e[0] || (e[0] = [
889
- r("path", {
843
+ function Pt(s, e) {
844
+ return i(), r("svg", Rt, [...e[0] || (e[0] = [
845
+ l("path", {
890
846
  stroke: "none",
891
847
  d: "M0 0h24v24H0z",
892
848
  fill: "none"
893
849
  }, null, -1),
894
- r("path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z" }, null, -1),
895
- r("path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" }, null, -1)
850
+ l("path", { d: "M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1)
896
851
  ])]);
897
852
  }
898
- const Pn = /* @__PURE__ */ N(Wt, [["render", qt]]), Jt = {}, Yt = {
853
+ const Dt = /* @__PURE__ */ $(Gt, [["render", Pt]]), Ht = {}, At = {
899
854
  xmlns: "http://www.w3.org/2000/svg",
900
855
  width: "24",
901
856
  height: "24",
@@ -907,19 +862,19 @@ const Pn = /* @__PURE__ */ N(Wt, [["render", qt]]), Jt = {}, Yt = {
907
862
  "stroke-linejoin": "round",
908
863
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"
909
864
  };
910
- function Qt(s, e) {
911
- return i(), l("svg", Yt, [...e[0] || (e[0] = [
912
- r("path", {
865
+ function Ft(s, e) {
866
+ return i(), r("svg", At, [...e[0] || (e[0] = [
867
+ l("path", {
913
868
  stroke: "none",
914
869
  d: "M0 0h24v24H0z",
915
870
  fill: "none"
916
871
  }, null, -1),
917
- r("path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
918
- r("path", { d: "M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
919
- r("path", { d: "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1)
872
+ l("path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
873
+ l("path", { d: "M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1),
874
+ l("path", { d: "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }, null, -1)
920
875
  ])]);
921
876
  }
922
- const Kt = /* @__PURE__ */ N(Jt, [["render", Qt]]), Zt = {}, es = {
877
+ const Wt = /* @__PURE__ */ $(Ht, [["render", Ft]]), Xt = {}, qt = {
923
878
  xmlns: "http://www.w3.org/2000/svg",
924
879
  width: "24",
925
880
  height: "24",
@@ -927,17 +882,17 @@ const Kt = /* @__PURE__ */ N(Jt, [["render", Qt]]), Zt = {}, es = {
927
882
  fill: "currentColor",
928
883
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"
929
884
  };
930
- function ts(s, e) {
931
- return i(), l("svg", es, [...e[0] || (e[0] = [
932
- r("path", {
885
+ function Jt(s, e) {
886
+ return i(), r("svg", qt, [...e[0] || (e[0] = [
887
+ l("path", {
933
888
  stroke: "none",
934
889
  d: "M0 0h24v24H0z",
935
890
  fill: "none"
936
891
  }, null, -1),
937
- 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)
892
+ l("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)
938
893
  ])]);
939
894
  }
940
- const ss = /* @__PURE__ */ N(Zt, [["render", ts]]), ns = {}, os = {
895
+ const Yt = /* @__PURE__ */ $(Xt, [["render", Jt]]), Qt = {}, Kt = {
941
896
  xmlns: "http://www.w3.org/2000/svg",
942
897
  width: "24",
943
898
  height: "24",
@@ -945,17 +900,17 @@ const ss = /* @__PURE__ */ N(Zt, [["render", ts]]), ns = {}, os = {
945
900
  fill: "currentColor",
946
901
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"
947
902
  };
948
- function as(s, e) {
949
- return i(), l("svg", os, [...e[0] || (e[0] = [
950
- r("path", {
903
+ function Zt(s, e) {
904
+ return i(), r("svg", Kt, [...e[0] || (e[0] = [
905
+ l("path", {
951
906
  stroke: "none",
952
907
  d: "M0 0h24v24H0z",
953
908
  fill: "none"
954
909
  }, null, -1),
955
- 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)
910
+ l("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)
956
911
  ])]);
957
912
  }
958
- const is = /* @__PURE__ */ N(ns, [["render", as]]), rs = {}, ls = {
913
+ const es = /* @__PURE__ */ $(Qt, [["render", Zt]]), ts = {}, ss = {
959
914
  xmlns: "http://www.w3.org/2000/svg",
960
915
  width: "24",
961
916
  height: "24",
@@ -963,17 +918,17 @@ const is = /* @__PURE__ */ N(ns, [["render", as]]), rs = {}, ls = {
963
918
  fill: "currentColor",
964
919
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"
965
920
  };
966
- function ds(s, e) {
967
- return i(), l("svg", ls, [...e[0] || (e[0] = [
968
- r("path", {
921
+ function ns(s, e) {
922
+ return i(), r("svg", ss, [...e[0] || (e[0] = [
923
+ l("path", {
969
924
  stroke: "none",
970
925
  d: "M0 0h24v24H0z",
971
926
  fill: "none"
972
927
  }, null, -1),
973
- 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)
928
+ l("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)
974
929
  ])]);
975
930
  }
976
- const us = /* @__PURE__ */ N(rs, [["render", ds]]), cs = {}, ps = {
931
+ const os = /* @__PURE__ */ $(ts, [["render", ns]]), as = {}, is = {
977
932
  xmlns: "http://www.w3.org/2000/svg",
978
933
  width: "24",
979
934
  height: "24",
@@ -981,17 +936,17 @@ const us = /* @__PURE__ */ N(rs, [["render", ds]]), cs = {}, ps = {
981
936
  fill: "currentColor",
982
937
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"
983
938
  };
984
- function hs(s, e) {
985
- return i(), l("svg", ps, [...e[0] || (e[0] = [
986
- r("path", {
939
+ function rs(s, e) {
940
+ return i(), r("svg", is, [...e[0] || (e[0] = [
941
+ l("path", {
987
942
  stroke: "none",
988
943
  d: "M0 0h24v24H0z",
989
944
  fill: "none"
990
945
  }, null, -1),
991
- 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)
946
+ l("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)
992
947
  ])]);
993
948
  }
994
- const vs = /* @__PURE__ */ N(cs, [["render", hs]]), ms = {}, fs = {
949
+ const ls = /* @__PURE__ */ $(as, [["render", rs]]), ds = {}, us = {
995
950
  xmlns: "http://www.w3.org/2000/svg",
996
951
  width: "24",
997
952
  height: "24",
@@ -999,17 +954,17 @@ const vs = /* @__PURE__ */ N(cs, [["render", hs]]), ms = {}, fs = {
999
954
  fill: "currentColor",
1000
955
  class: "baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"
1001
956
  };
1002
- function gs(s, e) {
1003
- return i(), l("svg", fs, [...e[0] || (e[0] = [
1004
- r("path", {
957
+ function cs(s, e) {
958
+ return i(), r("svg", us, [...e[0] || (e[0] = [
959
+ l("path", {
1005
960
  stroke: "none",
1006
961
  d: "M0 0h24v24H0z",
1007
962
  fill: "none"
1008
963
  }, null, -1),
1009
- 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)
964
+ l("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)
1010
965
  ])]);
1011
966
  }
1012
- const bs = /* @__PURE__ */ N(ms, [["render", gs]]), ys = {}, _s = {
967
+ const ps = /* @__PURE__ */ $(ds, [["render", cs]]), hs = {}, vs = {
1013
968
  xmlns: "http://www.w3.org/2000/svg",
1014
969
  width: "24",
1015
970
  height: "24",
@@ -1021,12 +976,12 @@ const bs = /* @__PURE__ */ N(ms, [["render", gs]]), ys = {}, _s = {
1021
976
  "stroke-linejoin": "round",
1022
977
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"
1023
978
  };
1024
- function ks(s, e) {
1025
- return i(), l("svg", _s, [...e[0] || (e[0] = [
979
+ function ms(s, e) {
980
+ return i(), r("svg", vs, [...e[0] || (e[0] = [
1026
981
  J('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>', 6)
1027
982
  ])]);
1028
983
  }
1029
- const ws = /* @__PURE__ */ N(ys, [["render", ks]]), Cs = {}, xs = {
984
+ const fs = /* @__PURE__ */ $(hs, [["render", ms]]), gs = {}, bs = {
1030
985
  xmlns: "http://www.w3.org/2000/svg",
1031
986
  width: "24",
1032
987
  height: "24",
@@ -1038,12 +993,12 @@ const ws = /* @__PURE__ */ N(ys, [["render", ks]]), Cs = {}, xs = {
1038
993
  "stroke-linejoin": "round",
1039
994
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"
1040
995
  };
1041
- function Is(s, e) {
1042
- return i(), l("svg", xs, [...e[0] || (e[0] = [
996
+ function ys(s, e) {
997
+ return i(), r("svg", bs, [...e[0] || (e[0] = [
1043
998
  J('<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)
1044
999
  ])]);
1045
1000
  }
1046
- const Ns = /* @__PURE__ */ N(Cs, [["render", Is]]), $s = {}, Ms = {
1001
+ const _s = /* @__PURE__ */ $(gs, [["render", ys]]), ks = {}, Cs = {
1047
1002
  xmlns: "http://www.w3.org/2000/svg",
1048
1003
  width: "24",
1049
1004
  height: "24",
@@ -1055,12 +1010,12 @@ const Ns = /* @__PURE__ */ N(Cs, [["render", Is]]), $s = {}, Ms = {
1055
1010
  "stroke-linejoin": "round",
1056
1011
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"
1057
1012
  };
1058
- function Os(s, e) {
1059
- return i(), l("svg", Ms, [...e[0] || (e[0] = [
1013
+ function ws(s, e) {
1014
+ return i(), r("svg", Cs, [...e[0] || (e[0] = [
1060
1015
  J('<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)
1061
1016
  ])]);
1062
1017
  }
1063
- const Ts = /* @__PURE__ */ N($s, [["render", Os]]), Es = {}, Bs = {
1018
+ const xs = /* @__PURE__ */ $(ks, [["render", ws]]), Is = {}, Ns = {
1064
1019
  xmlns: "http://www.w3.org/2000/svg",
1065
1020
  width: "24",
1066
1021
  height: "24",
@@ -1072,12 +1027,12 @@ const Ts = /* @__PURE__ */ N($s, [["render", Os]]), Es = {}, Bs = {
1072
1027
  "stroke-linejoin": "round",
1073
1028
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"
1074
1029
  };
1075
- function Vs(s, e) {
1076
- return i(), l("svg", Bs, [...e[0] || (e[0] = [
1030
+ function Ms(s, e) {
1031
+ return i(), r("svg", Ns, [...e[0] || (e[0] = [
1077
1032
  J('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>', 5)
1078
1033
  ])]);
1079
1034
  }
1080
- const zs = /* @__PURE__ */ N(Es, [["render", Vs]]), Ss = {}, js = {
1035
+ const $s = /* @__PURE__ */ $(Is, [["render", Ms]]), Os = {}, Ts = {
1081
1036
  xmlns: "http://www.w3.org/2000/svg",
1082
1037
  width: "24",
1083
1038
  height: "24",
@@ -1089,18 +1044,18 @@ const zs = /* @__PURE__ */ N(Es, [["render", Vs]]), Ss = {}, js = {
1089
1044
  "stroke-linejoin": "round",
1090
1045
  class: "baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-trash-off"
1091
1046
  };
1092
- function Ls(s, e) {
1093
- return i(), l("svg", js, [...e[0] || (e[0] = [
1047
+ function Es(s, e) {
1048
+ return i(), r("svg", Ts, [...e[0] || (e[0] = [
1094
1049
  J('<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)
1095
1050
  ])]);
1096
1051
  }
1097
- const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"], Rs = {
1052
+ const Vs = /* @__PURE__ */ $(Os, [["render", Es]]), Bs = ["id", "data-node-type"], Ss = {
1098
1053
  class: "__title-label",
1099
1054
  style: { "flex-grow": "1" }
1100
- }, Hs = { key: 0 }, Ps = {
1055
+ }, zs = { key: 0 }, js = {
1101
1056
  class: "__menu",
1102
1057
  style: { display: "flex" }
1103
- }, Ds = { class: "__outputs" }, As = { key: 0 }, Fs = ["id", "title"], Ws = { class: "__inputs" }, Xs = { key: 0 }, qs = ["id", "title"], Js = /* @__PURE__ */ U({
1058
+ }, Ls = { class: "__outputs" }, Us = { key: 0 }, Gs = ["id", "title"], Rs = { class: "__inputs" }, Ps = { key: 0 }, Ds = ["id", "title"], Hs = /* @__PURE__ */ U({
1104
1059
  __name: "CodeGraphNode",
1105
1060
  props: {
1106
1061
  node: {},
@@ -1109,9 +1064,9 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1109
1064
  },
1110
1065
  emits: ["select", "start-drag", "update"],
1111
1066
  setup(s, { emit: e }) {
1112
- const t = ke.ContextMenu, n = ke.NodeInterface, o = s, a = b(() => o.node), d = e, { viewModel: u } = q(), { graph: v, switchGraph: k } = ae(), C = V(null), B = V(!1), L = V(""), $ = V(null), m = V(!1);
1067
+ const t = ke.ContextMenu, n = ke.NodeInterface, o = s, a = b(() => o.node), d = e, { viewModel: u } = q(), { graph: v, switchGraph: k } = ae(), w = B(null), V = B(!1), L = B(""), N = B(null), m = B(!1);
1113
1068
  let y = 0, x = 0;
1114
- const f = V(!1), w = b(() => {
1069
+ const f = B(!1), C = b(() => {
1115
1070
  const c = [
1116
1071
  { value: "edit", label: "Edit" },
1117
1072
  { value: "rename", label: "Rename" },
@@ -1141,10 +1096,10 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1141
1096
  }, me = () => {
1142
1097
  const c = u.value.displayedGraph.sidebar;
1143
1098
  c.nodeId = o.node.id, c.visible = !0;
1144
- }, He = () => {
1099
+ }, Pe = () => {
1145
1100
  const c = u.value.displayedGraph.sidebar;
1146
1101
  c.nodeId = o.node.id;
1147
- }, Pe = async (c) => {
1102
+ }, De = async (c) => {
1148
1103
  switch (c) {
1149
1104
  case "edit":
1150
1105
  me();
@@ -1153,17 +1108,17 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1153
1108
  v.value.removeNode(o.node);
1154
1109
  break;
1155
1110
  case "rename":
1156
- L.value = o.node.title, B.value = !0, await ht(), $.value?.focus();
1111
+ L.value = o.node.title, V.value = !0, await ht(), N.value?.focus();
1157
1112
  break;
1158
1113
  case "editSubgraph":
1159
1114
  k(o.node.template);
1160
1115
  break;
1161
1116
  }
1162
1117
  }, fe = () => {
1163
- a.value.title = L.value, B.value = !1;
1118
+ a.value.title = L.value, V.value = !1;
1164
1119
  }, ge = () => {
1165
- C.value && u.value.hooks.renderNode.execute({ node: o.node, el: C.value });
1166
- }, De = (c) => {
1120
+ w.value && u.value.hooks.renderNode.execute({ node: o.node, el: w.value });
1121
+ }, He = (c) => {
1167
1122
  m.value = !0, y = o.node.width, x = c.clientX, c.preventDefault();
1168
1123
  }, be = (c) => {
1169
1124
  a.value.state && (a.value.state.integrated = c, d("update"));
@@ -1178,26 +1133,26 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1178
1133
  ge(), window.addEventListener("mousemove", ye), window.addEventListener("mouseup", _e);
1179
1134
  }), Oe(ge), ct(() => {
1180
1135
  window.removeEventListener("mousemove", ye), window.removeEventListener("mouseup", _e);
1181
- }), (c, g) => (i(), l("div", {
1136
+ }), (c, g) => (i(), r("div", {
1182
1137
  id: a.value.id,
1183
1138
  ref_key: "el",
1184
- ref: C,
1139
+ ref: w,
1185
1140
  class: G([p.value, "baklava-node"]),
1186
1141
  "data-node-type": a.value.type,
1187
1142
  style: re(je.value),
1188
1143
  onPointerdown: he
1189
1144
  }, [
1190
- _(u).settings.nodes.resizable ? (i(), l("div", {
1145
+ _(u).settings.nodes.resizable ? (i(), r("div", {
1191
1146
  key: 0,
1192
1147
  class: "__resize-handle",
1193
- onMousedown: De
1148
+ onMousedown: He
1194
1149
  }, null, 32)) : I("", !0),
1195
- r("div", {
1150
+ l("div", {
1196
1151
  class: "__title",
1197
1152
  onPointerdown: A(Ge, ["self", "stop"]),
1198
1153
  onContextmenu: A(ve, ["prevent"])
1199
1154
  }, [
1200
- a.value.inputs._node ? (i(), O(Ce, {
1155
+ a.value.inputs._node ? (i(), O(we, {
1201
1156
  key: 0,
1202
1157
  node: a.value,
1203
1158
  intf: a.value.inputs._node,
@@ -1205,10 +1160,10 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1205
1160
  "data-interface-type": "node",
1206
1161
  style: { "flex-grow": "0" }
1207
1162
  }, null, 8, ["node", "intf"])) : I("", !0),
1208
- B.value ? ee((i(), l("input", {
1163
+ V.value ? ee((i(), r("input", {
1209
1164
  key: 2,
1210
1165
  ref_key: "renameInputEl",
1211
- ref: $,
1166
+ ref: N,
1212
1167
  "onUpdate:modelValue": g[4] || (g[4] = (h) => L.value = h),
1213
1168
  class: "baklava-input",
1214
1169
  placeholder: "Node Name",
@@ -1218,56 +1173,56 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1218
1173
  onKeydown: ne(fe, ["enter"])
1219
1174
  }, null, 544)), [
1220
1175
  [te, L.value]
1221
- ]) : (i(), l(T, { key: 1 }, [
1222
- r("div", Rs, [
1223
- a.value.idx > -1 ? (i(), l("span", Hs, j(a.value.idx + 1) + " - ", 1)) : I("", !0),
1176
+ ]) : (i(), r(T, { key: 1 }, [
1177
+ l("div", Ss, [
1178
+ a.value.idx > -1 ? (i(), r("span", zs, j(a.value.idx + 1) + " - ", 1)) : I("", !0),
1224
1179
  pt(j(a.value.title), 1)
1225
1180
  ]),
1226
- r("div", Ps, [
1227
- a.value.subgraph ? I("", !0) : (i(), l(T, { key: 0 }, [
1228
- a.value.state.lockCode ? (i(), O(_(ws), {
1181
+ l("div", js, [
1182
+ a.value.subgraph ? I("", !0) : (i(), r(T, { key: 0 }, [
1183
+ a.value.state.lockCode ? (i(), O(_(fs), {
1229
1184
  key: 0,
1230
1185
  class: "--clickable mx-1",
1231
1186
  onClick: g[0] || (g[0] = (h) => a.value.lockCode = !1)
1232
1187
  })) : I("", !0),
1233
- a.value.state.integrated ? (i(), O(_(Ft), {
1188
+ a.value.state.integrated ? (i(), O(_(Dt), {
1234
1189
  key: 1,
1235
1190
  class: "--clickable mx-1",
1236
1191
  onClick: g[1] || (g[1] = (h) => be(!1))
1237
- })) : (i(), O(_(zs), {
1192
+ })) : (i(), O(_($s), {
1238
1193
  key: 2,
1239
1194
  class: "--clickable mx-1",
1240
1195
  onClick: g[2] || (g[2] = (h) => be(!0))
1241
1196
  })),
1242
- !_(u).displayedGraph.sidebar.visible && _(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), O(_(bs), {
1197
+ !_(u).displayedGraph.sidebar.visible && _(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), O(_(ps), {
1243
1198
  key: 3,
1244
1199
  class: "--clickable mx-1",
1245
1200
  onClick: me
1246
- })) : _(u).displayedGraph.sidebar.visible && _(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), O(_(us), {
1201
+ })) : _(u).displayedGraph.sidebar.visible && _(u).displayedGraph.sidebar.nodeId !== a.value.id ? (i(), O(_(os), {
1247
1202
  key: 4,
1248
1203
  class: "--clickable mx-1",
1249
- onClick: He
1250
- })) : (i(), O(_(vs), {
1204
+ onClick: Pe
1205
+ })) : (i(), O(_(ls), {
1251
1206
  key: 5,
1252
1207
  class: "--clickable mx-1",
1253
1208
  onClick: Re
1254
1209
  }))
1255
1210
  ], 64)),
1256
- S(_(Kt), {
1211
+ z(_(Wt), {
1257
1212
  class: "--clickable mx-1",
1258
1213
  onClick: ve
1259
1214
  }),
1260
- S(_(t), {
1215
+ z(_(t), {
1261
1216
  modelValue: f.value,
1262
1217
  "onUpdate:modelValue": g[3] || (g[3] = (h) => f.value = h),
1263
1218
  x: 0,
1264
1219
  y: 0,
1265
- items: w.value,
1266
- onClick: Pe
1220
+ items: C.value,
1221
+ onClick: De
1267
1222
  }, null, 8, ["modelValue", "items"])
1268
1223
  ])
1269
1224
  ], 64)),
1270
- a.value.outputs._node ? (i(), O(Ce, {
1225
+ a.value.outputs._node ? (i(), O(we, {
1271
1226
  key: 3,
1272
1227
  node: a.value,
1273
1228
  intf: a.value.outputs._node,
@@ -1275,33 +1230,33 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1275
1230
  "data-interface-type": "node"
1276
1231
  }, null, 8, ["node", "intf"])) : I("", !0)
1277
1232
  ], 32),
1278
- r("div", {
1233
+ l("div", {
1279
1234
  class: G(["__content", M.value]),
1280
1235
  onKeydown: g[5] || (g[5] = ne(A(() => {
1281
1236
  }, ["stop"]), ["delete"])),
1282
1237
  onContextmenu: g[6] || (g[6] = A(() => {
1283
1238
  }, ["prevent"]))
1284
1239
  }, [
1285
- r("div", Ds, [
1286
- (i(!0), l(T, null, P(Ue.value, (h) => (i(), l(T, {
1240
+ l("div", Ls, [
1241
+ (i(!0), r(T, null, D(Ue.value, (h) => (i(), r(T, {
1287
1242
  key: h.id
1288
1243
  }, [
1289
- a.value.state?.hidden ? (i(), l("div", As, [
1290
- h.port ? (i(), l("div", {
1244
+ a.value.state?.hidden ? (i(), r("div", Us, [
1245
+ h.port ? (i(), r("div", {
1291
1246
  key: 0,
1292
1247
  id: h.id,
1293
1248
  title: h.name,
1294
1249
  class: "baklava-node-interface --output --connected"
1295
1250
  }, [...g[7] || (g[7] = [
1296
- r("div", { class: "__port" }, null, -1)
1297
- ])], 8, Fs)) : I("", !0)
1251
+ l("div", { class: "__port" }, null, -1)
1252
+ ])], 8, Gs)) : I("", !0)
1298
1253
  ])) : W(c.$slots, "nodeInterface", {
1299
1254
  key: 1,
1300
1255
  type: "output",
1301
1256
  node: a.value,
1302
1257
  intf: h
1303
1258
  }, () => [
1304
- S(_(n), {
1259
+ z(_(n), {
1305
1260
  node: a.value,
1306
1261
  intf: h,
1307
1262
  title: h.type
@@ -1309,26 +1264,26 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1309
1264
  ])
1310
1265
  ], 64))), 128))
1311
1266
  ]),
1312
- r("div", Ws, [
1313
- (i(!0), l(T, null, P(Le.value, (h) => (i(), l(T, {
1267
+ l("div", Rs, [
1268
+ (i(!0), r(T, null, D(Le.value, (h) => (i(), r(T, {
1314
1269
  key: h.id
1315
1270
  }, [
1316
- a.value.state?.hidden ? (i(), l("div", Xs, [
1317
- h.port ? (i(), l("div", {
1271
+ a.value.state?.hidden ? (i(), r("div", Ps, [
1272
+ h.port ? (i(), r("div", {
1318
1273
  key: 0,
1319
1274
  id: h.id,
1320
1275
  title: h.name,
1321
1276
  class: "baklava-node-interface --input --connected"
1322
1277
  }, [...g[8] || (g[8] = [
1323
- r("div", { class: "__port" }, null, -1)
1324
- ])], 8, qs)) : I("", !0)
1278
+ l("div", { class: "__port" }, null, -1)
1279
+ ])], 8, Ds)) : I("", !0)
1325
1280
  ])) : W(c.$slots, "nodeInterface", {
1326
1281
  key: 1,
1327
1282
  node: a.value,
1328
1283
  intf: h,
1329
1284
  type: "input"
1330
1285
  }, () => [
1331
- S(_(n), {
1286
+ z(_(n), {
1332
1287
  node: a.value,
1333
1288
  intf: h,
1334
1289
  title: h.type
@@ -1337,9 +1292,9 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1337
1292
  ], 64))), 128))
1338
1293
  ])
1339
1294
  ], 34)
1340
- ], 46, Gs));
1295
+ ], 46, Bs));
1341
1296
  }
1342
- }), Ys = ["title"], Qs = {
1297
+ }), As = ["title"], Fs = {
1343
1298
  key: 0,
1344
1299
  class: "__label"
1345
1300
  }, xe = /* @__PURE__ */ U({
@@ -1353,42 +1308,42 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1353
1308
  emits: ["update:modelValue"],
1354
1309
  setup(s, { emit: e }) {
1355
1310
  const t = e;
1356
- return (n, o) => (i(), l("div", {
1311
+ return (n, o) => (i(), r("div", {
1357
1312
  class: G(["baklava-checkbox", { "--checked": s.inversed ? !s.modelValue : s.modelValue, "--disabled": s.disabled }]),
1358
1313
  title: s.name,
1359
1314
  onClick: o[0] || (o[0] = (a) => t("update:modelValue", !s.modelValue))
1360
1315
  }, [
1361
- o[1] || (o[1] = r("div", { class: "__checkmark-container" }, [
1362
- r("svg", {
1316
+ o[1] || (o[1] = l("div", { class: "__checkmark-container" }, [
1317
+ l("svg", {
1363
1318
  xmlns: "http://www.w3.org/2000/svg",
1364
1319
  width: "18",
1365
1320
  height: "18",
1366
1321
  viewBox: "0 0 18 18"
1367
1322
  }, [
1368
- r("path", {
1323
+ l("path", {
1369
1324
  class: "__checkmark",
1370
1325
  d: "M 6 5 L 6 10 L 16 10",
1371
1326
  transform: "rotate(-45 10 10)"
1372
1327
  })
1373
1328
  ])
1374
1329
  ], -1)),
1375
- s.name ? (i(), l("div", Qs, j(s.name), 1)) : I("", !0)
1376
- ], 10, Ys));
1330
+ s.name ? (i(), r("div", Fs, j(s.name), 1)) : I("", !0)
1331
+ ], 10, As));
1377
1332
  }
1378
- }), Ks = { class: "__header" }, Zs = { class: "__node-name" }, en = { class: "__interfaces" }, tn = { class: "__inputs" }, sn = { style: { display: "flex" } }, nn = { class: "__outputs" }, on = {
1333
+ }), Ws = { class: "__header" }, Xs = { class: "__node-name" }, qs = { class: "__interfaces" }, Js = { class: "__inputs" }, Ys = { style: { display: "flex" } }, Qs = { class: "__outputs" }, Ks = {
1379
1334
  key: 0,
1380
1335
  class: "__interface"
1381
- }, an = { style: { display: "flex" } }, rn = /* @__PURE__ */ U({
1336
+ }, Zs = { style: { display: "flex" } }, en = /* @__PURE__ */ U({
1382
1337
  __name: "CodeGraphSidebar",
1383
1338
  setup(s) {
1384
- const { viewModel: e } = q(), { graph: t } = ae(), n = V(null), o = Te(e.value.settings.sidebar, "width"), a = b(() => e.value.settings.sidebar.resizable);
1339
+ const { viewModel: e } = q(), { graph: t } = ae(), n = B(null), o = Te(e.value.settings.sidebar, "width"), a = b(() => e.value.settings.sidebar.resizable);
1385
1340
  let d = 0, u = 0;
1386
1341
  const v = b(() => {
1387
1342
  const f = t.value.sidebar.nodeId;
1388
- return t.value.nodes.find((w) => w.id === f);
1389
- }), k = b(() => v.value), C = b(() => ({
1343
+ return t.value.nodes.find((C) => C.id === f);
1344
+ }), k = b(() => v.value), w = b(() => ({
1390
1345
  width: `${o.value}px`
1391
- })), B = b(() => k.value ? Object.values(k.value.inputs).filter((f) => f.displayInSidebar && f.component) : []), L = b(() => k.value ? Object.values(k.value.outputs).filter((f) => f.displayInSidebar && f.component) : []), $ = () => {
1346
+ })), V = b(() => k.value ? Object.values(k.value.inputs).filter((f) => f.displayInSidebar && f.component) : []), L = b(() => k.value ? Object.values(k.value.outputs).filter((f) => f.displayInSidebar && f.component) : []), N = () => {
1392
1347
  t.value.sidebar.visible = !1;
1393
1348
  }, m = () => {
1394
1349
  v.value?.events.update.emit(null);
@@ -1401,50 +1356,50 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1401
1356
  { once: !0 }
1402
1357
  );
1403
1358
  }, x = (f) => {
1404
- const w = n.value?.parentElement?.getBoundingClientRect().width ?? 500, p = f.clientX - u;
1359
+ const C = n.value?.parentElement?.getBoundingClientRect().width ?? 500, p = f.clientX - u;
1405
1360
  let M = d - p;
1406
- M < 300 ? M = 300 : M > 0.9 * w && (M = 0.9 * w), o.value = M;
1361
+ M < 300 ? M = 300 : M > 0.9 * C && (M = 0.9 * C), o.value = M;
1407
1362
  };
1408
- return (f, w) => (i(), l("div", {
1363
+ return (f, C) => (i(), r("div", {
1409
1364
  class: G([{ "--open": _(t).sidebar.visible }, "baklava-sidebar"]),
1410
- style: re(C.value),
1365
+ style: re(w.value),
1411
1366
  ref_key: "el",
1412
1367
  ref: n
1413
1368
  }, [
1414
- a.value ? (i(), l("div", {
1369
+ a.value ? (i(), r("div", {
1415
1370
  key: 0,
1416
1371
  class: "__resizer",
1417
1372
  onMousedown: y
1418
1373
  }, null, 32)) : I("", !0),
1419
- v.value ? (i(), l(T, { key: 1 }, [
1420
- r("div", Ks, [
1421
- r("button", {
1374
+ v.value ? (i(), r(T, { key: 1 }, [
1375
+ l("div", Ws, [
1376
+ l("button", {
1422
1377
  tabindex: "-1",
1423
1378
  class: "__close",
1424
- onClick: $
1379
+ onClick: N
1425
1380
  }, "×"),
1426
- r("div", Zs, [
1427
- r("b", null, j(v.value.title), 1)
1381
+ l("div", Xs, [
1382
+ l("b", null, j(v.value.title), 1)
1428
1383
  ])
1429
1384
  ]),
1430
- r("div", en, [
1431
- r("div", tn, [
1432
- (i(!0), l(T, null, P(B.value, (p) => (i(), l("div", {
1385
+ l("div", qs, [
1386
+ l("div", Js, [
1387
+ (i(!0), r(T, null, D(V.value, (p) => (i(), r("div", {
1433
1388
  key: p.id,
1434
1389
  class: "__interface"
1435
1390
  }, [
1436
- r("div", sn, [
1437
- S(xe, {
1391
+ l("div", Ys, [
1392
+ z(xe, {
1438
1393
  modelValue: p.hidden,
1439
1394
  "onUpdate:modelValue": [
1440
1395
  (M) => p.hidden = M,
1441
- w[0] || (w[0] = () => v.value?.events.update.emit(null))
1396
+ C[0] || (C[0] = () => v.value?.events.update.emit(null))
1442
1397
  ],
1443
1398
  disabled: !p.optional,
1444
1399
  inversed: "",
1445
1400
  style: { "padding-right": "8px" }
1446
1401
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
1447
- (i(), O(we(p.component), {
1402
+ (i(), O(Ce(p.component), {
1448
1403
  modelValue: p.value,
1449
1404
  "onUpdate:modelValue": (M) => p.value = M,
1450
1405
  node: v.value,
@@ -1454,11 +1409,11 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1454
1409
  ])
1455
1410
  ]))), 128))
1456
1411
  ]),
1457
- r("div", nn, [
1458
- k.value && k.value.state ? (i(), l("div", on, [
1459
- w[3] || (w[3] = r("label", null, "Variable name", -1)),
1460
- ee(r("input", {
1461
- "onUpdate:modelValue": w[1] || (w[1] = (p) => k.value.state.variableName = p),
1412
+ l("div", Qs, [
1413
+ k.value && k.value.state ? (i(), r("div", Ks, [
1414
+ C[3] || (C[3] = l("label", null, "Variable name", -1)),
1415
+ ee(l("input", {
1416
+ "onUpdate:modelValue": C[1] || (C[1] = (p) => k.value.state.variableName = p),
1462
1417
  type: "text",
1463
1418
  class: "baklava-input",
1464
1419
  title: "Variable name",
@@ -1468,22 +1423,22 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1468
1423
  [te, k.value.state.variableName]
1469
1424
  ])
1470
1425
  ])) : I("", !0),
1471
- (i(!0), l(T, null, P(L.value, (p) => (i(), l("div", {
1426
+ (i(!0), r(T, null, D(L.value, (p) => (i(), r("div", {
1472
1427
  key: p.id,
1473
1428
  class: "__interface"
1474
1429
  }, [
1475
- r("div", an, [
1476
- S(xe, {
1430
+ l("div", Zs, [
1431
+ z(xe, {
1477
1432
  modelValue: p.hidden,
1478
1433
  "onUpdate:modelValue": [
1479
1434
  (M) => p.hidden = M,
1480
- w[2] || (w[2] = () => v.value?.events.update.emit(null))
1435
+ C[2] || (C[2] = () => v.value?.events.update.emit(null))
1481
1436
  ],
1482
1437
  disabled: !p.optional,
1483
1438
  inversed: "",
1484
1439
  style: { "padding-right": "8px" }
1485
1440
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
1486
- (i(), O(we(p.component), {
1441
+ (i(), O(Ce(p.component), {
1487
1442
  modelValue: p.value,
1488
1443
  "onUpdate:modelValue": (M) => p.value = M,
1489
1444
  node: v.value,
@@ -1498,7 +1453,7 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1498
1453
  ], 64)) : I("", !0)
1499
1454
  ], 6));
1500
1455
  }
1501
- }), ln = U({
1456
+ }), tn = U({
1502
1457
  props: {
1503
1458
  type: {
1504
1459
  type: String,
@@ -1510,82 +1465,82 @@ const Us = /* @__PURE__ */ N(Ss, [["render", Ls]]), Gs = ["id", "data-node-type"
1510
1465
  }
1511
1466
  },
1512
1467
  setup(s) {
1513
- const { viewModel: e } = q(), { switchGraph: t } = ae(), n = V(!1), o = b(() => s.type.startsWith(se));
1468
+ const { viewModel: e } = q(), { switchGraph: t } = ae(), n = B(!1), o = b(() => s.type.startsWith(se));
1514
1469
  return { showContextMenu: n, hasContextMenu: o, contextMenuItems: [
1515
1470
  { label: "Edit Subgraph", value: "editSubgraph" },
1516
1471
  { label: "Delete Subgraph", value: "deleteSubgraph" }
1517
1472
  ], openContextMenu: () => {
1518
1473
  n.value = !0;
1519
1474
  }, onContextMenuClick: (v) => {
1520
- const k = s.type.substring(se.length), C = e.value.editor.graphTemplates.find((B) => B.id === k);
1521
- if (C)
1475
+ const k = s.type.substring(se.length), w = e.value.editor.graphTemplates.find((V) => V.id === k);
1476
+ if (w)
1522
1477
  switch (v) {
1523
1478
  case "editSubgraph":
1524
- t(C);
1479
+ t(w);
1525
1480
  break;
1526
1481
  case "deleteSubgraph":
1527
- e.value.editor.removeGraphTemplate(C);
1482
+ e.value.editor.removeGraphTemplate(w);
1528
1483
  break;
1529
1484
  }
1530
1485
  } };
1531
1486
  }
1532
- }), dn = ["data-node-type"], un = { class: "__title" }, cn = { class: "__title-label" };
1533
- function pn(s, e, t, n, o, a) {
1534
- return i(), l("div", {
1487
+ }), sn = ["data-node-type"], nn = { class: "__title" }, on = { class: "__title-label" };
1488
+ function an(s, e, t, n, o, a) {
1489
+ return i(), r("div", {
1535
1490
  class: "baklava-node --palette",
1536
1491
  "data-node-type": s.type
1537
1492
  }, [
1538
- r("div", un, [
1539
- r("div", cn, j(s.title), 1)
1493
+ l("div", nn, [
1494
+ l("div", on, j(s.title), 1)
1540
1495
  ])
1541
- ], 8, dn);
1496
+ ], 8, sn);
1542
1497
  }
1543
- const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1498
+ const Ie = /* @__PURE__ */ $(tn, [["render", an]]), rn = {
1544
1499
  class: "baklava-node --palette",
1545
1500
  style: { "margin-top": "-20px", "margin-bottom": "20px" }
1546
- }, vn = {
1501
+ }, ln = {
1547
1502
  key: 0,
1548
1503
  style: { display: "flex", "justify-content": "space-between" }
1549
- }, mn = ["onClick"], fn = {
1504
+ }, dn = ["onClick"], un = {
1550
1505
  key: 0,
1551
1506
  style: { margin: "auto 0", "font-size": "12px" }
1552
- }, gn = /* @__PURE__ */ U({
1507
+ }, cn = /* @__PURE__ */ U({
1553
1508
  __name: "CodeNodePalette",
1554
1509
  setup(s) {
1555
- const { viewModel: e } = q(), { x: t, y: n } = wt(), { transform: o } = ot(), a = at(e), d = vt("editorEl"), u = V(""), v = V(null), k = () => u.value ? a.value.filter(
1556
- ($) => $.name.toLowerCase().includes(u.value.toLowerCase()) || Object.values($.nodeTypes).some(
1510
+ const { viewModel: e } = q(), { x: t, y: n } = Ct(), { transform: o } = ot(), a = at(e), d = vt("editorEl"), u = B(""), v = B(null), k = () => u.value ? a.value.filter(
1511
+ (N) => N.name.toLowerCase().includes(u.value.toLowerCase()) || Object.values(N.nodeTypes).some(
1557
1512
  (m) => m.title.toLowerCase().includes(u.value.toLowerCase())
1558
1513
  )
1559
- ) : a.value, C = ($) => u.value ? Object.values($).filter(
1514
+ ) : a.value, w = (N) => u.value ? Object.values(N).filter(
1560
1515
  (m) => m.category.toLowerCase().includes(u.value.toLowerCase()) || m.title.toLowerCase().includes(u.value.toLowerCase())
1561
- ) : Object.values($), B = b(() => {
1516
+ ) : Object.values(N), V = b(() => {
1562
1517
  if (!v.value || !d?.value) return {};
1563
- const { left: $, top: m } = d.value.getBoundingClientRect();
1518
+ const { left: N, top: m } = d.value.getBoundingClientRect();
1564
1519
  return {
1565
1520
  top: `${n.value - m}px`,
1566
- left: `${t.value - $}px`
1521
+ left: `${t.value - N}px`
1567
1522
  };
1568
- }), L = ($, m) => {
1523
+ }), L = (N, m) => {
1569
1524
  v.value = {
1570
- type: $,
1525
+ type: N,
1571
1526
  nodeInformation: m
1572
1527
  };
1573
1528
  const y = () => {
1574
- const x = H(new m.type());
1529
+ const x = P(new m.type());
1575
1530
  e.value.displayedGraph.addNode(x);
1576
- const f = d.value.getBoundingClientRect(), [w, p] = o(t.value - f.left, n.value - f.top);
1577
- x.position.x = w, x.position.y = p, v.value = null, document.removeEventListener("pointerup", y);
1531
+ const f = d.value.getBoundingClientRect(), [C, p] = o(t.value - f.left, n.value - f.top);
1532
+ x.position.x = C, x.position.y = p, v.value = null, document.removeEventListener("pointerup", y);
1578
1533
  };
1579
1534
  document.addEventListener("pointerup", y);
1580
1535
  };
1581
- return ($, m) => (i(), l(T, null, [
1582
- r("div", {
1536
+ return (N, m) => (i(), r(T, null, [
1537
+ l("div", {
1583
1538
  class: G([{ "--open": _(e).settings.palette.enabled }, "baklava-node-palette"]),
1584
1539
  onContextmenu: m[1] || (m[1] = A(() => {
1585
1540
  }, ["stop", "prevent"]))
1586
1541
  }, [
1587
- r("div", hn, [
1588
- ee(r("input", {
1542
+ l("div", rn, [
1543
+ ee(l("input", {
1589
1544
  "onUpdate:modelValue": m[0] || (m[0] = (y) => u.value = y),
1590
1545
  type: "text",
1591
1546
  class: "baklava-input",
@@ -1595,17 +1550,17 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1595
1550
  [te, u.value]
1596
1551
  ])
1597
1552
  ]),
1598
- (i(!0), l(T, null, P(k(), (y) => (i(), l("section", {
1553
+ (i(!0), r(T, null, D(k(), (y) => (i(), r("section", {
1599
1554
  key: y.name
1600
1555
  }, [
1601
- y.name !== "default" ? (i(), l("h3", vn, [
1602
- r("div", {
1556
+ y.name !== "default" ? (i(), r("h3", ln, [
1557
+ l("div", {
1603
1558
  onClick: (x) => u.value = y.name,
1604
1559
  style: { cursor: "pointer" }
1605
- }, j(y.name), 9, mn),
1606
- C(y.nodeTypes).length < Object.values(y.nodeTypes).length ? (i(), l("div", fn, " ( " + j(C(y.nodeTypes).length) + " / " + j(Object.values(y.nodeTypes).length) + " ) ", 1)) : I("", !0)
1560
+ }, j(y.name), 9, dn),
1561
+ w(y.nodeTypes).length < Object.values(y.nodeTypes).length ? (i(), r("div", un, " ( " + j(w(y.nodeTypes).length) + " / " + j(Object.values(y.nodeTypes).length) + " ) ", 1)) : I("", !0)
1607
1562
  ])) : I("", !0),
1608
- (i(!0), l(T, null, P(C(y.nodeTypes), (x) => (i(), O(Ie, {
1563
+ (i(!0), r(T, null, D(w(y.nodeTypes), (x) => (i(), O(Ie, {
1609
1564
  key: x.type,
1610
1565
  type: x.type,
1611
1566
  title: x.title,
@@ -1613,14 +1568,14 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1613
1568
  }, null, 8, ["type", "title", "onPointerdown"]))), 128))
1614
1569
  ]))), 128))
1615
1570
  ], 34),
1616
- S(mt, { name: "fade" }, {
1571
+ z(mt, { name: "fade" }, {
1617
1572
  default: F(() => [
1618
- v.value ? (i(), l("div", {
1573
+ v.value ? (i(), r("div", {
1619
1574
  key: 0,
1620
1575
  class: "baklava-dragged-node",
1621
- style: re(B.value)
1576
+ style: re(V.value)
1622
1577
  }, [
1623
- S(Ie, {
1578
+ z(Ie, {
1624
1579
  type: v.value.type,
1625
1580
  title: v.value.nodeInformation.title
1626
1581
  }, null, 8, ["type", "title"])
@@ -1630,7 +1585,7 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1630
1585
  })
1631
1586
  ], 64));
1632
1587
  }
1633
- }), Dn = /* @__PURE__ */ U({
1588
+ }), zn = /* @__PURE__ */ U({
1634
1589
  __name: "CodeGraphEditor",
1635
1590
  props: {
1636
1591
  viewModel: {}
@@ -1643,15 +1598,15 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1643
1598
  t.value.unsubscribe(), t.value.engine.stop();
1644
1599
  }), (o, a) => (i(), O(_(it), { "view-model": t.value }, {
1645
1600
  palette: F(() => [
1646
- S(gn)
1601
+ z(cn)
1647
1602
  ]),
1648
1603
  node: F((d) => [
1649
- S(Js, yt(d, {
1604
+ z(Hs, yt(d, {
1650
1605
  onUpdate: (u) => n(d.node)
1651
1606
  }), null, 16, ["onUpdate"])
1652
1607
  ]),
1653
1608
  sidebar: F((d) => [
1654
- S(rn, gt(bt(d)), {
1609
+ z(en, gt(bt(d)), {
1655
1610
  codeEditor: F(({ node: u }) => [
1656
1611
  W(o.$slots, "sidebarCodeEditor", { node: u })
1657
1612
  ]),
@@ -1661,7 +1616,7 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1661
1616
  _: 3
1662
1617
  }, 8, ["view-model"]));
1663
1618
  }
1664
- }), bn = (s) => {
1619
+ }), pn = (s) => {
1665
1620
  const e = "TOGGLE_PALETTE";
1666
1621
  s.commandHandler.registerCommand(e, {
1667
1622
  execute: () => s.settings.palette.enabled = !s.settings.palette.enabled,
@@ -1681,20 +1636,20 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1681
1636
  command: e,
1682
1637
  title: "Toggle palette",
1683
1638
  // Tooltip text
1684
- icon: b(() => s.settings.palette.enabled ? ss : is)
1639
+ icon: b(() => s.settings.palette.enabled ? Yt : es)
1685
1640
  },
1686
1641
  ...rt,
1687
1642
  {
1688
1643
  command: t,
1689
1644
  title: "Clear all",
1690
1645
  // Tooltip text
1691
- icon: Us
1646
+ icon: Vs
1692
1647
  },
1693
1648
  {
1694
1649
  command: n,
1695
1650
  title: "Toggle minimap",
1696
1651
  // Tooltip text
1697
- icon: b(() => s.settings.enableMinimap ? Ts : Ns)
1652
+ icon: b(() => s.settings.enableMinimap ? xs : _s)
1698
1653
  }
1699
1654
  ];
1700
1655
  }, Q = {
@@ -1712,16 +1667,18 @@ const Ie = /* @__PURE__ */ N(ln, [["render", pn]]), hn = {
1712
1667
  },
1713
1668
  displayValueOnHover: !1
1714
1669
  };
1715
- function An(s) {
1670
+ function jn(s) {
1716
1671
  const e = lt(s?.existingEditor);
1717
- e.code = s?.code ? new s.code(e) : new jt(e), bn(e);
1672
+ e.code = s?.code ? new s.code(e) : new jt(e), pn(e);
1718
1673
  const t = {};
1719
1674
  return Object.keys(Q).forEach((n) => {
1720
1675
  t[n] = typeof Q[n] == "object" ? { ...e.settings[n], ...Q[n] } : Q[n];
1721
- }), e.settings = H({ ...e.settings, ...t }), e.settings.nodes.defaultWidth = 350, e.state = H({
1676
+ }), e.settings = P({ ...e.settings, ...t }), e.settings.nodes.defaultWidth = 350, e.state = P({
1722
1677
  modules: {},
1723
1678
  token: null
1724
- }), e.engine = new dt(e.editor), e.subscribe = () => {
1679
+ }), e.init = () => {
1680
+ e.unsubscribe(), e.engine = new dt(e.editor);
1681
+ }, e.subscribe = () => {
1725
1682
  e.state.token && e.unsubscribe();
1726
1683
  const n = Symbol(), o = e.displayedGraph;
1727
1684
  o.events.addNode.subscribe(n, (a) => {
@@ -1746,58 +1703,56 @@ function An(s) {
1746
1703
  }, e;
1747
1704
  }
1748
1705
  export {
1749
- Ct as AbstractCodeNode,
1750
- Hn as Check,
1751
- $n as CheckboxInterface,
1706
+ wt as AbstractCodeNode,
1707
+ kn as CheckboxInterface,
1752
1708
  jt as Code,
1753
- Dn as CodeGraphEditor,
1709
+ zn as CodeGraphEditor,
1754
1710
  Ee as CodeNode,
1755
1711
  Y as CodeNodeInputInterface,
1756
- D as CodeNodeInterface,
1712
+ H as CodeNodeInterface,
1757
1713
  le as CodeNodeInterfaceComponent,
1758
- Mt as CodeNodeOutputInterface,
1759
- Ft as CodeVariable,
1760
- Pn as Copy,
1714
+ $t as CodeNodeOutputInterface,
1715
+ Dt as CodeVariable,
1761
1716
  Q as DEFAULT_SETTINGS,
1762
- Kt as DotsVertical,
1763
- St as DynamicCodeNode,
1764
- Mn as IntegerInterface,
1765
- ss as LayoutSidebarLeftCollapse,
1766
- is as LayoutSidebarLeftExpand,
1767
- us as LayoutSidebarRight,
1768
- vs as LayoutSidebarRightCollapse,
1769
- bs as LayoutSidebarRightExpand,
1770
- On as ListInputInterface,
1771
- ws as LockCode,
1772
- Tn as NumberInterface,
1773
- Ns as Schema,
1774
- Ts as SchemaOff,
1775
- En as SelectInterface,
1776
- Bn as SliderInterface,
1777
- Vn as TextInputInterface,
1778
- zt as TextInputInterfaceComponent,
1779
- zn as TextareaInputInterface,
1780
- zs as TransitionBottom,
1781
- Us as TrashOff,
1782
- Sn as TupleInputInterface,
1783
- Nn as addDefaultInterfaceTypes,
1784
- bn as addToolbarCommands,
1785
- Ve as booleanType,
1786
- jn as defineCodeNode,
1787
- Ln as defineDynamicCodeNode,
1788
- $t as dictType,
1717
+ Wt as DotsVertical,
1718
+ zt as DynamicCodeNode,
1719
+ Cn as IntegerInterface,
1720
+ Yt as LayoutSidebarLeftCollapse,
1721
+ es as LayoutSidebarLeftExpand,
1722
+ os as LayoutSidebarRight,
1723
+ ls as LayoutSidebarRightCollapse,
1724
+ ps as LayoutSidebarRightExpand,
1725
+ wn as ListInputInterface,
1726
+ fs as LockCode,
1727
+ xn as NumberInterface,
1728
+ _s as Schema,
1729
+ xs as SchemaOff,
1730
+ In as SelectInterface,
1731
+ Nn as SliderInterface,
1732
+ Mn as TextInputInterface,
1733
+ St as TextInputInterfaceComponent,
1734
+ $n as TextareaInputInterface,
1735
+ $s as TransitionBottom,
1736
+ Vs as TrashOff,
1737
+ On as TupleInputInterface,
1738
+ _n as addDefaultInterfaceTypes,
1739
+ pn as addToolbarCommands,
1740
+ Be as booleanType,
1741
+ Tn as defineCodeNode,
1742
+ En as defineDynamicCodeNode,
1743
+ Mt as dictType,
1789
1744
  xt as formatInputs,
1790
1745
  oe as getCodeNodes,
1791
- Un as getPositionAtColumn,
1792
- Gn as getPositionBeforeNode,
1793
- ze as listType,
1794
- Be as loadNodeState,
1746
+ Vn as getPositionAtColumn,
1747
+ Bn as getPositionBeforeNode,
1748
+ Se as listType,
1749
+ Ve as loadNodeState,
1795
1750
  X as nodeType,
1796
1751
  de as numberType,
1797
1752
  It as saveNodeState,
1798
- In as setOptional,
1753
+ yn as setOptional,
1799
1754
  ue as stringType,
1800
- Rn as transferCodeScript,
1801
- Se as tupleType,
1802
- An as useCodeGraph
1755
+ Sn as transferCodeScript,
1756
+ ze as tupleType,
1757
+ jn as useCodeGraph
1803
1758
  };