blockly 13.0.0-beta.6 → 13.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/blockly.min.js +172 -186
  2. package/blockly_compressed.js +151 -166
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks_compressed.js +16 -16
  5. package/blocks_compressed.js.map +1 -1
  6. package/core/block.d.ts +0 -7
  7. package/core/block_aria_composer.d.ts +1 -1
  8. package/core/common.d.ts +7 -0
  9. package/core/dragging/block_drag_strategy.d.ts +19 -0
  10. package/core/grid.d.ts +1 -1
  11. package/core/options.d.ts +3 -3
  12. package/core/procedures.d.ts +4 -6
  13. package/core/variable_map.d.ts +0 -33
  14. package/core/variables.d.ts +5 -6
  15. package/core/variables_dynamic.d.ts +4 -6
  16. package/core/workspace.d.ts +0 -81
  17. package/msg/ab.js +5 -4
  18. package/msg/ab.mjs +1 -0
  19. package/msg/ace.js +5 -4
  20. package/msg/ace.mjs +1 -0
  21. package/msg/af.js +5 -4
  22. package/msg/af.mjs +1 -0
  23. package/msg/am.js +5 -4
  24. package/msg/am.mjs +1 -0
  25. package/msg/ar.js +2 -1
  26. package/msg/ar.mjs +1 -0
  27. package/msg/ast.js +5 -4
  28. package/msg/ast.mjs +1 -0
  29. package/msg/az.js +5 -4
  30. package/msg/az.mjs +1 -0
  31. package/msg/ba.js +5 -4
  32. package/msg/ba.mjs +1 -0
  33. package/msg/bcc.js +5 -4
  34. package/msg/bcc.mjs +1 -0
  35. package/msg/be-tarask.js +5 -4
  36. package/msg/be-tarask.mjs +1 -0
  37. package/msg/be.js +5 -4
  38. package/msg/be.mjs +1 -0
  39. package/msg/bg.js +25 -24
  40. package/msg/bg.mjs +1 -0
  41. package/msg/bn.js +5 -4
  42. package/msg/bn.mjs +1 -0
  43. package/msg/br.js +5 -4
  44. package/msg/br.mjs +1 -0
  45. package/msg/bs.js +5 -4
  46. package/msg/bs.mjs +1 -0
  47. package/msg/ca.js +5 -4
  48. package/msg/ca.mjs +1 -0
  49. package/msg/ce.js +5 -4
  50. package/msg/ce.mjs +1 -0
  51. package/msg/cs.js +25 -24
  52. package/msg/cs.mjs +1 -0
  53. package/msg/da.js +2 -1
  54. package/msg/da.mjs +1 -0
  55. package/msg/de.js +5 -4
  56. package/msg/de.mjs +1 -0
  57. package/msg/diq.js +5 -4
  58. package/msg/diq.mjs +1 -0
  59. package/msg/dtp.js +5 -4
  60. package/msg/dtp.mjs +1 -0
  61. package/msg/dty.js +5 -4
  62. package/msg/dty.mjs +1 -0
  63. package/msg/ee.js +5 -4
  64. package/msg/ee.mjs +1 -0
  65. package/msg/el.js +2 -1
  66. package/msg/el.mjs +1 -0
  67. package/msg/en-gb.js +5 -4
  68. package/msg/en-gb.mjs +1 -0
  69. package/msg/en.js +5 -4
  70. package/msg/en.mjs +1 -0
  71. package/msg/eo.js +5 -4
  72. package/msg/eo.mjs +1 -0
  73. package/msg/es.js +2 -1
  74. package/msg/es.mjs +1 -0
  75. package/msg/et.js +5 -4
  76. package/msg/et.mjs +1 -0
  77. package/msg/eu.js +5 -4
  78. package/msg/eu.mjs +1 -0
  79. package/msg/fa.js +5 -4
  80. package/msg/fa.mjs +1 -0
  81. package/msg/fi.js +8 -7
  82. package/msg/fi.mjs +1 -0
  83. package/msg/fo.js +5 -4
  84. package/msg/fo.mjs +1 -0
  85. package/msg/fr.js +2 -1
  86. package/msg/fr.mjs +1 -0
  87. package/msg/frr.js +5 -4
  88. package/msg/frr.mjs +1 -0
  89. package/msg/ga.js +2 -1
  90. package/msg/ga.mjs +1 -0
  91. package/msg/gl.js +2 -1
  92. package/msg/gl.mjs +1 -0
  93. package/msg/gn.js +5 -4
  94. package/msg/gn.mjs +1 -0
  95. package/msg/gor.js +5 -4
  96. package/msg/gor.mjs +1 -0
  97. package/msg/ha.js +5 -4
  98. package/msg/ha.mjs +1 -0
  99. package/msg/hak.js +5 -4
  100. package/msg/hak.mjs +1 -0
  101. package/msg/he.js +5 -4
  102. package/msg/he.mjs +1 -0
  103. package/msg/hi.js +5 -4
  104. package/msg/hi.mjs +1 -0
  105. package/msg/hr.js +5 -4
  106. package/msg/hr.mjs +1 -0
  107. package/msg/hrx.js +5 -4
  108. package/msg/hrx.mjs +1 -0
  109. package/msg/hsb.js +5 -4
  110. package/msg/hsb.mjs +1 -0
  111. package/msg/hu.js +5 -4
  112. package/msg/hu.mjs +1 -0
  113. package/msg/hy.js +5 -4
  114. package/msg/hy.mjs +1 -0
  115. package/msg/ia.js +2 -1
  116. package/msg/ia.mjs +1 -0
  117. package/msg/id.js +2 -1
  118. package/msg/id.mjs +1 -0
  119. package/msg/ig.js +2 -1
  120. package/msg/ig.mjs +1 -0
  121. package/msg/inh.js +5 -4
  122. package/msg/inh.mjs +1 -0
  123. package/msg/is.js +5 -4
  124. package/msg/is.mjs +1 -0
  125. package/msg/it.js +2 -1
  126. package/msg/it.mjs +1 -0
  127. package/msg/ja.js +2 -1
  128. package/msg/ja.mjs +1 -0
  129. package/msg/ka.js +5 -4
  130. package/msg/ka.mjs +1 -0
  131. package/msg/kab.js +4 -3
  132. package/msg/kab.mjs +1 -0
  133. package/msg/kbd-cyrl.js +5 -4
  134. package/msg/kbd-cyrl.mjs +1 -0
  135. package/msg/km.js +5 -4
  136. package/msg/km.mjs +1 -0
  137. package/msg/kn.js +5 -4
  138. package/msg/kn.mjs +1 -0
  139. package/msg/ko.js +19 -18
  140. package/msg/ko.mjs +1 -0
  141. package/msg/krc.js +2 -1
  142. package/msg/krc.mjs +1 -0
  143. package/msg/ksh.js +5 -4
  144. package/msg/ksh.mjs +1 -0
  145. package/msg/ku-latn.js +5 -4
  146. package/msg/ku-latn.mjs +1 -0
  147. package/msg/ky.js +5 -4
  148. package/msg/ky.mjs +1 -0
  149. package/msg/la.js +5 -4
  150. package/msg/la.mjs +1 -0
  151. package/msg/lb.js +5 -4
  152. package/msg/lb.mjs +1 -0
  153. package/msg/lki.js +5 -4
  154. package/msg/lki.mjs +1 -0
  155. package/msg/lo.js +5 -4
  156. package/msg/lo.mjs +1 -0
  157. package/msg/lrc.js +5 -4
  158. package/msg/lrc.mjs +1 -0
  159. package/msg/lt.js +5 -4
  160. package/msg/lt.mjs +1 -0
  161. package/msg/lv.js +5 -4
  162. package/msg/lv.mjs +1 -0
  163. package/msg/mg.js +5 -4
  164. package/msg/mg.mjs +1 -0
  165. package/msg/mk.js +5 -4
  166. package/msg/mk.mjs +1 -0
  167. package/msg/ml.js +5 -4
  168. package/msg/ml.mjs +1 -0
  169. package/msg/mnw.js +5 -4
  170. package/msg/mnw.mjs +1 -0
  171. package/msg/ms.js +5 -4
  172. package/msg/ms.mjs +1 -0
  173. package/msg/my.js +5 -4
  174. package/msg/my.mjs +1 -0
  175. package/msg/mzn.js +5 -4
  176. package/msg/mzn.mjs +1 -0
  177. package/msg/nb.js +5 -4
  178. package/msg/nb.mjs +1 -0
  179. package/msg/ne.js +5 -4
  180. package/msg/ne.mjs +1 -0
  181. package/msg/nl.js +4 -3
  182. package/msg/nl.mjs +1 -0
  183. package/msg/oc.js +5 -4
  184. package/msg/oc.mjs +1 -0
  185. package/msg/olo.js +5 -4
  186. package/msg/olo.mjs +1 -0
  187. package/msg/pa.js +4 -3
  188. package/msg/pa.mjs +1 -0
  189. package/msg/pl.js +2 -1
  190. package/msg/pl.mjs +1 -0
  191. package/msg/pms.js +2 -1
  192. package/msg/pms.mjs +1 -0
  193. package/msg/ps.js +8 -7
  194. package/msg/ps.mjs +1 -0
  195. package/msg/pt-br.js +2 -1
  196. package/msg/pt-br.mjs +1 -0
  197. package/msg/pt.js +2 -1
  198. package/msg/pt.mjs +1 -0
  199. package/msg/ro.js +2 -1
  200. package/msg/ro.mjs +1 -0
  201. package/msg/ru.js +2 -1
  202. package/msg/ru.mjs +1 -0
  203. package/msg/sc.js +5 -4
  204. package/msg/sc.mjs +1 -0
  205. package/msg/sco.js +5 -4
  206. package/msg/sco.mjs +1 -0
  207. package/msg/sd.js +5 -4
  208. package/msg/sd.mjs +1 -0
  209. package/msg/shn.js +5 -4
  210. package/msg/shn.mjs +1 -0
  211. package/msg/si.js +5 -4
  212. package/msg/si.mjs +1 -0
  213. package/msg/sk.js +5 -4
  214. package/msg/sk.mjs +1 -0
  215. package/msg/skr-arab.js +5 -4
  216. package/msg/skr-arab.mjs +1 -0
  217. package/msg/sl.js +2 -1
  218. package/msg/sl.mjs +1 -0
  219. package/msg/smn.js +5 -4
  220. package/msg/smn.mjs +1 -0
  221. package/msg/sq.js +5 -4
  222. package/msg/sq.mjs +1 -0
  223. package/msg/sr-latn.js +5 -4
  224. package/msg/sr-latn.mjs +1 -0
  225. package/msg/sr.js +5 -4
  226. package/msg/sr.mjs +1 -0
  227. package/msg/sv.js +2 -1
  228. package/msg/sv.mjs +1 -0
  229. package/msg/sw.js +5 -4
  230. package/msg/sw.mjs +1 -0
  231. package/msg/ta.js +4 -3
  232. package/msg/ta.mjs +1 -0
  233. package/msg/tcy.js +2 -1
  234. package/msg/tcy.mjs +1 -0
  235. package/msg/tdd.js +5 -4
  236. package/msg/tdd.mjs +1 -0
  237. package/msg/te.js +5 -4
  238. package/msg/te.mjs +1 -0
  239. package/msg/th.js +5 -4
  240. package/msg/th.mjs +1 -0
  241. package/msg/ti.js +5 -4
  242. package/msg/ti.mjs +1 -0
  243. package/msg/tl.js +5 -4
  244. package/msg/tl.mjs +1 -0
  245. package/msg/tlh.js +5 -4
  246. package/msg/tlh.mjs +1 -0
  247. package/msg/tr.js +2 -1
  248. package/msg/tr.mjs +1 -0
  249. package/msg/ug-arab.js +5 -4
  250. package/msg/ug-arab.mjs +1 -0
  251. package/msg/uk.js +14 -13
  252. package/msg/uk.mjs +1 -0
  253. package/msg/ur.js +5 -4
  254. package/msg/ur.mjs +1 -0
  255. package/msg/uz.js +5 -4
  256. package/msg/uz.mjs +1 -0
  257. package/msg/vi.js +2 -1
  258. package/msg/vi.mjs +1 -0
  259. package/msg/xmf.js +5 -4
  260. package/msg/xmf.mjs +1 -0
  261. package/msg/yo.js +5 -4
  262. package/msg/yo.mjs +1 -0
  263. package/msg/zgh.js +5 -4
  264. package/msg/zgh.mjs +1 -0
  265. package/msg/zh-hans.js +2 -1
  266. package/msg/zh-hans.mjs +1 -0
  267. package/msg/zh-hant.js +2 -1
  268. package/msg/zh-hant.mjs +1 -0
  269. package/package.json +2 -2
@@ -19,22 +19,22 @@ isCommentDelete$$module$build$src$core$events$predicates,isCommentChange$$module
19
19
  fireNow$$module$build$src$core$events$utils,enqueueEvent$$module$build$src$core$events$utils,filter$$module$build$src$core$events$utils,clearPendingUndo$$module$build$src$core$events$utils,isEnabled$$module$build$src$core$events$utils,setGroupInternal$$module$build$src$core$events$utils,getDescendantIds$$module$build$src$core$events$utils,fromJson$$module$build$src$core$events$utils,get$$module$build$src$core$events$utils,disableOrphans$$module$build$src$core$events$utils,removeRole$$module$build$src$core$utils$aria,
20
20
  setRole$$module$build$src$core$utils$aria,getRole$$module$build$src$core$utils$aria,setState$$module$build$src$core$utils$aria,clearState$$module$build$src$core$utils$aria,getState$$module$build$src$core$utils$aria,initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria,announceDynamicAriaState$$module$build$src$core$utils$aria,mostAssertive$$module$build$src$core$utils$aria,createSvgElement$$module$build$src$core$utils$dom,addClass$$module$build$src$core$utils$dom,removeClasses$$module$build$src$core$utils$dom,
21
21
  removeClass$$module$build$src$core$utils$dom,hasClass$$module$build$src$core$utils$dom,removeNode$$module$build$src$core$utils$dom,insertAfter$$module$build$src$core$utils$dom,setCssTransform$$module$build$src$core$utils$dom,startTextWidthCache$$module$build$src$core$utils$dom,stopTextWidthCache$$module$build$src$core$utils$dom,getTextWidth$$module$build$src$core$utils$dom,getFastTextWidth$$module$build$src$core$utils$dom,getFastTextWidthWithSizeString$$module$build$src$core$utils$dom,measureFontMetrics$$module$build$src$core$utils$dom,
22
- isFocusableNode$$module$build$src$core$interfaces$i_focusable_node,isSelectable$$module$build$src$core$interfaces$i_selectable,deepMerge$$module$build$src$core$utils$object,getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common,registerWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common,setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,setSelected$$module$build$src$core$common,
23
- fireSelectedEvent$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common,jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common,defineBlocksWithJsonArrayInternal$$module$build$src$core$common,globalShortcutHandler$$module$build$src$core$common,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,
24
- inject$$module$build$src$core$css,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style,getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style,scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style,
25
- getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math,getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml,domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox,
26
- validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox,hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox,addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox,
27
- getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers,register$$module$build$src$core$serialization$registry,unregister$$module$build$src$core$serialization$registry,save$$module$build$src$core$serialization$workspace_comments,append$$module$build$src$core$serialization$workspace_comments,register$$module$build$src$core$clipboard$registry,unregister$$module$build$src$core$clipboard$registry,
28
- moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster,commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster,isSerializable$$module$build$src$core$interfaces$i_serializable,queueRender$$module$build$src$core$render_management,finishQueuedRenders$$module$build$src$core$render_management,triggerQueuedRenders$$module$build$src$core$render_management,alwaysImmediatelyRender$$module$build$src$core$render_management,queueBlock$$module$build$src$core$render_management,
29
- doRenders$$module$build$src$core$render_management,dequeueBlock$$module$build$src$core$render_management,shouldRenderRootBlock$$module$build$src$core$render_management,renderBlock$$module$build$src$core$render_management,alert$$module$build$src$core$dialog,setAlert$$module$build$src$core$dialog,confirm$$module$build$src$core$dialog,setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,setPrompt$$module$build$src$core$dialog,toast$$module$build$src$core$dialog,setToast$$module$build$src$core$dialog,
30
- displayDialog$$module$build$src$core$dialog,hasBubble$$module$build$src$core$interfaces$i_has_bubble,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model,internalFlyoutCategory$$module$build$src$core$variables,flyoutCategory$$module$build$src$core$variables,generateVariableFieldJson$$module$build$src$core$variables,
31
- jsonFlyoutCategoryBlocks$$module$build$src$core$variables,xmlFlyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables,createVariableButtonHandler$$module$build$src$core$variables,promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables,nameUsedWithAnyType$$module$build$src$core$variables,
32
- nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables,getAddedVariables$$module$build$src$core$variables,compareByName$$module$build$src$core$variables,getVariableUsesById$$module$build$src$core$variables,save$$module$build$src$core$serialization$blocks,
33
- saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks,saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,
34
- appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks,tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,
35
- loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting,getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting,getKeyName$$module$build$src$core$utils$shortcut_formatting,getShortcutKeys$$module$build$src$core$utils$shortcut_formatting,upperCaseFirst$$module$build$src$core$utils$shortcut_formatting,
36
- modifierOrder$$module$build$src$core$utils$shortcut_formatting,toRadians$$module$build$src$core$utils$math,toDegrees$$module$build$src$core$utils$math,clamp$$module$build$src$core$utils$math,createDom$$module$build$src$core$dropdowndiv,handleFocusLoss$$module$build$src$core$dropdowndiv,setBoundsElement$$module$build$src$core$dropdowndiv,getOwner$$module$build$src$core$dropdowndiv,getContentDiv$$module$build$src$core$dropdowndiv,clearContent$$module$build$src$core$dropdowndiv,setColour$$module$build$src$core$dropdowndiv,
37
- showPositionedByBlock$$module$build$src$core$dropdowndiv,showPositionedByField$$module$build$src$core$dropdowndiv,getScaledBboxOfBlock$$module$build$src$core$dropdowndiv,getScaledBboxOfField$$module$build$src$core$dropdowndiv,showPositionedByRect$$module$build$src$core$dropdowndiv,show$$module$build$src$core$dropdowndiv,getPositionBelowMetrics$$module$build$src$core$dropdowndiv,getPositionAboveMetrics$$module$build$src$core$dropdowndiv,getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv,
22
+ isFocusableNode$$module$build$src$core$interfaces$i_focusable_node,isSelectable$$module$build$src$core$interfaces$i_selectable,deepMerge$$module$build$src$core$utils$object,warn$$module$build$src$core$utils$deprecation,getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common,registerWorkspace$$module$build$src$core$common,unregisterWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common,
23
+ setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,setSelected$$module$build$src$core$common,fireSelectedEvent$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common,jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common,defineBlocksWithJsonArrayInternal$$module$build$src$core$common,
24
+ globalShortcutHandler$$module$build$src$core$common,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,inject$$module$build$src$core$css,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style,getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style,
25
+ scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style,getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math,getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml,
26
+ domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox,validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox,hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox,
27
+ addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox,getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers,register$$module$build$src$core$serialization$registry,unregister$$module$build$src$core$serialization$registry,save$$module$build$src$core$serialization$workspace_comments,append$$module$build$src$core$serialization$workspace_comments,
28
+ register$$module$build$src$core$clipboard$registry,unregister$$module$build$src$core$clipboard$registry,moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster,commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster,isSerializable$$module$build$src$core$interfaces$i_serializable,queueRender$$module$build$src$core$render_management,finishQueuedRenders$$module$build$src$core$render_management,triggerQueuedRenders$$module$build$src$core$render_management,
29
+ alwaysImmediatelyRender$$module$build$src$core$render_management,queueBlock$$module$build$src$core$render_management,doRenders$$module$build$src$core$render_management,dequeueBlock$$module$build$src$core$render_management,shouldRenderRootBlock$$module$build$src$core$render_management,renderBlock$$module$build$src$core$render_management,alert$$module$build$src$core$dialog,setAlert$$module$build$src$core$dialog,confirm$$module$build$src$core$dialog,setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,
30
+ setPrompt$$module$build$src$core$dialog,toast$$module$build$src$core$dialog,setToast$$module$build$src$core$dialog,displayDialog$$module$build$src$core$dialog,hasBubble$$module$build$src$core$interfaces$i_has_bubble,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model,flyoutCategory$$module$build$src$core$variables,
31
+ generateVariableFieldJson$$module$build$src$core$variables,jsonFlyoutCategoryBlocks$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables,createVariableButtonHandler$$module$build$src$core$variables,promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables,
32
+ nameUsedWithAnyType$$module$build$src$core$variables,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables,getAddedVariables$$module$build$src$core$variables,compareByName$$module$build$src$core$variables,getVariableUsesById$$module$build$src$core$variables,
33
+ save$$module$build$src$core$serialization$blocks,saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks,saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,
34
+ append$$module$build$src$core$serialization$blocks,appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks,tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,
35
+ loadFields$$module$build$src$core$serialization$blocks,loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,getShortcutKeysShort$$module$build$src$core$utils$shortcut_formatting,getShortcutKeysLong$$module$build$src$core$utils$shortcut_formatting,getKeyName$$module$build$src$core$utils$shortcut_formatting,getShortcutKeys$$module$build$src$core$utils$shortcut_formatting,
36
+ upperCaseFirst$$module$build$src$core$utils$shortcut_formatting,modifierOrder$$module$build$src$core$utils$shortcut_formatting,toRadians$$module$build$src$core$utils$math,toDegrees$$module$build$src$core$utils$math,clamp$$module$build$src$core$utils$math,createDom$$module$build$src$core$dropdowndiv,handleFocusLoss$$module$build$src$core$dropdowndiv,setBoundsElement$$module$build$src$core$dropdowndiv,getOwner$$module$build$src$core$dropdowndiv,getContentDiv$$module$build$src$core$dropdowndiv,clearContent$$module$build$src$core$dropdowndiv,
37
+ setColour$$module$build$src$core$dropdowndiv,showPositionedByBlock$$module$build$src$core$dropdowndiv,showPositionedByField$$module$build$src$core$dropdowndiv,getScaledBboxOfBlock$$module$build$src$core$dropdowndiv,getScaledBboxOfField$$module$build$src$core$dropdowndiv,showPositionedByRect$$module$build$src$core$dropdowndiv,show$$module$build$src$core$dropdowndiv,getPositionBelowMetrics$$module$build$src$core$dropdowndiv,getPositionAboveMetrics$$module$build$src$core$dropdowndiv,getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv,
38
38
  getPositionX$$module$build$src$core$dropdowndiv,isVisible$$module$build$src$core$dropdowndiv,hideIfOwner$$module$build$src$core$dropdowndiv,hide$$module$build$src$core$dropdowndiv,hideWithoutAnimation$$module$build$src$core$dropdowndiv,positionInternal$$module$build$src$core$dropdowndiv,repositionForWindowResize$$module$build$src$core$dropdowndiv,shortestStringLength$$module$build$src$core$utils$string,commonWordPrefix$$module$build$src$core$utils$string,commonWordSuffix$$module$build$src$core$utils$string,
39
39
  wrapLine$$module$build$src$core$utils$string,wrapScore$$module$build$src$core$utils$string,wrapMutate$$module$build$src$core$utils$string,wrapToText$$module$build$src$core$utils$string,setCustomTooltip$$module$build$src$core$tooltip,getCustomTooltip$$module$build$src$core$tooltip,isVisible$$module$build$src$core$tooltip,getDiv$$module$build$src$core$tooltip,getTooltipOfObject$$module$build$src$core$tooltip,getTargetObject$$module$build$src$core$tooltip,createDom$$module$build$src$core$tooltip,bindMouseEvents$$module$build$src$core$tooltip,
