x-block-lib 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- var xe = Object.defineProperty;
3
- var Ye = (e, o, t) => o in e ? xe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
- var L = (e, o, t) => Ye(e, typeof o != "symbol" ? o + "" : o, t);
5
- import { defineComponent as z, resolveComponent as C, openBlock as I, createBlock as S, unref as Y, useModel as le, computed as $, ref as j, onMounted as Le, onUnmounted as Ke, withCtx as U, createVNode as R, mergeProps as Fe, createElementVNode as ae, normalizeStyle as X, createElementBlock as x, Fragment as He, renderList as we, createTextVNode as Ge, toDisplayString as $e, mergeModels as Ee, onBeforeUnmount as je, watch as V, resolveDirective as Xe, withDirectives as We, createCommentVNode as te } from "vue";
6
- import { d as _, j as s, O as l, u, X as Je, B as O, E, M as h, i as Q, a as b, b as d, C as ye, F as Te, c as ze, P as re, N as de, V as W, e as Qe, f as Ce, s as qe, g as M, S as m, h as oe, k as B, l as K, m as ne, n as P, o as N, p as he, G as ie, q as Ze, r as et, t as se, U as F, D as H, v as k, w as tt, T as q, x as Ae, y as ot, z as nt } from "./blockly-jgwpd4oo.js";
7
- import { storeToRefs as it } from "pinia";
8
- import { openConfirmDlg as st, openPromptDlg as lt, eventBus as ce, useGlobalStore as at, useViewStack as rt } from "x-essential-lib";
9
- var ct = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", _t = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", ut = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", pt = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Tt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
2
+ var Qe = Object.defineProperty;
3
+ var qe = (e, o, t) => o in e ? Qe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
+ var A = (e, o, t) => qe(e, typeof o != "symbol" ? o + "" : o, t);
5
+ import { defineComponent as W, resolveComponent as v, openBlock as L, createBlock as P, unref as b, useModel as ue, ref as ee, onMounted as Se, onUnmounted as Ze, withCtx as K, createElementBlock as X, Fragment as et, renderList as tt, createVNode as B, createTextVNode as ot, toDisplayString as pe, computed as F, isRef as nt, withKeys as it, withModifiers as le, mergeProps as st, createElementVNode as M, normalizeStyle as H, createCommentVNode as te, mergeModels as Ae, onBeforeUnmount as lt, watch as G, resolveDirective as at, withDirectives as rt } from "vue";
6
+ import { d as _, j as s, O as l, u, X as ct, B as y, E as h, M as O, i as ie, a as U, b as E, C as Me, F as Ee, c as _t, P as Te, N as he, V as oe, e as ut, f as Ue, s as pt, g as w, S as g, h as ae, k as Y, l as J, m as re, n as $, o as V, p as be, G as ce, q as Tt, r as dt, t as _e, U as z, D as Q, v as D, w as ft, T as se, x as Ve, y as Et, z as ht } from "./blockly-jgwpd4oo.js";
7
+ import { storeToRefs as mt } from "pinia";
8
+ import { openConfirmDlg as Ot, openPromptDlg as gt, eventBus as de, useSystem as It, useColor as Lt, useViewStack as Pe, useGlobalStore as yt } from "x-essential-lib";
9
+ import { useDisplay as Ct } from "vuetify";
10
+ import { useI18n as xe } from "vue-i18n";
11
+ var vt = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", At = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", bt = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", kt = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", Nt = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Bt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
10
12
  _([
11
13
  {
12
14
  type: "color_blend_v1",
@@ -149,7 +151,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
149
151
  `
150
152
  )}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
151
153
  };
152
- const dt = function() {
154
+ const Rt = function() {
153
155
  if (!window.blocklyState) {
154
156
  const e = {
155
157
  runtime: {
@@ -179,7 +181,7 @@ const dt = function() {
179
181
  }
180
182
  return window.blocklyState;
181
183
  }();
182
- function w(e) {
184
+ function q(e) {
183
185
  let o = "";
184
186
  if (e.type === "string") {
185
187
  let t = "";
@@ -194,11 +196,11 @@ function w(e) {
194
196
  console.assert(!1, "invalid param type", e.type);
195
197
  return u.xml.textToDom(o);
196
198
  }
197
- function ve(e, o, t) {
198
- const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = Je.domToWorkspace(i, e);
199
+ function De(e, o, t) {
200
+ const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ct.domToWorkspace(i, e);
199
201
  return e.getBlockById(a[0]);
200
202
  }
201
- const ft = u.xml, Et = [
203
+ const St = u.xml, Mt = [
202
204
  {
203
205
  type: "call_func_v1",
204
206
  prefixInputs: ["OUTPUT"]
@@ -228,17 +230,17 @@ const ft = u.xml, Et = [
228
230
  prefixInputs: ["ARG"]
229
231
  }
230
232
  ];
231
- function ht(e, o) {
233
+ function Ut(e, o) {
232
234
  var n, i;
233
- const t = Et.find((a) => a.type === e);
235
+ const t = Mt.find((a) => a.type === e);
234
236
  return t ? !!((n = t.prefixInputs) != null && n.some((a) => o.startsWith(a)) || (i = t.inputs) != null && i.some((a) => a === o)) : !1;
235
237
  }
236
- const mt = {
238
+ const Vt = {
237
239
  init: function() {
238
240
  this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
239
241
  },
240
242
  mutationToDom: function() {
241
- const e = ft.createElement("mutation");
243
+ const e = St.createElement("mutation");
242
244
  return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
243
245
  },
244
246
  domToMutation: function(e) {
@@ -257,7 +259,7 @@ const mt = {
257
259
  this.key = e, this.name = o, this.updateShape_();
258
260
  },
259
261
  onchange: function(e) {
260
- if (e.type === E.BLOCK_MOVE) {
262
+ if (e.type === h.BLOCK_MOVE) {
261
263
  const o = e;
262
264
  if (o.blockId !== this.id)
263
265
  return;
@@ -267,49 +269,49 @@ const mt = {
267
269
  tryDuplicate_: function(e) {
268
270
  var t;
269
271
  const o = this.workspace.getBlockById(e.oldParentId);
270
- if (o && ht(o.type, e.oldInputName))
272
+ if (o && Ut(o.type, e.oldInputName))
271
273
  try {
272
- E.disable();
274
+ h.disable();
273
275
  const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
274
276
  if (n) {
275
- const i = ve(this.workspace, this.key, this.name);
277
+ const i = De(this.workspace, this.key, this.name);
276
278
  n.connect(i.outputConnection);
277
279
  }
278
280
  } finally {
279
- E.enable();
281
+ h.enable();
280
282
  }
281
283
  },
282
284
  updateShape_: function() {
283
- this.name ? this.setFieldValue(h[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
285
+ this.name ? this.setFieldValue(O[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
284
286
  }
285
287
  };
286
- O.parameter_v1 = mt;
288
+ y.parameter_v1 = Vt;
287
289
  s.forBlock.parameter_v1 = function(e) {
288
290
  return [e.key, l.ATOMIC];
289
291
  };
290
- const Ot = u.xml, It = {
292
+ const Pt = u.xml, xt = {
291
293
  init: function() {
292
294
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
293
295
  }
294
296
  };
295
- O.list_create_container_v1 = It;
296
- const gt = {
297
+ y.list_create_container_v1 = xt;
298
+ const Dt = {
297
299
  init: function() {
298
300
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
299
301
  }
300
302
  };
301
- O.list_create_item_v1 = gt;
302
- const Lt = {
303
+ y.list_create_item_v1 = Dt;
304
+ const Yt = {
303
305
  init: function() {
304
306
  this.itemCount_ = 0, this.setMutator(
305
- new Q.MutatorIcon(
307
+ new ie.MutatorIcon(
306
308
  ["list_create_item_v1"],
307
309
  this
308
310
  )
309
311
  ), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
310
312
  },
311
313
  mutationToDom: function() {
312
- const e = Ot.createElement("mutation");
314
+ const e = Pt.createElement("mutation");
313
315
  return e.setAttribute("items", String(this.itemCount_)), e;
314
316
  },
315
317
  domToMutation: function(e) {
@@ -377,13 +379,13 @@ const Lt = {
377
379
  for (let e = 0; e < this.itemCount_; e++)
378
380
  if (!this.getInput("ADD" + e)) {
379
381
  const o = this.appendValueInput("ADD" + e);
380
- e === 0 && (o.setAlign(b.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
382
+ e === 0 && (o.setAlign(U.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
381
383
  }
382
384
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
383
385
  this.removeInput("ADD" + e);
384
386
  }
385
387
  };
386
- O.list_create_v1 = Lt;
388
+ y.list_create_v1 = Yt;
387
389
  s.forBlock.list_create_v1 = function(e) {
388
390
  const o = e, t = new Array(o.itemCount_);
389
391
  for (let i = 0; i < o.itemCount_; i++)
@@ -599,7 +601,7 @@ s.forBlock.list_set_v1 = function(e) {
599
601
  return `${o}[${t}] = ${n};
600
602
  `;
601
603
  };
602
- const yt = {
604
+ const Kt = {
603
605
  // logic_compare
604
606
  EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
605
607
  NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
@@ -611,9 +613,9 @@ const yt = {
611
613
  AND: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_AND}",
612
614
  OR: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_OR}"
613
615
  };
614
- d.register(
616
+ E.register(
615
617
  "logic_op_tooltip_v1",
616
- d.buildTooltipForDropdown("OP", yt)
618
+ E.buildTooltipForDropdown("OP", Kt)
617
619
  );
618
620
  _([
619
621
  {
@@ -638,7 +640,7 @@ _([
638
640
  s.forBlock.logic_boolean_v1 = function(e) {
639
641
  return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", l.ATOMIC];
640
642
  };
641
- const Ct = {
643
+ const Ft = {
642
644
  onchange: function(e) {
643
645
  this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
644
646
  const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
@@ -646,19 +648,19 @@ const Ct = {
646
648
  o.outputConnection,
647
649
  t.outputConnection
648
650
  )) {
649
- E.setGroup(e.group);
651
+ h.setGroup(e.group);
650
652
  const n = this.prevBlocks_[0];
651
653
  n !== o && (o.unplug(), n && !n.isDisposed() && !n.isShadow() && this.getInput("A").connection.connect(n.outputConnection));
652
654
  const i = this.prevBlocks_[1];
653
- i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), E.setGroup(!1);
655
+ i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), h.setGroup(!1);
654
656
  }
655
657
  this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
656
658
  }
657
659
  };
658
- d.register(
660
+ E.register(
659
661
  "logic_compare_v1",
660
662
  function() {
661
- this.mixin(Ct);
663
+ this.mixin(Ft);
662
664
  }
663
665
  );
664
666
  _([
@@ -708,7 +710,7 @@ s.forBlock.logic_compare_v1 = function(e) {
708
710
  const i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
709
711
  return [`${i} ${t} ${a}`, n];
710
712
  };
711
- const At = {
713
+ const Ht = {
712
714
  elseIfCount_: 0,
713
715
  hasElse_: !1,
714
716
  mutationToDom: function() {
@@ -824,8 +826,8 @@ const At = {
824
826
  for (let e = 1; this.getInput("IF" + e); e++)
825
827
  this.removeInput("IF" + e), this.removeInput("DO" + e);
826
828
  for (let e = 1; e <= this.elseIfCount_; e++)
827
- this.appendValueInput("IF" + e).setCheck("Boolean").appendField(h.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(h.LOGIC_DO);
828
- this.hasElse_ && this.appendStatementInput("ELSE").appendField(h.LOGIC_ELSE);
829
+ this.appendValueInput("IF" + e).setCheck("Boolean").appendField(O.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(O.LOGIC_DO);
830
+ this.hasElse_ && this.appendStatementInput("ELSE").appendField(O.LOGIC_ELSE);
829
831
  },
830
832
  reconnectChildBlocks_: function(e, o, t) {
831
833
  var n, i;
@@ -834,9 +836,9 @@ const At = {
834
836
  t == null || t.reconnect(this, "ELSE");
835
837
  }
836
838
  };
837
- d.registerMutator(
839
+ E.registerMutator(
838
840
  "logic_if_v1_mutator",
839
- At,
841
+ Ht,
840
842
  void 0,
841
843
  ["logic_if_else_if_v1", "logic_if_else_v1"]
842
844
  );
@@ -982,7 +984,7 @@ s.forBlock.logic_operation_v1 = function(e) {
982
984
  }
983
985
  return [`${n} ${o} ${i}`, t];
984
986
  };
985
- const vt = {
987
+ const wt = {
986
988
  prevParentConnection_: null,
987
989
  onchange: function(e) {
988
990
  const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
@@ -992,12 +994,12 @@ const vt = {
992
994
  a && !a.workspace.connectionChecker.doTypeChecks(
993
995
  a.outputConnection,
994
996
  n
995
- ) && (E.setGroup(e.group), n === this.prevParentConnection_ ? (this.unplug(), n.getSourceBlock().bumpNeighbours()) : (a.unplug(), a.bumpNeighbours()), E.setGroup(!1));
997
+ ) && (h.setGroup(e.group), n === this.prevParentConnection_ ? (this.unplug(), n.getSourceBlock().bumpNeighbours()) : (a.unplug(), a.bumpNeighbours()), h.setGroup(!1));
996
998
  }
997
999
  this.prevParentConnection_ = n;
998
1000
  }
999
1001
  };
1000
- d.registerMixin("logic_ternary_v1", vt);
1002
+ E.registerMixin("logic_ternary_v1", wt);
1001
1003
  _([
1002
1004
  {
1003
1005
  type: "logic_ternary_v1",
@@ -1034,7 +1036,7 @@ s.forBlock.logic_ternary_v1 = function(e) {
1034
1036
  const o = s.valueToCode(e, "IF", l.CONDITIONAL) || "false", t = s.valueToCode(e, "THEN", l.CONDITIONAL) || "null", n = s.valueToCode(e, "ELSE", l.CONDITIONAL) || "null";
1035
1037
  return [o + " ? " + t + " : " + n, l.CONDITIONAL];
1036
1038
  };
1037
- const bt = {
1039
+ const Gt = {
1038
1040
  customContextMenu: function(e) {
1039
1041
  if (this.isInFlyout)
1040
1042
  return;
@@ -1048,33 +1050,33 @@ const bt = {
1048
1050
  };
1049
1051
  e.push({
1050
1052
  enabled: !0,
1051
- text: h.VARIABLES_SET_CREATE_GET.replace("%1", n),
1052
- callback: ye.callbackFactory(this, i)
1053
+ text: O.VARIABLES_SET_CREATE_GET.replace("%1", n),
1054
+ callback: Me.callbackFactory(this, i)
1053
1055
  });
1054
1056
  }
1055
1057
  }
1056
1058
  };
1057
- d.registerMixin(
1059
+ E.registerMixin(
1058
1060
  "contextMenu_newGetVariableBlock_v1",
1059
- bt
1061
+ Gt
1060
1062
  );
1061
- d.register(
1063
+ E.register(
1062
1064
  "flow_control_tooltip_v1",
1063
- d.buildTooltipForDropdown("MODE", {
1065
+ E.buildTooltipForDropdown("MODE", {
1064
1066
  BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
1065
1067
  CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
1066
1068
  })
1067
1069
  );
1068
- const Nt = /* @__PURE__ */ new Set([
1070
+ const $t = /* @__PURE__ */ new Set([
1069
1071
  "repeat_v1",
1070
1072
  "for_each_v1",
1071
1073
  "for_v1",
1072
1074
  "while_until_v1"
1073
- ]), kt = {
1075
+ ]), jt = {
1074
1076
  getSurroundLoop: function() {
1075
1077
  let e = this;
1076
1078
  do {
1077
- if (Nt.has(e.type))
1079
+ if ($t.has(e.type))
1078
1080
  return !0;
1079
1081
  e = e == null ? void 0 : e.getSurroundParent();
1080
1082
  } while (e);
@@ -1082,22 +1084,22 @@ const Nt = /* @__PURE__ */ new Set([
1082
1084
  },
1083
1085
  onchange: function(e) {
1084
1086
  const o = this.workspace;
1085
- if (!o.isDragging || o.isDragging() || e.type !== E.BLOCK_MOVE && e.type !== E.BLOCK_CREATE)
1087
+ if (!o.isDragging || o.isDragging() || e.type !== h.BLOCK_MOVE && e.type !== h.BLOCK_CREATE)
1086
1088
  return;
1087
1089
  const t = this.getSurroundLoop();
1088
1090
  if (console.log(e.type, t), this.setWarningText(
1089
- t ? null : h.LOOP_FLOW_CONTROL_WARNING
1091
+ t ? null : O.LOOP_FLOW_CONTROL_WARNING
1090
1092
  ), !this.isInFlyout)
1091
1093
  try {
1092
- E.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
1094
+ h.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
1093
1095
  } finally {
1094
- E.setRecordUndo(!0);
1096
+ h.setRecordUndo(!0);
1095
1097
  }
1096
1098
  }
1097
1099
  };
1098
- d.registerMixin(
1100
+ E.registerMixin(
1099
1101
  "flow_control_in_loop_check_v1",
1100
- kt
1102
+ jt
1101
1103
  );
1102
1104
  _([
1103
1105
  {
@@ -1120,9 +1122,9 @@ _([
1120
1122
  extensions: ["flow_control_tooltip_v1", "flow_control_in_loop_check_v1"]
1121
1123
  }
1122
1124
  ]);
1123
- d.register(
1125
+ E.register(
1124
1126
  "for_tooltip_v1",
1125
- d.buildTooltipWithFieldText(
1127
+ E.buildTooltipWithFieldText(
1126
1128
  "%{BKY_LOOP_V1_FOR_TOOLTIP}",
1127
1129
  "VAR"
1128
1130
  )
@@ -1171,9 +1173,9 @@ _([
1171
1173
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
1172
1174
  }
1173
1175
  ]);
1174
- d.register(
1176
+ E.register(
1175
1177
  "for_each_tooltip_v1",
1176
- d.buildTooltipWithFieldText(
1178
+ E.buildTooltipWithFieldText(
1177
1179
  "%{BKY_LOOP_V1_FOR_EACH_TOOLTIP}",
1178
1180
  "VAR"
1179
1181
  )
@@ -1208,9 +1210,9 @@ _([
1208
1210
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
1209
1211
  }
1210
1212
  ]);
1211
- d.register(
1213
+ E.register(
1212
1214
  "loop_while_until_tooltip_v1",
1213
- d.buildTooltipForDropdown("MODE", {
1215
+ E.buildTooltipForDropdown("MODE", {
1214
1216
  WHILE: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE}",
1215
1217
  UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
1216
1218
  })
@@ -1262,7 +1264,7 @@ ${n}
1262
1264
  }
1263
1265
  `;
1264
1266
  };
1265
- const Bt = {
1267
+ const Xt = {
1266
1268
  // math_arithmetic
1267
1269
  ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
1268
1270
  SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
@@ -1294,9 +1296,9 @@ const Bt = {
1294
1296
  STD_DEV: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_STD_DEV}",
1295
1297
  RANDOM: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_RANDOM}"
1296
1298
  };
1297
- d.register(
1299
+ E.register(
1298
1300
  "math_op_tooltip_v1",
1299
- d.buildTooltipForDropdown("OP", Bt)
1301
+ E.buildTooltipForDropdown("OP", Xt)
1300
1302
  );
1301
1303
  _([
1302
1304
  {
@@ -1899,31 +1901,31 @@ s.forBlock.math_trig_v1 = function(e) {
1899
1901
  }
1900
1902
  return [n, l.DIVISION];
1901
1903
  };
1902
- const Rt = u.xml, St = {
1904
+ const Wt = u.xml, Jt = {
1903
1905
  init: function() {
1904
1906
  this.appendDummyInput().appendField(
1905
1907
  "%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
1906
1908
  ), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
1907
1909
  }
1908
1910
  };
1909
- O.object_create_container_v1 = St;
1910
- const Mt = {
1911
+ y.object_create_container_v1 = Jt;
1912
+ const zt = {
1911
1913
  init: function() {
1912
1914
  this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
1913
1915
  }
1914
1916
  };
1915
- O.object_create_item_v1 = Mt;
1916
- const Ut = {
1917
+ y.object_create_item_v1 = zt;
1918
+ const Qt = {
1917
1919
  init: function() {
1918
1920
  this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
1919
- new Q.MutatorIcon(
1921
+ new ie.MutatorIcon(
1920
1922
  ["object_create_item_v1"],
1921
1923
  this
1922
1924
  )
1923
1925
  ), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
1924
1926
  },
1925
1927
  mutationToDom: function() {
1926
- const e = Rt.createElement("mutation");
1928
+ const e = Wt.createElement("mutation");
1927
1929
  return e.setAttribute("items", String(this.itemCount_)), e;
1928
1930
  },
1929
1931
  domToMutation: function(e) {
@@ -1988,12 +1990,12 @@ const Ut = {
1988
1990
  },
1989
1991
  updateShape_: function() {
1990
1992
  for (let e = 0; e < this.itemCount_; e++)
1991
- this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(b.Align.RIGHT).appendField(new Te("key"), "KEY" + e);
1993
+ this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(U.Align.RIGHT).appendField(new Ee("key"), "KEY" + e);
1992
1994
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
1993
1995
  this.removeInput("ADD" + e);
1994
1996
  }
1995
1997
  };
1996
- O.object_create_v1 = Ut;
1998
+ y.object_create_v1 = Qt;
1997
1999
  s.forBlock.object_create_v1 = function(e) {
1998
2000
  const o = e;
1999
2001
  let t = "{";
@@ -2251,15 +2253,15 @@ _([
2251
2253
  s.forBlock.object_to_json_v1 = function(e) {
2252
2254
  return [`__jsonStringifyV1__(${s.valueToCode(e, "OBJECT", l.NONE) || "null"})`, l.FUNCTION_CALL];
2253
2255
  };
2254
- const me = u.xml, Vt = {
2256
+ const ke = u.xml, qt = {
2255
2257
  init: function() {
2256
- this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new ze(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2258
+ this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new _t(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2257
2259
  }
2258
2260
  };
2259
- O.procedure_def_container_v1 = Vt;
2260
- const Pt = {
2261
+ y.procedure_def_container_v1 = qt;
2262
+ const Zt = {
2261
2263
  init: function() {
2262
- const e = new Te(re.DEFAULT_ARG);
2264
+ const e = new Ee(Te.DEFAULT_ARG);
2263
2265
  e.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(e, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2264
2266
  },
2265
2267
  validator_: function(e) {
@@ -2279,24 +2281,24 @@ const Pt = {
2279
2281
  return e;
2280
2282
  }
2281
2283
  };
2282
- O.procedure_def_item_v1 = Pt;
2283
- const Dt = {
2284
+ y.procedure_def_item_v1 = Zt;
2285
+ const eo = {
2284
2286
  init: function() {
2285
2287
  this.withReturn = !1, this.args = [];
2286
- const e = new Te(
2287
- re.findLegalName("", this)
2288
+ const e = new Ee(
2289
+ Te.findLegalName("", this)
2288
2290
  );
2289
- e.setValidator(re.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2290
- new Q.MutatorIcon(
2291
+ e.setValidator(Te.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2292
+ new ie.MutatorIcon(
2291
2293
  ["procedure_def_item_v1"],
2292
2294
  this
2293
2295
  )
2294
2296
  ), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_DEF_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_DEF_HELPURL}");
2295
2297
  },
2296
2298
  mutationToDom: function() {
2297
- const e = me.createElement("mutation");
2299
+ const e = ke.createElement("mutation");
2298
2300
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((o) => {
2299
- const t = me.createElement("arg");
2301
+ const t = ke.createElement("arg");
2300
2302
  t.setAttribute("name", o.name), t.setAttribute("id", o.id), e.appendChild(t);
2301
2303
  }), e;
2302
2304
  },
@@ -2373,20 +2375,20 @@ const Dt = {
2373
2375
  n.setKeyName(o.name, "");
2374
2376
  else
2375
2377
  try {
2376
- E.disable(), n = ve(this.workspace, o.name, ""), n.outputConnection.connect(t);
2378
+ h.disable(), n = De(this.workspace, o.name, ""), n.outputConnection.connect(t);
2377
2379
  } finally {
2378
- E.enable();
2380
+ h.enable();
2379
2381
  }
2380
2382
  }
2381
2383
  }
2382
2384
  };
2383
- O.procedure_def_v1 = Dt;
2384
- const xt = u.xml, Yt = {
2385
+ y.procedure_def_v1 = eo;
2386
+ const to = u.xml, oo = {
2385
2387
  init: function() {
2386
2388
  this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
2387
2389
  },
2388
2390
  mutationToDom: function() {
2389
- const e = xt.createElement("mutation");
2391
+ const e = to.createElement("mutation");
2390
2392
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
2391
2393
  },
2392
2394
  domToMutation: function(e) {
@@ -2406,7 +2408,7 @@ const xt = u.xml, Yt = {
2406
2408
  },
2407
2409
  onchange: function(e) {
2408
2410
  var o;
2409
- if (e.type === E.BLOCK_DRAG) {
2411
+ if (e.type === h.BLOCK_DRAG) {
2410
2412
  const t = e;
2411
2413
  if (t.isStart || !((o = t.blocks) != null && o.find((n) => n.id === this.id)))
2412
2414
  return;
@@ -2437,7 +2439,7 @@ const xt = u.xml, Yt = {
2437
2439
  e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
2438
2440
  }
2439
2441
  };
2440
- O.procedure_return_v1 = Yt;
2442
+ y.procedure_return_v1 = oo;
2441
2443
  s.forBlock.procedure_return_v1 = function(e) {
2442
2444
  const o = e;
2443
2445
  return o.withReturn ? `return ${s.valueToCode(o, "VALUE", l.NONE) || "null"};
@@ -2465,13 +2467,13 @@ _([
2465
2467
  s.forBlock.text_v1 = function(e) {
2466
2468
  return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
2467
2469
  };
2468
- const Kt = /^\s*'([^']|\\')*'\s*$/;
2469
- function J(e) {
2470
- return Kt.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2470
+ const no = /^\s*'([^']|\\')*'\s*$/;
2471
+ function ne(e) {
2472
+ return no.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2471
2473
  }
2472
- d.register(
2474
+ E.register(
2473
2475
  "text_append_tooltip_v1",
2474
- d.buildTooltipWithFieldText(
2476
+ E.buildTooltipWithFieldText(
2475
2477
  "%{BKY_TEXT_V1_APPEND_TOOLTIP}",
2476
2478
  "VAR"
2477
2479
  )
@@ -2501,9 +2503,9 @@ s.forBlock.text_append_v1 = function(e) {
2501
2503
  var n;
2502
2504
  const o = (n = s.nameDB_) == null ? void 0 : n.getName(
2503
2505
  e.getFieldValue("VAR"),
2504
- de.NameType.VARIABLE
2506
+ he.NameType.VARIABLE
2505
2507
  ), t = s.valueToCode(e, "TEXT", l.NONE) || "''";
2506
- return `${o} += ${J(t)};
2508
+ return `${o} += ${ne(t)};
2507
2509
  `;
2508
2510
  };
2509
2511
  _([
@@ -2672,10 +2674,10 @@ _([
2672
2674
  s.forBlock.text_is_empty_v1 = function(e) {
2673
2675
  return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.LOGICAL_NOT];
2674
2676
  };
2675
- const Ft = u.xml, Ht = {
2677
+ const io = u.xml, so = {
2676
2678
  itemCount_: 0,
2677
2679
  mutationToDom: function() {
2678
- const e = Ft.createElement("mutation");
2680
+ const e = io.createElement("mutation");
2679
2681
  return e.setAttribute("items", `${this.itemCount_}`), e;
2680
2682
  },
2681
2683
  domToMutation: function(e) {
@@ -2740,20 +2742,20 @@ const Ft = u.xml, Ht = {
2740
2742
  for (let e = 0; e < this.itemCount_; e++)
2741
2743
  if (!this.getInput("ADD" + e)) {
2742
2744
  const o = this.appendValueInput("ADD" + e).setAlign(
2743
- b.Align.RIGHT
2745
+ U.Align.RIGHT
2744
2746
  );
2745
2747
  e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
2746
2748
  }
2747
2749
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
2748
2750
  this.removeInput("ADD" + e);
2749
2751
  }
2750
- }, wt = function() {
2751
- this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Q.MutatorIcon(["text_join_item_v1"], this));
2752
+ }, lo = function() {
2753
+ this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ie.MutatorIcon(["text_join_item_v1"], this));
2752
2754
  };
2753
- d.registerMutator(
2755
+ E.registerMutator(
2754
2756
  "text_join_mutator_v1",
2755
- Ht,
2756
- wt
2757
+ so,
2758
+ lo
2757
2759
  );
2758
2760
  _([
2759
2761
  {
@@ -2796,11 +2798,11 @@ s.forBlock.text_join_v1 = function(e) {
2796
2798
  return ["''", l.ATOMIC];
2797
2799
  case 1: {
2798
2800
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''";
2799
- return J(t);
2801
+ return ne(t);
2800
2802
  }
2801
2803
  case 2: {
2802
2804
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''", n = s.valueToCode(o, "ADD1", l.NONE) || "''";
2803
- return [J(t)[0] + " + " + J(n)[0], l.ADDITION];
2805
+ return [ne(t)[0] + " + " + ne(n)[0], l.ADDITION];
2804
2806
  }
2805
2807
  default: {
2806
2808
  const t = new Array(o.itemCount_);
@@ -2985,7 +2987,7 @@ s.forBlock.text_trim_v1 = function(e) {
2985
2987
  }[e.getFieldValue("MODE")];
2986
2988
  return [`__trimV1__(${o}, ${n})`, l.ATOMIC];
2987
2989
  };
2988
- const Gt = {
2990
+ const ao = {
2989
2991
  init: function() {
2990
2992
  this.appendDummyInput().appendField("%{BKY_TIME_V1_CREATE_TIMER_TITLE}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("time_blocks"), this.setTooltip("%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}"), this.setHelpUrl("%{BKY_TIME_V1_CREATE_TIMER_HELPURL}");
2991
2993
  },
@@ -2996,22 +2998,22 @@ const Gt = {
2996
2998
  this.updateShape_(), this.updateShadow_();
2997
2999
  },
2998
3000
  updateShape_: function() {
2999
- this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
3001
+ this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
3000
3002
  },
3001
3003
  updateShadow_: function() {
3002
3004
  var e, o, t, n, i, a, r, c;
3003
3005
  this.isInsertionMarker() || ((o = (e = this.getInput("INTERVAL")) == null ? void 0 : e.connection) == null || o.setShadowDom(
3004
- w({ type: "number", default: 1e3 })
3006
+ q({ type: "number", default: 1e3 })
3005
3007
  ), (n = (t = this.getInput("LOOP")) == null ? void 0 : t.connection) == null || n.setShadowDom(
3006
- w({ type: "boolean", default: !1 })
3008
+ q({ type: "boolean", default: !1 })
3007
3009
  ), (a = (i = this.getInput("COUNT")) == null ? void 0 : i.connection) == null || a.setShadowDom(
3008
- w({ type: "number", default: 1 })
3010
+ q({ type: "number", default: 1 })
3009
3011
  ), (c = (r = this.getInput("IMMEDIATE")) == null ? void 0 : r.connection) == null || c.setShadowDom(
3010
- w({ type: "boolean", default: !1 })
3012
+ q({ type: "boolean", default: !1 })
3011
3013
  ));
3012
3014
  }
3013
3015
  };
3014
- O.create_timer_v1 = Gt;
3016
+ y.create_timer_v1 = ao;
3015
3017
  s.forBlock.create_timer_v1 = function(e) {
3016
3018
  const o = s.valueToCode(e, "INTERVAL", l.ATOMIC) || "1000", t = s.valueToCode(e, "LOOP", l.ATOMIC) || "false", n = s.valueToCode(e, "COUNT", l.ATOMIC) || "1", i = s.valueToCode(e, "IMMEDIATE", l.ATOMIC) || "false", a = s.statementToCode(e, "CALLBACK");
3017
3019
  return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
@@ -3041,24 +3043,24 @@ s.forBlock.delay_v1 = function(e) {
3041
3043
  return `__delayV1__(${s.valueToCode(e, "MS", l.ATOMIC) || "0"});
3042
3044
  `;
3043
3045
  };
3044
- const $t = {
3046
+ const ro = {
3045
3047
  customContextMenu: function(e) {
3046
3048
  if (this.isInFlyout) {
3047
3049
  if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
3048
3050
  const o = {
3049
- text: h.RENAME_VARIABLE,
3051
+ text: O.RENAME_VARIABLE,
3050
3052
  enabled: !0,
3051
- callback: jt(this)
3053
+ callback: co(this)
3052
3054
  }, t = this.getField("VAR").getText(), n = {
3053
- text: h.DELETE_VARIABLE.replace("%1", t),
3055
+ text: O.DELETE_VARIABLE.replace("%1", t),
3054
3056
  enabled: !0,
3055
- callback: Xt(this)
3057
+ callback: _o(this)
3056
3058
  };
3057
3059
  e.unshift(o), e.unshift(n);
3058
3060
  }
3059
3061
  } else {
3060
3062
  let o, t;
3061
- this.type === "variables_get_v1" ? (o = "variables_set_v1", t = h.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = h.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3063
+ this.type === "variables_get_v1" ? (o = "variables_set_v1", t = O.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = O.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3062
3064
  const n = this.getField("VAR"), i = {
3063
3065
  type: o,
3064
3066
  fields: { VAR: n.saveState(!0) }
@@ -3066,24 +3068,24 @@ const $t = {
3066
3068
  e.push({
3067
3069
  enabled: this.workspace.remainingCapacity() > 0,
3068
3070
  text: t.replace("%1", n.getText()),
3069
- callback: ye.callbackFactory(this, i)
3071
+ callback: Me.callbackFactory(this, i)
3070
3072
  });
3071
3073
  }
3072
3074
  }
3073
- }, jt = function(e) {
3075
+ }, co = function(e) {
3074
3076
  return function() {
3075
3077
  const o = e.workspace, n = e.getField("VAR").getVariable();
3076
- W.renameVariable(o, n);
3078
+ oe.renameVariable(o, n);
3077
3079
  };
3078
- }, Xt = function(e) {
3080
+ }, _o = function(e) {
3079
3081
  return function() {
3080
3082
  const o = e.workspace, n = e.getField("VAR").getVariable();
3081
3083
  o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
3082
3084
  };
3083
3085
  };
3084
- d.registerMixin(
3086
+ E.registerMixin(
3085
3087
  "context_menu_variable_v1",
3086
- $t
3088
+ ro
3087
3089
  );
3088
3090
  _([
3089
3091
  {
@@ -3105,7 +3107,7 @@ _([
3105
3107
  s.forBlock.variable_get_v1 = function(e) {
3106
3108
  return [s.nameDB_.getName(
3107
3109
  e.getFieldValue("VAR"),
3108
- de.NameType.VARIABLE
3110
+ he.NameType.VARIABLE
3109
3111
  ), l.ATOMIC];
3110
3112
  };
3111
3113
  _([
@@ -3134,86 +3136,86 @@ _([
3134
3136
  s.forBlock.variable_set_v1 = function(e) {
3135
3137
  const o = s.nameDB_.getName(
3136
3138
  e.getFieldValue("VAR"),
3137
- de.NameType.VARIABLE
3139
+ he.NameType.VARIABLE
3138
3140
  ), t = s.valueToCode(e, "VALUE", l.ASSIGNMENT) || "0";
3139
3141
  return `${o} = ${t};
3140
3142
  `;
3141
3143
  };
3142
- const Oe = u.xml;
3143
- function Wt() {
3144
+ const Ne = u.xml;
3145
+ function uo() {
3144
3146
  const e = [];
3145
3147
  {
3146
- const o = Oe.createElement("label");
3147
- o.setAttribute("text", h.LABEL_ASSET_LAYER), e.push(o);
3148
+ const o = Ne.createElement("label");
3149
+ o.setAttribute("text", O.LABEL_ASSET_LAYER), e.push(o);
3148
3150
  }
3149
3151
  {
3150
- const o = Oe.createElement("block");
3152
+ const o = Ne.createElement("block");
3151
3153
  o.setAttribute("type", "upload_asset_v1"), e.push(o);
3152
3154
  }
3153
3155
  return e;
3154
3156
  }
3155
- const Jt = {
3157
+ const po = {
3156
3158
  name: "INTERFACE_CATEGORY",
3157
- callback: Wt
3158
- }, D = u.xml;
3159
- function zt() {
3159
+ callback: uo
3160
+ }, j = u.xml;
3161
+ function To() {
3160
3162
  const e = [];
3161
3163
  {
3162
- const o = D.createElement("label");
3164
+ const o = j.createElement("label");
3163
3165
  o.setAttribute("text", "%{BKY_LABEL_PROCEDURE}"), e.push(o);
3164
3166
  }
3165
3167
  {
3166
- const o = D.createElement("block");
3168
+ const o = j.createElement("block");
3167
3169
  o.setAttribute("type", "procedure_def_v1");
3168
3170
  {
3169
- const t = D.createElement("field");
3171
+ const t = j.createElement("field");
3170
3172
  t.setAttribute("name", "NAME");
3171
- const n = D.createTextNode(
3172
- h.PROCEDURE_DEFAULT_NAME
3173
+ const n = j.createTextNode(
3174
+ O.PROCEDURE_DEFAULT_NAME
3173
3175
  );
3174
3176
  t.appendChild(n), o.appendChild(t);
3175
3177
  }
3176
3178
  e.push(o);
3177
3179
  }
3178
3180
  {
3179
- const o = D.createElement("block");
3181
+ const o = j.createElement("block");
3180
3182
  o.setAttribute("type", "procedure_return_v1"), e.push(o);
3181
3183
  }
3182
3184
  return e;
3183
3185
  }
3184
- const _e = {
3186
+ const k = {
3185
3187
  name: "PROCEDURE_CATEGORY",
3186
- callback: zt
3188
+ callback: To
3187
3189
  };
3188
- function Qt() {
3189
- const { args: e } = dt.app.view, o = [];
3190
+ function fo() {
3191
+ const { args: e } = Rt.app.view, o = [];
3190
3192
  return e == null || e.forEach(({ id: t, name: n, type: i }) => {
3191
3193
  o.push({ id: t, name: n, type: i });
3192
3194
  }), o;
3193
3195
  }
3194
- const Ie = u.xml;
3195
- function qt() {
3196
+ const Be = u.xml;
3197
+ function Eo() {
3196
3198
  const e = [];
3197
- if (Qt().length > 0) {
3199
+ if (fo().length > 0) {
3198
3200
  {
3199
- const o = Ie.createElement("label");
3201
+ const o = Be.createElement("label");
3200
3202
  o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
3201
3203
  }
3202
3204
  {
3203
- const o = Ie.createElement("block");
3205
+ const o = Be.createElement("block");
3204
3206
  o.setAttribute("type", "get_arg_v1"), e.push(o);
3205
3207
  }
3206
3208
  }
3207
3209
  return e;
3208
3210
  }
3209
- const ue = {
3211
+ const fe = {
3210
3212
  name: "UI_CATEGORY",
3211
- callback: qt
3212
- }, G = u.xml;
3213
- function Zt(e) {
3213
+ callback: Eo
3214
+ }, Z = u.xml;
3215
+ function ho(e) {
3214
3216
  const o = [];
3215
3217
  {
3216
- const n = G.createElement("label");
3218
+ const n = Z.createElement("label");
3217
3219
  n.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), o.push(n);
3218
3220
  }
3219
3221
  {
@@ -3221,7 +3223,7 @@ function Zt(e) {
3221
3223
  n.setAttribute("text", "%{BKY_NEW_VARIABLE}"), n.setAttribute("callbackKey", "CREATE_VARIABLE"), e.registerButtonCallback(
3222
3224
  "CREATE_VARIABLE",
3223
3225
  function(i) {
3224
- W.createVariableButtonHandler(
3226
+ oe.createVariableButtonHandler(
3225
3227
  i.getTargetWorkspace()
3226
3228
  );
3227
3229
  }
@@ -3230,41 +3232,41 @@ function Zt(e) {
3230
3232
  const t = e.getVariablesOfType("");
3231
3233
  if (t.length <= 0)
3232
3234
  return o;
3233
- t.sort(Qe.compareByName);
3235
+ t.sort(ut.compareByName);
3234
3236
  {
3235
- const n = G.createElement("label");
3236
- n.setAttribute("text", h.LABEL_CREATED), o.push(n);
3237
+ const n = Z.createElement("label");
3238
+ n.setAttribute("text", O.LABEL_CREATED), o.push(n);
3237
3239
  }
3238
3240
  return t.forEach((n) => {
3239
3241
  {
3240
- const i = G.createElement("block");
3241
- i.setAttribute("type", "variable_get_v1"), i.appendChild(W.generateVariableFieldDom(n)), o.push(i);
3242
+ const i = Z.createElement("block");
3243
+ i.setAttribute("type", "variable_get_v1"), i.appendChild(oe.generateVariableFieldDom(n)), o.push(i);
3242
3244
  }
3243
3245
  {
3244
- const i = G.createElement("block");
3245
- i.setAttribute("type", "variable_set_v1"), i.appendChild(W.generateVariableFieldDom(n)), o.push(i);
3246
+ const i = Z.createElement("block");
3247
+ i.setAttribute("type", "variable_set_v1"), i.appendChild(oe.generateVariableFieldDom(n)), o.push(i);
3246
3248
  }
3247
3249
  }), o;
3248
3250
  }
3249
- const pe = {
3251
+ const N = {
3250
3252
  name: "VARIABLE_CATEGORY",
3251
- callback: Zt
3253
+ callback: ho
3252
3254
  };
3253
- Ce.setConfirm(async (e, o) => {
3254
- const t = await st({
3255
+ Ue.setConfirm(async (e, o) => {
3256
+ const t = await Ot({
3255
3257
  title: "",
3256
3258
  text: e
3257
3259
  });
3258
3260
  o(!!t);
3259
3261
  });
3260
- Ce.setPrompt(async (e, o, t) => {
3261
- const n = await lt({
3262
+ Ue.setPrompt(async (e, o, t) => {
3263
+ const n = await gt({
3262
3264
  title: "",
3263
3265
  value: o
3264
3266
  });
3265
3267
  t(String(n));
3266
3268
  });
3267
- const eo = (e, o, t) => {
3269
+ const Ye = (e, o, t) => {
3268
3270
  const n = e[o];
3269
3271
  return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, a) => {
3270
3272
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -3277,12 +3279,12 @@ const eo = (e, o, t) => {
3277
3279
  );
3278
3280
  });
3279
3281
  };
3280
- async function ge(e) {
3281
- const o = await eo(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./zhHans-kgty7l19.js") }), `./msg/${e}.ts`, 3);
3282
- qe(o.default);
3282
+ async function Re(e) {
3283
+ const o = await Ye(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
3284
+ pt(o.default);
3283
3285
  }
3284
- function be(e) {
3285
- const o = M();
3286
+ function Ke(e) {
3287
+ const o = w();
3286
3288
  if (!o)
3287
3289
  return;
3288
3290
  const t = o.getBlockById(e);
@@ -3294,35 +3296,35 @@ function be(e) {
3294
3296
  const i = n.getRelativeToSurfaceXY(), a = i.x * o.scale, r = i.y * o.scale;
3295
3297
  o.scroll(-a, -r);
3296
3298
  }
3297
- function to() {
3299
+ function mo() {
3298
3300
  var t;
3299
- const e = M();
3301
+ const e = w();
3300
3302
  if (!e)
3301
3303
  return;
3302
3304
  const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
3303
- o && be(o.id);
3305
+ o && Ke(o.id);
3304
3306
  }
3305
- class oo {
3307
+ class Oo {
3306
3308
  init({ contextMenu: o = !0, shortcut: t = !0 } = {
3307
3309
  contextMenu: !0,
3308
3310
  shortcut: !0
3309
3311
  }) {
3310
- o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (m.registry.unregister(
3311
- oe.names.COPY
3312
- ), m.registry.unregister(
3313
- oe.names.CUT
3314
- ), m.registry.unregister(
3315
- oe.names.PASTE
3312
+ o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (g.registry.unregister(
3313
+ ae.names.COPY
3314
+ ), g.registry.unregister(
3315
+ ae.names.CUT
3316
+ ), g.registry.unregister(
3317
+ ae.names.PASTE
3316
3318
  ), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
3317
3319
  }
3318
3320
  blockCopyToStorageContextMenu() {
3319
3321
  const o = {
3320
3322
  displayText: function() {
3321
- return h.CROSS_TAB_COPY ? h.CROSS_TAB_COPY : "Copy";
3323
+ return O.CROSS_TAB_COPY ? O.CROSS_TAB_COPY : "Copy";
3322
3324
  },
3323
3325
  preconditionFn: function() {
3324
- const t = B();
3325
- return !t || !K(t) || !t.isDeletable() || !ne(t) || !t.isMovable() || !P(t) ? "disabled" : "enabled";
3326
+ const t = Y();
3327
+ return !t || !J(t) || !t.isDeletable() || !re(t) || !t.isMovable() || !$(t) ? "disabled" : "enabled";
3326
3328
  },
3327
3329
  callback: function(t) {
3328
3330
  var n;
@@ -3331,16 +3333,16 @@ class oo {
3331
3333
  JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
3332
3334
  );
3333
3335
  },
3334
- scopeType: N.ScopeType.BLOCK,
3336
+ scopeType: V.ScopeType.BLOCK,
3335
3337
  id: "blockCopyToStorage",
3336
3338
  weight: 0
3337
3339
  };
3338
- N.registry.register(o);
3340
+ V.registry.register(o);
3339
3341
  }
3340
3342
  blockPasteFromStorageContextMenu() {
3341
3343
  const o = {
3342
3344
  displayText: function() {
3343
- return h.CROSS_TAB_PASTE ? h.CROSS_TAB_PASTE : "Paste";
3345
+ return O.CROSS_TAB_PASTE ? O.CROSS_TAB_PASTE : "Paste";
3344
3346
  },
3345
3347
  preconditionFn: function(t) {
3346
3348
  var a;
@@ -3355,88 +3357,88 @@ class oo {
3355
3357
  if (!n)
3356
3358
  return;
3357
3359
  const i = JSON.parse(n);
3358
- i && t.workspace && he.paste(i, t.workspace);
3360
+ i && t.workspace && be.paste(i, t.workspace);
3359
3361
  },
3360
- scopeType: N.ScopeType.WORKSPACE,
3362
+ scopeType: V.ScopeType.WORKSPACE,
3361
3363
  id: "blockPasteFromStorage",
3362
3364
  weight: 0
3363
3365
  };
3364
- N.registry.register(o);
3366
+ V.registry.register(o);
3365
3367
  }
3366
3368
  blockCopyToStorageShortcut() {
3367
- const o = m.registry.createSerializedKey(
3369
+ const o = g.registry.createSerializedKey(
3368
3370
  u.KeyCodes.C,
3369
3371
  [u.KeyCodes.CTRL]
3370
- ), t = m.registry.createSerializedKey(
3372
+ ), t = g.registry.createSerializedKey(
3371
3373
  u.KeyCodes.C,
3372
3374
  [u.KeyCodes.ALT]
3373
- ), n = m.registry.createSerializedKey(
3375
+ ), n = g.registry.createSerializedKey(
3374
3376
  u.KeyCodes.C,
3375
3377
  [u.KeyCodes.META]
3376
3378
  ), i = {
3377
3379
  name: "copy",
3378
3380
  preconditionFn: function(a) {
3379
- if (a.options.readOnly || ie.inProgress())
3381
+ if (a.options.readOnly || ce.inProgress())
3380
3382
  return !1;
3381
- const r = B();
3382
- return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r));
3383
+ const r = Y();
3384
+ return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !$(r));
3383
3385
  },
3384
3386
  callback: function(a, r) {
3385
3387
  r.preventDefault();
3386
- const c = B();
3387
- if (!c || !P(c))
3388
+ const c = Y();
3389
+ if (!c || !$(c))
3388
3390
  return !1;
3389
3391
  const p = c.toCopyData();
3390
3392
  return p ? (a.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(p)), !0) : !1;
3391
3393
  },
3392
3394
  keyCodes: [o, t, n]
3393
3395
  };
3394
- m.registry.register(i);
3396
+ g.registry.register(i);
3395
3397
  }
3396
3398
  blockCutToStorageShortcut() {
3397
- const o = m.registry.createSerializedKey(
3399
+ const o = g.registry.createSerializedKey(
3398
3400
  u.KeyCodes.X,
3399
3401
  [u.KeyCodes.CTRL]
3400
- ), t = m.registry.createSerializedKey(
3402
+ ), t = g.registry.createSerializedKey(
3401
3403
  u.KeyCodes.X,
3402
3404
  [u.KeyCodes.ALT]
3403
- ), n = m.registry.createSerializedKey(
3405
+ ), n = g.registry.createSerializedKey(
3404
3406
  u.KeyCodes.X,
3405
3407
  [u.KeyCodes.META]
3406
3408
  ), i = {
3407
3409
  name: "cut",
3408
3410
  preconditionFn: function(a) {
3409
- if (a.options.readOnly || ie.inProgress())
3411
+ if (a.options.readOnly || ce.inProgress())
3410
3412
  return !1;
3411
- const r = B();
3412
- return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r) || r.workspace.isFlyout);
3413
+ const r = Y();
3414
+ return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !$(r) || r.workspace.isFlyout);
3413
3415
  },
3414
3416
  callback: function(a, r) {
3415
3417
  r.preventDefault();
3416
- const c = B();
3417
- if (!c || !K(c) || !c.isDeletable() || !P(c))
3418
+ const c = Y();
3419
+ if (!c || !J(c) || !c.isDeletable() || !$(c))
3418
3420
  return !1;
3419
3421
  const p = c.toCopyData();
3420
- return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof Ze ? c.checkAndDelete() : c.dispose(), !0) : !1;
3422
+ return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof Tt ? c.checkAndDelete() : c.dispose(), !0) : !1;
3421
3423
  },
3422
3424
  keyCodes: [o, t, n]
3423
3425
  };
3424
- m.registry.register(i);
3426
+ g.registry.register(i);
3425
3427
  }
3426
3428
  blockPasteFromStorageShortcut() {
3427
- const o = m.registry.createSerializedKey(
3429
+ const o = g.registry.createSerializedKey(
3428
3430
  u.KeyCodes.V,
3429
3431
  [u.KeyCodes.CTRL]
3430
- ), t = m.registry.createSerializedKey(
3432
+ ), t = g.registry.createSerializedKey(
3431
3433
  u.KeyCodes.V,
3432
3434
  [u.KeyCodes.ALT]
3433
- ), n = m.registry.createSerializedKey(
3435
+ ), n = g.registry.createSerializedKey(
3434
3436
  u.KeyCodes.V,
3435
3437
  [u.KeyCodes.META]
3436
3438
  ), i = {
3437
3439
  name: "paste",
3438
3440
  preconditionFn: function(a) {
3439
- if (a.options.readOnly || ie.inProgress())
3441
+ if (a.options.readOnly || ce.inProgress())
3440
3442
  return !1;
3441
3443
  const r = localStorage.getItem("blocklyStash");
3442
3444
  if (!r)
@@ -3450,21 +3452,21 @@ class oo {
3450
3452
  if (!c)
3451
3453
  return !1;
3452
3454
  const p = JSON.parse(c);
3453
- return p ? (he.paste(p, a), !0) : !1;
3455
+ return p ? (be.paste(p, a), !0) : !1;
3454
3456
  },
3455
3457
  keyCodes: [o, t, n]
3456
3458
  };
3457
- m.registry.register(i);
3459
+ g.registry.register(i);
3458
3460
  }
3459
3461
  }
3460
- class no {
3462
+ class go {
3461
3463
  init() {
3462
- const o = N.registry.getItem("cleanWorkspace");
3464
+ const o = V.registry.getItem("cleanWorkspace");
3463
3465
  o && (o.callback = function(t) {
3464
3466
  const n = t.workspace;
3465
3467
  if (!n)
3466
3468
  return;
3467
- n.setResizesEnabled(!1), E.setGroup(!0);
3469
+ n.setResizesEnabled(!1), h.setGroup(!0);
3468
3470
  const i = n.getTopBlocks(!0);
3469
3471
  let a = 0;
3470
3472
  for (let r = 0, c; c = i[r]; r++) {
@@ -3473,54 +3475,54 @@ class no {
3473
3475
  const p = c.getRelativeToSurfaceXY();
3474
3476
  c.moveBy(-p.x, a - p.y, ["cleanup"]), c.snapToGrid(), a = c.getRelativeToSurfaceXY().y + c.getHeightWidth().height + 100;
3475
3477
  }
3476
- E.setGroup(!1), n.setResizesEnabled(!0);
3478
+ h.setGroup(!1), n.setResizesEnabled(!0);
3477
3479
  });
3478
3480
  }
3479
3481
  }
3480
- function Ne(e) {
3482
+ function Fe(e) {
3481
3483
  const o = e.getParent();
3482
- return o && Ne(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3484
+ return o && Fe(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3483
3485
  }
3484
- class io {
3486
+ class Io {
3485
3487
  init() {
3486
- const o = N.registry.getItem("blockDisable");
3488
+ const o = V.registry.getItem("blockDisable");
3487
3489
  o && (o.preconditionFn = function(t) {
3488
3490
  const n = t.block;
3489
- return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Ne(n) ? "disabled" : "enabled" : "hidden";
3491
+ return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Fe(n) ? "disabled" : "enabled" : "hidden";
3490
3492
  });
3491
3493
  }
3492
3494
  }
3493
- class ke extends se {
3495
+ class He extends _e {
3494
3496
  constructor(t, n, i) {
3495
- super(se.SKIP_SETUP);
3497
+ super(_e.SKIP_SETUP);
3496
3498
  /** The field's colour picker element. */
3497
- L(this, "picker", null);
3499
+ A(this, "picker", null);
3498
3500
  /** Index of the currently highlighted element. */
3499
- L(this, "highlightedIndex", null);
3501
+ A(this, "highlightedIndex", null);
3500
3502
  /**
3501
3503
  * Array holding info needed to unbind events.
3502
3504
  * Used for disposing.
3503
3505
  * Ex: [[node, name, func], [node, name, func]].
3504
3506
  */
3505
- L(this, "boundEvents", []);
3507
+ A(this, "boundEvents", []);
3506
3508
  /**
3507
3509
  * Serializable fields are saved by the serializer, non-serializable fields
3508
3510
  * are not. Editable fields should also be serializable.
3509
3511
  */
3510
- L(this, "SERIALIZABLE", !0);
3512
+ A(this, "SERIALIZABLE", !0);
3511
3513
  /** Mouse cursor style when over the hotspot that initiates the editor. */
3512
- L(this, "CURSOR", "default");
3514
+ A(this, "CURSOR", "default");
3513
3515
  /**
3514
3516
  * Used to tell if the field needs to be rendered the next time the block is
3515
3517
  * rendered. Colour fields are statically sized, and only need to be
3516
3518
  * rendered at initialization.
3517
3519
  */
3518
- L(this, "isDirty_", !1);
3520
+ A(this, "isDirty_", !1);
3519
3521
  /**
3520
3522
  * An array of colour strings for the palette.
3521
3523
  * Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
3522
3524
  */
3523
- L(this, "colours", [
3525
+ A(this, "colours", [
3524
3526
  // red
3525
3527
  "#F44336",
3526
3528
  // base
@@ -4082,12 +4084,12 @@ class ke extends se {
4082
4084
  * An array of tooltip strings for the palette. If not the same length as
4083
4085
  * COLOURS, the colour's hex code will be used for any missing titles.
4084
4086
  */
4085
- L(this, "titles", ["%{BKY_COLOR_RED}"]);
4087
+ A(this, "titles", ["%{BKY_COLOR_RED}"]);
4086
4088
  /**
4087
4089
  * Number of columns in the palette.
4088
4090
  */
4089
- L(this, "columns", 14);
4090
- t !== se.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4091
+ A(this, "columns", 14);
4092
+ t !== _e.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4091
4093
  }
4092
4094
  configure_(t) {
4093
4095
  super.configure_(t), t.colourOptions && (this.colours = t.colourOptions), t.colourTitles && (this.titles = t.colourTitles), t.columns && (this.columns = t.columns);
@@ -4101,13 +4103,13 @@ class ke extends se {
4101
4103
  ), this.createBorderRect_(), this.getBorderRect().style.fillOpacity = "1", this.getBorderRect().setAttribute("stroke", "#fff"), this.isFullBlockField() && (this.clickTarget_ = this.sourceBlock_.getSvgRoot());
4102
4104
  }
4103
4105
  isFullBlockField() {
4104
- if (!this.getSourceBlock()) throw new F();
4106
+ if (!this.getSourceBlock()) throw new z();
4105
4107
  const n = this.getConstants();
4106
4108
  return this.blockIsSimpleReporter() && !!(n != null && n.FIELD_COLOUR_FULL_BLOCK);
4107
4109
  }
4108
4110
  blockIsSimpleReporter() {
4109
4111
  const t = this.getSourceBlock();
4110
- if (!t) throw new F();
4112
+ if (!t) throw new z();
4111
4113
  if (!t.outputConnection) return !1;
4112
4114
  for (const n of t.inputList)
4113
4115
  if (n.connection || n.fieldRow.length > 1) return !1;
@@ -4115,7 +4117,7 @@ class ke extends se {
4115
4117
  }
4116
4118
  applyColour() {
4117
4119
  const t = this.getSourceBlock();
4118
- if (!t) throw new F();
4120
+ if (!t) throw new z();
4119
4121
  if (!this.fieldGroup_) return;
4120
4122
  const n = this.borderRect_;
4121
4123
  if (!n)
@@ -4129,7 +4131,7 @@ class ke extends se {
4129
4131
  render_() {
4130
4132
  super.render_();
4131
4133
  const t = this.getSourceBlock();
4132
- if (!t) throw new F();
4134
+ if (!t) throw new z();
4133
4135
  t.applyColour();
4134
4136
  }
4135
4137
  updateSize_(t) {
@@ -4154,14 +4156,14 @@ class ke extends se {
4154
4156
  showEditor_() {
4155
4157
  if (this.dropdownCreate(), !this.picker)
4156
4158
  throw Error("Picker not found");
4157
- H.getContentDiv().appendChild(this.picker), H.showPositionedByField(
4159
+ Q.getContentDiv().appendChild(this.picker), Q.showPositionedByField(
4158
4160
  this,
4159
4161
  this.dropdownDispose.bind(this)
4160
4162
  ), this.picker.focus({ preventScroll: !0 });
4161
4163
  }
4162
4164
  onClick(t) {
4163
4165
  const n = t.target, i = n && n.getAttribute("data-colour");
4164
- i !== null && (this.setValue(i), H.hideIfOwner(this));
4166
+ i !== null && (this.setValue(i), Q.hideIfOwner(this));
4165
4167
  }
4166
4168
  onKeyDown(t) {
4167
4169
  let n = !0, i;
@@ -4183,7 +4185,7 @@ class ke extends se {
4183
4185
  const a = i.getAttribute("data-colour");
4184
4186
  a !== null && this.setValue(a);
4185
4187
  }
4186
- H.hideWithoutAnimation();
4188
+ Q.hideWithoutAnimation();
4187
4189
  break;
4188
4190
  default:
4189
4191
  n = !1;
@@ -4196,8 +4198,8 @@ class ke extends se {
4196
4198
  const i = this.colours, a = this.columns;
4197
4199
  let r = this.highlightedIndex % a, c = Math.floor(this.highlightedIndex / a);
4198
4200
  r += t, c += n, t < 0 ? r < 0 && c > 0 ? (r = a - 1, c--) : r < 0 && (r = 0) : t > 0 ? r > a - 1 && c < Math.floor(i.length / a) - 1 ? (r = 0, c++) : r > a - 1 && r-- : n < 0 ? c < 0 && (c = 0) : n > 0 && c > Math.floor(i.length / a) - 1 && (c = Math.floor(i.length / a) - 1);
4199
- const p = this.picker.childNodes[c].childNodes[r], y = c * a + r;
4200
- this.setHighlightedCell(p, y);
4201
+ const p = this.picker.childNodes[c].childNodes[r], T = c * a + r;
4202
+ this.setHighlightedCell(p, T);
4201
4203
  }
4202
4204
  onMouseMove(t) {
4203
4205
  const n = t.target, i = n && Number(n.getAttribute("data-index"));
@@ -4256,7 +4258,7 @@ class ke extends se {
4256
4258
  ), p.style.backgroundColor = n[c], n[c] === i && (p.className = "blocklyColourSelected", this.highlightedIndex = c);
4257
4259
  }
4258
4260
  this.boundEvents.push(
4259
- k.conditionalBind(
4261
+ D.conditionalBind(
4260
4262
  a,
4261
4263
  "pointerdown",
4262
4264
  this,
@@ -4264,7 +4266,7 @@ class ke extends se {
4264
4266
  !0
4265
4267
  )
4266
4268
  ), this.boundEvents.push(
4267
- k.conditionalBind(
4269
+ D.conditionalBind(
4268
4270
  a,
4269
4271
  "pointermove",
4270
4272
  this,
@@ -4272,7 +4274,7 @@ class ke extends se {
4272
4274
  !0
4273
4275
  )
4274
4276
  ), this.boundEvents.push(
4275
- k.conditionalBind(
4277
+ D.conditionalBind(
4276
4278
  a,
4277
4279
  "pointerenter",
4278
4280
  this,
@@ -4280,7 +4282,7 @@ class ke extends se {
4280
4282
  !0
4281
4283
  )
4282
4284
  ), this.boundEvents.push(
4283
- k.conditionalBind(
4285
+ D.conditionalBind(
4284
4286
  a,
4285
4287
  "pointerleave",
4286
4288
  this,
@@ -4288,7 +4290,7 @@ class ke extends se {
4288
4290
  !0
4289
4291
  )
4290
4292
  ), this.boundEvents.push(
4291
- k.conditionalBind(
4293
+ D.conditionalBind(
4292
4294
  a,
4293
4295
  "keydown",
4294
4296
  this,
@@ -4300,15 +4302,15 @@ class ke extends se {
4300
4302
  /** Disposes of events and DOM-references belonging to the colour editor. */
4301
4303
  dropdownDispose() {
4302
4304
  for (const t of this.boundEvents)
4303
- k.unbind(t);
4305
+ D.unbind(t);
4304
4306
  this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
4305
4307
  }
4306
4308
  static fromJson(t) {
4307
4309
  return new this(t.colour, void 0, t);
4308
4310
  }
4309
4311
  }
4310
- ke.prototype.DEFAULT_VALUE = "#ffffff";
4311
- et.register(`
4312
+ He.prototype.DEFAULT_VALUE = "#ffffff";
4313
+ dt.register(`
4312
4314
  .blocklyColourTable {
4313
4315
  border-collapse: collapse;
4314
4316
  display: block;
@@ -4335,17 +4337,17 @@ et.register(`
4335
4337
  position: relative;
4336
4338
  }
4337
4339
  `);
4338
- function so() {
4339
- tt.register("field_colour", ke);
4340
+ function Lo() {
4341
+ ft.register("field_colour", He);
4340
4342
  }
4341
- const lo = new oo();
4342
- lo.init({ contextMenu: !0, shortcut: !0 });
4343
- const ao = new no();
4344
- ao.init();
4345
- const ro = new io();
4346
- ro.init();
4347
- so();
4348
- q.Classic.blockStyles = {
4343
+ const yo = new Oo();
4344
+ yo.init({ contextMenu: !0, shortcut: !0 });
4345
+ const Co = new go();
4346
+ Co.init();
4347
+ const vo = new Io();
4348
+ vo.init();
4349
+ Lo();
4350
+ se.Classic.blockStyles = {
4349
4351
  color_blocks: {
4350
4352
  colourPrimary: "#a5745b",
4351
4353
  colourSecondary: "#ede3de",
@@ -4419,7 +4421,7 @@ q.Classic.blockStyles = {
4419
4421
  hat: ""
4420
4422
  }
4421
4423
  };
4422
- q.Classic.categoryStyles = {
4424
+ se.Classic.categoryStyles = {
4423
4425
  calc_category: {
4424
4426
  colour: "#757575"
4425
4427
  },
@@ -4469,9 +4471,9 @@ q.Classic.categoryStyles = {
4469
4471
  colour: "#a55b80"
4470
4472
  }
4471
4473
  };
4472
- const co = Ae.defineTheme("light", {
4474
+ const Ao = Ve.defineTheme("light", {
4473
4475
  name: "light",
4474
- base: q.Classic,
4476
+ base: se.Classic,
4475
4477
  componentStyles: {
4476
4478
  workspaceBackgroundColour: "#ffffff",
4477
4479
  toolboxBackgroundColour: "#eeeeee",
@@ -4485,9 +4487,9 @@ const co = Ae.defineTheme("light", {
4485
4487
  scrollbarOpacity: 0.4,
4486
4488
  cursorColour: ""
4487
4489
  }
4488
- }), _o = Ae.defineTheme("dark", {
4490
+ }), bo = Ve.defineTheme("dark", {
4489
4491
  name: "dark",
4490
- base: q.Classic,
4492
+ base: se.Classic,
4491
4493
  componentStyles: {
4492
4494
  workspaceBackgroundColour: "#1e1e1e",
4493
4495
  toolboxBackgroundColour: "#272727",
@@ -4502,18 +4504,18 @@ const co = Ae.defineTheme("light", {
4502
4504
  cursorColour: ""
4503
4505
  }
4504
4506
  });
4505
- function uo(e) {
4506
- const o = M();
4507
+ function ko(e) {
4508
+ const o = w();
4507
4509
  switch (console.log(o), e) {
4508
4510
  case "light":
4509
- o.setTheme(co);
4511
+ o.setTheme(Ao);
4510
4512
  break;
4511
4513
  case "dark":
4512
- o.setTheme(_o);
4514
+ o.setTheme(bo);
4513
4515
  break;
4514
4516
  }
4515
4517
  }
4516
- const po = {
4518
+ const me = {
4517
4519
  kind: "category",
4518
4520
  name: "%{BKY_CATEGORY_COLOR}",
4519
4521
  categorystyle: "color_category",
@@ -4587,7 +4589,7 @@ const po = {
4587
4589
  }
4588
4590
  }
4589
4591
  ]
4590
- }, To = {
4592
+ }, Oe = {
4591
4593
  kind: "category",
4592
4594
  name: "%{BKY_CATEGORY_LIST}",
4593
4595
  categorystyle: "list_category",
@@ -4702,7 +4704,7 @@ const po = {
4702
4704
  type: "list_reverse_v1"
4703
4705
  }
4704
4706
  ]
4705
- }, fo = {
4707
+ }, ge = {
4706
4708
  kind: "category",
4707
4709
  name: "%{BKY_CATEGORY_LOGIC}",
4708
4710
  categorystyle: "logic_category",
@@ -4744,7 +4746,7 @@ const po = {
4744
4746
  type: "logic_ternary_v1"
4745
4747
  }
4746
4748
  ]
4747
- }, Eo = {
4749
+ }, Ie = {
4748
4750
  kind: "category",
4749
4751
  name: "%{BKY_CATEGORY_LOOP}",
4750
4752
  categorystyle: "loop_category",
@@ -4766,7 +4768,7 @@ const po = {
4766
4768
  type: "for_each_v1"
4767
4769
  }
4768
4770
  ]
4769
- }, ho = {
4771
+ }, Le = {
4770
4772
  kind: "category",
4771
4773
  name: "%{BKY_CATEGORY_MATH}",
4772
4774
  categorystyle: "math_category",
@@ -4921,7 +4923,7 @@ const po = {
4921
4923
  type: "math_on_list_v1"
4922
4924
  }
4923
4925
  ]
4924
- }, mo = {
4926
+ }, ye = {
4925
4927
  kind: "category",
4926
4928
  name: "%{BKY_CATEGORY_OBJECT}",
4927
4929
  categorystyle: "object_category",
@@ -4989,7 +4991,7 @@ const po = {
4989
4991
  }
4990
4992
  }
4991
4993
  ]
4992
- }, Oo = {
4994
+ }, Ce = {
4993
4995
  kind: "category",
4994
4996
  name: "%{BKY_CATEGORY_TEXT}",
4995
4997
  categorystyle: "text_category",
@@ -5152,7 +5154,7 @@ const po = {
5152
5154
  type: "text_reverse_v1"
5153
5155
  }
5154
5156
  ]
5155
- }, Io = {
5157
+ }, No = {
5156
5158
  kind: "category",
5157
5159
  name: "%{BKY_CATEGORY_TIME}",
5158
5160
  categorystyle: "time_category",
@@ -5176,64 +5178,110 @@ const po = {
5176
5178
  }
5177
5179
  }
5178
5180
  ]
5179
- }, go = {
5181
+ }, Bo = {
5180
5182
  kind: "categoryToolbox",
5181
5183
  contents: [
5182
5184
  {
5183
5185
  kind: "category",
5184
5186
  name: "%{BKY_CATEGORY_UI}",
5185
5187
  categorystyle: "ui_category",
5186
- custom: ue.name
5188
+ custom: fe.name
5187
5189
  },
5188
- Eo,
5189
- fo,
5190
- ho,
5191
- Oo,
5192
- To,
5193
- mo,
5194
- po,
5195
- Io,
5190
+ Ie,
5191
+ ge,
5192
+ Le,
5193
+ Ce,
5194
+ Oe,
5195
+ ye,
5196
+ me,
5197
+ No,
5196
5198
  {
5197
5199
  kind: "category",
5198
5200
  name: "%{BKY_CATEGORY_VARIABLE}",
5199
5201
  categorystyle: "variable_category",
5200
- custom: pe.name
5202
+ custom: N.name
5201
5203
  },
5202
5204
  {
5203
5205
  kind: "category",
5204
5206
  name: "%{BKY_CATEGORY_PROCEDURE}",
5205
5207
  categorystyle: "procedure_category",
5206
- custom: _e.name
5208
+ custom: k.name
5207
5209
  },
5208
5210
  {
5209
5211
  kind: "category",
5210
5212
  name: "%{BKY_CATEGORY_INTERFACE}",
5211
5213
  categorystyle: "interface_category",
5212
- custom: Jt.name
5214
+ custom: po.name
5215
+ }
5216
+ ]
5217
+ }, Ro = {
5218
+ kind: "categoryToolbox",
5219
+ contents: [
5220
+ Ie,
5221
+ ge,
5222
+ Le,
5223
+ Ce,
5224
+ Oe,
5225
+ ye,
5226
+ me,
5227
+ {
5228
+ kind: "category",
5229
+ name: "%{BKY_CATEGORY_VARIABLE}",
5230
+ categorystyle: "variable_category",
5231
+ custom: N.name
5232
+ },
5233
+ {
5234
+ kind: "category",
5235
+ name: "%{BKY_CATEGORY_PROCEDURE}",
5236
+ categorystyle: "procedure_category",
5237
+ custom: k.name
5238
+ }
5239
+ ]
5240
+ }, So = {
5241
+ kind: "categoryToolbox",
5242
+ contents: [
5243
+ Ie,
5244
+ ge,
5245
+ Le,
5246
+ Ce,
5247
+ Oe,
5248
+ ye,
5249
+ me,
5250
+ {
5251
+ kind: "category",
5252
+ name: "%{BKY_CATEGORY_VARIABLE}",
5253
+ categorystyle: "variable_category",
5254
+ custom: N.name
5255
+ },
5256
+ {
5257
+ kind: "category",
5258
+ name: "%{BKY_CATEGORY_PROCEDURE}",
5259
+ categorystyle: "procedure_category",
5260
+ custom: k.name
5213
5261
  }
5214
5262
  ]
5215
- }, Lo = /* @__PURE__ */ z({
5263
+ }, Mo = /* @__PURE__ */ W({
5216
5264
  __name: "cleanup",
5217
5265
  setup(e) {
5218
5266
  const o = () => {
5219
- const t = M();
5267
+ const t = w();
5220
5268
  if (!t)
5221
5269
  return;
5222
- const n = N.registry.getItem("cleanWorkspace");
5270
+ const n = V.registry.getItem("cleanWorkspace");
5223
5271
  n && n.callback({ workspace: t }, new PointerEvent("dummy"));
5224
5272
  };
5225
5273
  return (t, n) => {
5226
- const i = C("v-btn");
5227
- return I(), S(i, {
5274
+ const i = v("v-btn");
5275
+ return L(), P(i, {
5228
5276
  class: "mr-3",
5229
5277
  variant: "outlined",
5230
5278
  density: "comfortable",
5231
- icon: Y(ct),
5279
+ icon: b(vt),
5232
5280
  onClick: o
5233
5281
  }, null, 8, ["icon"]);
5234
5282
  };
5235
5283
  }
5236
- }), yo = /* @__PURE__ */ z({
5284
+ }), Uo = /* @__PURE__ */ W({
5237
5285
  __name: "lock",
5238
5286
  props: {
5239
5287
  modelValue: { type: Boolean, required: !0 },
@@ -5241,111 +5289,173 @@ const po = {
5241
5289
  },
5242
5290
  emits: ["update:modelValue"],
5243
5291
  setup(e) {
5244
- const o = le(e, "modelValue");
5292
+ const o = ue(e, "modelValue");
5245
5293
  return (t, n) => {
5246
- const i = C("v-btn");
5247
- return I(), S(i, {
5294
+ const i = v("v-btn");
5295
+ return L(), P(i, {
5248
5296
  class: "mr-3",
5249
5297
  variant: "outlined",
5250
5298
  density: "comfortable",
5251
- icon: o.value ? Y(ut) : Y(pt),
5299
+ icon: o.value ? b(kt) : b(Nt),
5252
5300
  onClick: n[0] || (n[0] = (a) => o.value = !o.value)
5253
5301
  }, null, 8, ["icon"]);
5254
5302
  };
5255
5303
  }
5256
- }), Co = {
5304
+ }), Vo = {
5257
5305
  key: 1,
5258
5306
  class: "text-caption text-grey"
5259
- }, Ao = /* @__PURE__ */ z({
5260
- __name: "navigator",
5307
+ }, Po = /* @__PURE__ */ W({
5308
+ __name: "index",
5261
5309
  setup(e) {
5262
- const o = $(() => ({
5263
- maxHeight: "calc(100vh - 200px)"
5264
- })), t = j([]), n = () => {
5265
- var y;
5266
- const a = M();
5310
+ const { t: o } = xe(), t = ee([]), n = () => {
5311
+ var T;
5312
+ const a = w();
5267
5313
  if (!a) {
5268
5314
  t.value = [];
5269
5315
  return;
5270
5316
  }
5271
- const r = [], c = a.getTopBlocks(!0), p = ((y = B()) == null ? void 0 : y.id) ?? "";
5272
- c.forEach((v) => {
5273
- const g = v;
5274
- if (g.type.startsWith("on_node_event_v"))
5317
+ const r = [], c = a.getTopBlocks(!0), p = ((T = Y()) == null ? void 0 : T.id) ?? "";
5318
+ c.forEach((f) => {
5319
+ const I = f;
5320
+ if (I.type.startsWith("on_node_event_v"))
5275
5321
  console.log("1");
5276
- else if (g.type.startsWith("procedure_def_v"))
5322
+ else if (I.type.startsWith("procedure_def_v"))
5277
5323
  console.log("2");
5278
5324
  else {
5279
- const f = g.getRelativeToSurfaceXY();
5325
+ const R = I.getRelativeToSurfaceXY();
5280
5326
  r.push({
5281
- id: g.id,
5282
- name: h.fffff,
5283
- x: f.x,
5284
- y: f.y,
5285
- active: g.id === p
5327
+ id: I.id,
5328
+ name: O.fffff,
5329
+ x: R.x,
5330
+ y: R.y,
5331
+ active: I.id === p
5286
5332
  });
5287
5333
  }
5288
5334
  }), t.value = r;
5289
- }, i = (a) => {
5290
- const r = M();
5335
+ };
5336
+ Se(() => {
5337
+ de.on("codeUpdate", n);
5338
+ }), Ze(() => {
5339
+ de.off("codeUpdate", n);
5340
+ });
5341
+ const i = (a) => {
5342
+ const r = w();
5291
5343
  if (!r)
5292
5344
  return;
5293
5345
  const c = r.getBlockById(a.id);
5294
- c && (be(a.id), c.select());
5346
+ c && (Ke(a.id), c.select());
5295
5347
  };
5296
- return Le(() => {
5297
- ce.on("codeUpdate", n);
5298
- }), Ke(() => {
5299
- ce.off("codeUpdate", n);
5300
- }), (a, r) => {
5301
- const c = C("v-btn"), p = C("v-list-item-title"), y = C("v-list-item"), v = C("v-list"), g = C("v-menu");
5302
- return I(), S(g, {
5303
- "close-on-content-click": !1,
5304
- transition: "slide-y-transition",
5305
- "offset-y": ""
5348
+ return (a, r) => {
5349
+ const c = v("v-list-item-title"), p = v("v-list-item"), T = v("v-list");
5350
+ return t.value.length > 0 ? (L(), P(T, { key: 0 }, {
5351
+ default: K(() => [
5352
+ (L(!0), X(et, null, tt(t.value, (f) => (L(), P(p, {
5353
+ key: f.id,
5354
+ class: "d-flex justify-start",
5355
+ active: f.active,
5356
+ onClick: (I) => i(f)
5357
+ }, {
5358
+ default: K(() => [
5359
+ B(c, null, {
5360
+ default: K(() => [
5361
+ ot(pe(f.name), 1)
5362
+ ]),
5363
+ _: 2
5364
+ }, 1024)
5365
+ ]),
5366
+ _: 2
5367
+ }, 1032, ["active", "onClick"]))), 128))
5368
+ ]),
5369
+ _: 1
5370
+ })) : (L(), X("span", Vo, pe(b(o)("x-block-lib.noOption")), 1));
5371
+ };
5372
+ }
5373
+ }), xo = { class: "text-subtitle-1 ml-3" }, Do = /* @__PURE__ */ W({
5374
+ __name: "index",
5375
+ setup(e) {
5376
+ const { t: o } = xe(), t = Ct(), { sysBarAvail: n } = It(), { backgroundColor1: i } = Lt(), a = F(() => {
5377
+ let T = "100%";
5378
+ return t.mdAndUp.value && (T = "400px"), {
5379
+ background: i.value,
5380
+ width: T,
5381
+ height: "100%"
5382
+ };
5383
+ }), r = F(() => {
5384
+ let T = 48;
5385
+ return n.value && (T += 24), {
5386
+ position: "relative",
5387
+ width: "100%",
5388
+ height: `calc(100% - ${T}px)`
5389
+ };
5390
+ }), c = F(() => ({
5391
+ height: "60px"
5392
+ })), { open: p } = Pe("selectNodeDlg");
5393
+ return (T, f) => {
5394
+ const I = v("v-btn"), R = v("v-sheet"), m = v("v-icon"), x = v("v-dialog");
5395
+ return L(), P(x, {
5396
+ modelValue: b(p),
5397
+ "onUpdate:modelValue": f[3] || (f[3] = (C) => nt(p) ? p.value = C : null),
5398
+ transition: "scroll-x-reverse-transition",
5399
+ persistent: "",
5400
+ "no-click-animation": "",
5401
+ fullscreen: "",
5402
+ onKeydown: f[4] || (f[4] = it(le((C) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5306
5403
  }, {
5307
- activator: U(({ props: f }) => [
5308
- R(c, Fe(f, {
5404
+ activator: K(({ props: C }) => [
5405
+ B(I, st(C, {
5309
5406
  variant: "outlined",
5310
5407
  density: "comfortable",
5311
- icon: Y(Tt)
5408
+ icon: b(Bt)
5312
5409
  }), null, 16, ["icon"])
5313
5410
  ]),
5314
- default: U(() => [
5315
- ae("div", {
5316
- class: "overflow-auto",
5317
- style: X(o.value)
5411
+ default: K(() => [
5412
+ M("div", {
5413
+ class: "w-100 h-100 d-flex flex-row-reverse",
5414
+ onClick: f[1] || (f[1] = le((C) => p.value = !1, ["self"])),
5415
+ onContextmenu: f[2] || (f[2] = le((C) => p.value = !1, ["self", "prevent"]))
5318
5416
  }, [
5319
- t.value.length > 0 ? (I(), S(v, { key: 0 }, {
5320
- default: U(() => [
5321
- (I(!0), x(He, null, we(t.value, (f) => (I(), S(y, {
5322
- key: f.id,
5323
- class: "d-flex justify-start",
5324
- active: f.active,
5325
- onClick: i
5326
- }, {
5327
- default: U(() => [
5328
- R(p, null, {
5329
- default: U(() => [
5330
- Ge($e(f.name), 1)
5331
- ]),
5332
- _: 2
5333
- }, 1024)
5334
- ]),
5335
- _: 2
5336
- }, 1032, ["active"]))), 128))
5337
- ]),
5338
- _: 1
5339
- })) : (I(), x("span", Co, "xxxxxxxxxx"))
5340
- ], 4)
5417
+ M("div", {
5418
+ class: "elevation-2",
5419
+ style: H(a.value)
5420
+ }, [
5421
+ b(n) ? (L(), P(R, {
5422
+ key: 0,
5423
+ color: "transparent",
5424
+ height: 24
5425
+ })) : te("", !0),
5426
+ B(R, {
5427
+ class: "d-flex align-center px-3",
5428
+ color: "transparent",
5429
+ height: 48
5430
+ }, {
5431
+ default: K(() => [
5432
+ B(m, {
5433
+ icon: b(At),
5434
+ onClick: f[0] || (f[0] = (C) => p.value = !1)
5435
+ }, null, 8, ["icon"]),
5436
+ M("span", xo, pe(b(o)("x-block-lib.navigator")), 1)
5437
+ ]),
5438
+ _: 1
5439
+ }),
5440
+ M("div", {
5441
+ class: "overflow-y-auto",
5442
+ style: H(r.value)
5443
+ }, [
5444
+ B(Po),
5445
+ M("div", {
5446
+ style: H(c.value)
5447
+ }, null, 4)
5448
+ ], 4)
5449
+ ], 4)
5450
+ ], 32)
5341
5451
  ]),
5342
5452
  _: 1
5343
- });
5453
+ }, 8, ["modelValue"]);
5344
5454
  };
5345
5455
  }
5346
- }), vo = { class: "position-relative w-100 h-100" }, bo = /* @__PURE__ */ z({
5456
+ }), Yo = { class: "position-relative w-100 h-100" }, Ko = /* @__PURE__ */ W({
5347
5457
  __name: "index",
5348
- props: /* @__PURE__ */ Ee({
5458
+ props: /* @__PURE__ */ Ae({
5349
5459
  type: {},
5350
5460
  version: {},
5351
5461
  active: { type: Boolean }
@@ -5355,9 +5465,9 @@ const po = {
5355
5465
  scale: { required: !0 },
5356
5466
  scaleModifiers: {}
5357
5467
  }),
5358
- emits: /* @__PURE__ */ Ee(["ready", "change"], ["update:lock", "update:scale"]),
5359
- setup(e, { emit: o }) {
5360
- const t = at(), { locale: n, dark: i } = it(t), { open: a } = rt("blocklyEditorFlyout"), r = le(e, "lock"), c = le(e, "scale"), p = e, y = o, v = j(), g = {
5468
+ emits: /* @__PURE__ */ Ae(["ready", "change"], ["update:lock", "update:scale"]),
5469
+ setup(e, { expose: o, emit: t }) {
5470
+ const n = yt(), { locale: i, dark: a } = mt(n), { open: r } = Pe("blocklyEditorFlyout"), c = ue(e, "lock"), p = ue(e, "scale"), T = e, f = t, I = ee(), R = {
5361
5471
  grid: {
5362
5472
  length: 2,
5363
5473
  snap: !0,
@@ -5370,7 +5480,7 @@ const po = {
5370
5480
  wheel: !0
5371
5481
  },
5372
5482
  readOnly: !1,
5373
- theme: i.value ? "dark" : "light",
5483
+ theme: a.value ? "dark" : "light",
5374
5484
  trashcan: !1,
5375
5485
  zoom: {
5376
5486
  maxScale: 1,
@@ -5380,127 +5490,138 @@ const po = {
5380
5490
  wheel: !0
5381
5491
  }
5382
5492
  };
5383
- let f;
5384
- const Z = j(!1), ee = j(!1), Be = $(() => ({
5493
+ let m;
5494
+ const x = ee(!1), C = ee(!1), we = F(() => ({
5385
5495
  position: "absolute",
5386
- background: i.value ? "#0000007f" : "#ffffff7f",
5496
+ background: a.value ? "#0000007f" : "#ffffff7f",
5387
5497
  top: "1px",
5388
5498
  left: "0px",
5389
5499
  width: "56px",
5390
5500
  height: "calc(100% - 1px)",
5391
5501
  pointerEvents: "none",
5392
5502
  zIndex: 999
5393
- })), Re = $(() => ({
5503
+ })), Ge = F(() => ({
5394
5504
  position: "absolute",
5395
- background: i.value ? "#0000007f" : "#ffffff7f",
5505
+ background: a.value ? "#0000007f" : "#ffffff7f",
5396
5506
  top: "0px",
5397
5507
  left: "0px",
5398
5508
  width: "100%",
5399
5509
  height: "100%",
5400
5510
  pointerEvents: "none"
5401
- })), Se = $(() => ({
5511
+ })), $e = F(() => ({
5402
5512
  position: "absolute",
5403
5513
  top: "0px",
5404
5514
  right: "0px",
5405
5515
  zIndex: 20
5406
5516
  }));
5407
- Le(async () => {
5408
- if (!v.value)
5517
+ Se(async () => {
5518
+ if (!I.value)
5409
5519
  return;
5410
- await ge(n.value);
5411
- let T;
5412
- if (p.type === "app" && p.version === "v1" && (T = go), g.toolbox = T, f = ot(v.value, g), p.type === "app")
5413
- switch (p.version) {
5414
- case "v1":
5415
- f.registerToolboxCategoryCallback(
5416
- ue.name,
5417
- ue.callback
5418
- ), f.registerToolboxCategoryCallback(
5419
- _e.name,
5420
- _e.callback
5421
- ), f.registerToolboxCategoryCallback(
5422
- pe.name,
5423
- pe.callback
5424
- );
5425
- break;
5426
- }
5427
- f.addChangeListener(E.disableOrphans), f.addChangeListener(Me), y("ready", f);
5428
- }), je(() => {
5429
- a.value = !1;
5520
+ await Re(i.value);
5521
+ let d;
5522
+ T.type === "app" ? T.version === "v1" && (d = Bo) : T.type === "func" ? T.version === "v1" && (d = So) : T.type === "flow" && T.version === "v1" && (d = Ro), R.toolbox = d, m = Et(I.value, R), T.type === "app" ? T.version === "v1" && (m.registerToolboxCategoryCallback(
5523
+ fe.name,
5524
+ fe.callback
5525
+ ), m.registerToolboxCategoryCallback(
5526
+ k.name,
5527
+ k.callback
5528
+ ), m.registerToolboxCategoryCallback(
5529
+ N.name,
5530
+ N.callback
5531
+ )) : T.type === "func" ? T.version === "v1" && (m.registerToolboxCategoryCallback(
5532
+ k.name,
5533
+ k.callback
5534
+ ), m.registerToolboxCategoryCallback(
5535
+ N.name,
5536
+ N.callback
5537
+ )) : T.type === "flow" && T.version === "v1" && (m.registerToolboxCategoryCallback(
5538
+ k.name,
5539
+ k.callback
5540
+ ), m.registerToolboxCategoryCallback(
5541
+ N.name,
5542
+ N.callback
5543
+ )), m.addChangeListener(h.disableOrphans), m.addChangeListener(je), m.setScale(p.value), f("ready", m);
5544
+ }), lt(() => {
5545
+ r.value = !1;
5430
5546
  });
5431
- function fe() {
5432
- f && nt(f);
5547
+ function ve() {
5548
+ m && ht(m);
5433
5549
  }
5434
- function Me(T) {
5435
- if (T.type === E.FINISHED_LOADING) {
5436
- to(), ce.emit("codeUpdate"), Z.value = !1;
5550
+ function je(d) {
5551
+ if (d.type === h.FINISHED_LOADING) {
5552
+ mo(), de.emit("codeUpdate"), x.value = !1;
5437
5553
  return;
5438
5554
  }
5439
- Z.value || (T.type === E.BLOCK_DRAG && (T.isStart ? ee.value = !0 : ee.value = !1), y("change", T));
5555
+ x.value || (d.type === h.BLOCK_DRAG && (d.isStart ? C.value = !0 : C.value = !1), f("change", d));
5440
5556
  }
5441
- return V(n, (T) => {
5442
- ge(T);
5443
- }), V(i, (T) => {
5444
- uo(T ? "dark" : "light");
5445
- }), V(a, (T) => {
5446
- var A;
5447
- T || (A = f.getToolbox()) == null || A.clearSelection();
5448
- }), V(
5449
- () => p.active,
5450
- (T) => {
5451
- T && setTimeout(() => fe(), 1);
5557
+ return o({ load: () => {
5558
+ x.value = !0;
5559
+ }, save: () => {
5560
+ } }), G(i, (d) => {
5561
+ Re(d);
5562
+ }), G(a, (d) => {
5563
+ ko(d ? "dark" : "light");
5564
+ }), G(r, (d) => {
5565
+ var S;
5566
+ d || (S = m.getToolbox()) == null || S.clearSelection();
5567
+ }), G(
5568
+ () => T.active,
5569
+ (d) => {
5570
+ d && setTimeout(() => ve(), 1);
5452
5571
  }
5453
- ), V(
5454
- c,
5455
- (T) => {
5456
- f.setScale(T);
5457
- }
5458
- ), (T, A) => {
5459
- const Ue = C("v-icon"), Ve = C("x-loading"), Pe = Xe("resize");
5460
- return I(), x("div", vo, [
5461
- We(ae("div", {
5572
+ ), G(p, (d) => {
5573
+ m.setScale(d);
5574
+ }), (d, S) => {
5575
+ const Xe = v("v-icon"), We = v("x-loading"), Je = at("resize");
5576
+ return L(), X("div", Yo, [
5577
+ rt(M("div", {
5462
5578
  id: "blocklyEditor",
5463
5579
  ref_key: "blocklyDiv",
5464
- ref: v,
5580
+ ref: I,
5465
5581
  class: "w-100 h-100"
5466
5582
  }, null, 512), [
5467
- [Pe, fe]
5583
+ [Je, ve]
5468
5584
  ]),
5469
- ee.value ? (I(), x("div", {
5585
+ C.value ? (L(), X("div", {
5470
5586
  key: 0,
5471
5587
  class: "d-flex flex-column align-center justify-center",
5472
- style: X(Be.value)
5588
+ style: H(we.value)
5473
5589
  }, [
5474
- R(Ue, {
5475
- icon: Y(_t),
5590
+ B(Xe, {
5591
+ icon: b(bt),
5476
5592
  size: "x-large"
5477
5593
  }, null, 8, ["icon"])
5478
5594
  ], 4)) : te("", !0),
5479
- r.value ? (I(), x("div", {
5595
+ c.value ? (L(), X("div", {
5480
5596
  key: 1,
5481
- style: X(Re.value)
5597
+ style: H(Ge.value)
5482
5598
  }, null, 4)) : te("", !0),
5483
- ae("div", {
5599
+ M("div", {
5484
5600
  class: "d-flex align-end pt-3 pr-3",
5485
- style: X(Se.value)
5601
+ style: H($e.value)
5486
5602
  }, [
5487
- R(Lo),
5488
- R(yo, {
5489
- modelValue: r.value,
5490
- "onUpdate:modelValue": A[0] || (A[0] = (De) => r.value = De)
5603
+ B(Mo),
5604
+ B(Uo, {
5605
+ modelValue: c.value,
5606
+ "onUpdate:modelValue": S[0] || (S[0] = (ze) => c.value = ze)
5491
5607
  }, null, 8, ["modelValue"]),
5492
- R(Ao)
5608
+ B(Do)
5493
5609
  ], 4),
5494
- Z.value ? (I(), S(Ve, {
5610
+ x.value ? (L(), P(We, {
5495
5611
  key: 2,
5496
5612
  "z-index": 99
5497
5613
  })) : te("", !0)
5498
5614
  ]);
5499
5615
  };
5500
5616
  }
5501
- }), No = (e) => {
5502
- e.component("XBlockly", bo);
5503
- }, Uo = { install: No };
5617
+ }), Fo = (e) => {
5618
+ e.component("XBlockly", Ko);
5619
+ };
5620
+ async function Qo(e) {
5621
+ return (await Ye(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en-hf8d9jpk.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans-kicfou8k.js") }), `./locales/${e}/index.ts`, 4)).default;
5622
+ }
5623
+ const qo = { install: Fo };
5504
5624
  export {
5505
- Uo as default
5625
+ qo as default,
5626
+ Qo as loadLocaleMessageBlock
5506
5627
  };