blockly 13.0.0-beta.2 → 13.0.0-beta.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.
Files changed (262) hide show
  1. package/blockly.min.js +54 -42
  2. package/blockly_compressed.js +45 -42
  3. package/blockly_compressed.js.map +1 -1
  4. package/core/bubbles/textinput_bubble.d.ts +5 -0
  5. package/core/icons/comment_icon.d.ts +8 -0
  6. package/core/icons/icon.d.ts +14 -0
  7. package/core/icons/mutator_icon.d.ts +8 -0
  8. package/core/icons/warning_icon.d.ts +8 -0
  9. package/core/inputs/input.d.ts +28 -0
  10. package/msg/ab.js +9 -0
  11. package/msg/ab.mjs +9 -0
  12. package/msg/ace.js +9 -0
  13. package/msg/ace.mjs +9 -0
  14. package/msg/af.js +9 -0
  15. package/msg/af.mjs +9 -0
  16. package/msg/am.js +9 -0
  17. package/msg/am.mjs +9 -0
  18. package/msg/ar.js +9 -0
  19. package/msg/ar.mjs +9 -0
  20. package/msg/ast.js +9 -0
  21. package/msg/ast.mjs +9 -0
  22. package/msg/az.js +9 -0
  23. package/msg/az.mjs +9 -0
  24. package/msg/ba.js +9 -0
  25. package/msg/ba.mjs +9 -0
  26. package/msg/bcc.js +9 -0
  27. package/msg/bcc.mjs +9 -0
  28. package/msg/be-tarask.js +9 -0
  29. package/msg/be-tarask.mjs +9 -0
  30. package/msg/be.js +9 -0
  31. package/msg/be.mjs +9 -0
  32. package/msg/bg.js +9 -0
  33. package/msg/bg.mjs +9 -0
  34. package/msg/bn.js +9 -0
  35. package/msg/bn.mjs +9 -0
  36. package/msg/br.js +9 -0
  37. package/msg/br.mjs +9 -0
  38. package/msg/bs.js +9 -0
  39. package/msg/bs.mjs +9 -0
  40. package/msg/ca.js +9 -0
  41. package/msg/ca.mjs +9 -0
  42. package/msg/ce.js +9 -0
  43. package/msg/ce.mjs +9 -0
  44. package/msg/cs.js +9 -0
  45. package/msg/cs.mjs +9 -0
  46. package/msg/da.js +9 -0
  47. package/msg/da.mjs +9 -0
  48. package/msg/de.js +9 -0
  49. package/msg/de.mjs +9 -0
  50. package/msg/diq.js +9 -0
  51. package/msg/diq.mjs +9 -0
  52. package/msg/dtp.js +9 -0
  53. package/msg/dtp.mjs +9 -0
  54. package/msg/dty.js +9 -0
  55. package/msg/dty.mjs +9 -0
  56. package/msg/ee.js +9 -0
  57. package/msg/ee.mjs +9 -0
  58. package/msg/el.js +9 -0
  59. package/msg/el.mjs +9 -0
  60. package/msg/en-gb.js +9 -0
  61. package/msg/en-gb.mjs +9 -0
  62. package/msg/en.js +9 -0
  63. package/msg/en.mjs +9 -0
  64. package/msg/eo.js +9 -0
  65. package/msg/eo.mjs +9 -0
  66. package/msg/es.js +9 -0
  67. package/msg/es.mjs +9 -0
  68. package/msg/et.js +9 -0
  69. package/msg/et.mjs +9 -0
  70. package/msg/eu.js +9 -0
  71. package/msg/eu.mjs +9 -0
  72. package/msg/fa.js +9 -0
  73. package/msg/fa.mjs +9 -0
  74. package/msg/fi.js +9 -0
  75. package/msg/fi.mjs +9 -0
  76. package/msg/fo.js +9 -0
  77. package/msg/fo.mjs +9 -0
  78. package/msg/fr.js +9 -0
  79. package/msg/fr.mjs +9 -0
  80. package/msg/frr.js +9 -0
  81. package/msg/frr.mjs +9 -0
  82. package/msg/ga.js +9 -0
  83. package/msg/ga.mjs +9 -0
  84. package/msg/gl.js +9 -0
  85. package/msg/gl.mjs +9 -0
  86. package/msg/gn.js +9 -0
  87. package/msg/gn.mjs +9 -0
  88. package/msg/gor.js +9 -0
  89. package/msg/gor.mjs +9 -0
  90. package/msg/ha.js +9 -0
  91. package/msg/ha.mjs +9 -0
  92. package/msg/hak.js +9 -0
  93. package/msg/hak.mjs +9 -0
  94. package/msg/he.js +9 -0
  95. package/msg/he.mjs +9 -0
  96. package/msg/hi.js +9 -0
  97. package/msg/hi.mjs +9 -0
  98. package/msg/hr.js +9 -0
  99. package/msg/hr.mjs +9 -0
  100. package/msg/hrx.js +9 -0
  101. package/msg/hrx.mjs +9 -0
  102. package/msg/hsb.js +9 -0
  103. package/msg/hsb.mjs +9 -0
  104. package/msg/hu.js +9 -0
  105. package/msg/hu.mjs +9 -0
  106. package/msg/hy.js +9 -0
  107. package/msg/hy.mjs +9 -0
  108. package/msg/ia.js +9 -0
  109. package/msg/ia.mjs +9 -0
  110. package/msg/id.js +9 -0
  111. package/msg/id.mjs +9 -0
  112. package/msg/ig.js +9 -0
  113. package/msg/ig.mjs +9 -0
  114. package/msg/inh.js +9 -0
  115. package/msg/inh.mjs +9 -0
  116. package/msg/is.js +9 -0
  117. package/msg/is.mjs +9 -0
  118. package/msg/it.js +9 -0
  119. package/msg/it.mjs +9 -0
  120. package/msg/ja.js +9 -0
  121. package/msg/ja.mjs +9 -0
  122. package/msg/ka.js +9 -0
  123. package/msg/ka.mjs +9 -0
  124. package/msg/kab.js +9 -0
  125. package/msg/kab.mjs +9 -0
  126. package/msg/kbd-cyrl.js +9 -0
  127. package/msg/kbd-cyrl.mjs +9 -0
  128. package/msg/km.js +9 -0
  129. package/msg/km.mjs +9 -0
  130. package/msg/kn.js +9 -0
  131. package/msg/kn.mjs +9 -0
  132. package/msg/ko.js +9 -0
  133. package/msg/ko.mjs +9 -0
  134. package/msg/krc.js +9 -0
  135. package/msg/krc.mjs +9 -0
  136. package/msg/ksh.js +9 -0
  137. package/msg/ksh.mjs +9 -0
  138. package/msg/ku-latn.js +9 -0
  139. package/msg/ku-latn.mjs +9 -0
  140. package/msg/ky.js +9 -0
  141. package/msg/ky.mjs +9 -0
  142. package/msg/la.js +9 -0
  143. package/msg/la.mjs +9 -0
  144. package/msg/lb.js +9 -0
  145. package/msg/lb.mjs +9 -0
  146. package/msg/lki.js +9 -0
  147. package/msg/lki.mjs +9 -0
  148. package/msg/lo.js +9 -0
  149. package/msg/lo.mjs +9 -0
  150. package/msg/lrc.js +9 -0
  151. package/msg/lrc.mjs +9 -0
  152. package/msg/lt.js +9 -0
  153. package/msg/lt.mjs +9 -0
  154. package/msg/lv.js +9 -0
  155. package/msg/lv.mjs +9 -0
  156. package/msg/mg.js +9 -0
  157. package/msg/mg.mjs +9 -0
  158. package/msg/mk.js +9 -0
  159. package/msg/mk.mjs +9 -0
  160. package/msg/ml.js +9 -0
  161. package/msg/ml.mjs +9 -0
  162. package/msg/mnw.js +9 -0
  163. package/msg/mnw.mjs +9 -0
  164. package/msg/ms.js +9 -0
  165. package/msg/ms.mjs +9 -0
  166. package/msg/my.js +9 -0
  167. package/msg/my.mjs +9 -0
  168. package/msg/mzn.js +9 -0
  169. package/msg/mzn.mjs +9 -0
  170. package/msg/nb.js +9 -0
  171. package/msg/nb.mjs +9 -0
  172. package/msg/ne.js +9 -0
  173. package/msg/ne.mjs +9 -0
  174. package/msg/nl.js +9 -0
  175. package/msg/nl.mjs +9 -0
  176. package/msg/oc.js +9 -0
  177. package/msg/oc.mjs +9 -0
  178. package/msg/olo.js +9 -0
  179. package/msg/olo.mjs +9 -0
  180. package/msg/pa.js +9 -0
  181. package/msg/pa.mjs +9 -0
  182. package/msg/pl.js +9 -0
  183. package/msg/pl.mjs +9 -0
  184. package/msg/pms.js +9 -0
  185. package/msg/pms.mjs +9 -0
  186. package/msg/ps.js +9 -0
  187. package/msg/ps.mjs +9 -0
  188. package/msg/pt-br.js +9 -0
  189. package/msg/pt-br.mjs +9 -0
  190. package/msg/pt.js +9 -0
  191. package/msg/pt.mjs +9 -0
  192. package/msg/ro.js +9 -0
  193. package/msg/ro.mjs +9 -0
  194. package/msg/ru.js +9 -0
  195. package/msg/ru.mjs +9 -0
  196. package/msg/sc.js +9 -0
  197. package/msg/sc.mjs +9 -0
  198. package/msg/sco.js +9 -0
  199. package/msg/sco.mjs +9 -0
  200. package/msg/sd.js +9 -0
  201. package/msg/sd.mjs +9 -0
  202. package/msg/shn.js +9 -0
  203. package/msg/shn.mjs +9 -0
  204. package/msg/si.js +9 -0
  205. package/msg/si.mjs +9 -0
  206. package/msg/sk.js +9 -0
  207. package/msg/sk.mjs +9 -0
  208. package/msg/skr-arab.js +9 -0
  209. package/msg/skr-arab.mjs +9 -0
  210. package/msg/sl.js +9 -0
  211. package/msg/sl.mjs +9 -0
  212. package/msg/smn.js +9 -0
  213. package/msg/smn.mjs +9 -0
  214. package/msg/sq.js +9 -0
  215. package/msg/sq.mjs +9 -0
  216. package/msg/sr-latn.js +9 -0
  217. package/msg/sr-latn.mjs +9 -0
  218. package/msg/sr.js +9 -0
  219. package/msg/sr.mjs +9 -0
  220. package/msg/sv.js +9 -0
  221. package/msg/sv.mjs +9 -0
  222. package/msg/sw.js +9 -0
  223. package/msg/sw.mjs +9 -0
  224. package/msg/ta.js +9 -0
  225. package/msg/ta.mjs +9 -0
  226. package/msg/tcy.js +9 -0
  227. package/msg/tcy.mjs +9 -0
  228. package/msg/tdd.js +9 -0
  229. package/msg/tdd.mjs +9 -0
  230. package/msg/te.js +9 -0
  231. package/msg/te.mjs +9 -0
  232. package/msg/th.js +9 -0
  233. package/msg/th.mjs +9 -0
  234. package/msg/ti.js +9 -0
  235. package/msg/ti.mjs +9 -0
  236. package/msg/tl.js +9 -0
  237. package/msg/tl.mjs +9 -0
  238. package/msg/tlh.js +9 -0
  239. package/msg/tlh.mjs +9 -0
  240. package/msg/tr.js +9 -0
  241. package/msg/tr.mjs +9 -0
  242. package/msg/ug-arab.js +9 -0
  243. package/msg/ug-arab.mjs +9 -0
  244. package/msg/uk.js +9 -0
  245. package/msg/uk.mjs +9 -0
  246. package/msg/ur.js +9 -0
  247. package/msg/ur.mjs +9 -0
  248. package/msg/uz.js +9 -0
  249. package/msg/uz.mjs +9 -0
  250. package/msg/vi.js +9 -0
  251. package/msg/vi.mjs +9 -0
  252. package/msg/xmf.js +9 -0
  253. package/msg/xmf.mjs +9 -0
  254. package/msg/yo.js +9 -0
  255. package/msg/yo.mjs +9 -0
  256. package/msg/zgh.js +9 -0
  257. package/msg/zgh.mjs +9 -0
  258. package/msg/zh-hans.js +9 -0
  259. package/msg/zh-hans.mjs +9 -0
  260. package/msg/zh-hant.js +9 -0
  261. package/msg/zh-hant.mjs +9 -0
  262. package/package.json +1 -1