40
40
  unbindMouseEvents$$module$build$src$core$tooltip,onMouseOver$$module$build$src$core$tooltip,onMouseOut$$module$build$src$core$tooltip,onMouseMove$$module$build$src$core$tooltip,dispose$$module$build$src$core$tooltip,hide$$module$build$src$core$tooltip,display$$module$build$src$core$tooltip,block$$module$build$src$core$tooltip,unblock$$module$build$src$core$tooltip,renderContent$$module$build$src$core$tooltip,renderDefaultContent$$module$build$src$core$tooltip,getPosition$$module$build$src$core$tooltip,
@@ -58,16 +58,15 @@ registerFocusToolbox$$module$build$src$core$shortcut_items,registerReadInformati
58
58
  registerShowTooltip$$module$build$src$core$shortcut_items,registerToggleScreenreaderMode$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items,registerScreenReaderShortcuts$$module$build$src$core$shortcut_items,showUnconstrainedMoveHint$$module$build$src$core$hints,showConstrainedMovementHint$$module$build$src$core$hints,clearMoveHints$$module$build$src$core$hints,showHelpHint$$module$build$src$core$hints,
59
59
  showBlockNavigationHint$$module$build$src$core$hints,showWorkspaceNavigationHint$$module$build$src$core$hints,showFlyoutLabelActionHint$$module$build$src$core$hints,showCopiedHint$$module$build$src$core$hints,showCutHint$$module$build$src$core$hints,clearPasteHints$$module$build$src$core$hints,showScreenreaderModeHint$$module$build$src$core$hints,getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,
60
60
  isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item,getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures,
61
- procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,xmlFlyoutCategory$$module$build$src$core$procedures,internalFlyoutCategory$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,
62
- blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,register$$module$build$src$core$renderers$common$block_rendering,unregister$$module$build$src$core$renderers$common$block_rendering,init$$module$build$src$core$renderers$common$block_rendering,stringButtonClickHandler$$module$build$src$core$variables_dynamic,
63
- numberButtonClickHandler$$module$build$src$core$variables_dynamic,colourButtonClickHandler$$module$build$src$core$variables_dynamic,internalFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic,xmlFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,
64
- save$$module$build$src$core$serialization$workspaces,load$$module$build$src$core$serialization$workspaces,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,isFullBlockField$$module$build$src$core$contextmenu_items,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,
65
- registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,
66
- registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,registerDisable$$module$build$src$core$contextmenu_items,registerDelete$$module$build$src$core$contextmenu_items,registerHelp$$module$build$src$core$contextmenu_items,registerCommentDelete$$module$build$src$core$contextmenu_items,registerCommentDuplicate$$module$build$src$core$contextmenu_items,
67
- registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,
68
- $jscomp;
69
- register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&typeof a!=="string"||`${a}`.trim()==="")throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if(typeof b!=="string"||b.trim()==="")throw Error('Invalid name "'+b+'". The name must be a non-empty string.');var e=b.toLowerCase();if(!c)throw Error("Can not register a null value");var f=typeMap$$module$build$src$core$registry[a],g=
70
- nameMap$$module$build$src$core$registry[a];f||(f=typeMap$$module$build$src$core$registry[a]=Object.create(null),g=nameMap$$module$build$src$core$registry[a]=Object.create(null));validate$$module$build$src$core$registry(a,c);if(!d&&f[e]&&f[e]!==c)throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b};
61
+ procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,
62
+ isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,register$$module$build$src$core$renderers$common$block_rendering,unregister$$module$build$src$core$renderers$common$block_rendering,init$$module$build$src$core$renderers$common$block_rendering,stringButtonClickHandler$$module$build$src$core$variables_dynamic,numberButtonClickHandler$$module$build$src$core$variables_dynamic,colourButtonClickHandler$$module$build$src$core$variables_dynamic,
63
+ flyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,load$$module$build$src$core$serialization$workspaces,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,
64
+ init$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,isFullBlockField$$module$build$src$core$contextmenu_items,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,
65
+ addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,
66
+ registerDisable$$module$build$src$core$contextmenu_items,registerDelete$$module$build$src$core$contextmenu_items,registerHelp$$module$build$src$core$contextmenu_items,registerCommentDelete$$module$build$src$core$contextmenu_items,registerCommentDuplicate$$module$build$src$core$contextmenu_items,registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,
67
+ isBoundedElement$$module$build$src$core$interfaces$i_bounded_element,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,$jscomp;
68
+ register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&typeof a!=="string"||`${a}`.trim()==="")throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if(typeof b!=="string"||b.trim()==="")throw Error('Invalid name "'+b+'". The name must be a non-empty string.');var e=b.toLowerCase();if(!c)throw Error("Can not register a null value");var f=typeMap$$module$build$src$core$registry[a],
69
+ g=nameMap$$module$build$src$core$registry[a];f||(f=typeMap$$module$build$src$core$registry[a]=Object.create(null),g=nameMap$$module$build$src$core$registry[a]=Object.create(null));validate$$module$build$src$core$registry(a,c);if(!d&&f[e]&&f[e]!==c)throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b};
71
70
  validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if(typeof b.fromJson!=="function")throw Error('Type "'+a+'" must have a fromJson function');}};
72
71
  unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();var c=typeMap$$module$build$src$core$registry[a];c&&c[b]?(delete typeMap$$module$build$src$core$registry[a][b],delete nameMap$$module$build$src$core$registry[a][b]):console.warn("Unable to unregister ["+b+"]["+a+"] from the registry.")};
73
72
  getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();var d=typeMap$$module$build$src$core$registry[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};hasItem$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();return(a=typeMap$$module$build$src$core$registry[a])?!!a[b]:!1};
@@ -121,9 +120,11 @@ getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d
121
120
  measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){var e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems=
122
121
  "flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&typeof a.getFocusableElement==="function"&&typeof a.getFocusableTree==="function"&&typeof a.onNodeFocus==="function"&&typeof a.onNodeBlur==="function"&&typeof a.canBeFocused==="function"};
123
122
  isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&typeof a.id==="string"&&typeof a.workspace==="object"&&typeof a.select==="function"&&typeof a.unselect==="function"};
124
- deepMerge$$module$build$src$core$utils$object=function(a,b){for(let c in b)b[c]!==null&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=b[c]!==null&&typeof b[c]==="object"?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
125
- getAllWorkspaces$$module$build$src$core$common=function(){var a=[];for(let b in WorkspaceDB_$$module$build$src$core$common)a.push(WorkspaceDB_$$module$build$src$core$common[b]);return a};registerWorkspace$$module$build$src$core$common=function(a){WorkspaceDB_$$module$build$src$core$common[a.id]=a};unregisterWorkpace$$module$build$src$core$common=function(a){delete WorkspaceDB_$$module$build$src$core$common[a.id]};getMainWorkspace$$module$build$src$core$common=function(){return mainWorkspace$$module$build$src$core$common};
126
- setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a;a.rendered&&$.getFocusManager$$module$build$src$core$focus_manager().setPopoverFocusRoot(a.getInjectionDiv())};getSelected$$module$build$src$core$common=function(){var a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();return a&&isSelectable$$module$build$src$core$interfaces$i_selectable(a)?a:null};setSelected$$module$build$src$core$common=function(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)};
123
+ deepMerge$$module$build$src$core$utils$object=function(a,b){for(let c in b)b[c]!==null&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=b[c]!==null&&typeof b[c]==="object"?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};
124
+ warn$$module$build$src$core$utils$deprecation=function(a,b,c,d){a=a+" was deprecated in "+b+" and will be deleted in "+c+".";d&&(a+="\nUse "+d+" instead.");previousWarnings$$module$build$src$core$utils$deprecation.has(a)||(previousWarnings$$module$build$src$core$utils$deprecation.add(a),console.warn(a))};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};
125
+ getAllWorkspaces$$module$build$src$core$common=function(){var a=[];for(let b in WorkspaceDB_$$module$build$src$core$common)a.push(WorkspaceDB_$$module$build$src$core$common[b]);return a};registerWorkspace$$module$build$src$core$common=function(a){WorkspaceDB_$$module$build$src$core$common[a.id]=a};unregisterWorkspace$$module$build$src$core$common=function(a){delete WorkspaceDB_$$module$build$src$core$common[a.id]};
126
+ unregisterWorkpace$$module$build$src$core$common=function(a){warn$$module$build$src$core$utils$deprecation("Blockly.common.unregisterWorkpace","v13","v14","Blockly.common.unregisterWorkspace");unregisterWorkspace$$module$build$src$core$common(a)};getMainWorkspace$$module$build$src$core$common=function(){return mainWorkspace$$module$build$src$core$common};setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a;a.rendered&&$.getFocusManager$$module$build$src$core$focus_manager().setPopoverFocusRoot(a.getInjectionDiv())};
127
+ getSelected$$module$build$src$core$common=function(){var a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();return a&&isSelectable$$module$build$src$core$interfaces$i_selectable(a)?a:null};setSelected$$module$build$src$core$common=function(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)};
127
128
  fireSelectedEvent$$module$build$src$core$common=function(a){var b=getSelected$$module$build$src$core$common(),c,d,e,f,g=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.SELECTED))((c=b==null?void 0:b.id)!=null?c:null,(d=a==null?void 0:a.id)!=null?d:null,(f=(e=a==null?void 0:a.workspace.id)!=null?e:b==null?void 0:b.workspace.id)!=null?f:"");fire$$module$build$src$core$events$utils(g)};
128
129
  getParentContainer$$module$build$src$core$common=function(a=getMainWorkspace$$module$build$src$core$common()){return parentContainer$$module$build$src$core$common?parentContainer$$module$build$src$core$common:a&&a.rendered?a.getInjectionDiv():null};setParentContainer$$module$build$src$core$common=function(a){parentContainer$$module$build$src$core$common=a};
129
130
  svgResize$$module$build$src$core$common=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=a.getCachedParentSvgSize(),d=b.parentElement;if(d instanceof HTMLElement){var e=d.offsetWidth;d=d.offsetHeight;c.width!==e&&(b.setAttribute("width",e+"px"),a.setCachedParentSvgSize(e,null));c.height!==d&&(b.setAttribute("height",d+"px"),a.setCachedParentSvgSize(null,d));a.resize()}};
@@ -186,14 +187,11 @@ displayDialog$$module$build$src$core$dialog=function(...[a,b,c,d]){var e=documen
186
187
  b.textContent=$.Msg$$module$build$src$core$msg.DIALOG_CANCEL,b.value="cancel",k.appendChild(b);f.appendChild(k);var m;activeDialogCount$$module$build$src$core$dialog===0&&(m=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(e));activeDialogCount$$module$build$src$core$dialog++;e.addEventListener("close",()=>{activeDialogCount$$module$build$src$core$dialog--;if(!activeDialogCount$$module$build$src$core$dialog){let n;(n=m)==null||n()}e.remove();switch(a){case DialogType$$module$build$src$core$dialog.CONFIRM:c(e.returnValue===
187
188
  "ok");break;case DialogType$$module$build$src$core$dialog.PROMPT:c(e.returnValue==="ok"?h.value:null);break;case DialogType$$module$build$src$core$dialog.ALERT:c==null||c()}});document.body.appendChild(e);e.showModal()};hasBubble$$module$build$src$core$interfaces$i_has_bubble=function(a){return typeof a.bubbleIsVisible==="function"&&typeof a.setBubbleVisible==="function"&&typeof a.getBubble==="function"};
188
189
  isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&typeof a.getProcedureDef==="function"};isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&typeof a.getProcedureCall==="function"&&typeof a.renameProcedure==="function"};isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return a.getVariableModel!==void 0};
189
- $.warn$$module$build$src$core$utils$deprecation=function(a,b,c,d){a=a+" was deprecated in "+b+" and will be deleted in "+c+".";d&&(a+="\nUse "+d+" instead.");previousWarnings$$module$build$src$core$utils$deprecation.has(a)||(previousWarnings$$module$build$src$core$utils$deprecation.add(a),console.warn(a))};
190
190
  $.allUsedVarModels$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);var b=new Set;for(let c=0;c<a.length;c++){let d=a[c].getVarModels();if(d)for(let e=0;e<d.length;e++){let f=d[e];f.getId()&&b.add(f)}}return Array.from(b.values())};$.allDeveloperVariables$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);var b=new Set;for(let d=0,e;e=a[d];d++){var c=e.getDeveloperVariables;if(c){c=c();for(let f=0;f<c.length;f++)b.add(c[f])}}return Array.from(b.values())};
191
- internalFlyoutCategory$$module$build$src$core$variables=function(a){return flyoutCategory$$module$build$src$core$variables(a,!1)};
192
- flyoutCategory$$module$build$src$core$variables=function(a,b=!0){Blocks$$module$build$src$core$blocks.variables_set||Blocks$$module$build$src$core$blocks.variables_get||console.warn("There are no variable blocks, but there is a variable category.");if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.Variables.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),xmlFlyoutCategory$$module$build$src$core$variables(a);
193
- a.registerButtonCallback("CREATE_VARIABLE",function(c){createVariableButtonHandler$$module$build$src$core$variables(c.getTargetWorkspace())});return[{kind:"button",text:"%{BKY_NEW_VARIABLE}",callbackkey:"CREATE_VARIABLE"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,a.getVariableMap().getVariablesOfType(""),!0)]};generateVariableFieldJson$$module$build$src$core$variables=function(a){return{VAR:{name:a.getName(),type:a.getType()}}};
191
+ flyoutCategory$$module$build$src$core$variables=function(a){Blocks$$module$build$src$core$blocks.variables_set||Blocks$$module$build$src$core$blocks.variables_get||console.warn("There are no variable blocks, but there is a variable category.");a.registerButtonCallback("CREATE_VARIABLE",function(b){createVariableButtonHandler$$module$build$src$core$variables(b.getTargetWorkspace())});return[{kind:"button",text:"%{BKY_NEW_VARIABLE}",callbackkey:"CREATE_VARIABLE"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,
192
+ a.getVariableMap().getVariablesOfType(""),!0)]};generateVariableFieldJson$$module$build$src$core$variables=function(a){return{VAR:{name:a.getName(),type:a.getType()}}};
194
193
  jsonFlyoutCategoryBlocks$$module$build$src$core$variables=function(a,b,c,d="variables_get",e="variables_set"){c&&(c=Blocks$$module$build$src$core$blocks.math_change);a=[];var f=b.slice(-1)[0];f&&(Blocks$$module$build$src$core$blocks[e]&&a.push({kind:"block",type:e,gap:c?8:24,fields:generateVariableFieldJson$$module$build$src$core$variables(f)}),c&&a.push({kind:"block",type:"math_change",gap:Blocks$$module$build$src$core$blocks[d]?20:8,fields:generateVariableFieldJson$$module$build$src$core$variables(f),
195
194
  inputs:{DELTA:{shadow:{type:"math_number",fields:{NUM:1}}}}}));Blocks$$module$build$src$core$blocks[d]&&a.push(...b.sort(compareByName$$module$build$src$core$variables).map(g=>({kind:"block",type:d,gap:8,fields:generateVariableFieldJson$$module$build$src$core$variables(g)})));return a};
196
- xmlFlyoutCategory$$module$build$src$core$variables=function(a){var b=[],c=document.createElement("button");c.setAttribute("text","%{BKY_NEW_VARIABLE}");c.setAttribute("callbackKey","CREATE_VARIABLE");a.registerButtonCallback("CREATE_VARIABLE",function(d){createVariableButtonHandler$$module$build$src$core$variables(d.getTargetWorkspace())});b.push(c);a=flyoutCategoryBlocks$$module$build$src$core$variables(a);return b=b.concat(a)};
197
195
  flyoutCategoryBlocks$$module$build$src$core$variables=function(a){a=a.getVariableMap().getVariablesOfType("");var b=[];if(a.length>0){var c=a[a.length-1];if(Blocks$$module$build$src$core$blocks.variables_set){var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set");d.setAttribute("gap",Blocks$$module$build$src$core$blocks.math_change?"8":"24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}Blocks$$module$build$src$core$blocks.math_change&&
198
196
  (d=$.createElement$$module$build$src$core$utils$xml("block"),d.setAttribute("type","math_change"),d.setAttribute("gap",Blocks$$module$build$src$core$blocks.variables_get?"20":"8"),d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c)),c=$.textToDom$$module$build$src$core$utils$xml('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),d.appendChild(c),b.push(d));if(Blocks$$module$build$src$core$blocks.variables_get){a.sort(compareByName$$module$build$src$core$variables);
199
197
  for(let e=0,f;f=a[e];e++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(f)),b.push(c)}}return b};generateUniqueName$$module$build$src$core$variables=function(a){return TEST_ONLY$$module$build$src$core$variables.generateUniqueNameInternal(a)};
@@ -414,8 +412,8 @@ e=[],g}return g.computeAriaLabel(d)});if(!f.length&&b){let g=a.getSourceBlock().
414
412
  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();if(e&&(a=e.getSourceBlock(),!a.isInsertionMarker())){if(b=e.getAriaLabelText())a=b;else{if(!a.statementInputCount)return;a=a.inputList.find(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);if(e===a)return;a=computeFieldRowLabel$$module$build$src$core$block_aria_composer(e,
415
413
  !0)}return e.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT?(e=Array.isArray(a)?a.join(" "):a,$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_PREFIX.replace("%1",e)):a}};getBeginStackLabel$$module$build$src$core$block_aria_composer=function(a){if(!a.isInFlyout&&!a.isDragging())return a.getRootBlock()===a?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_BEGIN_STACK:void 0};
416
414
  getInputLabels$$module$build$src$core$block_aria_composer=function(a,b=Verbosity$$module$build$src$core$utils$aria.STANDARD,c=!0){var d=a=a.inputList.filter(e=>e.isVisible());if(b<=Verbosity$$module$build$src$core$utils$aria.STANDARD){let e=a.filter(f=>f.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT);e.length>1&&(d=a.slice(0,a.indexOf(e[0])+1))}return d.map(e=>{var f;return(f=c?e.getAriaLabelText():null)!=null?f:e.getLabel(b,c)})};
417
- getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b){var c=a.inputList.indexOf(b);if(c===-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,c):c;return a.inputList.slice(b,c+1).filter(d=>d.isVisible()).map(d=>d.getLabel(Verbosity$$module$build$src$core$utils$aria.TERSE)||$.Msg$$module$build$src$core$msg.INPUT_LABEL_INDEX.replace("%1",
418
- (d.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};
415
+ getInputLabelsSubset$$module$build$src$core$block_aria_composer=function(a,b,c=!0){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(Verbosity$$module$build$src$core$utils$aria.TERSE,!1)||(c?$.Msg$$module$build$src$core$msg.INPUT_LABEL_INDEX.replace("%1",
416
+ (e.getIndex()+1).toString()):void 0)).filter(e=>e!==void 0)};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};
419
417
  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",
420
418
  c.getName())}};
421
419
  getAnnouncementTemplate$$module$build$src$core$block_aria_composer=function(a){switch(a){case ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_BEFORE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AFTER;case ConnectionPreposition$$module$build$src$core$block_aria_composer.INSIDE:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_INSIDE;case ConnectionPreposition$$module$build$src$core$block_aria_composer.AROUND:return $.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_AROUND;
@@ -425,7 +423,7 @@ e&&(d=computeMoveConnectionLabel$$module$build$src$core$block_aria_composer(a,d)
425
423
  getConnectionPreposition$$module$build$src$core$block_aria_composer=function(a,b){switch(a.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:return ConnectionPreposition$$module$build$src$core$block_aria_composer.TO;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return a===a.getSourceBlock().nextConnection?ConnectionPreposition$$module$build$src$core$block_aria_composer.BEFORE:
426
424
  ConnectionPreposition$$module$build$src$core$block_aria_composer.AROUND;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:return b===b.getSourceBlock().nextConnection?ConnectionPreposition$$module$build$src$core$block_aria_composer.AFTER:ConnectionPreposition$$module$build$src$core$block_aria_composer.INSIDE}return ConnectionPreposition$$module$build$src$core$block_aria_composer.UNKNOWN};
427
425
  getDisabledLabel$$module$build$src$core$block_aria_composer=function(a){return a.isEnabled()?void 0:$.Msg$$module$build$src$core$msg.BLOCK_LABEL_DISABLED};getCollapsedLabel$$module$build$src$core$block_aria_composer=function(a){return a.isCollapsed()?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_COLLAPSED:void 0};getShadowBlockLabel$$module$build$src$core$block_aria_composer=function(a){return a.isShadow()?$.Msg$$module$build$src$core$msg.BLOCK_LABEL_REPLACEABLE:void 0};
428
- getInputCountLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.inputList.filter(c=>c.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT).length;if(b>1)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_BRANCHES.replace("%1",b.toString());switch(a.inputList.reduce((c,d)=>{var e;return d.fieldRow.reduce((f,g)=>g.EDITABLE&&!g.isFullBlockField()?f++:f,c)+(((e=d.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?
426
+ getInputCountLabel$$module$build$src$core$block_aria_composer=function(a){var b=a.inputList.filter(c=>c.type===$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT).length;if(b>1)return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_BRANCHES.replace("%1",b.toString());switch(a.inputList.reduce((c,d)=>{var e;return d.fieldRow.reduce((f,g)=>g.EDITABLE&&!g.isFullBlockField()?++f:f,c)+(((e=d.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?
429
427
  1:0)},0)){case 0:break;case 1:return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_INPUT;default:return $.Msg$$module$build$src$core$msg.BLOCK_LABEL_HAS_INPUTS}};
430
428
  isIcon$$module$build$src$core$interfaces$i_icon=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&typeof a.getType==="function"&&typeof a.initView==="function"&&typeof a.dispose==="function"&&typeof a.getWeight==="function"&&typeof a.getSize==="function"&&typeof a.applyColour==="function"&&typeof a.hideForInsertionMarker==="function"&&typeof a.updateEditable==="function"&&typeof a.updateCollapsed==="function"&&typeof a.isShownWhenCollapsed==="function"&&typeof a.setOffsetInBlock===
431
429
  "function"&&typeof a.onLocationChange==="function"&&typeof a.onClick==="function"};
@@ -454,20 +452,20 @@ pasteFromData$$module$build$src$core$clipboard=function(a,b,c){var d;b=b.isMutat
454
452
  isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return a&&typeof a.toCopyData==="function"};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&typeof a.isDeletable==="function"&&typeof a.dispose==="function"&&typeof a.setDeleteStyle==="function"};
455
453
  isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return a&&typeof a.getRelativeToSurfaceXY==="function"&&typeof a.isMovable==="function"&&typeof a.startDrag==="function"&&typeof a.drag==="function"&&typeof a.endDrag==="function"&&typeof a.revertDrag==="function"};
456
454
  registerEscape$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.ESCAPE,preconditionFn(a){return!a.isReadOnly()},callback(a){a.hideChaff();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ESC],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_ESCAPE})};
457
- registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&b!=null&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!a.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(a,b,c,d){b.preventDefault();b=d.focusedNode;b instanceof
458
- BlockSvg$$module$build$src$core$block_svg?b.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),b.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),a.getAudioManager().play("delete"));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DELETE})};
455
+ registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;(b=!a.isReadOnly()&&b!=null&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!a.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken())||a.getAudioManager().playErrorBeep();return b},callback(a,b,c,
456
+ d){b.preventDefault();b=d.focusedNode;b instanceof BlockSvg$$module$build$src$core$block_svg?b.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),b.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),a.getAudioManager().play("delete"));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DELETE})};
459
457
  isCopyable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)?a.isCopyable?a.isCopyable():a instanceof BlockSvg$$module$build$src$core$block_svg||a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment?a.isOwnDeletable()&&a.isOwnMovable():a.isDeletable()&&a.isMovable():!1};
460
458
  isCuttable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$shortcut_items(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()};
