blockly 12.5.1 → 13.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blockly.min.js +645 -533
- package/blockly.mjs +13 -5
- package/blockly_compressed.js +610 -507
- package/blockly_compressed.js.map +1 -1
- package/blocks_compressed.js +16 -16
- package/blocks_compressed.js.map +1 -1
- package/core/block.d.ts +1 -1
- package/core/block_svg.d.ts +39 -16
- package/core/blockly.d.ts +21 -16
- package/core/bubbles/bubble.d.ts +17 -2
- package/core/bubbles/mini_workspace_bubble.d.ts +5 -0
- package/core/bubbles/textinput_bubble.d.ts +5 -0
- package/core/comments/comment_editor.d.ts +2 -2
- package/core/comments/rendered_workspace_comment.d.ts +6 -1
- package/core/common.d.ts +1 -1
- package/core/css.d.ts +2 -1
- package/core/dragging/block_drag_strategy.d.ts +84 -14
- package/core/dragging/bubble_drag_strategy.d.ts +5 -4
- package/core/dragging/comment_drag_strategy.d.ts +4 -4
- package/core/dragging/dragger.d.ts +13 -14
- package/core/events/events_block_create.d.ts +0 -3
- package/core/events/events_block_delete.d.ts +0 -3
- package/core/events/events_comment_create.d.ts +0 -3
- package/core/events/events_comment_delete.d.ts +0 -3
- package/core/field.d.ts +69 -0
- package/core/flyout_base.d.ts +1 -125
- package/core/flyout_button.d.ts +9 -0
- package/core/flyout_horizontal.d.ts +0 -11
- package/core/flyout_vertical.d.ts +0 -11
- package/core/gesture.d.ts +0 -12
- package/core/hints.d.ts +44 -0
- package/core/icons/icon.d.ts +6 -0
- package/core/inputs/input.d.ts +7 -1
- package/core/interfaces/i_bounded_element.d.ts +7 -0
- package/core/interfaces/i_bubble.d.ts +3 -2
- package/core/interfaces/i_collapsible_toolbox_item.d.ts +5 -1
- package/core/interfaces/i_draggable.d.ts +22 -17
- package/core/interfaces/i_dragger.d.ts +19 -10
- package/core/interfaces/i_flyout.d.ts +1 -31
- package/core/interfaces/i_focusable_node.d.ts +6 -0
- package/core/interfaces/i_focusable_tree.d.ts +8 -0
- package/core/interfaces/i_json_block_definition.d.ts +102 -0
- package/core/interfaces/i_navigation_policy.d.ts +12 -0
- package/core/interfaces/i_selectable.d.ts +2 -2
- package/core/interfaces/i_selectable_toolbox_item.d.ts +3 -3
- package/core/interfaces/i_toolbox.d.ts +4 -0
- package/core/interfaces/i_toolbox_item.d.ts +6 -0
- package/core/keyboard_nav/keyboard_mover.d.ts +138 -0
- package/core/keyboard_nav/move_indicator.d.ts +35 -0
- package/core/keyboard_nav/{block_comment_navigation_policy.d.ts → navigation_policies/block_comment_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{block_navigation_policy.d.ts → navigation_policies/block_navigation_policy.d.ts} +17 -25
- package/core/keyboard_nav/{comment_bar_button_navigation_policy.d.ts → navigation_policies/comment_bar_button_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{comment_editor_navigation_policy.d.ts → navigation_policies/comment_editor_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{connection_navigation_policy.d.ts → navigation_policies/connection_navigation_policy.d.ts} +11 -16
- package/core/keyboard_nav/{field_navigation_policy.d.ts → navigation_policies/field_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{flyout_button_navigation_policy.d.ts → navigation_policies/flyout_button_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/{flyout_separator_navigation_policy.d.ts → navigation_policies/flyout_separator_navigation_policy.d.ts} +9 -3
- package/core/keyboard_nav/{icon_navigation_policy.d.ts → navigation_policies/icon_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.d.ts +64 -0
- package/core/keyboard_nav/{workspace_comment_navigation_policy.d.ts → navigation_policies/workspace_comment_navigation_policy.d.ts} +14 -9
- package/core/keyboard_nav/{workspace_navigation_policy.d.ts → navigation_policies/workspace_navigation_policy.d.ts} +10 -3
- package/core/keyboard_nav/navigators/flyout_navigator.d.ts +63 -0
- package/core/keyboard_nav/navigators/navigator.d.ts +225 -0
- package/core/keyboard_nav/navigators/toolbox_navigator.d.ts +70 -0
- package/core/registry.d.ts +0 -2
- package/core/renderers/common/constants.d.ts +4 -7
- package/core/renderers/common/i_path_object.d.ts +8 -0
- package/core/renderers/common/path_object.d.ts +5 -14
- package/core/renderers/common/renderer.d.ts +3 -3
- package/core/renderers/zelos/constants.d.ts +1 -14
- package/core/renderers/zelos/measurables/bottom_row.d.ts +1 -1
- package/core/renderers/zelos/measurables/top_row.d.ts +1 -1
- package/core/renderers/zelos/path_object.d.ts +0 -3
- package/core/renderers/zelos/renderer.d.ts +8 -0
- package/core/shortcut_items.d.ts +63 -1
- package/core/theme.d.ts +0 -2
- package/core/toast.d.ts +2 -11
- package/core/toolbox/category.d.ts +5 -0
- package/core/toolbox/separator.d.ts +4 -0
- package/core/toolbox/toolbox.d.ts +12 -22
- package/core/toolbox/toolbox_item.d.ts +4 -0
- package/core/utils/aria.d.ts +292 -23
- package/core/utils/shortcut_formatting.d.ts +24 -0
- package/core/utils/useragent.d.ts +1 -0
- package/core/workspace_audio.d.ts +23 -0
- package/core/workspace_svg.d.ts +8 -50
- package/dart_compressed.js +9 -9
- package/dart_compressed.js.map +1 -1
- package/index.mjs +13 -5
- package/javascript_compressed.js +11 -10
- package/javascript_compressed.js.map +1 -1
- package/lua_compressed.js +7 -7
- package/lua_compressed.js.map +1 -1
- package/msg/ab.js +8 -0
- package/msg/ab.mjs +8 -0
- package/msg/ace.js +8 -0
- package/msg/ace.mjs +8 -0
- package/msg/af.js +8 -0
- package/msg/af.mjs +8 -0
- package/msg/am.js +8 -0
- package/msg/am.mjs +8 -0
- package/msg/ar.js +8 -0
- package/msg/ar.mjs +8 -0
- package/msg/ast.js +8 -0
- package/msg/ast.mjs +8 -0
- package/msg/az.js +8 -0
- package/msg/az.mjs +8 -0
- package/msg/ba.js +8 -0
- package/msg/ba.mjs +8 -0
- package/msg/bcc.js +8 -0
- package/msg/bcc.mjs +8 -0
- package/msg/be-tarask.js +8 -0
- package/msg/be-tarask.mjs +8 -0
- package/msg/be.js +8 -0
- package/msg/be.mjs +8 -0
- package/msg/bg.js +8 -0
- package/msg/bg.mjs +8 -0
- package/msg/bn.js +8 -0
- package/msg/bn.mjs +8 -0
- package/msg/br.js +8 -0
- package/msg/br.mjs +8 -0
- package/msg/bs.js +8 -0
- package/msg/bs.mjs +8 -0
- package/msg/ca.js +8 -0
- package/msg/ca.mjs +8 -0
- package/msg/cdo.js +8 -0
- package/msg/cdo.mjs +8 -0
- package/msg/ce.js +8 -0
- package/msg/ce.mjs +8 -0
- package/msg/cs.js +8 -0
- package/msg/cs.mjs +8 -0
- package/msg/da.js +8 -0
- package/msg/da.mjs +8 -0
- package/msg/de.js +8 -0
- package/msg/de.mjs +8 -0
- package/msg/diq.js +8 -0
- package/msg/diq.mjs +8 -0
- package/msg/dtp.js +8 -0
- package/msg/dtp.mjs +8 -0
- package/msg/dty.js +8 -0
- package/msg/dty.mjs +8 -0
- package/msg/ee.js +8 -0
- package/msg/ee.mjs +8 -0
- package/msg/el.js +8 -0
- package/msg/el.mjs +8 -0
- package/msg/en-gb.js +8 -0
- package/msg/en-gb.mjs +8 -0
- package/msg/en.js +8 -0
- package/msg/en.mjs +8 -0
- package/msg/eo.js +8 -0
- package/msg/eo.mjs +8 -0
- package/msg/es.js +8 -0
- package/msg/es.mjs +8 -0
- package/msg/et.js +8 -0
- package/msg/et.mjs +8 -0
- package/msg/eu.js +8 -0
- package/msg/eu.mjs +8 -0
- package/msg/fa.js +8 -0
- package/msg/fa.mjs +8 -0
- package/msg/fi.js +8 -0
- package/msg/fi.mjs +8 -0
- package/msg/fo.js +8 -0
- package/msg/fo.mjs +8 -0
- package/msg/fr.js +8 -0
- package/msg/fr.mjs +8 -0
- package/msg/frr.js +8 -0
- package/msg/frr.mjs +8 -0
- package/msg/gl.js +8 -0
- package/msg/gl.mjs +8 -0
- package/msg/gn.js +8 -0
- package/msg/gn.mjs +8 -0
- package/msg/gor.js +8 -0
- package/msg/gor.mjs +8 -0
- package/msg/ha.js +8 -0
- package/msg/ha.mjs +8 -0
- package/msg/hak.js +8 -0
- package/msg/hak.mjs +8 -0
- package/msg/he.js +8 -0
- package/msg/he.mjs +8 -0
- package/msg/hi.js +8 -0
- package/msg/hi.mjs +8 -0
- package/msg/hr.js +8 -0
- package/msg/hr.mjs +8 -0
- package/msg/hrx.js +8 -0
- package/msg/hrx.mjs +8 -0
- package/msg/hsb.js +8 -0
- package/msg/hsb.mjs +8 -0
- package/msg/hu.js +8 -0
- package/msg/hu.mjs +8 -0
- package/msg/hy.js +8 -0
- package/msg/hy.mjs +8 -0
- package/msg/ia.js +8 -0
- package/msg/ia.mjs +8 -0
- package/msg/id.js +8 -0
- package/msg/id.mjs +8 -0
- package/msg/ig.js +8 -0
- package/msg/ig.mjs +8 -0
- package/msg/inh.js +8 -0
- package/msg/inh.mjs +8 -0
- package/msg/is.js +8 -0
- package/msg/is.mjs +8 -0
- package/msg/it.js +8 -0
- package/msg/it.mjs +8 -0
- package/msg/ja.js +8 -0
- package/msg/ja.mjs +8 -0
- package/msg/ka.js +8 -0
- package/msg/ka.mjs +8 -0
- package/msg/kab.js +8 -0
- package/msg/kab.mjs +8 -0
- package/msg/kbd-cyrl.js +8 -0
- package/msg/kbd-cyrl.mjs +8 -0
- package/msg/km.js +8 -0
- package/msg/km.mjs +8 -0
- package/msg/kn.js +8 -0
- package/msg/kn.mjs +8 -0
- package/msg/ko.js +8 -0
- package/msg/ko.mjs +8 -0
- package/msg/ksh.js +8 -0
- package/msg/ksh.mjs +8 -0
- package/msg/ku-latn.js +8 -0
- package/msg/ku-latn.mjs +8 -0
- package/msg/ky.js +8 -0
- package/msg/ky.mjs +8 -0
- package/msg/la.js +8 -0
- package/msg/la.mjs +8 -0
- package/msg/lb.js +8 -0
- package/msg/lb.mjs +8 -0
- package/msg/lki.js +8 -0
- package/msg/lki.mjs +8 -0
- package/msg/lo.js +8 -0
- package/msg/lo.mjs +8 -0
- package/msg/lrc.js +8 -0
- package/msg/lrc.mjs +8 -0
- package/msg/lt.js +8 -0
- package/msg/lt.mjs +8 -0
- package/msg/lv.js +8 -0
- package/msg/lv.mjs +8 -0
- package/msg/mg.js +8 -0
- package/msg/mg.mjs +8 -0
- package/msg/mk.js +8 -0
- package/msg/mk.mjs +8 -0
- package/msg/ml.js +8 -0
- package/msg/ml.mjs +8 -0
- package/msg/mnw.js +8 -0
- package/msg/mnw.mjs +8 -0
- package/msg/ms.js +8 -0
- package/msg/ms.mjs +8 -0
- package/msg/my.js +8 -0
- package/msg/my.mjs +8 -0
- package/msg/mzn.js +8 -0
- package/msg/mzn.mjs +8 -0
- package/msg/nb.js +8 -0
- package/msg/nb.mjs +8 -0
- package/msg/ne.js +8 -0
- package/msg/ne.mjs +8 -0
- package/msg/nl.js +8 -0
- package/msg/nl.mjs +8 -0
- package/msg/oc.js +8 -0
- package/msg/oc.mjs +8 -0
- package/msg/olo.js +8 -0
- package/msg/olo.mjs +8 -0
- package/msg/pa.js +8 -0
- package/msg/pa.mjs +8 -0
- package/msg/pl.js +8 -0
- package/msg/pl.mjs +8 -0
- package/msg/pms.js +8 -0
- package/msg/pms.mjs +8 -0
- package/msg/ps.js +8 -0
- package/msg/ps.mjs +8 -0
- package/msg/pt-br.js +8 -0
- package/msg/pt-br.mjs +8 -0
- package/msg/pt.js +8 -0
- package/msg/pt.mjs +8 -0
- package/msg/ro.js +8 -0
- package/msg/ro.mjs +8 -0
- package/msg/ru.js +8 -0
- package/msg/ru.mjs +8 -0
- package/msg/sc.js +8 -0
- package/msg/sc.mjs +8 -0
- package/msg/sco.js +8 -0
- package/msg/sco.mjs +8 -0
- package/msg/sd.js +8 -0
- package/msg/sd.mjs +8 -0
- package/msg/shn.js +8 -0
- package/msg/shn.mjs +8 -0
- package/msg/si.js +8 -0
- package/msg/si.mjs +8 -0
- package/msg/sk.js +8 -0
- package/msg/sk.mjs +8 -0
- package/msg/skr-arab.js +8 -0
- package/msg/skr-arab.mjs +8 -0
- package/msg/sl.js +8 -0
- package/msg/sl.mjs +8 -0
- package/msg/smn.js +8 -0
- package/msg/smn.mjs +8 -0
- package/msg/sq.js +8 -0
- package/msg/sq.mjs +8 -0
- package/msg/sr-latn.js +8 -0
- package/msg/sr-latn.mjs +8 -0
- package/msg/sr.js +8 -0
- package/msg/sr.mjs +8 -0
- package/msg/sv.js +8 -0
- package/msg/sv.mjs +8 -0
- package/msg/sw.js +8 -0
- package/msg/sw.mjs +8 -0
- package/msg/ta.js +8 -0
- package/msg/ta.mjs +8 -0
- package/msg/tcy.js +8 -0
- package/msg/tcy.mjs +8 -0
- package/msg/tdd.js +8 -0
- package/msg/tdd.mjs +8 -0
- package/msg/te.js +8 -0
- package/msg/te.mjs +8 -0
- package/msg/th.js +8 -0
- package/msg/th.mjs +8 -0
- package/msg/ti.js +8 -0
- package/msg/ti.mjs +8 -0
- package/msg/tl.js +8 -0
- package/msg/tl.mjs +8 -0
- package/msg/tlh.js +8 -0
- package/msg/tlh.mjs +8 -0
- package/msg/tr.js +8 -0
- package/msg/tr.mjs +8 -0
- package/msg/ug-arab.js +8 -0
- package/msg/ug-arab.mjs +8 -0
- package/msg/uk.js +8 -0
- package/msg/uk.mjs +8 -0
- package/msg/ur.js +8 -0
- package/msg/ur.mjs +8 -0
- package/msg/uz.js +8 -0
- package/msg/uz.mjs +8 -0
- package/msg/vi.js +8 -0
- package/msg/vi.mjs +8 -0
- package/msg/xmf.js +8 -0
- package/msg/xmf.mjs +8 -0
- package/msg/yo.js +8 -0
- package/msg/yo.mjs +8 -0
- package/msg/zgh.js +8 -0
- package/msg/zgh.mjs +8 -0
- package/msg/zh-hans.js +8 -0
- package/msg/zh-hans.mjs +8 -0
- package/msg/zh-hant.js +8 -0
- package/msg/zh-hant.mjs +8 -0
- package/package.json +11 -11
- package/php_compressed.js +2 -2
- package/php_compressed.js.map +1 -1
- package/python_compressed.js +2 -2
- package/python_compressed.js.map +1 -1
- package/core/flyout_navigator.d.ts +0 -11
- package/core/keyboard_nav/flyout_navigation_policy.d.ts +0 -65
- package/core/keyboard_nav/line_cursor.d.ts +0 -187
- package/core/keyboard_nav/marker.d.ts +0 -53
- package/core/marker_manager.d.ts +0 -72
- package/core/navigator.d.ts +0 -65
- package/media/sprites.png +0 -0
package/blockly_compressed.js
CHANGED
|
@@ -24,40 +24,43 @@ globalShortcutHandler$$module$build$src$core$common,removeElem$$module$build$src
|
|
|
24
24
|
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,
|
|
25
25
|
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,
|
|
26
26
|
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,
|
|
27
|
-
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,setRole$$module$build$src$core$utils$aria,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
27
|
+
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,removeRole$$module$build$src$core$utils$aria,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,
|
|
28
|
+
initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria,announceDynamicAriaState$$module$build$src$core$utils$aria,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,doRenders$$module$build$src$core$render_management,
|
|
29
|
+
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,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,
|
|
30
|
+
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,jsonFlyoutCategoryBlocks$$module$build$src$core$variables,xmlFlyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,
|
|
31
|
+
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,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,
|
|
32
|
+
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,saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,
|
|
33
|
+
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,appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,
|
|
34
|
+
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,loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,
|
|
35
|
+
initBlock$$module$build$src$core$serialization$blocks,hasBubble$$module$build$src$core$interfaces$i_has_bubble,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,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,
|
|
36
|
+
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,
|
|
37
|
+
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,
|
|
38
|
+
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,
|
|
39
|
+
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,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,show$$module$build$src$core$tooltip,
|
|
40
|
+
getHsvSaturation$$module$build$src$core$utils$colour,setHsvSaturation$$module$build$src$core$utils$colour,getHsvValue$$module$build$src$core$utils$colour,setHsvValue$$module$build$src$core$utils$colour,parse$$module$build$src$core$utils$colour,rgbToHex$$module$build$src$core$utils$colour,hexToRgb$$module$build$src$core$utils$colour,hsvToHex$$module$build$src$core$utils$colour,blend$$module$build$src$core$utils$colour,hueToHex$$module$build$src$core$utils$colour,tokenizeInterpolationInternal$$module$build$src$core$utils$parsing,
|
|
41
|
+
tokenizeInterpolation$$module$build$src$core$utils$parsing,replaceMessageReferences$$module$build$src$core$utils$parsing,checkMessageReferences$$module$build$src$core$utils$parsing,parseBlockColour$$module$build$src$core$utils$parsing,getDiv$$module$build$src$core$widgetdiv,testOnly_setDiv$$module$build$src$core$widgetdiv,createDom$$module$build$src$core$widgetdiv,show$$module$build$src$core$widgetdiv,hide$$module$build$src$core$widgetdiv,isVisible$$module$build$src$core$widgetdiv,hideIfOwner$$module$build$src$core$widgetdiv,
|
|
42
|
+
hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv,positionInternal$$module$build$src$core$widgetdiv,positionWithAnchor$$module$build$src$core$widgetdiv,calculateX$$module$build$src$core$widgetdiv,calculateY$$module$build$src$core$widgetdiv,isRepositionable$$module$build$src$core$widgetdiv,repositionForWindowResize$$module$build$src$core$widgetdiv,getCurrentBlock$$module$build$src$core$contextmenu,setCurrentBlock$$module$build$src$core$contextmenu,show$$module$build$src$core$contextmenu,populate_$$module$build$src$core$contextmenu,
|
|
43
|
+
position_$$module$build$src$core$contextmenu,createWidget_$$module$build$src$core$contextmenu,haltPropagation$$module$build$src$core$contextmenu,hide$$module$build$src$core$contextmenu,dispose$$module$build$src$core$contextmenu,getMenu$$module$build$src$core$contextmenu,mouseToWorkspacePoint$$module$build$src$core$utils$drag,start$$module$build$src$core$utils$drag,move$$module$build$src$core$utils$drag,workspaceToDom$$module$build$src$core$xml,saveWorkspaceComment$$module$build$src$core$xml,variablesToDom$$module$build$src$core$xml,
|
|
44
|
+
blockToDomWithXY$$module$build$src$core$xml,fieldToDom$$module$build$src$core$xml,allFieldsToDom$$module$build$src$core$xml,blockToDom$$module$build$src$core$xml,cloneShadow$$module$build$src$core$xml,domToText$$module$build$src$core$xml,domToPrettyText$$module$build$src$core$xml,clearWorkspaceAndLoadFromXml$$module$build$src$core$xml,loadWorkspaceComment$$module$build$src$core$xml,appendDomToWorkspace$$module$build$src$core$xml,domToBlockInternal$$module$build$src$core$xml,domToVariables$$module$build$src$core$xml,
|
|
45
|
+
mapSupportedXmlTags$$module$build$src$core$xml,applyMutationTagNodes$$module$build$src$core$xml,applyCommentTagNodes$$module$build$src$core$xml,applyDataTagNodes$$module$build$src$core$xml,applyFieldTagNodes$$module$build$src$core$xml,findChildBlocks$$module$build$src$core$xml,applyInputTagNodes$$module$build$src$core$xml,applyNextTagNodes$$module$build$src$core$xml,domToBlockHeadless$$module$build$src$core$xml,domToField$$module$build$src$core$xml,deleteNext$$module$build$src$core$xml,isElement$$module$build$src$core$xml,
|
|
46
|
+
register$$module$build$src$core$field_registry,unregister$$module$build$src$core$field_registry,fromJsonInternal$$module$build$src$core$field_registry,isImageProperties$$module$build$src$core$field_dropdown,unregister$$module$build$src$core$extensions,isRegistered$$module$build$src$core$extensions,apply$$module$build$src$core$extensions,checkNoMutatorProperties$$module$build$src$core$extensions,checkXmlHooks$$module$build$src$core$extensions,checkJsonHooks$$module$build$src$core$extensions,checkMutatorDialog$$module$build$src$core$extensions,
|
|
47
|
+
checkHasFunctionPair$$module$build$src$core$extensions,checkHasMutatorProperties$$module$build$src$core$extensions,getMutatorProperties$$module$build$src$core$extensions,mutatorPropertiesMatch$$module$build$src$core$extensions,runAfterPageLoad$$module$build$src$core$extensions,checkDropdownOptionsInTable$$module$build$src$core$extensions,extensionParentTooltip$$module$build$src$core$extensions,point$$module$build$src$core$utils$svg_paths,curve$$module$build$src$core$utils$svg_paths,moveTo$$module$build$src$core$utils$svg_paths,
|
|
48
|
+
moveBy$$module$build$src$core$utils$svg_paths,lineTo$$module$build$src$core$utils$svg_paths,line$$module$build$src$core$utils$svg_paths,lineOnAxis$$module$build$src$core$utils$svg_paths,arc$$module$build$src$core$utils$svg_paths,connectReciprocally$$module$build$src$core$connection,getSingleConnection$$module$build$src$core$connection,getConnectionForOrphanedOutput$$module$build$src$core$connection,isIcon$$module$build$src$core$interfaces$i_icon,isCommentIcon$$module$build$src$core$interfaces$i_comment_icon,
|
|
49
|
+
disposeUiEffect$$module$build$src$core$block_animations,disposeUiStep$$module$build$src$core$block_animations,connectionUiEffect$$module$build$src$core$block_animations,disconnectUiEffect$$module$build$src$core$block_animations,disconnectUiStep$$module$build$src$core$block_animations,disconnectUiStop$$module$build$src$core$block_animations,moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster,blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster,blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster,
|
|
50
|
+
bumpObjectIntoBounds$$module$build$src$core$bump_objects,bumpIntoBoundsHandler$$module$build$src$core$bump_objects,extractObjectFromEvent$$module$build$src$core$bump_objects,bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects,getShortActionShortcut$$module$build$src$core$utils$shortcut_formatting,getLongActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting,getActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting,upperCaseFirst$$module$build$src$core$utils$shortcut_formatting,
|
|
51
|
+
modifierOrder$$module$build$src$core$utils$shortcut_formatting,showUnconstrainedMoveHint$$module$build$src$core$hints,showConstrainedMovementHint$$module$build$src$core$hints,clearMoveHints$$module$build$src$core$hints,showHelpHint$$module$build$src$core$hints,showBlockNavigationHint$$module$build$src$core$hints,showWorkspaceNavigationHint$$module$build$src$core$hints,isDraggable$$module$build$src$core$interfaces$i_draggable,isDeletable$$module$build$src$core$interfaces$i_deletable,getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,
|
|
52
|
+
navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item,getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator,
|
|
53
|
+
hasContextMenu$$module$build$src$core$interfaces$i_contextmenu,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures,procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,xmlFlyoutCategory$$module$build$src$core$procedures,
|
|
54
|
+
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,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,
|
|
55
|
+
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,internalFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic,
|
|
56
|
+
xmlFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,copy$$module$build$src$core$clipboard,getLastCopiedData$$module$build$src$core$clipboard,setLastCopiedData$$module$build$src$core$clipboard,getLastCopiedWorkspace$$module$build$src$core$clipboard,setLastCopiedWorkspace$$module$build$src$core$clipboard,getLastCopiedLocation$$module$build$src$core$clipboard,setLastCopiedLocation$$module$build$src$core$clipboard,
|
|
57
|
+
paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,isCopyable$$module$build$src$core$interfaces$i_copyable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,isCopyable$$module$build$src$core$shortcut_items,isCuttable$$module$build$src$core$shortcut_items,registerCopy$$module$build$src$core$shortcut_items,registerCut$$module$build$src$core$shortcut_items,registerPaste$$module$build$src$core$shortcut_items,registerUndo$$module$build$src$core$shortcut_items,
|
|
58
|
+
registerRedo$$module$build$src$core$shortcut_items,registerMovementShortcuts$$module$build$src$core$shortcut_items,registerShowContextMenu$$module$build$src$core$shortcut_items,registerArrowNavigation$$module$build$src$core$shortcut_items,registerFocusWorkspace$$module$build$src$core$shortcut_items,registerFocusToolbox$$module$build$src$core$shortcut_items,registerWorkspaceOverview$$module$build$src$core$shortcut_items,registerDisconnectBlock$$module$build$src$core$shortcut_items,registerStackNavigation$$module$build$src$core$shortcut_items,
|
|
59
|
+
registerPerformAction$$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,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,
|
|
60
|
+
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,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,
|
|
61
|
+
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,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,
|
|
62
|
+
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,registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,
|
|
63
|
+
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,$jscomp;
|
|
61
64
|
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.');const e=b.toLowerCase();if(!c)throw Error("Can not register a null value");let f=typeMap$$module$build$src$core$registry[a],
|
|
62
65
|
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};
|
|
63
66
|
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');}};
|
|
@@ -108,16 +111,16 @@ isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return i
|
|
|
108
111
|
deepMerge$$module$build$src$core$utils$object=function(a,b){for(const 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};
|
|
109
112
|
getAllWorkspaces$$module$build$src$core$common=function(){const a=[];for(const 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};
|
|
110
113
|
setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a};getSelected$$module$build$src$core$common=function(){const 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)};
|
|
111
|
-
fireSelectedEvent$$module$build$src$core$common=function(a){const b=getSelected$$module$build$src$core$common();let c,d,e,f;const 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)};
|
|
112
|
-
setParentContainer$$module$build$src$core$common=function(a){parentContainer$$module$build$src$core$common=a};
|
|
114
|
+
fireSelectedEvent$$module$build$src$core$common=function(a){const b=getSelected$$module$build$src$core$common();let c,d,e,f;const 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)};
|
|
115
|
+
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};
|
|
113
116
|
svgResize$$module$build$src$core$common=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;const b=a.getParentSvg(),c=a.getCachedParentSvgSize();var 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()}};
|
|
114
117
|
getBlockTypeCounts$$module$build$src$core$common=function(a,b){const c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(let e=0,f;f=d[e];e++)c[f.type]?c[f.type]++:c[f.type]=1;return c};jsonInitFactory$$module$build$src$core$common=function(a){return function(){this.jsonInit(a)}};defineBlocksWithJsonArray$$module$build$src$core$common=function(a){TEST_ONLY$$module$build$src$core$common.defineBlocksWithJsonArrayInternal(a)};
|
|
115
|
-
defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))};
|
|
116
|
-
$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){const b={};for(let c=0;c<a.length;c++){const d=a[c];if(!d){console.warn(`Block definition #${c} in JSON array is ${d}. Skipping`);continue}const e=d.type;e?b[e]={init:jsonInitFactory$$module$build$src$core$common(d)}:console.warn(`Block definition #${c} in JSON array is missing a type attribute. `+"Skipping.")}return b};
|
|
118
|
+
defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))};$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){const b={};for(let c=0;c<a.length;c++){const d=a[c];if(!d){console.warn(`Block definition #${c} in JSON array is ${d}. Skipping`);continue}const e=d.type;e?b[e]={init:jsonInitFactory$$module$build$src$core$common(d)}:console.warn(`Block definition #${c} in JSON array is missing a type attribute. Skipping.`)}return b};
|
|
117
119
|
$.defineBlocks$$module$build$src$core$common=function(a){for(const b of Object.keys(a)){const c=a[b];b in Blocks$$module$build$src$core$blocks&&console.warn(`Block definition "${b}" overwrites previous definition.`);Blocks$$module$build$src$core$blocks[b]=c}};
|
|
118
120
|
globalShortcutHandler$$module$build$src$core$common=function(a){let b=getMainWorkspace$$module$build$src$core$common();const c=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree();for(const d of getAllWorkspaces$$module$build$src$core$common())if(c===d){b=d;break}if(!isTargetInput$$module$build$src$core$browser_events(a)&&b&&(!b.rendered||b.isFlyout||b.isVisible()))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.onKeyDown(b,a)};
|
|
119
|
-
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(b===-1)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){if(
|
|
120
|
-
inject$$module$build$src$core$css=function(a,b){
|
|
121
|
+
removeElem$$module$build$src$core$utils$array=function(a,b){b=a.indexOf(b);if(b===-1)return!1;a.splice(b,1);return!0};register$$module$build$src$core$css=function(a){if(typeof window!=="undefined"&&window.CSSStyleSheet){var b=new CSSStyleSheet;b.replace(a);registeredStyleSheets$$module$build$src$core$css.push(b)}};
|
|
122
|
+
inject$$module$build$src$core$css=function(a,b,c){if(b&&typeof window!=="undefined"&&window.CSSStyleSheet){var d=a.getRootNode();injectionSites$$module$build$src$core$css.has(d)||(injectionSites$$module$build$src$core$css.add(d),a=c.replace(/[\\/]$/,""),a=content$$module$build$src$core$css.replace(/<<<PATH>>>/g,a),b=new CSSStyleSheet,b.replace(a),d.adoptedStyleSheets.push(b),registeredStyleSheets$$module$build$src$core$css.forEach(e=>d.adoptedStyleSheets.push(e)))}};
|
|
123
|
+
getSize$$module$build$src$core$utils$style=function(a){return TEST_ONLY$$module$build$src$core$utils$style.getSizeInternal(a)};
|
|
121
124
|
getSizeInternal$$module$build$src$core$utils$style=function(a){if(getComputedStyle$$module$build$src$core$utils$style(a,"display")!=="none")return getSizeWithDisplay$$module$build$src$core$utils$style(a);const b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";const f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new Size$$module$build$src$core$utils$size(f,a)};
|
|
122
125
|
getSizeWithDisplay$$module$build$src$core$utils$style=function(a){return new Size$$module$build$src$core$utils$size(a.offsetWidth,a.offsetHeight)};getComputedStyle$$module$build$src$core$utils$style=function(a,b){a=window.getComputedStyle(a);return a[b]||a.getPropertyValue(b)};
|
|
123
126
|
getPageOffset$$module$build$src$core$utils$style=function(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(0,0);a=a.getBoundingClientRect();var c=document.documentElement;c=new Coordinate$$module$build$src$core$utils$coordinate(window.pageXOffset||c.scrollLeft,window.pageYOffset||c.scrollTop);b.x=a.left+c.x;b.y=a.top+c.y;return b};
|
|
@@ -153,7 +156,13 @@ append$$module$build$src$core$serialization$workspace_comments=function(a,b,{rec
|
|
|
153
156
|
a.height){e=c.getSize();let f,g;c.setSize(new Size$$module$build$src$core$utils$size((f=a.width)!=null?f:e.width,(g=a.height)!=null?g:e.height))}a.collapsed!==void 0&&c.setCollapsed(a.collapsed);a.editable!==void 0&&c.setEditable(a.editable);a.movable!==void 0&&c.setMovable(a.movable);a.deletable!==void 0&&c.setDeletable(a.deletable);$.setRecordUndo$$module$build$src$core$events$utils(d);return c};
|
|
154
157
|
register$$module$build$src$core$clipboard$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a,b)};unregister$$module$build$src$core$clipboard$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a)};
|
|
155
158
|
moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster=function(a){const b=a.workspace,c=a.getRelativeToSurfaceXY(),d=new Coordinate$$module$build$src$core$utils$coordinate(0,0),e=b.getTopComments(!1).filter(f=>f.id!==a.id).map(f=>f.getRelativeToSurfaceXY());for(;commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster(Coordinate$$module$build$src$core$utils$coordinate.sum(c,d),e);)d.translate(b.RTL?-30:30,30);a.moveTo(Coordinate$$module$build$src$core$utils$coordinate.sum(c,
|
|
156
|
-
d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>Math.abs(c.x-a.x)<=1&&Math.abs(c.y-a.y)<=1)};
|
|
159
|
+
d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>Math.abs(c.x-a.x)<=1&&Math.abs(c.y-a.y)<=1)};removeRole$$module$build$src$core$utils$aria=function(a){a.removeAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria)};setRole$$module$build$src$core$utils$aria=function(a,b){b?a.setAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria,b):removeRole$$module$build$src$core$utils$aria(a)};
|
|
160
|
+
getRole$$module$build$src$core$utils$aria=function(a){return(a=a.getAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria))&&Object.values(Role$$module$build$src$core$utils$aria).includes(a)?a:null};setState$$module$build$src$core$utils$aria=function(a,b,c){Array.isArray(c)&&(c=c.join(" "));a.setAttribute(ARIA_PREFIX$$module$build$src$core$utils$aria+b,`${c}`)};clearState$$module$build$src$core$utils$aria=function(a,b){a.removeAttribute(ARIA_PREFIX$$module$build$src$core$utils$aria+b)};
|
|
161
|
+
getState$$module$build$src$core$utils$aria=function(a,b){return(a=a.getAttribute(ARIA_PREFIX$$module$build$src$core$utils$aria+b))?a:null};
|
|
162
|
+
initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria=function(a){if(!liveRegionElement$$module$build$src$core$utils$aria||!document.contains(liveRegionElement$$module$build$src$core$utils$aria)){var b=document.createElement("div");b.textContent="";b.id="blocklyAriaAnnounce";addClass$$module$build$src$core$utils$dom(b,"hiddenForAria");setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LIVE,LiveRegionAssertiveness$$module$build$src$core$utils$aria.POLITE);
|
|
163
|
+
setRole$$module$build$src$core$utils$aria(b,DEFAULT_LIVE_REGION_ROLE$$module$build$src$core$utils$aria);setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.ATOMIC,!0);a.appendChild(b);liveRegionElement$$module$build$src$core$utils$aria=b}};
|
|
164
|
+
announceDynamicAriaState$$module$build$src$core$utils$aria=function(a,b){if(!liveRegionElement$$module$build$src$core$utils$aria)throw Error("ARIA live region not initialized.");const c=liveRegionElement$$module$build$src$core$utils$aria,{assertiveness:d=LiveRegionAssertiveness$$module$build$src$core$utils$aria.POLITE,role:e=DEFAULT_LIVE_REGION_ROLE$$module$build$src$core$utils$aria}=b||{};clearTimeout(ariaAnnounceTimeout$$module$build$src$core$utils$aria);ariaAnnounceTimeout$$module$build$src$core$utils$aria=
|
|
165
|
+
setTimeout(()=>{c.replaceChildren();setState$$module$build$src$core$utils$aria(c,State$$module$build$src$core$utils$aria.LIVE,d);setRole$$module$build$src$core$utils$aria(c,e);const f=document.createElement("span");f.textContent=a+(addBreakingSpace$$module$build$src$core$utils$aria?"\u00a0":"");addBreakingSpace$$module$build$src$core$utils$aria=!addBreakingSpace$$module$build$src$core$utils$aria;c.appendChild(f)},10)};
|
|
157
166
|
isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return a&&typeof a.saveState==="function"&&typeof a.loadState==="function"};
|
|
158
167
|
queueRender$$module$build$src$core$render_management=function(a){queueBlock$$module$build$src$core$render_management(a);if(alwaysImmediatelyRender$$module$build$src$core$render_management())return doRenders$$module$build$src$core$render_management(),Promise.resolve();afterRendersPromise$$module$build$src$core$render_management||(afterRendersPromise$$module$build$src$core$render_management=new Promise(b=>{afterRendersResolver$$module$build$src$core$render_management=b;animationRequestId$$module$build$src$core$render_management=
|
|
159
168
|
window.requestAnimationFrame(()=>{doRenders$$module$build$src$core$render_management();b()})}));return afterRendersPromise$$module$build$src$core$render_management};finishQueuedRenders$$module$build$src$core$render_management=function(){return afterRendersPromise$$module$build$src$core$render_management?afterRendersPromise$$module$build$src$core$render_management:Promise.resolve()};
|
|
@@ -166,10 +175,10 @@ renderBlock$$module$build$src$core$render_management=function(a){if(dirtyBlocks$
|
|
|
166
175
|
setAlert$$module$build$src$core$dialog=function(a=defaultAlert$$module$build$src$core$dialog){alertImplementation$$module$build$src$core$dialog=a};confirm$$module$build$src$core$dialog=function(a,b){confirmImplementation$$module$build$src$core$dialog(a,b)};setConfirm$$module$build$src$core$dialog=function(a=defaultConfirm$$module$build$src$core$dialog){confirmImplementation$$module$build$src$core$dialog=a};
|
|
167
176
|
prompt$$module$build$src$core$dialog=function(a,b,c){promptImplementation$$module$build$src$core$dialog(a,b,c)};setPrompt$$module$build$src$core$dialog=function(a=defaultPrompt$$module$build$src$core$dialog){promptImplementation$$module$build$src$core$dialog=a};toast$$module$build$src$core$dialog=function(a,b){toastImplementation$$module$build$src$core$dialog(a,b)};
|
|
168
177
|
setToast$$module$build$src$core$dialog=function(a=defaultToast$$module$build$src$core$dialog){toastImplementation$$module$build$src$core$dialog=a};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"};
|
|
169
|
-
isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return a.getVariableModel!==void 0}
|
|
178
|
+
isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return a.getVariableModel!==void 0};$.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))};
|
|
170
179
|
$.allUsedVarModels$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);const b=new Set;for(let c=0;c<a.length;c++){const d=a[c].getVarModels();if(d)for(let e=0;e<d.length;e++){const 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);const 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())};
|
|
171
180
|
internalFlyoutCategory$$module$build$src$core$variables=function(a){return flyoutCategory$$module$build$src$core$variables(a,!1)};
|
|
172
|
-
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);
|
|
181
|
+
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);
|
|
173
182
|
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()}}};
|
|
174
183
|
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=[];const 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),
|
|
175
184
|
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};
|
|
@@ -185,7 +194,7 @@ $.renameVariable$$module$build$src$core$variables=function(a,b,c){function d(e){
|
|
|
185
194
|
h.getName()).replace("%2",h.getType()):k&&(l=$.Msg$$module$build$src$core$msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER.replace("%1",g).replace("%2",k));alert$$module$build$src$core$dialog(l,function(){d(g)})}else a.getVariableMap().renameVariable(b,g),c&&c(g)}else c&&c(null)})}d("")};
|
|
186
195
|
promptName$$module$build$src$core$variables=function(a,b,c){prompt$$module$build$src$core$dialog(a,b,function(d){d&&(d=d.replace(/[\s\xa0]+/g," ").trim(),d===$.Msg$$module$build$src$core$msg.RENAME_VARIABLE||d===$.Msg$$module$build$src$core$msg.NEW_VARIABLE)&&(d=null);c(d)})};nameUsedWithOtherType$$module$build$src$core$variables=function(a,b,c){c=c.getVariableMap().getAllVariables();a=a.toLowerCase();for(let d=0,e;e=c[d];d++)if(e.getName().toLowerCase()===a&&e.getType()!==b)return e;return null};
|
|
187
196
|
nameUsedWithAnyType$$module$build$src$core$variables=function(a,b){b=b.getVariableMap().getAllVariables();a=a.toLowerCase();for(let c=0,d;d=b[c];c++)if(d.getName().toLowerCase()===a)return d;return null};nameUsedWithConflictingParam$$module$build$src$core$variables=function(a,b,c){return c.getProcedureMap().getProcedures().length?checkForConflictingParamWithProcedureModels$$module$build$src$core$variables(a,b,c):checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables(a,b,c)};
|
|
188
|
-
checkForConflictingParamWithProcedureModels$$module$build$src$core$variables=function(a,b,c){a=a.toLowerCase();b=b.toLowerCase();c=c.getProcedureMap().getProcedures();for(const e of c){var d=e.getParameters().filter(isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model).map(f=>f.getVariableModel().getName());if(d
|
|
197
|
+
checkForConflictingParamWithProcedureModels$$module$build$src$core$variables=function(a,b,c){a=a.toLowerCase();b=b.toLowerCase();c=c.getProcedureMap().getProcedures();for(const e of c){var d=e.getParameters().filter(isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model).map(f=>f.getVariableModel().getName());if(!d)continue;c=d.some(f=>f.toLowerCase()===a);d=d.some(f=>f.toLowerCase()===b);if(c&&d)return e.getName()}return null};
|
|
189
198
|
checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables=function(a,b,c){a=a.toLowerCase();b=b.toLowerCase();c=c.getAllBlocks(!1);for(const e of c){if(!isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(e))continue;c=e.getProcedureDef();var d=c[1];const f=d.some(g=>g.toLowerCase()===a);d=d.some(g=>g.toLowerCase()===b);if(f&&d)return c[0]}return null};
|
|
190
199
|
generateVariableFieldDom$$module$build$src$core$variables=function(a){const b=$.createElement$$module$build$src$core$utils$xml("field");b.setAttribute("name","VAR");b.setAttribute("id",a.getId());b.setAttribute("variabletype",a.getType());a=$.createTextNode$$module$build$src$core$utils$xml(a.getName());b.appendChild(a);return b};
|
|
191
200
|
$.getOrCreateVariablePackage$$module$build$src$core$variables=function(a,b,c,d){let e=$.getVariable$$module$build$src$core$variables(a,b,c,d);e||(e=createVariable$$module$build$src$core$variables(a,b,c,d));return e};
|
|
@@ -227,9 +236,9 @@ setColour$$module$build$src$core$dropdowndiv=function(a,b){div$$module$build$src
|
|
|
227
236
|
showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c,d=!0){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,d,b,c)};
|
|
228
237
|
getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot();const c=a.workspace.scale,d=a.height*c;a=a.width*c;b=getPageOffset$$module$build$src$core$utils$style(b);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)};getScaledBboxOfField$$module$build$src$core$dropdowndiv=function(a){a=a.getScaledBBox();return new Rect$$module$build$src$core$utils$rect(a.top,a.bottom,a.left,a.right)};
|
|
229
238
|
showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;e&&(a+=e);e=b.getSourceBlock();let h=e.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,e.RTL,f,g,f,a,c,d)};
|
|
230
|
-
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=
|
|
231
|
-
renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);c=positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));
|
|
232
|
-
getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
239
|
+
show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){let k;(k=getParentContainer$$module$build$src$core$common())==null||k.appendChild(div$$module$build$src$core$dropdowndiv);owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=
|
|
240
|
+
a.getTheme().getClassName();addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);c=positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));
|
|
241
|
+
return c};getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
|
|
233
242
|
getPositionAboveMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:d.height-BORDER_SIZE$$module$build$src$core$dropdowndiv*2-ARROW_SIZE$$module$build$src$core$dropdowndiv/2,arrowAtTop:!1,arrowVisible:!0}};
|
|
234
243
|
getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv=function(a,b,c){a=getPositionX$$module$build$src$core$dropdowndiv(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
|
|
235
244
|
getPositionX$$module$build$src$core$dropdowndiv=function(a,b,c,d){b=clamp$$module$build$src$core$utils$math(b,a-d/2,c-d);a=a-ARROW_SIZE$$module$build$src$core$dropdowndiv/2-b;c=ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv;a=clamp$$module$build$src$core$utils$math(c,a,d-c-ARROW_SIZE$$module$build$src$core$dropdowndiv);return{arrowX:a,divX:b}};isVisible$$module$build$src$core$dropdowndiv=function(){return!!owner$$module$build$src$core$dropdowndiv};
|
|
@@ -238,7 +247,8 @@ hide$$module$build$src$core$dropdowndiv=function(){div$$module$build$src$core$dr
|
|
|
238
247
|
hideWithoutAnimation$$module$build$src$core$dropdowndiv=function(){isVisible$$module$build$src$core$dropdowndiv()&&(animateOutTimer$$module$build$src$core$dropdowndiv&&clearTimeout(animateOutTimer$$module$build$src$core$dropdowndiv),onHide$$module$build$src$core$dropdowndiv&&(onHide$$module$build$src$core$dropdowndiv(),onHide$$module$build$src$core$dropdowndiv=null),clearContent$$module$build$src$core$dropdowndiv(),owner$$module$build$src$core$dropdowndiv=null,getMainWorkspace$$module$build$src$core$common().markFocused(),
|
|
239
248
|
returnEphemeralFocus$$module$build$src$core$dropdowndiv&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv(),returnEphemeralFocus$$module$build$src$core$dropdowndiv=null))};
|
|
240
249
|
positionInternal$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=internal$$module$build$src$core$dropdowndiv.getPositionMetrics(a,b,c,d);a.arrowVisible?(b=a.arrowX,c=a.arrowY,d=a.arrowAtTop?45:225,arrow$$module$build$src$core$dropdowndiv.style.display="",arrow$$module$build$src$core$dropdowndiv.style.transform=`translate(${b}px, ${c}px) rotate(${d}deg)`,arrow$$module$build$src$core$dropdowndiv.setAttribute("class","blocklyDropDownArrow")):arrow$$module$build$src$core$dropdowndiv.style.display=
|
|
241
|
-
"none";b=Math.floor(a.initialX);c=Math.floor(a.initialY);d=Math.floor(a.finalX);
|
|
250
|
+
"none";b=Math.floor(a.initialX);c=Math.floor(a.initialY);d=Math.floor(a.finalX);let e=Math.floor(a.finalY);var f=div$$module$build$src$core$dropdowndiv.parentElement;f&&(f=f.getBoundingClientRect(),b-=f.left+window.scrollX,d-=f.left+window.scrollX,c-=f.top+window.scrollY,e-=f.top+window.scrollY);div$$module$build$src$core$dropdowndiv.style.left=b+"px";div$$module$build$src$core$dropdowndiv.style.top=c+"px";div$$module$build$src$core$dropdowndiv.style.display="block";div$$module$build$src$core$dropdowndiv.style.opacity=
|
|
251
|
+
"1";div$$module$build$src$core$dropdowndiv.style.transform="translate("+(d-b)+"px,"+(e-c)+"px)";return!!a.arrowAtTop};
|
|
242
252
|
repositionForWindowResize$$module$build$src$core$dropdowndiv=function(){if(owner$$module$build$src$core$dropdowndiv){var a=owner$$module$build$src$core$dropdowndiv.getSourceBlock();a=positionToField$$module$build$src$core$dropdowndiv?getScaledBboxOfField$$module$build$src$core$dropdowndiv(owner$$module$build$src$core$dropdowndiv):getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(a);const b=a.left+(a.right-a.left)/2;positionInternal$$module$build$src$core$dropdowndiv(b,a.bottom,b,a.top)}else hide$$module$build$src$core$dropdowndiv()};
|
|
243
253
|
shortestStringLength$$module$build$src$core$utils$string=function(a){return a.length?a.reduce(function(b,c){return b.length<c.length?b:c}).length:0};
|
|
244
254
|
commonWordPrefix$$module$build$src$core$utils$string=function(a,b){if(!a.length)return 0;if(a.length===1)return a[0].length;let c=0;b=b||shortestStringLength$$module$build$src$core$utils$string(a);let d;for(d=0;d<b;d++){var e=a[0][d];for(var f=1;f<a.length;f++)if(e!==a[f][d])return c;e===" "&&(c=d+1)}for(e=1;e<a.length;e++)if((f=a[e][d])&&f!==" ")return c;return b};
|
|
@@ -255,16 +265,18 @@ unbindMouseEvents$$module$build$src$core$tooltip=function(a){a&&(unbind$$module$
|
|
|
255
265
|
onMouseOver$$module$build$src$core$tooltip=function(a){blocked$$module$build$src$core$tooltip||(a=getTargetObject$$module$build$src$core$tooltip(a.currentTarget),element$$module$build$src$core$tooltip!==a&&(hide$$module$build$src$core$tooltip(),poisonedElement$$module$build$src$core$tooltip=null,element$$module$build$src$core$tooltip=a),clearTimeout(mouseOutPid$$module$build$src$core$tooltip))};
|
|
256
266
|
onMouseOut$$module$build$src$core$tooltip=function(a){blocked$$module$build$src$core$tooltip||(mouseOutPid$$module$build$src$core$tooltip=setTimeout(function(){poisonedElement$$module$build$src$core$tooltip=element$$module$build$src$core$tooltip=null;hide$$module$build$src$core$tooltip()},1),clearTimeout(showPid$$module$build$src$core$tooltip),showPid$$module$build$src$core$tooltip=0)};
|
|
257
267
|
onMouseMove$$module$build$src$core$tooltip=function(a){if(element$$module$build$src$core$tooltip&&element$$module$build$src$core$tooltip.tooltip&&!blocked$$module$build$src$core$tooltip)if(visible$$module$build$src$core$tooltip){const b=lastX$$module$build$src$core$tooltip-a.pageX;a=lastY$$module$build$src$core$tooltip-a.pageY;Math.sqrt(b*b+a*a)>RADIUS_OK$$module$build$src$core$tooltip&&hide$$module$build$src$core$tooltip()}else poisonedElement$$module$build$src$core$tooltip!==element$$module$build$src$core$tooltip&&
|
|
258
|
-
(clearTimeout(showPid$$module$build$src$core$tooltip),lastX$$module$build$src$core$tooltip=a.pageX,lastY$$module$build$src$core$tooltip=a.pageY,showPid$$module$build$src$core$tooltip=setTimeout(
|
|
268
|
+
(clearTimeout(showPid$$module$build$src$core$tooltip),lastX$$module$build$src$core$tooltip=a.pageX,lastY$$module$build$src$core$tooltip=a.pageY,showPid$$module$build$src$core$tooltip=setTimeout(()=>{let b;if(this instanceof Element)for(const c of getAllWorkspaces$$module$build$src$core$common()){if(!c.rendered)continue;let d;if((d=c.getInjectionDiv())==null?0:d.contains(this)){b=c;break}}show$$module$build$src$core$tooltip(b)},HOVER_MS$$module$build$src$core$tooltip))};
|
|
269
|
+
dispose$$module$build$src$core$tooltip=function(){poisonedElement$$module$build$src$core$tooltip=element$$module$build$src$core$tooltip=null;hide$$module$build$src$core$tooltip()};
|
|
259
270
|
hide$$module$build$src$core$tooltip=function(){visible$$module$build$src$core$tooltip&&(visible$$module$build$src$core$tooltip=!1,containerDiv$$module$build$src$core$tooltip&&(containerDiv$$module$build$src$core$tooltip.style.display="none"));showPid$$module$build$src$core$tooltip&&(clearTimeout(showPid$$module$build$src$core$tooltip),showPid$$module$build$src$core$tooltip=0)};
|
|
260
271
|
block$$module$build$src$core$tooltip=function(){hide$$module$build$src$core$tooltip();blocked$$module$build$src$core$tooltip=!0};unblock$$module$build$src$core$tooltip=function(){blocked$$module$build$src$core$tooltip=!1};
|
|
261
272
|
renderContent$$module$build$src$core$tooltip=function(){containerDiv$$module$build$src$core$tooltip&&element$$module$build$src$core$tooltip&&(typeof customTooltip$$module$build$src$core$tooltip==="function"?customTooltip$$module$build$src$core$tooltip(containerDiv$$module$build$src$core$tooltip,element$$module$build$src$core$tooltip):renderDefaultContent$$module$build$src$core$tooltip())};
|
|
262
273
|
renderDefaultContent$$module$build$src$core$tooltip=function(){var a=getTooltipOfObject$$module$build$src$core$tooltip(element$$module$build$src$core$tooltip);a=$.wrap$$module$build$src$core$utils$string(a,LIMIT$$module$build$src$core$tooltip);a=a.split("\n");for(let b=0;b<a.length;b++){const c=document.createElement("div");c.appendChild(document.createTextNode(a[b]));containerDiv$$module$build$src$core$tooltip.appendChild(c)}};
|
|
263
|
-
getPosition$$module$build$src$core$tooltip=function(a){const b=document.documentElement.clientWidth,c=document.documentElement.clientHeight;let d=lastX$$module$build$src$core$tooltip;d=a?d-(OFFSET_X$$module$build$src$core$tooltip+containerDiv$$module$build$src$core$tooltip.offsetWidth):d+OFFSET_X$$module$build$src$core$tooltip;let e=lastY$$module$build$src$core$tooltip+OFFSET_Y$$module$build$src$core$tooltip;
|
|
264
|
-
2*OFFSET_Y$$module$build$src$core$tooltip);a?d=Math.max(MARGINS$$module$build$src$core$tooltip-window.scrollX,d):d+containerDiv$$module$build$src$core$tooltip.offsetWidth>b+window.scrollX-2*MARGINS$$module$build$src$core$tooltip&&(d=b-containerDiv$$module$build$src$core$tooltip.offsetWidth-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
274
|
+
getPosition$$module$build$src$core$tooltip=function(a){const b=document.documentElement.clientWidth,c=document.documentElement.clientHeight;let d=lastX$$module$build$src$core$tooltip;d=a?d-(OFFSET_X$$module$build$src$core$tooltip+containerDiv$$module$build$src$core$tooltip.offsetWidth):d+OFFSET_X$$module$build$src$core$tooltip;let e=lastY$$module$build$src$core$tooltip+OFFSET_Y$$module$build$src$core$tooltip;var f;const g=(f=containerDiv$$module$build$src$core$tooltip)==null?void 0:f.parentElement;
|
|
275
|
+
g&&(f=g.getBoundingClientRect(),d-=f.left+window.scrollX,e-=f.top+window.scrollY);e+containerDiv$$module$build$src$core$tooltip.offsetHeight>c+window.scrollY&&(e-=containerDiv$$module$build$src$core$tooltip.offsetHeight+2*OFFSET_Y$$module$build$src$core$tooltip);a?d=Math.max(MARGINS$$module$build$src$core$tooltip-window.scrollX,d):d+containerDiv$$module$build$src$core$tooltip.offsetWidth>b+window.scrollX-2*MARGINS$$module$build$src$core$tooltip&&(d=b-containerDiv$$module$build$src$core$tooltip.offsetWidth-
|
|
276
|
+
2*MARGINS$$module$build$src$core$tooltip);return{x:d,y:e}};
|
|
277
|
+
show$$module$build$src$core$tooltip=function(a){if(!blocked$$module$build$src$core$tooltip&&(poisonedElement$$module$build$src$core$tooltip=element$$module$build$src$core$tooltip,containerDiv$$module$build$src$core$tooltip)){var b;(b=getParentContainer$$module$build$src$core$common(a))==null||b.appendChild(containerDiv$$module$build$src$core$tooltip);containerDiv$$module$build$src$core$tooltip.textContent="";renderContent$$module$build$src$core$tooltip();a=element$$module$build$src$core$tooltip.RTL;
|
|
278
|
+
containerDiv$$module$build$src$core$tooltip.style.direction=a?"rtl":"ltr";containerDiv$$module$build$src$core$tooltip.style.display="block";visible$$module$build$src$core$tooltip=!0;var {x:c,y:d}=getPosition$$module$build$src$core$tooltip(a);containerDiv$$module$build$src$core$tooltip.style.left=c+"px";containerDiv$$module$build$src$core$tooltip.style.top=d+"px"}};getHsvSaturation$$module$build$src$core$utils$colour=function(){return hsvSaturation$$module$build$src$core$utils$colour};
|
|
279
|
+
setHsvSaturation$$module$build$src$core$utils$colour=function(a){hsvSaturation$$module$build$src$core$utils$colour=a};getHsvValue$$module$build$src$core$utils$colour=function(){return hsvValue$$module$build$src$core$utils$colour};setHsvValue$$module$build$src$core$utils$colour=function(a){hsvValue$$module$build$src$core$utils$colour=a};
|
|
268
280
|
parse$$module$build$src$core$utils$colour=function(a){a=`${a}`.toLowerCase().trim();var b=names$$module$build$src$core$utils$colour[a];if(b)return b;b=a.substring(0,2)==="0x"?"#"+a.substring(2):a;b=b[0]==="#"?b:"#"+b;if(/^#[0-9a-f]{6}$/.test(b))return b;if(/^#[0-9a-f]{3}$/.test(b))return["#",b[1],b[1],b[2],b[2],b[3],b[3]].join("");var c=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return c&&(a=Number(c[1]),b=Number(c[2]),c=Number(c[3]),a>=0&&a<256&&b>=0&&b<256&&c>=0&&c<256)?rgbToHex$$module$build$src$core$utils$colour(a,
|
|
269
281
|
b,c):null};rgbToHex$$module$build$src$core$utils$colour=function(a,b,c){b=a<<16|b<<8|c;return a<16?"#"+(16777216|b).toString(16).substr(1):"#"+b.toString(16)};hexToRgb$$module$build$src$core$utils$colour=function(a){a=parse$$module$build$src$core$utils$colour(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]};
|
|
270
282
|
hsvToHex$$module$build$src$core$utils$colour=function(a,b,c){let d=0,e=0,f=0;if(b===0)f=e=d=c;else{const g=Math.floor(a/60),h=a/60-g;a=c*(1-b);const k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return rgbToHex$$module$build$src$core$utils$colour(Math.floor(d),Math.floor(e),Math.floor(f))};
|
|
@@ -279,13 +291,13 @@ parseBlockColour$$module$build$src$core$utils$parsing=function(a){const b=typeof
|
|
|
279
291
|
a+'")');throw Error(c);};getDiv$$module$build$src$core$widgetdiv=function(){return containerDiv$$module$build$src$core$widgetdiv};testOnly_setDiv$$module$build$src$core$widgetdiv=function(a){containerDiv$$module$build$src$core$widgetdiv=a;if(a===null){let b;(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))==null||b.remove()}};
|
|
280
292
|
createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body,b=document.querySelector("div."+containerClassName$$module$build$src$core$widgetdiv);b?containerDiv$$module$build$src$core$widgetdiv=b:(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv,containerDiv$$module$build$src$core$widgetdiv.tabIndex=
|
|
281
293
|
-1);conditionalBind$$module$build$src$core$browser_events(containerDiv$$module$build$src$core$widgetdiv,"keydown",null,globalShortcutHandler$$module$build$src$core$common);a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
|
|
282
|
-
show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let
|
|
283
|
-
rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);
|
|
284
|
-
|
|
294
|
+
show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){var f;(f=getParentContainer$$module$build$src$core$common())==null||f.appendChild(c);c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let k;d=(k=a.getSourceBlock())==null?void 0:k.workspace}var g;ownerWorkspace$$module$build$src$core$widgetdiv=
|
|
295
|
+
(g=d)!=null?g:null;var h;a=(h=d)!=null?h:getMainWorkspace$$module$build$src$core$common();rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);
|
|
296
|
+
e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c))}};
|
|
285
297
|
hide$$module$build$src$core$widgetdiv=function(){if(isVisible$$module$build$src$core$widgetdiv()){owner$$module$build$src$core$widgetdiv=null;var a=containerDiv$$module$build$src$core$widgetdiv;a&&(a.style.display="none",a.style.left="",a.style.top="",dispose$$module$build$src$core$widgetdiv&&(dispose$$module$build$src$core$widgetdiv(),dispose$$module$build$src$core$widgetdiv=null),a.textContent="",rendererClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,
|
|
286
298
|
rendererClassName$$module$build$src$core$widgetdiv),rendererClassName$$module$build$src$core$widgetdiv=""),themeClassName$$module$build$src$core$widgetdiv&&(removeClass$$module$build$src$core$utils$dom(a,themeClassName$$module$build$src$core$widgetdiv),themeClassName$$module$build$src$core$widgetdiv=""),getMainWorkspace$$module$build$src$core$common().markFocused(),returnEphemeralFocus$$module$build$src$core$widgetdiv&&(returnEphemeralFocus$$module$build$src$core$widgetdiv(),returnEphemeralFocus$$module$build$src$core$widgetdiv=
|
|
287
299
|
null))}};isVisible$$module$build$src$core$widgetdiv=function(){return!!owner$$module$build$src$core$widgetdiv};hideIfOwner$$module$build$src$core$widgetdiv=function(a){owner$$module$build$src$core$widgetdiv===a&&hide$$module$build$src$core$widgetdiv()};hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv=function(a){let b=ownerWorkspace$$module$build$src$core$widgetdiv===null,c=a;for(;!b&&c;){if(c===a){b=!0;break}c=a.options.parentWorkspace}b&&hide$$module$build$src$core$widgetdiv()};
|
|
288
|
-
positionInternal$$module$build$src$core$widgetdiv=function(a,b,c){containerDiv$$module$build$src$core$widgetdiv.style.left=a+"px";containerDiv$$module$build$src$core$widgetdiv.style.top=b+"px";containerDiv$$module$build$src$core$widgetdiv.style.height=c+"px"};
|
|
300
|
+
positionInternal$$module$build$src$core$widgetdiv=function(a,b,c){if(containerDiv$$module$build$src$core$widgetdiv){var d=containerDiv$$module$build$src$core$widgetdiv.parentElement;d&&(d=d.getBoundingClientRect(),a-=d.left+window.scrollX,b-=d.top+window.scrollY);containerDiv$$module$build$src$core$widgetdiv.style.left=a+"px";containerDiv$$module$build$src$core$widgetdiv.style.top=b+"px";containerDiv$$module$build$src$core$widgetdiv.style.height=c+"px"}};
|
|
289
301
|
positionWithAnchor$$module$build$src$core$widgetdiv=function(a,b,c,d){const e=calculateY$$module$build$src$core$widgetdiv(a,b,c);a=calculateX$$module$build$src$core$widgetdiv(a,b,c,d);e<0?positionInternal$$module$build$src$core$widgetdiv(a,0,c.height+e):positionInternal$$module$build$src$core$widgetdiv(a,e,c.height)};calculateX$$module$build$src$core$widgetdiv=function(a,b,c,d){return d?Math.min(Math.max(b.right-c.width,a.left),a.right-c.width):Math.max(Math.min(b.left,a.right-c.width),a.left)};
|
|
290
302
|
calculateY$$module$build$src$core$widgetdiv=function(a,b,c){return b.bottom+c.height>=a.bottom?b.top-c.height:b.bottom};isRepositionable$$module$build$src$core$widgetdiv=function(a){return!(a==null||!a.repositionForWindowResize)};repositionForWindowResize$$module$build$src$core$widgetdiv=function(){isRepositionable$$module$build$src$core$widgetdiv(owner$$module$build$src$core$widgetdiv)&&owner$$module$build$src$core$widgetdiv.repositionForWindowResize()||hide$$module$build$src$core$widgetdiv()};
|
|
291
303
|
getCurrentBlock$$module$build$src$core$contextmenu=function(){return currentBlock$$module$build$src$core$contextmenu};setCurrentBlock$$module$build$src$core$contextmenu=function(a){currentBlock$$module$build$src$core$contextmenu=a};
|
|
@@ -356,7 +368,7 @@ getMutatorProperties$$module$build$src$core$extensions=function(a){const b=[];a.
|
|
|
356
368
|
mutatorPropertiesMatch$$module$build$src$core$extensions=function(a,b){b=getMutatorProperties$$module$build$src$core$extensions(b);if(b.length!==a.length)return!1;for(let c=0;c<b.length;c++)if(a[c]!==b[c])return!1;return!0};
|
|
357
369
|
runAfterPageLoad$$module$build$src$core$extensions=function(a){if(typeof document!=="object")throw Error("runAfterPageLoad() requires browser document.");if(document.readyState==="complete")a();else{const b=setInterval(function(){document.readyState==="complete"&&(clearInterval(b),a())},10)}};
|
|
358
370
|
$.buildTooltipForDropdown$$module$build$src$core$extensions=function(a,b){const c=[];return function(){c.includes(this.type)||(checkDropdownOptionsInTable$$module$build$src$core$extensions(this,a,b),c.push(this.type));this.setTooltip(function(){const d=String(this.getFieldValue(a));return replaceMessageReferences$$module$build$src$core$utils$parsing(b[d])}.bind(this))}};
|
|
359
|
-
checkDropdownOptionsInTable$$module$build$src$core$extensions=function(a,b,c){var d=a.getField(b);if(d instanceof FieldDropdown$$module$build$src$core$field_dropdown&&!d.isOptionListDynamic()){d=d.getOptions();for(const e of d)e
|
|
371
|
+
checkDropdownOptionsInTable$$module$build$src$core$extensions=function(a,b,c){var d=a.getField(b);if(d instanceof FieldDropdown$$module$build$src$core$field_dropdown&&!d.isOptionListDynamic()){d=d.getOptions();for(const e of d){if(e===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)continue;[,d]=e;c[d]===void 0&&console.warn(`No tooltip mapping for value ${d} of field ${b} of block type ${a.type}.`)}}};
|
|
360
372
|
$.buildTooltipWithFieldText$$module$build$src$core$extensions=function(a,b){return function(){this.setTooltip(function(){const c=this.getField(b);return replaceMessageReferences$$module$build$src$core$utils$parsing(a).replace("%1",c?c.getText():"")}.bind(this))}};extensionParentTooltip$$module$build$src$core$extensions=function(){const a=this.tooltip;this.setTooltip(function(){const b=this.getParent();return b&&b.getInputsInline()&&b.tooltip||a}.bind(this))};
|
|
361
373
|
point$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+","+b+" "};curve$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+b.join("")};moveTo$$module$build$src$core$utils$svg_paths=function(a,b){return" M "+a+","+b+" "};moveBy$$module$build$src$core$utils$svg_paths=function(a,b){return" m "+a+","+b+" "};lineTo$$module$build$src$core$utils$svg_paths=function(a,b){return" l "+a+","+b+" "};line$$module$build$src$core$utils$svg_paths=function(a){return" l"+a.join("")};
|
|
362
374
|
lineOnAxis$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+" "+b+" "};arc$$module$build$src$core$utils$svg_paths=function(a,b,c,d){return a+" "+c+" "+c+" "+b+d};connectReciprocally$$module$build$src$core$connection=function(a,b){if(!a||!b)throw Error("Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a};
|
|
@@ -379,15 +391,26 @@ bumpObjectIntoBounds$$module$build$src$core$bump_objects=function(a,b,c){const d
|
|
|
379
391
|
bumpIntoBoundsHandler$$module$build$src$core$bump_objects=function(a){return b=>{var c=a.getMetricsManager();if(c.hasFixedEdges()&&!a.isDragging()){var d;if(BUMP_EVENTS$$module$build$src$core$events$type.includes((d=b.type)!=null?d:"")){d=c.getScrollMetrics(!0);const e=extractObjectFromEvent$$module$build$src$core$bump_objects(a,b);e&&(c=$.getGroup$$module$build$src$core$events$utils()||!1,$.setGroup$$module$build$src$core$events$utils(b.group),bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,
|
|
380
392
|
d,e)&&!b.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),$.setGroup$$module$build$src$core$events$utils(c))}else isViewportChange$$module$build$src$core$events$predicates(b)&&b.scale&&b.oldScale&&b.scale>b.oldScale&&bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)}}};
|
|
381
393
|
extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){let c=null;switch(b.type){case EventType$$module$build$src$core$events$type.BLOCK_CREATE:case EventType$$module$build$src$core$events$type.BLOCK_MOVE:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case EventType$$module$build$src$core$events$type.COMMENT_CREATE:case EventType$$module$build$src$core$events$type.COMMENT_MOVE:case EventType$$module$build$src$core$events$type.COMMENT_RESIZE:c=a.getCommentById(b.commentId)}return c};
|
|
382
|
-
bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
394
|
+
bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};
|
|
395
|
+
getShortActionShortcut$$module$build$src$core$utils$shortcut_formatting=function(a){a=getActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting(a,shortModifierNames$$module$build$src$core$utils$shortcut_formatting);return a.length?a[0].join(APPLE$$module$build$src$core$utils$useragent?" ":" + "):""};getLongActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting=function(a){return getActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting(a,longModifierNames$$module$build$src$core$utils$shortcut_formatting)};
|
|
396
|
+
getActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting=function(a,b){a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.getKeyCodesByShortcutName(a);if(a.length===0)return[];a=a.map(d=>d.split("+"));a.forEach(d=>d.sort((e,f)=>{e=modifierOrder$$module$build$src$core$utils$shortcut_formatting(e);f=modifierOrder$$module$build$src$core$utils$shortcut_formatting(f);return e-f}));a.sort((d,e)=>{d=d.includes("Meta")?1:0;return(e.includes("Meta")?1:0)-d});let c=a.filter(d=>
|
|
397
|
+
d.includes("Meta")===APPLE$$module$build$src$core$utils$useragent);c=c.length===0?a:c;c.sort((d,e)=>d.length-e.length);return(c.some(d=>d.some(e=>"Meta"===e||"Alt"===e||"Control"===e))?[c[0]]:c).map(d=>d.map(e=>Number.isFinite(+e)?String.fromCharCode(+e):e).map(e=>{let f;return upperCaseFirst$$module$build$src$core$utils$shortcut_formatting((f=b[e])!=null?f:e)}))};upperCaseFirst$$module$build$src$core$utils$shortcut_formatting=function(a){return a.charAt(0).toUpperCase()+a.substring(1)};
|
|
398
|
+
modifierOrder$$module$build$src$core$utils$shortcut_formatting=function(a){a=modifierOrdering$$module$build$src$core$utils$shortcut_formatting.indexOf(a);return a===-1?Number.MAX_VALUE:a};
|
|
399
|
+
showUnconstrainedMoveHint$$module$build$src$core$hints=function(a,b=!1){const c=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT.replace("%1",MAC$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent?$.Msg$$module$build$src$core$msg.COMMAND_KEY:$.Msg$$module$build$src$core$msg.CONTROL_KEY).replace("%2",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:c,id:unconstrainedMoveHintId$$module$build$src$core$hints,
|
|
400
|
+
oncePerSession:!b})};showConstrainedMovementHint$$module$build$src$core$hints=function(a){const b=$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT.replace("%1",$.Msg$$module$build$src$core$msg.ENTER_KEY);Toast$$module$build$src$core$toast.show(a,{message:b,id:constrainedMoveHintId$$module$build$src$core$hints,oncePerSession:!0})};
|
|
401
|
+
clearMoveHints$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.hide(a,constrainedMoveHintId$$module$build$src$core$hints);Toast$$module$build$src$core$toast.hide(a,unconstrainedMoveHintId$$module$build$src$core$hints)};
|
|
402
|
+
showHelpHint$$module$build$src$core$hints=function(a){var b=getShortActionShortcut$$module$build$src$core$utils$shortcut_formatting("list_shortcuts");b&&(b=$.Msg$$module$build$src$core$msg.HELP_PROMPT.replace("%1",b),Toast$$module$build$src$core$toast.show(a,{message:b,id:helpHintId$$module$build$src$core$hints}))};
|
|
403
|
+
showBlockNavigationHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT,id:blockNavigationHintId$$module$build$src$core$hints})};showWorkspaceNavigationHint$$module$build$src$core$hints=function(a){Toast$$module$build$src$core$toast.show(a,{message:$.Msg$$module$build$src$core$msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT,id:workspaceNavigationHintId$$module$build$src$core$hints})};
|
|
404
|
+
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"};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&typeof a.isDeletable==="function"&&typeof a.dispose==="function"&&typeof a.setDeleteStyle==="function"};
|
|
405
|
+
getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a){if(a.isCollapsed())return[];const b=a.getIcons();for(const d of a.inputList){if(!d.isVisible())continue;b.push(...d.fieldRow);var c=d.connection;if(!c)continue;b.push(c);c=c.targetBlock();if(!c)continue;b.push(c);(c=c.lastConnectionInStack(!1))&&b.push(c)}a.nextConnection&&b.push(a.nextConnection);return b};
|
|
406
|
+
navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=function(a,b,c){a=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a);b=a.indexOf(b);if(b===-1)return null;c=b+c;return c>=0&&c<a.length?a[c]:null};register$$module$build$src$core$icons$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a.toString(),b)};
|
|
407
|
+
unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};
|
|
408
|
+
isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item=function(a){return a&&typeof a.init==="function"&&typeof a.getDiv==="function"&&typeof a.getId==="function"&&typeof a.getParent==="function"&&typeof a.getLevel==="function"&&typeof a.isSelectable==="function"&&typeof a.isCollapsible==="function"&&typeof a.dispose==="function"&&typeof a.getClickTarget==="function"&&typeof a.setVisible_==="function"&&typeof a.getParentToolbox==="function"};
|
|
409
|
+
isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item=function(a){return typeof a.getName==="function"&&typeof a.getContents==="function"&&typeof a.setSelected==="function"&&typeof a.onClick==="function"&&isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item(a)&&a.isSelectable()};
|
|
410
|
+
isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item=function(a){return typeof a.getChildToolboxItems==="function"&&typeof a.isExpanded==="function"&&typeof a.toggleExpanded==="function"&&isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)&&a.isCollapsible()};
|
|
411
|
+
getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator=function(a){const b=a.options.toolboxPosition;return a.options.RTL&&b!==Position$$module$build$src$core$utils$toolbox.TOP&&b!==Position$$module$build$src$core$utils$toolbox.BOTTOM?b===Position$$module$build$src$core$utils$toolbox.LEFT?Position$$module$build$src$core$utils$toolbox.RIGHT:Position$$module$build$src$core$utils$toolbox.LEFT:b};
|
|
412
|
+
hasContextMenu$$module$build$src$core$interfaces$i_contextmenu=function(a){return a&&typeof a.showContextMenu==="function"};isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return a&&typeof a.autoHide==="function"};isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return typeof a.getProcedureModel==="function"&&typeof a.doProcedureUpdate==="function"&&typeof a.isProcedureDef==="function"};
|
|
413
|
+
isObservable$$module$build$src$core$interfaces$i_observable=function(a){return a&&typeof a.startPublishing==="function"&&typeof a.stopPublishing==="function"};
|
|
391
414
|
allProcedures$$module$build$src$core$procedures=function(a){const b=a.getProcedureMap().getProcedures().filter(d=>!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!1]);a.getBlocksByType("procedures_defnoreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&b.push(d.getProcedureDef())});const c=a.getProcedureMap().getProcedures().filter(d=>
|
|
392
415
|
!!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!0]);a.getBlocksByType("procedures_defreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&c.push(d.getProcedureDef())});b.sort(procTupleComparator$$module$build$src$core$procedures);c.sort(procTupleComparator$$module$build$src$core$procedures);return[b,c]};
|
|
393
416
|
procTupleComparator$$module$build$src$core$procedures=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.findLegalName$$module$build$src$core$procedures=function(a,b){if(b.isInFlyout)return a;for(a=a||$.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!isLegalName$$module$build$src$core$procedures(a,b.workspace,b);){const c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2])+1):a+"2"}return a};
|
|
@@ -399,7 +422,7 @@ xmlFlyoutCategory$$module$build$src$core$procedures=function(a){function b(f,g){
|
|
|
399
422
|
const c=[];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&&
|
|
400
423
|
(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"),
|
|
401
424
|
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)};
|
|
402
|
-
flyoutCategory$$module$build$src$core$procedures=function(a,b=!0){function c(e,f){for(const [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);const d=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&
|
|
425
|
+
flyoutCategory$$module$build$src$core$procedures=function(a,b=!0){function c(e,f){for(const [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);const d=[];Blocks$$module$build$src$core$blocks.procedures_defnoreturn&&
|
|
403
426
|
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);
|
|
404
427
|
c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};
|
|
405
428
|
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");const d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","procedures_mutatorarg");const 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,
|
|
@@ -416,7 +439,7 @@ register$$module$build$src$core$renderers$common$block_rendering=function(a,b){r
|
|
|
416
439
|
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")};
|
|
417
440
|
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")};
|
|
418
441
|
internalFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){return flyoutCategory$$module$build$src$core$variables_dynamic(a,!1)};
|
|
419
|
-
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."),
|
|
442
|
+
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."),
|
|
420
443
|
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"},
|
|
421
444
|
{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")]};
|
|
422
445
|
xmlFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){let 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);
|
|
@@ -436,8 +459,8 @@ isCuttable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$
|
|
|
436
459
|
registerCopy$$module$build$src$core$shortcut_items=function(){const 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()&&
|
|
437
460
|
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;b=b.isFlyout?b.targetWorkspace:b;if(!b)return!1;c.workspace.isFlyout||b.hideChaff();b=isDraggable$$module$build$src$core$interfaces$i_draggable(c)&&c.workspace==b?c.getRelativeToSurfaceXY():void 0;return!!copy$$module$build$src$core$clipboard(c,b)},keyCodes:[a]})};
|
|
438
461
|
registerCut$$module$build$src$core$shortcut_items=function(){const 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()&&
|
|
439
|
-
isCuttable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){b=e.focusedNode;if(!b||!isCuttable$$module$build$src$core$shortcut_items(b)||!isCopyable$$module$build$src$core$interfaces$i_copyable(b))return!1;c=isDraggable$$module$build$src$core$interfaces$i_draggable(b)?b.getRelativeToSurfaceXY():void 0;c=copy$$module$build$src$core$clipboard(b,c);b instanceof BlockSvg$$module$build$src$core$block_svg?b.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&
|
|
440
|
-
return!!c},keyCodes:[a]})};
|
|
462
|
+
isCuttable$$module$build$src$core$shortcut_items(c)},callback(b,c,d,e){b=e.focusedNode;if(!b||!isCuttable$$module$build$src$core$shortcut_items(b)||!isCopyable$$module$build$src$core$interfaces$i_copyable(b))return!1;c=isDraggable$$module$build$src$core$interfaces$i_draggable(b)?b.getRelativeToSurfaceXY():void 0;c=copy$$module$build$src$core$clipboard(b,c);b instanceof BlockSvg$$module$build$src$core$block_svg?b.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&($.setGroup$$module$build$src$core$events$utils(!0),
|
|
463
|
+
b.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!!c},keyCodes:[a]})};
|
|
441
464
|
registerPaste$$module$build$src$core$shortcut_items=function(){const 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;
|
|
442
465
|
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){b=getLastCopiedData$$module$build$src$core$clipboard();if(!b)return!1;var d=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!d)return!1;d=d.isFlyout?d.targetWorkspace:d;if(!d||d.isReadOnly())return!1;if(c instanceof PointerEvent)return c=screenToWsCoordinates$$module$build$src$core$utils$svg_math(d,
|
|
443
466
|
new Coordinate$$module$build$src$core$utils$coordinate(c.clientX,c.clientY)),!!paste$$module$build$src$core$clipboard(b,d,c);c=getLastCopiedLocation$$module$build$src$core$clipboard();if(!c)return!!paste$$module$build$src$core$clipboard(b,d);const {left:e,top:f,width:g,height:h}=d.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(f,f+h,e,e+g)).contains(c.x,c.y))return!!paste$$module$build$src$core$clipboard(b,d);c=new Coordinate$$module$build$src$core$utils$coordinate(e+
|
|
@@ -446,18 +469,46 @@ registerUndo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRe
|
|
|
446
469
|
callback(b,c){b.hideChaff();b.undo(!1);c.preventDefault();return!0},keyCodes:[a]})};
|
|
447
470
|
registerRedo$$module$build$src$core$shortcut_items=function(){const 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]);
|
|
448
471
|
ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.REDO,preconditionFn(c){return!c.isDragging()&&!c.isReadOnly()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){c.hideChaff();c.undo(!0);d.preventDefault();return!0},keyCodes:[a,b]})};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
472
|
+
registerMovementShortcuts$$module$build$src$core$shortcut_items=function(){const a=d=>{const e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(isDraggable$$module$build$src$core$interfaces$i_draggable(e))return e;let f;return(f=d.getNavigator().getSourceBlockFromNode($.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()))!=null?f:void 0};var b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.M,
|
|
473
|
+
[KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]);const c={name:names$$module$build$src$core$shortcut_items.START_MOVE,preconditionFn:d=>{d=a(d);return!!d&&KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.canMove(d)},callback:(d,e)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);(d=a(d))&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(d);return!!d&&KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.startMove(d,
|
|
474
|
+
e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.M]};b=[c,Object.assign({},c,{name:names$$module$build$src$core$shortcut_items.START_MOVE_STACK,keyCodes:[b]}),{name:names$$module$build$src$core$shortcut_items.FINISH_MOVE,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.finishMove(e),keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.SPACE],
|
|
475
|
+
allowCollision:!0},{name:names$$module$build$src$core$shortcut_items.ABORT_MOVE,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.abortMove(e),keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ESC],allowCollision:!0},{name:names$$module$build$src$core$shortcut_items.MOVE_LEFT,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),
|
|
476
|
+
callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.LEFT,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.LEFT,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],allowCollision:!0},{name:names$$module$build$src$core$shortcut_items.MOVE_RIGHT,
|
|
477
|
+
preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.RIGHT,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.RIGHT,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],
|
|
478
|
+
allowCollision:!0},{name:names$$module$build$src$core$shortcut_items.MOVE_UP,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.UP,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.UP,
|
|
479
|
+
[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],allowCollision:!0},{name:names$$module$build$src$core$shortcut_items.MOVE_DOWN,preconditionFn:()=>KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving(),callback:(d,e)=>{e.preventDefault();return KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.move(Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN,e)},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DOWN,ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.DOWN,
|
|
480
|
+
[KeyCodes$$module$build$src$core$utils$keycodes.CTRL_CMD])],allowCollision:!0}];for(const d of b)ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(d)};
|
|
481
|
+
registerShowContextMenu$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.ENTER,[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.MENU,preconditionFn:b=>!b.isDragging(),callback:(b,c)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
482
|
+
b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(hasContextMenu$$module$build$src$core$interfaces$i_contextmenu(b)){b.showContextMenu(c);let d;(d=getMenu$$module$build$src$core$contextmenu())==null||d.highlightNext();return!0}return!1},keyCodes:[a]})};
|
|
483
|
+
registerArrowNavigation$$module$build$src$core$shortcut_items=function(){const a={right:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_RIGHT,preconditionFn:b=>!b.isDragging(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);let d,e;b=b.RTL?(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:d.getNavigator().getOutNode():(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==
|
|
484
|
+
null?void 0:e.getNavigator().getInNode();if(!b)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.RIGHT],allowCollision:!0},left:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_LEFT,preconditionFn:b=>!b.isDragging(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);let d,e;b=b.RTL?(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==
|
|
485
|
+
null?void 0:d.getNavigator().getInNode():(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:e.getNavigator().getOutNode();if(!b)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.LEFT],allowCollision:!0},down:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_DOWN,preconditionFn:b=>!b.isDragging(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
486
|
+
let d;b=(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:d.getNavigator().getNextNode();if(!b)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DOWN],allowCollision:!0},up:{name:names$$module$build$src$core$shortcut_items.NAVIGATE_UP,preconditionFn:b=>!b.isDragging(),callback:(b,c)=>{c.preventDefault();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
487
|
+
let d;b=(d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:d.getNavigator().getPreviousNode();if(!b)return!1;$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.UP],allowCollision:!0}};for(const b of Object.values(a))ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(b)};
|
|
488
|
+
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]})};
|
|
489
|
+
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=>{const 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);
|
|
490
|
+
$.getFocusManager$$module$build$src$core$focus_manager().focusTree(a.getWorkspace())}return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.T]})};
|
|
491
|
+
registerWorkspaceOverview$$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:(a,b)=>b.focusedNode===a,callback:a=>{var b=resolveWorkspace$$module$build$src$core$shortcut_items(a);a=b.getTopBlocks().length;b=b.getTopComments().length;let c;c=a===0?"WORKSPACE_CONTENTS_BLOCKS_ZERO":a===1?"WORKSPACE_CONTENTS_BLOCKS_ONE":"WORKSPACE_CONTENTS_BLOCKS_MANY";
|
|
492
|
+
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",String(a)).replace("%2",d);announceDynamicAriaState$$module$build$src$core$utils$aria(a);return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.I]})};
|
|
493
|
+
registerDisconnectBlock$$module$build$src$core$shortcut_items=function(){const 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);
|
|
494
|
+
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]})};
|
|
495
|
+
registerStackNavigation$$module$build$src$core$shortcut_items=function(){const a=(c,d=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())=>{const 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),callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
496
|
+
const 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]};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.NEXT_STACK,preconditionFn:c=>!c.isDragging()&&!!a(c),callback:c=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);
|
|
497
|
+
const 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]});ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register(b)};
|
|
498
|
+
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(),callback:(a,b)=>{keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!0);if((a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())&&"performAction"in a){b.preventDefault();let c;(c=a.performAction)==
|
|
499
|
+
null||c.call(a);return!0}return!1},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.SPACE],allowCollision:!0})};
|
|
500
|
+
registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()};
|
|
501
|
+
registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items=function(){registerShowContextMenu$$module$build$src$core$shortcut_items();registerMovementShortcuts$$module$build$src$core$shortcut_items();registerFocusWorkspace$$module$build$src$core$shortcut_items();registerFocusToolbox$$module$build$src$core$shortcut_items();registerArrowNavigation$$module$build$src$core$shortcut_items();registerDisconnectBlock$$module$build$src$core$shortcut_items();registerStackNavigation$$module$build$src$core$shortcut_items();
|
|
502
|
+
registerPerformAction$$module$build$src$core$shortcut_items()};registerScreenReaderShortcuts$$module$build$src$core$shortcut_items=function(){registerWorkspaceOverview$$module$build$src$core$shortcut_items()};saveProcedure$$module$build$src$core$serialization$procedures=function(a){const b=a.saveState();if(!a.getParameters().length)return b;b.parameters=a.getParameters().map(c=>c.saveState());return b};
|
|
503
|
+
loadProcedure$$module$build$src$core$serialization$procedures=function(a,b,c,d){a=a.loadState(c,d);if(!c.parameters)return a;for(const [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a};save$$module$build$src$core$serialization$workspaces=function(a){const b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(const d in c){let e;const f=(e=c[d])==null?void 0:e.save(a);f&&(b[d]=f)}return b};
|
|
454
504
|
load$$module$build$src$core$serialization$workspaces=function(a,b,{recordUndo:c=!1}={}){var d=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);if(d){d=Object.entries(d).sort((f,g)=>g[1].priority-f[1].priority);var e=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(c);(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);startTextWidthCache$$module$build$src$core$utils$dom();
|
|
455
505
|
b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(const [,f]of d.reverse()){let g;(g=f)==null||g.clear(b)}for(const [f,g]of d.reverse())if(a[f]){let h;(h=g)==null||h.load(a[f],b)}b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!0);stopTextWidthCache$$module$build$src$core$utils$dom();fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.FINISHED_LOADING))(b));
|
|
456
506
|
$.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}};
|
|
457
507
|
inject$$module$build$src$core$inject=function(a,b){let c=null;c=typeof a==="string"?document.getElementById(a)||document.querySelector(a):a;var d;if(!document.contains(c)&&document!==((d=c)==null?void 0:d.ownerDocument))throw Error("Error: container is not in current document");a=new Options$$module$build$src$core$options(b||{});d=document.createElement("div");addClass$$module$build$src$core$utils$dom(d,"injectionDiv");(b==null?0:b.rtl)&&addClass$$module$build$src$core$utils$dom(d,"blocklyRTL");c.appendChild(d);
|
|
458
|
-
b=createDom$$module$build$src$core$inject(d,a);const e=createMainWorkspace$$module$build$src$core$inject(d,b,a);init$$module$build$src$core$inject(e);setMainWorkspace$$module$build$src$core$common(e);svgResize$$module$build$src$core$common(e);d.addEventListener("focusin",function(){setMainWorkspace$$module$build$src$core$common(e)});conditionalBind$$module$build$src$core$browser_events(d,"keydown",null,globalShortcutHandler$$module$build$src$core$common);
|
|
459
|
-
|
|
460
|
-
|
|
508
|
+
b=createDom$$module$build$src$core$inject(d,a);const e=createMainWorkspace$$module$build$src$core$inject(d,b,a);init$$module$build$src$core$inject(e);setMainWorkspace$$module$build$src$core$common(e);svgResize$$module$build$src$core$common(e);d.addEventListener("focusin",function(){setMainWorkspace$$module$build$src$core$common(e)});conditionalBind$$module$build$src$core$browser_events(d,"keydown",null,globalShortcutHandler$$module$build$src$core$common);initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria(d);
|
|
509
|
+
return e};
|
|
510
|
+
createDom$$module$build$src$core$inject=function(a,b){a.setAttribute("dir","LTR");inject$$module$build$src$core$css(a,b.hasCss,b.pathToMedia);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{xmlns:SVG_NS$$module$build$src$core$utils$dom,"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1","class":"blocklySvg"},a),d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS,{},
|
|
511
|
+
c),e=String(Math.random()).substring(2);b.gridPattern=Grid$$module$build$src$core$grid.createDom(e,b.gridOptions,d,a);return c};
|
|
461
512
|
createMainWorkspace$$module$build$src$core$inject=function(a,b,c){c.parentWorkspace=null;c=new WorkspaceSvg$$module$build$src$core$workspace_svg(c);const d=c.options;c.scale=d.zoomOptions.startScale;b.appendChild(c.createDom("blocklyMainBackground",a));var e=c.getRenderer().getClassName();e&&addClass$$module$build$src$core$utils$dom(a,e);(e=c.getTheme().getClassName())&&addClass$$module$build$src$core$utils$dom(a,e);!d.hasCategories&&d.languageTree&&(a=c.addFlyout(Svg$$module$build$src$core$utils$svg.SVG),
|
|
462
513
|
insertAfter$$module$build$src$core$utils$dom(a,b));d.hasTrashcan&&c.addTrashcan();d.zoomOptions&&d.zoomOptions.controls&&c.addZoomControls();c.getThemeManager().subscribe(b,"workspaceBackgroundColour","background-color");c.translate(0,0);c.addChangeListener(bumpIntoBoundsHandler$$module$build$src$core$bump_objects(c));svgResize$$module$build$src$core$common(c);createDom$$module$build$src$core$widgetdiv();createDom$$module$build$src$core$dropdowndiv();createDom$$module$build$src$core$tooltip();return c};
|
|
463
514
|
init$$module$build$src$core$inject=function(a){const b=a.options;var c=a.getParentSvg();conditionalBind$$module$build$src$core$browser_events(c.parentNode,"contextmenu",null,function(d){isTargetInput$$module$build$src$core$browser_events(d)||d.preventDefault()});c=conditionalBind$$module$build$src$core$browser_events(window,"resize",null,function(){hide$$module$build$src$core$tooltip();a.hideComponents(!0);repositionForWindowResize$$module$build$src$core$dropdowndiv();repositionForWindowResize$$module$build$src$core$widgetdiv();
|
|
@@ -500,7 +551,7 @@ registerCommentCreate$$module$build$src$core$contextmenu_items=function(){Contex
|
|
|
500
551
|
new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y))),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b),$.setGroup$$module$build$src$core$events$utils(!1)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"commentCreate",weight:8})};
|
|
501
552
|
registerBlockOptions_$$module$build$src$core$contextmenu_items=function(){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()};
|
|
502
553
|
registerCommentOptions$$module$build$src$core$contextmenu_items=function(){registerCommentDuplicate$$module$build$src$core$contextmenu_items();registerCommentDelete$$module$build$src$core$contextmenu_items();registerCommentCreate$$module$build$src$core$contextmenu_items()};registerDefaultOptions$$module$build$src$core$contextmenu_items=function(){registerWorkspaceOptions_$$module$build$src$core$contextmenu_items();registerBlockOptions_$$module$build$src$core$contextmenu_items()};
|
|
503
|
-
|
|
554
|
+
isBoundedElement$$module$build$src$core$interfaces$i_bounded_element=function(a){return typeof a.getBoundingRectangle==="function"&&typeof a.moveBy==="function"};isPaster$$module$build$src$core$interfaces$i_paster=function(a){return a&&typeof a.paste==="function"};isRenderedElement$$module$build$src$core$interfaces$i_rendered_element=function(a){return a&&typeof a.getSvgRoot==="function"};hideChaff$$module$build$src$core$blockly=function(a){getMainWorkspace$$module$build$src$core$common().hideChaff(a)};
|
|
504
555
|
isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree=function(a){return a&&typeof a.getRootFocusableNode==="function"&&typeof a.getRestoredFocusableNode==="function"&&typeof a.getNestedTrees==="function"&&typeof a.lookUpFocusableNode==="function"&&typeof a.onTreeFocus==="function"&&typeof a.onTreeBlur==="function"};$jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_ES6=!1;$jscomp.ASSUME_ES2020=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;
|
|
505
556
|
$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.INSTRUMENT_ASYNC_CONTEXT=!0;$jscomp.objectCreate=$jscomp.ASSUME_ES5||typeof Object.create=="function"?Object.create:function(a){var b=function(){};b.prototype=a;return new b};$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
|
|
506
557
|
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.ASSUME_ES2020?globalThis:$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE=typeof Symbol==="function"&&typeof Symbol("x")==="symbol";$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
|
|
@@ -515,7 +566,7 @@ $jscomp.inherits=function(a,b){a.prototype=$jscomp.objectCreate(b.prototype);a.p
|
|
|
515
566
|
$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return $jscomp.arrayIterator(a);throw Error(String(a)+" is not an iterable or ArrayLike");};$jscomp.arrayFromIterator=function(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c};$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};
|
|
516
567
|
$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};
|
|
517
568
|
$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(a){this.yieldResult=a};
|
|
518
|
-
$jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.
|
|
569
|
+
$jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.getNextAddressJsc=function(){return this.nextAddress};$jscomp.generator.Context.prototype.getNextAddressJsc=function(){return this.nextAddress};$jscomp.generator.Context.prototype.getYieldResultJsc=function(){return this.yieldResult};$jscomp.generator.Context.prototype.getYieldResultJsc=function(){return this.yieldResult};
|
|
519
570
|
$jscomp.generator.Context.prototype.return=function(a){this.abruptCompletion_={return:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype["return"]=$jscomp.generator.Context.prototype.return;$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks;
|
|
520
571
|
$jscomp.generator.Context.prototype.yield=function(a,b){this.nextAddress=b;return{value:a}};$jscomp.generator.Context.prototype.yield=$jscomp.generator.Context.prototype.yield;$jscomp.generator.Context.prototype.yieldAll=function(a,b){a=$jscomp.makeIterator(a);var c=a.next();$jscomp.generator.ensureIteratorResultIsObject_(c);if(c.done)this.yieldResult=c.value,this.nextAddress=b;else return this.yieldAllIterator_=a,this.yield(c.value,b)};$jscomp.generator.Context.prototype.yieldAll=$jscomp.generator.Context.prototype.yieldAll;
|
|
521
572
|
$jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpTo=$jscomp.generator.Context.prototype.jumpTo;$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.jumpToEnd=$jscomp.generator.Context.prototype.jumpToEnd;$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(a,b){this.catchAddress_=a;b!=void 0&&(this.finallyAddress_=b)};
|
|
@@ -535,12 +586,11 @@ $jscomp.polyfill("globalThis",function(a){return a||$jscomp.global},"es_2020","e
|
|
|
535
586
|
$jscomp.checkEs6ConformanceViaProxy=function(){try{var a={},b=Object.create(new $jscomp.global.Proxy(a,{get:function(c,d,e){return c==a&&d=="q"&&e==b}}));return b.q===!0}catch(c){return!1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.initSymbol=function(){};$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};
|
|
536
587
|
$jscomp.owns=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};$jscomp.MapEntry=function(){};$jscomp.polyfill("Set.prototype.difference",function(a){return a?a:function(b){$jscomp.checkIsSetInstance(this);$jscomp.checkIsSetLike(b);var c=$jscomp.getSmallerAndLargerSets(this,b);b=new Set(this);var d=c.smallerSetIterator;c=c.largerSet;for(var e=d.next();!e.done;)c.has(e.value)&&b.delete(e.value),e=d.next();return b}},"es_next","es6");
|
|
537
588
|
$jscomp.checkIsSetLike=function(a){if(typeof a!=="object"||a===null||typeof a.size!=="number"||a.size<0||typeof a.keys!=="function"||typeof a.has!=="function")throw new TypeError("Argument must be set-like");};$jscomp.checkIsValidIterator=function(a){if(typeof a!=="object"||a===null||typeof a.next!=="function")throw new TypeError("Invalid iterator.");return a};
|
|
538
|
-
$jscomp.getSmallerAndLargerSets=function(a,b){return a.size<=b.size?{smallerSetIterator:a.keys(),largerSet:b}:{smallerSetIterator:$jscomp.checkIsValidIterator(b.keys()),largerSet:a}};$jscomp.checkIsSetInstance=function(a){if(!(a instanceof Set))throw new TypeError("Method must be called on an instance of Set.");};
|
|
589
|
+
$jscomp.getSmallerAndLargerSets=function(a,b){return a.size<=b.size?{smallerSetIterator:a.keys(),largerSet:b}:{smallerSetIterator:$jscomp.checkIsValidIterator(b.keys()),largerSet:a}};$jscomp.checkIsSetInstance=function(a){if(!(a instanceof Set))throw new TypeError("Method must be called on an instance of Set.");};$jscomp.polyfill("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push(b[d]);return c}},"es8","es3");
|
|
539
590
|
$jscomp.iteratorFromArray=function(a,b){if($jscomp.ASSUME_ES6)return a[Symbol.iterator]();a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e};$jscomp.polyfill("Array.prototype.values",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b,c){return c})}},"es8","es3");
|
|
540
591
|
$jscomp.polyfill("Array.prototype.flatMap",function(a){return a?a:function(b,c){var d=[];Array.prototype.forEach.call(this,function(e,f){e=b.call(c,e,f,this);Array.isArray(e)?d.push.apply(d,e):d.push(e)});return d}},"es9","es5");$jscomp.polyfill("Array.prototype.flat",function(a){return a?a:function(b){b=b===void 0?1:b;var c=[];Array.prototype.forEach.call(this,function(d){Array.isArray(d)&&b>0?(d=Array.prototype.flat.call(d,b-1),c.push.apply(c,d)):c.push(d)});return c}},"es9","es5");
|
|
541
|
-
$jscomp.polyfill("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push([d,b[d]]);return c}},"es8","es3")
|
|
542
|
-
|
|
543
|
-
Type$$module$build$src$core$registry.CONNECTION_PREVIEWER=new Type$$module$build$src$core$registry("connectionPreviewer");Type$$module$build$src$core$registry.CURSOR=new Type$$module$build$src$core$registry("cursor");Type$$module$build$src$core$registry.EVENT=new Type$$module$build$src$core$registry("event");Type$$module$build$src$core$registry.FIELD=new Type$$module$build$src$core$registry("field");Type$$module$build$src$core$registry.INPUT=new Type$$module$build$src$core$registry("input");
|
|
592
|
+
$jscomp.polyfill("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push([d,b[d]]);return c}},"es8","es3");var typeMap$$module$build$src$core$registry=Object.create(null),TEST_ONLY$$module$build$src$core$registry={typeMap:typeMap$$module$build$src$core$registry},nameMap$$module$build$src$core$registry=Object.create(null),DEFAULT$$module$build$src$core$registry="default",Type$$module$build$src$core$registry=class{constructor(a){this.name=a}toString(){return this.name}};
|
|
593
|
+
Type$$module$build$src$core$registry.CONNECTION_CHECKER=new Type$$module$build$src$core$registry("connectionChecker");Type$$module$build$src$core$registry.CONNECTION_PREVIEWER=new Type$$module$build$src$core$registry("connectionPreviewer");Type$$module$build$src$core$registry.EVENT=new Type$$module$build$src$core$registry("event");Type$$module$build$src$core$registry.FIELD=new Type$$module$build$src$core$registry("field");Type$$module$build$src$core$registry.INPUT=new Type$$module$build$src$core$registry("input");
|
|
544
594
|
Type$$module$build$src$core$registry.RENDERER=new Type$$module$build$src$core$registry("renderer");Type$$module$build$src$core$registry.TOOLBOX=new Type$$module$build$src$core$registry("toolbox");Type$$module$build$src$core$registry.THEME=new Type$$module$build$src$core$registry("theme");Type$$module$build$src$core$registry.TOOLBOX_ITEM=new Type$$module$build$src$core$registry("toolboxItem");Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsVerticalToolbox");
|
|
545
595
|
Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsHorizontalToolbox");Type$$module$build$src$core$registry.FLYOUT_INFLATER=new Type$$module$build$src$core$registry("flyoutInflater");Type$$module$build$src$core$registry.METRICS_MANAGER=new Type$$module$build$src$core$registry("metricsManager");Type$$module$build$src$core$registry.BLOCK_DRAGGER=new Type$$module$build$src$core$registry("blockDragger");
|
|
546
596
|
Type$$module$build$src$core$registry.SERIALIZER=new Type$$module$build$src$core$registry("serializer");Type$$module$build$src$core$registry.ICON=new Type$$module$build$src$core$registry("icon");Type$$module$build$src$core$registry.PASTER=new Type$$module$build$src$core$registry("paster");Type$$module$build$src$core$registry.VARIABLE_MODEL=new Type$$module$build$src$core$registry("variableModel");Type$$module$build$src$core$registry.VARIABLE_MAP=new Type$$module$build$src$core$registry("variableMap");
|
|
@@ -552,8 +602,8 @@ module$build$src$core$touch.getTouchIdentifierFromEvent=getTouchIdentifierFromEv
|
|
|
552
602
|
globalThis.navigator.maxTouchPoints;isIPad$$module$build$src$core$utils$useragent=b("iPad")||b("Macintosh")&&a>0;isIPhone$$module$build$src$core$utils$useragent=b("iPhone")&&!isIPad$$module$build$src$core$utils$useragent;isMac$$module$build$src$core$utils$useragent=b("Macintosh");isTablet$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent&&!b("Mobile")||b("Silk");isMobile$$module$build$src$core$utils$useragent=!isTablet$$module$build$src$core$utils$useragent&&
|
|
553
603
|
(isIPhone$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent)})(globalThis.navigator&&globalThis.navigator.userAgent||"");
|
|
554
604
|
var raw$$module$build$src$core$utils$useragent=rawUserAgent$$module$build$src$core$utils$useragent,JavaFx$$module$build$src$core$utils$useragent=isJavaFx$$module$build$src$core$utils$useragent,GECKO$$module$build$src$core$utils$useragent=isGecko$$module$build$src$core$utils$useragent,ANDROID$$module$build$src$core$utils$useragent=isAndroid$$module$build$src$core$utils$useragent,IPAD$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent,IPHONE$$module$build$src$core$utils$useragent=
|
|
555
|
-
isIPhone$$module$build$src$core$utils$useragent,MAC$$module$build$src$core$utils$useragent=isMac$$module$build$src$core$utils$useragent,MOBILE$$module$build$src$core$utils$useragent=isMobile$$module$build$src$core$utils$useragent,module$build$src$core$utils$useragent=
|
|
556
|
-
MAC:MAC$$module$build$src$core$utils$useragent,MOBILE:MOBILE$$module$build$src$core$utils$useragent,raw:raw$$module$build$src$core$utils$useragent};var LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events=40,PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events=125,module$build$src$core$browser_events={};module$build$src$core$browser_events.bind=bind$$module$build$src$core$browser_events;module$build$src$core$browser_events.conditionalBind=conditionalBind$$module$build$src$core$browser_events;module$build$src$core$browser_events.getScrollDeltaPixels=getScrollDeltaPixels$$module$build$src$core$browser_events;
|
|
605
|
+
isIPhone$$module$build$src$core$utils$useragent,MAC$$module$build$src$core$utils$useragent=isMac$$module$build$src$core$utils$useragent,MOBILE$$module$build$src$core$utils$useragent=isMobile$$module$build$src$core$utils$useragent,APPLE$$module$build$src$core$utils$useragent=MAC$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent,module$build$src$core$utils$useragent={ANDROID:ANDROID$$module$build$src$core$utils$useragent,
|
|
606
|
+
APPLE:APPLE$$module$build$src$core$utils$useragent,GECKO:GECKO$$module$build$src$core$utils$useragent,IPAD:IPAD$$module$build$src$core$utils$useragent,IPHONE:IPHONE$$module$build$src$core$utils$useragent,JavaFx:JavaFx$$module$build$src$core$utils$useragent,MAC:MAC$$module$build$src$core$utils$useragent,MOBILE:MOBILE$$module$build$src$core$utils$useragent,raw:raw$$module$build$src$core$utils$useragent};var LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events=40,PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events=125,module$build$src$core$browser_events={};module$build$src$core$browser_events.bind=bind$$module$build$src$core$browser_events;module$build$src$core$browser_events.conditionalBind=conditionalBind$$module$build$src$core$browser_events;module$build$src$core$browser_events.getScrollDeltaPixels=getScrollDeltaPixels$$module$build$src$core$browser_events;
|
|
557
607
|
module$build$src$core$browser_events.isRightButton=isRightButton$$module$build$src$core$browser_events;module$build$src$core$browser_events.isTargetInput=isTargetInput$$module$build$src$core$browser_events;module$build$src$core$browser_events.mouseToSvg=mouseToSvg$$module$build$src$core$browser_events;module$build$src$core$browser_events.unbind=unbind$$module$build$src$core$browser_events;var EventType$$module$build$src$core$events$type;
|
|
558
608
|
(function(a){a.BLOCK_CREATE="create";a.BLOCK_DELETE="delete";a.BLOCK_CHANGE="change";a.BLOCK_FIELD_INTERMEDIATE_CHANGE="block_field_intermediate_change";a.BLOCK_MOVE="move";a.VAR_CREATE="var_create";a.VAR_DELETE="var_delete";a.VAR_RENAME="var_rename";a.VAR_TYPE_CHANGE="var_type_change";a.UI="ui";a.BLOCK_DRAG="drag";a.SELECTED="selected";a.CLICK="click";a.MARKER_MOVE="marker_move";a.BUBBLE_OPEN="bubble_open";a.TRASHCAN_OPEN="trashcan_open";a.TOOLBOX_ITEM_SELECT="toolbox_item_select";a.THEME_CHANGE=
|
|
559
609
|
"theme_change";a.VIEWPORT_CHANGE="viewport_change";a.COMMENT_CREATE="comment_create";a.COMMENT_DELETE="comment_delete";a.COMMENT_CHANGE="comment_change";a.COMMENT_MOVE="comment_move";a.COMMENT_RESIZE="comment_resize";a.COMMENT_DRAG="comment_drag";a.COMMENT_COLLAPSE="comment_collapse";a.FINISHED_LOADING="finished_loading"})(EventType$$module$build$src$core$events$type||(EventType$$module$build$src$core$events$type={}));
|
|
@@ -576,13 +626,13 @@ a.id==="null"||b.getNestedTrees().map(e=>FocusableTreeTraverser$$module$build$sr
|
|
|
576
626
|
FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME="blocklyActiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME}`;
|
|
577
627
|
FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var TreeRegistration$$module$build$src$core$focus_manager=class{constructor(a,b){this.tree=a;this.rootShouldBeAutoTabbable=b}},FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.isUpdatingFocusedNode=this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{if(!this.isUpdatingFocusedNode){this.recentlyLostAllFocus=!c;var d=null;if(c instanceof HTMLElement||
|
|
578
628
|
c instanceof SVGElement)for(var e of this.registeredTrees)if(d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,e.tree))break;if(d&&d.canBeFocused()){c=d.getFocusableTree();let f;e=(f=this.focusedNode)==null?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()}};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&&
|
|
579
|
-
b(c.relatedTarget)})}registerTree(a,b=!1){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);this.registeredTrees.push(new TreeRegistration$$module$build$src$core$focus_manager(a,b));const c=a.getRootFocusableNode().getFocusableElement();if(!c.id||c.id==="null")throw Error(
|
|
629
|
+
b(c.relatedTarget)})}registerTree(a,b=!1){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);this.registeredTrees.push(new TreeRegistration$$module$build$src$core$focus_manager(a,b));const c=a.getRootFocusableNode().getFocusableElement();if(!c.id||c.id==="null")throw Error(`Attempting to register a tree with a root element that has an invalid ID: ${a}.`);b&&(c.tabIndex=0)}isRegistered(a){return!!this.lookUpRegistration(a)}lookUpRegistration(a){let b;
|
|
580
630
|
return(b=this.registeredTrees.find(c=>c.tree===a))!=null?b:null}unregisterTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to unregister not registered tree: ${a}.`);var b=this.registeredTrees.findIndex(e=>e.tree===a);const c=this.registeredTrees[b];this.registeredTrees.splice(b,1);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a);const d=a.getRootFocusableNode();b&&this.removeHighlight(b);this.focusedNode!==b&&
|
|
581
631
|
this.focusedNode!==d||this.updateFocusedNode(null);this.removeHighlight(d);c.rootShouldBeAutoTabbable&&a.getRootFocusableNode().getFocusableElement().removeAttribute("tabindex")}getFocusedTree(){let a,b;return(b=(a=this.focusedNode)==null?void 0:a.getFocusableTree())!=null?b:null}getFocusedNode(){return this.focusedNode}focusTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to focus unregistered tree: ${a}.`);const b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a),
|
|
582
632
|
c=a.getRestoredFocusableNode(b);a=a.getRootFocusableNode();let d;this.focusNode((d=c!=null?c:b)!=null?d:a)}focusNode(a){this.ensureManagerIsUnlocked();const b=!this.currentlyHoldsEphemeralFocus;b&&(this.isUpdatingFocusedNode=!0);var c,d=((c=this.focusedNode)==null?void 0:c.getFocusableElement())!==document.activeElement;if(this.focusedNode!==a||d)if(a.canBeFocused()){c=a.getFocusableTree();if(!this.isRegistered(c))throw Error(`Attempted to focus unregistered node: ${a}.`);d=a.getFocusableElement();
|
|
583
633
|
d.id&&d.id!=="null"||console.warn("Trying to focus a node that has an invalid ID.");var e=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(d,c);d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(c);var f=a;if(e!==a){f=c.getRestoredFocusableNode(d);a=c.getRootFocusableNode();var g;f=(g=f!=null?f:d)!=null?g:a}a=this.focusedNode;g=a==null?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,c);c=c.getRootFocusableNode();
|
|
584
|
-
d&&this.removeHighlight(d);c!==f&&this.removeHighlight(c);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(f,g!=null?g:null);this.updateFocusedNode(f)}else console.warn("Trying to focus a node that can't be focused.");b&&(this.isUpdatingFocusedNode=!1)}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();if(this.currentlyHoldsEphemeralFocus)throw Error(
|
|
585
|
-
this.passivelyFocusNode(this.focusedNode,null);a.focus({preventScroll:!0});let b=!1;return()=>{if(b)throw Error(
|
|
634
|
+
d&&this.removeHighlight(d);c!==f&&this.removeHighlight(c);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(f,g!=null?g:null);this.updateFocusedNode(f)}else console.warn("Trying to focus a node that can't be focused.");b&&(this.isUpdatingFocusedNode=!1)}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();if(this.currentlyHoldsEphemeralFocus)throw Error(`Attempted to take ephemeral focus when it's already held, with new element: ${a}.`);this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&&
|
|
635
|
+
this.passivelyFocusNode(this.focusedNode,null);a.focus({preventScroll:!0});let b=!1;return()=>{if(b)throw Error(`Attempted to finish ephemeral focus twice for element: ${a}.`);b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ephemeralFocusTaken(){return this.currentlyHoldsEphemeralFocus}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");
|
|
586
636
|
}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree(),d=a.getFocusableElement();let e;const f=(e=this.lookUpRegistration(c))==null?void 0:e.rootShouldBeAutoTabbable;c!==b&&(c.onTreeFocus(a,b),f&&(c.getRootFocusableNode().getFocusableElement().tabIndex=
|
|
587
637
|
-1));a.onNodeFocus();this.lockFocusStateChanges=!1;f&&a===c.getRootFocusableNode()||d.hasAttribute("tabindex")||(d.tabIndex=-1);this.setNodeToVisualActiveFocus(a);d.focus({preventScroll:!0})}passivelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree();if(c!==b){c.onTreeBlur(b);let d;if((d=this.lookUpRegistration(c))==null?0:d.rootShouldBeAutoTabbable)c.getRootFocusableNode().getFocusableElement().tabIndex=0}a.onNodeBlur();this.lockFocusStateChanges=!1;c!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=
|
|
588
638
|
a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a,
|
|
@@ -609,7 +659,7 @@ a+'" has not been added to the ComponentManager');if(this.hasCapability(a,b))con
|
|
|
609
659
|
b),removeElem$$module$build$src$core$utils$array(this.capabilityToComponentIds.get(b),a)):console.warn('Plugin "'+a+"doesn't have capability \""+b+'" to remove')}hasCapability(a,b){b=`${b}`.toLowerCase();return this.componentData.has(a)&&this.componentData.get(a).capabilities.includes(b)}getComponent(a){let b;return(b=this.componentData.get(a))==null?void 0:b.component}getComponents(a,b){a=`${a}`.toLowerCase();a=this.capabilityToComponentIds.get(a);if(!a)return[];const c=[];if(b){const d=[];a.forEach(e=>
|
|
610
660
|
{d.push(this.componentData.get(e))});d.sort(function(e,f){return e.weight-f.weight});d.forEach(function(e){c.push(e.component)})}else a.forEach(d=>{c.push(this.componentData.get(d).component)});return c}};ComponentManager$$module$build$src$core$component_manager.Capability=Capability$$module$build$src$core$component_manager;
|
|
611
661
|
(function(a){a=a.ComponentWeight||(a.ComponentWeight={});a[a.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT";a[a.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT";a[a.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT";a[a.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(ComponentManager$$module$build$src$core$component_manager||(ComponentManager$$module$build$src$core$component_manager={}));
|
|
612
|
-
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injected$$module$build$src$core$css=!1,content$$module$build$src$core$css='\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyEmboss {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; /* @todo: spec for maximum height. */\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyHighlighted>.blocklyPath {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.blocklyDragging {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n /* Drag surface disables events to not block the toolbox, so we have to\n * reenable them here for the cursor values to work. */\n pointer-events: auto;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete,\n.blocklyDragging.blocklyDraggingDelete .blocklyField {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabledPattern>.blocklyPath {\n fill: var(--blocklyDisabledPattern);\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyNonEditableField>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover):not(:focus),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Remove the increase and decrease arrows on the field number editor */\ninput.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,\ninput.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n pointer-events: none;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n width: 16px;\n height: 16px;\n position: static; /* Scroll with the menu. */\n display: block;\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n\n.blocklyMenuSeparator {\n background-color: #ccc;\n height: 1px;\n border: 0;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.blocklyBlockDragSurface, .blocklyAnimationLayer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 80;\n pointer-events: none;\n}\n\n.blocklyField {\n cursor: default;\n}\n\n.blocklyInputField {\n cursor: text;\n}\n\n.blocklyDragging .blocklyField,\n.blocklyDragging .blocklyIconGroup {\n cursor: grabbing;\n}\n\n.blocklyActiveFocus:is(\n .blocklyFlyout,\n .blocklyWorkspace,\n .blocklyField,\n .blocklyPath,\n .blocklyHighlightedConnectionPath,\n .blocklyComment,\n .blocklyBubble,\n .blocklyIconGroup,\n .blocklyTextarea\n) {\n outline: none;\n}\n',
|
|
662
|
+
var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injectionSites$$module$build$src$core$css=new WeakSet,registeredStyleSheets$$module$build$src$core$css=[],content$$module$build$src$core$css='\n:is(\n .injectionDiv,\n .blocklyWidgetDiv,\n .blocklyDropdownDiv,\n .blocklyTooltipDiv,\n) * {\n box-sizing: border-box;\n}\n\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyEmboss {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; /* @todo: spec for maximum height. */\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyHighlighted>.blocklyPath {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.blocklyDragging {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n /* Drag surface disables events to not block the toolbox, so we have to\n * reenable them here for the cursor values to work. */\n pointer-events: auto;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete,\n.blocklyDragging.blocklyDraggingDelete .blocklyField {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabledPattern>.blocklyPath {\n fill: var(--blocklyDisabledPattern);\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyNonEditableField>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover):not(:focus),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Remove the increase and decrease arrows on the field number editor */\ninput.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,\ninput.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n pointer-events: none;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<<PATH>>>/sprites.svg) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n width: 16px;\n height: 16px;\n position: static; /* Scroll with the menu. */\n display: block;\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n\n.blocklyMenuSeparator {\n background-color: #ccc;\n height: 1px;\n border: 0;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.blocklyBlockDragSurface, .blocklyAnimationLayer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 80;\n pointer-events: none;\n}\n\n.blocklyField {\n cursor: default;\n}\n\n.blocklyInputField {\n cursor: text;\n}\n\n.blocklyDragging .blocklyField,\n.blocklyDragging .blocklyIconGroup {\n cursor: grabbing;\n}\n\n.blocklyActiveFocus:is(\n .blocklyFlyout,\n .blocklyWorkspace,\n .blocklyField,\n .blocklyPath,\n .blocklyHighlightedConnectionPath,\n .blocklyComment,\n .blocklyBubble,\n .blocklyIconGroup,\n .blocklyTextarea\n) {\n outline: none;\n}\n.hiddenForAria {\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.injectionDiv {\n --blockly-active-node-color: #fff200;\n --blockly-active-tree-color: #60a5fa;\n --blockly-selection-width: 3px;\n}\n\n/* Active focus cases: */\n/* Blocks with active focus. */\n.blocklyKeyboardNavigation\n .blocklyActiveFocus:is(.blocklyPath, .blocklyHighlightedConnectionPath),\n/* Fields with active focus, */\n.blocklyKeyboardNavigation\n .blocklyActiveFocus.blocklyField\n > .blocklyFieldRect,\n/* Icons with active focus. */\n.blocklyKeyboardNavigation\n .blocklyActiveFocus.blocklyIconGroup\n > .blocklyIconShape:first-child {\n stroke: var(--blockly-active-node-color);\n stroke-width: var(--blockly-selection-width);\n}\n\n/* Passive focus cases: */\n/* Blocks with passive focus except when widget/dropdown div in use. */\n.blocklyKeyboardNavigation:not(\n :has(\n .blocklyDropDownDiv:focus-within,\n .blocklyWidgetDiv:focus-within\n )\n )\n .blocklyPassiveFocus:is(\n .blocklyPath:not(.blocklyFlyout .blocklyPath),\n .blocklyHighlightedConnectionPath\n ),\n/* Fields with passive focus except when widget/dropdown div in use. */\n.blocklyKeyboardNavigation:not(\n :has(\n .blocklyDropDownDiv:focus-within,\n .blocklyWidgetDiv:focus-within\n )\n )\n .blocklyPassiveFocus.blocklyField\n > .blocklyFieldRect,\n/* Icons with passive focus except when widget/dropdown div in use. */\n.blocklyKeyboardNavigation:not(\n :has(\n .blocklyDropDownDiv:focus-within,\n .blocklyWidgetDiv:focus-within\n )\n )\n .blocklyPassiveFocus.blocklyIconGroup\n > .blocklyIconShape:first-child {\n stroke: var(--blockly-active-node-color);\n stroke-dasharray: 5px 3px;\n stroke-width: var(--blockly-selection-width);\n}\n\n/* Workaround for unexpectedly hidden connection path due to core style. */\n.blocklyKeyboardNavigation\n .blocklyPassiveFocus.blocklyHighlightedConnectionPath {\n display: unset !important;\n}\n\n/* Different ways for toolbox/flyout to be the active tree: */\n/* Active focus in the flyout. */\n.blocklyKeyboardNavigation .blocklyFlyout:has(.blocklyActiveFocus),\n/* Active focus in the toolbox. */\n.blocklyKeyboardNavigation .blocklyToolbox:has(.blocklyActiveFocus),\n/* Active focus on the toolbox/flyout. */\n.blocklyKeyboardNavigation\n .blocklyActiveFocus:is(.blocklyFlyout, .blocklyToolbox) {\n outline-offset: calc(var(--blockly-selection-width) * -1);\n outline: var(--blockly-selection-width) solid\n var(--blockly-active-tree-color);\n}\n\n/* Suppress default outline. */\n.blocklyKeyboardNavigation\n .blocklyToolboxCategoryContainer:focus-visible {\n outline: none;\n}\n\n /* Different ways for the workspace to be the active tree: */\n/* Active focus within workspace. */\n.blocklyKeyboardNavigation\n .blocklyWorkspace:has(.blocklyActiveFocus)\n .blocklyWorkspaceFocusRing,\n/* Active focus within drag layer. */\n.blocklyKeyboardNavigation\n .blocklySvg:has(~ .blocklyBlockDragSurface .blocklyActiveFocus)\n .blocklyWorkspaceFocusRing,\n/* Active focus on workspace. */\n.blocklyKeyboardNavigation\n .blocklyWorkspace.blocklyActiveFocus\n .blocklyWorkspaceFocusRing,\n/* Focus in widget/dropdown div considered to be in workspace. */\n.blocklyKeyboardNavigation:has(\n .blocklyWidgetDiv:focus-within,\n .blocklyDropDownDiv:focus-within\n)\n .blocklyWorkspace\n .blocklyWorkspaceFocusRing {\n stroke: var(--blockly-active-tree-color);\n stroke-width: calc(var(--blockly-selection-width) * 2);\n}\n\n/* The workspace itself is the active node. */\n.blocklyKeyboardNavigation\n .blocklyWorkspace.blocklyActiveFocus\n .blocklyWorkspaceSelectionRing {\n stroke: var(--blockly-active-node-color);\n stroke-width: var(--blockly-selection-width);\n}\n\n/* The workspace itself is the active node. */\n.blocklyKeyboardNavigation\n .blocklyBubble.blocklyActiveFocus\n .blocklyDraggable {\n stroke: var(--blockly-active-node-color);\n stroke-width: var(--blockly-selection-width);\n}\n/* Flyout buttons and labels */\n.blocklyKeyboardNavigation .blocklyFlyout .blocklyFlyoutLabel.blocklyActiveFocus,\n.blocklyKeyboardNavigation .blocklyFlyout .blocklyFlyoutButton.blocklyActiveFocus {\n outline: none;\n}\n.blocklyKeyboardNavigation .blocklyFlyout .blocklyFlyoutLabel.blocklyActiveFocus > .blocklyFlyoutLabelText,\n.blocklyKeyboardNavigation .blocklyFlyout .blocklyFlyoutButton.blocklyActiveFocus > .blocklyFlyoutButtonBackground {\n outline-offset: 2px;\n outline: var(--blockly-selection-width) solid var(--blockly-active-node-color);\n border-radius: 2px;\n}\n',
|
|
613
663
|
module$build$src$core$css={};module$build$src$core$css.inject=inject$$module$build$src$core$css;module$build$src$core$css.register=register$$module$build$src$core$css;var Coordinate$$module$build$src$core$utils$coordinate=class{constructor(a,b){this.x=a;this.y=b}clone(){return new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y)}scale(a){this.x*=a;this.y*=a;return this}translate(a,b){this.x+=a;this.y+=b;return this}static equals(a,b){return a===b?!0:a&&b?a.x===b.x&&a.y===b.y:!1}static distance(a,b){const c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)}static magnitude(a){return Math.sqrt(a.x*a.x+a.y*a.y)}static difference(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x-
|
|
614
664
|
b.x,a.y-b.y)}static sum(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x+b.x,a.y+b.y)}},module$build$src$core$utils$coordinate={};module$build$src$core$utils$coordinate.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;var Svg$$module$build$src$core$utils$svg=class{constructor(a){this.tagName=a}toString(){return this.tagName}};Svg$$module$build$src$core$utils$svg.ANIMATE=new Svg$$module$build$src$core$utils$svg("animate");Svg$$module$build$src$core$utils$svg.CIRCLE=new Svg$$module$build$src$core$utils$svg("circle");Svg$$module$build$src$core$utils$svg.CLIPPATH=new Svg$$module$build$src$core$utils$svg("clipPath");Svg$$module$build$src$core$utils$svg.DEFS=new Svg$$module$build$src$core$utils$svg("defs");
|
|
615
665
|
Svg$$module$build$src$core$utils$svg.FECOMPOSITE=new Svg$$module$build$src$core$utils$svg("feComposite");Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER=new Svg$$module$build$src$core$utils$svg("feComponentTransfer");Svg$$module$build$src$core$utils$svg.FEFLOOD=new Svg$$module$build$src$core$utils$svg("feFlood");Svg$$module$build$src$core$utils$svg.FEFUNCA=new Svg$$module$build$src$core$utils$svg("feFuncA");Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR=new Svg$$module$build$src$core$utils$svg("feGaussianBlur");
|
|
@@ -644,7 +694,7 @@ module$build$src$core$utils$xml.domToText=domToText$$module$build$src$core$utils
|
|
|
644
694
|
var TEST_ONLY$$module$build$src$core$utils$toolbox={hasCategoriesInternal:hasCategoriesInternal$$module$build$src$core$utils$toolbox},module$build$src$core$utils$toolbox={};module$build$src$core$utils$toolbox.Position=Position$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.TEST_ONLY=TEST_ONLY$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.convertFlyoutDefToJsonArray=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox;
|
|
645
695
|
module$build$src$core$utils$toolbox.convertToolboxDefToJson=convertToolboxDefToJson$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.hasCategories=hasCategories$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.isCategoryCollapsible=isCategoryCollapsible$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.parseToolboxTree=parseToolboxTree$$module$build$src$core$utils$toolbox;var verticalPosition$$module$build$src$core$positionable_helpers;(function(a){a[a.TOP=0]="TOP";a[a.BOTTOM=1]="BOTTOM"})(verticalPosition$$module$build$src$core$positionable_helpers||(verticalPosition$$module$build$src$core$positionable_helpers={}));var horizontalPosition$$module$build$src$core$positionable_helpers;(function(a){a[a.LEFT=0]="LEFT";a[a.RIGHT=1]="RIGHT"})(horizontalPosition$$module$build$src$core$positionable_helpers||(horizontalPosition$$module$build$src$core$positionable_helpers={}));
|
|
646
696
|
var bumpDirection$$module$build$src$core$positionable_helpers;(function(a){a[a.UP=0]="UP";a[a.DOWN=1]="DOWN"})(bumpDirection$$module$build$src$core$positionable_helpers||(bumpDirection$$module$build$src$core$positionable_helpers={}));var module$build$src$core$positionable_helpers={};module$build$src$core$positionable_helpers.bumpDirection=bumpDirection$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.bumpPositionRect=bumpPositionRect$$module$build$src$core$positionable_helpers;
|
|
647
|
-
module$build$src$core$positionable_helpers.getCornerOppositeToolbox=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.getStartPositionRect=getStartPositionRect$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.horizontalPosition=horizontalPosition$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.verticalPosition=verticalPosition$$module$build$src$core$positionable_helpers;var SPRITE$$module$build$src$core$sprites={width:96,height:124,url:"sprites.
|
|
697
|
+
module$build$src$core$positionable_helpers.getCornerOppositeToolbox=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.getStartPositionRect=getStartPositionRect$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.horizontalPosition=horizontalPosition$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.verticalPosition=verticalPosition$$module$build$src$core$positionable_helpers;var SPRITE$$module$build$src$core$sprites={width:96,height:124,url:"sprites.svg"},module$build$src$core$sprites={SPRITE:SPRITE$$module$build$src$core$sprites};var ZoomControls$$module$build$src$core$zoom_controls=class{constructor(a){this.workspace=a;this.id="zoomControls";this.boundEvents=[];this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null;this.HEIGHT=this.WIDTH=32;this.SMALL_SPACING=2;this.LARGE_SPACING=11;this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20;this.svgGroup=null;this.top=this.left=0;this.initialized=!1}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});const a=String(Math.random()).substring(2);
|
|
648
698
|
this.createZoomOutSvg(a);this.createZoomInSvg(a);this.workspace.isMovable()&&this.createZoomResetSvg(a);return this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls");this.svgGroup&&
|
|
649
699
|
removeNode$$module$build$src$core$utils$dom(this.svgGroup);for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);this.boundEvents.length=0}getBoundingRectangle(){let a=this.SMALL_SPACING+2*this.HEIGHT;this.zoomResetGroup&&(a+=this.LARGE_SPACING+this.HEIGHT);return new Rect$$module$build$src$core$utils$rect(this.top,this.top+a,this.left,this.left+this.WIDTH)}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,
|
|
650
700
|
a),d=this.SMALL_SPACING+2*this.HEIGHT;this.zoomResetGroup&&(d+=this.LARGE_SPACING+this.HEIGHT);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(this.WIDTH,d),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,a,this.workspace);c=c.vertical;b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,this.MARGIN_VERTICAL,c===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:
|
|
@@ -662,10 +712,13 @@ WORKSPACE_COMMENTS:WORKSPACE_COMMENTS$$module$build$src$core$serialization$prior
|
|
|
662
712
|
b){for(const c of a)append$$module$build$src$core$serialization$workspace_comments(c,b,{recordUndo:getRecordUndo$$module$build$src$core$events$utils()})}clear(a){for(const b of a.getTopComments())b.dispose()}};register$$module$build$src$core$serialization$registry("workspaceComments",new WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments);var module$build$src$core$serialization$workspace_comments={};
|
|
663
713
|
module$build$src$core$serialization$workspace_comments.WorkspaceCommentSerializer=WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments;module$build$src$core$serialization$workspace_comments.append=append$$module$build$src$core$serialization$workspace_comments;module$build$src$core$serialization$workspace_comments.save=save$$module$build$src$core$serialization$workspace_comments;var module$build$src$core$clipboard$registry={};module$build$src$core$clipboard$registry.register=register$$module$build$src$core$clipboard$registry;module$build$src$core$clipboard$registry.unregister=unregister$$module$build$src$core$clipboard$registry;var WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster=class{paste(a,b,c){a=a.commentState;c&&(a.x=c.x,a.y=c.y);$.disable$$module$build$src$core$events$utils();let d;try{d=append$$module$build$src$core$serialization$workspace_comments(a,b),moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster(d)}finally{$.enable$$module$build$src$core$events$utils()}if(!d)return null;isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CREATE))(d));
|
|
664
714
|
$.getFocusManager$$module$build$src$core$focus_manager().focusNode(d);return d}};WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE="workspace-comment";register$$module$build$src$core$clipboard$registry(WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,new WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster);var module$build$src$core$clipboard$workspace_comment_paster={};
|
|
665
|
-
module$build$src$core$clipboard$workspace_comment_paster.WorkspaceCommentPaster=WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster;var DEFAULT_SNAP_RADIUS$$module$build$src$core$config,module$build$src$core$config;DEFAULT_SNAP_RADIUS$$module$build$src$core$config=28;$.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,connectingSnapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,currentConnectionPreference:8,bumpDelay:250};module$build$src$core$config={config:$.config$$module$build$src$core$config};var ARIA_PREFIX$$module$build$src$core$utils$aria="aria-",ROLE_ATTRIBUTE$$module$build$src$core$utils$aria="role",Role$$module$build$src$core$utils$aria;
|
|
666
|
-
(function(a){a.GRID="grid";a.GRIDCELL="gridcell";a.GROUP="group";a.LISTBOX="listbox";a.
|
|
667
|
-
|
|
668
|
-
|
|
715
|
+
module$build$src$core$clipboard$workspace_comment_paster.WorkspaceCommentPaster=WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster;var DEFAULT_SNAP_RADIUS$$module$build$src$core$config,module$build$src$core$config;DEFAULT_SNAP_RADIUS$$module$build$src$core$config=28;$.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,connectingSnapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,currentConnectionPreference:8,bumpDelay:250};module$build$src$core$config={config:$.config$$module$build$src$core$config};var ARIA_PREFIX$$module$build$src$core$utils$aria="aria-",ROLE_ATTRIBUTE$$module$build$src$core$utils$aria="role",LiveRegionAssertiveness$$module$build$src$core$utils$aria;(function(a){a.ASSERTIVE="assertive";a.OFF="off";a.POLITE="polite"})(LiveRegionAssertiveness$$module$build$src$core$utils$aria||(LiveRegionAssertiveness$$module$build$src$core$utils$aria={}));var Role$$module$build$src$core$utils$aria;
|
|
716
|
+
(function(a){a.APPLICATION="application";a.BUTTON="button";a.CHECKBOX="checkbox";a.DIALOG="dialog";a.FIGURE="figure";a.GENERIC="generic";a.GRID="grid";a.GRIDCELL="gridcell";a.GROUP="group";a.LIST="list";a.LISTBOX="listbox";a.LISTITEM="listitem";a.MENU="menu";a.MENUITEM="menuitem";a.OPTION="option";a.PRESENTATION="presentation";a.REGION="region";a.ROW="row";a.SEPARATOR="separator";a.STATUS="status";a.TEXTBOX="textbox";a.TREE="tree";a.TREEITEM="treeitem"})(Role$$module$build$src$core$utils$aria||(Role$$module$build$src$core$utils$aria=
|
|
717
|
+
{}));var DEFAULT_LIVE_REGION_ROLE$$module$build$src$core$utils$aria=Role$$module$build$src$core$utils$aria.STATUS,State$$module$build$src$core$utils$aria;
|
|
718
|
+
(function(a){a.ACTIVEDESCENDANT="activedescendant";a.ATOMIC="ATOMIC";a.CHECKED="checked";a.COLCOUNT="colcount";a.CONTROLS="controls";a.DISABLED="disabled";a.EXPANDED="expanded";a.HASPOPUP="haspopup";a.HIDDEN="hidden";a.INVALID="invalid";a.LABEL="label";a.LABELLEDBY="labelledby";a.LEVEL="level";a.LIVE="live";a.ORIENTATION="orientation";a.POSINSET="posinset";a.PRESSED="pressed";a.READONLY="readonly";a.REQUIRED="required";a.ROLEDESCRIPTION="roledescription";a.ROWCOUNT="rowcount";a.ROWINDEX="rowindex";
|
|
719
|
+
a.ROWSPAN="rowspan";a.SELECTED="selected";a.SETSIZE="setsize";a.VALUEMAX="valuemax";a.VALUEMIN="valuemin"})(State$$module$build$src$core$utils$aria||(State$$module$build$src$core$utils$aria={}));var liveRegionElement$$module$build$src$core$utils$aria=null,ariaAnnounceTimeout$$module$build$src$core$utils$aria,addBreakingSpace$$module$build$src$core$utils$aria=!1,module$build$src$core$utils$aria={};module$build$src$core$utils$aria.LiveRegionAssertiveness=LiveRegionAssertiveness$$module$build$src$core$utils$aria;
|
|
720
|
+
module$build$src$core$utils$aria.Role=Role$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.State=State$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.announceDynamicAriaState=announceDynamicAriaState$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.clearState=clearState$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.getRole=getRole$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.getState=getState$$module$build$src$core$utils$aria;
|
|
721
|
+
module$build$src$core$utils$aria.initializeGlobalAriaLiveRegion=initializeGlobalAriaLiveRegion$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.removeRole=removeRole$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.setRole=setRole$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.setState=setState$$module$build$src$core$utils$aria;var MenuItem$$module$build$src$core$menuitem=class{constructor(a,b){this.content=a;this.opt_value=b;this.enabled=!0;this.element=null;this.rightToLeft=!1;this.roleName=null;this.highlight=this.checked=this.checkable=!1;this.actionHandler=null}createDom(){const a=document.createElement("div");a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.element=a;a.className="blocklyMenuItem "+(this.enabled?"":"blocklyMenuItemDisabled ")+(this.checked?"blocklyMenuItemSelected ":"")+(this.highlight?
|
|
669
722
|
"blocklyMenuItemHighlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl ":"");const b=document.createElement("div");b.className="blocklyMenuItemContent";let c=this.content;typeof this.content==="string"&&(c=document.createTextNode(this.content));b.appendChild(c);a.appendChild(b);this.checkable&&this.toggleHasCheckbox(!0);this.roleName&&setRole$$module$build$src$core$utils$aria(a,this.roleName);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,this.checkable&&
|
|
670
723
|
this.checked||!1);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled);return a}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let a;return(a=this.opt_value)!=null?a:null}setRightToLeft(a){this.rightToLeft=a;let b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemRtl",this.rightToLeft)}setRole(a){this.roleName=a}setCheckable(a){(this.checkable=a)||this.setChecked(!1);this.toggleHasCheckbox(a)}setChecked(a){if(!a||
|
|
671
724
|
this.checkable)if(this.checked=a,a=this.getElement())a.classList.toggle("blocklyMenuItemSelected",this.checked),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,this.checked)}setHighlighted(a){this.highlight=a;if(this.isEnabled()){let b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemHighlight",this.highlight)}}isEnabled(){return this.enabled}setEnabled(a){this.enabled=a;if(a=this.getElement())a.classList.toggle("blocklyMenuItemDisabled",
|
|
@@ -680,10 +733,10 @@ break}a+=b}}handlePointerMove(a){Math.max(Math.abs(a.movementX),Math.abs(a.movem
|
|
|
680
733
|
b.performAction(a)}handlePointerEnter(a){this.focus()}handlePointerLeave(a){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(a){if(this.menuItems.length&&!(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)){var b=this.highlightedItem;switch(a.key){case "Enter":case " ":b&&b.performAction(a);break;case "ArrowUp":this.highlightPrevious();break;case "ArrowDown":this.highlightNext();break;case "PageUp":case "Home":this.highlightFirst();break;case "PageDown":case "End":this.highlightLast();break;
|
|
681
734
|
default:return}a.preventDefault();a.stopPropagation()}}getSize(){const a=this.getElement(),b=getSize$$module$build$src$core$utils$style(a);b.height=a.scrollHeight;return b}getMenuItems(){return this.menuItems.filter(a=>a instanceof MenuItem$$module$build$src$core$menuitem)}},module$build$src$core$menu={};module$build$src$core$menu.Menu=Menu$$module$build$src$core$menu;var MenuSeparator$$module$build$src$core$menu_separator=class{constructor(){this.element=null}createDom(){this.element=document.createElement("hr");this.element.className="blocklyMenuSeparator";setRole$$module$build$src$core$utils$aria(this.element,Role$$module$build$src$core$utils$aria.SEPARATOR);return this.element}dispose(){let a;(a=this.element)==null||a.remove();this.element=null}},module$build$src$core$menu_separator={};module$build$src$core$menu_separator.MenuSeparator=MenuSeparator$$module$build$src$core$menu_separator;var COLLAPSED_INPUT_NAME$$module$build$src$core$constants="_TEMP_COLLAPSED_INPUT",COLLAPSED_FIELD_NAME$$module$build$src$core$constants="_TEMP_COLLAPSED_FIELD",MANUALLY_DISABLED$$module$build$src$core$constants="MANUALLY_DISABLED",module$build$src$core$constants={COLLAPSED_FIELD_NAME:COLLAPSED_FIELD_NAME$$module$build$src$core$constants,COLLAPSED_INPUT_NAME:COLLAPSED_INPUT_NAME$$module$build$src$core$constants,MANUALLY_DISABLED:MANUALLY_DISABLED$$module$build$src$core$constants};(function(a){a[a.VALUE=1]="VALUE";a[a.STATEMENT=3]="STATEMENT";a[a.DUMMY=5]="DUMMY";a[a.CUSTOM=6]="CUSTOM";a[a.END_ROW=7]="END_ROW"})($.inputTypes$$module$build$src$core$inputs$input_types||($.inputTypes$$module$build$src$core$inputs$input_types={}));var module$build$src$core$inputs$input_types={};module$build$src$core$inputs$input_types.inputTypes=$.inputTypes$$module$build$src$core$inputs$input_types;var module$build$src$core$interfaces$i_serializable={};module$build$src$core$interfaces$i_serializable.isSerializable=isSerializable$$module$build$src$core$interfaces$i_serializable;var rootBlocks$$module$build$src$core$render_management=new Set,dirtyBlocks$$module$build$src$core$render_management=new WeakSet,eventGroups$$module$build$src$core$render_management=new WeakMap,afterRendersPromise$$module$build$src$core$render_management=null,afterRendersResolver$$module$build$src$core$render_management=null,animationRequestId$$module$build$src$core$render_management=0,module$build$src$core$render_management={};module$build$src$core$render_management.finishQueuedRenders=finishQueuedRenders$$module$build$src$core$render_management;
|
|
682
735
|
module$build$src$core$render_management.queueRender=queueRender$$module$build$src$core$render_management;module$build$src$core$render_management.triggerQueuedRenders=triggerQueuedRenders$$module$build$src$core$render_management;var setLocale$$module$build$src$core$msg,module$build$src$core$msg;$.Msg$$module$build$src$core$msg=Object.create(null);setLocale$$module$build$src$core$msg=function(a){Object.keys(a).forEach(function(b){$.Msg$$module$build$src$core$msg[b]=a[b]})};module$build$src$core$msg={Msg:$.Msg$$module$build$src$core$msg,setLocale:setLocale$$module$build$src$core$msg};var CLASS_NAME$$module$build$src$core$toast="blocklyToast",MESSAGE_CLASS_NAME$$module$build$src$core$toast="blocklyToastMessage",CLOSE_BUTTON_CLASS_NAME$$module$build$src$core$toast="blocklyToastCloseButton",Toast$$module$build$src$core$toast=class{static show(a,b){if(b.oncePerSession&&b.id){if(this.shownIds.has(b.id))return;this.shownIds.add(b.id)}this.hide(a);const c=this.createDom(a,b);requestAnimationFrame(()=>{c.style.bottom="2rem"})}static createDom(a,b){const {message:c,duration:d=5,assertiveness:e=
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
{x:
|
|
686
|
-
|
|
736
|
+
LiveRegionAssertiveness$$module$build$src$core$utils$aria.POLITE}=b,f=document.createElement("div");a.getInjectionDiv().appendChild(f);f.dataset.toastId=b.id;f.className=CLASS_NAME$$module$build$src$core$toast;b=f.appendChild(document.createElement("div"));b.className=MESSAGE_CLASS_NAME$$module$build$src$core$toast;b.innerText=c;b=f.appendChild(document.createElement("button"));b.className=CLOSE_BUTTON_CLASS_NAME$$module$build$src$core$toast;setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,
|
|
737
|
+
$.Msg$$module$build$src$core$msg.CLOSE);var g=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{width:24,height:24,viewBox:"0 0 24 24",fill:"none"},b);setState$$module$build$src$core$utils$aria(g,State$$module$build$src$core$utils$aria.HIDDEN,!0);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{x:19.7782,y:2.80762,width:2,height:24,transform:"rotate(45, 19.7782, 2.80762)",fill:"black"},g);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
738
|
+
{x:2.80762,y:4.22183,width:2,height:24,transform:"rotate(-45, 2.80762, 4.22183)",fill:"black"},g);b.addEventListener("click",()=>{f.remove();a.markFocused()});let h;b=()=>{h=setTimeout(()=>f.remove(),d*1E3)};g=()=>clearTimeout(h);f.addEventListener("focusin",g);f.addEventListener("focusout",b);f.addEventListener("mouseenter",g);f.addEventListener("mousemove",g);f.addEventListener("mouseleave",b);b();announceDynamicAriaState$$module$build$src$core$utils$aria(c,{assertiveness:e,role:Role$$module$build$src$core$utils$aria.STATUS});
|
|
739
|
+
return f}static hide(a,b){a=a.getInjectionDiv().querySelector(`.${CLASS_NAME$$module$build$src$core$toast}`);a instanceof HTMLElement&&(!b||b===a.dataset.toastId)&&a.remove()}};Toast$$module$build$src$core$toast.shownIds=new Set;register$$module$build$src$core$css(`
|
|
687
740
|
.${CLASS_NAME$$module$build$src$core$toast} {
|
|
688
741
|
font-size: 1.2rem;
|
|
689
742
|
position: absolute;
|
|
@@ -716,7 +769,7 @@ g);f.addEventListener("mousemove",g);f.addEventListener("mouseleave",b);b();retu
|
|
|
716
769
|
}
|
|
717
770
|
`);var module$build$src$core$toast={};module$build$src$core$toast.Toast=Toast$$module$build$src$core$toast;var defaultAlert$$module$build$src$core$dialog=function(a,b){window.alert(a);b&&b()},alertImplementation$$module$build$src$core$dialog=defaultAlert$$module$build$src$core$dialog,defaultConfirm$$module$build$src$core$dialog=function(a,b){b(window.confirm(a))},confirmImplementation$$module$build$src$core$dialog=defaultConfirm$$module$build$src$core$dialog,defaultPrompt$$module$build$src$core$dialog=function(a,b,c){c(window.prompt(a,b))},promptImplementation$$module$build$src$core$dialog=defaultPrompt$$module$build$src$core$dialog,
|
|
718
771
|
defaultToast$$module$build$src$core$dialog=Toast$$module$build$src$core$toast.show.bind(Toast$$module$build$src$core$toast),toastImplementation$$module$build$src$core$dialog=defaultToast$$module$build$src$core$dialog,module$build$src$core$dialog={};module$build$src$core$dialog.alert=alert$$module$build$src$core$dialog;module$build$src$core$dialog.confirm=confirm$$module$build$src$core$dialog;module$build$src$core$dialog.prompt=prompt$$module$build$src$core$dialog;
|
|
719
|
-
module$build$src$core$dialog.setAlert=setAlert$$module$build$src$core$dialog;module$build$src$core$dialog.setConfirm=setConfirm$$module$build$src$core$dialog;module$build$src$core$dialog.setPrompt=setPrompt$$module$build$src$core$dialog;module$build$src$core$dialog.setToast=setToast$$module$build$src$core$dialog;module$build$src$core$dialog.toast=toast$$module$build$src$core$dialog;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 previousWarnings$$module$build$src$core$utils$deprecation=new Set,module$build$src$core$utils$deprecation={};module$build$src$core$utils$deprecation.warn
|
|
772
|
+
module$build$src$core$dialog.setAlert=setAlert$$module$build$src$core$dialog;module$build$src$core$dialog.setConfirm=setConfirm$$module$build$src$core$dialog;module$build$src$core$dialog.setPrompt=setPrompt$$module$build$src$core$dialog;module$build$src$core$dialog.setToast=setToast$$module$build$src$core$dialog;module$build$src$core$dialog.toast=toast$$module$build$src$core$dialog;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 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};
|
|
720
773
|
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;
|
|
721
774
|
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;
|
|
722
775
|
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;
|
|
@@ -724,7 +777,7 @@ module$build$src$core$variables.jsonFlyoutCategoryBlocks=jsonFlyoutCategoryBlock
|
|
|
724
777
|
b,c){super(`The block ${b.toDevString()} is missing a(n) ${a}
|
|
725
778
|
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
|
|
726
779
|
${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,
|
|
727
|
-
b,c){super(`Cannot add an icon of type '${a}' to the block ${b.toDevString()}, because there is no icon registered with type '${a}'. Make sure that all of your icons have been
|
|
780
|
+
b,c){super(`Cannot add an icon of type '${a}' to the block ${b.toDevString()}, because there is no icon registered with type '${a}'. Make sure that all of your icons have been registered.`);this.block=b;this.state=c}},module$build$src$core$serialization$exceptions={};module$build$src$core$serialization$exceptions.BadConnectionCheck=BadConnectionCheck$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.DeserializationError=DeserializationError$$module$build$src$core$serialization$exceptions;
|
|
728
781
|
module$build$src$core$serialization$exceptions.MissingBlockType=MissingBlockType$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.MissingConnection=MissingConnection$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.RealChildOfShadow=RealChildOfShadow$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.UnregisteredIcon=UnregisteredIcon$$module$build$src$core$serialization$exceptions;var saveBlock$$module$build$src$core$serialization$blocks=save$$module$build$src$core$serialization$blocks,BlockSerializer$$module$build$src$core$serialization$blocks=class{constructor(){this.priority=BLOCKS$$module$build$src$core$serialization$priorities}save(a){const b=[];for(const c of a.getTopBlocks(!1))(a=save$$module$build$src$core$serialization$blocks(c,{addCoordinates:!0,doFullSerialization:!1}))&&b.push(a);return b.length?{languageVersion:0,blocks:b}:null}load(a,b){a=a.blocks;for(const c of a)append$$module$build$src$core$serialization$blocks(c,
|
|
729
782
|
b,{recordUndo:getRecordUndo$$module$build$src$core$events$utils()})}clear(a){for(const b of a.getTopBlocks(!1))b.dispose(!1)}};register$$module$build$src$core$serialization$registry("blocks",new BlockSerializer$$module$build$src$core$serialization$blocks);var module$build$src$core$serialization$blocks={};module$build$src$core$serialization$blocks.BlockSerializer=BlockSerializer$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.append=append$$module$build$src$core$serialization$blocks;
|
|
730
783
|
module$build$src$core$serialization$blocks.appendInternal=appendInternal$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.save=save$$module$build$src$core$serialization$blocks;var IconType$$module$build$src$core$icons$icon_types=class{constructor(a){this.name=a}toString(){return this.name}equals(a){return this.name===a.toString()}};IconType$$module$build$src$core$icons$icon_types.MUTATOR=new IconType$$module$build$src$core$icons$icon_types("mutator");IconType$$module$build$src$core$icons$icon_types.WARNING=new IconType$$module$build$src$core$icons$icon_types("warning");IconType$$module$build$src$core$icons$icon_types.COMMENT=new IconType$$module$build$src$core$icons$icon_types("comment");
|
|
@@ -746,17 +799,18 @@ module$build$src$core$dropdowndiv.showPositionedByBlock=showPositionedByBlock$$m
|
|
|
746
799
|
module$build$src$core$tooltip.bindMouseEvents=bindMouseEvents$$module$build$src$core$tooltip;module$build$src$core$tooltip.block=block$$module$build$src$core$tooltip;module$build$src$core$tooltip.createDom=createDom$$module$build$src$core$tooltip;module$build$src$core$tooltip.dispose=dispose$$module$build$src$core$tooltip;module$build$src$core$tooltip.getCustomTooltip=getCustomTooltip$$module$build$src$core$tooltip;module$build$src$core$tooltip.getDiv=getDiv$$module$build$src$core$tooltip;
|
|
747
800
|
module$build$src$core$tooltip.getTooltipOfObject=getTooltipOfObject$$module$build$src$core$tooltip;module$build$src$core$tooltip.hide=hide$$module$build$src$core$tooltip;module$build$src$core$tooltip.isVisible=isVisible$$module$build$src$core$tooltip;module$build$src$core$tooltip.setCustomTooltip=setCustomTooltip$$module$build$src$core$tooltip;module$build$src$core$tooltip.unbindMouseEvents=unbindMouseEvents$$module$build$src$core$tooltip;module$build$src$core$tooltip.unblock=unblock$$module$build$src$core$tooltip;var hsvSaturation$$module$build$src$core$utils$colour=.45,hsvValue$$module$build$src$core$utils$colour=.65,names$$module$build$src$core$utils$colour={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},module$build$src$core$utils$colour={};module$build$src$core$utils$colour.blend=blend$$module$build$src$core$utils$colour;
|
|
748
801
|
module$build$src$core$utils$colour.getHsvSaturation=getHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.getHsvValue=getHsvValue$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hexToRgb=hexToRgb$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hsvToHex=hsvToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hueToHex=hueToHex$$module$build$src$core$utils$colour;
|
|
749
|
-
module$build$src$core$utils$colour.names=names$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.parse=parse$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.rgbToHex=rgbToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvSaturation=setHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvValue=setHsvValue$$module$build$src$core$utils$colour;var module$build$src$core$utils$parsing={};module$build$src$core$utils$parsing.checkMessageReferences=checkMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.parseBlockColour=parseBlockColour$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.replaceMessageReferences=replaceMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.tokenizeInterpolation=tokenizeInterpolation$$module$build$src$core$utils$parsing;var Field$$module$build$src$core$field=class{get size_(){return this.size}set size_(a){this.size=a}constructor(a,b,c){this.DEFAULT_VALUE=null;this.name=void 0;this.tooltip=this.validator_=null;this.size=new Size$$module$build$src$core$utils$size(0,0);this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=null;this.disposed=!1;this.maxDisplayLength=50;this.sourceBlock_=null;this.enabled_=this.visible_=this.isDirty_=!0;this.suffixField=
|
|
750
|
-
this.clickTarget_=null;this.EDITABLE=!0;this.SERIALIZABLE=!1;this.id_=null;this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE;this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){a.tooltip&&this.setTooltip(replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip))
|
|
751
|
-
this.sourceBlock_=a;if(a.id.includes("_field"))throw Error(
|
|
752
|
-
this.
|
|
753
|
-
|
|
754
|
-
{
|
|
755
|
-
this,this.
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
a
|
|
802
|
+
module$build$src$core$utils$colour.names=names$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.parse=parse$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.rgbToHex=rgbToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvSaturation=setHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvValue=setHsvValue$$module$build$src$core$utils$colour;var module$build$src$core$utils$parsing={};module$build$src$core$utils$parsing.checkMessageReferences=checkMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.parseBlockColour=parseBlockColour$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.replaceMessageReferences=replaceMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.tokenizeInterpolation=tokenizeInterpolation$$module$build$src$core$utils$parsing;var Field$$module$build$src$core$field=class{get size_(){return this.size}set size_(a){this.size=a}constructor(a,b,c){this.DEFAULT_VALUE=null;this.name=void 0;this.tooltip=this.ariaTypeName=this.validator_=null;this.size=new Size$$module$build$src$core$utils$size(0,0);this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=null;this.disposed=!1;this.maxDisplayLength=50;this.sourceBlock_=null;this.enabled_=this.visible_=this.isDirty_=!0;this.suffixField=
|
|
803
|
+
this.prefixField=this.clickTarget_=null;this.EDITABLE=!0;this.SERIALIZABLE=!1;this.id_=null;this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE;this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){a.tooltip&&this.setTooltip(replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip));a.ariaTypeName&&
|
|
804
|
+
(this.ariaTypeName=a.ariaTypeName)}setSourceBlock(a){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=a;if(a.id.includes("_field"))throw Error(`Field ID indicator is contained in block ID. This may cause problems with focus: ${a.id}.`);this.id_=`${a.id}_field_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}getConstants(){!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=
|
|
805
|
+
this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_}getSourceBlock(){return this.sourceBlock_}getAriaTypeName(){return this.ariaTypeName}getAriaValue(){const a=this.getValue();return a===null||a===void 0?null:String(a)}computeAriaLabel(a=!1){a=a?this.getAriaTypeName():null;const b=this.getAriaValue();if(!a&&!b)return"";if(a&&b)return`${a}: ${b}`;let c;return(c=a!=null?a:b)!=null?c:""}init(){if(!this.fieldGroup_){var a=this.id_;if(!a)throw Error("Expected ID to be defined prior to init.");
|
|
806
|
+
this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{id:a});this.isVisible()||(this.fieldGroup_.style.display="none");this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_);this.initView();this.updateEditable();this.setTooltip(this.tooltip);this.bindEvents_();this.initModel();this.applyColour()}}initView(){this.createBorderRect_();this.createTextElement_();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField")}initModel(){}isFullBlockField(){return!this.borderRect_}createBorderRect_(){this.borderRect_=
|
|
807
|
+
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyFieldText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&
|
|
808
|
+
this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}bindEvents_(){const a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");bindMouseEvents$$module$build$src$core$tooltip(a);this.mouseDownWrapper=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown_)}fromXml(a){this.setValue(a.textContent)}toXml(a){a.textContent=this.getValue();
|
|
809
|
+
return a}saveState(a){a=this.saveLegacyState(Field$$module$build$src$core$field);return a!==null?a:this.getValue()}loadState(a){this.loadLegacyState(Field$$module$build$src$core$field,a)||this.setValue(a)}saveLegacyState(a){return a.prototype.saveState===this.saveState&&a.prototype.toXml!==this.toXml?(a=$.createElement$$module$build$src$core$utils$xml("field"),a.setAttribute("name",this.name||""),domToText$$module$build$src$core$utils$xml(this.toXml(a)).replace(' xmlns="https://developers.google.com/blockly/xml"',
|
|
810
|
+
"")):null}loadLegacyState(a,b){return a.prototype.loadState===this.loadState&&a.prototype.fromXml!==this.fromXml?(this.fromXml($.textToDom$$module$build$src$core$utils$xml(b)),!0):!1}dispose(){hideIfOwner$$module$build$src$core$dropdowndiv(this);hideIfOwner$$module$build$src$core$widgetdiv(this);let a;((a=this.getSourceBlock())==null?0:a.isDeadOrDying())||removeNode$$module$build$src$core$utils$dom(this.fieldGroup_);this.disposed=!0}updateEditable(){const a=this.fieldGroup_,b=this.getSourceBlock();
|
|
811
|
+
this.EDITABLE&&a&&b&&(this.enabled_&&b.isEditable()?(addClass$$module$build$src$core$utils$dom(a,"blocklyEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField")):(addClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyEditableField")))}setEnabled(a){this.enabled_=a;this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&
|
|
812
|
+
this.showEditor_!==Field$$module$build$src$core$field.prototype.showEditor_}isClickableInFlyout(a){return!a}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let a=!1;this.name&&(this.SERIALIZABLE?a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),a=!0));return a}isVisible(){return this.visible_}setVisible(a){if(this.visible_!==
|
|
813
|
+
a){this.visible_=a;var b=this.fieldGroup_;b&&(b.style.display=a?"block":"none")}}setValidator(a){this.validator_=a}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);
|
|
760
814
|
return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}repositionForWindowResize(){return!1}updateSize_(a){const b=this.getConstants();a=a!==void 0?a:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let c=a*2,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getTextWidth$$module$build$src$core$utils$dom(this.textElement_),
|
|
761
815
|
c+=e);this.isFullBlockField()||(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_=new Size$$module$build$src$core$utils$size(c,d);this.positionTextElement_(a,e);this.positionBorderRect_()}positionTextElement_(a,b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2,e;this.textElement_.setAttribute("x",String(((e=this.getSourceBlock())==null?0:e.RTL)?this.size_.width-b-a:a));this.textElement_.setAttribute("y",String(c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&
|
|
762
816
|
(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){if(!this.isVisible())return new Size$$module$build$src$core$utils$size(0,0);this.isDirty_&&(this.render_(),this.isDirty_=!1);return this.size_}getScaledBBox(){let a;var b=this.getSourceBlock();
|
|
@@ -766,24 +820,24 @@ this.sourceBlock_.queueRender()}setValue(a,b=!0){if(a!==null){var c=$.getGroup$$
|
|
|
766
820
|
b&&g&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(g,"field",this.name||null,h,f)),this.isDirty_&&this.forceRerender())}}}}finally{$.setGroup$$module$build$src$core$events$utils(c)}}}processValidation(a,b,c){return b===null?(this.doValueInvalid_(a,c),this.isDirty_&&this.forceRerender(),Error()):b===void 0?a:b}getValue(){return this.value_}doClassValidation_(a){return a===
|
|
767
821
|
null||a===void 0?null:a}doValueUpdate_(a){this.value_=a;this.isDirty_=!0}doValueInvalid_(a,b){}onMouseDown_(a){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)}setTooltip(a){a||a===""||(a=this.sourceBlock_);const b=this.getClickTarget_();b?b.tooltip=a:this.tooltip=a}getTooltip(){const a=this.getClickTarget_();return a?getTooltipOfObject$$module$build$src$core$tooltip(a):getTooltipOfObject$$module$build$src$core$tooltip({tooltip:this.tooltip})}getClickTarget_(){return this.clickTarget_||
|
|
768
822
|
this.getSvgRoot()}getAbsoluteXY_(){return getPageOffset$$module$build$src$core$utils$style(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let a=null;const b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;const c=b.inputList;for(let d=0;d<b.inputList.length;d++){const e=c[d],f=e.fieldRow;for(let g=0;g<f.length;g++)if(f[g]===this){a=e;break}}return a}getFlipRtl(){return!1}onShortcut(a){return!1}getFocusableElement(){if(!this.fieldGroup_)throw Error("This field currently has no representative DOM element.");
|
|
769
|
-
return this.fieldGroup_}getFocusableTree(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return a.workspace}onNodeFocus(){const a=this.getSourceBlock();a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren())}onNodeBlur(){}canBeFocused(){return!0}static fromJson(a){throw Error("Attempted to instantiate a field from the registry that hasn't defined a 'fromJson' method.");}};
|
|
770
|
-
Field$$module$build$src$core$field.SKIP_SETUP=Symbol("SKIP_SETUP");var UnattachedFieldError$$module$build$src$core$field=class extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}},module$build$src$core$field={};module$build$src$core$field.Field=Field$$module$build$src$core$field;module$build$src$core$field.UnattachedFieldError=UnattachedFieldError$$module$build$src$core$field;var owner$$module$build$src$core$widgetdiv=null,ownerWorkspace$$module$build$src$core$widgetdiv=null,dispose$$module$build$src$core$widgetdiv=null,containerClassName$$module$build$src$core$widgetdiv="blocklyWidgetDiv",rendererClassName$$module$build$src$core$widgetdiv="",themeClassName$$module$build$src$core$widgetdiv="",containerDiv$$module$build$src$core$widgetdiv,returnEphemeralFocus$$module$build$src$core$widgetdiv=null,module$build$src$core$widgetdiv={};
|
|
823
|
+
return this.fieldGroup_}getFocusableTree(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return a.workspace}onNodeFocus(){const a=this.getSourceBlock();a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren())}onNodeBlur(){}canBeFocused(){return!0}performAction(){this.showEditor()}static fromJson(a){throw Error("Attempted to instantiate a field from the registry that hasn't defined a 'fromJson' method.");}};
|
|
824
|
+
Field$$module$build$src$core$field.NBSP="\u00a0";Field$$module$build$src$core$field.SKIP_SETUP=Symbol("SKIP_SETUP");var UnattachedFieldError$$module$build$src$core$field=class extends Error{constructor(){super("The field has not yet been attached to its input. Call appendField to attach it.")}},module$build$src$core$field={};module$build$src$core$field.Field=Field$$module$build$src$core$field;module$build$src$core$field.UnattachedFieldError=UnattachedFieldError$$module$build$src$core$field;var owner$$module$build$src$core$widgetdiv=null,ownerWorkspace$$module$build$src$core$widgetdiv=null,dispose$$module$build$src$core$widgetdiv=null,containerClassName$$module$build$src$core$widgetdiv="blocklyWidgetDiv",rendererClassName$$module$build$src$core$widgetdiv="",themeClassName$$module$build$src$core$widgetdiv="",containerDiv$$module$build$src$core$widgetdiv,returnEphemeralFocus$$module$build$src$core$widgetdiv=null,module$build$src$core$widgetdiv={};
|
|
771
825
|
module$build$src$core$widgetdiv.createDom=createDom$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.getDiv=getDiv$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hide=hide$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwner=hideIfOwner$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwnerIsInWorkspace=hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.isVisible=isVisible$$module$build$src$core$widgetdiv;
|
|
772
826
|
module$build$src$core$widgetdiv.positionWithAnchor=positionWithAnchor$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.show=show$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.testOnly_setDiv=testOnly_setDiv$$module$build$src$core$widgetdiv;var currentBlock$$module$build$src$core$contextmenu=null,dummyOwner$$module$build$src$core$contextmenu={},menu_$$module$build$src$core$contextmenu=null,module$build$src$core$contextmenu={};module$build$src$core$contextmenu.callbackFactory=$.callbackFactory$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.dispose=dispose$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.getCurrentBlock=getCurrentBlock$$module$build$src$core$contextmenu;
|
|
773
827
|
module$build$src$core$contextmenu.getMenu=getMenu$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.hide=hide$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.setCurrentBlock=setCurrentBlock$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.show=show$$module$build$src$core$contextmenu;var ContextMenuRegistry$$module$build$src$core$contextmenu_registry=class{constructor(){this.registeredItems=new Map;this.reset()}reset(){this.registeredItems.clear()}register(a){if(this.registeredItems.has(a.id))throw Error('Menu item with ID "'+a.id+'" is already registered.');this.registeredItems.set(a.id,a)}unregister(a){if(!this.registeredItems.has(a))throw Error('Menu item with ID "'+a+'" not found.');this.registeredItems.delete(a)}getItem(a){let b;return(b=this.registeredItems.get(a))!=null?
|
|
774
828
|
b:null}getContextMenuOptions(a,b){const c=[];for(const d of this.registeredItems.values()){if(d.scopeType){if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.BLOCK&&!a.block)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.COMMENT&&!a.comment)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.WORKSPACE&&!a.workspace)continue}let e;e={scope:a,weight:d.weight};let f,g;const h=(g=(f=d).preconditionFn)==null?void 0:g.call(f,
|
|
775
829
|
a,b);if(h!=="hidden"){if(d.separator)e=Object.assign({},e,{separator:!0});else{const k=typeof d.displayText==="function"?d.displayText(a):d.displayText;e=Object.assign({},e,{text:k,callback:d.callback,enabled:h==="enabled"})}c.push(e)}}c.sort(function(d,e){return d.weight-e.weight});return c}};
|
|
776
830
|
(function(a){var b=a.ScopeType||(a.ScopeType={});b.BLOCK="block";b.WORKSPACE="workspace";b.COMMENT="comment";a.registry=new a})(ContextMenuRegistry$$module$build$src$core$contextmenu_registry||(ContextMenuRegistry$$module$build$src$core$contextmenu_registry={}));var ScopeType$$module$build$src$core$contextmenu_registry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType,module$build$src$core$contextmenu_registry={};
|
|
777
|
-
module$build$src$core$contextmenu_registry.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$contextmenu_registry.ScopeType=ScopeType$$module$build$src$core$contextmenu_registry;var BLOCK$$module$build$src$core$layers=50,BUBBLE$$module$build$src$core$layers=100,module$build$src$core$layers={BLOCK:BLOCK$$module$build$src$core$layers,BUBBLE:BUBBLE$$module$build$src$core$layers};var CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy=class{constructor(a){this.comment=a;this.startLoc=null;this.workspace=a.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.comment.isDeadOrDying()&&!this.workspace.isReadOnly()}startDrag(){this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.comment);this.comment.setDragging(!0)
|
|
778
|
-
this.fireMoveEvent();let a;(a=this.workspace.getLayerManager())==null||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!0);fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=
|
|
779
|
-
|
|
780
|
-
module$build$src$core$dragging$comment_drag_strategy.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;var workspaceToDragDelta$$module$build$src$core$utils$drag=new WeakMap,module$build$src$core$utils$drag={};module$build$src$core$utils$drag.move=move$$module$build$src$core$utils$drag;module$build$src$core$utils$drag.start=start$$module$build$src$core$utils$drag;var CommentBarButton$$module$build$src$core$comments$comment_bar_button=class{constructor(a,b,c,d){this.id=a;this.workspace=b;this.container=c;this.commentView=d}isVisible(){return this.icon.checkVisibility()}getCommentView(){return this.commentView}getSize(a=!1){var b=this.icon.getBBox();b=Rect$$module$build$src$core$utils$rect.from(b);a&&(a=this.getMargin(),b.left-=a,b.top-=a,b.bottom+=a,b.right+=a);return b}getMargin(){return(this.container.getBBox().height-this.icon.getBBox().height)/2}getFocusableElement(){return this.icon}getFocusableTree(){return this.workspace}onNodeFocus(){const a=
|
|
831
|
+
module$build$src$core$contextmenu_registry.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$contextmenu_registry.ScopeType=ScopeType$$module$build$src$core$contextmenu_registry;var BLOCK$$module$build$src$core$layers=50,BUBBLE$$module$build$src$core$layers=100,module$build$src$core$layers={BLOCK:BLOCK$$module$build$src$core$layers,BUBBLE:BUBBLE$$module$build$src$core$layers};var CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy=class{constructor(a){this.comment=a;this.startLoc=null;this.workspace=a.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.comment.isDeadOrDying()&&!this.workspace.isReadOnly()}startDrag(){this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.comment);this.comment.setDragging(!0);
|
|
832
|
+
return this.comment}drag(a){this.comment.moveDuringDrag(a)}endDrag(){this.fireDragEndEvent();this.fireMoveEvent();let a;(a=this.workspace.getLayerManager())==null||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!0);fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=
|
|
833
|
+
new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!1);fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.comment.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this.comment);a.setReason(["drag"]);a.oldCoordinate_=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}revertDrag(){this.startLoc&&this.comment.moveDuringDrag(this.startLoc)}},
|
|
834
|
+
module$build$src$core$dragging$comment_drag_strategy={};module$build$src$core$dragging$comment_drag_strategy.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;var workspaceToDragDelta$$module$build$src$core$utils$drag=new WeakMap,module$build$src$core$utils$drag={};module$build$src$core$utils$drag.move=move$$module$build$src$core$utils$drag;module$build$src$core$utils$drag.start=start$$module$build$src$core$utils$drag;var CommentBarButton$$module$build$src$core$comments$comment_bar_button=class{constructor(a,b,c,d){this.id=a;this.workspace=b;this.container=c;this.commentView=d}isVisible(){return this.icon.checkVisibility()}getCommentView(){return this.commentView}getSize(a=!1){var b=this.icon.getBBox();b=Rect$$module$build$src$core$utils$rect.from(b);a&&(a=this.getMargin(),b.left-=a,b.top-=a,b.bottom+=a,b.right+=a);return b}getMargin(){return(this.container.getBBox().height-this.icon.getBBox().height)/2}getFocusableElement(){return this.icon}getFocusableTree(){return this.workspace}onNodeFocus(){const a=
|
|
781
835
|
this.getCommentView();var b=a.getRelativeToSurfaceXY();const c=a.getSize();b=new Rect$$module$build$src$core$utils$rect(b.y,b.y+c.height,b.x,b.x+c.width);a.workspace.scrollBoundsIntoView(b)}onNodeBlur(){}canBeFocused(){return this.isVisible()}},module$build$src$core$comments$comment_bar_button={};module$build$src$core$comments$comment_bar_button.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;var COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button="_collapse_bar_button",CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button=class extends CommentBarButton$$module$build$src$core$comments$comment_bar_button{constructor(a,b,c,d){super(a,b,c,d);this.id=a;this.workspace=b;this.container=c;this.commentView=d;this.icon=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
|
|
782
836
|
{"class":"blocklyFoldoutIcon",href:`${this.workspace.options.pathToMedia}foldout-icon.svg`,id:`${this.id}${COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button}`},this.container);this.bindId=conditionalBind$$module$build$src$core$browser_events(this.icon,"pointerdown",this,this.performAction.bind(this))}dispose(){unbind$$module$build$src$core$browser_events(this.bindId)}reposition(){const a=this.getMargin();this.icon.setAttribute("y",`${a}`);this.icon.setAttribute("x",
|
|
783
837
|
`${a}`)}performAction(a){clearTouchIdentifier$$module$build$src$core$touch();this.getCommentView().bringToFront();a&&a instanceof PointerEvent&&isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.getCommentView().setCollapsed(!this.getCommentView().isCollapsed()),this.workspace.hideChaff(),a==null||a.stopPropagation())}},module$build$src$core$comments$collapse_comment_bar_button={COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER:COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button};
|
|
784
838
|
module$build$src$core$comments$collapse_comment_bar_button.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;var COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor="_comment_textarea_",CommentEditor$$module$build$src$core$comments$comment_editor=class{constructor(a,b,c){this.workspace=a;this.onFinishEditing=c;this.textChangeListeners=[];this.text="";this.foreignObject=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{"class":"blocklyCommentForeignObject"});a=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");
|
|
785
839
|
a.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);a.className="blocklyMinimalBody";this.textArea=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");this.textArea.setAttribute("tabindex","-1");this.textArea.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");this.textArea.setAttribute("placeholder",$.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT);addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(this.textArea,
|
|
786
|
-
"blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);
|
|
840
|
+
"blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);this.id=b+COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor;this.textArea.setAttribute("id",this.id);conditionalBind$$module$build$src$core$browser_events(this.textArea,"change",this,this.onTextChange);conditionalBind$$module$build$src$core$browser_events(this.textArea,"pointerdown",this,d=>{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);
|
|
787
841
|
clearTouchIdentifier$$module$build$src$core$touch()});conditionalBind$$module$build$src$core$browser_events(this.textArea,"wheel",this,d=>{d.stopPropagation()},!1,{passive:!0});conditionalBind$$module$build$src$core$browser_events(this.textArea,"keydown",this,this.handleKeyDown)}getDom(){return this.foreignObject}getText(){return this.text}setText(a){this.textArea.value=a;this.onTextChange()}onTextChange(){const a=this.text;this.text=this.textArea.value;for(let b=this.textChangeListeners.length-1;b>=
|
|
788
842
|
0;b--)this.textChangeListeners[b](a,this.text)}handleKeyDown(a){if(a.key==="Escape"||a.key==="Enter"&&(a.ctrlKey||a.metaKey)){if(this.onFinishEditing)this.onFinishEditing();a.stopPropagation()}}addTextChangeListener(a){this.textChangeListeners.push(a)}removeTextChangeListener(a){this.textChangeListeners.splice(this.textChangeListeners.indexOf(a),1)}setPlaceholderText(a){this.textArea.placeholder=a}setEditable(a){a?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","true")}updateSize(a,
|
|
789
843
|
b){this.foreignObject.setAttribute("height",`${a.height-b.height}`);this.foreignObject.setAttribute("width",`${a.width}`);this.foreignObject.setAttribute("y",`${b.height}`);this.workspace.RTL&&this.foreignObject.setAttribute("x",`${-a.width}`)}getFocusableElement(){return this.textArea}getFocusableTree(){return this.workspace}onNodeFocus(){const a=Rect$$module$build$src$core$utils$rect.from(this.foreignObject.getBoundingClientRect());this.workspace.scrollBoundsIntoView(Rect$$module$build$src$core$utils$rect.createFromPoint(screenToWsCoordinates$$module$build$src$core$utils$svg_math(this.workspace,
|
|
@@ -811,22 +865,21 @@ var module$build$src$core$comments$comment_view={};module$build$src$core$comment
|
|
|
811
865
|
fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CREATE))(this))}fireDeleteEvent(){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DELETE))(this))}fireChangeEvent(a,b){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CHANGE))(this,
|
|
812
866
|
a,b))}fireCollapseEvent(a){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE))(this,a))}setText(a){const b=this.text;this.text=a;this.fireChangeEvent(b,a)}getText(){return this.text}setSize(a){const b=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_RESIZE))(this);this.size=a;b.recordCurrentSizeAsNewSize();
|
|
813
867
|
fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=a;this.fireCollapseEvent(a)}isCollapsed(){return this.collapsed}setEditable(a){this.editable=a}isEditable(){return this.isOwnEditable()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&
|
|
814
|
-
!this.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||
|
|
868
|
+
!this.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location.clone()}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||
|
|
815
869
|
this.disposed}},module$build$src$core$comments$workspace_comment={};module$build$src$core$comments$workspace_comment.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment=class extends WorkspaceComment$$module$build$src$core$comments$workspace_comment{constructor(a,b){super(a,b);this.dragStrategy=new CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy(this);this.workspace=a;this.view=new CommentView$$module$build$src$core$comments$comment_view(a,this.id);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());this.view.getSvgRoot().setAttribute("data-id",
|
|
816
870
|
this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.addModelUpdateBindings();conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"pointerdown",this,this.startGesture)}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(a){this.view.setText(a)}setPlaceholderText(a){this.view.setPlaceholderText(a)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a);
|
|
817
871
|
this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=this.getRelativeToSurfaceXY();var b,c;const d=(c=(b=this.view)==null?void 0:b.getSize())!=null?c:this.getSize();this.workspace.RTL?(b=a.x-d.width,c=a.x):(b=a.x,c=a.x+d.width);return new Rect$$module$build$src$core$utils$rect(a.y,a.y+d.height,b,c)}moveBy(a,b,c){const d=this.getRelativeToSurfaceXY();a=new Coordinate$$module$build$src$core$utils$coordinate(d.x+
|
|
818
872
|
a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}moveDuringDrag(a){this.location=a;this.view.moveTo(a)}setDragging(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()||
|
|
819
|
-
this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isCopyable(){return this.isOwnMovable()&&this.isOwnDeletable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
873
|
+
this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isCopyable(){return this.isOwnMovable()&&this.isOwnDeletable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(){return this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
|
|
820
874
|
"blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0,saveIds:!1})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,
|
|
821
875
|
focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,
|
|
822
|
-
["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;(a=this.getSvgRoot().parentElement)==null||a.appendChild(this.getSvgRoot());this.workspace.scrollBoundsIntoView(this.getBoundingRectangle())}onNodeBlur(){this.unselect()}canBeFocused(){return!0}
|
|
823
|
-
module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
|
|
876
|
+
["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;(a=this.getSvgRoot().parentElement)==null||a.appendChild(this.getSvgRoot());this.workspace.scrollBoundsIntoView(this.getBoundingRectangle())}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(){this.setCollapsed(!1);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.getEditorFocusableNode())}},
|
|
877
|
+
module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
|
|
824
878
|
module$build$src$core$xml.domToBlock=$.domToBlock$$module$build$src$core$xml;module$build$src$core$xml.domToBlockInternal=domToBlockInternal$$module$build$src$core$xml;module$build$src$core$xml.domToPrettyText=domToPrettyText$$module$build$src$core$xml;module$build$src$core$xml.domToText=domToText$$module$build$src$core$xml;module$build$src$core$xml.domToVariables=domToVariables$$module$build$src$core$xml;module$build$src$core$xml.domToWorkspace=$.domToWorkspace$$module$build$src$core$xml;
|
|
825
|
-
module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.
|
|
826
|
-
if(!this.
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CREATE,BlockCreate$$module$build$src$core$events$events_block_create);var module$build$src$core$events$events_block_create={};module$build$src$core$events$events_block_create.BlockCreate=BlockCreate$$module$build$src$core$events$events_block_create;var ThemeChange$$module$build$src$core$events$events_theme_change=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(b);this.type=EventType$$module$build$src$core$events$type.THEME_CHANGE;this.themeName=a}toJson(){const a=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");a.themeName=this.themeName;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,
|
|
879
|
+
module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.ids=getDescendantIds$$module$build$src$core$events$utils(a),this.json=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");
|
|
880
|
+
if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.fromJson(a,b,c!=null?c:new BlockCreate$$module$build$src$core$events$events_block_create);b.ids=a.ids;b.json=a.json;a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();
|
|
881
|
+
if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!allShadowBlocks$$module$build$src$core$events$events_block_create(b,this.ids))if(a)append$$module$build$src$core$serialization$blocks(this.json,b);else for(a=0;a<this.ids.length;a++){const c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't uncreate non-existent block: "+
|
|
882
|
+
c)}}},allShadowBlocks$$module$build$src$core$events$events_block_create=function(a,b){return b.map(c=>a.getBlockById(c)).filter(c=>c&&c.isShadow()).length===b.length};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CREATE,BlockCreate$$module$build$src$core$events$events_block_create);var module$build$src$core$events$events_block_create={};module$build$src$core$events$events_block_create.BlockCreate=BlockCreate$$module$build$src$core$events$events_block_create;var ThemeChange$$module$build$src$core$events$events_theme_change=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(b);this.type=EventType$$module$build$src$core$events$type.THEME_CHANGE;this.themeName=a}toJson(){const a=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");a.themeName=this.themeName;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,
|
|
830
883
|
b,c!=null?c:new ThemeChange$$module$build$src$core$events$events_theme_change);b.themeName=a.themeName;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.THEME_CHANGE,ThemeChange$$module$build$src$core$events$events_theme_change);var module$build$src$core$events$events_theme_change={};module$build$src$core$events$events_theme_change.ThemeChange=ThemeChange$$module$build$src$core$events$events_theme_change;var ViewportChange$$module$build$src$core$events$events_viewport=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c,d,e){super(d);this.type=EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE;this.viewTop=a;this.viewLeft=b;this.scale=c;this.oldScale=e}toJson(){const a=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");
|
|
831
884
|
if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");a.viewTop=this.viewTop;a.viewLeft=this.viewLeft;a.scale=this.scale;a.oldScale=this.oldScale;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new ViewportChange$$module$build$src$core$events$events_viewport);
|
|
832
885
|
b.viewTop=a.viewTop;b.viewLeft=a.viewLeft;b.scale=a.scale;b.oldScale=a.oldScale;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE,ViewportChange$$module$build$src$core$events$events_viewport);var module$build$src$core$events$events_viewport={};module$build$src$core$events$events_viewport.ViewportChange=ViewportChange$$module$build$src$core$events$events_viewport;var TEST_ONLY$$module$build$src$core$field_registry={fromJsonInternal:fromJsonInternal$$module$build$src$core$field_registry},module$build$src$core$field_registry={TEST_ONLY:TEST_ONLY$$module$build$src$core$field_registry};module$build$src$core$field_registry.fromJson=$.fromJson$$module$build$src$core$field_registry;module$build$src$core$field_registry.register=register$$module$build$src$core$field_registry;module$build$src$core$field_registry.unregister=unregister$$module$build$src$core$field_registry;var FieldDropdown$$module$build$src$core$field_dropdown=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.svgArrow=this.arrow=this.imageElement=this.menu_=this.selectedMenuItem=null;this.SERIALIZABLE=!0;this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(this.setOptions(a),c&&this.configure_(c),b&&this.setValidator(b))}fromXml(a){this.isOptionListDynamic()&&
|
|
@@ -853,7 +906,30 @@ if(!a.length)throw TypeError("FieldDropdown options must not be an empty array."
|
|
|
853
906
|
Found ${d[1]} in: ${d}`)):!d[0]||typeof d[0]==="string"||isImageProperties$$module$build$src$core$field_dropdown(d[0])||typeof HTMLElement!=="undefined"&&d[0]instanceof HTMLElement||(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must have a string
|
|
854
907
|
label, image description, or HTML element. Found ${d[0]} in: ${d}`)):(b=!0,console.error(`Invalid option[${c}]: Each FieldDropdown option must be an array or
|
|
855
908
|
the string literal 'separator'. Found: ${d}`))}if(b)throw TypeError("Found invalid FieldDropdown options.");}};FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR="separator";FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR="\u25be";FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET=5;FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING=FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_OFFSET*2;
|
|
856
|
-
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var
|
|
909
|
+
register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var KeyCodes$$module$build$src$core$utils$keycodes;
|
|
910
|
+
(function(a){a[a.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX";a[a.MAC_ENTER=3]="MAC_ENTER";a[a.BACKSPACE=8]="BACKSPACE";a[a.TAB=9]="TAB";a[a.NUM_CENTER=12]="NUM_CENTER";a[a.ENTER=13]="ENTER";a[a.SHIFT=16]="SHIFT";a[a.CTRL=17]="CTRL";a[a.ALT=18]="ALT";a[a.PAUSE=19]="PAUSE";a[a.CAPS_LOCK=20]="CAPS_LOCK";a[a.ESC=27]="ESC";a[a.SPACE=32]="SPACE";a[a.PAGE_UP=33]="PAGE_UP";a[a.PAGE_DOWN=34]="PAGE_DOWN";a[a.END=35]="END";a[a.HOME=36]="HOME";a[a.LEFT=37]="LEFT";a[a.UP=38]="UP";a[a.RIGHT=39]="RIGHT";a[a.DOWN=40]=
|
|
911
|
+
"DOWN";a[a.PLUS_SIGN=43]="PLUS_SIGN";a[a.PRINT_SCREEN=44]="PRINT_SCREEN";a[a.INSERT=45]="INSERT";a[a.DELETE=46]="DELETE";a[a.ZERO=48]="ZERO";a[a.ONE=49]="ONE";a[a.TWO=50]="TWO";a[a.THREE=51]="THREE";a[a.FOUR=52]="FOUR";a[a.FIVE=53]="FIVE";a[a.SIX=54]="SIX";a[a.SEVEN=55]="SEVEN";a[a.EIGHT=56]="EIGHT";a[a.NINE=57]="NINE";a[a.FF_SEMICOLON=59]="FF_SEMICOLON";a[a.FF_EQUALS=61]="FF_EQUALS";a[a.FF_DASH=173]="FF_DASH";a[a.FF_HASH=163]="FF_HASH";a[a.QUESTION_MARK=63]="QUESTION_MARK";a[a.AT_SIGN=64]="AT_SIGN";
|
|
912
|
+
a[a.A=65]="A";a[a.B=66]="B";a[a.C=67]="C";a[a.D=68]="D";a[a.E=69]="E";a[a.F=70]="F";a[a.G=71]="G";a[a.H=72]="H";a[a.I=73]="I";a[a.J=74]="J";a[a.K=75]="K";a[a.L=76]="L";a[a.M=77]="M";a[a.N=78]="N";a[a.O=79]="O";a[a.P=80]="P";a[a.Q=81]="Q";a[a.R=82]="R";a[a.S=83]="S";a[a.T=84]="T";a[a.U=85]="U";a[a.V=86]="V";a[a.W=87]="W";a[a.X=88]="X";a[a.Y=89]="Y";a[a.Z=90]="Z";a[a.META=91]="META";a[a.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT";a[a.CONTEXT_MENU=93]="CONTEXT_MENU";a[a.NUM_ZERO=96]="NUM_ZERO";a[a.NUM_ONE=97]=
|
|
913
|
+
"NUM_ONE";a[a.NUM_TWO=98]="NUM_TWO";a[a.NUM_THREE=99]="NUM_THREE";a[a.NUM_FOUR=100]="NUM_FOUR";a[a.NUM_FIVE=101]="NUM_FIVE";a[a.NUM_SIX=102]="NUM_SIX";a[a.NUM_SEVEN=103]="NUM_SEVEN";a[a.NUM_EIGHT=104]="NUM_EIGHT";a[a.NUM_NINE=105]="NUM_NINE";a[a.NUM_MULTIPLY=106]="NUM_MULTIPLY";a[a.NUM_PLUS=107]="NUM_PLUS";a[a.NUM_MINUS=109]="NUM_MINUS";a[a.NUM_PERIOD=110]="NUM_PERIOD";a[a.NUM_DIVISION=111]="NUM_DIVISION";a[a.F1=112]="F1";a[a.F2=113]="F2";a[a.F3=114]="F3";a[a.F4=115]="F4";a[a.F5=116]="F5";a[a.F6=
|
|
914
|
+
117]="F6";a[a.F7=118]="F7";a[a.F8=119]="F8";a[a.F9=120]="F9";a[a.F10=121]="F10";a[a.F11=122]="F11";a[a.F12=123]="F12";a[a.NUMLOCK=144]="NUMLOCK";a[a.SCROLL_LOCK=145]="SCROLL_LOCK";a[a.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY";a[a.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY";a[a.SEMICOLON=186]="SEMICOLON";a[a.DASH=189]="DASH";a[a.EQUALS=187]="EQUALS";a[a.COMMA=188]="COMMA";a[a.PERIOD=190]="PERIOD";a[a.SLASH=191]="SLASH";a[a.APOSTROPHE=192]="APOSTROPHE";a[a.TILDE=192]="TILDE";a[a.SINGLE_QUOTE=222]="SINGLE_QUOTE";
|
|
915
|
+
a[a.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET";a[a.BACKSLASH=220]="BACKSLASH";a[a.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET";a[a.WIN_KEY=224]="WIN_KEY";a[a.MAC_FF_META=224]="MAC_FF_META";a[a.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT";a[a.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT";a[a.WIN_IME=229]="WIN_IME";a[a.VK_NONAME=252]="VK_NONAME";a[a.PHANTOM=255]="PHANTOM";a[a.CTRL_CMD=MAC$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent?
|
|
916
|
+
a.MAC_WK_CMD_LEFT:a.CTRL]="CTRL_CMD"})(KeyCodes$$module$build$src$core$utils$keycodes||(KeyCodes$$module$build$src$core$utils$keycodes={}));var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;/*
|
|
917
|
+
|
|
918
|
+
Copyright 2026 Raspberry Pi Foundation
|
|
919
|
+
SPDX-License-Identifier: Apache-2.0
|
|
920
|
+
*/
|
|
921
|
+
var MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator=class{constructor(a){this.workspace=a;let b;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},(b=a.getLayerManager())==null?void 0:b.getDragLayer());this.svgRoot.classList.add("blocklyMoveIndicator");a=a.RTL;createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{fill:"white","fill-opacity":"0.8",stroke:"grey","stroke-width":"1",r:20,cx:20*
|
|
922
|
+
(a?-1:1),cy:20},this.svgRoot);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m18 9l3 3l-3 3m-3-3h6M6 9l-3 3l3 3m-3-3h6m0 6l3 3l3-3m-3-3v6m3-15l-3-3l-3 3m3-3v6",transform:`translate(${(a?-4:1)*8} 8)`},this.svgRoot)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a+(this.workspace.RTL?20:-20)}, ${b-20})`)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot)}},
|
|
923
|
+
module$build$src$core$keyboard_nav$move_indicator={};module$build$src$core$keyboard_nav$move_indicator.MoveIndicator=MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator;var Direction$$module$build$src$core$keyboard_nav$keyboard_mover;(function(a){a[a.NONE=0]="NONE";a[a.UP=1]="UP";a[a.DOWN=2]="DOWN";a[a.LEFT=3]="LEFT";a[a.RIGHT=4]="RIGHT"})(Direction$$module$build$src$core$keyboard_nav$keyboard_mover||(Direction$$module$build$src$core$keyboard_nav$keyboard_mover={}));
|
|
924
|
+
var COMMIT_MOVE_SHORTCUT$$module$build$src$core$keyboard_nav$keyboard_mover="commitMove",KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover=class{constructor(){this.totalDelta=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.stepDistance=20;this.allowedShortcuts=[];this.blurListener=()=>{this.abortMove()}}canMove(a){return!a.workspace.isReadOnly()&&a.isMovable()}isMoving(){return!!this.draggable}startMove(a,b){if(!this.canMove(a)||this.isMoving())return!1;const c=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,
|
|
925
|
+
a.workspace.options,!0);if(!c)throw Error("no Dragger registered");this.dragger=new c(a,a.workspace);this.draggable=this.dragger.onDragStart(b);this.startLocation=this.draggable.getRelativeToSurfaceXY();this.updateTotalDelta();this.draggable.getFocusableElement().addEventListener("blur",this.blurListener);a=Object.values(ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.getRegistry()).flatMap(d=>d.keyCodes).filter(d=>d&&![KeyCodes$$module$build$src$core$utils$keycodes.RIGHT,KeyCodes$$module$build$src$core$utils$keycodes.LEFT,
|
|
926
|
+
KeyCodes$$module$build$src$core$utils$keycodes.UP,KeyCodes$$module$build$src$core$utils$keycodes.DOWN,KeyCodes$$module$build$src$core$utils$keycodes.ENTER,KeyCodes$$module$build$src$core$utils$keycodes.ESC,KeyCodes$$module$build$src$core$utils$keycodes.M].includes(typeof d==="number"?d:parseInt(`${d.split("+").pop()}`))).filter(d=>!!d);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:COMMIT_MOVE_SHORTCUT$$module$build$src$core$keyboard_nav$keyboard_mover,preconditionFn:()=>
|
|
927
|
+
this.isMoving(),callback:()=>{this.finishMove();return!1},keyCodes:a,allowCollision:!0},!0);this.scrollCurrentElementIntoView();this.moveIndicator=new MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator(this.draggable.workspace);this.repositionMoveIndicator();return!0}move(a,b){switch(a){case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP:this.totalDelta.y-=this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN:this.totalDelta.y+=
|
|
928
|
+
this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT:this.totalDelta.x-=this.stepDistance;break;case Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT:this.totalDelta.x+=this.stepDistance}let c;(c=this.dragger)==null||c.onDrag(b,this.totalPixelDelta());this.updateTotalDelta();this.scrollCurrentElementIntoView();this.repositionMoveIndicator();return!0}finishMove(a){this.preDragEndCleanup();let b;(b=this.dragger)==null||b.onDragEnd(a,this.totalPixelDelta());
|
|
929
|
+
this.postDragEndCleanup();return!0}abortMove(a){this.preDragEndCleanup();let b;(b=this.dragger)==null||b.onDragRevert(a,this.totalPixelDelta());this.postDragEndCleanup();return!0}setMoveDistance(a){this.stepDistance=a}getAllowedShortcuts(){return this.allowedShortcuts}setAllowedShortcuts(a){this.allowedShortcuts=a}repositionMoveIndicator(){let a;const b=(a=this.draggable)==null?void 0:a.getBoundingRectangle();if(b){var c,d;(d=this.moveIndicator)==null||d.moveTo(((c=this.draggable)==null?0:c.workspace.RTL)?
|
|
930
|
+
b.left:b.right,b.top)}}preDragEndCleanup(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.unregister(COMMIT_MOVE_SHORTCUT$$module$build$src$core$keyboard_nav$keyboard_mover);let a;(a=this.draggable)==null||a.getFocusableElement().removeEventListener("blur",this.blurListener)}postDragEndCleanup(){let a;(a=this.moveIndicator)==null||a.dispose();this.startLocation=this.dragger=this.draggable=this.moveIndicator=void 0;this.totalDelta=new Coordinate$$module$build$src$core$utils$coordinate(0,
|
|
931
|
+
0)}totalPixelDelta(){let a,b;const c=(b=(a=this.draggable)==null?void 0:a.workspace.scale)!=null?b:1;return new Coordinate$$module$build$src$core$utils$coordinate(this.totalDelta.x*c,this.totalDelta.y*c)}scrollCurrentElementIntoView(){if(this.draggable){var a=this.draggable.getBoundingRectangle();this.draggable.workspace.scrollBoundsIntoView(a)}}updateTotalDelta(){this.draggable&&this.startLocation&&(this.totalDelta=new Coordinate$$module$build$src$core$utils$coordinate(this.draggable.getRelativeToSurfaceXY().x-
|
|
932
|
+
this.startLocation.x,this.draggable.getRelativeToSurfaceXY().y-this.startLocation.y))}};KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover=new KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover;var module$build$src$core$keyboard_nav$keyboard_mover={};module$build$src$core$keyboard_nav$keyboard_mover.Direction=Direction$$module$build$src$core$keyboard_nav$keyboard_mover;module$build$src$core$keyboard_nav$keyboard_mover.KeyboardMover=KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover;var Theme$$module$build$src$core$theme=class{constructor(a,b,c,d){this.name=a;this.startHats=!1;this.blockStyles=b||Object.create(null);this.categoryStyles=c||Object.create(null);this.componentStyles=d||Object.create(null);this.fontStyle=Object.create(null);register$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(a,b){this.blockStyles[a]=b}setCategoryStyle(a,b){this.categoryStyles[a]=b}getComponentStyle(a){a=
|
|
857
933
|
this.componentStyles[a];if(!a)return null;if(typeof a==="string"){const b=this.getComponentStyle(a);if(b)return b}return`${a}`}setComponentStyle(a,b){this.componentStyles[a]=b}setFontStyle(a){this.fontStyle=a}setStartHats(a){this.startHats=a}static defineTheme(a,b){a=a.toLowerCase();const c=new Theme$$module$build$src$core$theme(a);let d=b.base;if(d){if(typeof d==="string"){let e;d=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,d))!=null?e:void 0}d instanceof
|
|
858
934
|
Theme$$module$build$src$core$theme&&(deepMerge$$module$build$src$core$utils$object(c,d),c.name=a)}deepMerge$$module$build$src$core$utils$object(c.blockStyles,b.blockStyles);deepMerge$$module$build$src$core$utils$object(c.categoryStyles,b.categoryStyles);deepMerge$$module$build$src$core$utils$object(c.componentStyles,b.componentStyles);deepMerge$$module$build$src$core$utils$object(c.fontStyle,b.fontStyle);b.startHats!==null&&(c.startHats=b.startHats);return c}},module$build$src$core$theme={};
|
|
859
935
|
module$build$src$core$theme.Theme=Theme$$module$build$src$core$theme;var defaultBlockStyles$$module$build$src$core$theme$classic={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},categoryStyles$$module$build$src$core$theme$classic={colour_category:{colour:"20"},
|
|
@@ -864,37 +940,38 @@ l;this.hasSounds=h;this.hasCss=r;this.horizontalLayout=n;this.languageTree=b;thi
|
|
|
864
940
|
b){const c=a.move||{},d={};c.scrollbars===void 0&&a.scrollbars===void 0?d.scrollbars=b:typeof c.scrollbars==="object"?(d.scrollbars={horizontal:!!c.scrollbars.horizontal,vertical:!!c.scrollbars.vertical},d.scrollbars.horizontal&&d.scrollbars.vertical?d.scrollbars=!0:d.scrollbars.horizontal||d.scrollbars.vertical||(d.scrollbars=!1)):d.scrollbars=!!c.scrollbars||!!a.scrollbars;d.wheel=d.scrollbars&&c.wheel!==void 0?!!c.wheel:typeof d.scrollbars==="object";d.drag=d.scrollbars?c.drag===void 0?!0:!!c.drag:
|
|
865
941
|
!1;return d}static parseZoomOptions(a){a=a.zoom||{};const b={};b.controls=a.controls===void 0?!1:!!a.controls;b.wheel=a.wheel===void 0?!1:!!a.wheel;b.startScale=a.startScale===void 0?1:Number(a.startScale);b.maxScale=a.maxScale===void 0?3:Number(a.maxScale);b.minScale=a.minScale===void 0?.3:Number(a.minScale);b.scaleSpeed=a.scaleSpeed===void 0?1.2:Number(a.scaleSpeed);b.pinch=a.pinch===void 0?b.wheel||b.controls:!!a.pinch;return b}static parseGridOptions(a){a=a.grid||{};const b={};b.spacing=Number(a.spacing)||
|
|
866
942
|
0;b.colour=a.colour||"#888";b.length=a.length===void 0?1:Number(a.length);b.snap=b.spacing>0&&!!a.snap;return b}static parseThemeOptions(a){a=a.theme||Classic$$module$build$src$core$theme$classic;return typeof a==="string"?getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a):a instanceof Theme$$module$build$src$core$theme?a:Theme$$module$build$src$core$theme.defineTheme(a.name||"builtin"+getNextUniqueId$$module$build$src$core$utils$idgenerator(),a)}},module$build$src$core$options=
|
|
867
|
-
{};module$build$src$core$options.Options=Options$$module$build$src$core$options;var BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy=class{constructor(a,b){this.bubble=a;this.workspace=b;this.startLoc=null}isMovable(){return!0}startDrag(){this.startLoc=this.bubble.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.bubble);this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(a){this.bubble.moveDuringDrag(a)}endDrag(){this.workspace.setResizesEnabled(!0);
|
|
868
|
-
null||a.moveOffDragLayer(this.bubble,BUBBLE$$module$build$src$core$layers);this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$bubble_drag_strategy={};module$build$src$core$dragging$bubble_drag_strategy.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;var _a$$module$build$src$core$bubbles$bubble,Bubble$$module$build$src$core$bubbles$bubble=class{constructor(a,b,c,d,e){this.workspace=a;this.anchor=b;this.ownerRect=c;this.owner=e;this.size=new Size$$module$build$src$core$utils$size(0,0);this.colour="#ffffff";this.disposed=!1;this.relativeLeft=this.relativeTop=0;this.dragStrategy=new BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy(this,this.workspace);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.svgRoot=
|
|
943
|
+
{};module$build$src$core$options.Options=Options$$module$build$src$core$options;var BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy=class{constructor(a,b){this.bubble=a;this.workspace=b;this.startLoc=null}isMovable(){return!0}startDrag(){this.startLoc=this.bubble.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.bubble);this.bubble.setDragging&&this.bubble.setDragging(!0);return this.bubble}drag(a){this.bubble.moveDuringDrag(a)}endDrag(){this.workspace.setResizesEnabled(!0);
|
|
944
|
+
let a;(a=this.workspace.getLayerManager())==null||a.moveOffDragLayer(this.bubble,BUBBLE$$module$build$src$core$layers);this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$bubble_drag_strategy={};module$build$src$core$dragging$bubble_drag_strategy.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;var _a$$module$build$src$core$bubbles$bubble,Bubble$$module$build$src$core$bubbles$bubble=class{constructor(a,b,c,d,e){this.workspace=a;this.anchor=b;this.ownerRect=c;this.owner=e;this.size=new Size$$module$build$src$core$utils$size(0,0);this.colour="#ffffff";this.disposed=!1;this.relativeLeft=this.relativeTop=0;this.dragStrategy=new BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy(this,this.workspace);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.svgRoot=
|
|
869
945
|
createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyBubble"},a.getBubbleCanvas());a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyEmboss"},this.svgRoot);this.tail=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyBubbleTail"},a);this.background=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
870
946
|
{"class":"blocklyDraggable",x:0,y:0,rx:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,ry:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);this.contentContainer=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},this.svgRoot);this.focusableElement=d!=null?d:this.svgRoot;this.focusableElement.setAttribute("id",this.id);conditionalBind$$module$build$src$core$browser_events(this.background,"pointerdown",this,this.onMouseDown);conditionalBind$$module$build$src$core$browser_events(this.focusableElement,
|
|
871
947
|
"keydown",this,this.onKeyDown)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot);this.disposed=!0}setAnchorLocation(a,b=!1){this.anchor=a;b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}setPositionRelativeToAnchor(a,b){this.relativeLeft=a;this.relativeTop=b;this.positionRelativeToAnchor();this.renderTail()}getSize(){return this.size}setSize(a,b=!1){a.width=Math.max(a.width,_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);a.height=Math.max(a.height,
|
|
872
948
|
_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);this.size=a;this.background.setAttribute("width",`${a.width}`);this.background.setAttribute("height",`${a.height}`);b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}getColour(){return this.colour}setColour(a){this.colour=a;this.tail.setAttribute("fill",a);this.background.setAttribute("fill",a)}onMouseDown(a){let b;(b=this.workspace.getGesture(a))==null||b.handleBubbleStart(a,this);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)}onKeyDown(a){a.key===
|
|
873
|
-
"Escape"&&this.owner&&(this.owner.setBubbleVisible(!1),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.owner))}positionRelativeToAnchor(){let a=this.anchor.x;a=this.workspace.RTL?a-(this.relativeLeft+this.size.width):a+this.relativeLeft;this.moveTo(a,this.relativeTop+this.anchor.y)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a}, ${b})`)}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,
|
|
874
|
-
c=this.getOptimalRelativeLeft(b),d=this.getOptimalRelativeTop(b);const e={x:c,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},f={x:-this.size.width-30,y:d};d={x:a.getWidth(),y:d};var g={x:c,y:a.getHeight()};c=a.getWidth()<a.getHeight()?d:g;a=a.getWidth()<a.getHeight()?g:d;d=this.getOverlap(e,b);g=this.getOverlap(f,b);const h=this.getOverlap(c,b);b=this.getOverlap(a,b);b=Math.max(d,g,h,b);d===b?(this.relativeLeft=
|
|
875
|
-
f.x,this.relativeTop=f.y):h===b?(this.relativeLeft=c.x,this.relativeTop=c.y):(this.relativeLeft=a.x,this.relativeTop=a.y);this.positionRelativeToAnchor()}getOverlap(a,b){var c=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x+this.anchor.x;a=a.y+this.anchor.y;return Math.max(0,Math.min(1,(Math.min(c+this.size.width,b.left+b.width)-Math.max(c,b.left))*(Math.min(a+this.size.height,b.top+b.height)-Math.max(a,b.top))/(this.size.width*this.size.height)))}getOptimalRelativeLeft(a){let b
|
|
876
|
-
4;if(this.size.width>a.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.width<a.left?b=-(a.left-this.anchor.x+this.size.width):c>a.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;const d=c+this.size.width;c<a.left?b=a.left-this.anchor.x:d>a.right&&(b=a.right-this.anchor.x-this.size.width)}return b}getOptimalRelativeTop(a){let b=-this.size.height/4;if(this.size.height>a.height)return b;const c=this.anchor.y+b,d=c+this.size.height;
|
|
877
|
-
c<a.top?b=a.top-this.anchor.y:d>a.bottom&&(b=a.bottom-this.anchor.y-this.size.height);return b}getWorkspaceViewRect(a){const b=a.top;let c=a.top+a.height,d=a.left;a=a.left+a.width;c-=this.getScrollbarThickness();this.workspace.RTL?d-=this.getScrollbarThickness():a-=this.getScrollbarThickness();return new Rect$$module$build$src$core$utils$rect(b,c,d,a)}getScrollbarThickness(){return Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness/this.workspace.scale}renderTail(){const a=
|
|
878
|
-
2,c=this.size.height/2,d=-this.relativeLeft,e=-this.relativeTop;if(b===d&&c===e)a.push("M "+b+","+c);else{e-=c;d-=b;this.workspace.RTL&&(d*=-1);var f=Math.sqrt(e*e+d*d),g=Math.acos(d/f);e<0&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>Math.PI*2&&(h-=Math.PI*2);var k=Math.sin(h);const m=Math.cos(h);let n=(this.size.width+this.size.height)/_a$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS;n=Math.min(n,this.size.width,this.size.height)/4;h=1-_a$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS/
|
|
879
|
-
h*d;e=c+h*e;h=b+n*m;const p=c+n*k;b-=n*m;c-=n*k;k=toRadians$$module$build$src$core$utils$math(this.workspace.RTL?-_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE:_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE);k=g+k;k>Math.PI*2&&(k-=Math.PI*2);g=Math.sin(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;f=Math.cos(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;a.push("M"+h+","+p);a.push("C"+(h+f)+","+(p+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+
|
|
880
|
-
b+","+c)}a.push("z");let l;(l=this.tail)==null||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=(a=this.svgRoot)==null?void 0:a.parentNode;return this.svgRoot&&(b==null?void 0:b.lastChild)!==this.svgRoot?(b==null||b.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}
|
|
881
|
-
a.y);this.relativeLeft=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x-this.anchor.x;this.relativeTop=a.y-this.anchor.y;this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
949
|
+
"Escape"&&this.owner&&(this.owner.setBubbleVisible(!1),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.owner))}positionRelativeToAnchor(){let a=this.anchor.x;a=this.workspace.RTL?a-(this.relativeLeft+this.size.width):a+this.relativeLeft;this.moveTo(a,this.relativeTop+this.anchor.y)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a}, ${b})`)}moveBy(a,b,c){c=this.getRelativeToSurfaceXY();this.moveTo(c.x+a,c.y+b)}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,
|
|
950
|
+
0,0,0)){var b=this.workspace.getMetricsManager().getViewMetrics(!0),c=this.getOptimalRelativeLeft(b),d=this.getOptimalRelativeTop(b);const e={x:c,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},f={x:-this.size.width-30,y:d};d={x:a.getWidth(),y:d};var g={x:c,y:a.getHeight()};c=a.getWidth()<a.getHeight()?d:g;a=a.getWidth()<a.getHeight()?g:d;d=this.getOverlap(e,b);g=this.getOverlap(f,b);const h=this.getOverlap(c,b);b=this.getOverlap(a,b);b=Math.max(d,g,h,b);d===b?(this.relativeLeft=
|
|
951
|
+
e.x,this.relativeTop=e.y):g===b?(this.relativeLeft=f.x,this.relativeTop=f.y):h===b?(this.relativeLeft=c.x,this.relativeTop=c.y):(this.relativeLeft=a.x,this.relativeTop=a.y);this.positionRelativeToAnchor()}getOverlap(a,b){var c=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x+this.anchor.x;a=a.y+this.anchor.y;return Math.max(0,Math.min(1,(Math.min(c+this.size.width,b.left+b.width)-Math.max(c,b.left))*(Math.min(a+this.size.height,b.top+b.height)-Math.max(a,b.top))/(this.size.width*this.size.height)))}getOptimalRelativeLeft(a){let b=
|
|
952
|
+
-this.size.width/4;if(this.size.width>a.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.width<a.left?b=-(a.left-this.anchor.x+this.size.width):c>a.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;const d=c+this.size.width;c<a.left?b=a.left-this.anchor.x:d>a.right&&(b=a.right-this.anchor.x-this.size.width)}return b}getOptimalRelativeTop(a){let b=-this.size.height/4;if(this.size.height>a.height)return b;const c=this.anchor.y+b,d=c+this.size.height;
|
|
953
|
+
a=this.getWorkspaceViewRect(a);c<a.top?b=a.top-this.anchor.y:d>a.bottom&&(b=a.bottom-this.anchor.y-this.size.height);return b}getWorkspaceViewRect(a){const b=a.top;let c=a.top+a.height,d=a.left;a=a.left+a.width;c-=this.getScrollbarThickness();this.workspace.RTL?d-=this.getScrollbarThickness():a-=this.getScrollbarThickness();return new Rect$$module$build$src$core$utils$rect(b,c,d,a)}getScrollbarThickness(){return Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness/this.workspace.scale}renderTail(){const a=
|
|
954
|
+
[];var b=this.size.width/2,c=this.size.height/2,d=-this.relativeLeft,e=-this.relativeTop;if(b===d&&c===e)a.push("M "+b+","+c);else{e-=c;d-=b;this.workspace.RTL&&(d*=-1);var f=Math.sqrt(e*e+d*d),g=Math.acos(d/f);e<0&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>Math.PI*2&&(h-=Math.PI*2);var k=Math.sin(h);const m=Math.cos(h);let n=(this.size.width+this.size.height)/_a$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS;n=Math.min(n,this.size.width,this.size.height)/4;h=1-_a$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS/
|
|
955
|
+
f;d=b+h*d;e=c+h*e;h=b+n*m;const p=c+n*k;b-=n*m;c-=n*k;k=toRadians$$module$build$src$core$utils$math(this.workspace.RTL?-_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE:_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE);k=g+k;k>Math.PI*2&&(k-=Math.PI*2);g=Math.sin(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;f=Math.cos(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;a.push("M"+h+","+p);a.push("C"+(h+f)+","+(p+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+
|
|
956
|
+
g)+" "+b+","+c)}a.push("z");let l;(l=this.tail)==null||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=(a=this.svgRoot)==null?void 0:a.parentNode;return this.svgRoot&&(b==null?void 0:b.lastChild)!==this.svgRoot?(b==null||b.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getBoundingRectangle(){const a=
|
|
957
|
+
this.getRelativeToSurfaceXY();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.size.height,a.x,a.x+this.size.width)}getSvgRoot(){return this.svgRoot}moveDuringDrag(a){this.moveTo(a.x,a.y);this.relativeLeft=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x-this.anchor.x;this.relativeTop=a.y-this.anchor.y;this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){return this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
|
|
882
958
|
this.bringToFront();var a=this.getRelativeToSurfaceXY();const b=this.getSize();a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+b.height,a.x,a.x+b.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}getOwner(){return this.owner}};_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;
|
|
883
959
|
Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2;Bubble$$module$build$src$core$bubbles$bubble.MIN_SIZE=_a$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;Bubble$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS=1;Bubble$$module$build$src$core$bubbles$bubble.TAIL_ANGLE=20;Bubble$$module$build$src$core$bubbles$bubble.TAIL_BEND=4;Bubble$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS=8;
|
|
884
960
|
var module$build$src$core$bubbles$bubble={};module$build$src$core$bubbles$bubble.Bubble=Bubble$$module$build$src$core$bubbles$bubble;var MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(b,c,d);this.workspace=b;this.anchor=c;this.ownerRect=d;this.autoLayout=!0;b=new Options$$module$build$src$core$options(a);this.validateWorkspaceOptions(b);this.svgDialog=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},
|
|
885
961
|
this.contentContainer);a.parentWorkspace=this.workspace;this.miniWorkspace=this.newWorkspaceSvg(new Options$$module$build$src$core$options(a));this.miniWorkspace.internalIsMutator=!0;a=this.miniWorkspace.createDom("blocklyMutatorBackground");this.svgDialog.appendChild(a);b.languageTree&&(a.insertBefore(this.miniWorkspace.addFlyout(Svg$$module$build$src$core$utils$svg.G),this.miniWorkspace.getCanvas()),a=this.miniWorkspace.getFlyout(),a==null||a.init(this.miniWorkspace),a==null||a.show(b.languageTree));
|
|
886
962
|
addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMiniWorkspaceBubble");this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let e,f;(e=this.miniWorkspace.getFlyout())==null||(f=e.getWorkspace())==null||f.addChangeListener(this.onWorkspaceChange.bind(this));this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose();super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(a){this.miniWorkspace.addChangeListener(a)}validateWorkspaceOptions(a){if(a.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories");
|
|
887
963
|
if(a.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(a.zoomOptions.controls||a.zoomOptions.wheel||a.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(a.moveOptions.scrollbars||a.moveOptions.wheel||a.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(a.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts");}onWorkspaceChange(){this.bumpBlocksIntoBounds();
|
|
888
|
-
this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging()||
|
|
889
|
-
|
|
890
|
-
this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${b.width}, 0)`),this.setSize(new Size$$module$build$src$core$utils$size(b.width+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,b.height+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var a=this.miniWorkspace.getCanvas().getBBox();
|
|
891
|
-
a=a.height+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;const c=this.miniWorkspace.getFlyout();if(c){const d=c.getWorkspace().getMetricsManager().getScrollMetrics();a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());let b;if(a=(b=
|
|
892
|
-
this.autoLayout=!1}moveTo(a,b){super.moveTo(a,b);this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(a){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts");}
|
|
893
|
-
module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
964
|
+
this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging()||KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving())for(const a of this.miniWorkspace.getTopBlocks(!1)){const b=a.getRelativeToSurfaceXY();b.y<20&&a.moveBy(0,20-b.y);if(a.RTL){let c=-20;const d=this.miniWorkspace.getFlyout();d&&(c-=d.getWidth());b.x>c&&a.moveBy(c-b.x,0)}else b.x<20&&a.moveBy(20-b.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()||KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving()){this.autoLayout&&
|
|
965
|
+
(this.autoLayout=!KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving());var a=this.getSize(),b=this.calculateWorkspaceSize();Math.abs(a.width-b.width)<MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE&&Math.abs(a.height-b.height)<MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE||(this.svgDialog.setAttribute("width",`${b.width}px`),this.svgDialog.setAttribute("height",`${b.height}px`),
|
|
966
|
+
this.miniWorkspace.setCachedParentSvgSize(b.width,b.height),this.miniWorkspace.RTL&&this.miniWorkspace.getCanvas().setAttribute("transform",`translate(${b.width}, 0)`),this.setSize(new Size$$module$build$src$core$utils$size(b.width+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,b.height+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER),this.autoLayout),this.miniWorkspace.resize(),this.miniWorkspace.recordDragTargets())}}calculateWorkspaceSize(){var a=this.miniWorkspace.getCanvas().getBBox();
|
|
967
|
+
let b=a.width+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;a=a.height+MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN;const c=this.miniWorkspace.getFlyout();if(c){const d=c.getWorkspace().getMetricsManager().getScrollMetrics();a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core$utils$size(b,a)}updateBlockStyles(){for(var a of this.miniWorkspace.getAllBlocks(!1))a.setStyle(a.getStyleName());let b;if(a=(b=
|
|
968
|
+
this.miniWorkspace.getFlyout())==null?void 0:b.getWorkspace())for(const c of a.getAllBlocks(!1))c.setStyle(c.getStyleName())}moveDuringDrag(a){super.moveDuringDrag(a);this.autoLayout=!1}moveTo(a,b){super.moveTo(a,b);this.miniWorkspace.recordDragTargets()}newWorkspaceSvg(a){throw Error("The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts");}performAction(){$.getFocusManager$$module$build$src$core$focus_manager().focusTree(this.getWorkspace())}};
|
|
969
|
+
MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER*3;var module$build$src$core$bubbles$mini_workspace_bubble={};module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
|
|
894
970
|
{"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,0)}setTooltip(a){this.tooltip=
|
|
895
971
|
a!=null?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){let a;
|
|
896
972
|
(a=this.svgRoot)==null||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){var a=this.sourceBlock.getBoundingRectangle();
|
|
897
|
-
a=new Rect$$module$build$src$core$utils$rect(a.top+this.offsetInBlock.y,a.top+this.offsetInBlock.y+this.getSize().height,a.left+this.offsetInBlock.x,a.left+this.offsetInBlock.x+this.getSize().width);this.sourceBlock.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}
|
|
973
|
+
a=new Rect$$module$build$src$core$utils$rect(a.top+this.offsetInBlock.y,a.top+this.offsetInBlock.y+this.getSize().height,a.left+this.offsetInBlock.x,a.left+this.offsetInBlock.x+this.getSize().width);this.sourceBlock.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}performAction(){this.onClick();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.bubbleIsVisible()){const a=this.getBubble();
|
|
974
|
+
a&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}})}getSourceBlock(){return this.sourceBlock}showContextMenu(a){this.getSourceBlock().showContextMenu(a)}},module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
|
|
898
975
|
$.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a,b){super(b);this.flyoutBlockTypes=a;this.sourceBlock=b;this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconShape",
|
|
899
976
|
rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
|
|
900
977
|
this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMutatorIcon"))}dispose(){super.dispose();let a;(a=this.miniWorkspaceBubble)==null||a.dispose()}getWeight(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$mutator_icon,
|
|
@@ -909,14 +986,7 @@ this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnecti
|
|
|
909
986
|
this.sourceBlock.compose(this.rootBlock);var c=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);b!==c&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,b,c));$.setGroup$$module$build$src$core$events$utils(a)}}getWorkspace(){let a;return(a=this.miniWorkspaceBubble)==null?void 0:a.getWorkspace()}};
|
|
910
987
|
$.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.MUTATOR;$.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1;var module$build$src$core$icons$mutator_icon={};module$build$src$core$icons$mutator_icon.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;var allExtensions$$module$build$src$core$extensions=Object.create(null),TEST_ONLY$$module$build$src$core$extensions={allExtensions:allExtensions$$module$build$src$core$extensions};$.register$$module$build$src$core$extensions("parent_tooltip_when_inline",extensionParentTooltip$$module$build$src$core$extensions);var module$build$src$core$extensions={TEST_ONLY:TEST_ONLY$$module$build$src$core$extensions};module$build$src$core$extensions.apply=apply$$module$build$src$core$extensions;
|
|
911
988
|
module$build$src$core$extensions.buildTooltipForDropdown=$.buildTooltipForDropdown$$module$build$src$core$extensions;module$build$src$core$extensions.buildTooltipWithFieldText=$.buildTooltipWithFieldText$$module$build$src$core$extensions;module$build$src$core$extensions.isRegistered=isRegistered$$module$build$src$core$extensions;module$build$src$core$extensions.register=$.register$$module$build$src$core$extensions;module$build$src$core$extensions.registerMixin=$.registerMixin$$module$build$src$core$extensions;
|
|
912
|
-
module$build$src$core$extensions.registerMutator=$.registerMutator$$module$build$src$core$extensions;module$build$src$core$extensions.runAfterPageLoad=runAfterPageLoad$$module$build$src$core$extensions;module$build$src$core$extensions.unregister=unregister$$module$build$src$core$extensions;var
|
|
913
|
-
(function(a){a[a.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX";a[a.MAC_ENTER=3]="MAC_ENTER";a[a.BACKSPACE=8]="BACKSPACE";a[a.TAB=9]="TAB";a[a.NUM_CENTER=12]="NUM_CENTER";a[a.ENTER=13]="ENTER";a[a.SHIFT=16]="SHIFT";a[a.CTRL=17]="CTRL";a[a.ALT=18]="ALT";a[a.PAUSE=19]="PAUSE";a[a.CAPS_LOCK=20]="CAPS_LOCK";a[a.ESC=27]="ESC";a[a.SPACE=32]="SPACE";a[a.PAGE_UP=33]="PAGE_UP";a[a.PAGE_DOWN=34]="PAGE_DOWN";a[a.END=35]="END";a[a.HOME=36]="HOME";a[a.LEFT=37]="LEFT";a[a.UP=38]="UP";a[a.RIGHT=39]="RIGHT";a[a.DOWN=40]=
|
|
914
|
-
"DOWN";a[a.PLUS_SIGN=43]="PLUS_SIGN";a[a.PRINT_SCREEN=44]="PRINT_SCREEN";a[a.INSERT=45]="INSERT";a[a.DELETE=46]="DELETE";a[a.ZERO=48]="ZERO";a[a.ONE=49]="ONE";a[a.TWO=50]="TWO";a[a.THREE=51]="THREE";a[a.FOUR=52]="FOUR";a[a.FIVE=53]="FIVE";a[a.SIX=54]="SIX";a[a.SEVEN=55]="SEVEN";a[a.EIGHT=56]="EIGHT";a[a.NINE=57]="NINE";a[a.FF_SEMICOLON=59]="FF_SEMICOLON";a[a.FF_EQUALS=61]="FF_EQUALS";a[a.FF_DASH=173]="FF_DASH";a[a.FF_HASH=163]="FF_HASH";a[a.QUESTION_MARK=63]="QUESTION_MARK";a[a.AT_SIGN=64]="AT_SIGN";
|
|
915
|
-
a[a.A=65]="A";a[a.B=66]="B";a[a.C=67]="C";a[a.D=68]="D";a[a.E=69]="E";a[a.F=70]="F";a[a.G=71]="G";a[a.H=72]="H";a[a.I=73]="I";a[a.J=74]="J";a[a.K=75]="K";a[a.L=76]="L";a[a.M=77]="M";a[a.N=78]="N";a[a.O=79]="O";a[a.P=80]="P";a[a.Q=81]="Q";a[a.R=82]="R";a[a.S=83]="S";a[a.T=84]="T";a[a.U=85]="U";a[a.V=86]="V";a[a.W=87]="W";a[a.X=88]="X";a[a.Y=89]="Y";a[a.Z=90]="Z";a[a.META=91]="META";a[a.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT";a[a.CONTEXT_MENU=93]="CONTEXT_MENU";a[a.NUM_ZERO=96]="NUM_ZERO";a[a.NUM_ONE=97]=
|
|
916
|
-
"NUM_ONE";a[a.NUM_TWO=98]="NUM_TWO";a[a.NUM_THREE=99]="NUM_THREE";a[a.NUM_FOUR=100]="NUM_FOUR";a[a.NUM_FIVE=101]="NUM_FIVE";a[a.NUM_SIX=102]="NUM_SIX";a[a.NUM_SEVEN=103]="NUM_SEVEN";a[a.NUM_EIGHT=104]="NUM_EIGHT";a[a.NUM_NINE=105]="NUM_NINE";a[a.NUM_MULTIPLY=106]="NUM_MULTIPLY";a[a.NUM_PLUS=107]="NUM_PLUS";a[a.NUM_MINUS=109]="NUM_MINUS";a[a.NUM_PERIOD=110]="NUM_PERIOD";a[a.NUM_DIVISION=111]="NUM_DIVISION";a[a.F1=112]="F1";a[a.F2=113]="F2";a[a.F3=114]="F3";a[a.F4=115]="F4";a[a.F5=116]="F5";a[a.F6=
|
|
917
|
-
117]="F6";a[a.F7=118]="F7";a[a.F8=119]="F8";a[a.F9=120]="F9";a[a.F10=121]="F10";a[a.F11=122]="F11";a[a.F12=123]="F12";a[a.NUMLOCK=144]="NUMLOCK";a[a.SCROLL_LOCK=145]="SCROLL_LOCK";a[a.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY";a[a.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY";a[a.SEMICOLON=186]="SEMICOLON";a[a.DASH=189]="DASH";a[a.EQUALS=187]="EQUALS";a[a.COMMA=188]="COMMA";a[a.PERIOD=190]="PERIOD";a[a.SLASH=191]="SLASH";a[a.APOSTROPHE=192]="APOSTROPHE";a[a.TILDE=192]="TILDE";a[a.SINGLE_QUOTE=222]="SINGLE_QUOTE";
|
|
918
|
-
a[a.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET";a[a.BACKSLASH=220]="BACKSLASH";a[a.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET";a[a.WIN_KEY=224]="WIN_KEY";a[a.MAC_FF_META=224]="MAC_FF_META";a[a.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT";a[a.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT";a[a.WIN_IME=229]="WIN_IME";a[a.VK_NONAME=252]="VK_NONAME";a[a.PHANTOM=255]="PHANTOM";a[a.CTRL_CMD=MAC$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent?
|
|
919
|
-
a.MAC_WK_CMD_LEFT:a.CTRL]="CTRL_CMD"})(KeyCodes$$module$build$src$core$utils$keycodes||(KeyCodes$$module$build$src$core$utils$keycodes={}));var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;var module$build$src$core$utils$svg_paths={};module$build$src$core$utils$svg_paths.arc=arc$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.curve=curve$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.line=line$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineOnAxis=lineOnAxis$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineTo=lineTo$$module$build$src$core$utils$svg_paths;
|
|
989
|
+
module$build$src$core$extensions.registerMutator=$.registerMutator$$module$build$src$core$extensions;module$build$src$core$extensions.runAfterPageLoad=runAfterPageLoad$$module$build$src$core$extensions;module$build$src$core$extensions.unregister=unregister$$module$build$src$core$extensions;var module$build$src$core$utils$svg_paths={};module$build$src$core$utils$svg_paths.arc=arc$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.curve=curve$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.line=line$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineOnAxis=lineOnAxis$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineTo=lineTo$$module$build$src$core$utils$svg_paths;
|
|
920
990
|
module$build$src$core$utils$svg_paths.moveBy=moveBy$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.moveTo=moveTo$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.point=point$$module$build$src$core$utils$svg_paths;var module$build$src$core$utils={};module$build$src$core$utils.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;module$build$src$core$utils.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;module$build$src$core$utils.Rect=Rect$$module$build$src$core$utils$rect;module$build$src$core$utils.Size=Size$$module$build$src$core$utils$size;module$build$src$core$utils.Svg=Svg$$module$build$src$core$utils$svg;module$build$src$core$utils.aria=module$build$src$core$utils$aria;
|
|
921
991
|
module$build$src$core$utils.array=module$build$src$core$utils$array;module$build$src$core$utils.browserEvents=module$build$src$core$browser_events;module$build$src$core$utils.colour=module$build$src$core$utils$colour;module$build$src$core$utils.deprecation=module$build$src$core$utils$deprecation;module$build$src$core$utils.dom=module$build$src$core$utils$dom;module$build$src$core$utils.extensions=module$build$src$core$extensions;module$build$src$core$utils.idGenerator=module$build$src$core$utils$idgenerator;
|
|
922
992
|
module$build$src$core$utils.math=module$build$src$core$utils$math;module$build$src$core$utils.object=module$build$src$core$utils$object;module$build$src$core$utils.parsing=module$build$src$core$utils$parsing;module$build$src$core$utils.string=module$build$src$core$utils$string;module$build$src$core$utils.style=module$build$src$core$utils$style;module$build$src$core$utils.svgMath=module$build$src$core$utils$svg_math;module$build$src$core$utils.svgPaths=module$build$src$core$utils$svg_paths;
|
|
@@ -927,17 +997,17 @@ this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAU
|
|
|
927
997
|
d),new Size$$module$build$src$core$utils$size(0,0));this.editor.getDom().setAttribute("x",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.editor.getDom().setAttribute("y",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a);
|
|
928
998
|
this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);this.onLocationChange()}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,
|
|
929
999
|
this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),
|
|
930
|
-
this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}onLocationChange(){for(const a of this.locationChangeListeners)a()}getEditor(){return this.editor}};
|
|
1000
|
+
this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}onLocationChange(){for(const a of this.locationChangeListeners)a()}getEditor(){return this.editor}performAction(){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.getEditor())}};
|
|
931
1001
|
register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");var module$build$src$core$bubbles$textinput_bubble={};module$build$src$core$bubbles$textinput_bubble.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var ConnectionType$$module$build$src$core$connection_type;(function(a){a[a.INPUT_VALUE=1]="INPUT_VALUE";a[a.OUTPUT_VALUE=2]="OUTPUT_VALUE";a[a.NEXT_STATEMENT=3]="NEXT_STATEMENT";a[a.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(ConnectionType$$module$build$src$core$connection_type||(ConnectionType$$module$build$src$core$connection_type={}));var module$build$src$core$connection_type={};module$build$src$core$connection_type.ConnectionType=ConnectionType$$module$build$src$core$connection_type;var ConnectionDB$$module$build$src$core$connection_db=class{constructor(a){this.connectionChecker=a;this.connections=[]}addConnection(a,b){b=this.calculateIndexForYPos(b);this.connections.splice(b,0,a)}findIndexOfConnection(a,b){if(!this.connections.length)return-1;const c=this.calculateIndexForYPos(b);if(c>=this.connections.length)return-1;b=a.y;let d=c;for(;d>=0&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;d<this.connections.length&&this.connections[d].y===b;){if(this.connections[d]===
|
|
932
1002
|
a)return d;d++}return-1}calculateIndexForYPos(a){if(!this.connections.length)return 0;let b=0,c=this.connections.length;for(;b<c;){const d=Math.floor((b+c)/2);if(this.connections[d].y<a)b=d+1;else if(this.connections[d].y>a)c=d;else{b=d;break}}return b}removeConnection(a,b){a=this.findIndexOfConnection(a,b);if(a===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(a,1)}getNeighbours(a,b){function c(l){const m=e-d[l].x,n=f-d[l].y;Math.sqrt(m*m+n*n)<=b&&k.push(d[l]);
|
|
933
1003
|
return n<b}const d=this.connections,e=a.x,f=a.y;a=0;let g=d.length-2,h=g;for(;a<h;)d[h].y<f?a=h:g=h,h=Math.floor((a+g)/2);const k=[];g=a=h;if(d.length){for(;a>=0&&c(a);)a--;do g++;while(g<d.length&&c(g))}return k}isInYRange(a,b,c){return Math.abs(this.connections[a].y-b)<=c}searchForClosest(a,b,c){if(!this.connections.length)return{connection:null,radius:b};const d=a.y,e=a.x;a.x=e+c.x;a.y=d+c.y;var f=this.calculateIndexForYPos(a.y);c=null;let g=b,h,k=f-1;for(;k>=0&&this.isInYRange(k,a.y,b);)h=this.connections[k],
|
|
934
1004
|
this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),k--;for(;f<this.connections.length&&this.isInYRange(f,a.y,b);)h=this.connections[f],this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),f++;a.x=e;a.y=d;return{connection:c,radius:g}}static init(a){const b=[];b[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);
|
|
935
1005
|
b[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);return b}},module$build$src$core$connection_db={};module$build$src$core$connection_db.ConnectionDB=ConnectionDB$$module$build$src$core$connection_db;var Selected$$module$build$src$core$events$events_selected=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(c);this.type=EventType$$module$build$src$core$events$type.SELECTED;this.oldElementId=a!=null?a:void 0;this.newElementId=b!=null?b:void 0}toJson(){const a=super.toJson();a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new Selected$$module$build$src$core$events$events_selected);
|
|
936
|
-
b.oldElementId=a.oldElementId;b.newElementId=a.newElementId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.SELECTED,Selected$$module$build$src$core$events$events_selected);var module$build$src$core$events$events_selected={};module$build$src$core$events$events_selected.Selected=Selected$$module$build$src$core$events$events_selected;var BlockDelete$$module$build$src$core$events$events_block_delete=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_DELETE;if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");a.isShadow()&&(this.recordUndo=!1);this.
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1006
|
+
b.oldElementId=a.oldElementId;b.newElementId=a.newElementId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.SELECTED,Selected$$module$build$src$core$events$events_selected);var module$build$src$core$events$events_selected={};module$build$src$core$events$events_selected.Selected=Selected$$module$build$src$core$events$events_selected;var BlockDelete$$module$build$src$core$events$events_block_delete=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_DELETE;if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");a.isShadow()&&(this.recordUndo=!1);this.ids=getDescendantIds$$module$build$src$core$events$utils(a);this.wasShadow=a.isShadow();this.oldJson=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0})}}toJson(){const a=
|
|
1007
|
+
super.toJson();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.ids=this.ids;a.wasShadow=this.wasShadow;a.oldJson=this.oldJson;this.recordUndo||(a.recordUndo=this.recordUndo);
|
|
1008
|
+
return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.fromJson(a,b,c!=null?c:new BlockDelete$$module$build$src$core$events$events_block_delete);b.ids=a.ids;b.wasShadow=a.wasShadow;b.oldJson=a.oldJson;a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");
|
|
1009
|
+
if(a)for(a=0;a<this.ids.length;a++){const c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't delete non-existent block: "+c)}else append$$module$build$src$core$serialization$blocks(this.oldJson,b)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_DELETE,BlockDelete$$module$build$src$core$events$events_block_delete);var module$build$src$core$events$events_block_delete={};
|
|
1010
|
+
module$build$src$core$events$events_block_delete.BlockDelete=BlockDelete$$module$build$src$core$events$events_block_delete;var Connection$$module$build$src$core$connection=class{constructor(a,b){this.type=b;this.targetConnection=null;this.disposed=!1;this.shadowDom=this.check=null;this.y=this.x=0;this.shadowState=null;this.sourceBlock_=a;if(a.id.includes("_connection"))throw Error(`Connection ID indicator is contained in block ID. This will cause problems with focus: ${a.id}.`);this.id=`${a.id}_connection_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}connect_(a){const b=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,
|
|
941
1011
|
c=this.getSourceBlock();var d=a.getSourceBlock();a.isConnected()&&a.disconnectInternal(!1);let e;if(this.isConnected()){const g=this.stashShadowState(),h=this.targetBlock();h.isShadow()?h.dispose(!1):(this.disconnectInternal(),e=h);this.applyShadowState(g)}let f;isEnabled$$module$build$src$core$events$utils()&&(f=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(d),f.setReason(["connect"]));connectReciprocally$$module$build$src$core$connection(this,
|
|
942
1012
|
a);d.setParent(c);f&&(f.recordNew(),fire$$module$build$src$core$events$utils(f));if(e&&(a=this.type===b?e.outputConnection:e.previousConnection))if(d=Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(d,a))a.connect(d);else a.onFailedConnect(this)}dispose(){if(this.isConnected()){this.isSuperior()&&this.setShadowStateInternal();const a=this.targetBlock();a&&!a.isDeadOrDying()&&a.unplug()}this.disposed=!0}getSourceBlock(){return this.sourceBlock_}isSuperior(){return this.type===
|
|
943
1013
|
ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE||this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT}isConnected(){return!!this.targetConnection}getConnectionChecker(){return this.sourceBlock_.workspace.connectionChecker}onFailedConnect(a){}connect(a){if(this.targetConnection===a)return!0;if(this.getConnectionChecker().canConnect(this,a,!1)){const b=$.getGroup$$module$build$src$core$events$utils();b||$.setGroup$$module$build$src$core$events$utils(!0);
|
|
@@ -952,7 +1022,7 @@ this.getSourceBlock();const c=this.getShadowState(),d=this.getShadowDom();if(b.i
|
|
|
952
1022
|
if(!this.connect(b.outputConnection))throw Error("Could not connect shadow block to connection");}else if(this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){if(!b.previousConnection)throw Error("Shadow block is missing previous connection");if(!this.connect(b.previousConnection))throw Error("Could not connect shadow block to connection");}else throw Error("Cannot connect a shadow block to a previous/output connection");return b}return null}serializeShadow(a){a&&(this.shadowDom=
|
|
953
1023
|
blockToDom$$module$build$src$core$xml(a),this.shadowState=save$$module$build$src$core$serialization$blocks(a))}static getConnectionForOrphanedConnection(a,b){if(b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return getConnectionForOrphanedOutput$$module$build$src$core$connection(a,b.getSourceBlock());a=a.lastConnectionInStack(!0);const c=b.getConnectionChecker();return a&&c.canConnect(b,a,!1)?a:null}};Connection$$module$build$src$core$connection.CAN_CONNECT=0;
|
|
954
1024
|
Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION=1;Connection$$module$build$src$core$connection.REASON_WRONG_TYPE=2;Connection$$module$build$src$core$connection.REASON_TARGET_NULL=3;Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED=4;Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES=5;Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT=6;Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED=7;
|
|
955
|
-
Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT=8;var module$build$src$core$connection={};module$build$src$core$connection.Connection=Connection$$module$build$src$core$connection;var DuplicateIconType$$module$build$src$core$icons$exceptions=class extends Error{constructor(a){super(`Tried to append an icon of type ${a.getType()} when an icon of
|
|
1025
|
+
Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT=8;var module$build$src$core$connection={};module$build$src$core$connection.Connection=Connection$$module$build$src$core$connection;var DuplicateIconType$$module$build$src$core$icons$exceptions=class extends Error{constructor(a){super(`Tried to append an icon of type ${a.getType()} when an icon of that type already exists on the block. Use getIcon to access the existing icon.`);this.icon=a}},module$build$src$core$icons$exceptions={};module$build$src$core$icons$exceptions.DuplicateIconType=DuplicateIconType$$module$build$src$core$icons$exceptions;(function(a){a[a.LEFT=-1]="LEFT";a[a.CENTRE=0]="CENTRE";a[a.RIGHT=1]="RIGHT"})($.Align$$module$build$src$core$inputs$align||($.Align$$module$build$src$core$inputs$align={}));var module$build$src$core$inputs$align={};module$build$src$core$inputs$align.Align=$.Align$$module$build$src$core$inputs$align;var FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class=null;this.EDITABLE=!1;this.maxDisplayLength=Infinity;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class=a.class)}initView(){this.createTextElement_();this.class&&addClass$$module$build$src$core$utils$dom(this.getTextElement(),
|
|
956
1026
|
this.class);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyLabelField")}doClassValidation_(a){return a===null||a===void 0?null:`${a}`}setClass(a){this.textElement_&&(this.class&&removeClass$$module$build$src$core$utils$dom(this.textElement_,this.class),a&&addClass$$module$build$src$core$utils$dom(this.textElement_,a));this.class=a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};
|
|
957
1027
|
register$$module$build$src$core$field_registry("field_label",FieldLabel$$module$build$src$core$field_label);FieldLabel$$module$build$src$core$field_label.prototype.DEFAULT_VALUE="";var module$build$src$core$field_label={};module$build$src$core$field_label.FieldLabel=FieldLabel$$module$build$src$core$field_label;var COLLAPSE_CHARS$$module$build$src$core$internal_constants=30,OPPOSITE_TYPE$$module$build$src$core$internal_constants=[];OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE;
|
|
958
1028
|
OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT;
|
|
@@ -961,20 +1031,21 @@ RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.WILL_
|
|
|
961
1031
|
b+a*a)}bumpAwayFrom(a,b=!1){if(!this.sourceBlock_.workspace.isDragging()){var c=$.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*BUMP_RANDOMNESS$$module$build$src$core$rendered_connection),d=$.config$$module$build$src$core$config.snapRadius+Math.floor(Math.random()*BUMP_RANDOMNESS$$module$build$src$core$rendered_connection),e=a.sourceBlock_.getRootBlock(),f=this.sourceBlock_.getRootBlock();if(!e.isInFlyout&&!f.isInFlyout){var g=!0;if(f.isMovable())e.isMovable()&&b&&(d=-d);
|
|
962
1032
|
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){let 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&&
|
|
963
1033
|
(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;const b=this.targetBlock();a&&b&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.offsetInBlock,
|
|
964
|
-
a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}highlight(){this.highlighted=!0;const a=this.findHighlightSvg();
|
|
965
|
-
this.sourceBlock_.isInFlyout||(a?(this.db.addConnection(this,this.y),this.trackedState=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState.TRACKED):(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);
|
|
966
|
-
for(let b=0;b<a.length;b++){const c=a[b],d=c.getConnections_(!0);for(let e=0;e<d.length;e++)d[e].setTracking(!1);for(const e of c.getIcons())hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&e.setBubbleVisible(!1)}}}startTrackingAll(){this.setTracking(!0);let a=[];if(this.type!==ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&this.type!==ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a;
|
|
967
|
-
(c=[],b.outputConnection&&c.push(b.outputConnection),b.nextConnection&&c.push(b.nextConnection),b.previousConnection&&c.push(b.previousConnection)):c=b.getConnections_(!0);for(let d=0;d<c.length;d++)a.push(...c[d].startTrackingAll());a.length||(a=[b])}return a}onFailedConnect(a){const b=this.getSourceBlock();if(getRecordUndo$$module$build$src$core$events$utils()){const c=$.getGroup$$module$build$src$core$events$utils();setTimeout(function(){b.isDisposed()||
|
|
968
|
-
this.bumpAwayFrom(a),$.setGroup$$module$build$src$core$events$utils(!1))}.bind(this),$.config$$module$build$src$core$config.bumpDelay)}}disconnectInternal(a=!0){const {parentConnection:b,childConnection:c}=this.getParentAndChildConnections();if(b&&c){var d=$.getGroup$$module$build$src$core$events$utils();d||$.setGroup$$module$build$src$core$events$utils(!0);var e=b.getSourceBlock(),f=c.getSourceBlock();super.disconnectInternal(a);e.queueRender();
|
|
969
|
-
"block";$.setGroup$$module$build$src$core$events$utils(d)}}respawnShadow_(){super.respawnShadow_();const a=this.targetBlock();a&&(a.initSvg(),a.queueRender())}neighbours(a){return this.dbOpposite.getNeighbours(this,a)}connect_(a){super.connect_(a);var b=this.getSourceBlock();a=a.getSourceBlock();b.updateDisabled();a.updateDisabled();a.queueRender();if(b=b.getInputWithBlock(a))b=b.isVisible(),a.getSvgRoot().style.display=b?"block":"none"}onCheckChanged_(){!this.isConnected()||
|
|
970
|
-
this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){super.setCheck(a);this.sourceBlock_.queueRender();return this}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({focusedNode:this},a);if(b.length){var c=this.getSourceBlock(),d=c.workspace;if(a instanceof PointerEvent)var e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
1034
|
+
a.offsetInBlock),b.translate(a.x,a.y))}closest(a,b){return this.dbOpposite.searchForClosest(this,a,b)}highlight(){this.highlighted=!0;const a=this.findHighlightSvg();if(a){a.style.display="";let b;(b=a.parentElement)==null||b.appendChild(a)}}unhighlight(){this.highlighted=!1;const 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&&
|
|
1035
|
+
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):(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);
|
|
1036
|
+
if(this.targetConnection){const a=this.targetBlock().getDescendants(!1);for(let b=0;b<a.length;b++){const c=a[b],d=c.getConnections_(!0);for(let e=0;e<d.length;e++)d[e].setTracking(!1);for(const e of c.getIcons())hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)&&e.setBubbleVisible(!1)}}}startTrackingAll(){this.setTracking(!0);let a=[];if(this.type!==ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&this.type!==ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a;
|
|
1037
|
+
const b=this.targetBlock();if(b){let c;b.isCollapsed()?(c=[],b.outputConnection&&c.push(b.outputConnection),b.nextConnection&&c.push(b.nextConnection),b.previousConnection&&c.push(b.previousConnection)):c=b.getConnections_(!0);for(let d=0;d<c.length;d++)a.push(...c[d].startTrackingAll());a.length||(a=[b])}return a}onFailedConnect(a){const b=this.getSourceBlock();if(getRecordUndo$$module$build$src$core$events$utils()){const c=$.getGroup$$module$build$src$core$events$utils();setTimeout(function(){b.isDisposed()||
|
|
1038
|
+
b.getParent()||($.setGroup$$module$build$src$core$events$utils(c),this.bumpAwayFrom(a),$.setGroup$$module$build$src$core$events$utils(!1))}.bind(this),$.config$$module$build$src$core$config.bumpDelay)}}disconnectInternal(a=!0){const {parentConnection:b,childConnection:c}=this.getParentAndChildConnections();if(b&&c){var d=$.getGroup$$module$build$src$core$events$utils();d||$.setGroup$$module$build$src$core$events$utils(!0);var e=b.getSourceBlock(),f=c.getSourceBlock();super.disconnectInternal(a);e.queueRender();
|
|
1039
|
+
f.updateDisabled();f.queueRender();f.getSvgRoot().style.display="block";$.setGroup$$module$build$src$core$events$utils(d)}}respawnShadow_(){super.respawnShadow_();const a=this.targetBlock();a&&(a.initSvg(),a.queueRender())}neighbours(a){return this.dbOpposite.getNeighbours(this,a)}connect_(a){super.connect_(a);var b=this.getSourceBlock();a=a.getSourceBlock();b.updateDisabled();a.updateDisabled();a.queueRender();if(b=b.getInputWithBlock(a))b=b.isVisible(),a.getSvgRoot().style.display=b?"block":"none"}onCheckChanged_(){!this.isConnected()||
|
|
1040
|
+
this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){super.setCheck(a);this.sourceBlock_.queueRender();return this}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({focusedNode:this},a);if(b.length){var c=this.getSourceBlock(),d=c.workspace;if(a instanceof PointerEvent)var e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
971
1041
|
a.clientY);else e=new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y),e=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(d,e).translate(c.RTL?-5:5,5);show$$module$build$src$core$contextmenu(a,b,c.RTL,d,e)}}getFocusableElement(){const a=this.findHighlightSvg();if(a)return a;throw Error("No highlight SVG found corresponding to this connection.");}getFocusableTree(){return this.getSourceBlock().workspace}onNodeFocus(){this.highlight();this.getSourceBlock().workspace.scrollBoundsIntoView(this.getSourceBlock().getBoundingRectangleWithoutChildren())}onNodeBlur(){this.unhighlight()}canBeFocused(){return!0}findHighlightSvg(){return document.getElementById(this.id)}};
|
|
972
1042
|
(function(a){a=a.TrackedState||(a.TrackedState={});a[a.WILL_TRACK=-1]="WILL_TRACK";a[a.UNTRACKED=0]="UNTRACKED";a[a.TRACKED=1]="TRACKED"})(RenderedConnection$$module$build$src$core$rendered_connection||(RenderedConnection$$module$build$src$core$rendered_connection={}));var TrackedState$$module$build$src$core$rendered_connection=RenderedConnection$$module$build$src$core$rendered_connection.TrackedState,module$build$src$core$rendered_connection={};
|
|
973
1043
|
module$build$src$core$rendered_connection.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$rendered_connection.TrackedState=TrackedState$$module$build$src$core$rendered_connection;var Input$$module$build$src$core$inputs$input=class{constructor(a,b){this.name=a;this.sourceBlock=b;this.fieldRow=[];this.align=$.Align$$module$build$src$core$inputs$align.LEFT;this.visible=!0;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM;this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this}insertFieldAt(a,b,c){if(a<0||a>this.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!(b||
|
|
974
1044
|
b===""&&c))return a;typeof b==="string"&&(b=$.fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock);this.sourceBlock.initialized&&this.initField(b);b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock.rendered&&this.sourceBlock.queueRender();return a}removeField(a,b){for(let c=0,d;d=this.fieldRow[c];c++)if(d.name===
|
|
975
1045
|
a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');}isVisible(){return this.visible}setVisible(a){let b=[];if(this.visible===a)return b;this.visible=a;for(let c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);if(this.connection&&this.connection instanceof RenderedConnection$$module$build$src$core$rendered_connection){a?b=this.connection.startTrackingAll():this.connection.stopTrackingAll();const c=
|
|
976
1046
|
this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");
|
|
977
|
-
return this.connection.getShadowDom()}init(){for(const a of this.fieldRow)a.init()}initModel(){for(const a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}
|
|
1047
|
+
return this.connection.getShadowDom()}init(){for(const a of this.fieldRow)a.init()}initModel(){for(const a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}getRowId(){const a=this.getSourceBlock().inputList;if(this===a[0])return this.getSourceBlock().getRowId();const b=a.indexOf(this);let c;const d=
|
|
1048
|
+
((c=a[b-1].connection)==null?void 0:c.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT;let e;return!this.getSourceBlock().getInputsInline()||((e=this.connection)==null?void 0:e.type)===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||d?`${this.getSourceBlock().id}-input${b}`:a[b-1].getRowId()}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={};
|
|
978
1049
|
module$build$src$core$inputs$statement_input.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;var module$build$src$core$inputs$value_input;$.ValueInput$$module$build$src$core$inputs$value_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Value inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.VALUE;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE)}};module$build$src$core$inputs$value_input={};
|
|
979
1050
|
module$build$src$core$inputs$value_input.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;var module$build$src$core$interfaces$i_icon={};module$build$src$core$interfaces$i_icon.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;var module$build$src$core$interfaces$i_comment_icon={};module$build$src$core$interfaces$i_comment_icon.isCommentIcon=isCommentIcon$$module$build$src$core$interfaces$i_comment_icon;var Block$$module$build$src$core$block=class{constructor(a,b,c){this.data=null;this.disposed=!1;this.hue=null;this.colour_="#000000";this.styleName_="";this.suppressPrefixSuffix=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.icons=[];this.disabledReasons=new Set;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable=this.movable=this.deletable=!0;this.collapsed_=this.shadow=!1;this.outputShape_=null;this.rendered=
|
|
980
1051
|
this.isInsertionMarker_=this.initialized=this.disposing=!1;this.onchangeWrapper=this.helpUrl=null;this.statementInputCount=0;this.workspace=a;this.id=c&&!a.getBlockById(c)?c:genUid$$module$build$src$core$utils$idgenerator();a.setBlockById(this.id,this);this.xy=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.isInFlyout=a.isFlyout;this.isInMutator=a.isMutator;this.RTL=a.RTL;if(b){this.type=b;c=Blocks$$module$build$src$core$blocks[b];if(!c||typeof c!=="object")throw TypeError("Invalid block definition for type: "+
|
|
@@ -992,52 +1063,67 @@ if(!c&&a)throw Error("Block not connected to new parent.");if(c&&!a)throw Error(
|
|
|
992
1063
|
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(const b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}isSimpleReporter(){if(!this.outputConnection)return!1;for(const a of this.inputList)if(a.connection||a.fieldRow.length>1)return!1;return!0}getMatchingConnection(a,
|
|
993
1064
|
b){const 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=parseBlockColour$$module$build$src$core$utils$parsing(a);
|
|
994
1065
|
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 "+(a===void 0?"nothing":a+" of type "+
|
|
995
|
-
typeof a)+" instead");for(const b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(const a of this.inputList)for(const b of a.fieldRow)yield b}getVars(){const a=[];for(const b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){const a=[];for(const b of this.getFields())if(b.referencesVariables()){const c=
|
|
996
|
-
a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(const 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){const c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,
|
|
997
|
-
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=
|
|
998
|
-
this.
|
|
999
|
-
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;
|
|
1000
|
-
for(a=1;a<this.inputList.length;a++)if(this.inputList[a-1]instanceof
|
|
1001
|
-
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),
|
|
1002
|
-
this.getSurroundParent();for(;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_!==
|
|
1003
|
-
for(let d=2;d<b.length;d++)b[d-2]==="("&&b[d]===")"&&(b[d-2]=b[d-1],b.splice(d-1,2));let 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=
|
|
1004
|
-
|
|
1005
|
-
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,
|
|
1006
|
-
0;a[
|
|
1007
|
-
this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());a.output!==void 0&&this.setOutput(!0,a.output);a.outputShape!==void 0&&this.setOutputShape(a.outputShape);a.previousStatement!==void 0&&this.setPreviousStatement(!0,a.previousStatement);
|
|
1008
|
-
|
|
1009
|
-
if(Array.isArray(a))for(b=0;b<a.length;b++)apply$$module$build$src$core$extensions(a[b],this,!1)}jsonInitColour(a,b){if("colour"in a)if(a.colour===void 0)console.warn(b+"Undefined colour value.");else{a=a.colour;try{this.setColour(a)}catch(c){console.warn(b+"Illegal colour value: ",
|
|
1010
|
-
[];for(const c in a)this[c]!==void 0&&b.push(c);if(b.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(b));}Object.assign(this,a)}interpolate(a,b,c,d){a=tokenizeInterpolation$$module$build$src$core$utils$parsing(a);this.validateTokens(a,b.length);b=this.interpolateArguments(a,
|
|
1011
|
-
b){const c=[];let d=0;for(let e=0;e<a.length;e++){const f=a[e];if(typeof f==="number"){if(f<1||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+
|
|
1012
|
-
{type:"input_end_row"},c&&(e.align=c);else if(e=this.stringToFieldJson(e),!e)continue;d.push(e)}(a=d.length)&&!this.isInputKeyword(d[a-1].type)&&(a={type:"input_dummy"},c&&(a.align=c),d.push(a));return d}fieldFromJson(a){const b=$.fromJson$$module$build$src$core$field_registry(a);return!b&&a.alt?
|
|
1013
|
-
CENTRE:$.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:$.Align$$module$build$src$core$inputs$align.CENTRE};let d;switch(a.type){case "input_value":d=this.appendValueInput(a.name);break;case "input_statement":d=this.appendStatementInput(a.name);
|
|
1014
|
-
c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,
|
|
1015
|
-
f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+
|
|
1016
|
-
0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===
|
|
1017
|
-
null?void 0:a.getText())!=null?b:null}setCommentText(a){var b;let c;const d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);
|
|
1018
|
-
b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a)
|
|
1019
|
-
"comment",null,d,a))}}setWarningText(a,b){}setMutator(a){}addIcon(a){if(this.hasIcon(a.getType()))throw new DuplicateIconType$$module$build$src$core$icons$exceptions(a);this.icons.push(a);this.icons.sort((b,c)=>b.getWeight()-
|
|
1020
|
-
this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");
|
|
1021
|
-
a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++)if(d.connection)
|
|
1022
|
-
Block$$module$build$src$core$block.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;var module$build$src$core$block={};module$build$src$core$block.Block=Block$$module$build$src$core$block;var disconnectPid$$module$build$src$core$block_animations=null,wobblingBlock$$module$build$src$core$block_animations=null,module$build$src$core$block_animations={};module$build$src$core$block_animations.connectionUiEffect=connectionUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiEffect=disconnectUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiStop=disconnectUiStop$$module$build$src$core$block_animations;
|
|
1066
|
+
typeof a)+" instead");for(const b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(const a of this.inputList)for(const 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())");const a=[];for(const b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){const a=[];for(const b of this.getFields())if(b.referencesVariables()){const c=
|
|
1067
|
+
this.workspace.getVariableMap().getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(const b of this.getFields())b.referencesVariables()&&a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(const 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){const c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,
|
|
1068
|
+
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.");this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=
|
|
1069
|
+
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);
|
|
1070
|
+
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;
|
|
1071
|
+
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;
|
|
1072
|
+
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),
|
|
1073
|
+
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(){let a=this.getSurroundParent();for(;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_!==
|
|
1074
|
+
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)}toString(a,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));let 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=
|
|
1075
|
+
"?"){const b=[];for(const d of this.inputList)if(d.name!=COLLAPSED_INPUT_NAME$$module$build$src$core$constants){for(const e of d.fieldRow)b.push(e.getText());if(d.connection){const e=d.connection.targetBlock();if(e){var c=d.connection;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,
|
|
1076
|
+
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,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,
|
|
1077
|
+
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=0;a[`args${c}`];){if(a[`message${c}`]===void 0)throw Error(b+`args${c} must have a corresponding message (message${c}).`);c++}a.style&&typeof a.style==="object"&&(this.hat=a.style.hat,a.style=null);if(a.style&&a.colour)throw Error(b+"Must not have both a colour and a style.");a.style?this.jsonInitStyle(a,
|
|
1078
|
+
b):this.jsonInitColour(a,b);for(c=0;a[`message${c}`]!==void 0;)this.interpolate(a[`message${c}`]||"",a[`args${c}`]||[],a[`implicitAlign${c}`]||a[`lastDummyAlign${c}`],b),c++;a.inputsInline!==void 0&&($.disable$$module$build$src$core$events$utils(),this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());a.output!==void 0&&this.setOutput(!0,a.output);a.outputShape!==void 0&&this.setOutputShape(a.outputShape);a.previousStatement!==void 0&&this.setPreviousStatement(!0,a.previousStatement);
|
|
1079
|
+
a.nextStatement!==void 0&&this.setNextStatement(!0,a.nextStatement);a.tooltip!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip),this.setTooltip(c));a.enableContextMenu!==void 0&&(this.contextMenu=!!a.enableContextMenu);a.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);a.helpUrl!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.helpUrl),this.setHelpUrl(c));typeof a.extensions==="string"&&(console.warn(b+
|
|
1080
|
+
"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+a.type+"' block."),a.extensions=[a.extensions]);a.mutator!==void 0&&apply$$module$build$src$core$extensions(a.mutator,this,!0);a=a.extensions;if(Array.isArray(a))for(b=0;b<a.length;b++)apply$$module$build$src$core$extensions(a[b],this,!1)}jsonInitColour(a,b){if("colour"in a)if(a.colour===void 0)console.warn(b+"Undefined colour value.");else{a=a.colour;try{this.setColour(a)}catch(c){console.warn(b+"Illegal colour value: ",
|
|
1081
|
+
a)}}}jsonInitStyle(a,b){a=a.style;try{this.setStyle(a)}catch(c){console.warn(b+"Style does not exist: ",a)}}mixin(a,b){if(b!==void 0&&typeof b!=="boolean")throw Error("opt_disableCheck must be a boolean if provided");if(!b){b=[];for(const c in a)this[c]!==void 0&&b.push(c);if(b.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(b));}Object.assign(this,a)}interpolate(a,b,c,d){a=tokenizeInterpolation$$module$build$src$core$utils$parsing(a);this.validateTokens(a,b.length);b=this.interpolateArguments(a,
|
|
1082
|
+
b,c);c=[];for(let e=0,f;f=b[e];e++)if(this.isInputKeyword(f.type)){if(a=this.inputFromJson(f,d)){for(let g=0,h;h=c[g];g++)a.appendField(h[0],h[1]);c.length=0}}else(a=this.fieldFromJson(f))&&c.push([a,f.name])}validateTokens(a,b){const c=[];let d=0;for(let e=0;e<a.length;e++){const f=a[e];if(typeof f==="number"){if(f<1||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+
|
|
1083
|
+
this.type+'": Message does not reference all '+b+" arg(s).");}interpolateArguments(a,b,c){const d=[];for(let f=0;f<a.length;f++){var e=a[f];typeof e==="number"&&(e=b[e-1]);if(typeof e==="string")if(e==="\n")e={type:"input_end_row"},c&&(e.align=c);else if(e=this.stringToFieldJson(e),!e)continue;d.push(e)}(a=d.length)&&!this.isInputKeyword(d[a-1].type)&&(a={type:"input_dummy"},c&&(a.align=c),d.push(a));return d}fieldFromJson(a){const b=$.fromJson$$module$build$src$core$field_registry(a);return!b&&a.alt?
|
|
1084
|
+
typeof a.alt==="string"?(a=this.stringToFieldJson(a.alt))?this.fieldFromJson(a):null:this.fieldFromJson(a.alt):b}inputFromJson(a,b){var c={LEFT:$.Align$$module$build$src$core$inputs$align.LEFT,RIGHT:$.Align$$module$build$src$core$inputs$align.RIGHT,CENTRE:$.Align$$module$build$src$core$inputs$align.CENTRE,CENTER:$.Align$$module$build$src$core$inputs$align.CENTRE};let d;switch(a.type){case "input_value":d=this.appendValueInput(a.name);break;case "input_statement":d=this.appendStatementInput(a.name);
|
|
1085
|
+
break;case "input_dummy":d=this.appendDummyInput(a.name);break;case "input_end_row":d=this.appendEndRowInput(a.name);break;default:d=this.appendInputFromRegistry(a.type,a.name)}if(!d)return null;a.check&&d.setCheck(a.check);a.align&&(c=c[a.align.toUpperCase()],c===void 0?console.warn(b+"Illegal align value: ",a.align):d.setAlign(c));return d}isInputKeyword(a){return a==="input_value"||a==="input_statement"||a==="input_dummy"||a==="input_end_row"||hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,
|
|
1086
|
+
a)}stringToFieldJson(a){return(a=a.trim())?{type:"field_label",text:a}:null}moveInputBefore(a,b){if(a!==b){var c=-1,d=b?-1:this.inputList.length;for(let e=0,f;f=this.inputList[e];e++)if(f.name===a){if(c=e,d!==-1)break}else if(b&&f.name===b&&(d=e,c!==-1))break;if(c===-1)throw Error('Named input "'+a+'" not found.');if(d===-1)throw Error('Reference input "'+b+'" not found.');this.moveNumberedInputBefore(c,d)}}moveNumberedInputBefore(a,b){if(a===b)throw Error("Can't move input to itself.");if(a>=this.inputList.length)throw RangeError("Input index "+
|
|
1087
|
+
a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");const c=this.inputList[a];this.inputList.splice(a,1);a<b&&b--;this.inputList.splice(b,0,c)}removeInput(a,b){for(let c=0,d;d=this.inputList[c];c++)if(d.name===a)return d instanceof StatementInput$$module$build$src$core$inputs$statement_input&&this.statementInputCount--,d.dispose(),this.inputList.splice(c,1),!0;if(b)return!1;throw Error("Input not found: "+a);}getInput(a){for(let b=0,c;c=this.inputList[b];b++)if(c.name===
|
|
1088
|
+
a)return c;return null}getInputTargetBlock(a){return(a=this.getInput(a))&&a.connection&&a.connection.targetBlock()}getCommentText(){let a,b;return(b=(a=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:a.getText())!=null?b:null}setCommentText(a){var b;let c;const d=(c=(b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT))==null?void 0:b.getText())!=null?c:null;if(d!==a){if(a!==null){b=this.getIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);
|
|
1089
|
+
if(!b){b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,IconType$$module$build$src$core$icons$icon_types.COMMENT.toString(),!1);if(!b)throw Error("No comment icon class is registered, so a comment cannot be set");b=new b(this);if(!isCommentIcon$$module$build$src$core$interfaces$i_comment_icon(b))throw Error("The class registered as a comment icon does not conform to the ICommentIcon interface");b=this.addIcon(b)}$.disable$$module$build$src$core$events$utils();b.setText(a);
|
|
1090
|
+
$.enable$$module$build$src$core$events$utils()}else this.removeIcon(IconType$$module$build$src$core$icons$icon_types.COMMENT);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this,"comment",null,d,a))}}setWarningText(a,b){}setMutator(a){}addIcon(a){if(this.hasIcon(a.getType()))throw new DuplicateIconType$$module$build$src$core$icons$exceptions(a);this.icons.push(a);this.icons.sort((b,c)=>b.getWeight()-
|
|
1091
|
+
c.getWeight());return a}removeIcon(a){if(!this.hasIcon(a))return!1;let b;(b=this.getIcon(a))==null||b.dispose();this.icons=this.icons.filter(c=>!c.getType().equals(a));return!0}hasIcon(a){return this.icons.some(b=>b.getType().equals(a))}getIcon(a){return a instanceof IconType$$module$build$src$core$icons$icon_types?this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");
|
|
1092
|
+
const d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this);c&&d.setReason(c);this.xy.translate(a,b);d.recordNew();fire$$module$build$src$core$events$utils(d)}makeConnection_(a){return new Connection$$module$build$src$core$connection(this,a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++){if(!d.connection)continue;var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=
|
|
1093
|
+
this.getNextBlock())?b.allInputsFilled(a):!0}toDevString(){let a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a}};Block$$module$build$src$core$block.COLLAPSED_INPUT_NAME=COLLAPSED_INPUT_NAME$$module$build$src$core$constants;Block$$module$build$src$core$block.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;var module$build$src$core$block={};module$build$src$core$block.Block=Block$$module$build$src$core$block;var disconnectPid$$module$build$src$core$block_animations=null,wobblingBlock$$module$build$src$core$block_animations=null,module$build$src$core$block_animations={};module$build$src$core$block_animations.connectionUiEffect=connectionUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiEffect=disconnectUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiStop=disconnectUiStop$$module$build$src$core$block_animations;
|
|
1023
1094
|
module$build$src$core$block_animations.disposeUiEffect=disposeUiEffect$$module$build$src$core$block_animations;var BlockPaster$$module$build$src$core$clipboard$block_paster=class{paste(a,b,c){if(!b.isCapacityAvailable(a.typeCounts))return null;c&&(a.blockState.x=c.x,a.blockState.y=c.y);c=c||new Coordinate$$module$build$src$core$utils$coordinate(a.blockState.x||0,a.blockState.y||0);$.disable$$module$build$src$core$events$utils();let d;try{d=append$$module$build$src$core$serialization$blocks(a.blockState,b),moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster(d,c)}finally{$.enable$$module$build$src$core$events$utils()}if(!d)return d;
|
|
1024
1095
|
isEnabled$$module$build$src$core$events$utils()&&!d.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(d));const e=d;finishQueuedRenders$$module$build$src$core$render_management().then(()=>$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e));return d}};BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE="block";
|
|
1025
|
-
register$$module$build$src$core$clipboard$registry(BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,new BlockPaster$$module$build$src$core$clipboard$block_paster);var module$build$src$core$clipboard$block_paster={};module$build$src$core$clipboard$block_paster.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard$block_paster.moveBlockToNotConflict=moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster;var bumpIntoBounds$$module$build$src$core$bump_objects=bumpObjectIntoBounds$$module$build$src$core$bump_objects,module$build$src$core$bump_objects={};module$build$src$core$bump_objects.bumpIntoBounds=bumpObjectIntoBounds$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpIntoBoundsHandler=bumpIntoBoundsHandler$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpTopObjectsIntoBounds=bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects;var
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
(
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
b
|
|
1039
|
-
|
|
1040
|
-
this.
|
|
1096
|
+
register$$module$build$src$core$clipboard$registry(BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,new BlockPaster$$module$build$src$core$clipboard$block_paster);var module$build$src$core$clipboard$block_paster={};module$build$src$core$clipboard$block_paster.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard$block_paster.moveBlockToNotConflict=moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster;var bumpIntoBounds$$module$build$src$core$bump_objects=bumpObjectIntoBounds$$module$build$src$core$bump_objects,module$build$src$core$bump_objects={};module$build$src$core$bump_objects.bumpIntoBounds=bumpObjectIntoBounds$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpIntoBoundsHandler=bumpIntoBoundsHandler$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpTopObjectsIntoBounds=bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects;var longModifierNames$$module$build$src$core$utils$shortcut_formatting={Control:$.Msg$$module$build$src$core$msg.CONTROL_KEY,Meta:$.Msg$$module$build$src$core$msg.COMMAND_KEY,Alt:APPLE$$module$build$src$core$utils$useragent?$.Msg$$module$build$src$core$msg.OPTION_KEY:$.Msg$$module$build$src$core$msg.ALT_KEY},shortModifierNames$$module$build$src$core$utils$shortcut_formatting={Control:$.Msg$$module$build$src$core$msg.CONTROL_KEY,Meta:"\u2318",Alt:APPLE$$module$build$src$core$utils$useragent?"\u2325":
|
|
1097
|
+
$.Msg$$module$build$src$core$msg.ALT_KEY},modifierOrdering$$module$build$src$core$utils$shortcut_formatting=["Meta","Control","Alt","Shift"],module$build$src$core$utils$shortcut_formatting={};module$build$src$core$utils$shortcut_formatting.getLongActionShortcutsAsKeys=getLongActionShortcutsAsKeys$$module$build$src$core$utils$shortcut_formatting;module$build$src$core$utils$shortcut_formatting.getShortActionShortcut=getShortActionShortcut$$module$build$src$core$utils$shortcut_formatting;var unconstrainedMoveHintId$$module$build$src$core$hints="unconstrainedMoveHint",constrainedMoveHintId$$module$build$src$core$hints="constrainedMoveHint",helpHintId$$module$build$src$core$hints="helpHint",blockNavigationHintId$$module$build$src$core$hints="blockNavigationHint",workspaceNavigationHintId$$module$build$src$core$hints="workspaceNavigationHint",module$build$src$core$hints={};module$build$src$core$hints.clearMoveHints=clearMoveHints$$module$build$src$core$hints;
|
|
1098
|
+
module$build$src$core$hints.showBlockNavigationHint=showBlockNavigationHint$$module$build$src$core$hints;module$build$src$core$hints.showConstrainedMovementHint=showConstrainedMovementHint$$module$build$src$core$hints;module$build$src$core$hints.showHelpHint=showHelpHint$$module$build$src$core$hints;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 DragDisposition$$module$build$src$core$interfaces$i_draggable;(function(a){a[a.COMMIT=1]="COMMIT";a[a.DELETE=2]="DELETE";a[a.REVERT=3]="REVERT"})(DragDisposition$$module$build$src$core$interfaces$i_draggable||(DragDisposition$$module$build$src$core$interfaces$i_draggable={}));var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.DragDisposition=DragDisposition$$module$build$src$core$interfaces$i_draggable;
|
|
1099
|
+
module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;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={}));
|
|
1100
|
+
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.BLOCK_CONNECTION_OFFSET=10;this.workspace=a.workspace}isMovable(){let a;return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&&
|
|
1101
|
+
!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.moveTo(a)}getTargetBlock(){if(this.block.isShadow()){var a=this.block.getParent();if(a)return a}else if(this.block.isInFlyout&&this.block.workspace.targetWorkspace&&
|
|
1102
|
+
(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}startDrag(a){var b=this.getTargetBlock();if(b!==this.block)return b.startDrag(a);this.dragging=!0;this.fireDragStartEvent();this.startLoc=
|
|
1103
|
+
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);startTextWidthCache$$module$build$src$core$utils$dom();this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();b=this.shouldHealStack(a);this.shouldDisconnect(b)&&this.disconnectBlock(b);this.block.setDragging(!0);let c;
|
|
1104
|
+
(c=this.workspace.getLayerManager())==null||c.moveToDragLayer(this.block);this.getVisibleBubbles(this.block).forEach(d=>{let e;(e=this.workspace.getLayerManager())==null||e.moveToDragLayer(d,!1)});a instanceof KeyboardEvent&&(this.cacheAllConnectionPairs(),this.block.moveDuringDrag(this.startLoc),a=this.updateConnectionPreview(this.block,new Coordinate$$module$build$src$core$utils$coordinate(0,0)))&&(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT?(a=this.block.getRelativeToSurfaceXY(),
|
|
1105
|
+
a=new Coordinate$$module$build$src$core$utils$coordinate(a.x+this.BLOCK_CONNECTION_OFFSET,a.y-this.BLOCK_CONNECTION_OFFSET)):a=new Coordinate$$module$build$src$core$utils$coordinate(a.x+this.BLOCK_CONNECTION_OFFSET,a.y+this.BLOCK_CONNECTION_OFFSET),this.block.moveDuringDrag(a));return this.block}cacheAllConnectionPairs(){const a=this.block.workspace.connectionChecker,b=[];this.allConnectionPairs=[];const c=this.getLocalConnections(this.block);for(const d of this.block.workspace.getTopBlocks(!0))b.push(...this.getAllConnections(d));
|
|
1106
|
+
for(const d of b)for(const e of c){let f;!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?
|
|
1107
|
+
-1:0})}shouldHealStack(a){return a instanceof 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.storeInitialConnections(a);this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}storeInitialConnections(a){var b=null;let c=null,d;if((d=this.block.outputConnection)==
|
|
1108
|
+
null?0:d.isConnected())b=this.block.outputConnection,c=this.block.outputConnection.targetConnection;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?
|
|
1109
|
+
b:null)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,!1,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var a=
|
|
1110
|
+
new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this.block);a.setReason(["drag"]);a.oldCoordinate=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}drag(a,b){this.moveMode=b instanceof KeyboardEvent&&!b.ctrlKey&&!b.metaKey?MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED:MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED;this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.UNCONSTRAINED&&
|
|
1111
|
+
this.block.moveDuringDrag(a);this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.startLoc));if(this.connectionCandidate){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED){const {local:c,neighbour:d}=this.connectionCandidate;a=this.startLoc.x+(d.x-c.x);b=this.startLoc.y+(d.y-c.y);const e=this.BLOCK_CONNECTION_OFFSET;c.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||c.type===
|
|
1112
|
+
ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?(a+=e,b+=e):(a-=e,b-=e);this.block.moveDuringDrag(new Coordinate$$module$build$src$core$utils$coordinate(a,b))}}else this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED&&(showUnconstrainedMoveHint$$module$build$src$core$hints(this.workspace,!0),this.workspace.getAudioManager().playErrorBeep())}updateConnectionPreview(a,b){var c=this.connectionCandidate;const d=this.getConnectionCandidate(b);if(d){this.connectionCandidate=
|
|
1113
|
+
b=c&&this.currCandidateIsBetter(c,b,d)?c:d;var {local:e,neighbour:f}=b;b=e.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE||e.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;var g;c=f.isConnected()&&!((g=f.targetBlock())==null?0:g.isInsertionMarker());if(b&&c&&!this.orphanCanConnectAtEnd(a,f.targetBlock(),e.type)){let k;(k=this.connectionPreviewer)==null||k.previewReplacement(e,f,f.targetBlock())}else{let k;(k=this.connectionPreviewer)==null||
|
|
1114
|
+
k.previewConnection(e,f)}return f}let h;(h=this.connectionPreviewer)==null||h.hidePreview();this.connectionCandidate=null}orphanCanConnectAtEnd(a,b,c){return!!Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(a,c===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?b.outputConnection:b.previousConnection)}currCandidateIsBetter(a,b,c){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED)return!1;const {local:d,neighbour:e}=
|
|
1115
|
+
a;a=new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y);const f=new Coordinate$$module$build$src$core$utils$coordinate(e.x,e.y);b=Coordinate$$module$build$src$core$utils$coordinate.distance(Coordinate$$module$build$src$core$utils$coordinate.sum(a,b),f);return c.distance>b-$.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(a){if(this.moveMode===MoveMode$$module$build$src$core$dragging$block_drag_strategy.CONSTRAINED)return a=this.getDirectionToNewLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,
|
|
1116
|
+
a)),this.findTraversalCandidate(a);let b=this.getSearchRadius();const c=this.getLocalConnections(this.block);let d=null;for(const e of c){const {connection:f,radius:g}=e.closest(b,a);f&&(d={local:e,neighbour:f,distance:g},b=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){const b=
|
|
1117
|
+
a.getConnections_(!1);var c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);a=[a.outputConnection,a.previousConnection,a.nextConnection].filter(d=>!!d);c=[];for(const 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();
|
|
1118
|
+
stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations();let 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=>{let f;return(f=this.workspace.getLayerManager())==null?void 0:f.moveOffDragLayer(e,BUBBLE$$module$build$src$core$layers,
|
|
1119
|
+
!1)});this.block.setDragging(!1)}this.connectionCandidate?(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep());this.allConnectionPairs=[]}disposeStep(){const a=$.getGroup$$module$build$src$core$events$utils();$.setGroup$$module$build$src$core$events$utils(this.originalEventGroup);this.block.snapToGrid();let b;(b=this.connectionPreviewer)==null||b.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(a)}applyConnections(a){const {local:b,
|
|
1120
|
+
neighbour:c}=a;b.connect(c);const 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(){let a;(a=this.connectionPreviewer)==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&&
|
|
1121
|
+
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.moveTo(this.startLoc,["drag"]);let b;(b=this.workspace.getLayerManager())==null||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.getVisibleBubbles(this.block).forEach(c=>{let d;return(d=this.workspace.getLayerManager())==null?void 0:
|
|
1122
|
+
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);this.dragging=!1}findTraversalCandidate(a){const b=this.allConnectionPairs;if(a===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE||!b.length)return this.connectionCandidate;a=a===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT||
|
|
1123
|
+
a===Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN;const c=b.findIndex(d=>{let e,f;return((e=this.connectionCandidate)==null?void 0:e.local)===d.local&&((f=this.connectionCandidate)==null?void 0:f.neighbour)===d.neighbour});return a?c===-1?this.pairToCandidate(b[0]):c===b.length-1?null:this.pairToCandidate(b[c+1]):c===-1?this.pairToCandidate(b[b.length-1]):c===0?null:this.pairToCandidate(b[c-1])}pairToCandidate(a){return Object.assign({},a,{distance:0})}getDirectionToNewLocation(a){const b=
|
|
1124
|
+
this.block.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.difference(a,b);const {x:c,y:d}=a;if(c){if(c<0)return Direction$$module$build$src$core$keyboard_nav$keyboard_mover.LEFT;if(c>0)return Direction$$module$build$src$core$keyboard_nav$keyboard_mover.RIGHT}else if(d){if(d<0)return Direction$$module$build$src$core$keyboard_nav$keyboard_mover.UP;if(d>0)return Direction$$module$build$src$core$keyboard_nav$keyboard_mover.DOWN}return Direction$$module$build$src$core$keyboard_nav$keyboard_mover.NONE}getAllConnections(a){if(a.isShadow())return[];
|
|
1125
|
+
const b=[];a.outputConnection&&b.push(a.outputConnection);a.previousConnection&&b.push(a.previousConnection);if(!a.isCollapsed())for(const c of a.inputList)if(c.connection&&c.isVisible()){b.push(c.connection);const d=c.connection.targetBlock();d&&b.push(...this.getAllConnections(d))}a.nextConnection&&(b.push(a.nextConnection),(a=a.nextConnection.targetBlock())&&b.push(...this.getAllConnections(a)));return b}},module$build$src$core$dragging$block_drag_strategy={};
|
|
1126
|
+
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){super(b,c,d);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;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);this.paragraph=this.stringToSvg(a,
|
|
1041
1127
|
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?
|
|
1042
1128
|
"rtl":"ltr"}`},a)}createTextFragments(a,b){let c=1;return b.split("\n").map(d=>{const 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(const c of b)c.setAttribute("text-anchor","start"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){const a=
|
|
1043
1129
|
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"},
|
|
@@ -1046,30 +1132,31 @@ a.dispose()}getWeight(){return WarningIcon$$module$build$src$core$icons$warning_
|
|
|
1046
1132
|
b){if(this.textMap.get(b)===a)return this;a?this.textMap.set(b,a):this.textMap.delete(b);let c;(c=this.textBubble)==null||c.setText(this.getText());return this}getText(){return[...this.textMap.values()].join("\n")}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(a){const b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(b.bubbleIsVisible()!==a){yield finishQueuedRenders$$module$build$src$core$render_management();
|
|
1047
1133
|
if(a)b.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(b.getText(),b.sourceBlock.workspace,b.getAnchorLocation(),b.getBubbleOwnerRect()),b.applyColour();else{let c;(c=b.textBubble)==null||c.dispose();b.textBubble=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"warning"))}})}getBubble(){return this.textBubble}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$warning_icon/
|
|
1048
1134
|
2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){const a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}};WarningIcon$$module$build$src$core$icons$warning_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.WARNING;WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT=2;
|
|
1049
|
-
var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);
|
|
1050
|
-
this.workspace=a;this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});b&&addClass$$module$build$src$core$utils$dom(this.svgGroup,b);this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup,this.style);a=this.pathObject.svgPath;a.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(a);
|
|
1051
|
-
this.doInit_()}initSvg(){if(!this.initialized){for(var a of this.inputList)a.init();for(const b of this.getIcons())b.initView(this.createIconPointerDownListener(b)),b.updateEditable();this.applyColour();this.pathObject.updateMovable(this.isMovable()||this.isInFlyout);(a=this.getSvgRoot())&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown);a.parentNode||
|
|
1052
|
-
fireSelectedEvent$$module$build$src$core$common(this)}unselect(){this.removeSelect();fireSelectedEvent$$module$build$src$core$common(null)}setParent(a){var b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();
|
|
1053
|
-
e==null?void 0:e.getFocusableElement())!=null?f:null);a?(a.getSvgRoot().appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)):b&&(a=this.workspace.getCanvas().querySelector(".blocklyDragging"),b=a==null?void 0:a.parentElement,f=this.workspace.getCanvas(),b===
|
|
1054
|
-
if(!a)throw Error("Cannot calculate position because the workspace has not been appended");let b=0,c=0,d=this.getSvgRoot();if(d){do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(d);b+=e.x;c+=e.y;d=d.parentNode}while(d&&!a.hasLayer(d))}return new Coordinate$$module$build$src$core$utils$coordinate(b,
|
|
1055
|
-
c&&e.setReason(c));a=new Coordinate$$module$build$src$core$utils$coordinate(a,b);b=this.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.sum(b,a);this.translate(a.x,a.y);this.updateComponentLocations(a);d&&e&&(e.recordNew(),
|
|
1056
|
-
this.getTranslation())}getTranslation(){return this.translation}moveTo(a,b){const c=this.getRelativeToSurfaceXY();this.moveBy(a.x-c.x,a.y-c.y,b)}moveDuringDrag(a){this.translate(a.x,a.y);this.getSvgRoot().setAttribute("transform",this.getTranslation());
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
a
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
return new Coordinate$$module$build$src$core$utils$coordinate(
|
|
1135
|
+
var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);
|
|
1136
|
+
if(!a.rendered)throw TypeError("Cannot create a rendered block in a headless workspace");this.workspace=a;this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});b&&addClass$$module$build$src$core$utils$dom(this.svgGroup,b);this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup,this.style);a=this.pathObject.svgPath;a.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(a);
|
|
1137
|
+
this.svgGroup.setAttribute("data-id",this.id);a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.doInit_()}initSvg(){if(!this.initialized){for(var a of this.inputList)a.init();for(const b of this.getIcons())b.initView(this.createIconPointerDownListener(b)),b.updateEditable();this.applyColour();this.pathObject.updateMovable(this.isMovable()||this.isInFlyout);(a=this.getSvgRoot())&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown);a.parentNode||
|
|
1138
|
+
this.workspace.getCanvas().appendChild(a);this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){this.addSelect();fireSelectedEvent$$module$build$src$core$common(this)}unselect(){this.removeSelect();fireSelectedEvent$$module$build$src$core$common(null)}setParent(a){var b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();
|
|
1139
|
+
var c=this.getSvgRoot();if(!this.workspace.isClearing&&c){var d=this.getRelativeToSurfaceXY(),e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),f,g=this.getSvgRoot().contains((f=e==null?void 0:e.getFocusableElement())!=null?f:null);a?(a.getSvgRoot().appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)):b&&(a=this.workspace.getCanvas().querySelector(".blocklyDragging"),b=a==null?void 0:a.parentElement,f=this.workspace.getCanvas(),b===
|
|
1140
|
+
f?f.insertBefore(c,a):(f.appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)),this.translate(d.x,d.y));this.applyColour()}}}getRelativeToSurfaceXY(){const a=this.workspace.getLayerManager();if(!a)throw Error("Cannot calculate position because the workspace has not been appended");let b=0,c=0,d=this.getSvgRoot();if(d){do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(d);b+=e.x;c+=e.y;d=d.parentNode}while(d&&!a.hasLayer(d))}return new Coordinate$$module$build$src$core$utils$coordinate(b,
|
|
1141
|
+
c)}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");const d=isEnabled$$module$build$src$core$events$utils();let e=null;d&&(e=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this),c&&e.setReason(c));a=new Coordinate$$module$build$src$core$utils$coordinate(a,b);b=this.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.sum(b,a);this.translate(a.x,a.y);this.updateComponentLocations(a);d&&e&&(e.recordNew(),
|
|
1142
|
+
fire$$module$build$src$core$events$utils(e));this.workspace.resizeContents()}translate(a,b){this.translation=`translate(${a}, ${b})`;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(a,b);this.getSvgRoot().setAttribute("transform",this.getTranslation())}getTranslation(){return this.translation}moveTo(a,b){const c=this.getRelativeToSurfaceXY();this.moveBy(a.x-c.x,a.y-c.y,b)}moveDuringDrag(a){this.translate(a.x,a.y);this.getSvgRoot().setAttribute("transform",this.getTranslation());
|
|
1143
|
+
this.updateComponentLocations(a)}snapToGrid(){if(!this.isDeadOrDying()&&!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getBoundingRectangle(){return this.getBoundingRectangleWithDimensions(this.getHeightWidth())}getBoundingRectangleWithoutChildren(){return this.getBoundingRectangleWithDimensions({height:this.height,width:this.childlessWidth})}getBoundingRectangleWithDimensions(a){const b=
|
|
1144
|
+
this.getRelativeToSurfaceXY();let c,d;this.RTL?(c=b.x-a.width,d=b.x):(c=b.x,d=b.x+a.width);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+a.height,c,d)}markDirty(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(let a=0,b;b=this.inputList[a];a++)b.markDirty()}setCollapsed(a){this.collapsed_!==a&&(super.setCollapsed(a),this.updateCollapsed())}childHasWarning(){var a=this.getNextBlock();a=a?new Set(a.getDescendants(!1)):null;const b=this.getDescendants(!1);for(const c of b){if(c===
|
|
1145
|
+
this)continue;let d;if(((d=a)==null||!d.has(c))&&c.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))return!0}return!1}updateCollapsed(){var a=this.isCollapsed();const b=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,c=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;for(let e=0,f;f=this.inputList[e];e++)f.name!==b&&f.setVisible(!a);for(var d of this.getIcons())d.updateCollapsed();a?(addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.childHasWarning()&&
|
|
1146
|
+
this.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID),a=this.toString(COLLAPSE_CHARS$$module$build$src$core$internal_constants),(d=this.getField(c))?d.setValue(a):(this.getInput(b)||this.appendDummyInput(b)).appendField(new FieldLabel$$module$build$src$core$field_label(a),c)):(this.updateDisabled(),this.removeInput(b),removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.setWarningText(null,
|
|
1147
|
+
BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID))}onMouseDown(a){if(!this.workspace.isReadOnly()){var b=this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)}}showHelp(){const a=typeof this.helpUrl==="function"?this.helpUrl():this.helpUrl;a&&window.open(a)}generateContextMenu(a){if(this.workspace.isReadOnly()||!this.contextMenu)return null;a=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({block:this,focusedNode:this},a);this.customContextMenu&&
|
|
1148
|
+
this.customContextMenu(a);return a}calculateContextMenuLocation(a){if(a instanceof PointerEvent)return new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY());let b,c;const d=(b=this.inputList.filter(e=>e.isVisible()).flatMap(e=>e.fieldRow).find(e=>e.isVisible()))==null?void 0:(c=b.getSvgRoot())==null?void 0:c.getBoundingClientRect();return new Coordinate$$module$build$src$core$utils$coordinate(this.RTL?
|
|
1149
|
+
a.x-5:a.x+5,(d&&d.height?d.y+d.height:a.y+this.height)+5)}showContextMenu(a){const b=this.generateContextMenu(a),c=this.calculateContextMenuLocation(a);b&&b.length&&(show$$module$build$src$core$contextmenu(a,b,this.RTL,this.workspace,c),setCurrentBlock$$module$build$src$core$contextmenu(this))}updateComponentLocations(a){this.dragging||this.updateConnectionLocations(a);this.updateIconLocations(a);this.updateFieldLocations(a);for(const b of this.getChildren(!1))b.updateComponentLocations(Coordinate$$module$build$src$core$utils$coordinate.sum(a,
|
|
1063
1150
|
b.relativeCoords))}updateConnectionLocations(a){for(const b of this.getConnections_(!1))b.moveToOffset(a)}updateIconLocations(a){for(const b of this.getIcons())b.onLocationChange(a)}updateFieldLocations(a){for(const b of this.inputList)for(const c of b.fieldRow)c.onLocationChange(a)}addClass(a){addClass$$module$build$src$core$utils$dom(this.svgGroup,a)}removeClass(a){removeClass$$module$build$src$core$utils$dom(this.svgGroup,a)}setDragging(a){(this.dragging=a)?(this.translation="",draggingConnections$$module$build$src$core$common.push(...this.getConnections_(!0)),
|
|
1064
|
-
this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)}setMovable(a){super.setMovable(a);this.pathObject.updateMovable(a)}setEditable(a){super.setEditable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");
|
|
1065
|
-
0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour()}setInsertionMarker(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup}getNearestNeighbour(){if(!this.workspace.rendered)return null;var a=this.workspace.getAllBlocks(!1).filter(e=>!e.isDeadOrDying());let b=null,
|
|
1066
|
-
this.getRelativeToSurfaceXY();for(const e of a)a=e.getRelativeToSurfaceXY(),a=Math.sqrt(Math.pow(a.x-d.x,2)+Math.pow(a.y-d.y,2)),a<c&&(b=e,c=a);return b}dispose(a,b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();const c=$.getFocusManager$$module$build$src$core$focus_manager();var d,e;if(this.getSvgRoot().contains((e=(d=c.getFocusedNode())==null?void 0:d.getFocusableElement())!=null?e:null)){d=this.getParent();
|
|
1067
|
-
null?f:this.previousConnection){let g;d=(g=e.closest(0,new Coordinate$$module$build$src$core$utils$coordinate(0,0)).connection)==null?void 0:g.getSourceBlock()}}d?c.focusNode(d):(f=this.getNearestNeighbour())?c.focusNode(f):setTimeout(()=>{this.workspace.rendered&&c.focusTree(this.workspace)},0)}b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));super.dispose(!!a);removeNode$$module$build$src$core$utils$dom(this.svgGroup)}disposeInternal(){this.disposing
|
|
1068
|
-
|
|
1069
|
-
null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:a,saveIds:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;(b=(a=this.pathObject).applyColour)==null||b.call(a,this);a=this.getIcons();for(b=0;b<a.length;b++)a[b].applyColour();for(const c of this.getFields())c.applyColour()}updateDisabled(){const a
|
|
1070
|
-
if(this.visuallyDisabled===a){let b;(b=this.getNextBlock())==null||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(const b of this.getChildren(!1))b.updateDisabled()}}setWarningText(a,b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,
|
|
1071
|
-
this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID);c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,
|
|
1072
|
-
(b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();
|
|
1151
|
+
this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)}isDragging(){return this.dragging}setMovable(a){super.setMovable(a);this.pathObject.updateMovable(a)}setEditable(a){super.setEditable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");
|
|
1152
|
+
a=this.getIcons();for(let b=0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour()}setInsertionMarker(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup}getNearestNeighbour(){if(!this.workspace.rendered)return null;var a=this.workspace.getAllBlocks(!1).filter(e=>!e.isDeadOrDying());let b=null,
|
|
1153
|
+
c=Number.MAX_SAFE_INTEGER;const d=this.getRelativeToSurfaceXY();for(const e of a)a=e.getRelativeToSurfaceXY(),a=Math.sqrt(Math.pow(a.x-d.x,2)+Math.pow(a.y-d.y,2)),a<c&&(b=e,c=a);return b}dispose(a,b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();const c=$.getFocusManager$$module$build$src$core$focus_manager();var d,e;if(this.getSvgRoot().contains((e=(d=c.getFocusedNode())==null?void 0:d.getFocusableElement())!=null?e:null)){d=this.getParent();
|
|
1154
|
+
if(!d){var f;if(e=(f=this.outputConnection)!=null?f:this.previousConnection){let g;d=(g=e.closest(0,new Coordinate$$module$build$src$core$utils$coordinate(0,0)).connection)==null?void 0:g.getSourceBlock()}}d?c.focusNode(d):(f=this.getNearestNeighbour())?c.focusNode(f):setTimeout(()=>{this.workspace.rendered&&c.focusTree(this.workspace)},0)}b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));super.dispose(!!a);removeNode$$module$build$src$core$utils$dom(this.svgGroup)}disposeInternal(){this.disposing=
|
|
1155
|
+
!0;super.disposeInternal();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(a=
|
|
1156
|
+
!1){return this.isInsertionMarker_?null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:a,saveIds:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;(b=(a=this.pathObject).applyColour)==null||b.call(a,this);a=this.getIcons();for(b=0;b<a.length;b++)a[b].applyColour();for(const c of this.getFields())c.applyColour()}updateDisabled(){const a=
|
|
1157
|
+
!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===a){let b;(b=this.getNextBlock())==null||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(const b of this.getChildren(!1))b.updateDisabled()}}setWarningText(a,b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,
|
|
1158
|
+
setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(b),this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID);c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,
|
|
1159
|
+
b))}else c&&(b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();
|
|
1073
1160
|
this.queueRender();return a}createIconPointerDownListener(a){return b=>{!this.isDeadOrDying()&&(b=this.workspace.getGesture(b))&&(this.bringToFront(),b.setStartIcon(a),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a))}}removeIcon(a){const b=super.removeIcon(a);a.equals($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null);this.queueRender();return b}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()===c||
|
|
1074
1161
|
this.getInheritedDisabled()||this.updateDisabled()}setDeletable(a){super.setDeletable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable")}setHighlighted(a){this.pathObject.updateHighlighted(a)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(a){this.pathObject.updateDraggingDelete(a)}getColour(){return this.style.colourPrimary}setColour(a){super.setColour(a);
|
|
1075
1162
|
a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);let b,c;(c=(b=this.pathObject).setStyle)==null||c.call(b,a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_&&removeClass$$module$build$src$core$utils$dom(this.svgGroup,this.styleName_);if(b){this.hat=b.hat;let c,d;(d=(c=this.pathObject).setStyle)==null||d.call(c,b);this.colour_=b.colourPrimary;this.style=
|
|
@@ -1080,9 +1167,11 @@ this.nextConnection&&b.push(this.nextConnection);if(a||!this.collapsed_)for(let
|
|
|
1080
1167
|
this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||a.isInFlyout))for(const b of this.getConnections_(!1)){if(b.isSuperior()){let c;(c=b.targetBlock())==null||c.bumpNeighbours()}for(const c of b.neighbours($.config$$module$build$src$core$config.snapRadius))c.getSourceBlock().getRootBlock()!==a&&(b.isConnected()&&c.isConnected()||(b.isSuperior()?c.bumpAwayFrom(b,!1):b.bumpAwayFrom(c,!0)))}}scheduleSnapAndBump(){this.snapToGrid();this.bumpNeighbours()}positionNearConnection(a,
|
|
1081
1168
|
b,c){if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){let d=b.x;b=b.y;d+=c.x-a.getOffsetInBlock().x;b+=c.y-a.getOffsetInBlock().y;this.moveBy(d,b)}}getChildren(a){return super.getChildren(a)}queueRender(){return queueRender$$module$build$src$core$render_management(this)}render(){this.queueRender();triggerQueuedRenders$$module$build$src$core$render_management()}renderEfficiently(){startTextWidthCache$$module$build$src$core$utils$dom();
|
|
1082
1169
|
this.isCollapsed()&&this.updateCollapsed();this.isEnabled()||this.updateDisabled();this.workspace.getRenderer().render(this);this.tightenChildrenEfficiently();stopTextWidthCache$$module$build$src$core$utils$dom()}tightenChildrenEfficiently(){for(const a of this.inputList){const b=a.connection;b&&b.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}getHeightWidth(){let a=this.height,b=this.width;var c=this.getNextBlock();if(c){c=c.getHeightWidth();const d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;
|
|
1083
|
-
a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){
|
|
1084
|
-
Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:typeof d[e]==="object"&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select()
|
|
1085
|
-
|
|
1170
|
+
a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){let b,c;(c=(b=this.pathObject).updateReplacing)==null||c.call(b,a)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isCopyable(){return this.isOwnDeletable()&&this.isOwnMovable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){return this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a,b){this.dragStrategy.endDrag(a,b)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){const a=
|
|
1171
|
+
Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:typeof d[e]==="object"&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()!==
|
|
1172
|
+
this&&finishQueuedRenders$$module$build$src$core$render_management().then(()=>{this.workspace.scrollBoundsIntoView(this.getBoundingRectangleWithoutChildren())})}onNodeBlur(){this.unselect()}canBeFocused(){return!0}performAction(){if(this.workspace.isFlyout)KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.startMove(this);else{if(this.isSimpleReporter())for(const a of this.inputList)for(const b of a.fieldRow)if(b.isClickable()&&b.isFullBlockField()){b.showEditor();return}this.workspace.getNavigator().getFirstChild(this)?
|
|
1173
|
+
showBlockNavigationHint$$module$build$src$core$hints(this.workspace):showHelpHint$$module$build$src$core$hints(this.workspace)}}getParents(){const a=new Set;let b=this.getParent();for(;b;)a.add(b),b=b.getParent();return a}getOutputParents(){const a=new Set;a.add(this);let b,c=(b=this.outputConnection)==null?void 0:b.targetBlock();for(;c;){a.add(c);let d;c=(d=c.outputConnection)==null?void 0:d.targetBlock()}return a}getRowId(){let a,b;const c=(a=this.outputConnection)==null?void 0:(b=a.targetConnection)==
|
|
1174
|
+
null?void 0:b.getParentInput();return c?c.getRowId():this.id}};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={};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 module$build$src$core$interfaces$i_deletable={};module$build$src$core$interfaces$i_deletable.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){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_=a}},module$build$src$core$delete_area={};
|
|
1086
1175
|
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){let 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(){const a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let a=
|
|
1087
1176
|
0,b=0;const c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox();var f;const g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;const 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;const b=this.getSvgMetrics(),c=this.getToolboxMetrics(),
|
|
1088
1177
|
d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox();var f;const g=!((f=this.workspace_.getFlyout())==null?0:f.autoClose);f=e?c.position:d.position;const h=f===Position$$module$build$src$core$utils$toolbox.LEFT||f===Position$$module$build$src$core$utils$toolbox.RIGHT;if(f===Position$$module$build$src$core$utils$toolbox.TOP||f===Position$$module$build$src$core$utils$toolbox.BOTTOM)e&&(b.height-=c.height),g&&(b.height-=d.height);h&&(e&&(b.width-=c.width),g&&(b.width-=d.width));return{height:b.height/
|
|
@@ -1091,7 +1180,8 @@ a=a||this.getViewMetrics(!1);const d={};c||(d.top=a.top,d.bottom=a.top+a.height)
|
|
|
1091
1180
|
b=this.getPaddedContent_(b,d);d=c.top!==void 0?c.top:b.top;const e=c.left!==void 0?c.left:b.left;return{top:d/a,left:e/a,width:((c.right!==void 0?c.right:b.right)-e)/a,height:((c.bottom!==void 0?c.bottom:b.bottom)-d)/a}}getUiMetrics(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}}getMetrics(){const a=this.getToolboxMetrics(),b=this.getFlyoutMetrics(!0),c=this.getSvgMetrics(),d=this.getAbsoluteMetrics(),e=this.getViewMetrics(),
|
|
1092
1181
|
f=this.getContentMetrics(),g=this.getScrollMetrics(!1,e,f);return{contentHeight:f.height,contentWidth:f.width,contentTop:f.top,contentLeft:f.left,scrollHeight:g.height,scrollWidth:g.width,scrollTop:g.top,scrollLeft:g.left,viewHeight:e.height,viewWidth:e.width,viewTop:e.top,viewLeft:e.left,absoluteTop:d.top,absoluteLeft:d.left,svgHeight:c.height,svgWidth:c.width,toolboxWidth:a.width,toolboxHeight:a.height,toolboxPosition:a.position,flyoutWidth:b.width,flyoutHeight:b.height}}};
|
|
1093
1182
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,DEFAULT$$module$build$src$core$registry,MetricsManager$$module$build$src$core$metrics_manager);var module$build$src$core$metrics_manager={};module$build$src$core$metrics_manager.MetricsManager=MetricsManager$$module$build$src$core$metrics_manager;var FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager=class extends MetricsManager$$module$build$src$core$metrics_manager{constructor(a,b){super(a);this.flyout_=b}getBoundingBox(){let a;try{a=this.workspace_.getCanvas().getBBox()}catch(b){a={height:0,y:0,width:0,x:0}}return a}getContentMetrics(a){const b=this.getBoundingBox();a=a?1:this.workspace_.scale;return{height:b.height*a,width:b.width*a,top:b.y*a,left:b.x*a}}getScrollMetrics(a,b,c){b=c||this.getContentMetrics();c=this.flyout_.MARGIN*
|
|
1094
|
-
this.workspace_.scale;a=a?this.workspace_.scale:1;return{height:(b.height+2*c)/a,width:(b.width+b.left+c)/a,top:0,left:0}}},module$build$src$core$flyout_metrics_manager={};module$build$src$core$flyout_metrics_manager.FlyoutMetricsManager=FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager;var
|
|
1183
|
+
this.workspace_.scale;a=a?this.workspace_.scale:1;return{height:(b.height+2*c)/a,width:(b.width+b.left+c)/a,top:0,left:0}}},module$build$src$core$flyout_metrics_manager={};module$build$src$core$flyout_metrics_manager.FlyoutMetricsManager=FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager;var FlyoutSeparator$$module$build$src$core$flyout_separator=class{constructor(a,b){this.gap=a;this.axis=b;this.y=this.x=0}getBoundingRectangle(){switch(this.axis){case "x":return new Rect$$module$build$src$core$utils$rect(this.y,this.y,this.x,this.x+this.gap);case "y":return new Rect$$module$build$src$core$utils$rect(this.y,this.y+this.gap,this.x,this.x)}}moveBy(a,b,c){this.x+=a;this.y+=b}isNavigable(){return!1}getFocusableElement(){throw Error("Cannot be focused");}getFocusableTree(){throw Error("Cannot be focused");
|
|
1184
|
+
}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}},module$build$src$core$flyout_separator={};module$build$src$core$flyout_separator.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;var FlyoutButton$$module$build$src$core$flyout_button=class{constructor(a,b,c,d){this.workspace=a;this.targetWorkspace=b;this.isFlyoutLabel=d;this.height=this.width=0;this.cursorSvg=this.svgText=null;this.text=c.text;this.position=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.callbackKey=c.callbackKey||c.callbackkey;this.cssClass=c["web-class"]||null;this.info=c;a=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton";this.cssClass&&(a+=" "+this.cssClass);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();
|
|
1095
1185
|
this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{id:this.id,"class":a},this.workspace.getCanvas());let e;this.isFlyoutLabel||(e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyFlyoutButtonShadow",rx:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,ry:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,x:1,y:1},this.svgGroup));a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,
|
|
1096
1186
|
{"class":this.isFlyoutLabel?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS,ry:FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS},this.svgGroup);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":this.isFlyoutLabel?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup);c=replaceMessageReferences$$module$build$src$core$utils$parsing(this.text);
|
|
1097
1187
|
this.workspace.RTL&&(c+="\u200f");b.textContent=c;this.isFlyoutLabel&&(this.svgText=b,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));d=getComputedStyle$$module$build$src$core$utils$style(b,"fontSize");const f=getComputedStyle$$module$build$src$core$utils$style(b,"fontWeight"),g=getComputedStyle$$module$build$src$core$utils$style(b,"fontFamily");this.width=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(b,d,f,g);c=measureFontMetrics$$module$build$src$core$utils$dom(c,
|
|
@@ -1100,22 +1190,21 @@ d,f,g);this.height=this.height||c.height;if(!this.isFlyoutLabel){this.width+=2*F
|
|
|
1100
1190
|
")")}moveTo(a,b){this.position.x=a;this.position.y=b;this.updateTransform()}moveBy(a,b,c){this.moveTo(this.position.x+a,this.position.y+b)}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.position.y,this.position.y+this.height,this.position.x,this.position.x+this.width)}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){unbind$$module$build$src$core$browser_events(this.onMouseDownWrapper);
|
|
1101
1191
|
unbind$$module$build$src$core$browser_events(this.onMouseUpWrapper);this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(a){a?this.svgGroup&&(this.svgGroup.appendChild(a),this.cursorSvg=a):this.cursorSvg=null}onMouseUp(a){(a=this.targetWorkspace.getGesture(a))&&a.cancel();this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||
|
|
1102
1192
|
this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(a=this.targetWorkspace.getButtonCallback(this.callbackKey))&&a(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}onMouseDown(a){const b=this.targetWorkspace.getGesture(a),c=this.targetWorkspace.getFlyout();b&&c&&b.handleFlyoutStart(a,c)}getSvgRoot(){return this.svgGroup}getFocusableElement(){return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){var a=this.getPosition();
|
|
1103
|
-
a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;
|
|
1104
|
-
var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;var FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getWorkspace()}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof FlyoutButton$$module$build$src$core$flyout_button}},module$build$src$core$keyboard_nav$flyout_button_navigation_policy={};
|
|
1105
|
-
module$build$src$core$keyboard_nav$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy;var
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
module$build$src$core$
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
module$build$src$core$keyboard_nav$
|
|
1113
|
-
|
|
1114
|
-
module$build$src$core$
|
|
1115
|
-
a){
|
|
1116
|
-
|
|
1117
|
-
a.
|
|
1118
|
-
null?0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var module$build$src$core$icons$registry={};module$build$src$core$icons$registry.register=register$$module$build$src$core$icons$registry;module$build$src$core$icons$registry.unregister=unregister$$module$build$src$core$icons$registry;var SIZE$$module$build$src$core$icons$comment_icon=17,DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon=160,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon=80,CommentIcon$$module$build$src$core$icons$comment_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textInputBubble=null;this.text="";this.bubbleSize=new Size$$module$build$src$core$utils$size(DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon);
|
|
1193
|
+
a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}getId(){return this.id}performAction(){if(!this.isFlyoutLabel){const a=this.targetWorkspace.getButtonCallback(this.callbackKey);a&&a(this)}}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;
|
|
1194
|
+
register$$module$build$src$core$css("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n@media (hover: hover) {\n .blocklyFlyoutButton:hover {\n fill: #aaa;\n }\n}\n\n.blocklyFlyoutButton:active {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;var FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getWorkspace()}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.getId()}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof FlyoutButton$$module$build$src$core$flyout_button}},module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy={};
|
|
1195
|
+
module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(){return"error"}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy={};
|
|
1196
|
+
module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy;var BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy=class{getFirstChild(a){return a.getEditor()}getParent(a){let b;return(b=a.getOwner())!=null?b:null}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.id}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble}},module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy=
|
|
1197
|
+
{};module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy.BlockCommentNavigationPolicy=BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a)[0]}getParent(a){var b;if((b=a.previousConnection)==null?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if((c=a.outputConnection)==null?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){if(a.nextConnection){let c;
|
|
1198
|
+
return(c=a.nextConnection.targetBlock())!=null?c:a.nextConnection}var b;return((b=a.outputConnection)==null?0:b.targetConnection)?(b=this.getParent(a),navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(b,a,1)):null}getPreviousSibling(a){let b;if((b=a.previousConnection)==null?0:b.targetBlock())return a.previousConnection;let c;return((c=a.outputConnection)==null?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.outputConnection.targetBlock(),
|
|
1199
|
+
a,-1):null}getRowId(a){return a.getRowId()}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy={};module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy;
|
|
1200
|
+
module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy;var CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getCommentView().workspace.getCommentById(a.getCommentView().commentId)}getNextSibling(a){const b=a.getCommentView().getCommentBarButtons();a=b.indexOf(a);return a>=0&&a+1<b.length?b[a+1]:null}getPreviousSibling(a){const b=a.getCommentView().getCommentBarButtons();a=b.indexOf(a);return a>0?b[a-1]:null}getRowId(a){return a.getCommentView().commentId}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof
|
|
1201
|
+
CommentBarButton$$module$build$src$core$comments$comment_bar_button}},module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy={};module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy.CommentBarButtonNavigationPolicy=CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy;var CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.id}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof CommentEditor$$module$build$src$core$comments$comment_editor}},module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy={};
|
|
1202
|
+
module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy.CommentEditorNavigationPolicy=CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy=class{getFirstChild(){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock(),a,1);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT&&a.getSourceBlock().getSurroundParent()&&!a.targetConnection)return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock().getSurroundParent(),
|
|
1203
|
+
a,1);switch(a.type){case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return a.targetConnection;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:return a.getSourceBlock()}return null}getPreviousSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getParentInput().getSourceBlock(),a,-1);switch(a.type){case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return a.getSourceBlock();
|
|
1204
|
+
case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:return a.targetConnection}return null}getRowId(a){switch(a.type){case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:return a.id;case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:return a.getParentInput().getRowId();default:return a.getSourceBlock().getRowId()}}isNavigable(a){if(!a.canBeFocused())return!1;
|
|
1205
|
+
if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){if(a.targetBlock())return!1;let b;const c=(b=a.getSourceBlock().getRootBlock())!=null?b:a.getSourceBlock();return a===c.lastConnectionInStack(!1)?!1:!0}return a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&!a.targetBlock()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy=
|
|
1206
|
+
{};module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock(),a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock(),a,-1)}getRowId(a){return a.getParentInput().getRowId()}isNavigable(a){let b;
|
|
1207
|
+
return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!(((b=a.getSourceBlock())==null?0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy={};module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy;var module$build$src$core$icons$registry={};module$build$src$core$icons$registry.register=register$$module$build$src$core$icons$registry;module$build$src$core$icons$registry.unregister=unregister$$module$build$src$core$icons$registry;var SIZE$$module$build$src$core$icons$comment_icon=17,DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon=160,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon=80,CommentIcon$$module$build$src$core$icons$comment_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textInputBubble=null;this.text="";this.bubbleSize=new Size$$module$build$src$core$utils$size(DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon);
|
|
1119
1208
|
this.bubbleVisiblity=!1}getType(){return CommentIcon$$module$build$src$core$icons$comment_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},
|
|
1120
1209
|
this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCommentIcon"))}dispose(){super.dispose();let a;(a=this.textInputBubble)==null||a.dispose()}getWeight(){return CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$comment_icon,
|
|
1121
1210
|
SIZE$$module$build$src$core$icons$comment_icon)}applyColour(){super.applyColour();const a=this.sourceBlock.getColour();let b;(b=this.textInputBubble)==null||b.setColour(a)}updateEditable(){const a=this,b=()=>super.updateEditable;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){b().call(a);a.bubbleIsVisible()&&(yield a.setBubbleVisible(!1),yield a.setBubbleVisible(!0))})}onLocationChange(a){const b=this.workspaceLocation;super.onLocationChange(a);this.bubbleLocation&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.workspaceLocation,
|
|
@@ -1128,24 +1217,43 @@ this.bubbleSize.width):b.x,a.y=b.y);return a}return null}loadState(a){let b;this
|
|
|
1128
1217
|
this.onTextChange());let b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.bubbleLocation&&
|
|
1129
1218
|
this.textInputBubble.moveDuringDrag(this.bubbleLocation);this.textInputBubble.addTextChangeListener(()=>this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange());this.textInputBubble.addLocationChangeListener(()=>this.onBubbleLocationChange())}hideBubble(){let a;(a=this.textInputBubble)==null||a.dispose();this.textInputBubble=null}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,
|
|
1130
1219
|
new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);
|
|
1131
|
-
var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){if(a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getWorkspace())!=null?c:null}if(a instanceof CommentIcon$$module$build$src$core$icons$comment_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===
|
|
1132
|
-
a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getEditor())!=null?c:null}return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof
|
|
1133
|
-
{};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_comment_navigation_policy=class{getFirstChild(a){return a.view.getCommentBarButtons()[0]}getParent(a){return a.workspace}getNextSibling(
|
|
1134
|
-
|
|
1135
|
-
module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var
|
|
1136
|
-
new
|
|
1137
|
-
|
|
1138
|
-
const c=(b=this.get(a))==null?void 0:b.
|
|
1139
|
-
|
|
1220
|
+
var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy=class{getFirstChild(a){if(a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getWorkspace())!=null?c:null}if(a instanceof CommentIcon$$module$build$src$core$icons$comment_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===
|
|
1221
|
+
a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getEditor())!=null?c:null}return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock(),a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy(a.getSourceBlock(),a,-1)}getRowId(a){return a.getSourceBlock().getRowId()}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof
|
|
1222
|
+
Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy={};module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy;var WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy=class{getFirstChild(a){return a.view.getCommentBarButtons()[0]}getParent(a){return a.workspace}getNextSibling(){return null}getPreviousSibling(){return null}getRowId(a){return a.id}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment}},module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy=
|
|
1223
|
+
{};module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy.WorkspaceCommentNavigationPolicy=WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}getRowId(a){return a.id}isNavigable(a){return a.canBeFocused()&&!a.isMutator}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy=
|
|
1224
|
+
{};module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy;var NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator;(function(a){a[a.NEXT=0]="NEXT";a[a.PREVIOUS=1]="PREVIOUS";a[a.IN=2]="IN";a[a.OUT=3]="OUT"})(NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator||(NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator={}));
|
|
1225
|
+
var Navigator$$module$build$src$core$keyboard_nav$navigators$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy,
|
|
1226
|
+
new IconNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy,new WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy,new CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy,new BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy,new CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy];
|
|
1227
|
+
this.navigationLoops=!1}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>b.isApplicable(a))}getFirstChild(a){let b;const c=(b=this.get(a))==null?void 0:b.getFirstChild(a);return c?this.isNavigable(c)?c:this.getFirstChild(c)||this.getNextSibling(c):null}getParent(a){let b;const c=(b=this.get(a))==null?void 0:b.getParent(a);return c?this.isNavigable(c)?c:this.getParent(c):null}getNextSibling(a){let b;const c=(b=this.get(a))==null?void 0:b.getNextSibling(a);return c?this.isNavigable(c)?
|
|
1228
|
+
c:this.getNextSibling(c):null}getPreviousSibling(a){let b;const c=(b=this.get(a))==null?void 0:b.getPreviousSibling(a);return c?this.isNavigable(c)?c:this.getPreviousSibling(c):null}getPreviousNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){if(!a)return null;var b=this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.PREVIOUS);if(!b||b===a.getFocusableTree()){b=this.navigateStacks(a,-1);if(!b)return null;b=this.getLastNodeInStack(b,
|
|
1229
|
+
a)}return this.getLeftmostSibling(b)}getOutNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){let b;const c=a instanceof BlockSvg$$module$build$src$core$block_svg?(b=a.outputConnection)==null?void 0:b.targetConnection:a instanceof RenderedConnection$$module$build$src$core$rendered_connection&&a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?a:null;return c&&!c.getSourceBlock().getInputsInline()&&c!==c.getSourceBlock().inputList[0].connection?
|
|
1230
|
+
c.getSourceBlock():this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT)}getNextNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){const b=this.getNextNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT);return a&&b===null?this.navigateStacks(a,1):b}getInNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()){return this.getNextNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.IN)}getPreviousNodeImpl(a,
|
|
1231
|
+
b,c,d=new Set){if(!b||!a||d.has(b))return null;const e=this.getRightMostChild(this.getPreviousSibling(b),b)||this.getParent(b);return e&&this.transitionAllowed(a,e,c)?e:e?(d.add(b),this.getPreviousNodeImpl(a,e,c,d)):null}getNextNodeImpl(a,b,c,d=new Set){if(!b||!a||d.has(b))return null;let e=this.getFirstChild(b)||this.getNextSibling(b);for(var f=b;f&&!e;){f=this.getParent(f);if(!f)break;e=this.getNextSibling(f)}return e&&this.transitionAllowed(a,e,c)?e:e?(d.add(b),this.getNextNodeImpl(a,e,c,d)):null}getRightMostChild(a,
|
|
1232
|
+
b){if(!a)return a;let c=this.getFirstChild(a);if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.getNextSibling(c))c=a;return this.getRightMostChild(c,b)}setNavigationLoops(a){this.navigationLoops=a}getNavigationLoops(){return this.navigationLoops}getFirstNode(){let a;const b=(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==null?void 0:a.getRootFocusableNode();return b?this.getTopLevelItems(b)[0]:null}getLastNode(){let a;const b=(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedTree())==
|
|
1233
|
+
null?void 0:a.getRootFocusableNode();return b?this.getTopLevelItems(b).slice(-1)[0]:null}transitionAllowed(a,b,c){switch(c){case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.IN:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT:return this.getRowId(a)===this.getRowId(b);case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT:case NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.PREVIOUS:return this.getRowId(a)!==
|
|
1234
|
+
this.getRowId(b)}}getLeftmostSibling(a){if(!a)return null;let b;for(;b=this.getPreviousNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.OUT);)a=b;return a}getLastNodeInStack(a,b){let c;for(;(c=this.getNextNodeImpl(a,a,NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator.NEXT))&&c!==b;)a=c;return a}getRowId(a){let b;return(b=this.get(a))==null?void 0:b.getRowId(a)}navigateStacks(a,b){const c=this.getTopLevelItems(a);let d,e;const f=(e=
|
|
1235
|
+
(d=this.getSourceBlockFromNode(a))==null?void 0:d.getRootBlock())!=null?e:a;a=c.indexOf(f)+b;b=null;a>=0&&a<c.length?b=c[a]:a<0&&this.getNavigationLoops()?b=c[c.length-1]:a>=c.length&&this.getNavigationLoops()&&(b=c[0]);return b}getTopLevelItems(a){return a.getFocusableTree().getTopBoundedElements(!0)}isNavigable(a){let b;return(b=this.get(a))==null?void 0:b.isNavigable(a)}getSourceBlockFromNode(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?a:a instanceof Field$$module$build$src$core$field||
|
|
1236
|
+
a instanceof RenderedConnection$$module$build$src$core$rendered_connection||a instanceof Icon$$module$build$src$core$icons$icon?a.getSourceBlock():null}},module$build$src$core$keyboard_nav$navigators$navigator={};module$build$src$core$keyboard_nav$navigators$navigator.NavigationDirection=NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator;module$build$src$core$keyboard_nav$navigators$navigator.Navigator=Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;var module$build$src$core$interfaces$i_toolbox_item={};module$build$src$core$interfaces$i_toolbox_item.isToolboxItem=isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item;var module$build$src$core$interfaces$i_selectable_toolbox_item={};module$build$src$core$interfaces$i_selectable_toolbox_item.isSelectableToolboxItem=isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item;var module$build$src$core$interfaces$i_collapsible_toolbox_item={};module$build$src$core$interfaces$i_collapsible_toolbox_item.isCollapsibleToolboxItem=isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item;var ToolboxItemNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy=class{getFirstChild(a){return isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item(a)?a.getChildToolboxItems()[0]:null}getParent(a){return a.getParent()}getNextSibling(a){const b=a.getParentToolbox().getToolboxItems();a=b.indexOf(a);let c;return(c=b[a+1])!=null?c:null}getPreviousSibling(a){const b=a.getParentToolbox().getToolboxItems();a=b.indexOf(a);
|
|
1237
|
+
let c;return(c=b[a-1])!=null?c:null}getRowId(a){return a.getId()}isNavigable(a){return a.canBeFocused()&&this.allParentsExpanded(a)}allParentsExpanded(a){return(a=a.getParent())&&isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item(a)?a.isExpanded()&&this.allParentsExpanded(a):!0}isApplicable(a){return isToolboxItem$$module$build$src$core$interfaces$i_toolbox_item(a)}},module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy={};
|
|
1238
|
+
module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy.ToolboxItemNavigationPolicy=ToolboxItemNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy;var ToolboxNavigator$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator=class extends Navigator$$module$build$src$core$keyboard_nav$navigators$navigator{constructor(a){super();this.toolbox=a;this.rules=[new ToolboxItemNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy]}getInNode(a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),b=!1){const c=getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.toolbox.getWorkspace());
|
|
1239
|
+
if(!b)switch(c){case Position$$module$build$src$core$utils$toolbox.TOP:case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.getNextNode(a,!0);case Position$$module$build$src$core$utils$toolbox.RIGHT:return this.getOutNode(a,!0)}if(isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)&&!a.getContents().length)return null;let d;return(a=(d=this.toolbox.getFlyout())==null?void 0:d.getWorkspace().getNavigator())?!this.toolbox.getWorkspace().RTL||c!==Position$$module$build$src$core$utils$toolbox.TOP&&
|
|
1240
|
+
c!==Position$$module$build$src$core$utils$toolbox.BOTTOM?a.getFirstNode():a.getLastNode():null}getOutNode(a,b=!1){if(!b)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.toolbox.getWorkspace())){case Position$$module$build$src$core$utils$toolbox.TOP:case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.getPreviousNode(a,!0);case Position$$module$build$src$core$utils$toolbox.RIGHT:return this.getInNode(a,!0)}return super.getOutNode(a)}getNextNode(a,
|
|
1241
|
+
b=!1){if(!b)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.toolbox.getWorkspace())){case Position$$module$build$src$core$utils$toolbox.TOP:return this.getInNode(a,!0);case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.getOutNode(a,!0)}return super.getNextNode(a)}getPreviousNode(a,b=!1){if(!b)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.toolbox.getWorkspace())){case Position$$module$build$src$core$utils$toolbox.TOP:return this.getOutNode(a,
|
|
1242
|
+
!0);case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.getInNode(a,!0)}return super.getPreviousNode(a)}getTopLevelItems(){return this.toolbox.getToolboxItems()}},module$build$src$core$keyboard_nav$navigators$toolbox_navigator={};module$build$src$core$keyboard_nav$navigators$toolbox_navigator.ToolboxNavigator=ToolboxNavigator$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator;
|
|
1243
|
+
module$build$src$core$keyboard_nav$navigators$toolbox_navigator.getPhysicalToolboxPosition=getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator;var FlyoutNavigator$$module$build$src$core$keyboard_nav$navigators$flyout_navigator=class extends Navigator$$module$build$src$core$keyboard_nav$navigators$navigator{constructor(a){super();this.flyout=a;this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy)}getOutNode(a,b=!1){if(!b&&this.flyout.targetWorkspace)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.flyout.targetWorkspace)){case Position$$module$build$src$core$utils$toolbox.TOP:case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.flyout.RTL?
|
|
1244
|
+
this.getNextNode(a,!0):this.getPreviousNode(a,!0);case Position$$module$build$src$core$utils$toolbox.RIGHT:return null}let c;return(a=(c=this.flyout.targetWorkspace)==null?void 0:c.getToolbox())?a.getSelectedItem():null}getInNode(a,b=!1){if(!b&&this.flyout.targetWorkspace)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.flyout.targetWorkspace)){case Position$$module$build$src$core$utils$toolbox.TOP:case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.flyout.RTL?
|
|
1245
|
+
this.getPreviousNode(a,!0):this.getNextNode(a,!0);case Position$$module$build$src$core$utils$toolbox.RIGHT:return this.getOutNode(a,!0)}return super.getInNode(a)}getNextNode(a,b=!1){if(!b&&this.flyout.targetWorkspace)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.flyout.targetWorkspace)){case Position$$module$build$src$core$utils$toolbox.TOP:return null;case Position$$module$build$src$core$utils$toolbox.BOTTOM:return this.getOutNode(a,!0)}return super.getNextNode(a)}getPreviousNode(a,
|
|
1246
|
+
b=!1){if(!b&&this.flyout.targetWorkspace)switch(getPhysicalToolboxPosition$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this.flyout.targetWorkspace)){case Position$$module$build$src$core$utils$toolbox.TOP:return this.getOutNode(a,!0);case Position$$module$build$src$core$utils$toolbox.BOTTOM:return null}return super.getPreviousNode(a)}getTopLevelItems(){return this.flyout.getContents().map(a=>a.getElement()).filter(a=>this.isNavigable(a))}isNavigable(a){return super.isNavigable(a)&&
|
|
1247
|
+
this.flyout.getContents().map(b=>b.getElement()).includes(a)}},module$build$src$core$keyboard_nav$navigators$flyout_navigator={};module$build$src$core$keyboard_nav$navigators$flyout_navigator.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$keyboard_nav$navigators$flyout_navigator;var ScrollbarPair$$module$build$src$core$scrollbar_pair=class{constructor(a,b,c,d,e){this.workspace=a;this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null;b=b===void 0?!0:b;c=c===void 0?!0:c;const f=b&&c;b&&(this.hScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!0,f,d,e));c&&(this.vScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!1,f,d,e));f&&(this.corner_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,
|
|
1140
1248
|
width:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,"class":"blocklyScrollbarBackground"}),insertAfter$$module$build$src$core$utils$dom(this.corner_,a.getBubbleCanvas()))}dispose(){removeNode$$module$build$src$core$utils$dom(this.corner_);this.oldHostMetrics=this.corner_=null;this.hScroll&&(this.hScroll.dispose(),this.hScroll=null);this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const a=this.workspace.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics&&this.oldHostMetrics.viewWidth===
|
|
1141
1249
|
a.viewWidth&&this.oldHostMetrics.viewHeight===a.viewHeight&&this.oldHostMetrics.absoluteTop===a.absoluteTop&&this.oldHostMetrics.absoluteLeft===a.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===a.scrollWidth&&this.oldHostMetrics.viewLeft===a.viewLeft&&this.oldHostMetrics.scrollLeft===a.scrollLeft||(b=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===a.scrollHeight&&this.oldHostMetrics.viewTop===a.viewTop&&this.oldHostMetrics.scrollTop===a.scrollTop||(c=!0)):c=b=!0;if(b||
|
|
1142
1250
|
c){try{$.disable$$module$build$src$core$events$utils(),this.hScroll&&b&&this.hScroll.resize(a),this.vScroll&&c&&this.vScroll.resize(a)}finally{$.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==a.viewWidth||this.oldHostMetrics.absoluteLeft!==a.absoluteLeft){let d;(d=this.corner_)==null||d.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!==
|
|
1143
1251
|
a.viewHeight||this.oldHostMetrics.absoluteTop!==a.absoluteTop){let d;(d=this.corner_)==null||d.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=a}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(a,b){this.hScroll&&this.hScroll.setOrigin(a,b);this.vScroll&&this.vScroll.setOrigin(a,b)}set(a,b,c){this.hScroll&&this.hScroll.set(a,!1);this.vScroll&&this.vScroll.set(b,!1);if(c||c===void 0)a={},this.hScroll&&(a.x=this.hScroll.getRatio_()),
|
|
1144
1252
|
this.vScroll&&(a.y=this.vScroll.getRatio_()),this.workspace.setMetrics(a)}setX(a){this.hScroll&&this.hScroll.set(a,!0)}setY(a){this.vScroll&&this.vScroll.set(a,!0)}setContainerVisible(a){this.hScroll&&this.hScroll.setContainerVisible(a);this.vScroll&&this.vScroll.setContainerVisible(a)}isVisible(){let a=!1;this.hScroll&&(a=this.hScroll.isVisible());this.vScroll&&(a=a||this.vScroll.isVisible());return a}setVisible(a){this.hScroll&&this.hScroll.setVisibleInternal(a);this.vScroll&&this.vScroll.setVisibleInternal(a)}resizeContent(a){this.hScroll&&
|
|
1145
1253
|
this.hScroll.resizeContentHorizontal(a);this.vScroll&&this.vScroll.resizeContentVertical(a)}resizeView(a){this.hScroll&&this.hScroll.resizeViewHorizontal(a);this.vScroll&&this.vScroll.resizeViewVertical(a)}},module$build$src$core$scrollbar_pair={};module$build$src$core$scrollbar_pair.ScrollbarPair=ScrollbarPair$$module$build$src$core$scrollbar_pair;var SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater="sep",SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater=class{load(a,b){a=new FlyoutSeparator$$module$build$src$core$flyout_separator(0,b.horizontalLayout?"x":"y");return new FlyoutItem$$module$build$src$core$flyout_item(a,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater)}gapForItem(a,b){let c;return(c=parseInt(String(a.gap)))!=null?c:b}disposeItem(a){}getType(){return SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater}};
|
|
1146
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater,SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater);var module$build$src$core$separator_flyout_inflater={SEPARATOR_TYPE:SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater};module$build$src$core$separator_flyout_inflater.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;var Flyout$$module$build$src$core$flyout_base=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.horizontalLayout=!1;this.boundEvents=[];this.reflowWrapper=null;this.inhibitReflowWrapper=!1;this.contents=[];this.autoClose=!0;this.visible=!1;this.containerVisible=!0;this.CORNER_RADIUS=8;this.SCROLLBAR_MARGIN=2.5;this.height_=this.width_=0;this.
|
|
1147
|
-
this.workspace_
|
|
1148
|
-
this.
|
|
1254
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater,SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater);var module$build$src$core$separator_flyout_inflater={SEPARATOR_TYPE:SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater};module$build$src$core$separator_flyout_inflater.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;var Flyout$$module$build$src$core$flyout_base=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.horizontalLayout=!1;this.boundEvents=[];this.reflowWrapper=null;this.inhibitReflowWrapper=!1;this.contents=[];this.autoClose=!0;this.visible=!1;this.containerVisible=!0;this.CORNER_RADIUS=8;this.SCROLLBAR_MARGIN=2.5;this.height_=this.width_=0;this.svgGroup_=this.svgBackground_=null;this.inflaters=new Map;a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new WorkspaceSvg$$module$build$src$core$workspace_svg(a);
|
|
1255
|
+
this.workspace_.setMetricsManager(new FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager(this.workspace_,this));this.workspace_.internalIsFlyout=!0;this.workspace_.setVisible(this.visible);this.workspace_.setNavigator(new FlyoutNavigator$$module$build$src$core$keyboard_nav$navigators$flyout_navigator(this));this.id=genUid$$module$build$src$core$utils$idgenerator();this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH;
|
|
1256
|
+
this.MARGIN=this.CORNER_RADIUS;this.GAP_X=this.MARGIN*3;this.GAP_Y=this.MARGIN*3}createDom(a){this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(a,{"class":"blocklyFlyout"});this.svgGroup_.style.display="none";this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,
|
|
1149
1257
|
"flyoutBackgroundColour","fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity");return this.svgGroup_}init(a){this.targetWorkspace=a;this.workspace_.targetWorkspace=a;this.workspace_.scrollbar=new ScrollbarPair$$module$build$src$core$scrollbar_pair(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN);this.hide();this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,
|
|
1150
1258
|
"wheel",this,this.wheel_,!1,{passive:!1}));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgBackground_,"pointerdown",this,this.onMouseDown));this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace);this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap());this.workspace_.createPotentialVariableMap();a.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.FLYOUT_WEIGHT,
|
|
1151
1259
|
capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]})}dispose(){this.hide();this.targetWorkspace.getComponentManager().removeComponent(this.id);for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);this.boundEvents.length=0;this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),
|
|
@@ -1156,34 +1264,30 @@ b,c,d){let e;(e=this.svgGroup_)==null||e.setAttribute("width",`${a}`);let f;(f=t
|
|
|
1156
1264
|
this.setContents(a);this.layout_(a);this.horizontalLayout?this.height_=0:this.width_=0;this.reflow();$.setRecordUndo$$module$build$src$core$events$utils(!0);this.workspace_.setResizesEnabled(!0);this.reflowWrapper=b=>{this.inhibitReflowWrapper||b.type!==EventType$$module$build$src$core$events$type.BLOCK_CHANGE&&b.type!==EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE||this.reflow()};this.workspace_.addChangeListener(this.reflowWrapper)}createFlyoutInfo(a){const b=[],c=
|
|
1157
1265
|
this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const d of a)if("custom"in d&&(a=this.getDynamicCategoryContents(d.custom),a=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a),b.push(...this.createFlyoutInfo(a))),a=d.kind.toLowerCase(),a=this.getInflaterForType(a))b.push(a.load(d,this)),(a=a.gapForItem(d,c))&&b.push(new FlyoutItem$$module$build$src$core$flyout_item(new FlyoutSeparator$$module$build$src$core$flyout_separator(a,this.horizontalLayout?"x":"y"),SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater));
|
|
1158
1266
|
return this.normalizeSeparators(b)}normalizeSeparators(a){for(let b=a.length-1;b>0;b--){const c=a[b].getType().toLowerCase(),d=a[b-1].getType().toLowerCase();c===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&d===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&a.splice(b-1,1)}return a}getDynamicCategoryContents(a){a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a);if(typeof a!=="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");
|
|
1159
|
-
return a(this.workspace_.targetWorkspace)}clearOldBlocks(){this.getContents().forEach(b=>{let c;(c=this.getInflaterForType(b.getType()))==null||c.disposeItem(b)});let a;(a=this.workspace_.getPotentialVariableMap())==null||a.clear()}onMouseDown(a){const b=this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}
|
|
1160
|
-
|
|
1161
|
-
e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY();a.scale(this.workspace_.scale);e=Coordinate$$module$build$src$core$utils$coordinate.sum(e,a);d=Coordinate$$module$build$src$core$utils$coordinate.difference(e,d);d.scale(1/c.scale);b.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y))}getInflaterForType(a){if(this.inflaters.has(a)){var b;return(b=this.inflaters.get(a))!=null?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,
|
|
1162
|
-
a))?(b=new b,this.inflaters.set(a,b),b):null}getFocusableElement(){throw Error("Flyouts are not directly focusable.");}getFocusableTree(){throw Error("Flyouts are not directly focusable.");}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}getRootFocusableNode(){throw Error("Flyouts are not directly focusable.");}getRestoredFocusableNode(a){throw Error("Flyouts are not directly focusable.");}getNestedTrees(){throw Error("Flyouts are not directly focusable.");}lookUpFocusableNode(a){throw Error("Flyouts are not directly focusable.");
|
|
1163
|
-
}onTreeFocus(a,b){}onTreeBlur(a){throw Error("Flyouts are not directly focusable.");}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var module$build$src$core$interfaces$i_contextmenu={};module$build$src$core$interfaces$i_contextmenu.hasContextMenu=hasContextMenu$$module$build$src$core$interfaces$i_contextmenu;var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=
|
|
1267
|
+
return a(this.workspace_.targetWorkspace)}clearOldBlocks(){this.getContents().forEach(b=>{let c;(c=this.getInflaterForType(b.getType()))==null||c.disposeItem(b)});let a;(a=this.workspace_.getPotentialVariableMap())==null||a.clear()}onMouseDown(a){const b=this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}reflow(){this.inhibitReflowWrapper=!0;this.reflowInternal_();this.inhibitReflowWrapper=!1}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}getInflaterForType(a){if(this.inflaters.has(a)){var b;
|
|
1268
|
+
return(b=this.inflaters.get(a))!=null?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,a))?(b=new b,this.inflaters.set(a,b),b):null}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var module$build$src$core$interfaces$i_contextmenu={};module$build$src$core$interfaces$i_contextmenu.hasContextMenu=hasContextMenu$$module$build$src$core$interfaces$i_contextmenu;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=
|
|
1164
1269
|
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;module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var WorkspaceDragger$$module$build$src$core$workspace_dragger=class{constructor(a){this.workspace=a;this.horizontalScrollEnabled=this.workspace.isMovableHorizontally();this.verticalScrollEnabled=this.workspace.isMovableVertically();this.startScrollXY_=new Coordinate$$module$build$src$core$utils$coordinate(a.scrollX,a.scrollY)}startDrag(){}endDrag(a){this.drag(a)}drag(a){a=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startScrollXY_,a);if(this.horizontalScrollEnabled&&this.verticalScrollEnabled)this.workspace.scroll(a.x,
|
|
1165
1270
|
a.y);else if(this.horizontalScrollEnabled)this.workspace.scroll(a.x,this.workspace.scrollY);else if(this.verticalScrollEnabled)this.workspace.scroll(this.workspace.scrollX,a.y);else throw new TypeError("Invalid state.");}},module$build$src$core$workspace_dragger={};module$build$src$core$workspace_dragger.WorkspaceDragger=WorkspaceDragger$$module$build$src$core$workspace_dragger;var ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture=5,ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture=6,Gesture$$module$build$src$core$gesture=class{constructor(a,b){this.creatorWorkspace=b;this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startWorkspace_=this.targetBlock=this.startComment=this.startBlock=this.startIcon=this.startField=this.startBubble=null;this.hasExceededDragRadius=!1;this.boundEvents=[];this.workspaceDragger=this.dragger=null;this.dragging=
|
|
1166
1271
|
!1;this.flyout=null;this.multiTouch=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1;this.cachedPoints=new Map;this.startDistance=this.previousScale=0;this.currentDropdownOwner=this.isPinchZoomEnabled=null;this.mostRecentEvent=a;this.currentDragDeltaXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0)}dispose(){clearTouchIdentifier$$module$build$src$core$touch();unblock$$module$build$src$core$tooltip();this.creatorWorkspace.clearGesture();for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);
|
|
1167
1272
|
this.boundEvents.length=0}updateFromEvent(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);this.updateDragDelta(b)&&(this.updateIsDragging(a),longStop$$module$build$src$core$touch());this.mostRecentEvent=a}updateDragDelta(a){this.currentDragDeltaXY=Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.mouseDownXY);return this.hasExceededDragRadius?!1:this.hasExceededDragRadius=Coordinate$$module$build$src$core$utils$coordinate.magnitude(this.currentDragDeltaXY)>
|
|
1168
|
-
(this.flyout?$.config$$module$build$src$core$config.flyoutDragRadius:$.config$$module$build$src$core$config.dragRadius)}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
this.
|
|
1173
|
-
this.
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
this.
|
|
1177
|
-
this.
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
if(
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
this.
|
|
1184
|
-
this.
|
|
1185
|
-
|
|
1186
|
-
var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(this.startBlock,this.startWorkspace_.id,"block");fire$$module$build$src$core$events$utils(a)}$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){this.fireWorkspaceClick(this.startWorkspace_||
|
|
1273
|
+
(this.flyout?$.config$$module$build$src$core$config.flyoutDragRadius:$.config$$module$build$src$core$config.dragRadius)}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");if(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())this.dragging=!0,this.workspaceDragger=new WorkspaceDragger$$module$build$src$core$workspace_dragger(this.startWorkspace_),this.workspaceDragger.startDrag()}updateIsDragging(a){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");
|
|
1274
|
+
if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0;const b=getSelected$$module$build$src$core$common();b&&isDraggable$$module$build$src$core$interfaces$i_draggable(b)&&b.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(b),this.dragger.onDragStart(a),this.dragger.onDrag(a,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(a){return new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,
|
|
1275
|
+
this.creatorWorkspace.options,!0))(a)}doStart(a){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch;isTargetInput$$module$build$src$core$browser_events(a)?this.cancel():(this.gestureHasStarted=!0,disconnectUiStop$$module$build$src$core$block_animations(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&
|
|
1276
|
+
this.startWorkspace_.resize(),this.currentDropdownOwner=getOwner$$module$build$src$core$dropdowndiv(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=a,block$$module$build$src$core$tooltip(),isRightButton$$module$build$src$core$browser_events(a)?this.handleRightClick(a):(a.type.toLowerCase()==="pointerdown"&&a.pointerType!=="mouse"&&longStart$$module$build$src$core$touch(a,this),this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
|
|
1277
|
+
a.clientY),this.bindMouseEvents(a),this.isEnding_||this.handleTouchStart(a)))}bindMouseEvents(a){this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerdown",null,this.handleStart.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointermove",null,this.handleMove.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerup",null,this.handleUp.bind(this),!0));
|
|
1278
|
+
this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointercancel",null,this.handleUp.bind(this),!0));a.preventDefault();a.stopPropagation()}handleStart(a){this.isDragging()||(this.handleTouchStart(a),this.isMultiTouch()&&longStop$$module$build$src$core$touch())}handleMove(a){if(this.isDragging()&&shouldHandleEvent$$module$build$src$core$touch(a)||!this.isMultiTouch()){this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);
|
|
1279
|
+
else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY);a.preventDefault();a.stopPropagation()}else this.isMultiTouch()&&(this.handleTouchMove(a),longStop$$module$build$src$core$touch())}handleUp(a){this.isDragging()||this.handleTouchEnd(a);if(!this.isMultiTouch()||this.isDragging()){if(!shouldHandleEvent$$module$build$src$core$touch(a))return;this.updateFromEvent(a);longStop$$module$build$src$core$touch();if(this.isEnding_){console.log("Trying to end a gesture recursively.");
|
|
1280
|
+
return}this.isEnding_=!0;this.dragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1),this.dragger.onDragEnd(a,this.currentDragDeltaXY)):this.workspaceDragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1),this.workspaceDragger.endDrag(this.currentDragDeltaXY)):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?
|
|
1281
|
+
this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(a))}a.preventDefault();a.stopPropagation();this.dispose()}handleTouchStart(a){var b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));var c=Array.from(this.cachedPoints.keys());c.length===2&&(b=this.cachedPoints.get(c[0]),c=this.cachedPoints.get(c[1]),this.startDistance=Coordinate$$module$build$src$core$utils$coordinate.distance(b,c),this.multiTouch=!0,a.preventDefault())}handleTouchMove(a){const b=
|
|
1282
|
+
getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));if(this.isPinchZoomEnabled&&this.cachedPoints.size===2)this.handlePinch(a);else{this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY);a.preventDefault();a.stopPropagation()}}handlePinch(a){var b=Array.from(this.cachedPoints.keys()),c=this.cachedPoints.get(b[0]);
|
|
1283
|
+
b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c,b)/this.startDistance;if(this.previousScale>0&&this.previousScale<Infinity){b=c-this.previousScale;b=b>0?b*ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture:b*ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture;if(!this.startWorkspace_)throw Error("Cannot handle a pinch because the start workspace is undefined");const d=this.startWorkspace_,e=mouseToSvg$$module$build$src$core$browser_events(a,d.getParentSvg(),
|
|
1284
|
+
d.getInverseScreenCTM());d.zoom(e.x,e.y,b)}this.previousScale=c;a.preventDefault()}handleTouchEnd(a){a=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.has(a)&&this.cachedPoints.delete(a);this.cachedPoints.size<2&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(a){return this.startWorkspace_?new Coordinate$$module$build$src$core$utils$coordinate(a.pageX,a.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){if(!this.isEnding_){longStop$$module$build$src$core$touch();
|
|
1285
|
+
if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY);else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY);this.dispose()}}handleRightClick(a){const b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(hasContextMenu$$module$build$src$core$interfaces$i_contextmenu(b)){let c;(c=this.startWorkspace_)==null||c.hideChaff(!!this.flyout);b.showContextMenu(a)}a.preventDefault();a.stopPropagation();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1);
|
|
1286
|
+
this.dispose()}handleWsStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(b);this.mostRecentEvent=a;this.targetBlock||this.startBubble||this.startComment||this.startIcon||$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);this.doStart(a)}fireWorkspaceClick(a){fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,
|
|
1287
|
+
a.id,"workspace"))}handleFlyoutStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(b);this.handleWsStart(a,b.getWorkspace())}handleBlockStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(b);this.mostRecentEvent=a}handleBubbleStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");
|
|
1288
|
+
this.setStartBubble(b);this.mostRecentEvent=a}handleCommentStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(b);this.mostRecentEvent=a}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent)}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");
|
|
1289
|
+
this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");var a=save$$module$build$src$core$serialization$blocks(this.targetBlock);const c=this.flyout.targetWorkspace;if(a&&c){var b=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.flyout.getWorkspace(),this.targetBlock.getRelativeToSurfaceXY());b=screenToWsCoordinates$$module$build$src$core$utils$svg_math(c,b);a.x=
|
|
1290
|
+
b.x;a.y=b.y;appendInternal$$module$build$src$core$serialization$blocks(a,c,{recordUndo:!0});c.hideChaff(!1)}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(this.startBlock,this.startWorkspace_.id,"block");fire$$module$build$src$core$events$utils(a)}$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){this.fireWorkspaceClick(this.startWorkspace_||
|
|
1187
1291
|
this.creatorWorkspace)}setStartField(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=a)}setStartIcon(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=a)}setStartBubble(a){this.startBubble||(this.startBubble=a)}setStartComment(a){this.startComment||(this.startComment=a)}setStartBlock(a){this.startBlock||
|
|
1188
1292
|
this.startBubble||this.startIcon||(this.startBlock=a,a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()):this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?this.setTargetBlock(a.getParent()):(this.targetBlock=a,$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.targetBlock),this.targetBlock.bringToFront())}setStartWorkspace(a){this.startWorkspace_||(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&
|
|
1189
1293
|
!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1;const a=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);
|
|
@@ -1197,15 +1301,7 @@ module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var module$buil
|
|
|
1197
1301
|
"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}appendToAnimationLayer(a){let b;const c=(b=this.dragLayer)==null?void 0:b.getAttribute("transform");if(c){let e;(e=this.animationLayer)==null||e.setAttribute("transform",c)}let d;(d=this.animationLayer)==null||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a=
|
|
1198
1302
|
`translate(${a.x}, ${a.y}) scale(${b})`;let c;(c=this.dragLayer)==null||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a,b=!0){let c;(c=this.dragLayer)==null||c.appendChild(a.getSvgRoot());b&&a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}moveOffDragLayer(a,b,c=!0){this.append(a,b);c&&a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}append(a,b){this.layers.has(b)||
|
|
1199
1303
|
this.createLayer(b);a=a.getSvgRoot();let c;if(((c=this.layers.get(b))==null?void 0:c.lastChild)!==a){let d;(d=this.layers.get(b))==null||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||
|
|
1200
|
-
(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}getDragLayer(){return this.dragLayer}},module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var
|
|
1201
|
-
module$build$src$core$keyboard_nav$marker={};module$build$src$core$keyboard_nav$marker.Marker=Marker$$module$build$src$core$keyboard_nav$marker;var LineCursor$$module$build$src$core$keyboard_nav$line_cursor=class extends Marker$$module$build$src$core$keyboard_nav$marker{constructor(a){super();this.workspace=a;this.type="cursor";this.potentialNodes=null}next(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode(a,b=>{let c;return b instanceof BlockSvg$$module$build$src$core$block_svg&&!((c=b.outputConnection)==null?0:c.targetBlock())||b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment},
|
|
1202
|
-
!0))&&this.setCurNode(a);return a}in(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode(a,()=>!0,!0))&&this.setCurNode(a);return a}prev(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode(a,b=>{let c;return b instanceof BlockSvg$$module$build$src$core$block_svg&&!((c=b.outputConnection)==null?0:c.targetBlock())||b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment},!0))&&this.setCurNode(a);return a}out(){var a=this.getCurNode();
|
|
1203
|
-
if(!a)return null;(a=this.getPreviousNode(a,()=>!0,!0))&&this.setCurNode(a);return a}atEndOfLine(){var a=this.getCurNode();if(!a)return!1;const b=this.getNextNode(a,()=>!0,!0);a=this.getNextNode(a,c=>{let d;return c instanceof BlockSvg$$module$build$src$core$block_svg&&!((d=c.outputConnection)==null?0:d.targetBlock())},!0);return b===a}getNextNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;let d=this.workspace.getNavigator().getFirstChild(a)||this.workspace.getNavigator().getNextSibling(a);for(var e=
|
|
1204
|
-
a;e&&!d;){e=this.workspace.getNavigator().getParent(e);if(!e)break;d=this.workspace.getNavigator().getNextSibling(e)}return b(d)?d:d?(c.add(a),this.getNextNodeImpl(d,b,c)):null}getNextNode(a,b,c){return!a||!c&&this.getLastNode()===a?null:this.getNextNodeImpl(a,b)}getPreviousNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;const d=this.getRightMostChild(this.workspace.getNavigator().getPreviousSibling(a),a)||this.workspace.getNavigator().getParent(a);return b(d)?d:d?(c.add(a),this.getPreviousNodeImpl(d,
|
|
1205
|
-
b,c)):null}getPreviousNode(a,b,c){return!a||!c&&this.getFirstNode()===a?null:this.getPreviousNodeImpl(a,b)}getRightMostChild(a,b){if(!a)return a;let c=this.workspace.getNavigator().getFirstChild(a);if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.workspace.getNavigator().getNextSibling(c))c=a;return this.getRightMostChild(c,b)}preDelete(a){var b=this.getCurNode();b=b?[b]:[];var c;let d,e;const f=(e=(c=a.previousConnection)==null?void 0:c.targetConnection)!=null?e:(d=a.outputConnection)==null?void 0:
|
|
1206
|
-
d.targetConnection;f&&b.push(f);(c=a.getNextBlock())&&b.push(c);(a=a.getParent())&&b.push(a);b.push(this.workspace);this.potentialNodes=b}postDelete(){const a=this.potentialNodes;this.potentialNodes=null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if((c=this.getSourceBlockFromNode(b))==null||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){return $.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()}setCurNode(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}getFirstNode(){return this.workspace.getNavigator().getFirstChild(this.workspace)}getLastNode(){const a=
|
|
1207
|
-
this.getFirstNode();return this.getPreviousNode(a,()=>!0,!0)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,LineCursor$$module$build$src$core$keyboard_nav$line_cursor);var module$build$src$core$keyboard_nav$line_cursor={};module$build$src$core$keyboard_nav$line_cursor.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;var MarkerManager$$module$build$src$core$marker_manager=class{constructor(a){this.workspace=a;this.markers=new Map;this.cursor=new LineCursor$$module$build$src$core$keyboard_nav$line_cursor(this.workspace)}registerMarker(a,b){this.markers.has(a)&&this.unregisterMarker(a);this.markers.set(a,b)}unregisterMarker(a){const b=this.markers.get(a);if(b)b.dispose(),this.markers.delete(a);else throw Error("Marker with ID "+a+" does not exist. Can only unregister markers that exist.");}getCursor(){return this.cursor}getMarker(a){return this.markers.get(a)||
|
|
1208
|
-
null}setCursor(a){this.cursor=a}dispose(){const a=Object.keys(this.markers);for(let b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers.clear();this.cursor.dispose()}};MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER="local_marker_1";var module$build$src$core$marker_manager={};module$build$src$core$marker_manager.MarkerManager=MarkerManager$$module$build$src$core$marker_manager;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;
|
|
1304
|
+
(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}getDragLayer(){return this.dragLayer}},module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;
|
|
1209
1305
|
module$build$src$core$icons.exceptions=module$build$src$core$icons$exceptions;module$build$src$core$icons.registry=module$build$src$core$icons$registry;var module$build$src$core$interfaces$i_procedure_block={};module$build$src$core$interfaces$i_procedure_block.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;$.Names$$module$build$src$core$names=class{constructor(a,b){this.db=new Map;this.dbReverse=new Set;this.variableMap=null;this.variablePrefix=b||"";this.reservedWords=new Set(a?a.split(","):[])}reset(){this.db.clear();this.dbReverse.clear();this.variableMap=null}setVariableMap(a){this.variableMap=a}getNameForUserVariable(a){return this.variableMap?(a=this.variableMap.getVariableById(a))?a.getName():null:(console.warn("Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());"),
|
|
1210
1306
|
null)}populateVariables(a){a=$.allUsedVarModels$$module$build$src$core$variables(a);for(let b=0;b<a.length;b++)this.getName(a[b].getId(),$.NameType$$module$build$src$core$names.VARIABLE)}populateProcedures(a){throw Error("The implementation of populateProcedures should be monkey-patched in by blockly.ts");}getName(a,b){let c=a;b===$.NameType$$module$build$src$core$names.VARIABLE&&(a=this.getNameForUserVariable(a))&&(c=a);a=c.toLowerCase();const d=b===$.NameType$$module$build$src$core$names.VARIABLE||
|
|
1211
1307
|
b===$.NameType$$module$build$src$core$names.DEVELOPER_VARIABLE?this.variablePrefix:"";this.db.has(b)||this.db.set(b,new Map);const e=this.db.get(b);if(e.has(a))return d+e.get(a);b=this.getDistinctName(c,b);e.set(a,b.substr(d.length));return b}getUserNames(a){let b;return(a=(b=this.db.get(a))==null?void 0:b.keys())?Array.from(a):[]}getDistinctName(a,b){a=this.safeName(a);let c=null,d,e;for(;this.dbReverse.has(a+((d=c)!=null?d:""))||this.reservedWords.has(a+((e=c)!=null?e:""));)c=c?c+1:2;let f;a+=(f=
|
|
@@ -1239,33 +1335,33 @@ c)]}measure(){}},module$build$src$core$renderers$measurables$spacer_row={};modul
|
|
|
1239
1335
|
{};module$build$src$core$renderers$measurables$square_corner.SquareCorner=SquareCorner$$module$build$src$core$renderers$measurables$square_corner;var StatementInput$$module$build$src$core$renderers$measurables$statement_input=class extends InputConnection$$module$build$src$core$renderers$measurables$input_connection{constructor(a,b){super(a,b);this.type|=Types$$module$build$src$core$renderers$measurables$types.STATEMENT_INPUT;this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT;this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width}},
|
|
1240
1336
|
module$build$src$core$renderers$measurables$statement_input={};module$build$src$core$renderers$measurables$statement_input.StatementInput=StatementInput$$module$build$src$core$renderers$measurables$statement_input;var TopRow$$module$build$src$core$renderers$measurables$top_row=class extends Row$$module$build$src$core$renderers$measurables$row{constructor(a){super(a);this.ascenderHeight=this.capline=0;this.hasPreviousConnection=!1;this.connection=null;this.type|=Types$$module$build$src$core$renderers$measurables$types.TOP_ROW}hasLeftSquareCorner(a){const b=(a.hat?a.hat==="cap":this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection,c=a.getPreviousBlock();return!!a.outputConnection||b||(c?
|
|
1241
1337
|
c.getNextBlock()===a:!1)}hasRightSquareCorner(a){return!0}measure(){let a=0,b=0,c=0;for(let d=0;d<this.elements.length;d++){const e=this.elements[d];b+=e.width;Types$$module$build$src$core$renderers$measurables$types.isSpacer(e)||(Types$$module$build$src$core$renderers$measurables$types.isHat(e)?c=Math.max(c,e.ascenderHeight):a=Math.max(a,e.height))}this.width=Math.max(this.minWidth,b);this.height=Math.max(this.minHeight,a)+c;this.capline=this.ascenderHeight=c;this.widthWithConnectedBlocks=this.width}startsWithElemSpacer(){return!1}endsWithElemSpacer(){return!1}},
|
|
1242
|
-
module$build$src$core$renderers$measurables$top_row={};module$build$src$core$renderers$measurables$top_row.TopRow=TopRow$$module$build$src$core$renderers$measurables$top_row;var ConstantProvider$$module$build$src$core$renderers$common$constants=class{constructor(){this.NO_PADDING=0;this.SMALL_PADDING=3;this.MEDIUM_PADDING=5;this.MEDIUM_LARGE_PADDING=8;this.LARGE_PADDING=10;this.TAB_HEIGHT=15;this.TAB_OFFSET_FROM_TOP=5;this.TAB_VERTICAL_OVERLAP=2.5;this.TAB_WIDTH=8;this.NOTCH_WIDTH=15;this.NOTCH_HEIGHT=4;this.MIN_BLOCK_WIDTH=12;this.EMPTY_BLOCK_SPACER_HEIGHT=16;this.CORNER_RADIUS=8;this.NOTCH_OFFSET_LEFT=
|
|
1243
|
-
20;this.BETWEEN_STATEMENT_PADDING_Y=4;this.ADD_START_HATS=!1;this.START_HAT_HEIGHT=15;this.START_HAT_WIDTH=100;this.SPACER_DEFAULT_HEIGHT=15;this.MIN_BLOCK_HEIGHT=24;this.EMPTY_INLINE_INPUT_PADDING=14.5;this.EXTERNAL_VALUE_INPUT_PADDING=2;this.JAGGED_TEETH_HEIGHT=12;this.JAGGED_TEETH_WIDTH=6;this.FIELD_TEXT_FONTSIZE=11;this.FIELD_TEXT_FONTWEIGHT="normal";this.FIELD_TEXT_FONTFAMILY="sans-serif";this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT
|
|
1244
|
-
16;this.FIELD_BORDER_RECT_X_PADDING=5;this.FIELD_BORDER_RECT_Y_PADDING=3;this.FIELD_BORDER_RECT_COLOUR="#fff";this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1;this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12;this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1;this.FIELD_COLOUR_DEFAULT_WIDTH=26;this.defs=null;this.embossFilterId="";this.embossFilter=null;this.disabledPatternId=
|
|
1245
|
-
this.debugFilter=null;this.CURSOR_COLOUR="#cc0a0a";this.MARKER_COLOUR="#4286f4";this.CURSOR_WS_WIDTH=100;this.WS_CURSOR_HEIGHT=5;this.CURSOR_STACK_PADDING=10;this.CURSOR_BLOCK_PADDING=2;this.CURSOR_STROKE_WIDTH=4;this.FULL_BLOCK_FIELDS=!1;this.INSERTION_MARKER_COLOUR="#000000";this.INSERTION_MARKER_OPACITY=.2;this.SHAPES={PUZZLE:1,NOTCH:2};this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=
|
|
1246
|
-
this.NOTCH_OFFSET_LEFT;this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11;this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT;this.START_POINT=moveBy$$module$build$src$core$utils$svg_paths(0,0);this.FIELD_TEXT_BASELINE_CENTER=!0;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=
|
|
1247
|
-
this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING;this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";
|
|
1338
|
+
module$build$src$core$renderers$measurables$top_row={};module$build$src$core$renderers$measurables$top_row.TopRow=TopRow$$module$build$src$core$renderers$measurables$top_row;var injectionSites$$module$build$src$core$renderers$common$constants=new Map,ConstantProvider$$module$build$src$core$renderers$common$constants=class{constructor(){this.NO_PADDING=0;this.SMALL_PADDING=3;this.MEDIUM_PADDING=5;this.MEDIUM_LARGE_PADDING=8;this.LARGE_PADDING=10;this.TAB_HEIGHT=15;this.TAB_OFFSET_FROM_TOP=5;this.TAB_VERTICAL_OVERLAP=2.5;this.TAB_WIDTH=8;this.NOTCH_WIDTH=15;this.NOTCH_HEIGHT=4;this.MIN_BLOCK_WIDTH=12;this.EMPTY_BLOCK_SPACER_HEIGHT=16;this.CORNER_RADIUS=8;this.NOTCH_OFFSET_LEFT=
|
|
1339
|
+
15;this.STATEMENT_BOTTOM_SPACER=0;this.STATEMENT_INPUT_PADDING_LEFT=20;this.BETWEEN_STATEMENT_PADDING_Y=4;this.ADD_START_HATS=!1;this.START_HAT_HEIGHT=15;this.START_HAT_WIDTH=100;this.SPACER_DEFAULT_HEIGHT=15;this.MIN_BLOCK_HEIGHT=24;this.EMPTY_INLINE_INPUT_PADDING=14.5;this.EXTERNAL_VALUE_INPUT_PADDING=2;this.JAGGED_TEETH_HEIGHT=12;this.JAGGED_TEETH_WIDTH=6;this.FIELD_TEXT_FONTSIZE=11;this.FIELD_TEXT_FONTWEIGHT="normal";this.FIELD_TEXT_FONTFAMILY="sans-serif";this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=
|
|
1340
|
+
-1;this.FIELD_BORDER_RECT_RADIUS=4;this.FIELD_BORDER_RECT_HEIGHT=16;this.FIELD_BORDER_RECT_X_PADDING=5;this.FIELD_BORDER_RECT_Y_PADDING=3;this.FIELD_BORDER_RECT_COLOUR="#fff";this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1;this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12;this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1;this.FIELD_COLOUR_DEFAULT_WIDTH=26;this.defs=null;this.embossFilterId="";this.embossFilter=null;this.disabledPatternId=
|
|
1341
|
+
"";this.disabledPattern=null;this.debugFilterId="";this.debugFilter=null;this.CURSOR_COLOUR="#cc0a0a";this.MARKER_COLOUR="#4286f4";this.CURSOR_WS_WIDTH=100;this.WS_CURSOR_HEIGHT=5;this.CURSOR_STACK_PADDING=10;this.CURSOR_BLOCK_PADDING=2;this.CURSOR_STROKE_WIDTH=4;this.FULL_BLOCK_FIELDS=!1;this.INSERTION_MARKER_COLOUR="#000000";this.INSERTION_MARKER_OPACITY=.2;this.SHAPES={PUZZLE:1,NOTCH:2};this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=
|
|
1342
|
+
this.TAB_HEIGHT;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT;this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11;this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT;this.START_POINT=moveBy$$module$build$src$core$utils$svg_paths(0,0);this.FIELD_TEXT_BASELINE_CENTER=!0;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=
|
|
1343
|
+
this.FIELD_BORDER_RECT_HEIGHT;this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING;this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";
|
|
1248
1344
|
this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT;this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3;this.randomIdentifier=String(Math.random()).substring(2)}init(){this.JAGGED_TEETH=this.makeJaggedTeeth();this.NOTCH=this.makeNotch();this.START_HAT=this.makeStartHat();this.PUZZLE_TAB=this.makePuzzleTab();this.INSIDE_CORNERS=this.makeInsideCorners();this.OUTSIDE_CORNERS=this.makeOutsideCorners()}setTheme(a){this.blockStyles=Object.create(null);const b=a.blockStyles;for(const c in b)this.blockStyles[c]=
|
|
1249
1345
|
this.validatedBlockStyle_(b[c]);this.setDynamicProperties_(a)}setDynamicProperties_(a){this.setFontConstants_(a);this.setComponentConstants_(a);this.ADD_START_HATS=a.startHats!==void 0?a.startHats:this.ADD_START_HATS}setFontConstants_(a){a.fontStyle&&a.fontStyle.family&&(this.FIELD_TEXT_FONTFAMILY=a.fontStyle.family);a.fontStyle&&a.fontStyle.weight&&(this.FIELD_TEXT_FONTWEIGHT=a.fontStyle.weight);a.fontStyle&&a.fontStyle.size&&(this.FIELD_TEXT_FONTSIZE=a.fontStyle.size);a=measureFontMetrics$$module$build$src$core$utils$dom("Hg",
|
|
1250
1346
|
this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY);this.FIELD_TEXT_HEIGHT=a.height;this.FIELD_TEXT_BASELINE=a.baseline}setComponentConstants_(a){this.CURSOR_COLOUR=a.getComponentStyle("cursorColour")||this.CURSOR_COLOUR;this.MARKER_COLOUR=a.getComponentStyle("markerColour")||this.MARKER_COLOUR;this.INSERTION_MARKER_COLOUR=a.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR;this.INSERTION_MARKER_OPACITY=Number(a.getComponentStyle("insertionMarkerOpacity"))||
|
|
1251
1347
|
this.INSERTION_MARKER_OPACITY}getBlockStyleForColour(a){const b="auto_"+a;this.blockStyles[b]||(this.blockStyles[b]=this.createBlockStyle_(a));return{style:this.blockStyles[b],name:b}}getBlockStyle(a){return this.blockStyles[a||""]||(a&&a.startsWith("auto_")?this.getBlockStyleForColour(a.substring(5)).style:this.createBlockStyle_("#000000"))}createBlockStyle_(a){return this.validatedBlockStyle_({colourPrimary:a})}validatedBlockStyle_(a){const b={};a&&Object.assign(b,a);a=parseBlockColour$$module$build$src$core$utils$parsing(b.colourPrimary||
|
|
1252
1348
|
"#000");b.colourPrimary=a.hex;b.colourSecondary=b.colourSecondary?parseBlockColour$$module$build$src$core$utils$parsing(b.colourSecondary).hex:this.generateSecondaryColour_(b.colourPrimary);b.colourTertiary=b.colourTertiary?parseBlockColour$$module$build$src$core$utils$parsing(b.colourTertiary).hex:this.generateTertiaryColour_(b.colourPrimary);b.hat=b.hat||"";return b}generateSecondaryColour_(a){return blend$$module$build$src$core$utils$colour("#fff",a,.6)||a}generateTertiaryColour_(a){return blend$$module$build$src$core$utils$colour("#fff",
|
|
1253
|
-
a,.3)||a}dispose(){this.embossFilter&&removeNode$$module$build$src$core$utils$dom(this.embossFilter);this.disabledPattern&&removeNode$$module$build$src$core$utils$dom(this.disabledPattern);this.debugFilter&&removeNode$$module$build$src$core$utils$dom(this.debugFilter)
|
|
1254
|
-
|
|
1255
|
-
f*h);
|
|
1349
|
+
a,.3)||a}dispose(){this.embossFilter&&removeNode$$module$build$src$core$utils$dom(this.embossFilter);this.disabledPattern&&removeNode$$module$build$src$core$utils$dom(this.disabledPattern);this.debugFilter&&removeNode$$module$build$src$core$utils$dom(this.debugFilter)}makeJaggedTeeth(){const a=this.JAGGED_TEETH_HEIGHT,b=this.JAGGED_TEETH_WIDTH,c=line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(b,a/4),point$$module$build$src$core$utils$svg_paths(-b*2,a/2),point$$module$build$src$core$utils$svg_paths(b,
|
|
1350
|
+
a/4)]);return{height:a,width:b,path:c}}makeStartHat(){const a=this.START_HAT_HEIGHT,b=this.START_HAT_WIDTH,c=curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(30,-a),point$$module$build$src$core$utils$svg_paths(70,-a),point$$module$build$src$core$utils$svg_paths(b,0)]);return{height:a*.75,width:b,path:c}}makePuzzleTab(){function a(f){f=f?-1:1;const g=-f;var h=c/2;const k=h+2.5,l=h+.5,m=point$$module$build$src$core$utils$svg_paths(-b,f*h);h=point$$module$build$src$core$utils$svg_paths(b,
|
|
1351
|
+
f*h);return curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(0,f*k),point$$module$build$src$core$utils$svg_paths(-b,g*l),m])+curve$$module$build$src$core$utils$svg_paths("s",[point$$module$build$src$core$utils$svg_paths(b,g*2.5),h])}const b=this.TAB_WIDTH,c=this.TAB_HEIGHT,d=a(!0),e=a(!1);return{type:this.SHAPES.PUZZLE,width:b,height:c,pathDown:e,pathUp:d}}makeNotch(){function a(g){return line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(g*
|
|
1256
1352
|
d,c),point$$module$build$src$core$utils$svg_paths(g*3,0),point$$module$build$src$core$utils$svg_paths(g*d,-c)])}const b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=(b-3)/2,e=a(1),f=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:e,pathRight:f}}makeInsideCorners(){const a=this.CORNER_RADIUS,b=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(-a,a)),c=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(a,
|
|
1257
1353
|
a));return{width:a,height:a,pathTop:b,pathBottom:c}}makeOutsideCorners(){const a=this.CORNER_RADIUS,b=moveBy$$module$build$src$core$utils$svg_paths(0,a)+arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(a,-a)),c=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(a,a)),d=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(-a,-a)),e=arc$$module$build$src$core$utils$svg_paths("a",
|
|
1258
1354
|
"0 0,1",a,point$$module$build$src$core$utils$svg_paths(-a,a));return{topLeft:b,topRight:c,bottomRight:e,bottomLeft:d,rightHeight:a}}shapeFor(a){switch(a.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:return this.PUZZLE_TAB;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type");
|
|
1259
|
-
}}createDom(a,b,c
|
|
1355
|
+
}}createDom(a,b,c){if(c){const d=c.getRootNode();this.injectCSS_(d,b)}this.defs=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS,{},a);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR,{"in":"SourceAlpha",stdDeviation:1,result:"blur"},a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FESPECULARLIGHTING,
|
|
1260
1356
|
{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEPOINTLIGHT,{x:-5E3,y:-1E4,z:2E4},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,
|
|
1261
1357
|
{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},a);this.embossFilterId=a.id;this.embossFilter=a;a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:10,height:10,fill:"#aaa"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,
|
|
1262
|
-
{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},a);this.disabledPatternId=a.id;this.disabledPattern=a;this.createDebugFilter();
|
|
1358
|
+
{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},a);this.disabledPatternId=a.id;this.disabledPattern=a;this.createDebugFilter();c&&(c.style.setProperty("--blocklyEmbossFilter",`url(#${this.embossFilterId})`),c.style.setProperty("--blocklyDisabledPattern",`url(#${this.disabledPatternId})`),c.style.setProperty("--blocklyDebugFilter",`url(#${this.debugFilterId})`))}createDebugFilter(){if(!this.debugFilter){const a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,
|
|
1263
1359
|
{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER,{result:"outBlur"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFLOOD,{"flood-color":"#ff0000",
|
|
1264
|
-
"flood-opacity":.5,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.debugFilterId=a.id;this.debugFilter=a}}injectCSS_(a,b){
|
|
1265
|
-
|
|
1266
|
-
"fill: #000;","}",`${a} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${a} .blocklyEditableField:not(.blocklyEditing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,
|
|
1267
|
-
"fill-opacity: .5;","}",`${a} .blocklyReplaceable .blocklyPathLight,`,`${a} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},module$build$src$core$renderers$common$constants={};
|
|
1268
|
-
module$build$src$core$renderers$common$constants.isDynamicShape=isDynamicShape$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isNotch=isNotch$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isPuzzleTab=isPuzzleTab$$module$build$src$core$renderers$common$constants;var Drawer$$module$build$src$core$renderers$common$drawer=class{constructor(a,b){this.inlinePath_=this.outlinePath_="";this.block_=a;this.info_=b;this.topLeft_=a.getRelativeToSurfaceXY();this.constants_=b.getRenderer().getConstants()}draw(){this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&this.block_.pathObject.flipRTL();this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=
|
|
1360
|
+
"flood-opacity":.5,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.debugFilterId=a.id;this.debugFilter=a}}injectCSS_(a,b){var c;if(typeof window!=="undefined"&&window.CSSStyleSheet&&((c=injectionSites$$module$build$src$core$renderers$common$constants.get(b))==null||!c.has(a))){c=new CSSStyleSheet;c.replace(this.getCSS_(b).join("\n"));a.adoptedStyleSheets.push(c);
|
|
1361
|
+
var d;c=(d=injectionSites$$module$build$src$core$renderers$common$constants.get(b))!=null?d:new WeakSet;c.add(a);injectionSites$$module$build$src$core$renderers$common$constants.set(b,c)}}getCSS_(a){return[`${a}.injectionDiv {`,"--blockly-active-node-color: #fc3;","}",`${a} .blocklyText, `,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyText {`,"fill: #fff;","}",`${a} .blocklyNonEditableField>rect,`,
|
|
1362
|
+
`${a} .blocklyEditableField>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text {`,"fill: #000;","}",`${a} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${a} .blocklyEditableField:not(.blocklyEditing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,
|
|
1363
|
+
"}",`${a} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${a} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${a} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${a} .blocklyReplaceable .blocklyPathLight,`,`${a} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},module$build$src$core$renderers$common$constants={};
|
|
1364
|
+
module$build$src$core$renderers$common$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isDynamicShape=isDynamicShape$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isNotch=isNotch$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isPuzzleTab=isPuzzleTab$$module$build$src$core$renderers$common$constants;var Drawer$$module$build$src$core$renderers$common$drawer=class{constructor(a,b){this.inlinePath_=this.outlinePath_="";this.block_=a;this.info_=b;this.topLeft_=a.getRelativeToSurfaceXY();this.constants_=b.getRenderer().getConstants()}draw(){this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&this.block_.pathObject.flipRTL();this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height=
|
|
1269
1365
|
this.info_.height;this.block_.width=this.info_.widthWithChildren;this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let a=1;a<this.info_.rows.length-1;a++){const b=this.info_.rows[a];b.hasJaggedEdge?this.drawJaggedEdge_(b):b.hasStatement?this.drawStatementInput_(b):b.hasExternalInput?this.drawValueInput_(b):this.drawRightSideRow_(b)}this.drawBottom_();this.drawLeft_()}drawTop_(){const a=this.info_.topRow,b=a.elements;this.positionPreviousConnection_();this.outlinePath_+=
|
|
1270
1366
|
moveBy$$module$build$src$core$utils$svg_paths(a.xPos,this.info_.startY);for(let c=0,d;d=b[c];c++)Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:Types$$module$build$src$core$renderers$measurables$types.isRightRoundedCorner(d)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(d)?this.outlinePath_+=d.shape.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(d)?
|
|
1271
1367
|
this.outlinePath_+=this.constants_.START_HAT.path:Types$$module$build$src$core$renderers$measurables$types.isSpacer(d)&&(this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("h",d.width));this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height-a.ascenderHeight)}drawJaggedEdge_(a){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height-this.constants_.JAGGED_TEETH.height)}drawValueInput_(a){const b=
|
|
@@ -1277,9 +1373,9 @@ if(a){const b=a.connectionOffsetY+a.height;a=isDynamicShape$$module$build$src$co
|
|
|
1277
1373
|
Types$$module$build$src$core$renderers$measurables$types.isField(d))&&this.layoutField_(d)}layoutField_(a){const b=a.centerline-a.height/2;let c=a.xPos;var d="";this.info_.RTL&&(c=-(c+a.width),a.flipRtl&&(c+=a.width,d="scale(-1 1)"));Types$$module$build$src$core$renderers$measurables$types.isIcon(a)?(d=a.icon,d.setOffsetInBlock(new Coordinate$$module$build$src$core$utils$coordinate(c,b)),this.info_.isInsertionMarker&&d.hideForInsertionMarker()):(a=a.field.getSvgRoot(),a.setAttribute("transform","translate("+
|
|
1278
1374
|
c+","+b+")"+d),this.info_.isInsertionMarker&&a.setAttribute("display","none"))}drawInlineInput_(a){const b=a.width,c=a.height,d=a.connectionOffsetY,e=a.connectionHeight+d;this.inlinePath_+=moveTo$$module$build$src$core$utils$svg_paths(a.xPos+a.connectionWidth,a.centerline-c/2)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",d)+a.shape.pathDown+lineOnAxis$$module$build$src$core$utils$svg_paths("v",c-e)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",b-a.connectionWidth)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",
|
|
1279
1375
|
-c)+"z";this.positionInlineInputConnection_(a)}positionInlineInputConnection_(a){const b=a.centerline-a.height/2;if(a.connectionModel){let c=a.xPos+a.connectionWidth+a.connectionOffsetX;this.info_.RTL&&(c*=-1);a.connectionModel.setOffsetInBlock(c,b+a.connectionOffsetY)}}positionStatementInputConnection_(a){const b=a.getLastInput();if(b==null?0:b.connectionModel){let c=a.xPos+a.statementEdge+b.notchOffset;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}}positionExternalValueConnection_(a){const b=
|
|
1280
|
-
a.getLastInput();if(b&&b.connectionModel){let c=a.xPos+a.width;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}}positionPreviousConnection_(){const a=this.info_.topRow;if(a.connection){const b=a.xPos+a.notchOffset;a.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-b:b,0)}}positionNextConnection_(){const a=this.info_.bottomRow;if(a.connection){const b=a.connection,c=b.xPos;b.connectionModel.setOffsetInBlock(this.info_.RTL?-c:c,a.baseline)}}positionOutputConnection_(){if(this.info_.outputConnection){
|
|
1281
|
-
this.info_.startX+this.info_.outputConnection.connectionOffsetX;this.block_.outputConnection.setOffsetInBlock(
|
|
1282
|
-
a=b.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE||b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?this.getExpressionConnectionHighlightPath(a):this.getStatementConnectionHighlightPath(a);const c=b.getSourceBlock();let d,e;return(e=(d=c.pathObject).addConnectionHighlight)==null?void 0:e.call(d,b,a,b.getOffsetInBlock(),c.RTL)}getExpressionConnectionHighlightPath(a){let b="";isDynamicShape$$module$build$src$core$renderers$common$constants(a.shape)?
|
|
1376
|
+
a.getLastInput();if(b&&b.connectionModel){let c=a.xPos+a.width;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}}positionPreviousConnection_(){const a=this.info_.topRow;if(a.connection){const b=a.xPos+a.notchOffset;a.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-b:b,0)}}positionNextConnection_(){const a=this.info_.bottomRow;if(a.connection){const b=a.connection,c=b.xPos;b.connectionModel.setOffsetInBlock(this.info_.RTL?-c:c,a.baseline)}}positionOutputConnection_(){if(this.info_.outputConnection){var a=
|
|
1377
|
+
this.info_.startX+this.info_.outputConnection.connectionOffsetX;a=this.info_.RTL?-a:a;let b;(b=this.block_.outputConnection)==null||b.setOffsetInBlock(a,this.info_.outputConnection.connectionOffsetY)}}updateConnectionHighlights(){for(const a of this.info_.rows)for(const b of a.elements){if(!(b instanceof Connection$$module$build$src$core$renderers$measurables$connection))continue;const c=this.drawConnectionHighlightPath(b);c&&(c.style.display=b.highlighted?"":"none")}}drawConnectionHighlightPath(a){const b=
|
|
1378
|
+
a.connectionModel;a=b.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE||b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?this.getExpressionConnectionHighlightPath(a):this.getStatementConnectionHighlightPath(a);const c=b.getSourceBlock();let d,e;return(e=(d=c.pathObject).addConnectionHighlight)==null?void 0:e.call(d,b,a,b.getOffsetInBlock(),c.RTL)}getExpressionConnectionHighlightPath(a){let b="";isDynamicShape$$module$build$src$core$renderers$common$constants(a.shape)?
|
|
1283
1379
|
b=a.shape.pathDown(a.height):isPuzzleTab$$module$build$src$core$renderers$common$constants(a.shape)&&(b=a.shape.pathDown);a=this.constants_.TAB_OFFSET_FROM_TOP;return moveBy$$module$build$src$core$utils$svg_paths(0,-a)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a)+b+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a)}getStatementConnectionHighlightPath(a){if(!isNotch$$module$build$src$core$renderers$common$constants(a.shape))throw Error("Statement connections should have notch shapes");
|
|
1284
1380
|
const b=this.constants_.NOTCH_OFFSET_LEFT-this.constants_.CORNER_RADIUS;return moveBy$$module$build$src$core$utils$svg_paths(-b,0)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",b)+a.shape.pathLeft+lineOnAxis$$module$build$src$core$utils$svg_paths("h",b)}},module$build$src$core$renderers$common$drawer={};module$build$src$core$renderers$common$drawer.Drawer=Drawer$$module$build$src$core$renderers$common$drawer;var RenderInfo$$module$build$src$core$renderers$common$info=class{constructor(a,b){this.statementEdge=this.width=this.widthWithChildren=this.height=0;this.rows=[];this.inputRows=[];this.startY=this.startX=0;this.renderer_=a;this.block_=b;this.constants_=this.renderer_.getConstants();this.outputConnection=b.outputConnection?new OutputConnection$$module$build$src$core$renderers$measurables$output_connection(this.constants_,b.outputConnection):null;this.isInline=b.getInputsInline()&&!b.isCollapsed();
|
|
1285
1381
|
this.isCollapsed=b.isCollapsed();this.isInsertionMarker=b.isInsertionMarker();this.RTL=b.RTL;this.topRow=new TopRow$$module$build$src$core$renderers$measurables$top_row(this.constants_);this.bottomRow=new BottomRow$$module$build$src$core$renderers$measurables$bottom_row(this.constants_)}getRenderer(){return this.renderer_}measure(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.computeBounds_();this.alignRowElements_();this.finalize_()}createRows_(){this.populateTopRow_();this.rows.push(this.topRow);
|
|
@@ -1305,12 +1401,12 @@ a+b.height/2:a-b.height/2):Types$$module$build$src$core$renderers$measurables$ty
|
|
|
1305
1401
|
b,d.xPos=this.startX,b+=d.height,a=Math.max(a,d.widthWithConnectedBlocks),this.recordElemPositions_(d);if(this.outputConnection&&this.block_.nextConnection){const c=this.block_.nextConnection.targetBlock();c&&(a=Math.max(a,c.getHeightWidth().width))}this.widthWithChildren=a+this.startX;this.height=b;this.startY=this.topRow.capline;this.bottomRow.baseline=b-this.bottomRow.descenderHeight}getMeasureableForConnection(a){let b;if(((b=this.outputConnection)==null?void 0:b.connectionModel)===a)return this.outputConnection;
|
|
1306
1402
|
for(const c of this.rows)for(const d of c.elements)if(d instanceof Connection$$module$build$src$core$renderers$measurables$connection&&d.connectionModel===a)return d;return null}},module$build$src$core$renderers$common$info={};module$build$src$core$renderers$common$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$common$info;var PathObject$$module$build$src$core$renderers$common$path_object=class{constructor(a,b,c){this.connectionHighlights=new WeakMap;this.highlightOffsets=new WeakMap;this.constants=c;this.style=b;this.svgRoot=a;this.svgPath=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyPath"},this.svgRoot);this.setClass_("blocklyBlock",!0)}setPath(a){this.svgPath.setAttribute("d",a)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)")}applyColour(a){this.svgPath.setAttribute("stroke",
|
|
1307
1403
|
this.style.colourTertiary);this.svgPath.setAttribute("fill",this.style.colourPrimary);this.updateShadow_(a.isShadow());this.updateDisabled_(!a.isEnabled()||a.getInheritedDisabled())}setStyle(a){this.style=a}setClass_(a,b){a&&(b?addClass$$module$build$src$core$utils$dom(this.svgRoot,a):removeClass$$module$build$src$core$utils$dom(this.svgRoot,a))}updateHighlighted(a){a?this.setClass_("blocklyHighlighted",!0):this.setClass_("blocklyHighlighted",!1)}updateShadow_(a){a?(this.setClass_("blocklyShadow",
|
|
1308
|
-
!0),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary)):this.setClass_("blocklyShadow",!1)}updateDisabled_(a){this.setClass_("blocklyDisabled",a);this.setClass_("blocklyDisabledPattern",a)}updateSelected(a){this.setClass_("blocklySelected",a)}updateDraggingDelete(a){this.setClass_("blocklyDraggingDelete",a)}updateInsertionMarker(a){this.setClass_("blocklyInsertionMarker",a)}updateMovable(a){this.setClass_("blocklyDraggable",a)}
|
|
1309
|
-
a)}
|
|
1310
|
-
|
|
1311
|
-
this.
|
|
1312
|
-
b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$common$path_object(a,b,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(a){return!
|
|
1313
|
-
module$build$src$core$renderers$common$renderer={};module$build$src$core$renderers$common$renderer.Renderer=Renderer$$module$build$src$core$renderers$common$renderer;var module$build$src$core$renderers$common$block_rendering={};module$build$src$core$renderers$common$block_rendering.BottomRow=BottomRow$$module$build$src$core$renderers$measurables$bottom_row;module$build$src$core$renderers$common$block_rendering.Connection=Connection$$module$build$src$core$renderers$measurables$connection;module$build$src$core$renderers$common$block_rendering.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$common$constants;
|
|
1404
|
+
!0),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary)):this.setClass_("blocklyShadow",!1)}updateDisabled_(a){this.setClass_("blocklyDisabled",a);this.setClass_("blocklyDisabledPattern",a)}updateSelected(a){this.setClass_("blocklySelected",a)}updateDraggingDelete(a){this.setClass_("blocklyDraggingDelete",a)}updateInsertionMarker(a){this.setClass_("blocklyInsertionMarker",a)}updateMovable(a){this.setClass_("blocklyDraggable",a)}updateReplacing(a){this.setClass_("blocklyReplaceable",
|
|
1405
|
+
a)}addConnectionHighlight(a,b,c,d){c=`translate(${c.x}, ${c.y})`+(d?" scale(-1 1)":"");if(d=this.connectionHighlights.get(a))return d.setAttribute("d",b),d.setAttribute("transform",c),d;b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{id:a.id,"class":"blocklyHighlightedConnectionPath",style:"display: none;",d:b,transform:c},this.svgRoot);this.connectionHighlights.set(a,b);return b}removeConnectionHighlight(a){const b=this.connectionHighlights.get(a);b&&
|
|
1406
|
+
(removeNode$$module$build$src$core$utils$dom(b),this.connectionHighlights.delete(a))}},module$build$src$core$renderers$common$path_object={};module$build$src$core$renderers$common$path_object.PathObject=PathObject$$module$build$src$core$renderers$common$path_object;var Renderer$$module$build$src$core$renderers$common$renderer=class{constructor(a){this.overrides=null;this.name=a}getClassName(){return this.name+"-renderer"}init(a,b){this.constants_=this.makeConstants_();b&&(this.overrides=b,Object.assign(this.constants_,b));this.constants_.setTheme(a);this.constants_.init()}createDom(a,b,c){this.constants_.createDom(a,"."+this.getClassName()+"."+b.getClassName(),c)}refreshDom(a,b,c){const d=this.getConstants();d.dispose();this.constants_=this.makeConstants_();
|
|
1407
|
+
this.overrides&&Object.assign(this.constants_,this.overrides);this.constants_.randomIdentifier=d.randomIdentifier;this.constants_.setTheme(b);this.constants_.init();this.createDom(a,b,c)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$common$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$common$info(this,a)}makeDrawer_(a,b){return new Drawer$$module$build$src$core$renderers$common$drawer(a,
|
|
1408
|
+
b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$common$path_object(a,b,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(a){return!a.getSourceBlock().isDragging()}orphanCanConnectAtEnd(a,b,c){return!!Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(a,c===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE?b.outputConnection:b.previousConnection)}render(a){const b=this.makeRenderInfo_(a);b.measure();
|
|
1409
|
+
this.makeDrawer_(a,b).draw()}},module$build$src$core$renderers$common$renderer={};module$build$src$core$renderers$common$renderer.Renderer=Renderer$$module$build$src$core$renderers$common$renderer;var module$build$src$core$renderers$common$block_rendering={};module$build$src$core$renderers$common$block_rendering.BottomRow=BottomRow$$module$build$src$core$renderers$measurables$bottom_row;module$build$src$core$renderers$common$block_rendering.Connection=Connection$$module$build$src$core$renderers$measurables$connection;module$build$src$core$renderers$common$block_rendering.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$common$constants;
|
|
1314
1410
|
module$build$src$core$renderers$common$block_rendering.Drawer=Drawer$$module$build$src$core$renderers$common$drawer;module$build$src$core$renderers$common$block_rendering.ExternalValueInput=ExternalValueInput$$module$build$src$core$renderers$measurables$external_value_input;module$build$src$core$renderers$common$block_rendering.Field=Field$$module$build$src$core$renderers$measurables$field;module$build$src$core$renderers$common$block_rendering.Hat=Hat$$module$build$src$core$renderers$measurables$hat;
|
|
1315
1411
|
module$build$src$core$renderers$common$block_rendering.Icon=Icon$$module$build$src$core$renderers$measurables$icon;module$build$src$core$renderers$common$block_rendering.InRowSpacer=InRowSpacer$$module$build$src$core$renderers$measurables$in_row_spacer;module$build$src$core$renderers$common$block_rendering.InlineInput=InlineInput$$module$build$src$core$renderers$measurables$inline_input;module$build$src$core$renderers$common$block_rendering.InputConnection=InputConnection$$module$build$src$core$renderers$measurables$input_connection;
|
|
1316
1412
|
module$build$src$core$renderers$common$block_rendering.InputRow=InputRow$$module$build$src$core$renderers$measurables$input_row;module$build$src$core$renderers$common$block_rendering.JaggedEdge=JaggedEdge$$module$build$src$core$renderers$measurables$jagged_edge;module$build$src$core$renderers$common$block_rendering.Measurable=Measurable$$module$build$src$core$renderers$measurables$base;module$build$src$core$renderers$common$block_rendering.NextConnection=NextConnection$$module$build$src$core$renderers$measurables$next_connection;
|
|
@@ -1336,64 +1432,66 @@ this.readOnly=!1;this.potentialVariableMap=null;this.id=genUid$$module$build$src
|
|
|
1336
1432
|
[]);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 "'+
|
|
1337
1433
|
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){const 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),
|
|
1338
1434
|
b=0;b<a.length;b++)a.push(...a[b].getChildren(!1));return a.filter(c=>!c.isInsertionMarker())}clear(){this.isClearing=!0;try{const 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=
|
|
1339
|
-
!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",
|
|
1340
|
-
"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");const 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",
|
|
1341
|
-
"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!=
|
|
1342
|
-
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");
|
|
1435
|
+
!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",
|
|
1436
|
+
"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");const 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",
|
|
1437
|
+
"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!=
|
|
1438
|
+
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");
|
|
1343
1439
|
}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;let b=0;for(const c in a){if(a[c]>this.remainingCapacityOfType(c))return!1;
|
|
1344
1440
|
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){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_;const d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group===b[b.length-1].group;){const 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);
|
|
1345
1441
|
try{for(c=0;c<e.length;c++)e[c].run(a)}finally{$.setRecordUndo$$module$build$src$core$events$utils(!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&&this.MAX_UNDO>=
|
|
1346
1442
|
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){let b;return(b=this.commentDB.get(a))!=null?b:null}allInputsFilled(a){const 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=
|
|
1347
1443
|
new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableMap}setVariableMap(a){this.variableMap=a}getProcedureMap(){return this.procedureMap}getRootWorkspace(){let a=null;const 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(){const a=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,
|
|
1348
1444
|
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();let a;(a=this.context)==null||a.close()}load(a,b){const c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
|
|
1349
|
-
e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){const c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(
|
|
1350
|
-
|
|
1351
|
-
|
|
1445
|
+
e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){const c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(c.isPlayingAllowed()&&b!==0){var d=c.sounds.get(a);if(d){yield c.prepareToPlay();const 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,
|
|
1446
|
+
b)}})}beep(a,b=.2){const 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);
|
|
1447
|
+
d.stop(c.context.currentTime+b)}})}playErrorBeep(){const a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){return a.beep(260)})}isPlayingAllowed(){const a=new Date;return this.getMuted()||!this.context||this.lastSound!==null&&a.getTime()-this.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio?!1:!0}prepareToPlay(){const a=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){a.lastSound=new Date;a.context.state==="suspended"&&(yield a.context.resume())})}setMuted(a){this.muted=
|
|
1448
|
+
a}getMuted(){return this.muted}},module$build$src$core$workspace_audio={};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=
|
|
1449
|
+
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.zoomControls_=this.layerManager=null;this.navigator=new Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;this.metricsManager=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,
|
|
1352
1450
|
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);this.audioManager=new WorkspaceAudio$$module$build$src$core$workspace_audio(a.parentWorkspace);this.grid=this.options.gridPattern?
|
|
1353
|
-
new Grid$$module$build$src$core$grid(this.options.gridPattern,a.gridOptions):null;
|
|
1451
|
+
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&&internalFlyoutCategory$$module$build$src$core$variables_dynamic&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables_dynamic,
|
|
1354
1452
|
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));this.addChangeListener(this.variableChangeCallback.bind(this));this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():
|
|
1355
|
-
new ThemeManager$$module$build$src$core$theme_manager(this,this.options.theme||Classic$$module$build$src$core$theme$classic);this.themeManager_.subscribeWorkspace(this);let b;this.renderer=init$$module$build$src$core$renderers$common$block_rendering(this.options.renderer||"geras",this.getTheme(),(b=this.options.rendererOverrides)!=null?b:void 0);this.cachedParentSvgSize=new Size$$module$build$src$core$utils$size(0,0)}
|
|
1356
|
-
a;this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
a
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
this
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
this.
|
|
1366
|
-
|
|
1367
|
-
this.svgGroup_.
|
|
1368
|
-
|
|
1369
|
-
this.
|
|
1370
|
-
this.
|
|
1371
|
-
a
|
|
1372
|
-
this.
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
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(){const a=
|
|
1453
|
+
new ThemeManager$$module$build$src$core$theme_manager(this,this.options.theme||Classic$$module$build$src$core$theme$classic);this.themeManager_.subscribeWorkspace(this);let b;this.renderer=init$$module$build$src$core$renderers$common$block_rendering(this.options.renderer||"geras",this.getTheme(),(b=this.options.rendererOverrides)!=null?b:void 0);this.cachedParentSvgSize=new Size$$module$build$src$core$utils$size(0,0)}getMetricsManager(){return this.metricsManager}setMetricsManager(a){this.metricsManager=
|
|
1454
|
+
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===null;this.renderer.refreshDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():
|
|
1455
|
+
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++){const d=c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const a=
|
|
1456
|
+
this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(a){let b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(a);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()&&
|
|
1457
|
+
a!==this.getInjectionDiv());return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}getCachedParentSvgSize(){const 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((" "+(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=
|
|
1458
|
+
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});b&&setState$$module$build$src$core$utils$aria(this.svgGroup_,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL);a&&(this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:"100%",
|
|
1459
|
+
width:"100%","class":a},this.svgGroup_),a==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this);this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",
|
|
1460
|
+
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===
|
|
1461
|
+
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&&
|
|
1462
|
+
(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();
|
|
1463
|
+
this.flyoutButtonCallbacks.clear();if(!this.options.parentWorkspace){const a=this.getParentSvg();a&&a.parentNode&&removeNode$$module$build$src$core$utils$dom(a.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);$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&
|
|
1464
|
+
$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);const 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);const a=this.zoomControls_.createDom();
|
|
1465
|
+
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){const b=this.copyOptionsForFlyout();b.toolboxPosition=this.options.toolboxPosition;this.flyout=this.horizontalLayout?
|
|
1466
|
+
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();
|
|
1467
|
+
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();const 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);const f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&
|
|
1468
|
+
this.scrollbar.resize();this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const a=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){const c=this.getParentSvg();a!=null&&(this.cachedParentSvgSize.width=
|
|
1469
|
+
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=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===
|
|
1470
|
+
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=b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){let c;(c=this.layerManager)==null||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);let d;(d=this.grid)==null||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){const a=
|
|
1471
|
+
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),this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){const 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=>
|
|
1472
|
+
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)||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(){const a=
|
|
1376
1473
|
this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){const 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++){const 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");
|
|
1377
|
-
}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}getDragTarget(a){for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.
|
|
1378
|
-
a}isDragging(){return
|
|
1379
|
-
|
|
1380
|
-
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=
|
|
1381
|
-
for(let d=1;d<a.length;d++){var c=a[d];c.isInsertionMarker&&c.isInsertionMarker()
|
|
1382
|
-
g.getBoundingRectangle());b=function(g){for(const h of d)if(g.intersects(h))return h;return null};var e=0;const f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=
|
|
1383
|
-
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,
|
|
1384
|
-
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.");
|
|
1385
|
-
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,
|
|
1386
|
-
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();let c;this.flyout?(c=b.svgWidth?
|
|
1387
|
-
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()/
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
a)}
|
|
1395
|
-
this.
|
|
1396
|
-
|
|
1474
|
+
}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){const b=this.getGesture(a);b&&b.handleWsStart(a,
|
|
1475
|
+
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||
|
|
1476
|
+
this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}onMouseWheel(a){if(Gesture$$module$build$src$core$gesture.inProgress())a.preventDefault(),
|
|
1477
|
+
a.stopPropagation();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=
|
|
1478
|
+
this.scrollX-d.y,c=this.scrollY),this.scroll(b,c));a.preventDefault()}}}getBlocksBoundingBox(){const a=this.getTopBoundedElements();if(!a.length)return new Rect$$module$build$src$core$utils$rect(0,0,0,0);const 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);
|
|
1479
|
+
const 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());const d=b.filter(g=>!g.isMovable()).map(g=>g.getBoundingRectangle());b=function(g){for(const h of d)if(g.intersects(h))return h;return null};var e=0;const f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=
|
|
1480
|
+
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);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,
|
|
1481
|
+
a);var c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,new Coordinate$$module$build$src$core$utils$coordinate(5,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.");
|
|
1482
|
+
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():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,
|
|
1483
|
+
c);const 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*(1-c),b*(1-c)).scale(c);this.scrollX=e.e;this.scrollY=e.f;this.setScale(d)}}zoomCenter(a){var b=this.getMetrics();let c;this.flyout?(c=b.svgWidth?
|
|
1484
|
+
b.svgWidth/2:0,b=b.svgHeight?b.svgHeight/2:0):(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&&(this.horizontalLayout?(a+=this.flyout.getHeight(),c+=this.flyout.getHeight()/this.scale):(b+=this.flyout.getWidth(),e+=this.flyout.getWidth()/
|
|
1485
|
+
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(),"blocklyCanvasTransitioning");addClass$$module$build$src$core$utils$dom(this.getBubbleCanvas(),
|
|
1486
|
+
"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,c)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")}centerOnBlock(a,
|
|
1487
|
+
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&&a>this.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:
|
|
1488
|
+
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&&(this.flyout?this.scrollbar.resizeView(a):this.scrollbar.resizeContent(a))}getScale(){return this.scale}getAbsoluteScale(){const a=
|
|
1489
|
+
c=>{if(c.isFlyout){let d;const e=(d=c.targetWorkspace)==null?void 0:d.getFlyout();if(e instanceof Flyout$$module$build$src$core$flyout_base)return e.getFlyoutScale()}return c.getScale()},b=(c,d)=>c.options.parentWorkspace&&c.options.parentWorkspace.getSvgGroup().contains(c.getSvgGroup())?b(c.options.parentWorkspace,d*a(c)):d*a(c);return b(this,1)}scroll(a,b){this.hideChaff(!0);const c=this.getMetrics();a=Math.min(a,-c.scrollLeft);b=Math.min(b,-c.scrollTop);const d=c.scrollTop+Math.max(0,c.scrollHeight-
|
|
1490
|
+
c.viewHeight);a=Math.max(a,-(c.scrollLeft+Math.max(0,c.scrollWidth-c.viewWidth)));b=Math.max(b,-d);this.scrollX=a;this.scrollY=b;this.scrollbar&&this.scrollbar.set(-(a+c.scrollLeft),-(b+c.scrollTop),!1);a+=c.absoluteLeft;b+=c.absoluteTop;this.translate(a,b)}getBlockById(a){return super.getBlockById(a)}getAllBlocks(a=!1){return super.getAllBlocks(a)}getTopBlocks(a=!1){return super.getTopBlocks(a)}addTopBlock(a){this.addTopBoundedElement(a);super.addTopBlock(a)}removeTopBlock(a){this.removeTopBoundedElement(a);
|
|
1491
|
+
super.removeTopBlock(a)}addTopComment(a){this.addTopBoundedElement(a);super.addTopComment(a)}removeTopComment(a){this.removeTopBoundedElement(a);super.removeTopComment(a)}getTopComments(a=!1){return super.getTopComments(a)}getCommentById(a){return super.getCommentById(a)}getRootWorkspace(){return super.getRootWorkspace()}addTopBoundedElement(a){this.topBoundedElements.push(a)}removeTopBoundedElement(a){removeElem$$module$build$src$core$utils$array(this.topBoundedElements,a)}getTopBoundedElements(a=
|
|
1492
|
+
!1){const b=[].concat(this.topBoundedElements);a&&b.sort(this.sortByOrigin.bind(this));return b}setResizesEnabled(a){const b=!this.resizesEnabled&&a;this.resizesEnabled=a;b&&this.resizeContents()}clear(){this.setResizesEnabled(!1);super.clear();this.topBoundedElements=[];this.setResizesEnabled(!0)}registerButtonCallback(a,b){if(typeof b!=="function")throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks.set(a,b)}getButtonCallback(a){let b;return(b=this.flyoutButtonCallbacks.get(a))!=
|
|
1493
|
+
null?b:null}removeButtonCallback(a){this.flyoutButtonCallbacks.delete(a)}registerToolboxCategoryCallback(a,b){if(typeof b!=="function")throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks.set(a,b)}getToolboxCategoryCallback(a){return this.toolboxCategoryCallbacks.get(a)||null}removeToolboxCategoryCallback(a){this.toolboxCategoryCallbacks.delete(a)}getGesture(a){if(KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover.mover.isMoving())return a==
|
|
1494
|
+
null||a.preventDefault(),a==null||a.stopPropagation(),null;const b=(a==null?void 0:a.type)==="pointerdown";let c;b&&((c=this.currentGesture_)==null?0:c.hasStarted())&&(console.warn("Tried to start the same gesture twice."),this.currentGesture_.cancel());!this.currentGesture_&&b&&(this.currentGesture_=new Gesture$$module$build$src$core$gesture(a,this));return this.currentGesture_}clearGesture(){this.currentGesture_=null}cancelCurrentGesture(){this.currentGesture_&&this.currentGesture_.cancel()}getAudioManager(){return this.audioManager}getGrid(){return this.grid}hideChaff(a=
|
|
1397
1495
|
!1){hide$$module$build$src$core$tooltip();hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this);hideWithoutAnimation$$module$build$src$core$dropdowndiv();this.hideComponents(a)}hideComponents(a=!1){this.getComponentManager().getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,!0).forEach(b=>b.autoHide(a))}static setTopLevelWorkspaceMetrics(a){const b=this.getMetrics();typeof a.x==="number"&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)*
|
|
1398
1496
|
a.x));typeof a.y==="number"&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)}addClass(a){this.injectionDiv&&addClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}removeClass(a){this.injectionDiv&&removeClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}setIsReadOnly(a){super.setIsReadOnly(a);a?this.addClass("blocklyReadOnly"):this.removeClass("blocklyReadOnly")}scrollBoundsIntoView(a,b=10){if(!Gesture$$module$build$src$core$gesture.inProgress()){var c=
|
|
1399
1497
|
this.getScale(),d=this.getMetricsManager().getViewMetrics(!0);d=new Rect$$module$build$src$core$utils$rect(d.top,d.top+d.height,d.left,d.left+d.width);if(!(a.left>=d.left&&a.top>=d.top&&a.right<=d.right&&a.bottom<=d.bottom)){a=a.clone();a.top-=b;a.bottom+=b;a.left-=b;a.right+=b;var e=b=0;a.left<d.left?b=this.RTL?Math.min(d.left-a.left,d.right-a.right):d.left-a.left:a.right>d.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.top<d.top?e=d.top-a.top:a.bottom>d.bottom&&(e=
|
|
@@ -1403,7 +1501,7 @@ RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comm
|
|
|
1403
1501
|
d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&f.getFocusableElement().id===a)return f;return null}if(b!==-1){e=a.substring(0,b);if(e=this.getBlockById(e))for(const h of e.getConnections_(!0))if(h.id===a)return h;return null}f=Math.max(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor),a.indexOf(COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button),a.indexOf(COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button));
|
|
1404
1502
|
if(f!==-1&&(f=a.substring(0,f),f=this.searchForWorkspaceComment(f))){if(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor)>-1)return f.getEditorFocusableNode();var g;return(g=f.view.getCommentBarButtons().find(h=>h.getFocusableElement().id.includes(a)))!=null?g:null}if((g=this.getAllBlocks(!1).find(h=>h.getFocusableElement().id===a))||(g=this.searchForWorkspaceComment(a)))return g;g=this.getAllBlocks().map(h=>h.getIcons()).flat();for(e of g){if(e.canBeFocused()&&
|
|
1405
1503
|
e.getFocusableElement().id===a)return e;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)){if((g=e.getBubble())&&g.canBeFocused()&&g.getFocusableElement().id===a)return g;if(g instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble&&g.getEditor().getFocusableElement().id===a)return g.getEditor()}}return null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b=
|
|
1406
|
-
this.targetWorkspace.getToolbox();b&&a===b||isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1)}}getNavigator(){return this.navigator}setNavigator(a){this.navigator=a}},module$build$src$core$workspace_svg={};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 VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.isBlank=typeof a==="undefined";a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=Abstract$$module$build$src$core$events$events_abstract.fromJson(a,
|
|
1504
|
+
this.targetWorkspace.getToolbox();b&&a===b||isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1)}}performAction(){showWorkspaceNavigationHint$$module$build$src$core$hints(this)}getNavigator(){return this.navigator}setNavigator(a){this.navigator=a}},module$build$src$core$workspace_svg={};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 VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.isBlank=typeof a==="undefined";a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=Abstract$$module$build$src$core$events$events_abstract.fromJson(a,
|
|
1407
1505
|
b,c!=null?c:new VarBase$$module$build$src$core$events$events_var_base);b.varId=a.varId;return b}},module$build$src$core$events$events_var_base={};module$build$src$core$events$events_var_base.VarBase=VarBase$$module$build$src$core$events$events_var_base;var VarCreate$$module$build$src$core$events$events_var_create=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_CREATE;a&&(this.varType=a.getType(),this.varName=a.getName())}toJson(){const a=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");
|
|
1408
1506
|
a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=VarBase$$module$build$src$core$events$events_var_base.fromJson(a,b,c!=null?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");
|
|
1409
1507
|
b=b.getVariableMap();a?b.createVariable(this.varName,this.varType,this.varId):(a=b.getVariableById(this.varId))&&b.deleteVariable(a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_CREATE,VarCreate$$module$build$src$core$events$events_var_create);var module$build$src$core$events$events_var_create={};module$build$src$core$events$events_var_create.VarCreate=VarCreate$$module$build$src$core$events$events_var_create;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(){const 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,
|
|
@@ -1414,14 +1512,14 @@ a.oldName=this.oldName;a.newName=this.newName;return a}static fromJson(a,b,c){b=
|
|
|
1414
1512
|
if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");b=b.getVariableMap();const c=b.getVariableById(this.varId);a?c&&b.renameVariable(c,this.newName):c&&b.renameVariable(c,this.oldName)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_RENAME,VarRename$$module$build$src$core$events$events_var_rename);
|
|
1415
1513
|
var module$build$src$core$events$events_var_rename={};module$build$src$core$events$events_var_rename.VarRename=VarRename$$module$build$src$core$events$events_var_rename;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(const a of this.variableMap.values())for(const 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);const d=this.workspace.getAllBlocks(!1);let e="";this.potentialMap||(e=$.getGroup$$module$build$src$core$events$utils())||
|
|
1416
1514
|
$.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){const 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);let e;d=(e=this.variableMap.get(b))!=null?e:new Map;d.set(a.getId(),a);
|
|
1417
|
-
this.variableMap.has(b)||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");const 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,
|
|
1515
|
+
this.variableMap.has(b)||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");const 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,
|
|
1418
1516
|
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){const 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));
|
|
1419
1517
|
let 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,
|
|
1420
1518
|
this.workspace.options,!0);if(!c)throw Error("No variable model is registered.");d=new c(this.workspace,a,b,d);let 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){const b=a.getType();this.variableMap.has(b)||this.variableMap.set(b,new Map);
|
|
1421
1519
|
let c;(c=this.variableMap.get(b))==null||c.set(a.getId(),a)}deleteVariable(a){const b=getVariableUsesById$$module$build$src$core$variables(this.workspace,a.getId());let 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);const 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)),
|
|
1422
|
-
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;let c;return(c=[...b.values()].find(d=>$.Names$$module$build$src$core$names.equals(d.getName(),
|
|
1423
|
-
a)))!=null?c:null}getVariableById(a){for(const 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(){let a=[];for(const 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");
|
|
1424
|
-
const a=[];for(const b of this.variableMap.values())for(const 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);
|
|
1520
|
+
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;let c;return(c=[...b.values()].find(d=>$.Names$$module$build$src$core$names.equals(d.getName(),
|
|
1521
|
+
a)))!=null?c:null}getVariableById(a){for(const 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(){let a=[];for(const 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");
|
|
1522
|
+
const a=[];for(const b of this.variableMap.values())for(const 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);
|
|
1425
1523
|
var module$build$src$core$variable_map={};module$build$src$core$variable_map.VariableMap=VariableMap$$module$build$src$core$variable_map;var TrashcanOpen$$module$build$src$core$events$events_trashcan_open=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(b);this.type=EventType$$module$build$src$core$events$type.TRASHCAN_OPEN;this.isOpen=a}toJson(){const a=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");a.isOpen=this.isOpen;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,
|
|
1426
1524
|
b,c!=null?c:new TrashcanOpen$$module$build$src$core$events$events_trashcan_open);b.isOpen=a.isOpen;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.TRASHCAN_OPEN,TrashcanOpen$$module$build$src$core$events$events_trashcan_open);var module$build$src$core$events$events_trashcan_open={};module$build$src$core$events$events_trashcan_open.TrashcanOpen=TrashcanOpen$$module$build$src$core$events$events_trashcan_open;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.contents=[];this.flyout=null;this.isLidOpen=!1;this.minOpenness=0;this.lidTask=this.svgLid=this.svgGroup=null;this.top=this.left=this.lidOpen=0;this.initialized=!1;this.workspace.options.maxTrashcanContents<=0||(a=this.workspace.copyOptionsForFlyout(),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition===
|
|
1427
1525
|
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,
|
|
@@ -1446,38 +1544,41 @@ delete c.x;delete c.y;delete c.enabled;delete c.disabledReasons;if(c.icons&&c.ic
|
|
|
1446
1544
|
MAX_LID_ANGLE$$module$build$src$core$trashcan=45,module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,stashedCoordinates$$module$build$src$core$clipboard=void 0,module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.copy=copy$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedData=getLastCopiedData$$module$build$src$core$clipboard;
|
|
1447
1545
|
module$build$src$core$clipboard.getLastCopiedLocation=getLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedWorkspace=getLastCopiedWorkspace$$module$build$src$core$clipboard;module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;module$build$src$core$clipboard.setLastCopiedData=setLastCopiedData$$module$build$src$core$clipboard;
|
|
1448
1546
|
module$build$src$core$clipboard.setLastCopiedLocation=setLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.setLastCopiedWorkspace=setLastCopiedWorkspace$$module$build$src$core$clipboard;var module$build$src$core$comments={};module$build$src$core$comments.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;module$build$src$core$comments.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;module$build$src$core$comments.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;module$build$src$core$comments.CommentView=CommentView$$module$build$src$core$comments$comment_view;
|
|
1449
|
-
module$build$src$core$comments.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;
|
|
1450
|
-
|
|
1451
|
-
|
|
1547
|
+
module$build$src$core$comments.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;
|
|
1548
|
+
(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo";a.MENU="menu";a.FOCUS_WORKSPACE="focus_workspace";a.FOCUS_TOOLBOX="focus_toolbox";a.START_MOVE="start_move";a.START_MOVE_STACK="start_move_stack";a.FINISH_MOVE="finish_move";a.ABORT_MOVE="abort_move";a.MOVE_UP="move_up";a.MOVE_DOWN="move_down";a.MOVE_LEFT="move_left";a.MOVE_RIGHT="move_right";a.NAVIGATE_RIGHT="right";a.NAVIGATE_LEFT="left";a.NAVIGATE_UP="up";a.NAVIGATE_DOWN="down";
|
|
1549
|
+
a.DISCONNECT="disconnect";a.NEXT_STACK="next_stack";a.PREVIOUS_STACK="previous_stack";a.INFORMATION="information";a.PERFORM_ACTION="perform_action"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));var resolveWorkspace$$module$build$src$core$shortcut_items=a=>{if(a.isFlyout){const c=a.targetWorkspace;if(c)return resolveWorkspace$$module$build$src$core$shortcut_items(c)}let b;return(b=a.getRootWorkspace())!=null?b:a};registerDefaultShortcuts$$module$build$src$core$shortcut_items();
|
|
1550
|
+
registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items();registerScreenReaderShortcuts$$module$build$src$core$shortcut_items();var module$build$src$core$shortcut_items={};module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerArrowNavigation=registerArrowNavigation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCopy=registerCopy$$module$build$src$core$shortcut_items;
|
|
1551
|
+
module$build$src$core$shortcut_items.registerCut=registerCut$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDisconnectBlock=registerDisconnectBlock$$module$build$src$core$shortcut_items;
|
|
1552
|
+
module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusToolbox=registerFocusToolbox$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerFocusWorkspace=registerFocusWorkspace$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerKeyboardNavigationShortcuts=registerKeyboardNavigationShortcuts$$module$build$src$core$shortcut_items;
|
|
1553
|
+
module$build$src$core$shortcut_items.registerMovementShortcuts=registerMovementShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerPaste=registerPaste$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerPerformAction=registerPerformAction$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerRedo=registerRedo$$module$build$src$core$shortcut_items;
|
|
1554
|
+
module$build$src$core$shortcut_items.registerScreenReaderShortcuts=registerScreenReaderShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerShowContextMenu=registerShowContextMenu$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerStackNavigation=registerStackNavigation$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;
|
|
1555
|
+
module$build$src$core$shortcut_items.registerWorkspaceOverview=registerWorkspaceOverview$$module$build$src$core$shortcut_items;var ProcedureSerializer$$module$build$src$core$serialization$procedures=class{constructor(a,b){this.procedureModelClass=a;this.parameterModelClass=b;this.priority=PROCEDURES$$module$build$src$core$serialization$priorities}save(a){a=a.getProcedureMap().getProcedures().map(b=>saveProcedure$$module$build$src$core$serialization$procedures(b));return a.length?a:null}load(a,b){const c=b.getProcedureMap();for(const d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass,
|
|
1452
1556
|
this.parameterModelClass,d,b))}clear(a){a.getProcedureMap().clear()}},module$build$src$core$serialization$procedures={};module$build$src$core$serialization$procedures.ProcedureSerializer=ProcedureSerializer$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.loadProcedure=loadProcedure$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.saveProcedure=saveProcedure$$module$build$src$core$serialization$procedures;var VariableSerializer$$module$build$src$core$serialization$variables=class{constructor(){this.priority=VARIABLES$$module$build$src$core$serialization$priorities}save(a){a=a.getVariableMap().getAllVariables().map(b=>b.save());return a.length?a:null}load(a,b){const c=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry);a.forEach(d=>{c==null||c.load(d,b)})}clear(a){a.getVariableMap().clear()}};
|
|
1453
1557
|
register$$module$build$src$core$serialization$registry("variables",new VariableSerializer$$module$build$src$core$serialization$variables);var module$build$src$core$serialization$variables={};module$build$src$core$serialization$variables.VariableSerializer=VariableSerializer$$module$build$src$core$serialization$variables;var module$build$src$core$serialization$workspaces={};module$build$src$core$serialization$workspaces.load=load$$module$build$src$core$serialization$workspaces;module$build$src$core$serialization$workspaces.save=save$$module$build$src$core$serialization$workspaces;var module$build$src$core$serialization={blocks:module$build$src$core$serialization$blocks,exceptions:module$build$src$core$serialization$exceptions,priorities:module$build$src$core$serialization$priorities,procedures:module$build$src$core$serialization$procedures,registry:module$build$src$core$serialization$registry,variables:module$build$src$core$serialization$variables,workspaceComments:module$build$src$core$serialization$workspace_comments,workspaces:module$build$src$core$serialization$workspaces};"Blockly"in globalThis||(globalThis.Blockly={Msg:module$build$src$core$msg});var module$build$src$core$main={};var LABEL_TYPE$$module$build$src$core$label_flyout_inflater="label",LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater=class{load(a,b){a=new FlyoutButton$$module$build$src$core$flyout_button(b.getWorkspace(),b.targetWorkspace,a,!0);a.show();return new FlyoutItem$$module$build$src$core$flyout_item(a,LABEL_TYPE$$module$build$src$core$label_flyout_inflater)}gapForItem(a,b){return b}disposeItem(a){a=a.getElement();a instanceof FlyoutButton$$module$build$src$core$flyout_button&&a.dispose()}getType(){return LABEL_TYPE$$module$build$src$core$label_flyout_inflater}};
|
|
1454
1558
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,LABEL_TYPE$$module$build$src$core$label_flyout_inflater,LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater);var module$build$src$core$label_flyout_inflater={};module$build$src$core$label_flyout_inflater.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;var ConstantProvider$$module$build$src$core$renderers$zelos$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(a){super();this.GRID_UNIT=4;this.CURSOR_COLOUR="#ffa200";this.CURSOR_RADIUS=5;this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0;this.START_HAT_HEIGHT=22;this.START_HAT_WIDTH=96;this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5};this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},
|
|
1455
1559
|
2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}};this.FULL_BLOCK_FIELDS=!0;this.FIELD_TEXT_FONTWEIGHT="bold";this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif';this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0;this.SELECTED_GLOW_COLOUR="#fff200";
|
|
1456
|
-
this.SELECTED_GLOW_SIZE=.5;this.
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
1)*
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
a)),
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
"}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${a} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableField:not(.blocklyEditing):hover>rect,",`${a} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableField:not(.blocklyEditing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${a} .blocklyDropdownText {`,"fill: #fff !important;",
|
|
1479
|
-
"}",`${a}.blocklyWidgetDiv .blocklyMenuItem,`,`${a}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${a} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${a} .blocklyDisabledPattern > .blocklyOutlinePath {`,"fill: var(--blocklyDisabledPattern)","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
|
|
1480
|
-
"}",`${a} .blocklySelected>.blocklyPath.blocklyPathSelected {`,"fill: none;","filter: var(--blocklySelectedGlowFilter);","}",`${a} .blocklyReplaceable>.blocklyPath {`,"filter: var(--blocklyReplacementGlowFilter);","}"]}},module$build$src$core$renderers$zelos$constants={};module$build$src$core$renderers$zelos$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$zelos$constants;var Drawer$$module$build$src$core$renderers$zelos$drawer=class extends Drawer$$module$build$src$core$renderers$common$drawer{constructor(a,b){super(a,b)}draw(){const a=this.block_.pathObject;a.beginDrawing();this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);a.endDrawing()}drawOutline_(){this.info_.outputConnection&&
|
|
1560
|
+
this.SELECTED_GLOW_SIZE=.5;this.selectedGlowFilterId="";this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.selectedGlowFilter=null;a&&(this.GRID_UNIT=a);this.SMALL_PADDING=this.GRID_UNIT;this.MEDIUM_PADDING=2*this.GRID_UNIT;this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT;this.LARGE_PADDING=4*this.GRID_UNIT;this.CORNER_RADIUS=1*this.GRID_UNIT;this.NOTCH_WIDTH=9*this.GRID_UNIT;this.NOTCH_HEIGHT=2*this.GRID_UNIT;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT;this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT;
|
|
1561
|
+
this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT;this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT;this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT;this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT;this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT;this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT;
|
|
1562
|
+
this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT;this.CURSOR_WS_WIDTH=20*this.GRID_UNIT;this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT;this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS;this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT;this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT;this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT;this.FIELD_DROPDOWN_SVG_ARROW_PADDING=
|
|
1563
|
+
this.FIELD_BORDER_RECT_X_PADDING;this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT;this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT;this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT;this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(a){super.setFontConstants_(a);this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+this.FIELD_BORDER_RECT_Y_PADDING*2}init(){super.init();this.HEXAGONAL=this.makeHexagonal();this.ROUNDED=this.makeRounded();this.SQUARED=
|
|
1564
|
+
this.makeSquared();this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(a){super.setDynamicProperties_(a);this.SELECTED_GLOW_COLOUR=a.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;this.SELECTED_GLOW_SIZE=(a=Number(a.getComponentStyle("selectedGlowSize")))&&!isNaN(a)?a:this.SELECTED_GLOW_SIZE}dispose(){super.dispose();this.selectedGlowFilter&&removeNode$$module$build$src$core$utils$dom(this.selectedGlowFilter)}makeStartHat(){const a=
|
|
1565
|
+
this.START_HAT_HEIGHT,b=this.START_HAT_WIDTH,c=curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(25,-a),point$$module$build$src$core$utils$svg_paths(71,-a),point$$module$build$src$core$utils$svg_paths(b,0)]);return{height:a*.75,width:b,path:c}}makeHexagonal(){function a(c,d,e){var f=c/2;f=f>b?b:f;e=e?-1:1;c=(d?-1:1)*c/2;return lineTo$$module$build$src$core$utils$svg_paths(-e*f,c)+lineTo$$module$build$src$core$utils$svg_paths(e*f,c)}const b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;
|
|
1566
|
+
return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(c){c/=2;return c>b?b:c},height(c){return c},connectionOffsetY(c){return c/2},connectionOffsetX(c){return-c},pathDown(c){return a(c,!1,!1)},pathUp(c){return a(c,!0,!1)},pathRightDown(c){return a(c,!1,!0)},pathRightUp(c){return a(c,!1,!0)}}}makeRounded(){function a(d,e,f){const g=d>c?d-c:0;d=(d>c?c:d)/2;const h=f===e?"0":"1";return arc$$module$build$src$core$utils$svg_paths("a","0 0,"+h,d,point$$module$build$src$core$utils$svg_paths((f?1:-1)*d,(e?
|
|
1567
|
+
-1:1)*d))+lineOnAxis$$module$build$src$core$utils$svg_paths("v",(e?-1:1)*g)+arc$$module$build$src$core$utils$svg_paths("a","0 0,"+h,d,point$$module$build$src$core$utils$svg_paths((f?-1:1)*d,(e?-1:1)*d))}const b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,c=b*2;return{type:this.SHAPES.ROUND,isDynamic:!0,width(d){d/=2;return d>b?b:d},height(d){return d},connectionOffsetY(d){return d/2},connectionOffsetX(d){return-d},pathDown(d){return a(d,!1,!1)},pathUp(d){return a(d,!0,!1)},pathRightDown(d){return a(d,
|
|
1568
|
+
!1,!0)},pathRightUp(d){return a(d,!1,!0)}}}makeSquared(){function a(c,d,e){c-=b*2;const f=e===d?"0":"1";return arc$$module$build$src$core$utils$svg_paths("a","0 0,"+f,b,point$$module$build$src$core$utils$svg_paths((e?1:-1)*b,(d?-1:1)*b))+lineOnAxis$$module$build$src$core$utils$svg_paths("v",(d?-1:1)*c)+arc$$module$build$src$core$utils$svg_paths("a","0 0,"+f,b,point$$module$build$src$core$utils$svg_paths((e?-1:1)*b,(d?-1:1)*b))}const b=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,
|
|
1569
|
+
width(c){return b},height(c){return c},connectionOffsetY(c){return c/2},connectionOffsetX(c){return-c},pathDown(c){return a(c,!1,!1)},pathUp(c){return a(c,!0,!1)},pathRightDown(c){return a(c,!1,!0)},pathRightUp(c){return a(c,!1,!0)}}}shapeFor(a){let b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:a=a.getSourceBlock().getOutputShape();
|
|
1570
|
+
if(a!==null)switch(a){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}if(b&&b.includes("Boolean"))return this.HEXAGONAL;if(b&&b.includes("Number"))return this.ROUNDED;b&&b.includes("String");return this.ROUNDED;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type");
|
|
1571
|
+
}}makeNotch(){function a(l){return curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/2,0),point$$module$build$src$core$utils$svg_paths(l*e*3/4,g/2),point$$module$build$src$core$utils$svg_paths(l*e,g)])+line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(l*e,f)])+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/4,g/2),point$$module$build$src$core$utils$svg_paths(l*
|
|
1572
|
+
e/2,g),point$$module$build$src$core$utils$svg_paths(l*e,g)])+lineOnAxis$$module$build$src$core$utils$svg_paths("h",l*d)+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/2,0),point$$module$build$src$core$utils$svg_paths(l*e*3/4,-(g/2)),point$$module$build$src$core$utils$svg_paths(l*e,-g)])+line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(l*e,-f)])+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*
|
|
1573
|
+
e/4,-(g/2)),point$$module$build$src$core$utils$svg_paths(l*e/2,-g),point$$module$build$src$core$utils$svg_paths(l*e,-g)])}const b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}}makeInsideCorners(){const a=this.CORNER_RADIUS,b=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(-a,a)),c=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(-a,
|
|
1574
|
+
a)),d=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(a,a)),e=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(a,a));return{width:a,height:a,pathTop:b,pathBottom:d,rightWidth:a,rightHeight:a,pathTopRight:c,pathBottomRight:e}}generateSecondaryColour_(a){return blend$$module$build$src$core$utils$colour("#000",a,.15)||a}generateTertiaryColour_(a){return blend$$module$build$src$core$utils$colour("#000",
|
|
1575
|
+
a,.25)||a}createDom(a,b,c){super.createDom(a,b,c);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS,{},a);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR,{"in":"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},
|
|
1576
|
+
a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER,{result:"outBlur"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,
|
|
1577
|
+
{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a);this.selectedGlowFilterId=a.id;this.selectedGlowFilter=a;c&&c.style.setProperty("--blocklySelectedGlowFilter",`url(#${this.selectedGlowFilterId})`)}getCSS_(a){return[`${a} .blocklyText,`,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${a} .blocklyText {`,"fill: #fff;","}",`${a} .blocklyNonEditableField>rect:not(.blocklyDropdownRect),`,
|
|
1578
|
+
`${a} .blocklyEditableField>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text,`,`${a} .blocklyNonEditableField>g>text,`,`${a} .blocklyEditableField>g>text {`,"fill: #575E75;","}",`${a} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${a} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableField:not(.blocklyEditing):hover>rect,",`${a} .blocklyDraggable:not(.blocklyDisabled)`,
|
|
1579
|
+
" .blocklyEditableField:not(.blocklyEditing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${a} .blocklyDropdownText {`,"fill: #fff !important;","}",`${a}.blocklyWidgetDiv .blocklyMenuItem,`,`${a}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;",
|
|
1580
|
+
"}",`${a} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${a} .blocklyDisabledPattern > .blocklyOutlinePath {`,"fill: var(--blocklyDisabledPattern)","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}",`${a} .blocklySelected>.blocklyPath.blocklyPathSelected {`,"fill: none;","filter: var(--blocklySelectedGlowFilter);","}"]}},module$build$src$core$renderers$zelos$constants={};
|
|
1581
|
+
module$build$src$core$renderers$zelos$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$zelos$constants;var Drawer$$module$build$src$core$renderers$zelos$drawer=class extends Drawer$$module$build$src$core$renderers$common$drawer{constructor(a,b){super(a,b)}draw(){const a=this.block_.pathObject;a.beginDrawing();this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);a.endDrawing()}drawOutline_(){this.info_.outputConnection&&
|
|
1481
1582
|
this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(a){if(!(a.height<=0)){if(Types$$module$build$src$core$renderers$measurables$types.isSpacer(a)){const d=
|
|
1482
1583
|
a.precedesStatement;var b=a.followsStatement;if(d||b){const e=this.constants_.INSIDE_CORNERS;var c=e.rightHeight;c=a.height-(d?c:0);b=b?e.pathBottomRight:"";a=c>0?lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.yPos+c):"";this.outlinePath_+=b+a+(d?e.pathTopRight:"");return}}this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.yPos+a.height)}}drawRightDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one");
|
|
1483
1584
|
this.outlinePath_+=this.info_.outputConnection.shape.pathRightDown(this.info_.outputConnection.height)}drawLeftDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one");this.positionOutputConnection_();this.outlinePath_+=this.info_.outputConnection.shape.pathUp(this.info_.outputConnection.height);this.outlinePath_+="z"}drawFlatTop_(){const a=this.info_.topRow;this.positionPreviousConnection_();this.outlinePath_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,
|
|
@@ -1503,12 +1604,12 @@ d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core
|
|
|
1503
1604
|
e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,
|
|
1504
1605
|
"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null);$.setGroup$$module$build$src$core$events$utils(!1);this.unbindInputEvents_();var a=getDiv$$module$build$src$core$widgetdiv().style;a.width="auto";a.height="auto";a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");removeClass$$module$build$src$core$utils$dom(a,"blocklyEditing")}onFinishEditing_(a){}bindInputEvents_(a){this.onKeyDownWrapper=
|
|
1505
1606
|
conditionalBind$$module$build$src$core$browser_events(a,"keydown",this,this.onHtmlInputKeyDown_);this.onInputWrapper=conditionalBind$$module$build$src$core$browser_events(a,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper),this.onKeyDownWrapper=null);this.onInputWrapper&&(unbind$$module$build$src$core$browser_events(this.onInputWrapper),this.onInputWrapper=null)}onHtmlInputKeyDown_(a){if(a.key==="Enter")hideIfOwner$$module$build$src$core$widgetdiv(this),
|
|
1506
|
-
hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Escape")this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Tab"){a.preventDefault();var b
|
|
1507
|
-
|
|
1508
|
-
$.getFocusManager$$module$build$src$core$focus_manager().focusNode(
|
|
1509
|
-
this.name||null,a,this.value_))}setEditorValue_(a,b=!0){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a,b)}resizeEditor_(){finishQueuedRenders$$module$build$src$core$render_management().then(()=>{
|
|
1510
|
-
b.
|
|
1511
|
-
(MINIMUM_WIDTH$$module$build$src$core$field_input-c)/2:0),b)}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(a){return`${a}`}getValueFromEditorText_(a){return a}};FieldInput$$module$build$src$core$field_input.BORDERRADIUS=4;var module$build$src$core$field_input={};module$build$src$core$field_input.FieldInput=FieldInput$$module$build$src$core$field_input;$.FieldTextInput$$module$build$src$core$field_textinput=class extends FieldInput$$module$build$src$core$field_input{constructor(a,b,c){super(a,b,c)}initView(){super.initView();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyTextInputField")}doClassValidation_(a){return a===void 0?null:`${a}`}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};
|
|
1607
|
+
hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Escape")this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Tab"){a.preventDefault();var b;const c=(b=this.workspace_)==null?void 0:b.getNavigator(),d=e=>(e instanceof FieldInput$$module$build$src$core$field_input||e instanceof BlockSvg$$module$build$src$core$block_svg&&e.isSimpleReporter())&&
|
|
1608
|
+
e!==this.getSourceBlock();b=this;do{let e,f;b=a.shiftKey?(e=c)==null?void 0:e.getOutNode(b):(f=c)==null?void 0:f.getInNode(b)}while(b&&!d(b));b=b instanceof BlockSvg$$module$build$src$core$block_svg&&b.isSimpleReporter()?b.getFields().next().value:b;b instanceof FieldInput$$module$build$src$core$field_input&&(hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv(),a=b.getSourceBlock(),b.isFullBlockField()&&a&&a instanceof BlockSvg$$module$build$src$core$block_svg?
|
|
1609
|
+
$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a):$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b),b.showEditor())}}onHtmlInputChange(a){a=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_,
|
|
1610
|
+
this.name||null,a,this.value_))}setEditorValue_(a,b=!0){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a,b)}resizeEditor_(){finishQueuedRenders$$module$build$src$core$render_management().then(()=>{var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;const b=getDiv$$module$build$src$core$widgetdiv();var c=this.getScaledBBox();b.style.width=c.right-c.left+"px";b.style.height=c.bottom-c.top+"px";a=a.RTL?c.right-
|
|
1611
|
+
b.offsetWidth:c.left;c=c.top;var d=b==null?void 0:b.parentElement;d&&(d=d.getBoundingClientRect(),a-=d.left+window.scrollX,c-=d.top+window.scrollY);b.style.left=`${a}px`;b.style.top=`${c}px`})}repositionForWindowResize(){let a;const b=(a=this.getSourceBlock())==null?void 0:a.getRootBlock();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),b)||this.resizeEditor_();
|
|
1612
|
+
return!0}positionTextElement_(a,b){const c=a*2+b;super.positionTextElement_(a+(c<MINIMUM_WIDTH$$module$build$src$core$field_input?(MINIMUM_WIDTH$$module$build$src$core$field_input-c)/2:0),b)}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(a){return`${a}`}getValueFromEditorText_(a){return a}};FieldInput$$module$build$src$core$field_input.BORDERRADIUS=4;var module$build$src$core$field_input={};module$build$src$core$field_input.FieldInput=FieldInput$$module$build$src$core$field_input;$.FieldTextInput$$module$build$src$core$field_textinput=class extends FieldInput$$module$build$src$core$field_input{constructor(a,b,c){super(a,b,c)}initView(){super.initView();this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyTextInputField")}doClassValidation_(a){return a===void 0?null:`${a}`}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};
|
|
1512
1613
|
register$$module$build$src$core$field_registry("field_input",$.FieldTextInput$$module$build$src$core$field_textinput);$.FieldTextInput$$module$build$src$core$field_textinput.prototype.DEFAULT_VALUE="";var module$build$src$core$field_textinput={};module$build$src$core$field_textinput.FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput;var BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row=class extends BottomRow$$module$build$src$core$renderers$measurables$bottom_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){return!!a.outputConnection}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$bottom_row={};module$build$src$core$renderers$zelos$measurables$bottom_row.BottomRow=BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row;var StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs=class extends StatementInput$$module$build$src$core$renderers$measurables$statement_input{constructor(a,b){super(a,b);this.connectedBottomNextConnection=!1;if(this.connectedBlock){for(a=this.connectedBlock;b=a.getNextBlock();)a=b;a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},module$build$src$core$renderers$zelos$measurables$inputs={};
|
|
1513
1614
|
module$build$src$core$renderers$zelos$measurables$inputs.StatementInput=StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs;var RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements=class extends Measurable$$module$build$src$core$renderers$measurables$base{constructor(a){super(a);this.width=this.height=0;this.type|=Types$$module$build$src$core$renderers$measurables$types.getType("RIGHT_CONNECTION")}},module$build$src$core$renderers$zelos$measurables$row_elements={};module$build$src$core$renderers$zelos$measurables$row_elements.RightConnectionShape=RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements;var TopRow$$module$build$src$core$renderers$zelos$measurables$top_row=class extends TopRow$$module$build$src$core$renderers$measurables$top_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){const b=(a.hat?a.hat==="cap":this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$top_row=
|
|
1514
1615
|
{};module$build$src$core$renderers$zelos$measurables$top_row.TopRow=TopRow$$module$build$src$core$renderers$zelos$measurables$top_row;var RenderInfo$$module$build$src$core$renderers$zelos$info=class extends RenderInfo$$module$build$src$core$renderers$common$info{constructor(a,b){super(a,b);this.isInline=!0;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.topRow=new TopRow$$module$build$src$core$renderers$zelos$measurables$top_row(this.constants_);this.bottomRow=new BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row(this.constants_);this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=
|
|
@@ -1533,43 +1634,42 @@ this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConn
|
|
|
1533
1634
|
c.field instanceof FieldImage$$module$build$src$core$field_image);if(!a&&c)e.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.SMALL_PADDING,f.height-=this.constants_.MEDIUM_PADDING;else if(!a&&!b)e.height+=this.constants_.SMALL_PADDING;else if(b){a=!1;for(b=0;b<f.elements.length;b++)if(c=f.elements[b],Types$$module$build$src$core$renderers$measurables$types.isInlineInput(c)&&c.connectedBlock&&!c.connectedBlock.isShadow()&&c.connectedBlock.getHeightWidth().height>=40){a=!0;break}a&&
|
|
1534
1635
|
(e.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.SMALL_PADDING)}}}}finalize_(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();super.finalize_();this.rightSide&&(this.widthWithChildren+=this.rightSide.width)}},module$build$src$core$renderers$zelos$info={};module$build$src$core$renderers$zelos$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$zelos$info;var PathObject$$module$build$src$core$renderers$zelos$path_object=class extends PathObject$$module$build$src$core$renderers$common$path_object{constructor(a,b,c){super(a,b,c);this.svgPathSelected=null;this.outlines=new Map;this.remainingOutlines=new Set;this.outputShapeType=null;this.constants=c}setPath(a){super.setPath(a);this.svgPathSelected&&this.svgPathSelected.setAttribute("d",a)}applyColour(a){super.applyColour(a);const b=a.getParent();a.isShadow()&&b&&this.svgPath.setAttribute("stroke",b.getColourTertiary());
|
|
1535
1636
|
for(const c of this.outlines.values())c.setAttribute("fill",this.style.colourTertiary)}flipRTL(){super.flipRTL();for(const a of this.outlines.values())a.setAttribute("transform","scale(-1 1)")}updateSelected(a){this.setClass_("blocklySelected",a);a?this.svgPathSelected||(this.svgPathSelected=this.svgPath.cloneNode(!0),this.svgPathSelected.classList.add("blocklyPathSelected"),removeClass$$module$build$src$core$utils$dom(this.svgPathSelected,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME),
|
|
1536
|
-
removeClass$$module$build$src$core$utils$dom(this.svgPathSelected,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME),this.svgPathSelected.removeAttribute("tabindex"),this.svgPathSelected.removeAttribute("id"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}
|
|
1537
|
-
(a=this.getOutlinePath(a)
|
|
1538
|
-
this.outlines.
|
|
1539
|
-
b,this.getConstants())}getConstants(){return this.constants_}};register$$module$build$src$core$renderers$common$block_rendering("zelos",Renderer$$module$build$src$core$renderers$zelos$renderer);var module$build$src$core$renderers$zelos$renderer={};module$build$src$core$renderers$zelos$renderer.Renderer=Renderer$$module$build$src$core$renderers$zelos$renderer;var InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer=class{constructor(a){this.staticConn=this.draggedConn=this.markerConn=this.fadedBlock=null;this.workspace=a.workspace}previewReplacement(a,b,c){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.fadedBlock=c,c.fadeForReplacement(!0),this.workspace.getRenderer().shouldHighlightConnection(b)&&(b.highlight(),this.staticConn=b)}finally{$.enable$$module$build$src$core$events$utils()}}previewConnection(a,
|
|
1540
|
-
b){if(a!==this.draggedConn||b!==this.staticConn){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.shouldUseMarkerPreview(a,b)&&(this.markerConn=this.previewMarker(a,b)),this.workspace.getRenderer().shouldHighlightConnection(b)&&b.highlight(),this.draggedConn=a,this.staticConn=b}finally{$.enable$$module$build$src$core$events$utils()}}}shouldUseMarkerPreview(a,b){return b.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||
|
|
1541
|
-
|
|
1542
|
-
try{d==null||d.positionNearConnection(e,f,g),d==null||d.getSvgRoot().setAttribute("visibility","visible")}finally{$.enable$$module$build$src$core$events$utils()}}});return e}serializeBlockToInsertionMarker(a){const b=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!b)throw Error(`Failed to serialize source block. ${a.toDevString()}`);return b}createInsertionMarker(a){a=
|
|
1543
|
-
this.workspace);for(const b of a.getDescendants(!1))b.setInsertionMarker(!0);a.initSvg();a.getSvgRoot().setAttribute("visibility","hidden");return a}getMatchingConnection(a,b,c){a=a.getConnections_(!0);b=b.getConnections_(!0);if(a.length!==b.length)return null;for(let d=0;d<a.length;d++)if(a[d]===c)return b[d];return null}hidePreview(){$.disable$$module$build$src$core$events$utils();try{this.staticConn&&
|
|
1544
|
-
this.fadedBlock=null),this.markerConn&&(this.hideInsertionMarker(this.markerConn),this.draggedConn=this.markerConn=null)}finally{$.enable$$module$build$src$core$events$utils()}}hideInsertionMarker(a){const b=a.getSourceBlock(),c=b.outputConnection;let d;if(((d=b.previousConnection)==null?0:d.targetConnection)||(c==null?
|
|
1545
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,DEFAULT$$module$build$src$core$registry,InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer);var module$build$src$core$insertion_marker_previewer={};module$build$src$core$insertion_marker_previewer.InsertionMarkerPreviewer=InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer;var module$build$src$core$inputs={};module$build$src$core$inputs.Align=$.Align$$module$build$src$core$inputs$align;module$build$src$core$inputs.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;module$build$src$core$inputs.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;module$build$src$core$inputs.Input=Input$$module$build$src$core$inputs$input;module$build$src$core$inputs.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;
|
|
1637
|
+
removeClass$$module$build$src$core$utils$dom(this.svgPathSelected,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME),this.svgPathSelected.removeAttribute("tabindex"),this.svgPathSelected.removeAttribute("id"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}beginDrawing(){this.remainingOutlines.clear();for(const a of this.outlines.keys())this.remainingOutlines.add(a)}endDrawing(){if(this.remainingOutlines.size)for(const a of this.remainingOutlines)this.removeOutlinePath(a);
|
|
1638
|
+
this.remainingOutlines.clear()}setOutlinePath(a,b){a=this.getOutlinePath(a);a.setAttribute("d",b);a.setAttribute("fill",this.style.colourTertiary)}getOutlinePath(a){this.outlines.has(a)||this.outlines.set(a,createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyOutlinePath",d:""},this.svgRoot));this.remainingOutlines.delete(a);return this.outlines.get(a)}removeOutlinePath(a){let b,c;(b=this.outlines.get(a))==null||(c=b.parentNode)==null||c.removeChild(this.outlines.get(a));
|
|
1639
|
+
this.outlines.delete(a)}},module$build$src$core$renderers$zelos$path_object={};module$build$src$core$renderers$zelos$path_object.PathObject=PathObject$$module$build$src$core$renderers$zelos$path_object;var Renderer$$module$build$src$core$renderers$zelos$renderer=class extends Renderer$$module$build$src$core$renderers$common$renderer{constructor(a){super(a)}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$zelos$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$zelos$info(this,a)}makeDrawer_(a,b){return new Drawer$$module$build$src$core$renderers$zelos$drawer(a,b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$zelos$path_object(a,
|
|
1640
|
+
b,this.getConstants())}getConstants(){return this.constants_}shouldHighlightConnection(a){return super.shouldHighlightConnection(a)||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE}};register$$module$build$src$core$renderers$common$block_rendering("zelos",Renderer$$module$build$src$core$renderers$zelos$renderer);var module$build$src$core$renderers$zelos$renderer={};module$build$src$core$renderers$zelos$renderer.Renderer=Renderer$$module$build$src$core$renderers$zelos$renderer;var InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer=class{constructor(a){this.staticConn=this.draggedConn=this.markerConn=this.fadedBlock=null;this.workspace=a.workspace}previewReplacement(a,b,c){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.fadedBlock=c,c.fadeForReplacement(!0),this.workspace.getRenderer().shouldHighlightConnection(b)&&(b.highlight(),this.staticConn=b)}finally{$.enable$$module$build$src$core$events$utils()}}previewConnection(a,
|
|
1641
|
+
b){if(a!==this.draggedConn||b!==this.staticConn){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.shouldUseMarkerPreview(a,b)&&(this.markerConn=this.previewMarker(a,b)),this.workspace.getRenderer().shouldHighlightConnection(b)&&b.highlight(),this.workspace.getRenderer().shouldHighlightConnection(a)&&a.highlight(),this.draggedConn=a,this.staticConn=b}finally{$.enable$$module$build$src$core$events$utils()}}}shouldUseMarkerPreview(a,b){return b.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||
|
|
1642
|
+
b.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||!(this.workspace.getRenderer()instanceof Renderer$$module$build$src$core$renderers$zelos$renderer)}previewMarker(a,b){const c=a.getSourceBlock(),d=this.createInsertionMarker(c),e=this.getMatchingConnection(c,d,a);if(!e)return null;d.queueRender();triggerQueuedRenders$$module$build$src$core$render_management();e.connect(b);const f={x:b.x-e.x,y:b.y-e.y},g=e.getOffsetInBlock().clone();finishQueuedRenders$$module$build$src$core$render_management().then(()=>
|
|
1643
|
+
{if(!d.isDeadOrDying()){$.disable$$module$build$src$core$events$utils();try{d==null||d.positionNearConnection(e,f,g),d==null||d.getSvgRoot().setAttribute("visibility","visible")}finally{$.enable$$module$build$src$core$events$utils()}}});return e}serializeBlockToInsertionMarker(a){const b=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!b)throw Error(`Failed to serialize source block. ${a.toDevString()}`);return b}createInsertionMarker(a){a=
|
|
1644
|
+
this.serializeBlockToInsertionMarker(a);a=append$$module$build$src$core$serialization$blocks(a,this.workspace);for(const b of a.getDescendants(!1))b.setInsertionMarker(!0);a.initSvg();a.getSvgRoot().setAttribute("visibility","hidden");return a}getMatchingConnection(a,b,c){a=a.getConnections_(!0);b=b.getConnections_(!0);if(a.length!==b.length)return null;for(let d=0;d<a.length;d++)if(a[d]===c)return b[d];return null}hidePreview(){$.disable$$module$build$src$core$events$utils();try{this.staticConn&&
|
|
1645
|
+
(this.staticConn.unhighlight(),this.staticConn=null),this.draggedConn&&(this.draggedConn.unhighlight(),this.draggedConn=null),this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null),this.markerConn&&(this.hideInsertionMarker(this.markerConn),this.draggedConn=this.markerConn=null)}finally{$.enable$$module$build$src$core$events$utils()}}hideInsertionMarker(a){const b=a.getSourceBlock(),c=b.outputConnection;let d;if(((d=b.previousConnection)==null?0:d.targetConnection)||(c==null?
|
|
1646
|
+
0:c.targetConnection))b.unplug(!0);else{let e;(e=a.targetBlock())==null||e.unplug(!1)}b.dispose()}dispose(){this.hidePreview()}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,DEFAULT$$module$build$src$core$registry,InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer);var module$build$src$core$insertion_marker_previewer={};module$build$src$core$insertion_marker_previewer.InsertionMarkerPreviewer=InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer;var module$build$src$core$inputs={};module$build$src$core$inputs.Align=$.Align$$module$build$src$core$inputs$align;module$build$src$core$inputs.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;module$build$src$core$inputs.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;module$build$src$core$inputs.Input=Input$$module$build$src$core$inputs$input;module$build$src$core$inputs.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;
|
|
1546
1647
|
module$build$src$core$inputs.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;module$build$src$core$inputs.inputTypes=$.inputTypes$$module$build$src$core$inputs$input_types;var documentEventsBound$$module$build$src$core$inject=!1,module$build$src$core$inject={};module$build$src$core$inject.inject=inject$$module$build$src$core$inject;var module$build$src$core$generator;
|
|
1547
1648
|
$.CodeGenerator$$module$build$src$core$generator=class{constructor(a){this.forBlock=Object.create(null);this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}";this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null;this.INDENT=" ";this.COMMENT_WRAP=60;this.ORDER_OVERRIDES=[];this.isInitialized=null;this.RESERVED_WORDS_="";this.definitions_=Object.create(null);this.functionNames_=Object.create(null);this.nameDB_=void 0;this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,
|
|
1548
1649
|
"g")}workspaceToCode(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=getMainWorkspace$$module$build$src$core$common());var b=[];this.init(a);a=a.getTopBlocks(!0);for(let c=0,d;d=a[c];c++){let e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX,
|
|
1549
1650
|
d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")}prefixLines(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)}allNestedComments(a){const b=[];a=a.getDescendants(!0);for(let c=0;c<a.length;c++){const d=a[c].getCommentText();d&&b.push(d)}b.length&&b.push("");return b.join("\n")}blockToCode(a,b){this.isInitialized===!1&&console.warn("CodeGenerator init was not called before blockToCode was called.");if(!a)return"";if(!a.isEnabled())return b?
|
|
1550
1651
|
"":this.blockToCode(a.getNextBlock());if(a.isInsertionMarker())return b?"":this.blockToCode(a.getChildren(!1)[0]);var c=this.forBlock[a.type];if(typeof c!=="function")throw Error(`${this.name_} generator does not know how to generate code for block type "${a.type}".`);c=c.call(a,a,this);if(Array.isArray(c)){if(!a.outputConnection)throw TypeError("Expecting string from statement block: "+a.type);return[this.scrub_(a,c[0],b),c[1]]}if(typeof c==="string")return this.STATEMENT_PREFIX&&!a.suppressPrefixSuffix&&
|
|
1551
|
-
(c=this.injectId(this.STATEMENT_PREFIX,a)+c),this.STATEMENT_SUFFIX&&!a.suppressPrefixSuffix&&(c+=this.injectId(this.STATEMENT_SUFFIX,a)),this.scrub_(a,c,b);if(c===null)return"";throw SyntaxError("Invalid code generated: "+c);}valueToCode(a,b,c){if(isNaN(c))throw TypeError("Expecting valid order from block: "+a.type);var d=a.getInputTargetBlock(b);if(!d&&!a.getInput(b))throw ReferenceError(`Input "${b}" doesn't exist on "${a.type}"`);if(!d)return"";b=this.blockToCode(d);if(b==="")return"";if(!Array.isArray(b))throw TypeError(`Expecting tuple from value block: ${d.type} See
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1652
|
+
(c=this.injectId(this.STATEMENT_PREFIX,a)+c),this.STATEMENT_SUFFIX&&!a.suppressPrefixSuffix&&(c+=this.injectId(this.STATEMENT_SUFFIX,a)),this.scrub_(a,c,b);if(c===null)return"";throw SyntaxError("Invalid code generated: "+c);}valueToCode(a,b,c){if(isNaN(c))throw TypeError("Expecting valid order from block: "+a.type);var d=a.getInputTargetBlock(b);if(!d&&!a.getInput(b))throw ReferenceError(`Input "${b}" doesn't exist on "${a.type}"`);if(!d)return"";b=this.blockToCode(d);if(b==="")return"";if(!Array.isArray(b))throw TypeError(`Expecting tuple from value block: ${d.type} See developers.google.com/blockly/guides/create-custom-blocks/generating-code for more information`);
|
|
1653
|
+
a=b[0];b=b[1];if(isNaN(b))throw TypeError("Expecting valid order from value block: "+d.type);if(!a)return"";d=!1;var e=Math.floor(c);const f=Math.floor(b);if(e<=f&&(e!==f||e!==0&&e!==99))for(d=!0,e=0;e<this.ORDER_OVERRIDES.length;e++)if(this.ORDER_OVERRIDES[e][0]===c&&this.ORDER_OVERRIDES[e][1]===b){d=!1;break}d&&(a="("+a+")");return a}statementToCode(a,b){const c=a.getInputTargetBlock(b);if(!c&&!a.getInput(b))throw ReferenceError(`Input "${b}" doesn't exist on "${a.type}"`);a=this.blockToCode(c);
|
|
1654
|
+
if(typeof a!=="string")throw TypeError("Expecting code from statement block: "+(c&&c.type));a&&(a=this.prefixLines(a,this.INDENT));return a}addLoopTrap(a,b){this.INFINITE_LOOP_TRAP&&(a=this.prefixLines(this.injectId(this.INFINITE_LOOP_TRAP,b),this.INDENT)+a);this.STATEMENT_SUFFIX&&!b.suppressPrefixSuffix&&(a=this.prefixLines(this.injectId(this.STATEMENT_SUFFIX,b),this.INDENT)+a);this.STATEMENT_PREFIX&&!b.suppressPrefixSuffix&&(a+=this.prefixLines(this.injectId(this.STATEMENT_PREFIX,b),this.INDENT));
|
|
1655
|
+
return a}injectId(a,b){b=b.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+b+"'")}addReservedWords(a){this.RESERVED_WORDS_+=a+","}provideFunction_(a,b){if(!this.definitions_[a]){const c=this.nameDB_.getDistinctName(a,$.NameType$$module$build$src$core$names.PROCEDURE);this.functionNames_[a]=c;Array.isArray(b)&&(b=b.join("\n"));b=b.trim().replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,c);let d;for(;d!==b;)d=b,b=b.replace(/^(( {2})*) {2}/gm,"$1\x00");b=b.replace(/\0/g,this.INDENT);this.definitions_[a]=
|
|
1656
|
+
b}return this.functionNames_[a]}getVariableName(a){return this.getName(a,$.NameType$$module$build$src$core$names.VARIABLE)}getProcedureName(a){return this.getName(a,$.NameType$$module$build$src$core$names.PROCEDURE)}getName(a,b){if(!this.nameDB_)throw Error("Name database is not defined. You must initialize `nameDB_` in your generator class and call `init` first.");return this.nameDB_.getName(a,b)}init(a){this.definitions_=Object.create(null);this.functionNames_=Object.create(null)}scrub_(a,b,c){return b}finish(a){this.definitions_=
|
|
1657
|
+
Object.create(null);this.functionNames_=Object.create(null);return a}scrubNakedValue(a){return a}};module$build$src$core$generator={};module$build$src$core$generator.CodeGenerator=$.CodeGenerator$$module$build$src$core$generator;var VerticalFlyout$$module$build$src$core$flyout_vertical=class extends Flyout$$module$build$src$core$flyout_base{constructor(a){super(a)}setMetrics_(a){if(this.isVisible()){var b=this.workspace_.getMetricsManager(),c=b.getScrollMetrics(),d=b.getViewMetrics();b=b.getAbsoluteMetrics();typeof a.y==="number"&&(this.workspace_.scrollY=-(c.top+(c.height-d.height)*a.y));this.workspace_.translate(this.workspace_.scrollX+b.left,this.workspace_.scrollY+b.top)}}getX(){if(!this.isVisible())return 0;var a=this.targetWorkspace.getMetricsManager();
|
|
1557
1658
|
const b=a.getAbsoluteMetrics(),c=a.getViewMetrics();a=a.getToolboxMetrics();return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.LEFT?a.width:c.width-this.getWidth():this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.LEFT?0:c.width:this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.LEFT?0:c.width+b.left-this.getWidth()}getY(){return 0}position(){if(this.isVisible()&&
|
|
1558
1659
|
this.targetWorkspace.isVisible()){var a=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=a.height;var b=this.getWidth()-this.CORNER_RADIUS;this.setBackgroundPath(b,a.height-2*this.CORNER_RADIUS);a=this.getX();b=this.getY();this.positionAt_(this.getWidth(),this.getHeight(),a,b)}}setBackgroundPath(a,b){const c=this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.RIGHT;var d=a+this.CORNER_RADIUS;d=["M "+(c?d:0)+",0"];d.push("h",c?-a:a);d.push("a",this.CORNER_RADIUS,
|
|
1559
1660
|
this.CORNER_RADIUS,0,0,c?0:1,c?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("v",Math.max(0,b));d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,c?0:1,c?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS);d.push("h",c?a:-a);d.push("z");this.svgBackground_.setAttribute("d",d.join(" "))}scrollToStart(){let a;(a=this.workspace_.scrollbar)==null||a.setY(0)}wheel_(a){var b=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(b.y){const c=this.workspace_.getMetricsManager(),
|
|
1560
|
-
d=c.getScrollMetrics();b=c.getViewMetrics().top-d.top+b.y;let e;(e=this.workspace_.scrollbar)==null||e.setY(b);hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this.workspace_);hideWithoutAnimation$$module$build$src$core$dropdowndiv()}a.preventDefault();a.stopPropagation()}layout_(a){this.workspace_.scale=this.targetWorkspace.scale;var b=this.MARGIN;const c=this.RTL?b:b+this.tabWidth_;for(const d of a)d.getElement().moveBy(c,b),b+=d.getElement().getBoundingRectangle().getHeight()}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
this.
|
|
1564
|
-
|
|
1661
|
+
d=c.getScrollMetrics();b=c.getViewMetrics().top-d.top+b.y;let e;(e=this.workspace_.scrollbar)==null||e.setY(b);hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this.workspace_);hideWithoutAnimation$$module$build$src$core$dropdowndiv()}a.preventDefault();a.stopPropagation()}layout_(a){this.workspace_.scale=this.targetWorkspace.scale;var b=this.MARGIN;const c=this.RTL?b:b+this.tabWidth_;for(const d of a)d.getElement().moveBy(c,b),b+=d.getElement().getBoundingRectangle().getHeight()}getClientRect(){if(!this.svgGroup_||
|
|
1662
|
+
this.autoClose||!this.isVisible())return null;const a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.LEFT?new Rect$$module$build$src$core$utils$rect(-1E9,1E9,-1E9,b+a.width):new Rect$$module$build$src$core$utils$rect(-1E9,1E9,b,1E9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let a=this.getContents().reduce((b,c)=>Math.max(b,c.getElement().getBoundingRectangle().getWidth()),0);a+=this.MARGIN*1.5+this.tabWidth_;
|
|
1663
|
+
a*=this.workspace_.scale;a+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness;if(this.getWidth()!==a){if(this.RTL)for(const b of this.getContents()){const c=b.getElement().getBoundingRectangle().left,d=a/this.workspace_.scale-b.getElement().getBoundingRectangle().getWidth()-this.MARGIN-this.tabWidth_;b.getElement().moveBy(d-c,0)}this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Position$$module$build$src$core$utils$toolbox.LEFT||
|
|
1664
|
+
this.targetWorkspace.translate(this.targetWorkspace.scrollX+a,this.targetWorkspace.scrollY);this.width_=a;this.position();this.targetWorkspace.resizeContents();this.targetWorkspace.recordDragTargets()}}};VerticalFlyout$$module$build$src$core$flyout_vertical.registryName="verticalFlyout";register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,DEFAULT$$module$build$src$core$registry,VerticalFlyout$$module$build$src$core$flyout_vertical);
|
|
1665
|
+
var module$build$src$core$flyout_vertical={};module$build$src$core$flyout_vertical.VerticalFlyout=VerticalFlyout$$module$build$src$core$flyout_vertical;var HorizontalFlyout$$module$build$src$core$flyout_horizontal=class extends Flyout$$module$build$src$core$flyout_base{constructor(a){super(a);this.horizontalLayout=!0}setMetrics_(a){if(this.isVisible()){var b=this.workspace_.getMetricsManager(),c=b.getScrollMetrics(),d=b.getViewMetrics();b=b.getAbsoluteMetrics();typeof a.x==="number"&&(this.workspace_.scrollX=-(c.left+(c.width-d.width)*a.x));this.workspace_.translate(this.workspace_.scrollX+b.left,this.workspace_.scrollY+b.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0;
|
|
1565
1666
|
var a=this.targetWorkspace.getMetricsManager();const b=a.getAbsoluteMetrics(),c=a.getViewMetrics();a=a.getToolboxMetrics();const d=this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?d?a.height:c.height-this.getHeight():d?0:c.height:d?0:c.height+b.top-this.getHeight()}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var a=this.targetWorkspace.getMetricsManager().getViewMetrics();
|
|
1566
1667
|
this.width_=a.width;a=a.width-2*this.CORNER_RADIUS;var b=this.getHeight()-this.CORNER_RADIUS;this.setBackgroundPath(a,b);a=this.getX();b=this.getY();this.positionAt_(this.getWidth(),this.getHeight(),a,b)}}setBackgroundPath(a,b){const c=this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP,d=["M 0,"+(c?0:this.CORNER_RADIUS)];c?(d.push("h",a+2*this.CORNER_RADIUS),d.push("v",b),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("h",
|
|
1567
1668
|
-a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),d.push("h",a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("v",b),d.push("h",-a-2*this.CORNER_RADIUS));d.push("z");this.svgBackground_.setAttribute("d",d.join(" "))}scrollToStart(){let a;(a=this.workspace_.scrollbar)==null||a.setX(this.RTL?Infinity:
|
|
1568
1669
|
0)}wheel_(a){var b=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(b=b.x||b.y){const c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().left-d.left+b;let e;(e=this.workspace_.scrollbar)==null||e.setX(b);hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this.workspace_);hideWithoutAnimation$$module$build$src$core$dropdowndiv()}a.preventDefault();a.stopPropagation()}layout_(a){this.workspace_.scale=this.targetWorkspace.scale;const b=this.MARGIN;
|
|
1569
|
-
let c=b+this.tabWidth_;this.RTL&&(a=a.reverse());for(const d of a)a=d.getElement().getBoundingRectangle(),a=this.RTL?c+a.getWidth():c,d.getElement().moveBy(a,b),c+=d.getElement().getBoundingRectangle().getWidth()}
|
|
1570
|
-
|
|
1571
|
-
this.
|
|
1572
|
-
var module$build$src$core$flyout_horizontal={};module$build$src$core$flyout_horizontal.HorizontalFlyout=HorizontalFlyout$$module$build$src$core$flyout_horizontal;var FieldVariable$$module$build$src$core$field_variable=class extends FieldDropdown$$module$build$src$core$field_dropdown{constructor(a,b,c,d,e){super(Field$$module$build$src$core$field.SKIP_SETUP);this.defaultType="";this.variableTypes=[];this.variable=null;this.SERIALIZABLE=!0;this.menuGenerator_=FieldVariable$$module$build$src$core$field_variable.dropdownCreate;this.defaultVariableName=typeof a==="string"?a:"";this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&
|
|
1670
|
+
let c=b+this.tabWidth_;this.RTL&&(a=a.reverse());for(const d of a)a=d.getElement().getBoundingRectangle(),a=this.RTL?c+a.getWidth():c,d.getElement().moveBy(a,b),c+=d.getElement().getBoundingRectangle().getWidth()}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP?new Rect$$module$build$src$core$utils$rect(-1E9,b+a.height,-1E9,1E9):new Rect$$module$build$src$core$utils$rect(b,
|
|
1671
|
+
1E9,-1E9,1E9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let a=this.getContents().reduce((b,c)=>Math.max(b,c.getElement().getBoundingRectangle().getHeight()),0);a+=this.MARGIN*1.5;a*=this.workspace_.scale;a+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness;this.getHeight()!==a&&(this.targetWorkspace.scrollbar||this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Position$$module$build$src$core$utils$toolbox.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,
|
|
1672
|
+
this.targetWorkspace.scrollY+a),this.height_=a,this.position(),this.targetWorkspace.resizeContents(),this.targetWorkspace.recordDragTargets())}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,DEFAULT$$module$build$src$core$registry,HorizontalFlyout$$module$build$src$core$flyout_horizontal);var module$build$src$core$flyout_horizontal={};module$build$src$core$flyout_horizontal.HorizontalFlyout=HorizontalFlyout$$module$build$src$core$flyout_horizontal;var FieldVariable$$module$build$src$core$field_variable=class extends FieldDropdown$$module$build$src$core$field_dropdown{constructor(a,b,c,d,e){super(Field$$module$build$src$core$field.SKIP_SETUP);this.defaultType="";this.variableTypes=[];this.variable=null;this.SERIALIZABLE=!0;this.menuGenerator_=FieldVariable$$module$build$src$core$field_variable.dropdownCreate;this.defaultVariableName=typeof a==="string"?a:"";this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&
|
|
1573
1673
|
(e?this.configure_(e):this.setTypes(c,d),b&&this.setValidator(b))}configure_(a){super.configure_(a);this.setTypes(a.variableTypes,a.defaultType)}initModel(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.variable||(a=$.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(a.getId()))}initView(){super.initView();addClass$$module$build$src$core$utils$dom(this.fieldGroup_,
|
|
1574
1674
|
"blocklyVariableField")}shouldAddBorderRect_(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||a.type!=="variables_get")}fromXml(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;const c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=$.getOrCreateVariablePackage$$module$build$src$core$variables(b.workspace,
|
|
1575
1675
|
c,d,e);if(e!==null&&e!==b.getType())throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.getType()+", and does not match variable field that references it: "+domToText$$module$build$src$core$xml(a)+".");this.setValue(b.getId())}toXml(a){this.initModel();a.id=this.variable.getId();a.textContent=this.variable.getName();this.variable.getType()&&a.setAttribute("variabletype",this.variable.getType());return a}saveState(a){var b=this.saveLegacyState(FieldVariable$$module$build$src$core$field_variable);
|
|
@@ -1588,11 +1688,12 @@ this.max_));return a}initView(){super.initView();this.fieldGroup_&&addClass$$mod
|
|
|
1588
1688
|
var module$build$src$core$field_label_serializable={};module$build$src$core$field_label_serializable.FieldLabelSerializable=FieldLabelSerializable$$module$build$src$core$field_label_serializable;var FieldCheckbox$$module$build$src$core$field_checkbox=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.SERIALIZABLE=!0;this.value_=this.value_;this.checkChar=FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.checkCharacter&&(this.checkChar=a.checkCharacter)}saveState(){const a=
|
|
1589
1689
|
this.saveLegacyState(FieldCheckbox$$module$build$src$core$field_checkbox);return a!==null?a:this.getValueBoolean()}initView(){super.initView();const a=this.getTextElement();addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyCheckboxField");a.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(a){this.checkChar=
|
|
1590
1690
|
a||FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(a){return a===!0||a==="TRUE"?"TRUE":a===!1||a==="FALSE"?"FALSE":null}doValueUpdate_(a){this.value_=this.convertValueToBool(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool(this.value_))}convertValueToBool(a){return typeof a===
|
|
1591
|
-
"string"?a==="TRUE":!!a}static fromJson(a){return new this(a.checked,void 0,a)}};FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR="\u2713";register$$module$build$src$core$field_registry("field_checkbox",FieldCheckbox$$module$build$src$core$field_checkbox);FieldCheckbox$$module$build$src$core$field_checkbox.prototype.DEFAULT_VALUE=!1;var module$build$src$core$field_checkbox={};module$build$src$core$field_checkbox.FieldCheckbox=FieldCheckbox$$module$build$src$core$field_checkbox;var Dragger$$module$build$src$core$dragging$dragger=class{constructor(a
|
|
1592
|
-
this.
|
|
1593
|
-
a.wouldDelete(b):!1}onDragEnd(a){const b=$.getGroup$$module$build$src$core$events$utils();
|
|
1594
|
-
this.draggable.
|
|
1595
|
-
|
|
1691
|
+
"string"?a==="TRUE":!!a}static fromJson(a){return new this(a.checked,void 0,a)}};FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR="\u2713";register$$module$build$src$core$field_registry("field_checkbox",FieldCheckbox$$module$build$src$core$field_checkbox);FieldCheckbox$$module$build$src$core$field_checkbox.prototype.DEFAULT_VALUE=!1;var module$build$src$core$field_checkbox={};module$build$src$core$field_checkbox.FieldCheckbox=FieldCheckbox$$module$build$src$core$field_checkbox;var Dragger$$module$build$src$core$dragging$dragger=class{constructor(a){this.draggable=a;this.dragTarget=null;this.startLoc=a.getRelativeToSurfaceXY()}onDragStart(a){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);this.draggable=this.draggable.startDrag(a);this.startLoc=this.draggable.getRelativeToSurfaceXY();return this.draggable}onDrag(a,b){this.moveDraggable(a,b);isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)&&this.draggable.setDeleteStyle(this.wouldDeleteDraggable(this.draggable.getRelativeToSurfaceXY(),
|
|
1692
|
+
this.draggable));this.updateDragTarget(this.draggable.getRelativeToSurfaceXY())}updateDragTarget(a){a=this.draggable.workspace.getDragTarget(a);if(this.dragTarget!==a){let b;(b=this.dragTarget)==null||b.onDragExit(this.draggable);a==null||a.onDragEnter(this.draggable)}a==null||a.onDragOver(this.draggable);this.dragTarget=a}moveDraggable(a,b){b=this.pixelsToWorkspaceUnits(b);b=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startLoc,b);this.draggable.drag(b,a)}wouldDeleteDraggable(a,b){return(a=
|
|
1693
|
+
this.draggable.workspace.getDragTarget(a))&&this.draggable.workspace.getComponentManager().hasCapability(a.id,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA)?a.wouldDelete(b):!1}onDragEnd(a){const b=$.getGroup$$module$build$src$core$events$utils();if(this.draggable.workspace.getDragTarget(this.draggable.getRelativeToSurfaceXY())){var c;(c=this.dragTarget)==null||c.onDrop(this.draggable)}c=!1;this.shouldReturnToStart(this.draggable.getRelativeToSurfaceXY(),this.draggable)&&
|
|
1694
|
+
(c=!0,this.draggable.revertDrag());const d=isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)&&this.wouldDeleteDraggable(this.draggable.getRelativeToSurfaceXY(),this.draggable);d&&isDeletable$$module$build$src$core$interfaces$i_deletable(this.draggable)?(this.draggable.endDrag(a,DragDisposition$$module$build$src$core$interfaces$i_draggable.DELETE),$.setGroup$$module$build$src$core$events$utils(b),this.draggable.dispose()):this.draggable.endDrag(a,c?DragDisposition$$module$build$src$core$interfaces$i_draggable.REVERT:
|
|
1695
|
+
DragDisposition$$module$build$src$core$interfaces$i_draggable.COMMIT);$.setGroup$$module$build$src$core$events$utils(!1);!d&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(this.draggable)&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.draggable)}onDragRevert(){this.draggable.revertDrag();isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(this.draggable)&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.draggable)}shouldReturnToStart(a,
|
|
1696
|
+
b){return(a=this.draggable.workspace.getDragTarget(a))?a.shouldPreventMove(b):!1}pixelsToWorkspaceUnits(a){a=new Coordinate$$module$build$src$core$utils$coordinate(a.x/this.draggable.workspace.scale,a.y/this.draggable.workspace.scale);this.draggable.workspace.isMutator&&a.scale(1/this.draggable.workspace.options.parentWorkspace.scale);return a}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,DEFAULT$$module$build$src$core$registry,Dragger$$module$build$src$core$dragging$dragger);
|
|
1596
1697
|
var module$build$src$core$dragging$dragger={};module$build$src$core$dragging$dragger.Dragger=Dragger$$module$build$src$core$dragging$dragger;var module$build$src$core$dragging={};module$build$src$core$dragging.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;module$build$src$core$dragging.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;module$build$src$core$dragging.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;module$build$src$core$dragging.Dragger=Dragger$$module$build$src$core$dragging$dragger;var BlockDrag$$module$build$src$core$events$events_block_drag=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.BLOCK_DRAG;a&&(this.blockId=a.id,this.isStart=b,this.blocks=c)}toJson(){const a=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===
|
|
1597
1698
|
void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.isStart=this.isStart;a.blockId=this.blockId;a.blocks=this.blocks;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new BlockDrag$$module$build$src$core$events$events_block_drag);b.isStart=a.isStart;b.blockId=a.blockId;b.blocks=a.blocks;return b}};
|
|
1598
1699
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_DRAG,BlockDrag$$module$build$src$core$events$events_block_drag);var module$build$src$core$events$events_block_drag={};module$build$src$core$events$events_block_drag.BlockDrag=BlockDrag$$module$build$src$core$events$events_block_drag;var BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a,b,c,d){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE;this.recordUndo=!1;a&&(this.name=b,this.oldValue=c,this.newValue=d)}toJson(){const a=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");
|
|
@@ -1614,11 +1715,11 @@ a.oldContents=this.oldContents_;a.newContents=this.newContents_;return a}static
|
|
|
1614
1715
|
if(b=b.getCommentById(this.commentId)){var c=a?this.newContents_:this.oldContents_;if(c===void 0){if(a)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");}b.setText(c)}else console.warn("Can't change non-existent comment: "+this.commentId)}};
|
|
1615
1716
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_CHANGE,CommentChange$$module$build$src$core$events$events_comment_change);var module$build$src$core$events$events_comment_change={};module$build$src$core$events$events_comment_change.CommentChange=CommentChange$$module$build$src$core$events$events_comment_change;var CommentCollapse$$module$build$src$core$events$events_comment_collapse=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a,b){super(a);this.newCollapsed=b;this.type=EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE}toJson(){const a=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");a.newCollapsed=this.newCollapsed;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,
|
|
1616
1717
|
b,c!=null?c:new CommentCollapse$$module$build$src$core$events$events_comment_collapse);b.newCollapsed=a.newCollapsed;return b}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(b=b.getCommentById(this.commentId))?b.setCollapsed(a?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};
|
|
1617
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE,CommentCollapse$$module$build$src$core$events$events_comment_collapse);var module$build$src$core$events$events_comment_collapse={};module$build$src$core$events$events_comment_collapse.CommentCollapse=CommentCollapse$$module$build$src$core$events$events_comment_collapse;var CommentCreate$$module$build$src$core$events$events_comment_create=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_CREATE;a&&(this.
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1718
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE,CommentCollapse$$module$build$src$core$events$events_comment_collapse);var module$build$src$core$events$events_comment_collapse={};module$build$src$core$events$events_comment_collapse.CommentCollapse=CommentCollapse$$module$build$src$core$events$events_comment_collapse;var CommentCreate$$module$build$src$core$events$events_comment_create=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_CREATE;a&&(this.json=save$$module$build$src$core$serialization$workspace_comments(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");a.json=this.json;
|
|
1719
|
+
return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentCreate$$module$build$src$core$events$events_comment_create);b.json=a.json;return b}run(a){CommentBase$$module$build$src$core$events$events_comment_base.CommentCreateDeleteHelper(this,a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_CREATE,CommentCreate$$module$build$src$core$events$events_comment_create);
|
|
1720
|
+
var module$build$src$core$events$events_comment_create={};module$build$src$core$events$events_comment_create.CommentCreate=CommentCreate$$module$build$src$core$events$events_comment_create;var CommentDelete$$module$build$src$core$events$events_comment_delete=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_DELETE;a&&(this.json=save$$module$build$src$core$serialization$workspace_comments(a,{addCoordinates:!0}))}run(a){CommentBase$$module$build$src$core$events$events_comment_base.CommentCreateDeleteHelper(this,!a)}toJson(){const a=super.toJson();if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");
|
|
1721
|
+
a.json=this.json;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentDelete$$module$build$src$core$events$events_comment_delete);b.json=a.json;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DELETE,CommentDelete$$module$build$src$core$events$events_comment_delete);var module$build$src$core$events$events_comment_delete={};
|
|
1722
|
+
module$build$src$core$events$events_comment_delete.CommentDelete=CommentDelete$$module$build$src$core$events$events_comment_delete;var CommentDrag$$module$build$src$core$events$events_comment_drag=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.COMMENT_DRAG;a&&(this.commentId=a.id,this.isStart=b)}toJson(){const a=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
|
|
1622
1723
|
a.isStart=this.isStart;a.commentId=this.commentId;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new CommentDrag$$module$build$src$core$events$events_comment_drag);b.isStart=a.isStart;b.commentId=a.commentId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DRAG,CommentDrag$$module$build$src$core$events$events_comment_drag);
|
|
1623
1724
|
var module$build$src$core$events$events_comment_drag={};module$build$src$core$events$events_comment_drag.CommentDrag=CommentDrag$$module$build$src$core$events$events_comment_drag;var CommentMove$$module$build$src$core$events$events_comment_move=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_MOVE;a&&(this.comment_=a,this.oldCoordinate_=a.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");
|
|
1624
1725
|
this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(a){this.reason=a}setOldCoordinate(a){this.oldCoordinate_=a}toJson(){const a=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");a.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`;
|
|
@@ -1670,7 +1771,7 @@ void 0&&a.enabled===!1&&(a.disabledReasons=[MANUALLY_DISABLED$$module$build$src$
|
|
|
1670
1771
|
void 0:(c=b.targetWorkspace)==null?void 0:c.isCapacityAvailable(getBlockTypeCounts$$module$build$src$core$common(a));for(;a;)a.setDisabledReason(!d,WORKSPACE_AT_BLOCK_CAPACITY_DISABLED_REASON$$module$build$src$core$block_flyout_inflater),a=a.getNextBlock()}addBlockListeners(a){const b=[];b.push(conditionalBind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointerdown",a,c=>{let d,e;const f=(d=this.flyout)==null?void 0:(e=d.targetWorkspace)==null?void 0:e.getGesture(c);f&&this.flyout&&(f.setStartBlock(a),
|
|
1671
1772
|
f.handleFlyoutStart(c,this.flyout))}));b.push(bind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointermove",null,()=>{let c,d;((c=this.flyout)==null?0:(d=c.targetWorkspace)==null?0:d.isDragging())||a.addSelect()}));b.push(bind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointerleave",null,()=>{let c,d;((c=this.flyout)==null?0:(d=c.targetWorkspace)==null?0:d.isDragging())||a.removeSelect()}));this.listeners.set(a.id,b)}filterFlyoutBasedOnCapacity(a){!this.flyout||a&&a.type!==EventType$$module$build$src$core$events$type.BLOCK_CREATE&&
|
|
1672
1773
|
a.type!==EventType$$module$build$src$core$events$type.BLOCK_DELETE||this.flyout.getWorkspace().getTopBlocks(!1).forEach(b=>{this.permanentlyDisabledBlocks.has(b)||this.updateStateBasedOnCapacity(b)})}getType(){return BLOCK_TYPE$$module$build$src$core$block_flyout_inflater}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,BLOCK_TYPE$$module$build$src$core$block_flyout_inflater,BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater);
|
|
1673
|
-
var module$build$src$core$block_flyout_inflater={};module$build$src$core$block_flyout_inflater.BlockFlyoutInflater=BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater;var module$build$src$core$interfaces$i_paster={};module$build$src$core$interfaces$i_paster.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;var module$build$src$core$interfaces$i_rendered_element={};module$build$src$core$interfaces$i_rendered_element.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
|
|
1774
|
+
var module$build$src$core$block_flyout_inflater={};module$build$src$core$block_flyout_inflater.BlockFlyoutInflater=BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater;var module$build$src$core$interfaces$i_bounded_element={};module$build$src$core$interfaces$i_bounded_element.isBoundedElement=isBoundedElement$$module$build$src$core$interfaces$i_bounded_element;var module$build$src$core$interfaces$i_paster={};module$build$src$core$interfaces$i_paster.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;var module$build$src$core$interfaces$i_rendered_element={};module$build$src$core$interfaces$i_rendered_element.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
|
|
1674
1775
|
"}"])}},module$build$src$core$renderers$geras$constants={};module$build$src$core$renderers$geras$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$geras$constants;var Highlighter$$module$build$src$core$renderers$geras$highlighter=class{constructor(a){this.inlineSteps_=this.steps_="";this.info_=a;this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_=
|
|
1675
1776
|
this.highlightConstants_.NOTCH;this.startPaths_=this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+"\n"+this.inlineSteps_}drawTopCorner(a){this.steps_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,this.info_.startY);for(let b=0,c;c=a.elements[b];b++)Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(c)?
|
|
1676
1777
|
this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(c)?this.steps_+=this.notchPaths_.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(c)?this.steps_+=this.startPaths_.path(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isSpacer(c)&&c.width!==0&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c.xPos+c.width-this.highlightOffset));this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",
|
|
@@ -1733,7 +1834,7 @@ module$build$src$core$renderers$thrasos$renderer.Renderer=Renderer$$module$build
|
|
|
1733
1834
|
procedure_blocks:{colourPrimary:"#FF6680",colourSecondary:"#FF4D6A",colourTertiary:"#FF3355"},text_blocks:{colourPrimary:"#FFBF00",colourSecondary:"#E6AC00",colourTertiary:"#CC9900"},variable_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},variable_dynamic_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},hat_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC",hat:"cap"}},categoryStyles$$module$build$src$core$theme$zelos=
|
|
1734
1835
|
{colour_category:{colour:"#CF63CF"},list_category:{colour:"#9966FF"},logic_category:{colour:"#4C97FF"},loop_category:{colour:"#0fBD8C"},math_category:{colour:"#59C059"},procedure_category:{colour:"#FF6680"},text_category:{colour:"#FFBF00"},variable_category:{colour:"#FF8C1A"},variable_dynamic_category:{colour:"#FF8C1A"}},Zelos$$module$build$src$core$theme$zelos=new Theme$$module$build$src$core$theme("zelos",defaultBlockStyles$$module$build$src$core$theme$zelos,categoryStyles$$module$build$src$core$theme$zelos),
|
|
1735
1836
|
module$build$src$core$theme$zelos={Zelos:Zelos$$module$build$src$core$theme$zelos};var module$build$src$core$theme$themes={Classic:Classic$$module$build$src$core$theme$classic,Zelos:Zelos$$module$build$src$core$theme$zelos};var ToolboxItem$$module$build$src$core$toolbox$toolbox_item=class{constructor(a,b,c){this.id_=a.toolboxitemid||getNextUniqueId$$module$build$src$core$utils$idgenerator();this.level_=(this.parent_=c||null)?this.parent_.getLevel()+1:0;this.toolboxItemDef_=a;this.parentToolbox_=b;this.workspace_=this.parentToolbox_.getWorkspace()}init(){}getDiv(){return null}getClickTarget(){return null}getId(){return this.id_}getParent(){return null}getLevel(){return this.level_}isSelectable(){return!1}isCollapsible(){return!1}dispose(){}setVisible_(a){}getFocusableElement(){const a=
|
|
1736
|
-
this.getDiv();if(!a)throw Error("Trying to access toolbox item before DOM is initialized.");if(!(a instanceof HTMLElement))throw Error("Toolbox item div is unexpectedly not an HTML element.");return a}getFocusableTree(){return this.parentToolbox_}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}},module$build$src$core$toolbox$toolbox_item={};module$build$src$core$toolbox$toolbox_item.ToolboxItem=ToolboxItem$$module$build$src$core$toolbox$toolbox_item;var ToolboxCategory$$module$build$src$core$toolbox$category=class extends ToolboxItem$$module$build$src$core$toolbox$toolbox_item{constructor(a,b,c){super(a,b,c);this.colour_=this.name_="";this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null;this.isDisabled_=this.isHidden_=!1;this.flyoutItems_=[];this.cssConfig_=this.makeDefaultCssConfig_()}init(){this.parseCategoryDef_(this.toolboxItemDef_);this.parseContents_(this.toolboxItemDef_);this.createDom_();this.toolboxItemDef_.hidden===
|
|
1837
|
+
this.getDiv();if(!a)throw Error("Trying to access toolbox item before DOM is initialized.");if(!(a instanceof HTMLElement))throw Error("Toolbox item div is unexpectedly not an HTML element.");return a}getFocusableTree(){return this.parentToolbox_}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getParentToolbox(){return this.parentToolbox_}},module$build$src$core$toolbox$toolbox_item={};module$build$src$core$toolbox$toolbox_item.ToolboxItem=ToolboxItem$$module$build$src$core$toolbox$toolbox_item;var ToolboxCategory$$module$build$src$core$toolbox$category=class extends ToolboxItem$$module$build$src$core$toolbox$toolbox_item{constructor(a,b,c){super(a,b,c);this.colour_=this.name_="";this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null;this.isDisabled_=this.isHidden_=!1;this.flyoutItems_=[];this.cssConfig_=this.makeDefaultCssConfig_()}init(){this.parseCategoryDef_(this.toolboxItemDef_);this.parseContents_(this.toolboxItemDef_);this.createDom_();this.toolboxItemDef_.hidden===
|
|
1737
1838
|
"true"&&this.hide()}makeDefaultCssConfig_(){return{container:"blocklyToolboxCategoryContainer",row:"blocklyToolboxCategory",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyToolboxCategoryIcon",label:"blocklyToolboxCategoryLabel",contents:"blocklyToolboxCategoryGroup",selected:"blocklyToolboxSelected",openicon:"blocklyToolboxCategoryIconOpen",closedicon:"blocklyToolboxCategoryIconClosed"}}parseContents_(a){if("custom"in a)this.flyoutItems_=a.custom;else if(a=a.contents)for(let b=
|
|
1738
1839
|
0;b<a.length;b++){const c=a[b];Array.isArray(this.flyoutItems_)&&this.flyoutItems_.push(c)}}parseCategoryDef_(a){this.name_="name"in a?replaceMessageReferences$$module$build$src$core$utils$parsing(a.name):"";this.colour_=this.getColour_(a);Object.assign(this.cssConfig_,a.cssconfig||a.cssConfig)}createDom_(){this.htmlDiv_=this.createContainer_();setRole$$module$build$src$core$utils$aria(this.htmlDiv_,Role$$module$build$src$core$utils$aria.TREEITEM);setState$$module$build$src$core$utils$aria(this.htmlDiv_,
|
|
1739
1840
|
State$$module$build$src$core$utils$aria.SELECTED,!1);setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.LEVEL,this.level_+1);this.rowDiv_=this.createRowContainer_();this.rowDiv_.style.pointerEvents="auto";this.htmlDiv_.appendChild(this.rowDiv_);this.rowContents_=this.createRowContentsContainer_();this.rowContents_.style.pointerEvents="none";this.rowDiv_.appendChild(this.rowContents_);this.iconDom_=this.createIconDom_();setRole$$module$build$src$core$utils$aria(this.iconDom_,
|
|
@@ -1744,11 +1845,11 @@ b);return a}createIconDom_(){const a=document.createElement("span");if(!this.par
|
|
|
1744
1845
|
b.colour)return this.parseColour(b.colour);console.warn('Style "'+a+'" must exist and contain a colour value')}return""}getClickTarget(){return this.rowDiv_}parseColour(a){a=replaceMessageReferences$$module$build$src$core$utils$parsing(a);if(a==null||a==="")return"";var b=Number(a);if(isNaN(b)){if(b=parse$$module$build$src$core$utils$colour(a))return b;console.warn('Toolbox category "'+this.name_+'" has unrecognized colour attribute: '+a);return""}return hueToHex$$module$build$src$core$utils$colour(b)}openIcon_(a){if(a){var b=
|
|
1745
1846
|
this.cssConfig_.closedicon;b&&removeClasses$$module$build$src$core$utils$dom(a,b);(b=this.cssConfig_.openicon)&&addClass$$module$build$src$core$utils$dom(a,b)}}closeIcon_(a){if(a){var b=this.cssConfig_.openicon;b&&removeClasses$$module$build$src$core$utils$dom(a,b);(b=this.cssConfig_.closedicon)&&addClass$$module$build$src$core$utils$dom(a,b)}}setVisible_(a){this.htmlDiv_.style.display=a?"block":"none";this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}hide(){this.setVisible_(!1)}show(){this.setVisible_(!0)}isVisible(){return!this.isHidden_&&
|
|
1746
1847
|
this.allAncestorsExpanded_()}allAncestorsExpanded_(){let a=this;for(;a.getParent();)if(a=a.getParent(),!a.isExpanded())return!1;return!0}isSelectable(){return this.isVisible()&&!this.isDisabled_}onClick(a){}setSelected(a){if(this.rowDiv_){var b=this.cssConfig_.selected;if(a){const c=this.parseColour(ToolboxCategory$$module$build$src$core$toolbox$category.defaultBackgroundColour);this.rowDiv_.style.backgroundColor=this.colour_||c;b&&addClass$$module$build$src$core$utils$dom(this.rowDiv_,b)}else this.rowDiv_.style.backgroundColor=
|
|
1747
|
-
"",b&&removeClass$$module$build$src$core$utils$dom(this.rowDiv_,b);setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.SELECTED,a)}}setDisabled(a){this.isDisabled_=a;this.getDiv().setAttribute("disabled",`${a}`);a?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")}getName(){return this.name_}getParent(){return this.parent_}getDiv(){return this.htmlDiv_}
|
|
1748
|
-
[];this.toolboxItemDef_=typeof a==="string"?{kind:this.toolboxItemDef_.kind,custom:a,id:this.toolboxItemDef_.id,categorystyle:this.toolboxItemDef_.categorystyle,colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden}:{kind:this.toolboxItemDef_.kind,name:"name"in this.toolboxItemDef_?this.toolboxItemDef_.name:"",contents:convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a),
|
|
1749
|
-
colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden};this.parseContents_(this.toolboxItemDef_)}dispose(){removeNode$$module$build$src$core$utils$dom(this.htmlDiv_)}};ToolboxCategory$$module$build$src$core$toolbox$category.registrationName="category";ToolboxCategory$$module$build$src$core$toolbox$category.nestedPadding=19;
|
|
1750
|
-
ToolboxCategory$$module$build$src$core$toolbox$category.defaultBackgroundColour="#57e";register$$module$build$src$core$css('\n.blocklyToolboxCategory:not(.blocklyToolboxSelected):hover {\n background-color: rgba(255, 255, 255, .2);\n}\n\n.blocklyToolbox[layout="h"] .blocklyToolboxCategoryContainer {\n margin: 1px 5px 1px 0;\n}\n\n.blocklyToolbox[dir="RTL"][layout="h"] .blocklyToolboxCategoryContainer {\n margin: 1px 0 1px 5px;\n}\n\n.blocklyToolboxCategory {\n height: 22px;\n line-height: 22px;\n margin-bottom: 3px;\n padding-right: 8px;\n white-space: nowrap;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxCategory {\n margin-left: 8px;\n padding-right: 0;\n}\n\n.blocklyToolboxCategoryIcon {\n background-image: url(<<<PATH>>>/sprites.
|
|
1751
|
-
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,ToolboxCategory$$module$build$src$core$toolbox$category.registrationName,ToolboxCategory$$module$build$src$core$toolbox$category);var module$build$src$core$toolbox$category={};module$build$src$core$toolbox$category.ToolboxCategory=ToolboxCategory$$module$build$src$core$toolbox$category;var ToolboxSeparator$$module$build$src$core$toolbox$separator=class extends ToolboxItem$$module$build$src$core$toolbox$toolbox_item{constructor(a,b){super(a,b);this.cssConfig_={container:"blocklyTreeSeparator"};this.htmlDiv=null;Object.assign(this.cssConfig_,a.cssconfig||a.cssConfig)}init(){this.createDom_()}createDom_(){const a=document.createElement("div");a.tabIndex=-1;a.id=this.getId();const b=this.cssConfig_.container;b&&addClass$$module$build$src$core$utils$dom(a,b);return this.htmlDiv=a}getDiv(){return this.htmlDiv}dispose(){removeNode$$module$build$src$core$utils$dom(this.htmlDiv)}};
|
|
1848
|
+
"",b&&removeClass$$module$build$src$core$utils$dom(this.rowDiv_,b);setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.SELECTED,a)}}setDisabled(a){this.isDisabled_=a;this.getDiv().setAttribute("disabled",`${a}`);a?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")}getName(){return this.name_}getParent(){return this.parent_}getDiv(){return this.htmlDiv_}onNodeFocus(){this.getParentToolbox().getSelectedItem()!==this&&
|
|
1849
|
+
this.getParentToolbox().setSelectedItem(this)}getContents(){return this.flyoutItems_}updateFlyoutContents(a){this.flyoutItems_=[];this.toolboxItemDef_=typeof a==="string"?{kind:this.toolboxItemDef_.kind,custom:a,id:this.toolboxItemDef_.id,categorystyle:this.toolboxItemDef_.categorystyle,colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden}:{kind:this.toolboxItemDef_.kind,name:"name"in this.toolboxItemDef_?this.toolboxItemDef_.name:"",contents:convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a),
|
|
1850
|
+
id:this.toolboxItemDef_.id,categorystyle:this.toolboxItemDef_.categorystyle,colour:this.toolboxItemDef_.colour,cssconfig:this.toolboxItemDef_.cssconfig,hidden:this.toolboxItemDef_.hidden};this.parseContents_(this.toolboxItemDef_)}dispose(){removeNode$$module$build$src$core$utils$dom(this.htmlDiv_)}};ToolboxCategory$$module$build$src$core$toolbox$category.registrationName="category";ToolboxCategory$$module$build$src$core$toolbox$category.nestedPadding=19;
|
|
1851
|
+
ToolboxCategory$$module$build$src$core$toolbox$category.borderWidth=8;ToolboxCategory$$module$build$src$core$toolbox$category.defaultBackgroundColour="#57e";register$$module$build$src$core$css('\n.blocklyToolboxCategory:not(.blocklyToolboxSelected):hover {\n background-color: rgba(255, 255, 255, .2);\n}\n\n.blocklyToolbox[layout="h"] .blocklyToolboxCategoryContainer {\n margin: 1px 5px 1px 0;\n}\n\n.blocklyToolbox[dir="RTL"][layout="h"] .blocklyToolboxCategoryContainer {\n margin: 1px 0 1px 5px;\n}\n\n.blocklyToolboxCategory {\n height: 22px;\n line-height: 22px;\n margin-bottom: 3px;\n padding-right: 8px;\n white-space: nowrap;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxCategory {\n margin-left: 8px;\n padding-right: 0;\n}\n\n.blocklyToolboxCategoryIcon {\n background-image: url(<<<PATH>>>/sprites.svg);\n height: 16px;\n vertical-align: middle;\n visibility: hidden;\n width: 16px;\n}\n\n.blocklyToolboxCategoryIconClosed {\n background-position: -32px -1px;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxCategoryIconClosed {\n background-position: 0 -1px;\n}\n\n.blocklyToolboxSelected>.blocklyToolboxCategoryIconClosed {\n background-position: -32px -17px;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxSelected>.blocklyToolboxCategoryIconClosed {\n background-position: 0 -17px;\n}\n\n.blocklyToolboxCategoryIconOpen {\n background-position: -16px -1px;\n}\n\n.blocklyToolboxSelected>.blocklyToolboxCategoryIconOpen {\n background-position: -16px -17px;\n}\n\n.blocklyToolboxCategoryLabel {\n cursor: default;\n font: 16px sans-serif;\n padding: 0 3px;\n vertical-align: middle;\n}\n\n.blocklyToolboxDelete .blocklyToolboxCategoryLabel {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxSelected .blocklyToolboxCategoryLabel {\n color: #fff;\n}\n');
|
|
1852
|
+
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,ToolboxCategory$$module$build$src$core$toolbox$category.registrationName,ToolboxCategory$$module$build$src$core$toolbox$category);var module$build$src$core$toolbox$category={};module$build$src$core$toolbox$category.ToolboxCategory=ToolboxCategory$$module$build$src$core$toolbox$category;var ToolboxSeparator$$module$build$src$core$toolbox$separator=class extends ToolboxItem$$module$build$src$core$toolbox$toolbox_item{constructor(a,b){super(a,b);this.cssConfig_={container:"blocklyTreeSeparator"};this.htmlDiv=null;Object.assign(this.cssConfig_,a.cssconfig||a.cssConfig)}init(){this.createDom_()}createDom_(){const a=document.createElement("div");a.tabIndex=-1;a.id=this.getId();const b=this.cssConfig_.container;b&&addClass$$module$build$src$core$utils$dom(a,b);return this.htmlDiv=a}getDiv(){return this.htmlDiv}dispose(){removeNode$$module$build$src$core$utils$dom(this.htmlDiv)}canBeFocused(){return!1}};
|
|
1752
1853
|
ToolboxSeparator$$module$build$src$core$toolbox$separator.registrationName="sep";register$$module$build$src$core$css('\n.blocklyTreeSeparator {\n border-bottom: solid #e5e5e5 1px;\n height: 0;\n margin: 5px 0;\n}\n\n.blocklyToolbox[layout="h"] .blocklyTreeSeparator {\n border-right: solid #e5e5e5 1px;\n border-bottom: none;\n height: auto;\n margin: 0 5px 0 5px;\n padding: 5px 0;\n width: 0;\n}\n');
|
|
1753
1854
|
register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,ToolboxSeparator$$module$build$src$core$toolbox$separator.registrationName,ToolboxSeparator$$module$build$src$core$toolbox$separator);var module$build$src$core$toolbox$separator={};module$build$src$core$toolbox$separator.ToolboxSeparator=ToolboxSeparator$$module$build$src$core$toolbox$separator;var CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category=class extends ToolboxCategory$$module$build$src$core$toolbox$category{constructor(a,b,c){super(a,b,c);this.subcategoriesDiv_=null;this.expanded_=!1;this.toolboxItems_=[]}makeDefaultCssConfig_(){const a=super.makeDefaultCssConfig_();a.contents="blocklyToolboxCategoryGroup";return a}parseContents_(a){if("custom"in a)this.flyoutItems_=a.custom;else{const b=a.contents;if(b){this.flyoutItems_=[];a=!0;for(let c=0;c<b.length;c++){const d=
|
|
1754
1855
|
b[c];!hasItem$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,d.kind)||d.kind.toLowerCase()===ToolboxSeparator$$module$build$src$core$toolbox$separator.registrationName&&a?(this.flyoutItems_.push(d),a=!0):(this.createToolboxItem(d),a=!1)}}}}createToolboxItem(a){let b=a.kind;b.toUpperCase()==="CATEGORY"&&isCategoryCollapsible$$module$build$src$core$utils$toolbox(a)&&(b=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName);
|
|
@@ -1757,66 +1858,68 @@ this.htmlDiv_.appendChild(this.subcategoriesDiv_);this.closeIcon_(this.iconDom_)
|
|
|
1757
1858
|
b.style.display="none";var c=this.cssConfig_.contents;c&&addClass$$module$build$src$core$utils$dom(b,c);for(c=0;c<a.length;c++){const d=a[c];d.init();const e=d.getDiv();b.appendChild(e);if(d.getClickTarget){let f;(f=d.getClickTarget())==null||f.setAttribute("id",d.getId())}}return b}setExpanded(a){if(this.expanded_!==a){if(this.expanded_=a)this.subcategoriesDiv_.style.display="block",this.openIcon_(this.iconDom_);else{let b;(b=this.parentToolbox_.getFlyout())==null||b.setVisible(!1);this.subcategoriesDiv_.style.display=
|
|
1758
1859
|
"none";this.closeIcon_(this.iconDom_)}setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.EXPANDED,a);this.parentToolbox_.handleToolboxItemResize()}}setVisible_(a){this.htmlDiv_.style.display=a?"block":"none";const b=this.getChildToolboxItems();for(let c=0;c<b.length;c++)b[c].setVisible_(a);this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}isExpanded(){return this.expanded_}isCollapsible(){return!0}onClick(a){this.toggleExpanded()}toggleExpanded(){this.setExpanded(!this.expanded_)}getDiv(){return this.htmlDiv_}getChildToolboxItems(){return this.toolboxItems_}};
|
|
1759
1860
|
CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName="collapsibleCategory";register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category);var module$build$src$core$toolbox$collapsible_category={};
|
|
1760
|
-
module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;var
|
|
1761
|
-
this.toolboxPosition=a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_;const b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);const c=this.flyout.createDom("svg");addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");insertAfter$$module$build$src$core$utils$dom(c,b);this.setVisible(!0);this.flyout.init(a);
|
|
1762
|
-
"background-color");a.subscribe(this.HtmlDiv,"toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,
|
|
1763
|
-
|
|
1764
|
-
document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){const a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,
|
|
1765
|
-
|
|
1766
|
-
b==null?0:b.isSelectable())&&(this.setSelectedItem(b),b.onClick(a));getMainWorkspace$$module$build$src$core$common().hideChaff(!0)}clearTouchIdentifier$$module$build$src$core$touch()}onKeyDown_(a){let b=!1;switch(a.key){case "
|
|
1767
|
-
b
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
a)}
|
|
1771
|
-
|
|
1861
|
+
module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;var Toolbox$$module$build$src$core$toolbox$toolbox=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.id="toolbox";this.contentsDiv_=this.HtmlDiv=null;this.isVisible_=!1;this.height_=this.width_=0;this.flyout=null;this.contents=new Map;this.previouslySelectedItem_=this.selectedItem_=null;this.boundEvents_=[];this.mouseDown=!1;this.navigator=new ToolboxNavigator$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator(this);this.workspace_=a;this.toolboxDef_=
|
|
1862
|
+
a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;this.toolboxPosition=a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_;const b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);const c=this.flyout.createDom("svg");addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");insertAfter$$module$build$src$core$utils$dom(c,b);this.setVisible(!0);this.flyout.init(a);
|
|
1863
|
+
this.render(this.toolboxDef_);a=a.getThemeManager();a.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");a.subscribe(this.HtmlDiv,"toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,
|
|
1864
|
+
ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]});$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!0)}createDom_(a){a=a.getParentSvg();const b=this.createContainer_();b.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contentsDiv_=this.createContentsContainer_();setRole$$module$build$src$core$utils$aria(this.contentsDiv_,Role$$module$build$src$core$utils$aria.TREE);b.appendChild(this.contentsDiv_);let c;(c=a.parentNode)==
|
|
1865
|
+
null||c.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){const a=document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){const a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,
|
|
1866
|
+
b){const c=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onClick_,!1);this.boundEvents_.push(c);a=bind$$module$build$src$core$browser_events(a,"pointerup",this,()=>{this.mouseDown=!1});this.boundEvents_.push(a);b=conditionalBind$$module$build$src$core$browser_events(b,"keydown",this,this.onKeyDown_,!1);this.boundEvents_.push(b)}onClick_(a){this.mouseDown=!0;if(isRightButton$$module$build$src$core$browser_events(a)||a.target===this.HtmlDiv)getMainWorkspace$$module$build$src$core$common().hideChaff(!1);
|
|
1867
|
+
else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b),b==null?0:b.isSelectable())&&(this.setSelectedItem(b),b.onClick(a));getMainWorkspace$$module$build$src$core$common().hideChaff(!0)}clearTouchIdentifier$$module$build$src$core$touch()}onKeyDown_(a){let b=!1;switch(a.key){case "ArrowLeft":b=this.toggleSelectedItem(!1);break;case "ArrowRight":b=this.toggleSelectedItem(!0)}b&&(a.preventDefault(),a.stopPropagation())}createFlyout_(){const a=this.workspace_,b=a.copyOptionsForFlyout();
|
|
1868
|
+
b.toolboxPosition=a.options.toolboxPosition;return new (a.horizontalLayout?getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,a.options,!0):getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,a.options,!0))(b)}render(a){this.toolboxDef_=a;this.contents.forEach(b=>b.dispose());this.contents.clear();this.renderContents_(a.contents);this.position();this.handleToolboxItemResize()}renderContents_(a){const b=
|
|
1869
|
+
document.createDocumentFragment();for(let d=0;d<a.length;d++)this.createToolboxItem(a[d],b);let c;(c=this.contentsDiv_)==null||c.appendChild(b)}createToolboxItem(a,b){var c=a.kind;c.toUpperCase()==="CATEGORY"&&isCategoryCollapsible$$module$build$src$core$utils$toolbox(a)&&(c=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName);if(c=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,c.toLowerCase())){a=new c(a,this);
|
|
1870
|
+
a.init();this.addToolboxItem_(a);(c=a.getDiv())&&b.appendChild(c);let d;(d=a.getClickTarget())==null||d.setAttribute("id",a.getId())}}addToolboxItem_(a){this.contents.set(a.getId(),a);if(a.isCollapsible()){a=a.getChildToolboxItems();for(let b=0;b<a.length;b++)this.addToolboxItem_(a[b])}}getToolboxItems(){return[...this.contents.values()]}addStyle(a){a&&this.HtmlDiv&&addClass$$module$build$src$core$utils$dom(this.HtmlDiv,a)}removeStyle(a){a&&this.HtmlDiv&&removeClass$$module$build$src$core$utils$dom(this.HtmlDiv,
|
|
1871
|
+
a)}getClientRect(){if(!this.HtmlDiv||!this.isVisible_)return null;var a=this.HtmlDiv.getBoundingClientRect();const b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?new Rect$$module$build$src$core$utils$rect(-1E7,c,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.BOTTOM?new Rect$$module$build$src$core$utils$rect(b,1E7,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.LEFT?
|
|
1872
|
+
new Rect$$module$build$src$core$utils$rect(-1E7,1E7,-1E7,a):new Rect$$module$build$src$core$utils$rect(-1E7,1E7,d,1E7)}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?this.updateWouldDelete_(!a.getParent()&&a.isDeletable()):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}onDragEnter(a){this.updateCursorDeleteStyle_(!0)}onDragExit(a){this.updateCursorDeleteStyle_(!1)}onDrop(a){this.updateCursorDeleteStyle_(!1)}updateWouldDelete_(a){a!==
|
|
1772
1873
|
this.wouldDelete_&&(this.updateCursorDeleteStyle_(!1),this.wouldDelete_=a,this.updateCursorDeleteStyle_(!0))}updateCursorDeleteStyle_(a){const b=this.wouldDelete_?"blocklyToolboxDelete":"blocklyToolboxGrab";a?this.addStyle(b):this.removeStyle(b)}getToolboxItemById(a){return this.contents.get(a)||null}getWidth(){return this.width_}getHeight(){return this.height_}getFlyout(){return this.flyout}getWorkspace(){return this.workspace_}getSelectedItem(){return this.selectedItem_}getPreviouslySelectedItem(){return this.previouslySelectedItem_}isHorizontal(){return this.horizontalLayout}position(){const a=
|
|
1773
1874
|
this.workspace_.getMetrics(),b=this.HtmlDiv;if(b){this.horizontalLayout?(b.style.left="0",b.style.height="auto",b.style.width="100%",this.height_=b.offsetHeight,this.width_=a.viewWidth,this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?b.style.top="0":b.style.bottom="0"):(this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT?b.style.right="0":b.style.left="0",b.style.height="100%",this.width_=b.offsetWidth,this.height_=a.viewHeight);var c;(c=this.flyout)==
|
|
1774
1875
|
null||c.position()}}handleToolboxItemResize(){if(this.HtmlDiv){var a=this.workspace_,b=this.HtmlDiv.getBoundingClientRect(),c=this.getFlyout(),d=this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.LEFT?a.scrollX+b.width+((c==null?0:c.isVisible())?c.getWidth():0):a.scrollX;b=this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?a.scrollY+b.height+((c==null?0:c.isVisible())?c.getHeight():0):a.scrollY;a.translate(d,b);svgResize$$module$build$src$core$common(a)}}clearSelection(){this.setSelectedItem(null)}refreshTheme(){this.contents.forEach(a=>
|
|
1775
1876
|
{a.refreshTheme&&a.refreshTheme()})}refreshSelection(){if(this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length){let a;(a=this.flyout)==null||a.show(this.selectedItem_.getContents())}}setVisible(a){this.isVisible_!==a&&(this.HtmlDiv&&(this.HtmlDiv.style.display=a?"block":"none"),this.isVisible_=a,this.workspace_.recordDragTargets())}autoHide(a){!a&&this.flyout&&this.flyout.autoClose&&this.clearSelection()}setSelectedItem(a){const b=this.selectedItem_;!a&&!b||
|
|
1776
1877
|
a&&!isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)||(this.shouldDeselectItem_(b,a)&&b!==null&&this.deselectItem_(b),this.shouldSelectItem_(b,a)&&a!==null&&this.selectItem_(b,a),this.updateFlyout_(b,a),this.fireSelectEvent(b,a))}shouldDeselectItem_(a,b){return a!==null&&(!a.isCollapsible()||a!==b)}shouldSelectItem_(a,b){return b!==null&&b!==a}deselectItem_(a){this.selectedItem_=null;this.previouslySelectedItem_=a;a.setSelected(!1);setState$$module$build$src$core$utils$aria(this.contentsDiv_,
|
|
1777
1878
|
State$$module$build$src$core$utils$aria.ACTIVEDESCENDANT,"")}selectItem_(a,b){this.selectedItem_=b;this.previouslySelectedItem_=a;b.setSelected(!0);setState$$module$build$src$core$utils$aria(this.contentsDiv_,State$$module$build$src$core$utils$aria.ACTIVEDESCENDANT,b.getId())}selectItemByPosition(a){(a=this.getToolboxItems()[a])&&this.setSelectedItem(a)}updateFlyout_(a,b){if(b&&(a!==b||b.isCollapsible())&&b.getContents().length){let c;(c=this.flyout)==null||c.show(b.getContents());let d;(d=this.flyout)==
|
|
1778
|
-
null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEvent(a,b){const c=a&&a.getName();let d=b&&b.getName();a===b&&(d=null);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT))(c,d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
this.
|
|
1782
|
-
|
|
1783
|
-
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="12.5.1",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,
|
|
1879
|
+
null||d.scrollToStart()}else{let c;(c=this.flyout)==null||c.hide()}}fireSelectEvent(a,b){const c=a&&a.getName();let d=b&&b.getName();a===b&&(d=null);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT))(c,d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}toggleSelectedItem(a){let b,c;return isCollapsibleToolboxItem$$module$build$src$core$interfaces$i_collapsible_toolbox_item(this.selectedItem_)&&((b=this.selectedItem_)==null?
|
|
1880
|
+
0: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),
|
|
1881
|
+
removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));$.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,
|
|
1882
|
+
b){a!==this?this.getSelectedItem()===a||this.mouseDown||this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){let 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');
|
|
1883
|
+
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.0",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,
|
|
1784
1884
|
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=
|
|
1785
1885
|
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,
|
|
1786
1886
|
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,
|
|
1787
1887
|
VARIABLE_DYNAMIC_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables_dynamic,PROCEDURE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$procedures;Workspace$$module$build$src$core$workspace.prototype.newBlock=function(a,b){return new Block$$module$build$src$core$block(this,a,b)};WorkspaceSvg$$module$build$src$core$workspace_svg.prototype.newBlock=function(a,b){return new BlockSvg$$module$build$src$core$block_svg(this,a,b)};
|
|
1788
1888
|
Workspace$$module$build$src$core$workspace.prototype.newComment=function(a){return new WorkspaceComment$$module$build$src$core$comments$workspace_comment(this,a)};WorkspaceSvg$$module$build$src$core$workspace_svg.prototype.newComment=function(a){return new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(this,a)};WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan=function(a){return new Trashcan$$module$build$src$core$trashcan(a)};
|
|
1789
1889
|
MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.prototype.newWorkspaceSvg=function(a){return new WorkspaceSvg$$module$build$src$core$workspace_svg(a)};$.Names$$module$build$src$core$names.prototype.populateProcedures=function(a){a=allProcedures$$module$build$src$core$procedures(a);a=a[0].concat(a[1]);for(let b=0;b<a.length;b++)this.getName(a[b][0],$.Names$$module$build$src$core$names.NameType.PROCEDURE)};
|
|
1790
|
-
var DropDownDiv$$module$build$src$core$blockly=module$build$src$core$dropdowndiv,module$build$src$core$blockly={};module$build$src$core$blockly.Block=Block$$module$build$src$core$block;module$build$src$core$blockly.
|
|
1791
|
-
module$build$src$core$blockly.
|
|
1792
|
-
module$build$src$core$blockly.
|
|
1793
|
-
module$build$src$core$blockly.
|
|
1794
|
-
module$build$src$core$blockly.
|
|
1795
|
-
module$build$src$core$blockly.
|
|
1796
|
-
module$build$src$core$blockly.
|
|
1797
|
-
module$build$src$core$blockly.
|
|
1798
|
-
module$build$src$core$blockly.
|
|
1799
|
-
module$build$src$core$blockly.
|
|
1800
|
-
module$build$src$core$blockly.
|
|
1801
|
-
module$build$src$core$blockly.
|
|
1802
|
-
module$build$src$core$blockly.
|
|
1803
|
-
module$build$src$core$blockly.
|
|
1804
|
-
module$build$src$core$blockly.
|
|
1805
|
-
module$build$src$core$blockly.
|
|
1806
|
-
module$build$src$core$blockly.
|
|
1807
|
-
module$build$src$core$blockly.
|
|
1808
|
-
module$build$src$core$blockly.
|
|
1809
|
-
module$build$src$core$blockly.
|
|
1810
|
-
module$build$src$core$blockly.
|
|
1811
|
-
module$build$src$core$blockly.
|
|
1812
|
-
module$build$src$core$blockly.
|
|
1813
|
-
module$build$src$core$blockly.
|
|
1814
|
-
module$build$src$core$blockly.
|
|
1815
|
-
module$build$src$core$blockly.
|
|
1816
|
-
module$build$src$core$blockly.
|
|
1817
|
-
module$build$src$core$blockly.
|
|
1818
|
-
module$build$src$core$blockly.
|
|
1819
|
-
module$build$src$core$blockly.
|
|
1890
|
+
var DropDownDiv$$module$build$src$core$blockly=module$build$src$core$dropdowndiv,module$build$src$core$blockly={};module$build$src$core$blockly.Block=Block$$module$build$src$core$block;module$build$src$core$blockly.BlockCommentNavigationPolicy=BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_comment_navigation_policy;module$build$src$core$blockly.BlockFlyoutInflater=BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater;
|
|
1891
|
+
module$build$src$core$blockly.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy;module$build$src$core$blockly.BlockSvg=BlockSvg$$module$build$src$core$block_svg;module$build$src$core$blockly.Blocks=Blocks$$module$build$src$core$blocks;module$build$src$core$blockly.ButtonFlyoutInflater=ButtonFlyoutInflater$$module$build$src$core$button_flyout_inflater;module$build$src$core$blockly.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;
|
|
1892
|
+
module$build$src$core$blockly.COLLAPSED_INPUT_NAME=COLLAPSED_INPUT_NAME$$module$build$src$core$constants;module$build$src$core$blockly.COLLAPSE_CHARS=COLLAPSE_CHARS$$module$build$src$core$internal_constants;module$build$src$core$blockly.CodeGenerator=$.CodeGenerator$$module$build$src$core$generator;module$build$src$core$blockly.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;module$build$src$core$blockly.CommentBarButtonNavigationPolicy=CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_bar_button_navigation_policy;
|
|
1893
|
+
module$build$src$core$blockly.CommentEditorNavigationPolicy=CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$comment_editor_navigation_policy;module$build$src$core$blockly.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$blockly.Connection=Connection$$module$build$src$core$connection;module$build$src$core$blockly.ConnectionChecker=ConnectionChecker$$module$build$src$core$connection_checker;
|
|
1894
|
+
module$build$src$core$blockly.ConnectionDB=ConnectionDB$$module$build$src$core$connection_db;module$build$src$core$blockly.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$connection_navigation_policy;module$build$src$core$blockly.ConnectionType=ConnectionType$$module$build$src$core$connection_type;module$build$src$core$blockly.ContextMenu=module$build$src$core$contextmenu;module$build$src$core$blockly.ContextMenuItems=module$build$src$core$contextmenu_items;
|
|
1895
|
+
module$build$src$core$blockly.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$blockly.Css=module$build$src$core$css;module$build$src$core$blockly.DELETE_VARIABLE_ID=DELETE_VARIABLE_ID$$module$build$src$core$internal_constants;module$build$src$core$blockly.DeleteArea=DeleteArea$$module$build$src$core$delete_area;module$build$src$core$blockly.Direction=Direction$$module$build$src$core$keyboard_nav$keyboard_mover;
|
|
1896
|
+
module$build$src$core$blockly.DragDisposition=DragDisposition$$module$build$src$core$interfaces$i_draggable;module$build$src$core$blockly.DragTarget=DragTarget$$module$build$src$core$drag_target;module$build$src$core$blockly.DropDownDiv=module$build$src$core$dropdowndiv;module$build$src$core$blockly.Events=module$build$src$core$events$events;module$build$src$core$blockly.Extensions=module$build$src$core$extensions;module$build$src$core$blockly.Field=Field$$module$build$src$core$field;
|
|
1897
|
+
module$build$src$core$blockly.FieldCheckbox=FieldCheckbox$$module$build$src$core$field_checkbox;module$build$src$core$blockly.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;module$build$src$core$blockly.FieldImage=FieldImage$$module$build$src$core$field_image;module$build$src$core$blockly.FieldLabel=FieldLabel$$module$build$src$core$field_label;module$build$src$core$blockly.FieldLabelSerializable=FieldLabelSerializable$$module$build$src$core$field_label_serializable;
|
|
1898
|
+
module$build$src$core$blockly.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$field_navigation_policy;module$build$src$core$blockly.FieldNumber=FieldNumber$$module$build$src$core$field_number;module$build$src$core$blockly.FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput;module$build$src$core$blockly.FieldVariable=FieldVariable$$module$build$src$core$field_variable;module$build$src$core$blockly.Flyout=Flyout$$module$build$src$core$flyout_base;
|
|
1899
|
+
module$build$src$core$blockly.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;module$build$src$core$blockly.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_button_navigation_policy;module$build$src$core$blockly.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;module$build$src$core$blockly.FlyoutMetricsManager=FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager;
|
|
1900
|
+
module$build$src$core$blockly.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$keyboard_nav$navigators$flyout_navigator;module$build$src$core$blockly.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;module$build$src$core$blockly.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$flyout_separator_navigation_policy;module$build$src$core$blockly.FocusManager=FocusManager$$module$build$src$core$focus_manager;
|
|
1901
|
+
module$build$src$core$blockly.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;module$build$src$core$blockly.Generator=$.CodeGenerator$$module$build$src$core$generator;module$build$src$core$blockly.Gesture=Gesture$$module$build$src$core$gesture;module$build$src$core$blockly.Grid=Grid$$module$build$src$core$grid;module$build$src$core$blockly.HorizontalFlyout=HorizontalFlyout$$module$build$src$core$flyout_horizontal;
|
|
1902
|
+
module$build$src$core$blockly.INPUT_VALUE=INPUT_VALUE$$module$build$src$core$blockly;module$build$src$core$blockly.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$icon_navigation_policy;module$build$src$core$blockly.Input=Input$$module$build$src$core$inputs$input;module$build$src$core$blockly.InsertionMarkerPreviewer=InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer;module$build$src$core$blockly.KeyboardMover=KeyboardMover$$module$build$src$core$keyboard_nav$keyboard_mover;
|
|
1903
|
+
module$build$src$core$blockly.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$blockly.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;module$build$src$core$blockly.Menu=Menu$$module$build$src$core$menu;module$build$src$core$blockly.MenuItem=MenuItem$$module$build$src$core$menuitem;module$build$src$core$blockly.MetricsManager=MetricsManager$$module$build$src$core$metrics_manager;
|
|
1904
|
+
module$build$src$core$blockly.MoveIndicator=MoveIndicator$$module$build$src$core$keyboard_nav$move_indicator;module$build$src$core$blockly.Msg=$.Msg$$module$build$src$core$msg;module$build$src$core$blockly.NEXT_STATEMENT=NEXT_STATEMENT$$module$build$src$core$blockly;module$build$src$core$blockly.Names=$.Names$$module$build$src$core$names;module$build$src$core$blockly.NavigationDirection=NavigationDirection$$module$build$src$core$keyboard_nav$navigators$navigator;
|
|
1905
|
+
module$build$src$core$blockly.Navigator=Navigator$$module$build$src$core$keyboard_nav$navigators$navigator;module$build$src$core$blockly.OPPOSITE_TYPE=OPPOSITE_TYPE$$module$build$src$core$internal_constants;module$build$src$core$blockly.OUTPUT_VALUE=OUTPUT_VALUE$$module$build$src$core$blockly;module$build$src$core$blockly.Options=Options$$module$build$src$core$options;module$build$src$core$blockly.PREVIOUS_STATEMENT=PREVIOUS_STATEMENT$$module$build$src$core$blockly;
|
|
1906
|
+
module$build$src$core$blockly.PROCEDURE_CATEGORY_NAME=CATEGORY_NAME$$module$build$src$core$procedures;module$build$src$core$blockly.Procedures=module$build$src$core$procedures;module$build$src$core$blockly.RENAME_VARIABLE_ID=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants;module$build$src$core$blockly.RenderedConnection=RenderedConnection$$module$build$src$core$rendered_connection;module$build$src$core$blockly.Scrollbar=Scrollbar$$module$build$src$core$scrollbar;
|
|
1907
|
+
module$build$src$core$blockly.ScrollbarPair=ScrollbarPair$$module$build$src$core$scrollbar_pair;module$build$src$core$blockly.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;module$build$src$core$blockly.ShortcutItems=module$build$src$core$shortcut_items;module$build$src$core$blockly.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;module$build$src$core$blockly.TOOLBOX_AT_BOTTOM=TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly;
|
|
1908
|
+
module$build$src$core$blockly.TOOLBOX_AT_LEFT=TOOLBOX_AT_LEFT$$module$build$src$core$blockly;module$build$src$core$blockly.TOOLBOX_AT_RIGHT=TOOLBOX_AT_RIGHT$$module$build$src$core$blockly;module$build$src$core$blockly.TOOLBOX_AT_TOP=TOOLBOX_AT_TOP$$module$build$src$core$blockly;module$build$src$core$blockly.Theme=Theme$$module$build$src$core$theme;module$build$src$core$blockly.ThemeManager=ThemeManager$$module$build$src$core$theme_manager;module$build$src$core$blockly.Themes=module$build$src$core$theme$themes;
|
|
1909
|
+
module$build$src$core$blockly.Toast=Toast$$module$build$src$core$toast;module$build$src$core$blockly.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;module$build$src$core$blockly.ToolboxCategory=ToolboxCategory$$module$build$src$core$toolbox$category;module$build$src$core$blockly.ToolboxItem=ToolboxItem$$module$build$src$core$toolbox$toolbox_item;module$build$src$core$blockly.ToolboxItemNavigationPolicy=ToolboxItemNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$toolbox_item_navigation_policy;
|
|
1910
|
+
module$build$src$core$blockly.ToolboxNavigator=ToolboxNavigator$$module$build$src$core$keyboard_nav$navigators$toolbox_navigator;module$build$src$core$blockly.ToolboxSeparator=ToolboxSeparator$$module$build$src$core$toolbox$separator;module$build$src$core$blockly.Tooltip=module$build$src$core$tooltip;module$build$src$core$blockly.Touch=module$build$src$core$touch;module$build$src$core$blockly.Trashcan=Trashcan$$module$build$src$core$trashcan;module$build$src$core$blockly.UnattachedFieldError=UnattachedFieldError$$module$build$src$core$field;
|
|
1911
|
+
module$build$src$core$blockly.VARIABLE_CATEGORY_NAME=CATEGORY_NAME$$module$build$src$core$variables;module$build$src$core$blockly.VARIABLE_DYNAMIC_CATEGORY_NAME=CATEGORY_NAME$$module$build$src$core$variables_dynamic;module$build$src$core$blockly.VERSION=VERSION$$module$build$src$core$blockly;module$build$src$core$blockly.VariableMap=VariableMap$$module$build$src$core$variable_map;module$build$src$core$blockly.VariableModel=VariableModel$$module$build$src$core$variable_model;
|
|
1912
|
+
module$build$src$core$blockly.Variables=module$build$src$core$variables;module$build$src$core$blockly.VariablesDynamic=module$build$src$core$variables_dynamic;module$build$src$core$blockly.VerticalFlyout=VerticalFlyout$$module$build$src$core$flyout_vertical;module$build$src$core$blockly.WidgetDiv=module$build$src$core$widgetdiv;module$build$src$core$blockly.Workspace=Workspace$$module$build$src$core$workspace;module$build$src$core$blockly.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;
|
|
1913
|
+
module$build$src$core$blockly.WorkspaceCommentNavigationPolicy=WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_comment_navigation_policy;module$build$src$core$blockly.WorkspaceDragger=WorkspaceDragger$$module$build$src$core$workspace_dragger;module$build$src$core$blockly.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$navigation_policies$workspace_navigation_policy;
|
|
1914
|
+
module$build$src$core$blockly.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;module$build$src$core$blockly.Xml=module$build$src$core$xml;module$build$src$core$blockly.ZoomControls=ZoomControls$$module$build$src$core$zoom_controls;module$build$src$core$blockly.blockAnimations=module$build$src$core$block_animations;module$build$src$core$blockly.blockRendering=module$build$src$core$renderers$common$block_rendering;module$build$src$core$blockly.browserEvents=module$build$src$core$browser_events;
|
|
1915
|
+
module$build$src$core$blockly.bubbles=module$build$src$core$bubbles;module$build$src$core$blockly.bumpObjects=module$build$src$core$bump_objects;module$build$src$core$blockly.clipboard=module$build$src$core$clipboard;module$build$src$core$blockly.comments=module$build$src$core$comments;module$build$src$core$blockly.common=module$build$src$core$common;module$build$src$core$blockly.config=$.config$$module$build$src$core$config;module$build$src$core$blockly.constants=module$build$src$core$constants;
|
|
1916
|
+
module$build$src$core$blockly.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$blockly.dialog=module$build$src$core$dialog;module$build$src$core$blockly.dragging=module$build$src$core$dragging;module$build$src$core$blockly.fieldRegistry=module$build$src$core$field_registry;module$build$src$core$blockly.geras=module$build$src$core$renderers$geras$geras;module$build$src$core$blockly.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;
|
|
1917
|
+
module$build$src$core$blockly.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$blockly.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$blockly.hasBubble=hasBubble$$module$build$src$core$interfaces$i_has_bubble;module$build$src$core$blockly.hideChaff=hideChaff$$module$build$src$core$blockly;module$build$src$core$blockly.icons=module$build$src$core$icons;module$build$src$core$blockly.inject=inject$$module$build$src$core$inject;
|
|
1918
|
+
module$build$src$core$blockly.inputs=module$build$src$core$inputs;module$build$src$core$blockly.isBoundedElement=isBoundedElement$$module$build$src$core$interfaces$i_bounded_element;module$build$src$core$blockly.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;module$build$src$core$blockly.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;module$build$src$core$blockly.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;
|
|
1919
|
+
module$build$src$core$blockly.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;module$build$src$core$blockly.isObservable=isObservable$$module$build$src$core$interfaces$i_observable;module$build$src$core$blockly.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;module$build$src$core$blockly.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;module$build$src$core$blockly.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;
|
|
1920
|
+
module$build$src$core$blockly.isSerializable=isSerializable$$module$build$src$core$interfaces$i_serializable;module$build$src$core$blockly.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;module$build$src$core$blockly.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$blockly.layers=module$build$src$core$layers;
|
|
1921
|
+
module$build$src$core$blockly.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$navigation_policies$block_navigation_policy;module$build$src$core$blockly.procedures=module$build$src$core$procedures;module$build$src$core$blockly.registry=module$build$src$core$registry;module$build$src$core$blockly.renderManagement=module$build$src$core$render_management;module$build$src$core$blockly.serialization=module$build$src$core$serialization;module$build$src$core$blockly.setLocale=setLocale$$module$build$src$core$msg;
|
|
1922
|
+
module$build$src$core$blockly.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$blockly.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$blockly.thrasos=module$build$src$core$renderers$thrasos$thrasos;module$build$src$core$blockly.uiPosition=module$build$src$core$positionable_helpers;module$build$src$core$blockly.utils=module$build$src$core$utils;module$build$src$core$blockly.zelos=module$build$src$core$renderers$zelos$zelos;var module$build$src$core$utils$metrics={};var module$build$src$core$renderers$common$i_path_object={};var module$build$src$core$interfaces$i_variable_model={};var module$build$src$core$interfaces$i_variable_map={};var module$build$src$core$interfaces$i_toolbox={};var module$build$src$core$interfaces$i_styleable={};var module$build$src$core$interfaces$i_serializer={};var module$build$src$core$interfaces$i_registrable={};var module$build$src$core$interfaces$i_procedure_model={};var module$build$src$core$interfaces$i_procedure_map={};var module$build$src$core$interfaces$i_positionable={};var module$build$src$core$interfaces$i_parameter_model={};var module$build$src$core$interfaces$i_movable={};var module$build$src$core$interfaces$i_metrics_manager={};var module$build$src$core$interfaces$i_keyboard_accessible={};var module$build$src$core$interfaces$i_json_block_definition={};var module$build$src$core$interfaces$i_focusable_tree={};module$build$src$core$interfaces$i_focusable_tree.isFocusableTree=isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree;var module$build$src$core$interfaces$i_flyout_inflater={};var module$build$src$core$interfaces$i_flyout={};var module$build$src$core$interfaces$i_dragger={};var module$build$src$core$interfaces$i_drag_target={};var module$build$src$core$interfaces$i_delete_area={};var module$build$src$core$interfaces$i_connection_previewer={};var module$build$src$core$interfaces$i_connection_checker={};var module$build$src$core$interfaces$i_component={};var module$build$src$core$interfaces$i_bubble={};
|
|
1820
1923
|
module$build$src$core$blockly.__namespace__=$;
|
|
1821
1924
|
return module$build$src$core$blockly;
|
|
1822
1925
|
}));
|