@@ -397,7 +397,7 @@ a.outputConnection?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_VALUE:$.Msg$$mod
397
397
  computeFieldRowLabel$$module$build$src$core$block_aria_composer=function(a,b,c=Verbosity$$module$build$src$core$utils$aria.STANDARD){var d=c>=Verbosity$$module$build$src$core$utils$aria.STANDARD,e=a.fieldRow.filter(f=>f.isVisible()).map(f=>f.computeAriaLabel(d));if(!e.length&&b){let f=a.getSourceBlock().inputList;a=f.indexOf(a);if(a>0)return computeFieldRowLabel$$module$build$src$core$block_aria_composer(f[a-1],b,c)}return e};
398
398
  getParentInputLabel$$module$build$src$core$block_aria_composer=function(a){var b,c,d,e=(b=(d=a.outputConnection)!=null?d:a.previousConnection)==null?void 0:(c=b.targetConnection)==null?void 0:c.getParentInput();a=e==null?void 0:e.getSourceBlock();if((a==null||!a.isInsertionMarker())&&a!=null&&a.statementInputCount&&(a=a.inputList.find(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT),e&&e!==a))return a=computeFieldRowLabel$$module$build$src$core$block_aria_composer(e,!0),
399
399
  e.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_PREFIX.replace("%1",a.join(" ")):a};getBeginStackLabel$$module$build$src$core$block_aria_composer=function(a){return a.workspace.isFlyout||a.getRootBlock()!==a?void 0:$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_STACK};
400
- getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD){return a.inputList.filter(c=>c.isVisible()).map(c=>c.getLabel(b))};
400
+ getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD){return a.inputList.filter(c=>c.isVisible()).map(c=>c.getAriaLabelText()!==null?c.getAriaLabelText():c.getLabel(b))};
401
401
  getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b,c=Verbosity$$module$build$src$core$utils$aria.STANDARD){var d=a.inputList.indexOf(b);if(d===-1)throw Error(`Input with name "${b.name}" not found on block with id "${a.id}".`);b=b.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?findStartOfStatementSection$$module$build$src$core$block_aria_composer(a.inputList,d):d;return a.inputList.slice(b,d+1).filter(e=>e.isVisible()).map(e=>e.getLabel(c)||$.Msg$$module$build$src$core$msg.INPUT_LABEL_INDEX.replace("%1",
402
402
  (e.getIndex()+1).toString()))};findStartOfStatementSection$$module$build$src$core$block_aria_composer=function(a,b){for(--b;b>=0;b--)if(a[b].type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT)return b+1;return 0};