461
- registerCopy$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY,preconditionFn(b,c){c=c.focusedNode;b=b.isFlyout?b.targetWorkspace:b;return!!c&&!!b&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
462
- isCopyable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){c.preventDefault();c=e.focusedNode;if(!c||!isCopyable$$module$build$src$core$interfaces$i_copyable(c)||!isCopyable$$module$build$src$core$shortcut_items(c))return!1;d=b.isFlyout?b.targetWorkspace:b;if(!d)return!1;c.workspace.isFlyout||d.hideChaff();d=isDraggable$$module$build$src$core$interfaces$i_draggable(c)&&c.workspace==d?c.getRelativeToSurfaceXY():void 0;(c=!!copy$$module$build$src$core$clipboard(c,d))&&showCopiedHint$$module$build$src$core$hints(b);
463
- return c},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.COPY_SHORTCUT})};
464
- registerCut$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT,preconditionFn(b,c){c=c.focusedNode;return!!c&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
465
- isCuttable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){d=e.focusedNode;if(!d||!isCuttable$$module$build$src$core$shortcut_items(d)||!isCopyable$$module$build$src$core$interfaces$i_copyable(d))return!1;e=isDraggable$$module$build$src$core$interfaces$i_draggable(d)?d.getRelativeToSurfaceXY():void 0;e=copy$$module$build$src$core$clipboard(d,e);d instanceof BlockSvg$$module$build$src$core$block_svg?(d.checkAndDelete(),c.preventDefault()):isDeletable$$module$build$src$core$interfaces$i_deletable(d)&&
466
- ($.setGroup$$module$build$src$core$events$utils(!0),d.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),b.getAudioManager().play("delete"),c.preventDefault());e&&showCutHint$$module$build$src$core$hints(b);return!!e},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.CUT_SHORTCUT})};
459
+ registerCopy$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY,preconditionFn(b,c){c=c.focusedNode;var d=b.isFlyout?b.targetWorkspace:b;(c=!!c&&!!d&&!d.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
460
+ isCopyable$$module$build$src$core$shortcut_items(c))||b.getAudioManager().playErrorBeep();return c},callback(b,c,d,e){c.preventDefault();c=e.focusedNode;if(!c||!isCopyable$$module$build$src$core$interfaces$i_copyable(c)||!isCopyable$$module$build$src$core$shortcut_items(c))return!1;d=b.isFlyout?b.targetWorkspace:b;if(!d)return!1;c.workspace.isFlyout||d.hideChaff();d=isDraggable$$module$build$src$core$interfaces$i_draggable(c)&&c.workspace==d?c.getRelativeToSurfaceXY():void 0;(c=!!copy$$module$build$src$core$clipboard(c,
461
+ d))&&showCopiedHint$$module$build$src$core$hints(b);return c},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.COPY_SHORTCUT})};
462
+ registerCut$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT,preconditionFn(b,c){c=c.focusedNode;(c=!!c&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&
463
+ isCuttable$$module$build$src$core$shortcut_items(c))||b.getAudioManager().playErrorBeep();return c},callback(b,c,d,e){d=e.focusedNode;if(!d||!isCuttable$$module$build$src$core$shortcut_items(d)||!isCopyable$$module$build$src$core$interfaces$i_copyable(d))return!1;e=isDraggable$$module$build$src$core$interfaces$i_draggable(d)?d.getRelativeToSurfaceXY():void 0;e=copy$$module$build$src$core$clipboard(d,e);d instanceof BlockSvg$$module$build$src$core$block_svg?(d.checkAndDelete(),c.preventDefault()):
464
+ isDeletable$$module$build$src$core$interfaces$i_deletable(d)&&($.setGroup$$module$build$src$core$events$utils(!0),d.dispose(),$.setGroup$$module$build$src$core$events$utils(!1),b.getAudioManager().play("delete"),c.preventDefault());e&&showCutHint$$module$build$src$core$hints(b);return!!e},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.CUT_SHORTCUT})};
467
465
  registerPaste$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PASTE,preconditionFn(){var b=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!b||!b.rendered)return!1;
468
- b=b.isFlyout?b.targetWorkspace:b;return!!getLastCopiedData$$module$build$src$core$clipboard()&&!!b&&!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(b,c){var d=getLastCopiedData$$module$build$src$core$clipboard();if(!d)return!1;var e=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!e)return!1;clearPasteHints$$module$build$src$core$hints(b);b=e.isFlyout?e.targetWorkspace:e;if(!b||b.isReadOnly())return!1;if(c instanceof
469
- PointerEvent)return c=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b,new Coordinate$$module$build$src$core$utils$coordinate(c.clientX,c.clientY)),!!paste$$module$build$src$core$clipboard(d,b,c);c=getLastCopiedLocation$$module$build$src$core$clipboard();if(!c)return!!paste$$module$build$src$core$clipboard(d,b);var {left:f,top:g,width:h,height:k}=b.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(g,g+k,f,f+h)).contains(c.x,c.y))return!!paste$$module$build$src$core$clipboard(d,
470
- b);c=new Coordinate$$module$build$src$core$utils$coordinate(f+h/2,g+k/2);return!!paste$$module$build$src$core$clipboard(d,b,c)},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.PASTE_SHORTCUT})};
466
+ var c=b.isFlyout?b.targetWorkspace:b;(c=!!getLastCopiedData$$module$build$src$core$clipboard()&&!!c&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken())||b.getAudioManager().playErrorBeep();return c},callback(b,c){var d=getLastCopiedData$$module$build$src$core$clipboard();if(!d)return!1;var e=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!e)return!1;clearPasteHints$$module$build$src$core$hints(b);b=e.isFlyout?e.targetWorkspace:
467
+ e;if(!b||b.isReadOnly())return!1;if(c instanceof PointerEvent)return c=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b,new Coordinate$$module$build$src$core$utils$coordinate(c.clientX,c.clientY)),!!paste$$module$build$src$core$clipboard(d,b,c);c=getLastCopiedLocation$$module$build$src$core$clipboard();if(!c)return!!paste$$module$build$src$core$clipboard(d,b);var {left:f,top:g,width:h,height:k}=b.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(g,
468
+ g+k,f,f+h)).contains(c.x,c.y))return!!paste$$module$build$src$core$clipboard(d,b);c=new Coordinate$$module$build$src$core$utils$coordinate(f+h/2,g+k/2);return!!paste$$module$build$src$core$clipboard(d,b,c)},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.PASTE_SHORTCUT})};
471
469
  registerUndo$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.UNDO,preconditionFn(b){return!b.isReadOnly()&&!b.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},
472
470
  callback(b,c){b.hideChaff();b.undo();c.preventDefault();return!0},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.UNDO})};
473
471
  registerRedo$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD,KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Y,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]);
@@ -494,16 +492,17 @@ displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_DOWN},up:{na
494
492
  d.getNavigator().getPreviousNode();if(!c)return b.getAudioManager().playErrorBeep(),!1;b.getAudioManager().maybePlayScopeChangeAudioCue(c);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.UP],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NAVIGATE_UP}};for(let b of Object.values(a))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(b)};
495
493
  registerFocusWorkspace$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_WORKSPACE,preconditionFn:a=>!a.isDragging(),callback:a=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(resolveWorkspace$$module$build$src$core$shortcut_items(a));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.W],
496
494
  displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_WORKSPACE})};
497
- registerFocusToolbox$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_TOOLBOX,preconditionFn:a=>!a.isDragging(),callback:a=>{var b=a.getToolbox();if(b)keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),$.getFocusManager$$module$build$src$core$focus_manager().focusTree(b);else{a=a.getFlyout();if(!a)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
498
- $.getFocusManager$$module$build$src$core$focus_manager().focusTree(a.getWorkspace())}return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.T],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_TOOLBOX})};
495
+ registerFocusToolbox$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.FOCUS_TOOLBOX,preconditionFn:a=>!a.isDragging(),callback:(a,b)=>{var c=a.getToolbox();if(c)keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),$.getFocusManager$$module$build$src$core$focus_manager().focusTree(c);else{a=a.getFlyout();if(!a)return!1;keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
496
+ $.getFocusManager$$module$build$src$core$focus_manager().focusTree(a.getWorkspace())}b.preventDefault();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.T],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_FOCUS_TOOLBOX})};
499
497
  registerReadInformation$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.INFORMATION,preconditionFn:()=>!0,callback:a=>{var b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),c=a.getNavigator().getSourceBlockFromNode(b);if(c)return a=computeAriaLabel$$module$build$src$core$block_aria_composer(c,Verbosity$$module$build$src$core$utils$aria.LOQUACIOUS,
500
498
  !1),announceDynamicAriaState$$module$build$src$core$utils$aria(a),!0;if(b===a){b=resolveWorkspace$$module$build$src$core$shortcut_items(a);a=b.getTopBlocks().length;b=b.getTopComments().length;c=a===0?"WORKSPACE_CONTENTS_BLOCKS_ZERO":a===1?"WORKSPACE_CONTENTS_BLOCKS_ONE":"WORKSPACE_CONTENTS_BLOCKS_MANY";let d="";b>0&&(d=$.Msg$$module$build$src$core$msg[b===1?"WORKSPACE_CONTENTS_COMMENTS_ONE":"WORKSPACE_CONTENTS_COMMENTS_MANY"].replace("%1",String(b)));a=$.Msg$$module$build$src$core$msg[c].replace("%1",
501
499
  String(a)).replace("%2",d);announceDynamicAriaState$$module$build$src$core$utils$aria(a);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.I],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_INFORMATION})};
502
500
  registerReadExtendedInformation$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.I,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.EXTENDED_INFORMATION,preconditionFn:()=>!0,callback:b=>{b=b.getNavigator().getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());
503
501
  if(!b)return!1;for(var c=[],d=b,e;(e=d.outputConnection)==null?0:e.isConnected();)d=d.getParent();d!==b&&c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(d,Verbosity$$module$build$src$core$utils$aria.TERSE,!1));for(e=d.getParent();e;)c.push(computeAriaLabel$$module$build$src$core$block_aria_composer(e,Verbosity$$module$build$src$core$utils$aria.TERSE,!1)),e=e.getParent();if(c.length){c.reverse();let f;((f=b.outputConnection)==null?0:f.isConnected())||c.push($.Msg$$module$build$src$core$msg.CURRENT_BLOCK_ANNOUNCEMENT.replace("%1",
504
502
  computeAriaLabel$$module$build$src$core$block_aria_composer(b,Verbosity$$module$build$src$core$utils$aria.TERSE,!1)));announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.PARENT_BLOCKS_ANNOUNCEMENT.replace("%1",c.join(",")))}else announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.NO_PARENT_ANNOUNCEMENT);return!0},keyCodes:[a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_EXTENDED_INFORMATION})};
505
- registerDisconnectBlock$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DISCONNECT,preconditionFn:b=>!b.isDragging()&&!b.isReadOnly(),callback:(b,c)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
506
- b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;c=!(c instanceof KeyboardEvent&&c.shiftKey);$.setGroup$$module$build$src$core$events$utils(!0);b.unplug(c);$.setGroup$$module$build$src$core$events$utils(!1);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.X,a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DISCONNECT})};
503
+ registerDisconnectBlock$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DISCONNECT,preconditionFn:(b,c)=>{(c=!b.isDragging()&&!b.isReadOnly()&&c.focusedNode instanceof BlockSvg$$module$build$src$core$block_svg)||
504
+ b.getAudioManager().playErrorBeep();return c},callback:(b,c)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;c=!(c instanceof KeyboardEvent&&c.shiftKey);$.setGroup$$module$build$src$core$events$utils(!0);b.unplug(c);$.setGroup$$module$build$src$core$events$utils(!1);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.X,
505
+ a],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DISCONNECT})};
507
506
  registerStackNavigation$$module$build$src$core$shortcut_items=function(){var a=(c,d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())=>{var e=c.getNavigator();for(let f=d;f&&f!==c;f=e.getParent(f))d=f;return isSelectable$$module$build$src$core$interfaces$i_selectable(d)?d:null},b={name:names$$module$build$src$core$shortcut_items.PREVIOUS_STACK,preconditionFn:c=>!c.isDragging()&&!!a(c)&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),
508
507
  callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d=a(c);if(!d)return!1;c=a(c,c.getNavigator().navigateStacks(d,-1));if(!c)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.B],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_PREVIOUS_STACK};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.NEXT_STACK,
509
508
  preconditionFn:c=>!c.isDragging()&&!!a(c)&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv(),callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);var d=a(c);if(!d)return!1;c=c.getNavigator().navigateStacks(d,1);if(!c)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.N],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NEXT_STACK});
@@ -515,8 +514,8 @@ ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({nam
515
514
  return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.H],displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_NEXT_HEADING});ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(d)};
516
515
  registerPerformAction$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PERFORM_ACTION,preconditionFn:a=>!a.isDragging()&&!isVisible$$module$build$src$core$dropdowndiv()&&!isVisible$$module$build$src$core$widgetdiv()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken(),callback:(a,b)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
517
516
  if((a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())&&"performAction"in a){b.preventDefault();let c;(c=a.performAction)==null||c.call(a,b);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.SPACE],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_PERFORM_ACTION})};
518
- registerDuplicate$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DUPLICATE,preconditionFn:(a,b)=>{({focusedNode:b}=b);return!a.isDragging()&&!a.isReadOnly()&&!a.isFlyout&&(b instanceof BlockSvg$$module$build$src$core$block_svg?b.isDuplicatable():!0)},callback:(a,b,c,d)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);b=
519
- isCopyable$$module$build$src$core$interfaces$i_copyable(d.focusedNode)&&d.focusedNode;return b?(b=b.toCopyData())?!!paste$$module$build$src$core$clipboard(b,a):!1:!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.D],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DUPLICATE})};
517
+ registerDuplicate$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DUPLICATE,preconditionFn:(a,b)=>{({focusedNode:b}=b);(b=!a.isDragging()&&!a.isReadOnly()&&!a.isFlyout&&(b instanceof BlockSvg$$module$build$src$core$block_svg?b.isDuplicatable():!0))||a.getAudioManager().playErrorBeep();return b},callback:(a,b,c,d)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
518
+ b=isCopyable$$module$build$src$core$interfaces$i_copyable(d.focusedNode)&&d.focusedNode;return b?(b=b.toCopyData())?!!paste$$module$build$src$core$clipboard(b,a):!1:!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.D],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_DUPLICATE})};
520
519
  registerCleanup$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CLEANUP,preconditionFn:a=>!a.isDragging()&&!a.isReadOnly()&&!a.isFlyout,callback:a=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);a.cleanUp();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.C],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_CLEANUP})};
521
520
  registerShowTooltip$$module$build$src$core$shortcut_items=function(){var a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.J,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.SHOW_TOOLTIP,preconditionFn:b=>!b.isDragging(),callback:b=>{var c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();
522
521
  c!==null&&(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0),display$$module$build$src$core$tooltip(c,b));return!0},keyCodes:[a],allowCollision:!0,displayText:()=>$.Msg$$module$build$src$core$msg.SHORTCUTS_SHOW_TOOLTIP})};
@@ -550,13 +549,8 @@ isLegalName$$module$build$src$core$procedures=function(a,b,c){return!isNameUsed$
550
549
  isNameUsed$$module$build$src$core$procedures=function(a,b,c){for(let d of b.getAllBlocks(!1))if(d!==c&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&$.Names$$module$build$src$core$names.equals(d.getProcedureDef()[0],a))return!0;c=c&&isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)?c==null?void 0:c.getProcedureModel():void 0;for(let d of b.getProcedureMap().getProcedures())if(d!==c&&$.Names$$module$build$src$core$names.equals(d.getName(),
551
550
  a))return!0;return!1};
552
551
  $.rename$$module$build$src$core$procedures=function(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;a=a.trim();var c=$.findLegalName$$module$build$src$core$procedures(a,b);isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(b)&&!b.isInsertionMarker()&&b.getProcedureModel().setName(c);var d=this.getValue();if(d!==a&&d!==c)for(a=b.workspace.getAllBlocks(!1),b=0;b<a.length;b++){let e=a[b];e.renameProcedure&&e.renameProcedure(d,c)}return c};
553
- xmlFlyoutCategory$$module$build$src$core$procedures=function(a){function b(f,g){for(let k=0;k<f.length;k++){var h=f[k][0];let l=f[k][1],m=$.createElement$$module$build$src$core$utils$xml("block");m.setAttribute("type",g);m.setAttribute("gap","16");let n=$.createElement$$module$build$src$core$utils$xml("mutation");n.setAttribute("name",h);m.appendChild(n);for(h=0;h<l.length;h++){let p=$.createElement$$module$build$src$core$utils$xml("arg");p.setAttribute("name",l[h]);n.appendChild(p)}c.push(m)}}var c=
554
- [];if(Blocks$$module$build$src$core$blocks.procedures_defnoreturn){var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_defnoreturn");d.setAttribute("gap","16");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE));d.appendChild(e);c.push(d)}Blocks$$module$build$src$core$blocks.procedures_defreturn&&
555
- (d=$.createElement$$module$build$src$core$utils$xml("block"),d.setAttribute("type","procedures_defreturn"),d.setAttribute("gap","16"),e=$.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name","NAME"),e.appendChild($.createTextNode$$module$build$src$core$utils$xml($.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE)),d.appendChild(e),c.push(d));Blocks$$module$build$src$core$blocks.procedures_ifreturn&&(d=$.createElement$$module$build$src$core$utils$xml("block"),
556
- d.setAttribute("type","procedures_ifreturn"),d.setAttribute("gap","16"),c.push(d));c.length&&c[c.length-1].setAttribute("gap","24");a=allProcedures$$module$build$src$core$procedures(a);b(a[0],"procedures_callnoreturn");b(a[1],"procedures_callreturn");return c};internalFlyoutCategory$$module$build$src$core$procedures=function(a){return flyoutCategory$$module$build$src$core$procedures(a,!1)};
557
- flyoutCategory$$module$build$src$core$procedures=function(a,b=!0){function c(e,f){for(let [g,h]of e)d.push({kind:"block",type:f,gap:16,extraState:{name:g,params:h}})}if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.Procedures.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),xmlFlyoutCategory$$module$build$src$core$procedures(a);var d=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&
558
- d.push({kind:"block",type:"procedures_defnoreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_defreturn&&d.push({kind:"block",type:"procedures_defreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_ifreturn&&d.push({kind:"block",type:"procedures_ifreturn",gap:16});d.length&&(d[d.length-1].gap=24);a=allProcedures$$module$build$src$core$procedures(a);
559
- c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};
552
+ flyoutCategory$$module$build$src$core$procedures=function(a){function b(d,e){for(let [f,g]of d)c.push({kind:"block",type:e,gap:16,extraState:{name:f,params:g}})}var c=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&c.push({kind:"block",type:"procedures_defnoreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_PROCEDURE}});Blocks$$module$build$src$core$blocks.procedures_defreturn&&c.push({kind:"block",type:"procedures_defreturn",gap:16,fields:{NAME:$.Msg$$module$build$src$core$msg.PROCEDURES_DEFRETURN_PROCEDURE}});
553
+ Blocks$$module$build$src$core$blocks.procedures_ifreturn&&c.push({kind:"block",type:"procedures_ifreturn",gap:16});c.length&&(c[c.length-1].gap=24);a=allProcedures$$module$build$src$core$procedures(a);b(a[0],"procedures_callnoreturn");b(a[1],"procedures_callreturn");return c};
560
554
  updateMutatorFlyout$$module$build$src$core$procedures=function(a){var b=[],c=a.getBlocksByType("procedures_mutatorarg",!1);for(let f=0,g;g=c[f];f++)b.push(g.getFieldValue("NAME"));c=$.createElement$$module$build$src$core$utils$xml("xml");var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_mutatorarg");var e=$.createElement$$module$build$src$core$utils$xml("field");e.setAttribute("name","NAME");b=generateUniqueNameFromOptions$$module$build$src$core$variables($.DEFAULT_ARG$$module$build$src$core$procedures,
561
555
  b);b=$.createTextNode$$module$build$src$core$utils$xml(b);e.appendChild(b);d.appendChild(e);c.appendChild(d);a.updateToolbox(c)};
562
556
  mutatorOpenListener$$module$build$src$core$procedures=function(a){if(isBubbleOpen$$module$build$src$core$events$predicates(a)&&a.bubbleType==="mutator"&&a.isOpen&&a.blockId){a=getWorkspaceById$$module$build$src$core$common(a.workspaceId).getBlockById(a.blockId);var b=a.type;if(b==="procedures_defnoreturn"||b==="procedures_defreturn")a=a.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),updateMutatorFlyout$$module$build$src$core$procedures(a),a.addChangeListener(mutatorChangeListener$$module$build$src$core$procedures)}};
@@ -570,12 +564,9 @@ isDynamicShape$$module$build$src$core$renderers$common$constants=function(a){ret
570
564
  register$$module$build$src$core$renderers$common$block_rendering=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a,b)};unregister$$module$build$src$core$renderers$common$block_rendering=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a)};
571
565
  init$$module$build$src$core$renderers$common$block_rendering=function(a,b,c){a=new (getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a))(a);a.init(b,c);return a};stringButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"String")};
572
566
  numberButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Number")};colourButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Colour")};
573
- internalFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){return flyoutCategory$$module$build$src$core$variables_dynamic(a,!1)};
574
- flyoutCategory$$module$build$src$core$variables_dynamic=function(a,b=!0){Blocks$$module$build$src$core$blocks.variables_set_dynamic||Blocks$$module$build$src$core$blocks.variables_get_dynamic||console.warn("There are no dynamic variable blocks, but there is a dynamic variable category.");if(b)return $.warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.VariablesDynamic.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."),
575
- xmlFlyoutCategory$$module$build$src$core$variables_dynamic(a);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);return[{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE,callbackkey:"CREATE_VARIABLE_STRING"},
576
- {kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE,callbackkey:"CREATE_VARIABLE_NUMBER"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE,callbackkey:"CREATE_VARIABLE_COLOUR"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,a.getVariableMap().getAllVariables(),!1,"variables_get_dynamic","variables_set_dynamic")]};
577
- xmlFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){var b=[],c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE);
578
- c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);a=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic(a);return b=b.concat(a)};
567
+ flyoutCategory$$module$build$src$core$variables_dynamic=function(a){Blocks$$module$build$src$core$blocks.variables_set_dynamic||Blocks$$module$build$src$core$blocks.variables_get_dynamic||console.warn("There are no dynamic variable blocks, but there is a dynamic variable category.");a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);
568
+ a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);return[{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE,callbackkey:"CREATE_VARIABLE_STRING"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE,callbackkey:"CREATE_VARIABLE_NUMBER"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE,callbackkey:"CREATE_VARIABLE_COLOUR"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,
569
+ a.getVariableMap().getAllVariables(),!1,"variables_get_dynamic","variables_set_dynamic")]};
579
570
  flyoutCategoryBlocks$$module$build$src$core$variables_dynamic=function(a){a=a.getVariableMap().getAllVariables();var b=[];if(a.length>0){if(Blocks$$module$build$src$core$blocks.variables_set_dynamic){var c=a[a.length-1];let d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set_dynamic");d.setAttribute("gap","24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}if(Blocks$$module$build$src$core$blocks.variables_get_dynamic){a.sort(compareByName$$module$build$src$core$variables);
580
571
  for(let d=0,e;e=a[d];d++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get_dynamic"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(e)),b.push(c)}}return b};resizeSvgContents$$module$build$src$core$workspace_svg=function(a){a.resizeContents()};
581
572
  saveProcedure$$module$build$src$core$serialization$procedures=function(a){var b=a.saveState();if(!a.getParameters().length)return b;b.parameters=a.getParameters().map(c=>c.saveState());return b};loadProcedure$$module$build$src$core$serialization$procedures=function(a,b,c,d){a=a.loadState(c,d);if(!c.parameters)return a;for(let [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a};
@@ -735,11 +726,11 @@ return!1}removeAllKeyMappings(a){for(let b of this.keyMap.keys())this.removeKeyM
735
726
  for(let d of c){c=this.shortcuts.get(d);let e;if(!c||c.preconditionFn&&!c.preconditionFn(a,{focusedNode:(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())!=null?e:void 0}))continue;let f,g;if((f=c.callback)==null?0:f.call(c,a,b,c,{focusedNode:(g=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())!=null?g:void 0}))return!0}return!1}getShortcutNamesByKeyCode(a){var b;return((b=this.keyMap.get(a))==null?void 0:b.slice())||[]}getKeyCodesByShortcutName(a){var b=
736
727
  [];for(let [c,d]of this.keyMap)d.indexOf(a)>-1&&b.push(c);return b}serializeKeyEvent(a){var b="";for(let c in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)a.getModifierState(c)&&(b!==""&&(b+="+"),b+=c);b!==""&&a.keyCode?b+="+"+a.keyCode:a.keyCode&&(b=String(a.keyCode));return b}checkModifiers(a){for(let b of a)if(!(b in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys))throw Error(b+" is not a valid modifier key.");}createSerializedKey(a,b){var c="";
737
728
  if(b){this.checkModifiers(b);for(let d in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)b.includes(ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys[d])&&(c!==""&&(c+="+"),c+=d)}c!==""&&a?c+="+"+a:a&&(c=`${a}`);return c}};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry=new ShortcutRegistry$$module$build$src$core$shortcut_registry;
738
- (function(a){a=a.modifierKeys||(a.modifierKeys={});a[a.Shift=16]="Shift";a[a.Control=17]="Control";a[a.Alt=18]="Alt";a[a.Meta=91]="Meta"})(ShortcutRegistry$$module$build$src$core$shortcut_registry||(ShortcutRegistry$$module$build$src$core$shortcut_registry={}));var module$build$src$core$shortcut_registry={};module$build$src$core$shortcut_registry.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;
729
+ (function(a){a=a.modifierKeys||(a.modifierKeys={});a[a.Shift=16]="Shift";a[a.Control=17]="Control";a[a.Alt=18]="Alt";a[a.Meta=91]="Meta"})(ShortcutRegistry$$module$build$src$core$shortcut_registry||(ShortcutRegistry$$module$build$src$core$shortcut_registry={}));var module$build$src$core$shortcut_registry={};module$build$src$core$shortcut_registry.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;var previousWarnings$$module$build$src$core$utils$deprecation=new Set,module$build$src$core$utils$deprecation={};module$build$src$core$utils$deprecation.warn=warn$$module$build$src$core$utils$deprecation;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;
739
730
  module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$common;module$build$src$core$common.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$common.draggingConnections=draggingConnections$$module$build$src$core$common;module$build$src$core$common.fireSelectedEvent=fireSelectedEvent$$module$build$src$core$common;module$build$src$core$common.getAllWorkspaces=getAllWorkspaces$$module$build$src$core$common;
740
731
  module$build$src$core$common.getBlockTypeCounts=getBlockTypeCounts$$module$build$src$core$common;module$build$src$core$common.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$common.getParentContainer=getParentContainer$$module$build$src$core$common;module$build$src$core$common.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$common.getWorkspaceById=getWorkspaceById$$module$build$src$core$common;
741
732
  module$build$src$core$common.globalShortcutHandler=globalShortcutHandler$$module$build$src$core$common;module$build$src$core$common.registerWorkspace=registerWorkspace$$module$build$src$core$common;module$build$src$core$common.setMainWorkspace=setMainWorkspace$$module$build$src$core$common;module$build$src$core$common.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$common.setSelected=setSelected$$module$build$src$core$common;
742
- module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){var a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId));
733
+ module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;module$build$src$core$common.unregisterWorkspace=unregisterWorkspace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){var a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId));
743
734
  if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a}},module$build$src$core$events$events_abstract={};module$build$src$core$events$events_abstract.Abstract=Abstract$$module$build$src$core$events$events_abstract;var UiBase$$module$build$src$core$events$events_ui_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.recordUndo=!1;this.isUiEvent=!0;this.isBlank=typeof a==="undefined";this.workspaceId=a?a:""}},module$build$src$core$events$events_ui_base={};module$build$src$core$events$events_ui_base.UiBase=UiBase$$module$build$src$core$events$events_ui_base;var Click$$module$build$src$core$events$events_click=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){b=a?a.workspace.id:b;b===null&&(b=void 0);super(b);this.type=EventType$$module$build$src$core$events$type.CLICK;this.blockId=a?a.id:void 0;this.targetType=c}toJson(){var a=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");a.targetType=this.targetType;a.blockId=this.blockId;
744
735
  return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new Click$$module$build$src$core$events$events_click);b.targetType=a.targetType;b.blockId=a.blockId;return b}},ClickTarget$$module$build$src$core$events$events_click;(function(a){a.BLOCK="block";a.WORKSPACE="workspace";a.ZOOM_CONTROLS="zoom_controls"})(ClickTarget$$module$build$src$core$events$events_click||(ClickTarget$$module$build$src$core$events$events_click={}));
745
736
  register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.CLICK,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var module$build$src$core$utils$array={};module$build$src$core$utils$array.removeElem=removeElem$$module$build$src$core$utils$array;var Capability$$module$build$src$core$component_manager=class{constructor(a){this.name=a}toString(){return this.name}};Capability$$module$build$src$core$component_manager.POSITIONABLE=new Capability$$module$build$src$core$component_manager("positionable");Capability$$module$build$src$core$component_manager.DRAG_TARGET=new Capability$$module$build$src$core$component_manager("drag_target");Capability$$module$build$src$core$component_manager.DELETE_AREA=new Capability$$module$build$src$core$component_manager("delete_area");
@@ -1573,11 +1564,11 @@ module$build$src$core$events$events.clearPendingUndo=clearPendingUndo$$module$bu
1573
1564
  module$build$src$core$events$events.fire=fire$$module$build$src$core$events$utils;module$build$src$core$events$events.fromJson=fromJson$$module$build$src$core$events$utils;module$build$src$core$events$events.get=get$$module$build$src$core$events$utils;module$build$src$core$events$events.getDescendantIds=getDescendantIds$$module$build$src$core$events$utils;module$build$src$core$events$events.getGroup=$.getGroup$$module$build$src$core$events$utils;module$build$src$core$events$events.getRecordUndo=getRecordUndo$$module$build$src$core$events$utils;
1574
1565
  module$build$src$core$events$events.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$events.setGroup=$.setGroup$$module$build$src$core$events$utils;module$build$src$core$events$events.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var module$build$src$core$interfaces$i_legacy_procedure_blocks={};module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureCallBlock=isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureDefBlock=isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;var module$build$src$core$interfaces$i_variable_backed_parameter_model={};module$build$src$core$interfaces$i_variable_backed_parameter_model.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.scopeChangeAudioCuesEnabled=this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}setScopeChangeAudioCuesEnabled(a){this.scopeChangeAudioCuesEnabled=a}getScopeChangeAudioCuesEnabled(){return this.scopeChangeAudioCuesEnabled}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):
1575
1566
  document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=new KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller,module$build$src$core$keyboard_navigation_controller={};module$build$src$core$keyboard_navigation_controller.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;
1576
- module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var previousWarnings$$module$build$src$core$utils$deprecation=new Set,module$build$src$core$utils$deprecation={};module$build$src$core$utils$deprecation.warn=$.warn$$module$build$src$core$utils$deprecation;var CATEGORY_NAME$$module$build$src$core$variables="VARIABLE",VAR_LETTER_OPTIONS$$module$build$src$core$variables="ijkmnopqrstuvwxyzabcdefgh",TEST_ONLY$$module$build$src$core$variables={generateUniqueNameInternal:generateUniqueNameInternal$$module$build$src$core$variables},module$build$src$core$variables={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables,TEST_ONLY:TEST_ONLY$$module$build$src$core$variables,VAR_LETTER_OPTIONS:VAR_LETTER_OPTIONS$$module$build$src$core$variables};
1567
+ module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var CATEGORY_NAME$$module$build$src$core$variables="VARIABLE",VAR_LETTER_OPTIONS$$module$build$src$core$variables="ijkmnopqrstuvwxyzabcdefgh",TEST_ONLY$$module$build$src$core$variables={generateUniqueNameInternal:generateUniqueNameInternal$$module$build$src$core$variables},module$build$src$core$variables={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables,TEST_ONLY:TEST_ONLY$$module$build$src$core$variables,VAR_LETTER_OPTIONS:VAR_LETTER_OPTIONS$$module$build$src$core$variables};
1577
1568
  module$build$src$core$variables.allDeveloperVariables=$.allDeveloperVariables$$module$build$src$core$variables;module$build$src$core$variables.allUsedVarModels=$.allUsedVarModels$$module$build$src$core$variables;module$build$src$core$variables.compareByName=compareByName$$module$build$src$core$variables;module$build$src$core$variables.createVariableButtonHandler=createVariableButtonHandler$$module$build$src$core$variables;module$build$src$core$variables.deleteVariable=$.deleteVariable$$module$build$src$core$variables;
1578
1569
  module$build$src$core$variables.flyoutCategory=flyoutCategory$$module$build$src$core$variables;module$build$src$core$variables.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueName=generateUniqueName$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueNameFromOptions=generateUniqueNameFromOptions$$module$build$src$core$variables;module$build$src$core$variables.generateVariableFieldDom=generateVariableFieldDom$$module$build$src$core$variables;
1579
- module$build$src$core$variables.getAddedVariables=getAddedVariables$$module$build$src$core$variables;module$build$src$core$variables.getOrCreateVariablePackage=$.getOrCreateVariablePackage$$module$build$src$core$variables;module$build$src$core$variables.getVariable=$.getVariable$$module$build$src$core$variables;module$build$src$core$variables.getVariableUsesById=getVariableUsesById$$module$build$src$core$variables;module$build$src$core$variables.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$variables;
1580
- module$build$src$core$variables.jsonFlyoutCategoryBlocks=jsonFlyoutCategoryBlocks$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithAnyType=nameUsedWithAnyType$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithConflictingParam=nameUsedWithConflictingParam$$module$build$src$core$variables;module$build$src$core$variables.promptName=promptName$$module$build$src$core$variables;module$build$src$core$variables.renameVariable=$.renameVariable$$module$build$src$core$variables;var DeserializationError$$module$build$src$core$serialization$exceptions=class extends Error{},MissingBlockType$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Expected to find a 'type' property, defining the block type");this.state=a}},MissingConnection$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a,
1570
+ module$build$src$core$variables.getAddedVariables=getAddedVariables$$module$build$src$core$variables;module$build$src$core$variables.getOrCreateVariablePackage=$.getOrCreateVariablePackage$$module$build$src$core$variables;module$build$src$core$variables.getVariable=$.getVariable$$module$build$src$core$variables;module$build$src$core$variables.getVariableUsesById=getVariableUsesById$$module$build$src$core$variables;module$build$src$core$variables.jsonFlyoutCategoryBlocks=jsonFlyoutCategoryBlocks$$module$build$src$core$variables;
1571
+ module$build$src$core$variables.nameUsedWithAnyType=nameUsedWithAnyType$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithConflictingParam=nameUsedWithConflictingParam$$module$build$src$core$variables;module$build$src$core$variables.promptName=promptName$$module$build$src$core$variables;module$build$src$core$variables.renameVariable=$.renameVariable$$module$build$src$core$variables;var DeserializationError$$module$build$src$core$serialization$exceptions=class extends Error{},MissingBlockType$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Expected to find a 'type' property, defining the block type");this.state=a}},MissingConnection$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a,
1581
1572
  b,c){super(`The block ${b.toDevString()} is missing a(n) ${a}
1582
1573
  connection`);this.block=b;this.state=c}},BadConnectionCheck$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a,b,c,d){super(`The block ${c.toDevString()} could not connect its
1583
1574
  ${b} to its parent, because: ${a}`);this.childBlock=c;this.childState=d}},RealChildOfShadow$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Encountered a real block which is defined as a child of a shadow\nblock. It is an invariant of Blockly that shadow blocks only have shadow\nchildren");this.state=a}},UnregisteredIcon$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a,