403
403
  getParentToolboxCategoryLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.workspace.getToolbox();if(b){var c=void 0;for(let d of b.getToolboxItems()){if(!isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(d))continue;b=d.getContents();if(Array.isArray(b)&&b.some(e=>e.kind.toLowerCase()==="block"&&"type"in e&&e.type===a.type)){c=d;break}"getColour"in d&&typeof d.getColour==="function"&&d.getColour()===a.getColour()&&(c=d)}if(c)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_TOOLBOX_CATEGORY.replace("%1",
@@ -1708,7 +1708,7 @@ f;d=b+h*d;e=c+h*e;h=b+n*m;let p=c+n*k;b-=n*m;c-=n*k;k=toRadians$$module$build$sr
1708
1708
  " "+b+","+c)}a.push("z");var l;(l=this.tail)==null||l.setAttribute("d",a.join(" "))}bringToFront(){var a,b=(a=this.svgRoot)==null?void 0:a.parentNode;return this.svgRoot&&(b==null?void 0:b.lastChild)!==this.svgRoot?(b==null||b.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getBoundingRectangle(){var a=
1709
1709
  this.getRelativeToSurfaceXY();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.size.height,a.x,a.x+this.size.width)}getSvgRoot(){return this.svgRoot}moveDuringDrag(a){this.moveTo(a.x,a.y);this.relativeLeft=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x-this.anchor.x;this.relativeTop=a.y-this.anchor.y;this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){return this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
1710
1710
  this.bringToFront();var a=this.getRelativeToSurfaceXY(),b=this.getSize();a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+b.height,a.x,a.x+b.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}getOwner(){return this.owner}recomputeAriaContext(){var a=this.getFocusableElement();if(a){setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.GROUP);var b,c=(b=this.getAriaLabel())==null?void 0:b.trim();setState$$module$build$src$core$utils$aria(a,
1711
- State$$module$build$src$core$utils$aria.LABEL,c?c:"Bubble")}}setAriaLabelProvider(a){this.ariaLabelProvider=a}getAriaLabel(){if(this.ariaLabelProvider){if(typeof this.ariaLabelProvider==="string")return this.ariaLabelProvider;if(typeof this.ariaLabelProvider==="function")return this.ariaLabelProvider(this)}return null}};_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;
1711
+ State$$module$build$src$core$utils$aria.LABEL,c?c:"Bubble")}}setAriaLabelProvider(a){this.ariaLabelProvider=a;this.recomputeAriaContext()}getAriaLabel(){if(this.ariaLabelProvider){if(typeof this.ariaLabelProvider==="string")return this.ariaLabelProvider;if(typeof this.ariaLabelProvider==="function")return this.ariaLabelProvider(this)}return null}};_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;
1712
1712
  Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2;Bubble$$module$build$src$core$bubbles$bubble.MIN_SIZE=_a$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;Bubble$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS=1;Bubble$$module$build$src$core$bubbles$bubble.TAIL_ANGLE=20;Bubble$$module$build$src$core$bubbles$bubble.TAIL_BEND=4;Bubble$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS=8;
1713
1713
  var module$build$src$core$bubbles$bubble={};module$build$src$core$bubbles$bubble.Bubble=Bubble$$module$build$src$core$bubbles$bubble;var MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d,e){super(b,c,d,void 0,e);this.workspace=b;this.anchor=c;this.ownerRect=d;this.owner=e;this.autoLayout=!0;b=new Options$$module$build$src$core$options(a);this.validateWorkspaceOptions(b);this.svgDialog=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,
1714
1714
  y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},this.contentContainer);a.parentWorkspace=this.workspace;this.miniWorkspace=this.newWorkspaceSvg(new Options$$module$build$src$core$options(a));this.miniWorkspace.internalIsMutator=!0;a=this.miniWorkspace.createDom("blocklyMutatorBackground");this.svgDialog.appendChild(a);b.languageTree&&(a.insertBefore(this.miniWorkspace.addFlyout(Svg$$module$build$src$core$utils$svg.G),this.miniWorkspace.getCanvas()),a=this.miniWorkspace.getFlyout(),a==
@@ -1720,38 +1720,40 @@ this.miniWorkspace.setCachedParentSvgSize(b.width,b.height),this.miniWorkspace.R
1720
1720
  b=a.width+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;a=a.height+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;var c=this.miniWorkspace.getFlyout();if(c){let d=c.getWorkspace().getMetricsManager().getScrollMetrics();a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());var b;if(a=(b=this.miniWorkspace.getFlyout())==
1721
1721
  null?void 0:b.getWorkspace())for(let c of a.getAllBlocks(!1))c.setStyle(c.getStyleName())}moveDuringDrag(a){super.moveDuringDrag(a);this.autoLayout=!1}moveTo(a,b){super.moveTo(a,b);this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(a){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts");}performAction(){$.getFocusManager$$module$build$src$core$focus_manager().focusTree(this.getWorkspace())}};
1722
1722
  MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER*3;var module$build$src$core$bubbles$mini_workspace_bubble={};module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
1723
- {"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,0)}setTooltip(a){this.tooltip=
1724
- a!=null?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){var a;
1723
+ {"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);this.recomputeAriaContext()}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,
1724
+ 0)}setTooltip(a){this.tooltip=a!=null?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){var a;
1725
1725
  (a=this.svgRoot)==null||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){var a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){var a=this.sourceBlock.getBoundingRectangle();
1726
1726
  a=new Rect$$module$build$src$core$utils$rect(a.top+this.offsetInBlock.y,a.top+this.offsetInBlock.y+this.getSize().height,a.left+this.offsetInBlock.x,a.left+this.offsetInBlock.x+this.getSize().width);this.sourceBlock.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}performAction(){this.onClick();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.bubbleIsVisible()){let a=this.getBubble();
1727
- a&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}})}getSourceBlock(){return this.sourceBlock}showContextMenu(a){this.getSourceBlock().showContextMenu(a)}},module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
1727
+ a&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}})}getSourceBlock(){return this.sourceBlock}showContextMenu(a){this.getSourceBlock().showContextMenu(a)}recomputeAriaContext(){var a=this.getFocusableElement();if(a){setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.BUTTON);var b,c=(b=this.getAriaLabel())!=null?b:$.Msg$$module$build$src$core$msg.ICON_LABEL_DEFAULT;setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
1728
+ c)}}getAriaLabel(){return null}},module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
1728
1729
  $.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a,b){super(b);this.flyoutBlockTypes=a;this.sourceBlock=b;this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconShape",
1729
1730
  rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
1730
1731
  this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMutatorIcon"))}dispose(){super.dispose();var a;(a=this.miniWorkspaceBubble)==null||a.dispose()}getWeight(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$mutator_icon,
1731
1732
  SIZE$$module$build$src$core$icons$mutator_icon)}applyColour(){super.applyColour();var a;(a=this.miniWorkspaceBubble)==null||a.setColour(this.sourceBlock.getColour());var b;(b=this.miniWorkspaceBubble)==null||b.updateBlockStyles()}updateCollapsed(){super.updateCollapsed();this.sourceBlock.isCollapsed()&&this.setBubbleVisible(!1)}onLocationChange(a){super.onLocationChange(a);var b;(b=this.miniWorkspaceBubble)==null||b.setAnchorLocation(this.getAnchorLocation())}onClick(){super.onClick();this.sourceBlock.isEditable()&&
1732
1733
  this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.miniWorkspaceBubble}setBubbleVisible(a){var b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(b.bubbleIsVisible()!==a){yield finishQueuedRenders$$module$build$src$core$render_management();if(a){b.miniWorkspaceBubble=new MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble(b.getMiniWorkspaceConfig(),b.sourceBlock.workspace,b.getAnchorLocation(),
1733
- b.getBubbleOwnerRect(),b);b.applyColour();b.createRootBlock();b.addSaveConnectionsListener();let c;(c=b.miniWorkspaceBubble)==null||c.addWorkspaceChangeListener(b.createMiniWorkspaceChangeListener())}else{let c;(c=b.miniWorkspaceBubble)==null||c.dispose();b.miniWorkspaceBubble=null;b.saveConnectionsListener&&b.sourceBlock.workspace.removeChangeListener(b.saveConnectionsListener);b.saveConnectionsListener=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,
1734
- a,"mutator"))}})}getBubble(){return this.miniWorkspaceBubble}getMiniWorkspaceConfig(){var a,b={disable:!1,media:this.sourceBlock.workspace.options.pathToMedia,rtl:this.sourceBlock.RTL,renderer:this.sourceBlock.workspace.options.renderer,rendererOverrides:(a=this.sourceBlock.workspace.options.rendererOverrides)!=null?a:void 0};this.flyoutBlockTypes.length&&(b.toolbox={kind:"flyoutToolbox",contents:this.flyoutBlockTypes.map(c=>({kind:"block",type:c}))});return b}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$mutator_icon/
1735
- 2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){var a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());
1736
- for(var a of this.rootBlock.getDescendants(!1))a.queueRender();this.rootBlock.setMovable(!1);this.rootBlock.setDeletable(!1);var b,c,d,e;a=(e=(b=this.miniWorkspaceBubble)==null?void 0:(c=b.getWorkspace())==null?void 0:(d=c.getFlyout())==null?void 0:d.getWidth())!=null?e:0;this.rootBlock.moveBy(this.rootBlock.RTL?-(a+WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon):WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&
1737
- this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return a=>{$.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(a)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null;this.recomposeSourceBlock()},
1738
- 0))}}static isIgnorableMutatorEvent(a){return a.isUiEvent||isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)&&a.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);
1739
- this.sourceBlock.compose(this.rootBlock);var c=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);b!==c&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,b,c));$.setGroup$$module$build$src$core$events$utils(a)}}getWorkspace(){var a;return(a=this.miniWorkspaceBubble)==null?void 0:a.getWorkspace()}};
1740
- $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.MUTATOR;$.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1;var module$build$src$core$icons$mutator_icon={};module$build$src$core$icons$mutator_icon.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;var allExtensions$$module$build$src$core$extensions=Object.create(null),TEST_ONLY$$module$build$src$core$extensions={allExtensions:allExtensions$$module$build$src$core$extensions};$.register$$module$build$src$core$extensions("parent_tooltip_when_inline",extensionParentTooltip$$module$build$src$core$extensions);var module$build$src$core$extensions={TEST_ONLY:TEST_ONLY$$module$build$src$core$extensions};module$build$src$core$extensions.apply=apply$$module$build$src$core$extensions;
1734
+ b.getBubbleOwnerRect(),b);b.applyColour();b.createRootBlock();b.addSaveConnectionsListener();let c;(c=b.miniWorkspaceBubble)==null||c.addWorkspaceChangeListener(b.createMiniWorkspaceChangeListener());b.miniWorkspaceBubble.setAriaLabelProvider($.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE)}else{let c;(c=b.miniWorkspaceBubble)==null||c.dispose();b.miniWorkspaceBubble=null;b.saveConnectionsListener&&b.sourceBlock.workspace.removeChangeListener(b.saveConnectionsListener);b.saveConnectionsListener=
1735
+ null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"mutator"));b.recomputeAriaContext()}})}getBubble(){return this.miniWorkspaceBubble}getMiniWorkspaceConfig(){var a,b={disable:!1,media:this.sourceBlock.workspace.options.pathToMedia,rtl:this.sourceBlock.RTL,renderer:this.sourceBlock.workspace.options.renderer,rendererOverrides:(a=this.sourceBlock.workspace.options.rendererOverrides)!=
1736
+ null?a:void 0};this.flyoutBlockTypes.length&&(b.toolbox={kind:"flyoutToolbox",contents:this.flyoutBlockTypes.map(c=>({kind:"block",type:c}))});return b}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$mutator_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){var a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,
1737
+ a.x,a.x+a.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var a of this.rootBlock.getDescendants(!1))a.queueRender();this.rootBlock.setMovable(!1);this.rootBlock.setDeletable(!1);var b,c,d,e;a=(e=(b=this.miniWorkspaceBubble)==null?void 0:(c=b.getWorkspace())==null?void 0:(d=c.getFlyout())==null?void 0:d.getWidth())!=null?e:0;this.rootBlock.moveBy(this.rootBlock.RTL?
1738
+ -(a+WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon):WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return a=>
1739
+ {$.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(a)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null;this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(a){return a.isUiEvent||isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)&&a.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");
1740
+ var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var c=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);b!==c&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,
1741
+ "mutation",null,b,c));$.setGroup$$module$build$src$core$events$utils(a)}}getWorkspace(){var a;return(a=this.miniWorkspaceBubble)==null?void 0:a.getWorkspace()}getAriaLabel(){return this.bubbleIsVisible()?$.Msg$$module$build$src$core$msg.ICON_LABEL_MUTATOR_OPEN:$.Msg$$module$build$src$core$msg.ICON_LABEL_MUTATOR_CLOSED}};$.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.MUTATOR;
1742
+ $.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1;var module$build$src$core$icons$mutator_icon={};module$build$src$core$icons$mutator_icon.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;var allExtensions$$module$build$src$core$extensions=Object.create(null),TEST_ONLY$$module$build$src$core$extensions={allExtensions:allExtensions$$module$build$src$core$extensions};$.register$$module$build$src$core$extensions("parent_tooltip_when_inline",extensionParentTooltip$$module$build$src$core$extensions);var module$build$src$core$extensions={TEST_ONLY:TEST_ONLY$$module$build$src$core$extensions};module$build$src$core$extensions.apply=apply$$module$build$src$core$extensions;
1741
1743
  module$build$src$core$extensions.buildTooltipForDropdown=$.buildTooltipForDropdown$$module$build$src$core$extensions;module$build$src$core$extensions.buildTooltipWithFieldText=$.buildTooltipWithFieldText$$module$build$src$core$extensions;module$build$src$core$extensions.isRegistered=isRegistered$$module$build$src$core$extensions;module$build$src$core$extensions.register=$.register$$module$build$src$core$extensions;module$build$src$core$extensions.registerMixin=$.registerMixin$$module$build$src$core$extensions;
1742
1744
  module$build$src$core$extensions.registerMutator=$.registerMutator$$module$build$src$core$extensions;module$build$src$core$extensions.runAfterPageLoad=runAfterPageLoad$$module$build$src$core$extensions;module$build$src$core$extensions.unregister=unregister$$module$build$src$core$extensions;var module$build$src$core$utils$svg_paths={};module$build$src$core$utils$svg_paths.arc=arc$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.curve=curve$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.line=line$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineOnAxis=lineOnAxis$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineTo=lineTo$$module$build$src$core$utils$svg_paths;
1743
1745
  module$build$src$core$utils$svg_paths.moveBy=moveBy$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.moveTo=moveTo$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.point=point$$module$build$src$core$utils$svg_paths;var module$build$src$core$utils={};module$build$src$core$utils.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;module$build$src$core$utils.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;module$build$src$core$utils.Rect=Rect$$module$build$src$core$utils$rect;module$build$src$core$utils.Size=Size$$module$build$src$core$utils$size;module$build$src$core$utils.Svg=Svg$$module$build$src$core$utils$svg;module$build$src$core$utils.aria=module$build$src$core$utils$aria;