@@ -1835,7 +1826,7 @@ a*a)}bumpAwayFrom(a,b=!1){if(!this.sourceBlock_.workspace.isDragging()){var c=$.
1835
1826
  else if(e.isMovable())g=!1,c=-c,d=-d;else return;b=g?a:this;a=g?this:a;e=g?f:e;e.RTL&&(c=-c);e.moveBy(b.x+c-a.x,b.y+d-a.y,["bump"])}}}moveTo(a,b){var c=!1;this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.WILL_TRACK?(this.db.addConnection(this,b),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED,c=!0):this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&
1836
1827
  (this.db.removeConnection(this,this.y),this.db.addConnection(this,b),c=!0);this.x=a;this.y=b;return c}moveBy(a,b){return this.moveTo(this.x+a,this.y+b)}moveToOffset(a){return this.moveTo(a.x+this.offsetInBlock.x,a.y+this.offsetInBlock.y)}setOffsetInBlock(a,b){this.offsetInBlock.x=a;this.offsetInBlock.y=b}getOffsetInBlock(){return this.offsetInBlock}tightenEfficiently(){var a=this.targetConnection,b=this.targetBlock();a&&b&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.offsetInBlock,
1837
1828
  a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}recomputeAriaContext(a){var b=this.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?$.Msg$$module$build$src$core$msg.INPUT_LABEL_VALUE:$.Msg$$module$build$src$core$msg.INPUT_LABEL_STATEMENT;setRole$$module$build$src$core$utils$aria(a,Role$$module$build$src$core$utils$aria.FIGURE);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.ROLEDESCRIPTION,
1838
- b);var c,d,e;if(b=(e=this.getParentInput())!=null?e:(c=this.getSourceBlock().getTopStackBlock().previousConnection)==null?void 0:(d=c.targetConnection)==null?void 0:d.getParentInput()){var f;c=(f=b==null?void 0:b.getAriaLabelText())!=null?f:getInputLabelsSubset$$module$build$src$core$block_aria_composer(b.getSourceBlock(),b).join(", ");this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
1829
+ b);var c,d,e;if(b=(e=this.getParentInput())!=null?e:(c=this.getSourceBlock().getTopStackBlock().previousConnection)==null?void 0:(d=c.targetConnection)==null?void 0:d.getParentInput()){var f;c=(f=b==null?void 0:b.getAriaLabelText())!=null?f:getInputLabelsSubset$$module$build$src$core$block_aria_composer(b.getSourceBlock(),b,!1).join(", ");this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,
1839
1830
  $.Msg$$module$build$src$core$msg.INPUT_LABEL_END_STATEMENT.replace("%1",c)):setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,c)}else setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.INPUT_LABEL_EMPTY)}highlight(){this.highlighted=!0;var a=this.findHighlightSvg();if(a){a.style.display="";let b;(b=a.parentElement)==null||b.appendChild(a);this.recomputeAriaContext(a)}}unhighlight(){this.highlighted=
1840
1831
  !1;var a=this.findHighlightSvg();a&&(a.style.display="none")}isHighlighted(){return this.highlighted}setTracking(a){a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED||!a&&this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(a?(this.db.addConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED):
1841
1832
  (this.trackedState===RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED&&this.db.removeConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.UNTRACKED))}stopTrackingAll(){this.setTracking(!1);if(this.targetConnection){let a=this.targetBlock().getDescendants(!1);for(let b=0;b<a.length;b++){let c=a[b],d=c.getConnections_(!0);for(let e=0;e<d.length;e++)d[e].setTracking(!1);for(let e of c.getIcons())hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&
@@ -1871,15 +1862,14 @@ if(!c&&a)throw Error("Block not connected to new parent.");if(c&&!a)throw Error(
1871
1862
  a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setEditable(a){this.editable=a;for(let b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}getFullBlockField(){if(!this.isSimpleReporter())return null;var a,b=(a=this.inputList[0])==null?void 0:a.fieldRow[0];return(b==null?0:b.isFullBlockField())?b:null}isSimpleReporter(){if(!this.outputConnection)return!1;
1872
1863
  for(let a of this.inputList)if(a.connection||a.fieldRow.length>1)return!1;return!0}getMatchingConnection(a,b){var c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!==a.length)throw Error("Connection lists did not match in length.");for(let d=0;d<a.length;d++)if(a[d]===b)return c[d];return null}setHelpUrl(a){this.helpUrl=a}setTooltip(a){this.tooltip=a}getTooltip(){return getTooltipOfObject$$module$build$src$core$tooltip(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue}setColour(a){a=
1873
1864
  parseBlockColour$$module$build$src$core$utils$parsing(a);this.hue=a.hue;this.colour_=a.hex}setStyle(a){this.styleName_=a}setOnChange(a){if(a&&typeof a!=="function")throw Error("onchange must be a function.");this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.onchange=a;this.onchangeWrapper=a.bind(this);this.workspace.addChangeListener(this.onchangeWrapper)}getField(a){if(typeof a!=="string")throw TypeError("Block.prototype.getField expects a string with the field name but received "+
1874
- (a===void 0?"nothing":a+" of type "+typeof a)+" instead");for(let b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(let a of this.inputList)for(let b of a.fieldRow)yield b}getVars(){$.warn$$module$build$src$core$utils$deprecation("Blockly.Block.getVars()","v13","v14","Blockly.Block.getVarModels().map(model => model.getId())");var a=[];for(let b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){var a=[];for(let b of this.getFields())if(b.referencesVariables()){let c=
1875
- this.workspace.getVariableMap().getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(let b of this.getFields())b.referencesVariables()&&a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(let c of this.getFields())c.referencesVariables()&&a===c.getValue()&&c.setValue(b)}getFieldValue(a){return(a=this.getField(a))?a.getValue():null}setFieldValue(a,b){var c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,b){if(a)b===
1876
- void 0&&(b=null),this.previousConnection||(this.previousConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=
1877
- this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)),this.nextConnection.setCheck(b);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose();this.nextConnection=null}}setOutput(a,b){if(a)b===void 0&&(b=null),this.outputConnection||(this.outputConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)),this.outputConnection.setCheck(b);
1878
- else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose();this.outputConnection=null}}setInputsInline(a){this.inputsInline!==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,"inline",null,this.inputsInline,a)),this.inputsInline=a)}getInputsInline(){if(this.inputsInline!==void 0)return this.inputsInline;
1879
- for(var a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof DummyInput$$module$build$src$core$inputs$dummy_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!1;for(a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof $.ValueInput$$module$build$src$core$inputs$value_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!0;for(a=0;a<this.inputList.length;a++)if(this.inputList[a]instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)return!0;
1880
- return!1}setOutputShape(a){this.outputShape_=a}getOutputShape(){return this.outputShape_}isEnabled(){return this.disabledReasons.size===0}setDisabledReason(a,b){a||this.workspace.options.disable||!this.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants)||b==MANUALLY_DISABLED$$module$build$src$core$constants||this.setDisabledReason(!1,MANUALLY_DISABLED$$module$build$src$core$constants);this.disabledReasons.has(b)!==a&&(a?this.disabledReasons.add(b):this.disabledReasons.delete(b),
1881
- a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"disabled",null,!a,a),a.setDisabledReason(b),fire$$module$build$src$core$events$utils(a))}getInheritedDisabled(){for(var a=this.getSurroundParent();a;){if(!a.isEnabled())return!0;a=a.getSurroundParent()}return!1}hasDisabledReason(a){return this.disabledReasons.has(a)}getDisabledReasons(){return this.disabledReasons}isCollapsed(){return this.collapsed_}setCollapsed(a){this.collapsed_!==a&&
1882
- (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,"collapsed",null,this.collapsed_,a)),this.collapsed_=a)}setAriaRoleDescriptionProvider(a){this.ariaRoleDescriptionProvider=a}getAriaRoleDescription(){if(this.ariaRoleDescriptionProvider)return typeof this.ariaRoleDescriptionProvider==="function"?this.ariaRoleDescriptionProvider():replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaRoleDescriptionProvider)}toString(a,
1865
+ (a===void 0?"nothing":a+" of type "+typeof a)+" instead");for(let b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(let a of this.inputList)for(let b of a.fieldRow)yield b}getVarModels(){var a=[];for(let b of this.getFields())if(b.referencesVariables()){let c=this.workspace.getVariableMap().getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(let b of this.getFields())b.referencesVariables()&&a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,
1866
+ b){for(let c of this.getFields())c.referencesVariables()&&a===c.getValue()&&c.setValue(b)}getFieldValue(a){return(a=this.getField(a))?a.getValue():null}setFieldValue(a,b){var c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,b){if(a)b===void 0&&(b=null),this.previousConnection||(this.previousConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT)),this.previousConnection.setCheck(b);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");
1867
+ this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)),this.nextConnection.setCheck(b);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose();this.nextConnection=null}}setOutput(a,b){if(a)b===void 0&&
1868
+ (b=null),this.outputConnection||(this.outputConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)),this.outputConnection.setCheck(b);else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose();this.outputConnection=null}}setInputsInline(a){this.inputsInline!==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,
1869
+ "inline",null,this.inputsInline,a)),this.inputsInline=a)}getInputsInline(){if(this.inputsInline!==void 0)return this.inputsInline;for(var a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof DummyInput$$module$build$src$core$inputs$dummy_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!1;for(a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof $.ValueInput$$module$build$src$core$inputs$value_input&&this.inputList[a]instanceof DummyInput$$module$build$src$core$inputs$dummy_input)return!0;
1870
+ for(a=0;a<this.inputList.length;a++)if(this.inputList[a]instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)return!0;return!1}setOutputShape(a){this.outputShape_=a}getOutputShape(){return this.outputShape_}isEnabled(){return this.disabledReasons.size===0}setDisabledReason(a,b){a||this.workspace.options.disable||!this.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants)||b==MANUALLY_DISABLED$$module$build$src$core$constants||this.setDisabledReason(!1,MANUALLY_DISABLED$$module$build$src$core$constants);
1871
+ this.disabledReasons.has(b)!==a&&(a?this.disabledReasons.add(b):this.disabledReasons.delete(b),a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"disabled",null,!a,a),a.setDisabledReason(b),fire$$module$build$src$core$events$utils(a))}getInheritedDisabled(){for(var a=this.getSurroundParent();a;){if(!a.isEnabled())return!0;a=a.getSurroundParent()}return!1}hasDisabledReason(a){return this.disabledReasons.has(a)}getDisabledReasons(){return this.disabledReasons}isCollapsed(){return this.collapsed_}setCollapsed(a){this.collapsed_!==
1872
+ 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,"collapsed",null,this.collapsed_,a)),this.collapsed_=a)}setAriaRoleDescriptionProvider(a){this.ariaRoleDescriptionProvider=a}getAriaRoleDescription(){if(this.ariaRoleDescriptionProvider)return typeof this.ariaRoleDescriptionProvider==="function"?this.ariaRoleDescriptionProvider():replaceMessageReferences$$module$build$src$core$utils$parsing(this.ariaRoleDescriptionProvider)}toString(a,
1883
1873
  b){b=this.toTokens(b);for(let d=2;d<b.length;d++)b[d-2]==="("&&b[d]===")"&&(b[d-2]=b[d-1],b.splice(d-1,2));var c="";b=b.reduce((d,e)=>{d=d+(c==="("||e===")"?"":" ")+e;c=e[e.length-1];return d},"");b=b.trim()||"???";a&&b.length>a&&(b=b.substring(0,a-3)+"...");return b}toTokens(a="?"){var b=[];for(let d of this.inputList)if(d.name!=COLLAPSED_INPUT_NAME$$module$build$src$core$constants){for(let e of d.fieldRow)b.push(e.getText());if(d.connection){let e=d.connection.targetBlock();if(e){var c=d.connection;
1884
1874
  let f=c.getCheck();!f&&c.targetConnection&&(f=c.targetConnection.getCheck());(c=!!f&&(f.includes("Boolean")||f.includes("Number")))&&b.push("(");b.push(...e.toTokens(a));c&&b.push(")")}else b.push(a)}}return b}appendValueInput(a){return this.appendInput(new $.ValueInput$$module$build$src$core$inputs$value_input(a,this))}appendStatementInput(a){this.statementInputCount++;return this.appendInput(new StatementInput$$module$build$src$core$inputs$statement_input(a,this))}appendDummyInput(a=""){return this.appendInput(new DummyInput$$module$build$src$core$inputs$dummy_input(a,
1885
1875
  this))}appendEndRowInput(a=""){return this.appendInput(new EndRowInput$$module$build$src$core$inputs$end_row_input(a,this))}appendInput(a){this.inputList.push(a);return a}appendInputFromRegistry(a,b){return(a=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a,!1))?this.appendInput(new a(b,this)):null}jsonInit(a){var b=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(b+"Must not have both an output and a previousStatement.");for(var c=
@@ -1932,16 +1922,16 @@ module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src
1932
1922
  "cutHint",screenreaderHintId$$module$build$src$core$hints="screenreaderHint",module$build$src$core$hints={};module$build$src$core$hints.clearMoveHints=clearMoveHints$$module$build$src$core$hints;module$build$src$core$hints.clearPasteHints=clearPasteHints$$module$build$src$core$hints;module$build$src$core$hints.showBlockNavigationHint=showBlockNavigationHint$$module$build$src$core$hints;module$build$src$core$hints.showConstrainedMovementHint=showConstrainedMovementHint$$module$build$src$core$hints;
1933
1923
  module$build$src$core$hints.showCopiedHint=showCopiedHint$$module$build$src$core$hints;module$build$src$core$hints.showCutHint=showCutHint$$module$build$src$core$hints;module$build$src$core$hints.showFlyoutLabelActionHint=showFlyoutLabelActionHint$$module$build$src$core$hints;module$build$src$core$hints.showHelpHint=showHelpHint$$module$build$src$core$hints;module$build$src$core$hints.showScreenreaderModeHint=showScreenreaderModeHint$$module$build$src$core$hints;
1934
1924
  module$build$src$core$hints.showUnconstrainedMoveHint=showUnconstrainedMoveHint$$module$build$src$core$hints;module$build$src$core$hints.showWorkspaceNavigationHint=showWorkspaceNavigationHint$$module$build$src$core$hints;var MoveMode$$module$build$src$core$dragging$block_drag_strategy;(function(a){a[a.CONSTRAINED=1]="CONSTRAINED";a[a.UNCONSTRAINED=2]="UNCONSTRAINED"})(MoveMode$$module$build$src$core$dragging$block_drag_strategy||(MoveMode$$module$build$src$core$dragging$block_drag_strategy={}));
1935
- var BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy=class{constructor(a){this.block=a;this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null;this.dragging=!1;this.allConnectionPairs=[];this.moveMode=MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.originalEventGroup="";this.WORKSPACE_MARGIN=this.BLOCK_CONNECTION_OFFSET=10;this.workspace=a.workspace}isMovable(){var a;return this.block.isOwnMovable()&&
1936
- !this.block.isDeadOrDying()&&!this.workspace.isReadOnly()&&(!this.block.isInFlyout||this.block.isEnabled()&&!((a=this.block.workspace.targetWorkspace)==null?0:a.isReadOnly()))}positionNewBlock(a,b){a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(a.workspace,a.getRelativeToSurfaceXY());a=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b.workspace,a);b.moveDuringDrag(a);if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){var c=b.workspace,
1937
- d=this.WORKSPACE_MARGIN;a=this.WORKSPACE_MARGIN;var e=Math.max($.config$$module$build$src$core$config.connectingSnapRadius,$.config$$module$build$src$core$config.snapRadius)+2,f=c.getTopBlocks(!0).filter(p=>p.id!==b.id).map(p=>{p=p.getBoundingRectangle();return new Rect$$module$build$src$core$utils$rect(p.top-e,p.bottom+e,p.left-e,p.right+e)}),g,h=(g=c.getToolbox())==null?void 0:g.getWidth();g=c.getParentSvg().clientWidth-(h!=null?h:0);c.getParentSvg();({width:h}=b.getHeightWidth());var k=function(p){for(let q of f)if(p.intersects(q))return q;
1938
- return null},l=a;c=c.getRenderer().getConstants().MIN_BLOCK_HEIGHT;var m=b.getBoundingRectangle();b.moveBy(l-m.left,d-m.top,["cleanup"]);m=b.getBoundingRectangle();for(var n=k(m);n!=null;)l=n.left+n.getWidth()+80,n=n.top+n.getHeight()+c,l+h<=g||(d=n,l=a),b.moveBy(l-m.left,d-m.top,["cleanup"]),m=b.getBoundingRectangle(),n=k(m)}}getTargetBlock(){if(this.block.isShadow()){var a=this.block.getParent();if(a)return a}else if(this.block.isInFlyout&&this.block.workspace.targetWorkspace&&(a=this.block.getRootBlock(),
1939
- a=save$$module$build$src$core$serialization$blocks(a)))return a=appendInternal$$module$build$src$core$serialization$blocks(a,this.block.workspace.targetWorkspace,{recordUndo:!0}),$.setRecordUndo$$module$build$src$core$events$utils(!1),this.positionNewBlock(this.block,a),$.setRecordUndo$$module$build$src$core$events$utils(!0),a;return this.block}announceMove(a=!1){if(this.connectionCandidate)a=computeMoveLabel$$module$build$src$core$block_aria_composer(this.connectionCandidate.local,this.connectionCandidate.neighbour,
1940
- this.hasMultipleCompatibleConnections.bind(this),a);else{let b=a?this.block.getStackBlocksCountLabel():"";a=$.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_WORKSPACE;a=a.replace("%1",b)}announceDynamicAriaState$$module$build$src$core$utils$aria(a.replace(/\s+/g," "))}hasMultipleCompatibleConnections(a=!0){var b=this.connectionCandidate;if(!b)return!1;var c=a?"local":"neighbour",d=a?"neighbour":"local";return this.allConnectionPairs.filter(e=>e[d]===b[d]&&e[c]!==b[c].getSourceBlock().nextConnection&&
1925
+ var BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy=class{constructor(a){this.block=a;this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null;this.dragging=!1;this.allConnectionPairs=[];this.moveMode=MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.originalEventGroup="";this.lastBlockDisabledReasons=new Map;this.WORKSPACE_MARGIN=this.BLOCK_CONNECTION_OFFSET=10;this.workspace=a.workspace}isMovable(){var a;
1926
+ return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&!this.workspace.isReadOnly()&&(!this.block.isInFlyout||this.block.isEnabled()&&!((a=this.block.workspace.targetWorkspace)==null?0:a.isReadOnly()))}positionNewBlock(a,b){a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(a.workspace,a.getRelativeToSurfaceXY());a=screenToWsCoordinates$$module$build$src$core$utils$svg_math(b.workspace,a);b.moveDuringDrag(a);if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){var c=
1927
+ b.workspace,d=this.WORKSPACE_MARGIN;a=this.WORKSPACE_MARGIN;var e=Math.max($.config$$module$build$src$core$config.connectingSnapRadius,$.config$$module$build$src$core$config.snapRadius)+2,f=c.getTopBlocks(!0).filter(p=>p.id!==b.id).map(p=>{p=p.getBoundingRectangle();return new Rect$$module$build$src$core$utils$rect(p.top-e,p.bottom+e,p.left-e,p.right+e)}),g,h=(g=c.getToolbox())==null?void 0:g.getWidth();g=c.getParentSvg().clientWidth-(h!=null?h:0);c.getParentSvg();({width:h}=b.getHeightWidth());var k=
1928
+ function(p){for(let q of f)if(p.intersects(q))return q;return null},l=a;c=c.getRenderer().getConstants().MIN_BLOCK_HEIGHT;var m=b.getBoundingRectangle();b.moveBy(l-m.left,d-m.top,["cleanup"]);m=b.getBoundingRectangle();for(var n=k(m);n!=null;)l=n.left+n.getWidth()+80,n=n.top+n.getHeight()+c,l+h<=g||(d=n,l=a),b.moveBy(l-m.left,d-m.top,["cleanup"]),m=b.getBoundingRectangle(),n=k(m)}}getTargetBlock(){if(this.block.isShadow()){var a=this.block.getParent();if(a)return a}else if(this.block.isInFlyout&&
1929
+ this.block.workspace.targetWorkspace&&(a=this.block.getRootBlock(),a=save$$module$build$src$core$serialization$blocks(a)))return a=appendInternal$$module$build$src$core$serialization$blocks(a,this.block.workspace.targetWorkspace,{recordUndo:!0}),$.setRecordUndo$$module$build$src$core$events$utils(!1),this.positionNewBlock(this.block,a),$.setRecordUndo$$module$build$src$core$events$utils(!0),a;return this.block}announceMove(a=!1){if(this.connectionCandidate)a=computeMoveLabel$$module$build$src$core$block_aria_composer(this.connectionCandidate.local,
1930
+ this.connectionCandidate.neighbour,this.hasMultipleCompatibleConnections.bind(this),a);else{let b=a?this.block.getStackBlocksCountLabel():"";a=$.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_WORKSPACE;a=a.replace("%1",b)}announceDynamicAriaState$$module$build$src$core$utils$aria(a.replace(/\s+/g," "))}hasMultipleCompatibleConnections(a=!0){var b=this.connectionCandidate;if(!b)return!1;var c=a?"local":"neighbour",d=a?"neighbour":"local";return this.allConnectionPairs.filter(e=>e[d]===b[d]&&e[c]!==b[c].getSourceBlock().nextConnection&&
1941
1931
  e[c].getSourceBlock().id===b[c].getSourceBlock().id).length>1}startDrag(a){this.updateMoveMode(a);var b=this.getTargetBlock();if(b!==this.block)return b.startDrag(a);this.block.workspace.recordDragTargets();this.dragging=!0;this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,this.workspace.options))(this.block);
1942
- startTextWidthCache$$module$build$src$core$utils$dom();this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();b=this.shouldHealStack(a);this.storeInitialConnections(b);this.shouldDisconnect(b)&&this.disconnectBlock(b);this.block.setDragging(!0);if(a instanceof KeyboardEvent){this.cacheAllConnectionPairs();if(a=this.updateConnectionPreview(this.block,new Coordinate$$module$build$src$core$utils$coordinate(0,0)))a=a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT?
1943
- new Coordinate$$module$build$src$core$utils$coordinate(a.x,a.y-this.block.getHeightWidth().height-this.BLOCK_CONNECTION_OFFSET):new Coordinate$$module$build$src$core$utils$coordinate(a.x+this.BLOCK_CONNECTION_OFFSET,a.y+this.BLOCK_CONNECTION_OFFSET),this.block.moveDuringDrag(a);this.allConnectionPairs.length?showConstrainedMovementHint$$module$build$src$core$hints(this.workspace):showUnconstrainedMoveHint$$module$build$src$core$hints(this.workspace)}else this.block.moveDuringDrag(this.startLoc);var c;
1944
- (c=this.workspace.getLayerManager())==null||c.moveToDragLayer(this.block);this.getVisibleBubbles(this.block).forEach(d=>{var e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(d,!1)});this.announceMove(!0);return this.block}cacheAllConnectionPairs(){var a=this.block.workspace.connectionChecker,b=[];this.allConnectionPairs=[];var c=this.getLocalConnections(this.block);for(let d of this.block.workspace.getTopBlocks(!0))b.push(...this.getAllConnections(d));for(let d of b)for(let e of c){let f;
1932
+ startTextWidthCache$$module$build$src$core$utils$dom();this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();b=this.shouldHealStack(a);this.storeInitialConnections(b);this.shouldDisconnect(b)&&this.disconnectBlock(b);this.block.setDragging(!0);this.enableAllDraggedBlocks(this.block);if(a instanceof KeyboardEvent){this.cacheAllConnectionPairs();if(a=this.updateConnectionPreview(this.block,new Coordinate$$module$build$src$core$utils$coordinate(0,0)))a=a.type===
1933
+ ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT?new Coordinate$$module$build$src$core$utils$coordinate(a.x,a.y-this.block.getHeightWidth().height-this.BLOCK_CONNECTION_OFFSET):new Coordinate$$module$build$src$core$utils$coordinate(a.x+this.BLOCK_CONNECTION_OFFSET,a.y+this.BLOCK_CONNECTION_OFFSET),this.block.moveDuringDrag(a);this.allConnectionPairs.length?showConstrainedMovementHint$$module$build$src$core$hints(this.workspace):showUnconstrainedMoveHint$$module$build$src$core$hints(this.workspace)}else this.block.moveDuringDrag(this.startLoc);
1934
+ var c;(c=this.workspace.getLayerManager())==null||c.moveToDragLayer(this.block);this.getVisibleBubbles(this.block).forEach(d=>{var e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(d,!1)});this.announceMove(!0);return this.block}cacheAllConnectionPairs(){var a=this.block.workspace.connectionChecker,b=[];this.allConnectionPairs=[];var c=this.getLocalConnections(this.block);for(let d of this.block.workspace.getTopBlocks(!0))b.push(...this.getAllConnections(d));for(let d of b)for(let e of c){let f;
1945
1935
  !a.canConnect(e,d,!0,Infinity)||((f=d.targetBlock())==null?0:f.isInsertionMarker())||this.allConnectionPairs.push({local:e,neighbour:d})}}getVisibleBubbles(a){return a.getDescendants(!1).flatMap(b=>b.getIcons()).filter(b=>hasBubble$$module$build$src$core$interfaces$i_has_bubble(b)&&b.bubbleIsVisible()).map(b=>b.getBubble()).filter(b=>!!b).sort((b,c)=>{b=b.getSvgRoot().compareDocumentPosition(c.getSvgRoot());return b&Node.DOCUMENT_POSITION_PRECEDING?1:b&Node.DOCUMENT_POSITION_FOLLOWING?-1:0})}shouldHealStack(a){return a instanceof
1946
1936
  PointerEvent?a.ctrlKey||a.metaKey:a instanceof KeyboardEvent?!(a.shiftKey||!this.block.previousConnection):!1}shouldDisconnect(a){return!!(this.block.getParent()||a&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(a){this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}storeInitialConnections(a){var b=null,c=null,d;if((d=this.block.outputConnection)==null?0:d.isConnected())b=this.block.outputConnection,c=this.block.outputConnection.targetConnection;
1947
1937
  else{let e;if((e=this.block.previousConnection)==null?0:e.isConnected())b=this.block.previousConnection,c=this.block.previousConnection.targetConnection}this.startParentConn=c;b&&c?this.connectionCandidate={local:b,neighbour:c,distance:0}:a&&(a=this.block.nextConnection,b=a==null?void 0:a.targetConnection,a&&b&&(this.connectionCandidate={local:a,neighbour:b,distance:0}),this.startChildConn=b!=null?b:null)}fireDragStartEvent(){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,
@@ -1956,18 +1946,19 @@ var {local:d,neighbour:e}=a;a=new Coordinate$$module$build$src$core$utils$coordi
1956
1946
  this.getClosestCandidate(this.block,a)}getClosestCandidate(a,b){var c=this.getSearchRadius();a=this.getLocalConnections(a);var d=null;for(let e of a){let {connection:f,radius:g}=e.closest(c,b);f&&(d={local:e,neighbour:f,distance:g},c=g)}return d}getSearchRadius(){return this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED?Infinity:this.connectionCandidate?$.config$$module$build$src$core$config.connectingSnapRadius:$.config$$module$build$src$core$config.snapRadius}getLocalConnections(a){var b=
1957
1947
  a.getConnections_(!1),c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);a=[a.outputConnection,a.previousConnection,a.nextConnection].filter(d=>!!d);c=[];for(let d of b)a.includes(d)||c.push(d);c.reverse();return[...a,...c]}endDrag(a,b){b===DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE&&disposeUiEffect$$module$build$src$core$block_animations(this.block);this.originalEventGroup=$.getGroup$$module$build$src$core$events$utils();this.fireDragEndEvent();this.fireMoveEvent();
1958
1948
  stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations();var c;(c=this.connectionPreviewer)==null||c.hidePreview();if(!this.block.isDeadOrDying()&&this.dragging){let d;(d=this.workspace.getLayerManager())==null||d.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.getVisibleBubbles(this.block).forEach(e=>{var f;return(f=this.workspace.getLayerManager())==null?void 0:f.moveOffDragLayer(e,BUBBLE$$module$build$src$core$layers,
1959
- !1)});this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):(b!==DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE&&this.workspace.getAudioManager().play("drop"),this.block.queueRender().then(()=>this.disposeStep()));this.allConnectionPairs=[]}disposeStep(){var a=$.getGroup$$module$build$src$core$events$utils();$.setGroup$$module$build$src$core$events$utils(this.originalEventGroup);this.block.snapToGrid();var b;
1960
- (b=this.connectionPreviewer)==null||b.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(a)}applyConnections(a){var {local:b,neighbour:c}=a;b.connect(c);var d=b.isSuperior()?c:b,e=this.block.getRootBlock();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{connectionUiEffect$$module$build$src$core$block_animations(d.getSourceBlock());setTimeout(()=>{e.bringToFront()},0)})}revertDrag(){var a;(a=this.connectionPreviewer)==null||a.hidePreview();
1961
- this.connectionCandidate=null;if(this.block.nextConnection){let b;(b=this.startChildConn)==null||b.connect(this.block.nextConnection)}if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.block.outputConnection&&this.startParentConn.connect(this.block.outputConnection);break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.block.previousConnection&&this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveDuringDrag(this.startLoc);
1949
+ !1)});this.block.setDragging(!1);this.redisableAllDraggedBlocks(this.block)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):(b!==DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE&&this.workspace.getAudioManager().play("drop"),this.block.queueRender().then(()=>this.disposeStep()));this.allConnectionPairs=[]}disposeStep(){var a=$.getGroup$$module$build$src$core$events$utils();$.setGroup$$module$build$src$core$events$utils(this.originalEventGroup);
1950
+ this.block.snapToGrid();var b;(b=this.connectionPreviewer)==null||b.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(a)}applyConnections(a){var {local:b,neighbour:c}=a;b.connect(c);var d=b.isSuperior()?c:b,e=this.block.getRootBlock();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{connectionUiEffect$$module$build$src$core$block_animations(d.getSourceBlock());setTimeout(()=>{e.bringToFront()},0)})}revertDrag(){var a;(a=this.connectionPreviewer)==
1951
+ null||a.hidePreview();this.connectionCandidate=null;if(this.block.nextConnection){let b;(b=this.startChildConn)==null||b.connect(this.block.nextConnection)}if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.block.outputConnection&&this.startParentConn.connect(this.block.outputConnection);break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.block.previousConnection&&this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveDuringDrag(this.startLoc);
1962
1952
  let b;(b=this.workspace.getLayerManager())==null||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.getVisibleBubbles(this.block).forEach(c=>{var d;return(d=this.workspace.getLayerManager())==null?void 0:d.moveOffDragLayer(c,BUBBLE$$module$build$src$core$layers,!1)});bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null;this.block.setDragging(!1);
1963
- this.dragging=!1;announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_CANCELED)}findTraversalCandidate(a){var b=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,a)),c=this.allConnectionPairs;if(b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE||!c.length)return this.connectionCandidate;var d=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT||b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,
1964
- e=c.findIndex(f=>{var g,h;return((g=this.connectionCandidate)==null?void 0:g.local)===f.local&&((h=this.connectionCandidate)==null?void 0:h.neighbour)===f.neighbour});b=this.block.workspace.getNavigator();return d?e===-1?(d=this.isInTerminalPosition(this.block,Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN),b.getNavigationLoops()?this.pairToCandidate(c[0]):d?null:this.getClosestCandidate(this.block,a)):e===c.length-1?null:this.pairToCandidate(c[e+1]):e===-1?(d=this.isInTerminalPosition(this.block,
1965
- Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP),b.getNavigationLoops()?this.pairToCandidate(c[c.length-1]):d?null:this.getClosestCandidate(this.block,a)):e===0?null:this.pairToCandidate(c[e-1])}isInTerminalPosition(a,b){if(a.getParent())return!1;var c=a.workspace.getTopBlocks(!0),d=c.indexOf(a);b=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP?-1:1;var e=d+b;for(d=a.getConnections_(!1);e>=0&&e<c.length;e+=b){let f=c[e];for(let g of d){let h=this.getAllConnections(f);
1966
- for(let k of h)if(a.workspace.connectionChecker.canConnect(g,k,!0,Infinity))return!1}}return!0}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){var b=this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:
1967
- d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];var b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&(b.push(a.nextConnection),
1968
- (a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));return b}getInitialCandidate(){var a=this.workspace.getSvgGroup().querySelector(`.${FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME}`);if(!a||!a.id||a===this.block.getFocusableElement())return null;a=this.workspace.lookUpFocusableNode(a.id);if(!a)return null;var b=this.workspace.getNavigator().getSourceBlockFromNode(a);if(!b)return null;var c=null;if(b.getConnections_(!1).includes(a)){c=a;
1969
- let f=this.block.workspace.connectionChecker;if(a=this.block.getConnections_(!1).find(g=>f.canConnect(g,c,!0,Infinity)))return{local:a,neighbour:c,distance:0}}if(a=this.allConnectionPairs.find(f=>f.neighbour.getSourceBlock()===b))return this.pairToCandidate(a);var d,e=(d=b.outputConnection)==null?void 0:d.targetConnection;return(d=this.allConnectionPairs.find(f=>f.neighbour===e))?this.pairToCandidate(d):null}updateMoveMode(a){this.moveMode=a instanceof KeyboardEvent&&!a.ctrlKey&&!a.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:
1970
- MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var TextBubble$$module$build$src$core$bubbles$text_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d,e){super(b,c,d,void 0,e);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;this.owner=e;this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize();addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextBubble")}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);
1953
+ this.redisableAllDraggedBlocks(this.block);this.dragging=!1;announceDynamicAriaState$$module$build$src$core$utils$aria($.Msg$$module$build$src$core$msg.ANNOUNCE_MOVE_CANCELED)}findTraversalCandidate(a){var b=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,a)),c=this.allConnectionPairs;if(b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE||!c.length)return this.connectionCandidate;var d=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT||
1954
+ b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,e=c.findIndex(f=>{var g,h;return((g=this.connectionCandidate)==null?void 0:g.local)===f.local&&((h=this.connectionCandidate)==null?void 0:h.neighbour)===f.neighbour});b=this.block.workspace.getNavigator();return d?e===-1?(d=this.isInTerminalPosition(this.block,Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN),b.getNavigationLoops()?this.pairToCandidate(c[0]):d?null:this.getClosestCandidate(this.block,a)):e===c.length-
1955
+ 1?null:this.pairToCandidate(c[e+1]):e===-1?(d=this.isInTerminalPosition(this.block,Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP),b.getNavigationLoops()?this.pairToCandidate(c[c.length-1]):d?null:this.getClosestCandidate(this.block,a)):e===0?null:this.pairToCandidate(c[e-1])}isInTerminalPosition(a,b){if(a.getParent())return!1;var c=a.workspace.getTopBlocks(!0),d=c.indexOf(a);b=b===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP?-1:1;var e=d+b;for(d=a.getConnections_(!1);e>=
1956
+ 0&&e<c.length;e+=b){let f=c[e];for(let g of d){let h=this.getAllConnections(f);for(let k of h)if(a.workspace.connectionChecker.canConnect(g,k,!0,Infinity))return!1}}return!0}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){var b=this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);var {x:c,y:d}=a;return c<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:c>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:
1957
+ d<0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:d>0?Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];var b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(let c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);let d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&
1958
+ (b.push(a.nextConnection),(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));return b}getInitialCandidate(){var a=this.workspace.getSvgGroup().querySelector(`.${FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME}`);if(!a||!a.id||a===this.block.getFocusableElement())return null;a=this.workspace.lookUpFocusableNode(a.id);if(!a)return null;var b=this.workspace.getNavigator().getSourceBlockFromNode(a);if(!b)return null;var c=null;if(b.getConnections_(!1).includes(a)){c=
1959
+ a;let f=this.block.workspace.connectionChecker;if(a=this.block.getConnections_(!1).find(g=>f.canConnect(g,c,!0,Infinity)))return{local:a,neighbour:c,distance:0}}if(a=this.allConnectionPairs.find(f=>f.neighbour.getSourceBlock()===b))return this.pairToCandidate(a);var d,e=(d=b.outputConnection)==null?void 0:d.targetConnection;return(d=this.allConnectionPairs.find(f=>f.neighbour===e))?this.pairToCandidate(d):null}updateMoveMode(a){this.moveMode=a instanceof KeyboardEvent&&!a.ctrlKey&&!a.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:
1960
+ MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED}enableAllDraggedBlocks(a){var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);this.lastBlockDisabledReasons.clear();a.getDescendants(!1).forEach(c=>{var d=new Set(c.getDisabledReasons());this.lastBlockDisabledReasons.set(c.id,d);d.forEach(e=>c.setDisabledReason(!1,e))});$.setRecordUndo$$module$build$src$core$events$utils(b)}redisableAllDraggedBlocks(a){console.log("redisable");
1961
+ var b=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(!1);a.getDescendants(!1).forEach(c=>{var d;(d=this.lastBlockDisabledReasons.get(c.id))==null||d.forEach(e=>{c.setDisabledReason(!0,e)})});$.setRecordUndo$$module$build$src$core$events$utils(b)}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var TextBubble$$module$build$src$core$bubbles$text_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d,e){super(b,c,d,void 0,e);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;this.owner=e;this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize();addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextBubble")}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);
1971
1962
  this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b=this.createParagraph(b);a=this.createTextFragments(b,a);this.workspace.RTL&&this.rightAlignTextFragments(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL?
1972
1963
  "rtl":"ltr"}`},a)}createTextFragments(a,b){var c=1;return b.split("\n").map(d=>{var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{y:`${c}em`,x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);d=document.createTextNode(d);e.appendChild(d);c+=1;return e})}rightAlignTextFragments(a,b){for(let c of b)c.setAttribute("text-anchor","start"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){var a=
1973
1964
  this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2,a.height+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2),!0)}},module$build$src$core$bubbles$text_bubble={};module$build$src$core$bubbles$text_bubble.TextBubble=TextBubble$$module$build$src$core$bubbles$text_bubble;var SIZE$$module$build$src$core$icons$warning_icon=17,WarningIcon$$module$build$src$core$icons$warning_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textMap=new Map;this.textBubble=null}getType(){return WarningIcon$$module$build$src$core$icons$warning_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},
@@ -2015,7 +2006,7 @@ Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks
2015
2006
  this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.recomputeAriaContext();this.select();var a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();a&&a!==this&&finishQueuedRenders$$module$build$src$core$render_management().then(()=>{this.workspace.scrollBoundsIntoView(this.getBoundingRectangleWithoutChildren())})}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(a){if(this.workspace.isFlyout)KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.startMove(this,
2016
2007
  a);else{if(this.isSimpleReporter())for(let b of this.inputList)for(let c of b.fieldRow)if(c.isClickable()&&c.isFullBlockField()){c.showEditor();return}this.workspace.getNavigator().getInNode(this)?showBlockNavigationHint$$module$build$src$core$hints(this.workspace):showHelpHint$$module$build$src$core$hints(this.workspace)}}getParents(){for(var a=new Set,b=this.getParent();b;)a.add(b),b=b.getParent();return a}getOutputParents(){var a=new Set;a.add(this);for(var b,c=(b=this.outputConnection)==null?
2017
2008
  void 0:b.targetBlock();c;){a.add(c);let d;c=(d=c.outputConnection)==null?void 0:d.targetBlock()}return a}getRowId(){var a,b,c=(a=this.outputConnection)==null?void 0:(b=a.targetConnection)==null?void 0:b.getParentInput();return c?c.getRowId():this.id}recomputeAriaContext(){this.getFullBlockField()||(setState$$module$build$src$core$utils$aria(this.getFocusableElement(),State$$module$build$src$core$utils$aria.LABEL,this.getAriaLabel(Verbosity$$module$build$src$core$utils$aria.STANDARD)),configureAriaRole$$module$build$src$core$block_aria_composer(this))}getAriaLabel(a){return computeAriaLabel$$module$build$src$core$block_aria_composer(this,
2018
- a,!1)}getStackBlocksCountLabel(){for(var a=1,b=this.getNextBlock();b;)a++,b=b.getNextBlock();return a<=1?computeAriaLabel$$module$build$src$core$block_aria_composer(this,Verbosity$$module$build$src$core$utils$aria.TERSE):$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STACK_BLOCKS.replace("%1",a.toString())}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};
2009
+ a,!1)}getStackBlocksCountLabel(){for(var a=1,b=this.getNextBlock();b;)a++,b=b.getNextBlock();return a<=1?computeAriaLabel$$module$build$src$core$block_aria_composer(this,Verbosity$$module$build$src$core$utils$aria.TERSE,!1):$.Msg$$module$build$src$core$msg.BLOCK_LABEL_STACK_BLOCKS.replace("%1",a.toString())}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};
2019
2010
  module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()?this.updateWouldDelete_(!1):a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=
2020
2011
  a}},module$build$src$core$delete_area={};module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;var FlyoutItem$$module$build$src$core$flyout_item=class{constructor(a,b){this.element=a;this.type=b}getElement(){return this.element}getType(){return this.type}},module$build$src$core$flyout_item={};module$build$src$core$flyout_item.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;var MetricsManager$$module$build$src$core$metrics_manager=class{constructor(a){this.workspace_=a}getDimensionsPx_(a){var b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return new Size$$module$build$src$core$utils$size(b,c)}getFlyoutMetrics(a){a=this.getDimensionsPx_(this.workspace_.getFlyout(a));return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){var a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){var a=
2021
2012
  0,b=0,c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox(),f,g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;var h=f===Position$$module$build$src$core$utils$toolbox.TOP;f===Position$$module$build$src$core$utils$toolbox.LEFT&&(e&&(a+=c.width),g&&(a+=d.width));h&&(e&&(b+=c.height),g&&(b+=d.height));return{top:b,left:a}}getViewMetrics(a){a=a?this.workspace_.scale:1;var b=this.getSvgMetrics(),c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),
@@ -2145,8 +2136,7 @@ null?f:"";this.dbReverse.add(a);return(b===$.NameType$$module$build$src$core$nam
2145
2136
  module$build$src$core$names.Names=$.Names$$module$build$src$core$names;var module$build$src$core$interfaces$i_observable={};module$build$src$core$interfaces$i_observable.isObservable=isObservable$$module$build$src$core$interfaces$i_observable;var ObservableProcedureMap$$module$build$src$core$observable_procedure_map=class extends Map{constructor(){super()}set(a,b){if(this.get(a)===b)return this;super.set(a,b);isObservable$$module$build$src$core$interfaces$i_observable(b)&&b.startPublishing();return this}delete(a){var b=this.get(a);a=super.delete(a);if(!a)return a;isObservable$$module$build$src$core$interfaces$i_observable(b)&&b.stopPublishing();return a}clear(){if(this.size)for(let a of this.keys())this.delete(a)}add(a){return this.set(a.getId(),
2146
2137
  a)}getProcedures(){return[...this.values()]}},module$build$src$core$observable_procedure_map={};module$build$src$core$observable_procedure_map.ObservableProcedureMap=ObservableProcedureMap$$module$build$src$core$observable_procedure_map;var CATEGORY_NAME$$module$build$src$core$procedures,module$build$src$core$procedures;CATEGORY_NAME$$module$build$src$core$procedures="PROCEDURE";$.DEFAULT_ARG$$module$build$src$core$procedures="x";module$build$src$core$procedures={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$procedures,DEFAULT_ARG:$.DEFAULT_ARG$$module$build$src$core$procedures};module$build$src$core$procedures.ObservableProcedureMap=ObservableProcedureMap$$module$build$src$core$observable_procedure_map;
2147
2138
  module$build$src$core$procedures.allProcedures=allProcedures$$module$build$src$core$procedures;module$build$src$core$procedures.findLegalName=$.findLegalName$$module$build$src$core$procedures;module$build$src$core$procedures.flyoutCategory=flyoutCategory$$module$build$src$core$procedures;module$build$src$core$procedures.getCallers=getCallers$$module$build$src$core$procedures;module$build$src$core$procedures.getDefinition=$.getDefinition$$module$build$src$core$procedures;
2148
- module$build$src$core$procedures.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$procedures;module$build$src$core$procedures.isNameUsed=isNameUsed$$module$build$src$core$procedures;module$build$src$core$procedures.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;module$build$src$core$procedures.mutateCallers=$.mutateCallers$$module$build$src$core$procedures;module$build$src$core$procedures.mutatorOpenListener=mutatorOpenListener$$module$build$src$core$procedures;
2149
- module$build$src$core$procedures.rename=$.rename$$module$build$src$core$procedures;var TypesContainer$$module$build$src$core$renderers$measurables$types=class{constructor(){this.NONE=0;this.FIELD=1;this.HAT=2;this.ICON=4;this.SPACER=8;this.BETWEEN_ROW_SPACER=16;this.IN_ROW_SPACER=32;this.EXTERNAL_VALUE_INPUT=64;this.INPUT=128;this.INLINE_INPUT=256;this.STATEMENT_INPUT=512;this.CONNECTION=1024;this.PREVIOUS_CONNECTION=2048;this.NEXT_CONNECTION=4096;this.OUTPUT_CONNECTION=8192;this.CORNER=16384;this.LEFT_SQUARE_CORNER=32768;this.LEFT_ROUND_CORNER=65536;this.RIGHT_SQUARE_CORNER=131072;
2139
+ module$build$src$core$procedures.isNameUsed=isNameUsed$$module$build$src$core$procedures;module$build$src$core$procedures.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;module$build$src$core$procedures.mutateCallers=$.mutateCallers$$module$build$src$core$procedures;module$build$src$core$procedures.mutatorOpenListener=mutatorOpenListener$$module$build$src$core$procedures;module$build$src$core$procedures.rename=$.rename$$module$build$src$core$procedures;var TypesContainer$$module$build$src$core$renderers$measurables$types=class{constructor(){this.NONE=0;this.FIELD=1;this.HAT=2;this.ICON=4;this.SPACER=8;this.BETWEEN_ROW_SPACER=16;this.IN_ROW_SPACER=32;this.EXTERNAL_VALUE_INPUT=64;this.INPUT=128;this.INLINE_INPUT=256;this.STATEMENT_INPUT=512;this.CONNECTION=1024;this.PREVIOUS_CONNECTION=2048;this.NEXT_CONNECTION=4096;this.OUTPUT_CONNECTION=8192;this.CORNER=16384;this.LEFT_SQUARE_CORNER=32768;this.LEFT_ROUND_CORNER=65536;this.RIGHT_SQUARE_CORNER=131072;
2150
2140
  this.RIGHT_ROUND_CORNER=262144;this.JAGGED_EDGE=524288;this.ROW=1048576;this.TOP_ROW=2097152;this.BOTTOM_ROW=4194304;this.INPUT_ROW=8388608;this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER;this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER;this.nextTypeValue_=16777216}getType(a){Object.prototype.hasOwnProperty.call(this,a)||(this[a]=this.nextTypeValue_,this.nextTypeValue_<<=1);return this[a]}isField(a){return(a.type&this.FIELD)>=1}isHat(a){return(a.type&this.HAT)>=1}isIcon(a){return(a.type&
2151
2141
  this.ICON)>=1}isSpacer(a){return(a.type&this.SPACER)>=1}isInRowSpacer(a){return(a.type&this.IN_ROW_SPACER)>=1}isSpacerRow(a){return(a.type&this.BETWEEN_ROW_SPACER)>=1}isInput(a){return(a.type&this.INPUT)>=1}isExternalInput(a){return(a.type&this.EXTERNAL_VALUE_INPUT)>=1}isInlineInput(a){return(a.type&this.INLINE_INPUT)>=1}isStatementInput(a){return(a.type&this.STATEMENT_INPUT)>=1}isPreviousConnection(a){return(a.type&this.PREVIOUS_CONNECTION)>=1}isNextConnection(a){return(a.type&this.NEXT_CONNECTION)>=
2152
2142
  1}isPreviousOrNextConnection(a){return this.isPreviousConnection(a)||this.isNextConnection(a)}isRoundCorner(a){return(a.type&this.LEFT_ROUND_CORNER)>=1||(a.type&this.RIGHT_ROUND_CORNER)>=1}isLeftRoundedCorner(a){return this.isRoundCorner(a)&&(a.type&this.LEFT_ROUND_CORNER)>=1}isRightRoundedCorner(a){return this.isRoundCorner(a)&&(a.type&this.RIGHT_ROUND_CORNER)>=1}isLeftSquareCorner(a){return(a.type&this.LEFT_SQUARE_CORNER)>=1}isRightSquareCorner(a){return(a.type&this.RIGHT_SQUARE_CORNER)>=1}isCorner(a){return(a.type&
@@ -2252,8 +2242,8 @@ module$build$src$core$renderers$common$block_rendering.SpacerRow=SpacerRow$$modu
2252
2242
  module$build$src$core$renderers$common$block_rendering.Types=Types$$module$build$src$core$renderers$measurables$types;module$build$src$core$renderers$common$block_rendering.init=init$$module$build$src$core$renderers$common$block_rendering;module$build$src$core$renderers$common$block_rendering.register=register$$module$build$src$core$renderers$common$block_rendering;module$build$src$core$renderers$common$block_rendering.unregister=unregister$$module$build$src$core$renderers$common$block_rendering;var ThemeManager$$module$build$src$core$theme_manager=class{constructor(a,b){this.workspace=a;this.theme=b;this.subscribedWorkspaces=[];this.componentDB=new Map}getTheme(){return this.theme}setTheme(a){var b=this.theme;this.theme=a;if(a=this.workspace.getInjectionDiv())b&&(b=b.getClassName())&&removeClass$$module$build$src$core$utils$dom(a,b),(b=this.theme.getClassName())&&addClass$$module$build$src$core$utils$dom(a,b);for(let c=0,d;d=this.subscribedWorkspaces[c];c++)d.refreshTheme();for(let [c,d]of this.componentDB)for(let e of d){a=
2253
2243
  e.element;b=e.propertyName;let f=this.theme&&this.theme.getComponentStyle(c);a.style.setProperty(b,f||"")}for(let c of this.subscribedWorkspaces)c.hideChaff()}subscribeWorkspace(a){this.subscribedWorkspaces.push(a)}unsubscribeWorkspace(a){if(!removeElem$$module$build$src$core$utils$array(this.subscribedWorkspaces,a))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");}subscribe(a,b,c){this.componentDB.has(b)||this.componentDB.set(b,[]);this.componentDB.get(b).push({element:a,
2254
2244
  propertyName:c});b=this.theme&&this.theme.getComponentStyle(b);a.style.setProperty(c,b||"")}unsubscribe(a){if(a)for(let [b,c]of this.componentDB){for(let d=c.length-1;d>=0;d--)c[d].element===a&&c.splice(d,1);c.length||this.componentDB.delete(b)}}dispose(){this.subscribedWorkspaces.length=0;this.componentDB.clear()}},module$build$src$core$theme_manager={};module$build$src$core$theme_manager.ThemeManager=ThemeManager$$module$build$src$core$theme_manager;var CATEGORY_NAME$$module$build$src$core$variables_dynamic="VARIABLE_DYNAMIC",onCreateVariableButtonClick_String$$module$build$src$core$variables_dynamic=stringButtonClickHandler$$module$build$src$core$variables_dynamic,onCreateVariableButtonClick_Number$$module$build$src$core$variables_dynamic=numberButtonClickHandler$$module$build$src$core$variables_dynamic,onCreateVariableButtonClick_Colour$$module$build$src$core$variables_dynamic=colourButtonClickHandler$$module$build$src$core$variables_dynamic,
2255
- module$build$src$core$variables_dynamic={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables_dynamic};module$build$src$core$variables_dynamic.flyoutCategory=flyoutCategory$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$variables_dynamic;
2256
- module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Colour=colourButtonClickHandler$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Number=numberButtonClickHandler$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_String=stringButtonClickHandler$$module$build$src$core$variables_dynamic;var ConnectionChecker$$module$build$src$core$connection_checker=class{canConnect(a,b,c,d){return this.canConnectWithReason(a,b,c,d)===Connection$$module$build$src$core$connection.CAN_CONNECT}canConnectWithReason(a,b,c,d){var e=this.doSafetyChecks(a,b);return e!==Connection$$module$build$src$core$connection.CAN_CONNECT?e:this.doTypeChecks(a,b)?c&&!this.doDragChecks(a,b,d||0)?Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED:Connection$$module$build$src$core$connection.CAN_CONNECT:
2245
+ module$build$src$core$variables_dynamic={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables_dynamic};module$build$src$core$variables_dynamic.flyoutCategory=flyoutCategory$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Colour=colourButtonClickHandler$$module$build$src$core$variables_dynamic;
2246
+ module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Number=numberButtonClickHandler$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_String=stringButtonClickHandler$$module$build$src$core$variables_dynamic;var ConnectionChecker$$module$build$src$core$connection_checker=class{canConnect(a,b,c,d){return this.canConnectWithReason(a,b,c,d)===Connection$$module$build$src$core$connection.CAN_CONNECT}canConnectWithReason(a,b,c,d){var e=this.doSafetyChecks(a,b);return e!==Connection$$module$build$src$core$connection.CAN_CONNECT?e:this.doTypeChecks(a,b)?c&&!this.doDragChecks(a,b,d||0)?Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED:Connection$$module$build$src$core$connection.CAN_CONNECT:
2257
2247
  Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED}getErrorMessage(a,b,c){switch(a){case Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Connection$$module$build$src$core$connection.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Connection$$module$build$src$core$connection.REASON_TARGET_NULL:return"Target connection is null.";
2258
2248
  case Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED:return"Connection checks failed. "+(b+" expected "+b.getCheck()+", found "+c.getCheck());case Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection.";
2259
2249
  default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(a,b){if(!a||!b)return Connection$$module$build$src$core$connection.REASON_TARGET_NULL;if(a.isSuperior()){var c=a.getSourceBlock();var d=b.getSourceBlock();var e=b}else d=a.getSourceBlock(),c=b.getSourceBlock(),e=a,a=b;return c===d?Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION:e.type!==OPPOSITE_TYPE$$module$build$src$core$internal_constants[a.type]?Connection$$module$build$src$core$connection.REASON_WRONG_TYPE:
@@ -2263,21 +2253,17 @@ Connection$$module$build$src$core$connection.CAN_CONNECT}doTypeChecks(a,b){a=a.g
2263
2253
  break;default:return!1}return draggingConnections$$module$build$src$core$common.includes(b)?!1:!0}canConnectToPrevious_(a,b){if(a.targetConnection||draggingConnections$$module$build$src$core$common.includes(b))return!1;if(!b.targetConnection)return!0;a=b.targetBlock();return a.isInsertionMarker()?!a.getPreviousBlock():!1}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_CHECKER,DEFAULT$$module$build$src$core$registry,ConnectionChecker$$module$build$src$core$connection_checker);
2264
2254
  var module$build$src$core$connection_checker={};module$build$src$core$connection_checker.ConnectionChecker=ConnectionChecker$$module$build$src$core$connection_checker;var Workspace$$module$build$src$core$workspace=class{get isFlyout(){return this.internalIsFlyout}get isMutator(){return this.internalIsMutator}constructor(a){this.isClearing=this.internalIsMutator=this.internalIsFlyout=this.rendered=!1;this.MAX_UNDO=1024;this.connectionDBList=[];this.topBlocks=[];this.topComments=[];this.commentDB=new Map;this.listeners=[];this.undoStack_=[];this.redoStack_=[];this.blockDB=new Map;this.typedBlocksDB=new Map;this.procedureMap=new ObservableProcedureMap$$module$build$src$core$observable_procedure_map;
2265
2255
  this.readOnly=!1;this.potentialVariableMap=null;this.id=genUid$$module$build$src$core$utils$idgenerator();registerWorkspace$$module$build$src$core$common(this);this.options=a||new Options$$module$build$src$core$options({});this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.connectionChecker=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_CHECKER,this.options,
2266
- !0))(this);this.variableMap=new (this.getVariableMapClass())(this);this.setIsReadOnly(this.options.readOnly)}dispose(){this.listeners.length=0;this.clear();unregisterWorkpace$$module$build$src$core$common(this)}sortObjects(a,b){var c=d=>({getBoundingRectangle:()=>{var e=d.getRelativeToSurfaceXY();return new Rect$$module$build$src$core$utils$rect(e.y,e.y,e.x,e.x)},moveBy:()=>{}});return this.sortByOrigin(c(a),c(b))}sortByOrigin(a,b){var c=Math.sin(toRadians$$module$build$src$core$utils$math(Workspace$$module$build$src$core$workspace.SCAN_ANGLE))*
2256
+ !0))(this);this.variableMap=new (this.getVariableMapClass())(this);this.setIsReadOnly(this.options.readOnly)}dispose(){this.listeners.length=0;this.clear();unregisterWorkspace$$module$build$src$core$common(this)}sortObjects(a,b){var c=d=>({getBoundingRectangle:()=>{var e=d.getRelativeToSurfaceXY();return new Rect$$module$build$src$core$utils$rect(e.y,e.y,e.x,e.x)},moveBy:()=>{}});return this.sortByOrigin(c(a),c(b))}sortByOrigin(a,b){var c=Math.sin(toRadians$$module$build$src$core$utils$math(Workspace$$module$build$src$core$workspace.SCAN_ANGLE))*
2267
2257
  (this.RTL?-1:1);a=a.getBoundingRectangle().getOrigin();b=b.getBoundingRectangle().getOrigin();return a.y+c*a.x-(b.y+c*b.x)}addTopBlock(a){this.topBlocks.push(a)}removeTopBlock(a){if(!removeElem$$module$build$src$core$utils$array(this.topBlocks,a))throw Error("Block not present in workspace's list of top-most blocks.");}getTopBlocks(a=!1){var b=[].concat(this.topBlocks);a&&b.length>1&&b.sort(this.sortObjects.bind(this));return b}addTypedBlock(a){this.typedBlocksDB.has(a.type)||this.typedBlocksDB.set(a.type,
2268
2258
  []);this.typedBlocksDB.get(a.type).push(a)}removeTypedBlock(a){removeElem$$module$build$src$core$utils$array(this.typedBlocksDB.get(a.type),a);this.typedBlocksDB.get(a.type).length||this.typedBlocksDB.delete(a.type)}getBlocksByType(a,b=!1){if(!this.typedBlocksDB.has(a))return[];a=this.typedBlocksDB.get(a).slice(0);b&&a&&a.length>1&&a.sort(this.sortObjects.bind(this));return a.filter(c=>!c.isInsertionMarker())}addTopComment(a){this.topComments.push(a);this.commentDB.has(a.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+
2269
2259
  a.id+'"');this.commentDB.set(a.id,a)}removeTopComment(a){if(!removeElem$$module$build$src$core$utils$array(this.topComments,a))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(a.id)}getTopComments(a=!1){var b=[].concat(this.topComments);a&&b.length>1&&b.sort(this.sortObjects.bind(this));return b}getAllBlocks(a=!1){if(a){var b=this.getTopBlocks(!0);a=[];for(let c=0;c<b.length;c++)a.push(...b[c].getDescendants(!0))}else for(a=this.getTopBlocks(!1),b=
2270
2260
  0;b<a.length;b++)a.push(...a[b].getChildren(!1));return a.filter(c=>!c.isInsertionMarker())}clear(){this.isClearing=!0;try{let a=$.getGroup$$module$build$src$core$events$utils();for(a||$.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();$.setGroup$$module$build$src$core$events$utils(a);this.isFlyout||this.variableMap.clear();this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=
2271
- !1}}renameVariableById(a,b){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.renameVariableById","v12","v13","Blockly.Workspace.getVariableMap().renameVariable");(a=this.variableMap.getVariableById(a))&&this.variableMap.renameVariable(a,b)}createVariable(a,b,c){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.createVariable","v12","v13","Blockly.Workspace.getVariableMap().createVariable");return this.variableMap.createVariable(a,b!=null?b:void 0,c!=null?c:void 0)}getVariableUsesById(a){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariableUsesById",
2272
- "v12","v13","Blockly.Variables.getVariableUsesById");return getVariableUsesById$$module$build$src$core$variables(this,a)}deleteVariableById(a){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.deleteVariableById","v12","v13","Blockly.Workspace.getVariableMap().deleteVariable");var b=this.variableMap.getVariableById(a);b?$.deleteVariable$$module$build$src$core$variables(this,b):console.warn(`Can't delete non-existent variable: ${a}`)}getVariable(a,b){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariable",
2273
- "v12","v13","Blockly.Workspace.getVariableMap().getVariable");return this.variableMap.getVariable(a,b)}getVariableById(a){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariableById","v12","v13","Blockly.Workspace.getVariableMap().getVariableById");return this.variableMap.getVariableById(a)}getVariablesOfType(a){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariablesOfType","v12","v13","Blockly.Workspace.getVariableMap().getVariablesOfType");return this.variableMap.getVariablesOfType(a!=
2274
- null?a:"")}getAllVariables(){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getAllVariables","v12","v13","Blockly.Workspace.getVariableMap().getAllVariables");return this.variableMap.getAllVariables()}getAllVariableNames(){$.warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getAllVariableNames","v12","v13","Blockly.Workspace.getVariableMap().getAllVariables");return this.variableMap.getAllVariables().map(a=>a.getName())}getWidth(){return 0}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");
2275
- }newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}remainingCapacity(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(a){return this.options.maxInstances?(this.options.maxInstances[a]!==void 0?this.options.maxInstances[a]:Infinity)-this.getBlocksByType(a,!1).length:Infinity}isCapacityAvailable(a){if(!this.hasBlockLimits())return!0;var b=0;for(let c in a){if(a[c]>this.remainingCapacityOfType(c))return!1;
2276
- b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return this.options.maxBlocks!==Infinity||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(a=!1){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group===b[b.length-1].group;){let f=b.pop();f&&e.push(f)}for(b=0;b<e.length;b++)c.push(e[b]);$.setRecordUndo$$module$build$src$core$events$utils(!1);try{for(c=
2277
- 0;c<e.length;c++)e[c].run(a)}finally{$.setRecordUndo$$module$build$src$core$events$utils(!0)}}}redo(){this.undo(!0)}clearUndo(){this.undoStack_.length=0;this.redoStack_.length=0;clearPendingUndo$$module$build$src$core$events$utils()}addChangeListener(a){this.listeners.push(a);return a}removeChangeListener(a){removeElem$$module$build$src$core$utils$array(this.listeners,a)}fireChangeListener(a){if(a.recordUndo)for(this.undoStack_.push(a),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&
2278
- this.MAX_UNDO>=0;)this.undoStack_.shift();for(let b=0;b<this.listeners.length;b++)(0,this.listeners[b])(a)}getBlockById(a){return this.blockDB.get(a)||null}setBlockById(a,b){this.blockDB.set(a,b)}removeBlockById(a){this.blockDB.delete(a)}getCommentById(a){var b;return(b=this.commentDB.get(a))!=null?b:null}allInputsFilled(a){var b=this.getTopBlocks(!1);for(let c=0;c<b.length;c++)if(!b[c].allInputsFilled(a))return!1;return!0}getPotentialVariableMap(){return this.potentialVariableMap}createPotentialVariableMap(){this.potentialVariableMap=
2279
- new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableMap}setVariableMap(a){this.variableMap=a}getProcedureMap(){return this.procedureMap}getRootWorkspace(){var a=null,b=this.options.parentWorkspace;this.isFlyout?b&&b.options&&(a=b.options.parentWorkspace):b&&(a=b);return a}static getById(a){return getWorkspaceById$$module$build$src$core$common(a)}static getAll(){return getAllWorkspaces$$module$build$src$core$common()}getVariableMapClass(){var a=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,
2280
- this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1;window.AudioContext&&(this.context=new AudioContext)}dispose(){this.sounds.clear();var a;(a=this.context)==null||a.close()}load(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
2261
+ !1}}getWidth(){return 0}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}remainingCapacity(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(a){return this.options.maxInstances?(this.options.maxInstances[a]!==void 0?this.options.maxInstances[a]:Infinity)-this.getBlocksByType(a,
2262
+ !1).length:Infinity}isCapacityAvailable(a){if(!this.hasBlockLimits())return!0;var b=0;for(let c in a){if(a[c]>this.remainingCapacityOfType(c))return!1;b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return this.options.maxBlocks!==Infinity||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(a=!1){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_,d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group===
2263
+ b[b.length-1].group;){let f=b.pop();f&&e.push(f)}for(b=0;b<e.length;b++)c.push(e[b]);$.setRecordUndo$$module$build$src$core$events$utils(!1);try{for(c=0;c<e.length;c++)e[c].run(a)}finally{$.setRecordUndo$$module$build$src$core$events$utils(!0)}}}redo(){this.undo(!0)}clearUndo(){this.undoStack_.length=0;this.redoStack_.length=0;clearPendingUndo$$module$build$src$core$events$utils()}addChangeListener(a){this.listeners.push(a);return a}removeChangeListener(a){removeElem$$module$build$src$core$utils$array(this.listeners,
2264
+ a)}fireChangeListener(a){if(a.recordUndo)for(this.undoStack_.push(a),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&this.MAX_UNDO>=0;)this.undoStack_.shift();for(let b=0;b<this.listeners.length;b++)(0,this.listeners[b])(a)}getBlockById(a){return this.blockDB.get(a)||null}setBlockById(a,b){this.blockDB.set(a,b)}removeBlockById(a){this.blockDB.delete(a)}getCommentById(a){var b;return(b=this.commentDB.get(a))!=null?b:null}allInputsFilled(a){var b=this.getTopBlocks(!1);for(let c=0;c<b.length;c++)if(!b[c].allInputsFilled(a))return!1;
2265
+ return!0}getPotentialVariableMap(){return this.potentialVariableMap}createPotentialVariableMap(){this.potentialVariableMap=new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableMap}setVariableMap(a){this.variableMap=a}getProcedureMap(){return this.procedureMap}getRootWorkspace(){var a=null,b=this.options.parentWorkspace;this.isFlyout?b&&b.options&&(a=b.options.parentWorkspace):b&&(a=b);return a}static getById(a){return getWorkspaceById$$module$build$src$core$common(a)}static getAll(){return getAllWorkspaces$$module$build$src$core$common()}getVariableMapClass(){var a=
2266
+ getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1;window.AudioContext&&(this.context=new AudioContext)}dispose(){this.sounds.clear();var a;(a=this.context)==null||a.close()}load(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
2281
2267
  e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()&&b!==0){var d=c.sounds.get(a);if(d){yield c.prepareToPlay();let e=c.context.createBufferSource(),f=c.context.createGain();f.gain.value=b!=null?b:1;f.connect(c.context.destination);e.buffer=d;e.connect(f);e.addEventListener("ended",()=>{e.disconnect();f.disconnect()});e.start()}else c.parentWorkspace&&c.parentWorkspace.getAudioManager().play(a,
2282
2268
  b)}})}beep(a,b=.2){var c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()){yield c.prepareToPlay();var d=c.context.createOscillator();d.type="sine";d.frequency.setValueAtTime(a,c.context.currentTime);var e=c.context.createGain();e.gain.setValueAtTime(0,c.context.currentTime);e.gain.linearRampToValueAtTime(.5,c.context.currentTime+.01);e.gain.linearRampToValueAtTime(0,c.context.currentTime+b);d.connect(e);e.connect(c.context.destination);d.start(c.context.currentTime);
2283
2269
  d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}maybePlayScopeChangeAudioCue(a){if(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.getScopeChangeAudioCuesEnabled()){var b=this.parentWorkspace.getNavigator(),c=b.getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode());a=b.getSourceBlockFromNode(a);b=0;c&&a&&c.getNestingLevel()!==
@@ -2285,44 +2271,45 @@ d.stop(c.context.currentTime+b)}})}playErrorBeep(){var a=this;return(0,$jscomp.a
2285
2271
  {};module$build$src$core$workspace_audio.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;var ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg=20,WorkspaceSvg$$module$build$src$core$workspace_svg=class extends Workspace$$module$build$src$core$workspace{constructor(a){super(a);this.resizeHandlerWrapper=null;this.resizesEnabled=this.visible=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.oldScale=this.scale=1;this.oldLeft=this.oldTop=0;this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=
2286
2272
  this.injectionDiv=this.currentGesture_=this.toolbox=this.flyout=this.scrollbar=this.trashcan=null;this.inverseScreenCTMDirty=!0;this.highlightedBlocks=[];this.toolboxCategoryCallbacks=new Map;this.flyoutButtonCallbacks=new Map;this.cachedParentSvg=null;this.topBoundedElements=[];this.dragTargetAreas=[];this.workspaceSelectionRing=this.workspaceFocusRing=this.zoomControls_=this.layerManager=null;this.navigator=new Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;this.metricsManager=
2287
2273
  new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,a,!0))(this);this.getMetrics=a.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager);this.setMetrics=a.setMetrics||WorkspaceSvg$$module$build$src$core$workspace_svg.setTopLevelWorkspaceMetrics;this.componentManager=new ComponentManager$$module$build$src$core$component_manager;this.connectionDBList=ConnectionDB$$module$build$src$core$connection_db.init(this.connectionChecker);
2288
- var b;this.audioManager=new WorkspaceAudio$$module$build$src$core$workspace_audio((b=a.parentWorkspace)!=null?b:this);this.grid=this.options.gridPattern?new Grid$$module$build$src$core$grid(this.options.gridPattern,a.gridOptions):null;module$build$src$core$variables&&internalFlyoutCategory$$module$build$src$core$variables&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables,internalFlyoutCategory$$module$build$src$core$variables);module$build$src$core$variables_dynamic&&
2289
- internalFlyoutCategory$$module$build$src$core$variables_dynamic&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables_dynamic,internalFlyoutCategory$$module$build$src$core$variables_dynamic);module$build$src$core$procedures&&internalFlyoutCategory$$module$build$src$core$procedures&&(this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$procedures,internalFlyoutCategory$$module$build$src$core$procedures),this.addChangeListener(mutatorOpenListener$$module$build$src$core$procedures));
2290
- this.addChangeListener(this.variableChangeCallback.bind(this));this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new ThemeManager$$module$build$src$core$theme_manager(this,this.options.theme||Classic$$module$build$src$core$theme$classic);this.themeManager_.subscribeWorkspace(this);var c;this.renderer=init$$module$build$src$core$renderers$common$block_rendering(this.options.renderer||"geras",this.getTheme(),(c=this.options.rendererOverrides)!=null?c:void 0);
2291
- this.cachedParentSvgSize=new Size$$module$build$src$core$utils$size(0,0)}getMetricsManager(){return this.metricsManager}setMetricsManager(a){this.metricsManager=a;this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(a){a||(a=Classic$$module$build$src$core$theme$classic);this.themeManager_.setTheme(a)}refreshTheme(){if(this.svgGroup_){var a=
2292
- this.options.parentWorkspace===null;this.renderer.refreshDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0)}this.updateBlockStyles(this.getAllBlocks(!1).filter(b=>!!b.getStyleName()));this.refreshToolboxSelection();this.toolbox&&this.toolbox.refreshTheme();this.isVisible()&&this.setVisible(!0);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.THEME_CHANGE))(this.getTheme().name,this.id);fire$$module$build$src$core$events$utils(a)}updateBlockStyles(a){for(let b=
2293
- 0,c;c=a[b];b++){let d=c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){let a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(a){var b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{let e=getRelativeXY$$module$build$src$core$utils$svg_math(a);
2294
- if(a===this.getCanvas()||a===this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!==this.getParentSvg()&&a!==this.getInjectionDiv());return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}getCachedParentSvgSize(){var a=this.cachedParentSvgSize;return new Size$$module$build$src$core$utils$size(a.width,a.height)}getOriginOffsetInPixels(){return getInjectionDivXY$$module$build$src$core$utils$svg_math(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let a=this.svgGroup_;
2295
- for(;a;){if((" "+(a.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=a;break}a=a.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(a){this.resizeHandlerWrapper=a}setInitialAriaContext(){if(!this.svgGroup_)throw Error("Must initialize svgGroup_ by calling `createDom` before calling setAriaContext");this.isFlyout||(setRole$$module$build$src$core$utils$aria(this.svgGroup_,Role$$module$build$src$core$utils$aria.REGION),
2296
- this.isMutator?setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE):this.updateAriaLabel())}updateAriaLabel(){var a=this.getTopBlocks(!1).length;a==1?setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_1_STACK):setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,
2297
- $.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MANY_STACKS.replace("%1",String(a)))}createDom(a,b){this.injectionDiv||(this.injectionDiv=b!=null?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",id:this.id});a&&(this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:"100%",width:"100%","class":a},this.svgGroup_),a==="blocklyMainBackground"&&this.grid?
2298
- this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.workspaceSelectionRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceSelectionRing"},this.svgGroup_);this.workspaceFocusRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceFocusRing"},this.svgGroup_);
2299
- this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this);this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.setInitialAriaContext();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener,{passive:!0}),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,
2300
- "wheel",this,this.onMouseWheel,!1,{passive:!1}));this.options.hasCategories&&(this.toolbox=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,this.options,!0))(this));this.grid&&this.grid.update(this.scale);this.recordDragTargets();a=this.options.parentWorkspace===null;this.renderer.createDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0);$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!!this.injectionDiv||
2301
- this.isFlyout);return this.svgGroup_}dispose(){this.rendered=!1;this.currentGesture_&&this.currentGesture_.cancel();this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_);this.toolbox&&(this.toolbox.dispose(),this.toolbox=null);this.flyout&&(this.flyout.dispose(),this.flyout=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null);this.zoomControls_&&this.zoomControls_.dispose();this.audioManager&&this.audioManager.dispose();
2302
- this.grid&&(this.grid=null);this.renderer.dispose();super.dispose();this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose());this.connectionDBList.length=0;this.toolboxCategoryCallbacks.clear();this.flyoutButtonCallbacks.clear();if(!this.options.parentWorkspace){let c=this.getParentSvg();c&&c.parentNode&&removeNode$$module$build$src$core$utils$dom(c.parentNode)}this.resizeHandlerWrapper&&
2303
- (unbind$$module$build$src$core$browser_events(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null);this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null);var a;(a=this.workspaceFocusRing)==null||a.remove();var b;(b=this.workspaceSelectionRing)==null||b.remove();$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=
2304
- WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);var a=this.trashcan.createDom();this.svgGroup_.insertBefore(a,this.getCanvas())}static newTrashcan(a){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts");}addZoomControls(){this.zoomControls_=new ZoomControls$$module$build$src$core$zoom_controls(this);var a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)}copyOptionsForFlyout(){return new Options$$module$build$src$core$options({parentWorkspace:this,
2305
- rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,plugins:this.options.plugins,modalInputs:this.options.modalInputs,move:{scrollbars:!0}})}addFlyout(a){var b=this.copyOptionsForFlyout();b.toolboxPosition=this.options.toolboxPosition;this.flyout=this.horizontalLayout?new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,
2306
- this.options,!0))(b):new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(b);this.flyout.autoClose=!1;this.flyout.getWorkspace().setVisible(!0);return this.flyout.createDom(a)}getFlyout(a){return this.flyout||a?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM();this.recordDragTargets()}resizeContents(){this.resizesEnabled&&
2307
- this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox?this.toolbox.position():this.flyout&&this.flyout.position();var a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE,!0),b=this.getMetricsManager().getUiMetrics(),c=[];for(let d=0,e;e=a[d];d++){e.position(b,c);let f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations();
2308
- this.workspaceFocusRing&&this.workspaceSelectionRing&&(this.resizeWorkspaceRing(this.workspaceSelectionRing,5),this.resizeWorkspaceRing(this.workspaceFocusRing,0))}resizeWorkspaceRing(a,b){var c=this.getMetrics();a.setAttribute("x",`${c.absoluteLeft+b}`);a.setAttribute("y",`${c.absoluteTop+b}`);a.setAttribute("width",`${Math.max(0,c.viewWidth-b*2)}`);a.setAttribute("height",`${Math.max(0,c.svgHeight-b*2)}`)}updateScreenCalculationsIfScrolled(){var a=getDocumentScroll$$module$build$src$core$utils$svg_math();
2309
- Coordinate$$module$build$src$core$utils$coordinate.equals(this.lastRecordedPageScroll,a)||(this.lastRecordedPageScroll=a,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(a,b){var c=this.getParentSvg();a!=null&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));b!=null&&(this.cachedParentSvgSize.height=b,c.setAttribute("data-cached-height",`${b}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let a=
2310
- this.svgGroup_;for(;a;){if(a.tagName==="svg"){this.cachedParentSvg=a;break}a=a.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(isEnabled$$module$build$src$core$events$utils()){var a=this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&Math.abs(b-this.oldTop)<1&&Math.abs(c-this.oldLeft)<1)){var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE))(b,c,a,this.id,this.oldScale);this.oldScale=a;this.oldTop=
2311
- b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){var c;(c=this.layerManager)==null||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);var d;(d=this.grid)==null||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){var a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.visible=a;this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(a),this.getFlyout()&&this.getFlyout().setContainerVisible(a),
2312
- this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){var a=this.getAllBlocks(!1);for(let b=a.length-1;b>=0;b--)a[b].queueRender();this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender())}highlightBlock(a,b){if(b===void 0){for(let c=0,d;d=this.highlightedBlocks[c];c++)d.setHighlighted(!1);this.highlightedBlocks.length=0}if(a=a?this.getBlockById(a):null)(b=b===void 0||b)?this.highlightedBlocks.includes(a)||
2313
- this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks,a),a.setHighlighted(b)}variableChangeCallback(a){switch(a.type){case EventType$$module$build$src$core$events$type.VAR_CREATE:case EventType$$module$build$src$core$events$type.VAR_DELETE:case EventType$$module$build$src$core$events$type.VAR_RENAME:case EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE:this.refreshToolboxSelection()}}refreshToolboxSelection(){var a=this.isFlyout?this.targetWorkspace:
2314
- this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){var a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let b=0,c;c=a[b];b++){let d=c.getClientRect();d&&this.dragTargetAreas.push({component:c,clientRect:d})}}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");
2315
- }getDragTarget(a){a=a instanceof Coordinate$$module$build$src$core$utils$coordinate?wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,a):new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.x,a.y))return c.component;return null}onMouseDown(a){var b=this.getGesture(a);b&&b.handleWsStart(a,this)}startDrag(a,b){start$$module$build$src$core$utils$drag(this,a,b)}moveDrag(a){return move$$module$build$src$core$utils$drag(this,
2316
- a)}isDragging(){return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||
2317
- this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}onMouseWheel(a){if(Gesture$$module$build$src$core$gesture.inProgress())a.preventDefault(),a.stopPropagation();else{var b=this.options.zoomOptions&&this.options.zoomOptions.wheel,c=this.options.moveOptions&&this.options.moveOptions.wheel;
2318
- if(b||c){var d=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(MAC$$module$build$src$core$utils$useragent)var e=a.metaKey;b&&(a.ctrlKey||e||!c)?(d=-d.y/50,b=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(b.x,b.y,d)):(b=this.scrollX-d.x,c=this.scrollY-d.y,a.shiftKey&&!d.x&&(b=this.scrollX-d.y,c=this.scrollY),this.scroll(b,c));a.preventDefault()}}}getBlocksBoundingBox(){var a=this.getTopBoundedElements();if(!a.length)return new Rect$$module$build$src$core$utils$rect(0,
2319
- 0,0,0);var b=a[0].getBoundingRectangle();for(let d=1;d<a.length;d++){var c=a[d];if(c.isInsertionMarker&&c.isInsertionMarker())continue;c=c.getBoundingRectangle();c.top<b.top&&(b.top=c.top);c.bottom>b.bottom&&(b.bottom=c.bottom);c.left<b.left&&(b.left=c.left);c.right>b.right&&(b.right=c.right)}return b}cleanUp(){this.setResizesEnabled(!1);var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=this.getTopBlocks(!0),c=b.filter(g=>g.isMovable()),
2320
- d=b.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());b=function(g){for(let h of d)if(g.intersects(h))return h;return null};var e=0,f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(let g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=b(c);e!=null;)e=e.top+e.getHeight()+f,g.moveBy(0,e-c.top,["cleanup"]),g.snapToGrid(),c=g.getBoundingRectangle(),e=b(c);e=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+f}$.setGroup$$module$build$src$core$events$utils(a);
2321
- this.setResizesEnabled(!0)}showContextMenu(a){if(!this.isReadOnly()&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({workspace:this,focusedNode:this},a);this.configureContextMenu&&this.configureContextMenu(b,a);if(a instanceof PointerEvent)var c=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);else c=this.RTL?this.getWidth()-5:5,c=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,new Coordinate$$module$build$src$core$utils$coordinate(c,
2322
- 5));show$$module$build$src$core$contextmenu(a,b,this.RTL,this,c)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");
2323
- this.options.languageTree=a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:
2324
- d<this.options.zoomOptions.minScale&&(c=this.options.zoomOptions.minScale/this.scale);var e=this.getCanvas().getCTM(),f=this.getParentSvg().createSVGPoint();f.x=a;f.y=b;f=f.matrixTransform(e.inverse());a=f.x;b=f.y;e=e.translate(a*(1-c),b*(1-c)).scale(c);this.scrollX=e.e;this.scrollY=e.f;this.setScale(d)}}zoomCenter(a){var b=this.getMetrics();if(this.flyout){var c=b.svgWidth?b.svgWidth/2:0;b=b.svgHeight?b.svgHeight/2:0}else c=b.viewWidth/2+b.absoluteLeft,b=b.viewHeight/2+b.absoluteTop;this.zoom(c,
2325
- b,a)}zoomToFit(){if(this.isMovable()){var a=this.getMetrics(),b=a.viewWidth;a=a.viewHeight;var c=this.getBlocksBoundingBox(),d=ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg*2,e=c.right-c.left+d;c=c.bottom-c.top+d;if(e){this.flyout&&(this.horizontalLayout?(a+=this.flyout.getHeight(),c+=this.flyout.getHeight()/this.scale):(b+=this.flyout.getWidth(),e+=this.flyout.getWidth()/this.scale));b/=e;a/=c;$.disable$$module$build$src$core$events$utils();try{this.setScale(Math.min(b,a)),this.scrollCenter()}finally{$.enable$$module$build$src$core$events$utils()}this.maybeFireViewportChangeEvent()}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}beginCanvasTransition(){addClass$$module$build$src$core$utils$dom(this.getCanvas(),
2274
+ var b;this.audioManager=new WorkspaceAudio$$module$build$src$core$workspace_audio((b=a.parentWorkspace)!=null?b:this);this.grid=this.options.gridPattern?new Grid$$module$build$src$core$grid(this.options.gridPattern,a.gridOptions):null;module$build$src$core$variables&&flyoutCategory$$module$build$src$core$variables&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables,flyoutCategory$$module$build$src$core$variables);module$build$src$core$variables_dynamic&&flyoutCategory$$module$build$src$core$variables_dynamic&&
2275
+ this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic);module$build$src$core$procedures&&flyoutCategory$$module$build$src$core$procedures&&(this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures),this.addChangeListener(mutatorOpenListener$$module$build$src$core$procedures));this.addChangeListener(this.variableChangeCallback.bind(this));
2276
+ this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new ThemeManager$$module$build$src$core$theme_manager(this,this.options.theme||Classic$$module$build$src$core$theme$classic);this.themeManager_.subscribeWorkspace(this);var c;this.renderer=init$$module$build$src$core$renderers$common$block_rendering(this.options.renderer||"geras",this.getTheme(),(c=this.options.rendererOverrides)!=null?c:void 0);this.cachedParentSvgSize=new Size$$module$build$src$core$utils$size(0,
2277
+ 0)}getMetricsManager(){return this.metricsManager}setMetricsManager(a){this.metricsManager=a;this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(a){a||(a=Classic$$module$build$src$core$theme$classic);this.themeManager_.setTheme(a)}refreshTheme(){if(this.svgGroup_){var a=this.options.parentWorkspace===
2278
+ null;this.renderer.refreshDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0)}this.updateBlockStyles(this.getAllBlocks(!1).filter(b=>!!b.getStyleName()));this.refreshToolboxSelection();this.toolbox&&this.toolbox.refreshTheme();this.isVisible()&&this.setVisible(!0);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.THEME_CHANGE))(this.getTheme().name,this.id);fire$$module$build$src$core$events$utils(a)}updateBlockStyles(a){for(let b=0,c;c=a[b];b++){let d=
2279
+ c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){let a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(a){var b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{let e=getRelativeXY$$module$build$src$core$utils$svg_math(a);if(a===this.getCanvas()||
2280
+ a===this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!==this.getParentSvg()&&a!==this.getInjectionDiv());return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}getCachedParentSvgSize(){var a=this.cachedParentSvgSize;return new Size$$module$build$src$core$utils$size(a.width,a.height)}getOriginOffsetInPixels(){return getInjectionDivXY$$module$build$src$core$utils$svg_math(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let a=this.svgGroup_;for(;a;){if((" "+
2281
+ (a.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=a;break}a=a.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(a){this.resizeHandlerWrapper=a}setInitialAriaContext(){if(!this.svgGroup_)throw Error("Must initialize svgGroup_ by calling `createDom` before calling setAriaContext");this.isFlyout||(setRole$$module$build$src$core$utils$aria(this.svgGroup_,Role$$module$build$src$core$utils$aria.REGION),
2282
+ this.isMutator?setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE):this.updateAriaLabel())}updateAriaLabel(){if(APPLE$$module$build$src$core$utils$useragent)setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_PLAIN);else{var a=this.getTopBlocks(!1).length;a==1?setState$$module$build$src$core$utils$aria(this.svgGroup_,
2283
+ State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_1_STACK):setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_LABEL_MANY_STACKS.replace("%1",String(a)))}}createDom(a,b){this.injectionDiv||(this.injectionDiv=b!=null?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",id:this.id});
2284
+ a&&(this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:"100%",width:"100%","class":a},this.svgGroup_),a==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.workspaceSelectionRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceSelectionRing"},
2285
+ this.svgGroup_);this.workspaceFocusRing=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{fill:"none",class:"blocklyWorkspaceFocusRing"},this.svgGroup_);this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this);this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.setInitialAriaContext();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",
2286
+ this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener,{passive:!0}),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.onMouseWheel,!1,{passive:!1}));this.options.hasCategories&&(this.toolbox=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,this.options,!0))(this));this.grid&&this.grid.update(this.scale);this.recordDragTargets();a=this.options.parentWorkspace===
2287
+ null;this.renderer.createDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0);$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!!this.injectionDiv||this.isFlyout);return this.svgGroup_}dispose(){this.rendered=!1;this.currentGesture_&&this.currentGesture_.cancel();this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_);this.toolbox&&(this.toolbox.dispose(),this.toolbox=null);this.flyout&&(this.flyout.dispose(),this.flyout=null);this.trashcan&&
2288
+ (this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null);this.zoomControls_&&this.zoomControls_.dispose();this.audioManager&&this.audioManager.dispose();this.grid&&(this.grid=null);this.renderer.dispose();super.dispose();this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose());this.connectionDBList.length=0;this.toolboxCategoryCallbacks.clear();
2289
+ this.flyoutButtonCallbacks.clear();if(!this.options.parentWorkspace){let c=this.getParentSvg();c&&c.parentNode&&removeNode$$module$build$src$core$utils$dom(c.parentNode)}this.resizeHandlerWrapper&&(unbind$$module$build$src$core$browser_events(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null);this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null);var a;(a=this.workspaceFocusRing)==null||a.remove();var b;(b=this.workspaceSelectionRing)==
2290
+ null||b.remove();$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);var a=this.trashcan.createDom();this.svgGroup_.insertBefore(a,this.getCanvas())}static newTrashcan(a){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts");}addZoomControls(){this.zoomControls_=new ZoomControls$$module$build$src$core$zoom_controls(this);
2291
+ var a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)}copyOptionsForFlyout(){return new Options$$module$build$src$core$options({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,plugins:this.options.plugins,modalInputs:this.options.modalInputs,move:{scrollbars:!0}})}addFlyout(a){var b=this.copyOptionsForFlyout();b.toolboxPosition=this.options.toolboxPosition;
2292
+ this.flyout=this.horizontalLayout?new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(b):new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(b);this.flyout.autoClose=!1;this.flyout.getWorkspace().setVisible(!0);return this.flyout.createDom(a)}getFlyout(a){return this.flyout||a?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM();
2293
+ this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox?this.toolbox.position():this.flyout&&this.flyout.position();var a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE,!0),b=this.getMetricsManager().getUiMetrics(),c=[];for(let d=0,e;e=a[d];d++){e.position(b,c);let f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&
2294
+ this.scrollbar.resize();this.updateScreenCalculations();this.workspaceFocusRing&&this.workspaceSelectionRing&&(this.resizeWorkspaceRing(this.workspaceSelectionRing,5),this.resizeWorkspaceRing(this.workspaceFocusRing,0))}resizeWorkspaceRing(a,b){var c=this.getMetrics();a.setAttribute("x",`${c.absoluteLeft+b}`);a.setAttribute("y",`${c.absoluteTop+b}`);a.setAttribute("width",`${Math.max(0,c.viewWidth-b*2)}`);a.setAttribute("height",`${Math.max(0,c.svgHeight-b*2)}`)}updateScreenCalculationsIfScrolled(){var a=
2295
+ getDocumentScroll$$module$build$src$core$utils$svg_math();Coordinate$$module$build$src$core$utils$coordinate.equals(this.lastRecordedPageScroll,a)||(this.lastRecordedPageScroll=a,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(a,b){var c=this.getParentSvg();a!=null&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));b!=null&&(this.cachedParentSvgSize.height=b,c.setAttribute("data-cached-height",
2296
+ `${b}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let a=this.svgGroup_;for(;a;){if(a.tagName==="svg"){this.cachedParentSvg=a;break}a=a.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(isEnabled$$module$build$src$core$events$utils()){var a=this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&Math.abs(b-this.oldTop)<1&&Math.abs(c-this.oldLeft)<1)){var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE))(b,
2297
+ c,a,this.id,this.oldScale);this.oldScale=a;this.oldTop=b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){var c;(c=this.layerManager)==null||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);var d;(d=this.grid)==null||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){var a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.visible=a;this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(a),
2298
+ this.getFlyout()&&this.getFlyout().setContainerVisible(a),this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){var a=this.getAllBlocks(!1);for(let b=a.length-1;b>=0;b--)a[b].queueRender();this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender())}highlightBlock(a,b){if(b===void 0){for(let c=0,d;d=this.highlightedBlocks[c];c++)d.setHighlighted(!1);this.highlightedBlocks.length=
2299
+ 0}if(a=a?this.getBlockById(a):null)(b=b===void 0||b)?this.highlightedBlocks.includes(a)||this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks,a),a.setHighlighted(b)}variableChangeCallback(a){switch(a.type){case EventType$$module$build$src$core$events$type.VAR_CREATE:case EventType$$module$build$src$core$events$type.VAR_DELETE:case EventType$$module$build$src$core$events$type.VAR_RENAME:case EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE:this.refreshToolboxSelection()}}refreshToolboxSelection(){var a=
2300
+ this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){var a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let b=0,c;c=a[b];b++){let d=c.getClientRect();d&&this.dragTargetAreas.push({component:c,clientRect:d})}}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");
2301
+ }newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}getDragTarget(a){a=a instanceof Coordinate$$module$build$src$core$utils$coordinate?wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,a):new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.x,a.y))return c.component;return null}onMouseDown(a){var b=this.getGesture(a);b&&b.handleWsStart(a,
2302
+ this)}startDrag(a,b){start$$module$build$src$core$utils$drag(this,a,b)}moveDrag(a){return move$$module$build$src$core$utils$drag(this,a)}isDragging(){return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()||this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||
2303
+ this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){var a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}onMouseWheel(a){if(Gesture$$module$build$src$core$gesture.inProgress())a.preventDefault(),a.stopPropagation();
2304
+ else{var b=this.options.zoomOptions&&this.options.zoomOptions.wheel,c=this.options.moveOptions&&this.options.moveOptions.wheel;if(b||c){var d=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(MAC$$module$build$src$core$utils$useragent)var e=a.metaKey;b&&(a.ctrlKey||e||!c)?(d=-d.y/50,b=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(b.x,b.y,d)):(b=this.scrollX-d.x,c=this.scrollY-d.y,a.shiftKey&&!d.x&&(b=this.scrollX-d.y,c=
2305
+ this.scrollY),this.scroll(b,c));a.preventDefault()}}}getBlocksBoundingBox(){var a=this.getTopBoundedElements();if(!a.length)return new Rect$$module$build$src$core$utils$rect(0,0,0,0);var b=a[0].getBoundingRectangle();for(let d=1;d<a.length;d++){var c=a[d];if(c.isInsertionMarker&&c.isInsertionMarker())continue;c=c.getBoundingRectangle();c.top<b.top&&(b.top=c.top);c.bottom>b.bottom&&(b.bottom=c.bottom);c.left<b.left&&(b.left=c.left);c.right>b.right&&(b.right=c.right)}return b}cleanUp(){this.setResizesEnabled(!1);
2306
+ var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=this.getTopBlocks(!0),c=b.filter(g=>g.isMovable()),d=b.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());b=function(g){for(let h of d)if(g.intersects(h))return h;return null};var e=0,f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(let g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=b(c);e!=null;)e=e.top+
2307
+ e.getHeight()+f,g.moveBy(0,e-c.top,["cleanup"]),g.snapToGrid(),c=g.getBoundingRectangle(),e=b(c);e=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+f}$.setGroup$$module$build$src$core$events$utils(a);this.setResizesEnabled(!0)}showContextMenu(a){if(!this.isReadOnly()&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({workspace:this,focusedNode:this},a);this.configureContextMenu&&this.configureContextMenu(b,a);if(a instanceof
2308
+ PointerEvent)var c=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);else c=this.RTL?this.getWidth()-5:5,c=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,new Coordinate$$module$build$src$core$utils$coordinate(c,5));show$$module$build$src$core$contextmenu(a,b,this.RTL,this,c)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");
2309
+ if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():
2310
+ (setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);var d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:d<this.options.zoomOptions.minScale&&(c=this.options.zoomOptions.minScale/this.scale);var e=this.getCanvas().getCTM(),f=this.getParentSvg().createSVGPoint();f.x=a;f.y=b;f=f.matrixTransform(e.inverse());a=f.x;b=f.y;e=e.translate(a*
2311
+ (1-c),b*(1-c)).scale(c);this.scrollX=e.e;this.scrollY=e.f;this.setScale(d)}}zoomCenter(a){var b=this.getMetrics();if(this.flyout){var c=b.svgWidth?b.svgWidth/2:0;b=b.svgHeight?b.svgHeight/2:0}else c=b.viewWidth/2+b.absoluteLeft,b=b.viewHeight/2+b.absoluteTop;this.zoom(c,b,a)}zoomToFit(){if(this.isMovable()){var a=this.getMetrics(),b=a.viewWidth;a=a.viewHeight;var c=this.getBlocksBoundingBox(),d=ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg*2,e=c.right-c.left+d;c=c.bottom-c.top+d;if(e){this.flyout&&
2312
+ (this.horizontalLayout?(a+=this.flyout.getHeight(),c+=this.flyout.getHeight()/this.scale):(b+=this.flyout.getWidth(),e+=this.flyout.getWidth()/this.scale));b/=e;a/=c;$.disable$$module$build$src$core$events$utils();try{this.setScale(Math.min(b,a)),this.scrollCenter()}finally{$.enable$$module$build$src$core$events$utils()}this.maybeFireViewportChangeEvent()}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}beginCanvasTransition(){addClass$$module$build$src$core$utils$dom(this.getCanvas(),
2326
2313
  "blocklyCanvasTransitioning");addClass$$module$build$src$core$utils$dom(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}endCanvasTransition(){removeClass$$module$build$src$core$utils$dom(this.getCanvas(),"blocklyCanvasTransitioning");removeClass$$module$build$src$core$utils$dom(this.getBubbleCanvas(),"blocklyCanvasTransitioning")}scrollCenter(){if(this.isMovable()){var a=this.getMetrics(),b=(a.scrollWidth-a.viewWidth)/2,c=(a.scrollHeight-a.viewHeight)/2;b=-b-a.scrollLeft;c=-c-a.scrollTop;this.scroll(b,
2327
2314
  c)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}centerOnBlock(a,b){if(this.isMovable()){var c=a?this.getBlockById(a):null;if(c){a=c.getRelativeToSurfaceXY();c=b?{height:c.height,width:c.width}:c.getHeightWidth();var d=this.scale;b=(a.x+(this.RTL?-1:1)*c.width/2)*d;a=(a.y+c.height/2)*d;c=this.getMetrics();this.scroll(-(b-c.viewWidth/2),-(a-c.viewHeight/2))}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}setScale(a){this.options.zoomOptions.maxScale&&
2328
2315
  a>this.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&a<this.options.zoomOptions.minScale&&(a=this.options.zoomOptions.minScale);this.scale=a;this.hideChaff(!1);(a=this.getFlyout(!1))&&a.isVisible()&&(a.reflow(),this.recordDragTargets());this.grid&&this.grid.update(this.scale);a=this.getMetrics();this.scrollX-=a.absoluteLeft;this.scrollY-=a.absoluteTop;a.viewLeft+=a.absoluteLeft;a.viewTop+=a.absoluteTop;this.scroll(this.scrollX,this.scrollY);this.scrollbar&&
@@ -2346,15 +2333,13 @@ this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().
2346
2333
  module$build$src$core$workspace_svg.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;var VariableModel$$module$build$src$core$variable_model=class{constructor(a,b,c,d){this.workspace=a;this.name=b;this.type=c||"";this.id=d||genUid$$module$build$src$core$utils$idgenerator()}getId(){return this.id}getName(){return this.name}setName(a){this.name=a;return this}getType(){return this.type}setType(a){this.type=a;return this}getWorkspace(){return this.workspace}save(){var a={name:this.getName(),id:this.getId()},b=this.getType();b&&(a.type=b);return a}static load(a,b){a=new this(b,a.name,
2347
2334
  a.type,a.id);b.getVariableMap().addVariable(a);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(a))}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry,VariableModel$$module$build$src$core$variable_model);var module$build$src$core$variable_model={};module$build$src$core$variable_model.VariableModel=VariableModel$$module$build$src$core$variable_model;var VariableMap$$module$build$src$core$variable_map=class{constructor(a,b=!1){this.workspace=a;this.potentialMap=b;this.variableMap=new Map}clear(){for(let a of this.variableMap.values())for(let b of a.values())this.deleteVariable(b);if(this.variableMap.size!==0)throw Error("Non-empty variable map");}renameVariable(a,b){if(a.getName()===b)return a;var c=a.getType();c=this.getVariable(b,c);var d=this.workspace.getAllBlocks(!1),e="";this.potentialMap||(e=$.getGroup$$module$build$src$core$events$utils())||
2348
2335
  $.setGroup$$module$build$src$core$events$utils(!0);try{c&&c.getId()!==a.getId()?this.renameVariableWithConflict(a,b,c,d):this.renameVariableAndUses(a,b,d)}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(e)}return a}changeVariableType(a,b){var c=a.getType();if(c===b)return a;var d=this.variableMap.get(c);d==null||d.delete(a.getId());(d==null?void 0:d.size)===0&&this.variableMap.delete(c);a.setType(b);var e;d=(e=this.variableMap.get(b))!=null?e:new Map;d.set(a.getId(),a);this.variableMap.has(b)||
2349
- this.variableMap.set(b,d);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE))(a,c,b));return a}renameVariableById(a,b){$.warn$$module$build$src$core$utils$deprecation("VariableMap.renameVariableById","v12","v13","VariableMap.renameVariable");var c=this.getVariableById(a);if(!c)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.renameVariable(c,b)}renameVariableAndUses(a,b,c){this.potentialMap||
2350
- fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_RENAME))(a,b));a.setName(b);for(b=0;b<c.length;b++)c[b].updateVarName(a)}renameVariableWithConflict(a,b,c,d){var e=a.getType(),f=c.getName();b!==f&&this.renameVariableAndUses(c,b,d);for(b=0;b<d.length;b++)d[b].renameVarById(a.getId(),c.getId());this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_DELETE))(a));
2351
- var g;(g=this.variableMap.get(e))==null||g.delete(a.getId())}createVariable(a,b,c){var d=this.getVariable(a,b);if(d){if(c&&d.getId()!==c)throw Error('Variable "'+a+'" is already in use and its id is "'+d.getId()+'" which conflicts with the passed in id, "'+c+'".');return d}if(c&&this.getVariableById(c))throw Error('Variable id, "'+c+'", is already in use.');d=c||genUid$$module$build$src$core$utils$idgenerator();b=b||"";c=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,
2352
- this.workspace.options,!0);if(!c)throw Error("No variable model is registered.");d=new c(this.workspace,a,b,d);var e;a=(e=this.variableMap.get(b))!=null?e:new Map;a.set(d.getId(),d);this.variableMap.has(b)||this.variableMap.set(b,a);this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(d));return d}addVariable(a){var b=a.getType();this.variableMap.has(b)||this.variableMap.set(b,new Map);var c;
2353
- (c=this.variableMap.get(b))==null||c.set(a.getId(),a)}deleteVariable(a){var b=getVariableUsesById$$module$build$src$core$variables(this.workspace,a.getId()),c="";this.potentialMap||(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);try{for(let e=0;e<b.length;e++)b[e].isDeadOrDying()||b[e].dispose(!0);let d=this.variableMap.get(a.getType());d&&d.has(a.getId())&&(d.delete(a.getId()),this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_DELETE))(a)),
2354
- d.size===0&&this.variableMap.delete(a.getType()))}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(c)}}deleteVariableById(a){$.warn$$module$build$src$core$utils$deprecation("VariableMap.deleteVariableById","v12","v13","Blockly.Variables.deleteVariable");(a=this.getVariableById(a))&&$.deleteVariable$$module$build$src$core$variables(this.workspace,a)}getVariable(a,b){b=this.variableMap.get(b||"");if(!b)return null;var c;return(c=[...b.values()].find(d=>$.Names$$module$build$src$core$names.equals(d.getName(),
2355
- a)))!=null?c:null}getVariableById(a){for(let b of this.variableMap.values())if(b.has(a)){let c;return(c=b.get(a))!=null?c:null}return null}getVariablesOfType(a){return(a=this.variableMap.get(a||""))?[...a.values()]:[]}getTypes(){return[...this.variableMap.keys()]}getAllVariables(){var a=[];for(let b of this.variableMap.values())a=a.concat(...b.values());return a}getAllVariableNames(){$.warn$$module$build$src$core$utils$deprecation("VariableMap.getAllVariableNames","v12","v13","Blockly.Variables.getAllVariables");
2356
- var a=[];for(let b of this.variableMap.values())for(let c of b.values())a.push(c.getName());return a}getVariableUsesById(a){$.warn$$module$build$src$core$utils$deprecation("VariableMap.getVariableUsesById","v12","v13","Blockly.Variables.getVariableUsesById");return getVariableUsesById$$module$build$src$core$variables(this.workspace,a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,DEFAULT$$module$build$src$core$registry,VariableMap$$module$build$src$core$variable_map);
2357
- var module$build$src$core$variable_map={};module$build$src$core$variable_map.VariableMap=VariableMap$$module$build$src$core$variable_map;var Trashcan$$module$build$src$core$trashcan=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.workspace=a;this.id="trashcan";this.uniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contents=[];this.flyout=null;this.isLidOpen=!1;this.svgGroup=null;this.top=this.left=0;this.initialized=!1;this.workspace.options.maxTrashcanContents<=0||(a=this.workspace.copyOptionsForFlyout(),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition===
2336
+ this.variableMap.set(b,d);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE))(a,c,b));return a}renameVariableAndUses(a,b,c){this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_RENAME))(a,b));a.setName(b);for(b=0;b<c.length;b++)c[b].updateVarName(a)}renameVariableWithConflict(a,b,c,d){var e=a.getType(),
2337
+ f=c.getName();b!==f&&this.renameVariableAndUses(c,b,d);for(b=0;b<d.length;b++)d[b].renameVarById(a.getId(),c.getId());this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_DELETE))(a));var g;(g=this.variableMap.get(e))==null||g.delete(a.getId())}createVariable(a,b,c){var d=this.getVariable(a,b);if(d){if(c&&d.getId()!==c)throw Error('Variable "'+a+'" is already in use and its id is "'+d.getId()+'" which conflicts with the passed in id, "'+
2338
+ c+'".');return d}if(c&&this.getVariableById(c))throw Error('Variable id, "'+c+'", is already in use.');d=c||genUid$$module$build$src$core$utils$idgenerator();b=b||"";c=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,this.workspace.options,!0);if(!c)throw Error("No variable model is registered.");d=new c(this.workspace,a,b,d);var e;a=(e=this.variableMap.get(b))!=null?e:new Map;a.set(d.getId(),d);this.variableMap.has(b)||this.variableMap.set(b,
2339
+ a);this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(d));return d}addVariable(a){var b=a.getType();this.variableMap.has(b)||this.variableMap.set(b,new Map);var c;(c=this.variableMap.get(b))==null||c.set(a.getId(),a)}deleteVariable(a){var b=getVariableUsesById$$module$build$src$core$variables(this.workspace,a.getId()),c="";this.potentialMap||(c=$.getGroup$$module$build$src$core$events$utils())||
2340
+ $.setGroup$$module$build$src$core$events$utils(!0);try{for(let e=0;e<b.length;e++)b[e].isDeadOrDying()||b[e].dispose(!0);let d=this.variableMap.get(a.getType());d&&d.has(a.getId())&&(d.delete(a.getId()),this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_DELETE))(a)),d.size===0&&this.variableMap.delete(a.getType()))}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(c)}}getVariable(a,
2341
+ b){b=this.variableMap.get(b||"");if(!b)return null;var c;return(c=[...b.values()].find(d=>$.Names$$module$build$src$core$names.equals(d.getName(),a)))!=null?c:null}getVariableById(a){for(let b of this.variableMap.values())if(b.has(a)){let c;return(c=b.get(a))!=null?c:null}return null}getVariablesOfType(a){return(a=this.variableMap.get(a||""))?[...a.values()]:[]}getTypes(){return[...this.variableMap.keys()]}getAllVariables(){var a=[];for(let b of this.variableMap.values())a=a.concat(...b.values());
2342
+ return a}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,DEFAULT$$module$build$src$core$registry,VariableMap$$module$build$src$core$variable_map);var module$build$src$core$variable_map={};module$build$src$core$variable_map.VariableMap=VariableMap$$module$build$src$core$variable_map;var Trashcan$$module$build$src$core$trashcan=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.workspace=a;this.id="trashcan";this.uniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contents=[];this.flyout=null;this.isLidOpen=!1;this.svgGroup=null;this.top=this.left=0;this.initialized=!1;this.workspace.options.maxTrashcanContents<=0||(a=this.workspace.copyOptionsForFlyout(),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition===
2358
2343
  Position$$module$build$src$core$utils$toolbox.TOP?Position$$module$build$src$core$utils$toolbox.BOTTOM:Position$$module$build$src$core$utils$toolbox.TOP,this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(a)):(a.toolboxPosition=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT?Position$$module$build$src$core$utils$toolbox.LEFT:Position$$module$build$src$core$utils$toolbox.RIGHT,
2359
2344
  this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(a)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyTrash",tabindex:"0",id:this.uniqueId});createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan+
2360
2345
  8,height:BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan+8,x:-4,y:-4,rx:2,ry:2,fill:"none","class":"blocklyFocusRing"},this.svgGroup);setRole$$module$build$src$core$utils$aria(this.svgGroup,Role$$module$build$src$core$utils$aria.BUTTON);setState$$module$build$src$core$utils$aria(this.svgGroup,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.OPEN_TRASH);var a=String(Math.random()).substring(2);var b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,
@@ -2645,7 +2630,7 @@ null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEv
2645
2630
  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));
2646
2631
  $.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,
2647
2632
  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');
2648
- 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.6",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,
2633
+ 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.7",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,
2649
2634
  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=
2650
2635
  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,
2651
2636
  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,