1744
1746
  module$build$src$core$utils.array=module$build$src$core$utils$array;module$build$src$core$utils.browserEvents=module$build$src$core$browser_events;module$build$src$core$utils.colour=module$build$src$core$utils$colour;module$build$src$core$utils.deprecation=module$build$src$core$utils$deprecation;module$build$src$core$utils.dom=module$build$src$core$utils$dom;module$build$src$core$utils.extensions=module$build$src$core$extensions;module$build$src$core$utils.idGenerator=module$build$src$core$utils$idgenerator;
1745
1747
  module$build$src$core$utils.math=module$build$src$core$utils$math;module$build$src$core$utils.object=module$build$src$core$utils$object;module$build$src$core$utils.parsing=module$build$src$core$utils$parsing;module$build$src$core$utils.string=module$build$src$core$utils$string;module$build$src$core$utils.style=module$build$src$core$utils$style;module$build$src$core$utils.svgMath=module$build$src$core$utils$svg_math;module$build$src$core$utils.svgPaths=module$build$src$core$utils$svg_paths;
1746
1748
  module$build$src$core$utils.toolbox=module$build$src$core$utils$toolbox;module$build$src$core$utils.userAgent=module$build$src$core$utils$useragent;module$build$src$core$utils.xml=module$build$src$core$utils$xml;var TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(a,b,c,void 0,d);this.workspace=a;this.anchor=b;this.ownerRect=c;this.owner=d;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.sizeChangeListeners=[];this.locationChangeListeners=[];this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);
1747
- this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.editable=!0;addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");this.editor=new CommentEditor$$module$build$src$core$comments$comment_editor(a,this.id,()=>{$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)});this.contentContainer.appendChild(this.editor.getDom());
1748
- this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.editor.getText()}setText(a){this.editor.setText(a)}setEditable(a){this.editable=a;this.editor.setEditable(a)}isEditable(){return this.editable}addTextChangeListener(a){this.editor.addTextChangeListener(a)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}addLocationChangeListener(a){this.locationChangeListeners.push(a)}createResizeHandle(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
1749
- {"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height=Math.max(a.height,this.MIN_SIZE.height);var c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;this.editor.updateSize(new Size$$module$build$src$core$utils$size(c,
1750
- d),new Size$$module$build$src$core$utils$size(0,0));this.editor.getDom().setAttribute("x",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.editor.getDom().setAttribute("y",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a);
1751
- this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);this.onLocationChange()}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,
1752
- this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),
1753
- this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onSizeChange(){for(let a of this.sizeChangeListeners)a()}onLocationChange(){for(let a of this.locationChangeListeners)a()}getEditor(){return this.editor}performAction(){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.getEditor())}};
1754
- register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");var module$build$src$core$bubbles$textinput_bubble={};module$build$src$core$bubbles$textinput_bubble.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var ConnectionDB$$module$build$src$core$connection_db=class{constructor(a){this.connectionChecker=a;this.connections=[]}addConnection(a,b){b=this.calculateIndexForYPos(b);this.connections.splice(b,0,a)}findIndexOfConnection(a,b){if(!this.connections.length)return-1;var c=this.calculateIndexForYPos(b);if(c>=this.connections.length)return-1;b=a.y;for(var d=c;d>=0&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;d<this.connections.length&&this.connections[d].y===b;){if(this.connections[d]===
1749
+ this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.editable=!0;this.textChangeListener=()=>{this.recomputeAriaContext()};addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");this.editor=new CommentEditor$$module$build$src$core$comments$comment_editor(a,this.id,()=>{$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)});
1750
+ this.contentContainer.appendChild(this.editor.getDom());this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAULT_SIZE,!0);this.addTextChangeListener(this.textChangeListener)}getText(){return this.editor.getText()}setText(a){this.editor.setText(a)}setEditable(a){this.editable=a;this.editor.setEditable(a)}isEditable(){return this.editable}addTextChangeListener(a){this.editor.addTextChangeListener(a)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}addLocationChangeListener(a){this.locationChangeListeners.push(a)}createResizeHandle(a,
1751
+ b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height=Math.max(a.height,this.MIN_SIZE.height);var c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;
1752
+ this.editor.updateSize(new Size$$module$build$src$core$utils$size(c,d),new Size$$module$build$src$core$utils$size(0,0));this.editor.getDom().setAttribute("x",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.editor.getDom().setAttribute("y",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",
1753
+ `${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a);this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);this.onLocationChange()}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,
1754
+ a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();
1755
+ this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onSizeChange(){for(let a of this.sizeChangeListeners)a()}onLocationChange(){for(let a of this.locationChangeListeners)a()}getEditor(){return this.editor}performAction(){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.getEditor())}dispose(){super.dispose();
1756
+ this.editor.removeTextChangeListener(this.textChangeListener)}};register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");var module$build$src$core$bubbles$textinput_bubble={};module$build$src$core$bubbles$textinput_bubble.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var ConnectionDB$$module$build$src$core$connection_db=class{constructor(a){this.connectionChecker=a;this.connections=[]}addConnection(a,b){b=this.calculateIndexForYPos(b);this.connections.splice(b,0,a)}findIndexOfConnection(a,b){if(!this.connections.length)return-1;var c=this.calculateIndexForYPos(b);if(c>=this.connections.length)return-1;b=a.y;for(var d=c;d>=0&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;d<this.connections.length&&this.connections[d].y===b;){if(this.connections[d]===
1755
1757
  a)return d;d++}return-1}calculateIndexForYPos(a){if(!this.connections.length)return 0;for(var b=0,c=this.connections.length;b<c;){let d=Math.floor((b+c)/2);if(this.connections[d].y<a)b=d+1;else if(this.connections[d].y>a)c=d;else{b=d;break}}return b}removeConnection(a,b){a=this.findIndexOfConnection(a,b);if(a===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(a,1)}getNeighbours(a,b){function c(l){var m=e-d[l].x,n=f-d[l].y;Math.sqrt(m*m+n*n)<=b&&k.push(d[l]);return n<
1756
1758
  b}var d=this.connections,e=a.x,f=a.y;a=0;for(var g=d.length-2,h=g;a<h;)d[h].y<f?a=h:g=h,h=Math.floor((a+g)/2);var k=[];g=a=h;if(d.length){for(;a>=0&&c(a);)a--;do g++;while(g<d.length&&c(g))}return k}isInYRange(a,b,c){return Math.abs(this.connections[a].y-b)<=c}searchForClosest(a,b,c){if(!this.connections.length)return{connection:null,radius:b};var d=a.y,e=a.x;a.x=e+c.x;a.y=d+c.y;var f=this.calculateIndexForYPos(a.y);c=null;for(var g=b,h,k=f-1;k>=0&&this.isInYRange(k,a.y,b);)h=this.connections[k],
1757
1759
  this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),k--;for(;f<this.connections.length&&this.isInYRange(f,a.y,b);)h=this.connections[f],this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),f++;a.x=e;a.y=d;return{connection:c,radius:g}}static init(a){var b=[];b[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);
@@ -1790,13 +1792,14 @@ f.updateDisabled();f.queueRender();f.getSvgRoot().style.display="block";$.setGro
1790
1792
  this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){super.setCheck(a);this.sourceBlock_.queueRender();return this}showContextMenu(a){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({focusedNode:this},a);if(b.length){var c=this.getSourceBlock(),d=c.workspace;if(a instanceof PointerEvent)var e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
1791
1793
  a.clientY);else e=new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y),e=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(d,e).translate(c.RTL?-5:5,5);show$$module$build$src$core$contextmenu(a,b,c.RTL,d,e)}}getFocusableElement(){var a=this.findHighlightSvg();if(a)return a;throw Error("No highlight SVG found corresponding to this connection.");}getFocusableTree(){return this.getSourceBlock().workspace}onNodeFocus(){this.highlight();this.getSourceBlock().workspace.scrollBoundsIntoView(this.getSourceBlock().getBoundingRectangleWithoutChildren())}onNodeBlur(){this.unhighlight()}canBeFocused(){return!0}findHighlightSvg(){return document.getElementById(this.id)}};
1792
1794
  (function(a){a=a.TrackedState||(a.TrackedState={});a[a.WILL_TRACK=-1]="WILL_TRACK";a[a.UNTRACKED=0]="UNTRACKED";a[a.TRACKED=1]="TRACKED"})(RenderedConnection$$module$build$src$core$rendered_connection||(RenderedConnection$$module$build$src$core$rendered_connection={}));var TrackedState$$module$build$src$core$rendered_connection=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState,module$build$src$core$rendered_connection={};
1793
- module$build$src$core$rendered_connection.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$rendered_connection.TrackedState=TrackedState$$module$build$src$core$rendered_connection;var Input$$module$build$src$core$inputs$input=class{constructor(a,b){this.name=a;this.sourceBlock=b;this.fieldRow=[];this.align=$.Align$$module$build$src$core$inputs$align.LEFT;this.visible=!0;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM;this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this}insertFieldAt(a,b,c){if(a<0||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!(b||
1794
- b===""&&c))return a;typeof b==="string"&&(b=$.fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock);this.sourceBlock.initialized&&this.initField(b);b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock.rendered&&this.sourceBlock.queueRender();return a}removeField(a,b){for(let c=0,d;d=this.fieldRow[c];c++)if(d.name===
1795
- a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');}isVisible(){return this.visible}setVisible(a){var b=[];if(this.visible===a)return b;this.visible=a;for(let c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);if(this.connection&&this.connection instanceof RenderedConnection$$module$build$src$core$rendered_connection){a?b=this.connection.startTrackingAll():this.connection.stopTrackingAll();let c=
1796
- this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");
1797
- return this.connection.getShadowDom()}init(){for(let a of this.fieldRow)a.init()}initModel(){for(let a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){var a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();var b=a.indexOf(this),c,d=((c=a[b-1].connection)==
1798
- null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,e;return!this.getSourceBlock().getInputsInline()||((e=this.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD){if(!this.isVisible())return"";var b=computeFieldRowLabel$$module$build$src$core$block_aria_composer(this,!1,a),c;((c=this.connection)==
1799
- null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&(c=this.connection.targetBlock())&&!c.isInsertionMarker()&&b.push(getInputLabels$$module$build$src$core$block_aria_composer(c,a).join(" "));return b.join(" ")}getIndex(){return this.getSourceBlock().inputList.indexOf(this)}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={};
1795
+ module$build$src$core$rendered_connection.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$rendered_connection.TrackedState=TrackedState$$module$build$src$core$rendered_connection;var Input$$module$build$src$core$inputs$input=class{constructor(a,b){this.name=a;this.sourceBlock=b;this.fieldRow=[];this.align=$.Align$$module$build$src$core$inputs$align.LEFT;this.visible=!0;this.ariaLabelProvider=null;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM;this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this}insertFieldAt(a,b,c){if(a<0||a>this.fieldRow.length)throw Error("index "+
1796
+ a+" out of bounds.");if(!(b||b===""&&c))return a;typeof b==="string"&&(b=$.fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock);this.sourceBlock.initialized&&this.initField(b);b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock.rendered&&this.sourceBlock.queueRender();return a}removeField(a,b){for(let c=
1797
+ 0,d;d=this.fieldRow[c];c++)if(d.name===a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');}isVisible(){return this.visible}setVisible(a){var b=[];if(this.visible===a)return b;this.visible=a;for(let c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);if(this.connection&&this.connection instanceof RenderedConnection$$module$build$src$core$rendered_connection){a?b=this.connection.startTrackingAll():
1798
+ this.connection.stopTrackingAll();let c=this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");
1799
+ this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){for(let a of this.fieldRow)a.init()}setAriaLabelProvider(a){this.ariaLabelProvider=a}getAriaLabelText(){return this.ariaLabelProvider?typeof this.ariaLabelProvider==="string"?replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaLabelProvider):this.ariaLabelProvider(this):null}initModel(){for(let a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?
1800
+ a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){var a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();var b=a.indexOf(this),c,d=((c=a[b-1].connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,e;return!this.getSourceBlock().getInputsInline()||((e=this.connection)==
1801
+ null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}getLabel(a=Verbosity$$module$build$src$core$utils$aria.STANDARD){if(!this.isVisible())return"";var b=computeFieldRowLabel$$module$build$src$core$block_aria_composer(this,!1,a),c;((c=this.connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&(c=this.connection.targetBlock())&&!c.isInsertionMarker()&&b.push(getInputLabels$$module$build$src$core$block_aria_composer(c,
1802
+ a).join(" "));return b.join(" ")}getIndex(){return this.getSourceBlock().inputList.indexOf(this)}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={};
1800
1803
  module$build$src$core$inputs$statement_input.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;var module$build$src$core$inputs$value_input;$.ValueInput$$module$build$src$core$inputs$value_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Value inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.VALUE;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE)}};module$build$src$core$inputs$value_input={};
1801
1804
  module$build$src$core$inputs$value_input.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;var module$build$src$core$interfaces$i_icon={};module$build$src$core$interfaces$i_icon.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;var module$build$src$core$interfaces$i_comment_icon={};module$build$src$core$interfaces$i_comment_icon.isCommentIcon=isCommentIcon$$module$build$src$core$interfaces$i_comment_icon;var Block$$module$build$src$core$block=class{constructor(a,b,c){this.data=null;this.disposed=!1;this.hue=null;this.colour_="#000000";this.styleName_="";this.suppressPrefixSuffix=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.icons=[];this.disabledReasons=new Set;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable=this.movable=this.deletable=!0;this.collapsed_=this.shadow=!1;this.outputShape_=null;this.rendered=
1802
1805
  this.isInsertionMarker_=this.initialized=this.disposing=!1;this.onchangeWrapper=this.helpUrl=null;this.statementInputCount=0;this.workspace=a;this.id=c&&!a.getBlockById(c)?c:genUid$$module$build$src$core$utils$idgenerator();a.setBlockById(this.id,this);this.xy=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.isInFlyout=a.isFlyout;this.isInMutator=a.isMutator;this.RTL=a.RTL;if(b){this.type=b;c=Blocks$$module$build$src$core$blocks[b];if(!c||typeof c!=="object")throw TypeError("Invalid block definition for type: "+
@@ -1834,11 +1837,11 @@ if(!b){b=[];for(let c in a)this[c]!==void 0&&b.push(c);if(b.length)throw Error("
1834
1837
  f.name])}validateTokens(a,b){var c=[],d=0;for(let e=0;e<a.length;e++){let f=a[e];if(typeof f==="number"){if(f<1||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");}interpolateArguments(a,b,c){var d=[];for(let f=0;f<a.length;f++){var e=a[f];typeof e==="number"&&(e=b[e-1]);if(typeof e==="string")if(e===
1835
1838
  "\n")e={type:"input_end_row"},c&&(e.align=c);else if(e=this.stringToFieldJson(e),!e)continue;d.push(e)}(a=d.length)&&!this.isInputKeyword(d[a-1].type)&&(a={type:"input_dummy"},c&&(a.align=c),d.push(a));return d}fieldFromJson(a){var b=$.fromJson$$module$build$src$core$field_registry(a);return!b&&a.alt?typeof a.alt==="string"?(a=this.stringToFieldJson(a.alt))?this.fieldFromJson(a):null:this.fieldFromJson(a.alt):b}inputFromJson(a,b){var c={LEFT:$.Align$$module$build$src$core$inputs$align.LEFT,RIGHT:$.Align$$module$build$src$core$inputs$align.RIGHT,
1836
1839
  CENTRE:$.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:$.Align$$module$build$src$core$inputs$align.CENTRE};switch(a.type){case "input_value":var d=this.appendValueInput(a.name);break;case "input_statement":d=this.appendStatementInput(a.name);break;case "input_dummy":d=this.appendDummyInput(a.name);break;case "input_end_row":d=this.appendEndRowInput(a.name);break;default:d=this.appendInputFromRegistry(a.type,a.name)}if(!d)return null;a.check&&d.setCheck(a.check);a.align&&(c=c[a.align.toUpperCase()],
1837
- c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a)}stringToFieldJson(a){return(a=a.trim())?{type:"field_label",text:a}:null}moveInputBefore(a,b){if(a!==b){var c=-1,d=b?-1:this.inputList.length;for(let e=0,f;f=this.inputList[e];e++)if(f.name===a){if(c=e,d!==-1)break}else if(b&&
1838
- f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,1);a<b&&b--;this.inputList.splice(b,
1839
- 0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===a)return c;return null}getInputTargetBlock(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()}getCommentText(){var a,b;return(b=(a=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==
1840
- null?void 0:a.getText())!=null?b:null}setCommentText(a){var b,c,d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);if(!b){b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,IconType$$module$build$src$core$icons$icon_types.COMMENT.toString(),!1);if(!b)throw Error("No comment icon class is registered, so a comment cannot be set");
1841
- b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a);$.enable$$module$build$src$core$events$utils()}else this.removeIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,
1840
+ c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));a.ariaLabelText&&d.setAriaLabelProvider(a.ariaLabelText);return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a)}stringToFieldJson(a){return(a=a.trim())?{type:"field_label",text:a}:null}moveInputBefore(a,b){if(a!==b){var c=-1,d=b?-1:this.inputList.length;for(let e=0,f;f=this.inputList[e];e++)if(f.name===
1841
+ a){if(c=e,d!==-1)break}else if(b&&f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");var c=this.inputList[a];this.inputList.splice(a,
1842
+ 1);a<b&&b--;this.inputList.splice(b,0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===a)return c;return null}getInputTargetBlock(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()}getCommentText(){var a,
1843
+ b;return(b=(a=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:a.getText())!=null?b:null}setCommentText(a){var b,c,d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);if(!b){b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,IconType$$module$build$src$core$icons$icon_types.COMMENT.toString(),
1844
+ !1);if(!b)throw Error("No comment icon class is registered, so a comment cannot be set");b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a);$.enable$$module$build$src$core$events$utils()}else this.removeIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,
1842
1845
  "comment",null,d,a))}}setWarningText(a,b){}setMutator(a){}addIcon(a){if(this.hasIcon(a.getType()))throw new DuplicateIconType$$module$build$src$core$icons$exceptions(a);this.icons.push(a);this.icons.sort((b,c)=>b.getWeight()-c.getWeight());return a}removeIcon(a){if(!this.hasIcon(a))return!1;var b;(b=this.getIcon(a))==null||b.dispose();this.icons=this.icons.filter(c=>!c.getType().equals(a));return!0}hasIcon(a){return this.icons.some(b=>b.getType().equals(a))}getIcon(a){return a instanceof IconType$$module$build$src$core$icons$icon_types?
1843
1846
  this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this);c&&d.setReason(c);this.xy.translate(a,b);d.recordNew();fire$$module$build$src$core$events$utils(d)}makeConnection_(a){return new Connection$$module$build$src$core$connection(this,
1844
1847
  a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++){if(!d.connection)continue;var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=this.getNextBlock())?b.allInputsFilled(a):!0}toDevString(){var a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a}};Block$$module$build$src$core$block.COLLAPSED_INPUT_NAME=COLLAPSED_INPUT_NAME$$module$build$src$core$constants;
@@ -1889,9 +1892,9 @@ this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size
1889
1892
  this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyWarningIcon"))}dispose(){super.dispose();var a;(a=this.textBubble)==null||
1890
1893
  a.dispose()}getWeight(){return WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$warning_icon,SIZE$$module$build$src$core$icons$warning_icon)}applyColour(){super.applyColour();var a;(a=this.textBubble)==null||a.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(a){super.onLocationChange(a);var b;(b=this.textBubble)==null||b.setAnchorLocation(this.getAnchorLocation())}addMessage(a,
1891
1894
  b){if(this.textMap.get(b)===a)return this;a?this.textMap.set(b,a):this.textMap.delete(b);var c;(c=this.textBubble)==null||c.setText(this.getText());return this}getText(){return[...this.textMap.values()].join("\n")}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(a){var b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(b.bubbleIsVisible()!==a){yield finishQueuedRenders$$module$build$src$core$render_management();
1892
- if(a)b.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(b.getText(),b.sourceBlock.workspace,b.getAnchorLocation(),b.getBubbleOwnerRect(),b),b.applyColour();else{let c;(c=b.textBubble)==null||c.dispose();b.textBubble=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"warning"))}})}getBubble(){return this.textBubble}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$warning_icon/
1893
- 2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){var a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}};WarningIcon$$module$build$src$core$icons$warning_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.WARNING;WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT=2;
1894
- var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);
1895
+ if(a)b.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(b.getText(),b.sourceBlock.workspace,b.getAnchorLocation(),b.getBubbleOwnerRect(),b),b.applyColour(),b.textBubble.setAriaLabelProvider(()=>$.Msg$$module$build$src$core$msg.BUBBLE_LABEL_WARNING.replace("%1",b.getText()));else{let c;(c=b.textBubble)==null||c.dispose();b.textBubble=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,
1896
+ a,"warning"));b.recomputeAriaContext()}})}getBubble(){return this.textBubble}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$warning_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){var a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}getAriaLabel(){return this.bubbleIsVisible()?$.Msg$$module$build$src$core$msg.ICON_LABEL_WARNING_OPEN:
1897
+ $.Msg$$module$build$src$core$msg.ICON_LABEL_WARNING_CLOSED}};WarningIcon$$module$build$src$core$icons$warning_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.WARNING;WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT=2;var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);
1895
1898
  if(!a.rendered)throw TypeError("Cannot create a rendered block in a headless workspace");this.workspace=a;this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});b&&addClass$$module$build$src$core$utils$dom(this.svgGroup,b);this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup,this.style);a=this.pathObject.svgPath;a.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(a);
1896
1899
  this.svgGroup.setAttribute("data-id",this.id);a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.doInit_()}initSvg(){if(!this.initialized){for(var a of this.inputList)a.init();for(let b of this.getIcons())b.initView(this.createIconPointerDownListener(b)),b.updateEditable();this.applyColour();this.pathObject.updateMovable(this.isMovable()||this.isInFlyout);(a=this.getSvgRoot())&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown);a.parentNode||
1897
1900
  this.workspace.getCanvas().appendChild(a);this.recomputeAriaAttributes();this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){this.addSelect();fireSelectedEvent$$module$build$src$core$common(this)}unselect(){this.removeSelect();fireSelectedEvent$$module$build$src$core$common(null)}setParent(a){var b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();
@@ -2058,11 +2061,11 @@ a;var b;(b=this.textInputBubble)==null||b.setSize(this.bubbleSize,!0)}getBubbleS
2058
2061
  this.bubbleSize.width):b.x,a.y=b.y);return a}return null}loadState(a){var b;this.text=(b=a.text)!=null?b:"";var c,d;this.bubbleSize=new Size$$module$build$src$core$utils$size((c=a.width)!=null?c:DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,(d=a.height)!=null?d:DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon);var e;this.bubbleVisiblity=(e=a.pinned)!=null?e:!1;this.setBubbleVisible(this.bubbleVisiblity);var f=a.x,g=a.y;finishQueuedRenders$$module$build$src$core$render_management().then(()=>
2059
2062
  {f&&g&&(f=this.sourceBlock.workspace.RTL?this.sourceBlock.workspace.getWidth()-(f+this.bubbleSize.width):f,this.setBubbleLocation(new Coordinate$$module$build$src$core$utils$coordinate(f,g)))})}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var a=this.textInputBubble.getText();this.text!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,
2060
2063
  "comment",null,this.text,a)),this.text=a)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}onBubbleLocationChange(){this.textInputBubble&&(this.bubbleLocation=this.textInputBubble.getRelativeToSurfaceXY())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(a){var b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){b.bubbleVisiblity!==a&&(b.bubbleVisiblity=a,yield finishQueuedRenders$$module$build$src$core$render_management(),
2061
- !b.sourceBlock.rendered||b.sourceBlock.isInFlyout||b.sourceBlock.isInsertionMarker()||(a?(b.sourceBlock.isEditable()?b.showEditableBubble():b.showNonEditableBubble(),b.applyColour()):b.hideBubble(),fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"comment"))))})}getBubble(){return this.textInputBubble}showEditableBubble(){this.createBubble();var a;(a=this.textInputBubble)==null||a.addTextChangeListener(()=>
2062
- this.onTextChange());var b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();var a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.bubbleLocation&&
2063
- this.textInputBubble.moveDuringDrag(this.bubbleLocation);this.textInputBubble.addTextChangeListener(()=>this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange());this.textInputBubble.addLocationChangeListener(()=>this.onBubbleLocationChange())}hideBubble(){var a;(a=this.textInputBubble)==null||a.dispose();this.textInputBubble=null}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,
2064
- new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);
2065
- var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;
2064
+ !b.sourceBlock.rendered||b.sourceBlock.isInFlyout||b.sourceBlock.isInsertionMarker()||(a?(b.sourceBlock.isEditable()?b.showEditableBubble():b.showNonEditableBubble(),b.applyColour()):b.hideBubble(),fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"comment")),b.svgRoot&&b.recomputeAriaContext()))})}getBubble(){return this.textInputBubble}showEditableBubble(){this.createBubble();var a;(a=
2065
+ this.textInputBubble)==null||a.addTextChangeListener(()=>this.onTextChange());var b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();var a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,
2066
+ !0);this.bubbleLocation&&this.textInputBubble.moveDuringDrag(this.bubbleLocation);this.textInputBubble.addTextChangeListener(()=>this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange());this.textInputBubble.addLocationChangeListener(()=>this.onBubbleLocationChange());this.textInputBubble.setAriaLabelProvider(()=>$.Msg$$module$build$src$core$msg.BUBBLE_LABEL_COMMENT.replace("%1",this.getText()))}hideBubble(){var a;(a=this.textInputBubble)==null||a.dispose();this.textInputBubble=
2067
+ null}getAnchorLocation(){var a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}getAriaLabel(){return this.bubbleIsVisible()?$.Msg$$module$build$src$core$msg.ICON_LABEL_COMMENT_OPEN:$.Msg$$module$build$src$core$msg.ICON_LABEL_COMMENT_CLOSED}};
2068
+ CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;
2066
2069
  module$build$src$core$icons.exceptions=module$build$src$core$icons$exceptions;module$build$src$core$icons.registry=module$build$src$core$icons$registry;var module$build$src$core$interfaces$i_procedure_block={};module$build$src$core$interfaces$i_procedure_block.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;$.Names$$module$build$src$core$names=class{constructor(a,b){this.db=new Map;this.dbReverse=new Set;this.variableMap=null;this.variablePrefix=b||"";this.reservedWords=new Set(a?a.split(","):[])}reset(){this.db.clear();this.dbReverse.clear();this.variableMap=null}setVariableMap(a){this.variableMap=a}getNameForUserVariable(a){return this.variableMap?(a=this.variableMap.getVariableById(a))?a.getName():null:(console.warn("Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());"),
2067
2070
  null)}populateVariables(a){a=$.allUsedVarModels$$module$build$src$core$variables(a);for(let b=0;b<a.length;b++)this.getName(a[b].getId(),$.NameType$$module$build$src$core$names.VARIABLE)}populateProcedures(a){throw Error("The implementation of populateProcedures should be monkey-patched in by blockly.ts");}getName(a,b){var c=a;b===$.NameType$$module$build$src$core$names.VARIABLE&&(a=this.getNameForUserVariable(a))&&(c=a);a=c.toLowerCase();var d=b===$.NameType$$module$build$src$core$names.VARIABLE||
2068
2071
  b===$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE?this.variablePrefix:"";this.db.has(b)||this.db.set(b,new Map);var e=this.db.get(b);if(e.has(a))return d+e.get(a);b=this.getDistinctName(c,b);e.set(a,b.substr(d.length));return b}getUserNames(a){var b;return(a=(b=this.db.get(a))==null?void 0:b.keys())?Array.from(a):[]}getDistinctName(a,b){a=this.safeName(a);for(var c=null,d,e;this.dbReverse.has(a+((d=c)!=null?d:""))||this.reservedWords.has(a+((e=c)!=null?e:""));)c=c?c+1:2;var f;a+=(f=c)!=
@@ -2577,7 +2580,7 @@ null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEv
2577
2580
  b.isCollapsible())&&((c=this.selectedItem_)==null?void 0:c.isExpanded())!==a?(this.selectedItem_.toggleExpanded(),!0):!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");var a;(a=this.flyout)==null||a.dispose();this.contents.forEach(b=>b.dispose());for(a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));
2578
2581
  $.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return(b=this.getToolboxItems().find(c=>c.isSelectable()))!=null?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,
2579
2582
  b){a!==this?this.getSelectedItem()===a||this.mouseDown||this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){var b;a&&a===((b=this.flyout)==null?void 0:b.getWorkspace())||this.autoHide(!1)}getNavigator(){return this.navigator}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n box-sizing: border-box;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
2580
- register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.2",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
2583
+ register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="13.0.0-beta.3",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
2581
2584
  TOOLBOX_AT_TOP$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.TOP,TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.BOTTOM,TOOLBOX_AT_LEFT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.LEFT,TOOLBOX_AT_RIGHT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.RIGHT,svgResize$$module$build$src$core$blockly=svgResize$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$blockly=
2582
2585
  getMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$blockly=getSelected$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$blockly=defineBlocksWithJsonArray$$module$build$src$core$common,setParentContainer$$module$build$src$core$blockly=setParentContainer$$module$build$src$core$common,COLLAPSE_CHARS$$module$build$src$core$blockly=COLLAPSE_CHARS$$module$build$src$core$internal_constants,OPPOSITE_TYPE$$module$build$src$core$blockly=OPPOSITE_TYPE$$module$build$src$core$internal_constants,
2583
2586
  RENAME_VARIABLE_ID$$module$build$src$core$blockly=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants,DELETE_VARIABLE_ID$$module$build$src$core$blockly=DELETE_VARIABLE_ID$$module$build$src$core$internal_constants,COLLAPSED_INPUT_NAME$$module$build$src$core$blockly=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,COLLAPSED_FIELD_NAME$$module$build$src$core$blockly=COLLAPSED_FIELD_NAME$$module$build$src$core$constants,VARIABLE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables,