diff --git a/common/blockly-core/blockly_compressed.js b/common/blockly-core/blockly_compressed.js index edd34f6e..5d217a4d 100644 --- a/common/blockly-core/blockly_compressed.js +++ b/common/blockly-core/blockly_compressed.js @@ -11,48 +11,50 @@ } }(this, function() { var $={}; -var register$$module$build$src$core$registry,validate$$module$build$src$core$registry,unregister$$module$build$src$core$registry,getItem$$module$build$src$core$registry,hasItem$$module$build$src$core$registry,getClass$$module$build$src$core$registry,getObject$$module$build$src$core$registry,getAllItems$$module$build$src$core$registry,getClassFromOptions$$module$build$src$core$registry,getNextUniqueId$$module$build$src$core$utils$idgenerator,genUid$$module$build$src$core$utils$idgenerator,getRecordUndo$$module$build$src$core$events$utils, -fire$$module$build$src$core$events$utils,fireInternal$$module$build$src$core$events$utils,fireNow$$module$build$src$core$events$utils,filter$$module$build$src$core$events$utils,clearPendingUndo$$module$build$src$core$events$utils,isEnabled$$module$build$src$core$events$utils,setGroupInternal$$module$build$src$core$events$utils,getDescendantIds$$module$build$src$core$events$utils,fromJson$$module$build$src$core$events$utils,get$$module$build$src$core$events$utils,disableOrphans$$module$build$src$core$events$utils, -getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common,registerWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common,setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common, -jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common,defineBlocksWithJsonArrayInternal$$module$build$src$core$common,longStart$$module$build$src$core$touch,longStop$$module$build$src$core$touch,clearTouchIdentifier$$module$build$src$core$touch,shouldHandleEvent$$module$build$src$core$touch,getTouchIdentifierFromEvent$$module$build$src$core$touch,checkTouchIdentifier$$module$build$src$core$touch,conditionalBind$$module$build$src$core$browser_events, -bind$$module$build$src$core$browser_events,unbind$$module$build$src$core$browser_events,isTargetInput$$module$build$src$core$browser_events,isRightButton$$module$build$src$core$browser_events,mouseToSvg$$module$build$src$core$browser_events,getScrollDeltaPixels$$module$build$src$core$browser_events,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,inject$$module$build$src$core$css,createSvgElement$$module$build$src$core$utils$dom,addClass$$module$build$src$core$utils$dom, -removeClasses$$module$build$src$core$utils$dom,removeClass$$module$build$src$core$utils$dom,hasClass$$module$build$src$core$utils$dom,removeNode$$module$build$src$core$utils$dom,insertAfter$$module$build$src$core$utils$dom,setCssTransform$$module$build$src$core$utils$dom,startTextWidthCache$$module$build$src$core$utils$dom,stopTextWidthCache$$module$build$src$core$utils$dom,getTextWidth$$module$build$src$core$utils$dom,getFastTextWidth$$module$build$src$core$utils$dom,getFastTextWidthWithSizeString$$module$build$src$core$utils$dom, -measureFontMetrics$$module$build$src$core$utils$dom,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style,getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style,scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style, -getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math,getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml,domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox, -validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox,hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox,addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox, -getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers,alert$$module$build$src$core$dialog,setAlert$$module$build$src$core$dialog,confirm$$module$build$src$core$dialog,confirmInternal$$module$build$src$core$dialog,setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,setPrompt$$module$build$src$core$dialog,isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model, -isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,flyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables,createVariableButtonHandler$$module$build$src$core$variables, -promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables,nameUsedWithAnyType$$module$build$src$core$variables,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables,getAddedVariables$$module$build$src$core$variables, -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,dequeueBlock$$module$build$src$core$render_management,shouldRenderRootBlock$$module$build$src$core$render_management,renderBlock$$module$build$src$core$render_management, +var register$$module$build$src$core$registry,validate$$module$build$src$core$registry,unregister$$module$build$src$core$registry,getItem$$module$build$src$core$registry,hasItem$$module$build$src$core$registry,getClass$$module$build$src$core$registry,getObject$$module$build$src$core$registry,getAllItems$$module$build$src$core$registry,getClassFromOptions$$module$build$src$core$registry,warn$$module$build$src$core$utils$deprecation,getNextUniqueId$$module$build$src$core$utils$idgenerator,genUid$$module$build$src$core$utils$idgenerator, +isBlockCreate$$module$build$src$core$events$predicates,isBlockDelete$$module$build$src$core$events$predicates,isBlockChange$$module$build$src$core$events$predicates,isBlockFieldIntermediateChange$$module$build$src$core$events$predicates,isBlockMove$$module$build$src$core$events$predicates,isVarCreate$$module$build$src$core$events$predicates,isVarDelete$$module$build$src$core$events$predicates,isVarRename$$module$build$src$core$events$predicates,isBlockDrag$$module$build$src$core$events$predicates, +isSelected$$module$build$src$core$events$predicates,isClick$$module$build$src$core$events$predicates,isMarkerMove$$module$build$src$core$events$predicates,isBubbleOpen$$module$build$src$core$events$predicates,isTrashcanOpen$$module$build$src$core$events$predicates,isToolboxItemSelect$$module$build$src$core$events$predicates,isThemeChange$$module$build$src$core$events$predicates,isViewportChange$$module$build$src$core$events$predicates,isCommentCreate$$module$build$src$core$events$predicates,isCommentDelete$$module$build$src$core$events$predicates, +isCommentChange$$module$build$src$core$events$predicates,isCommentMove$$module$build$src$core$events$predicates,isCommentResize$$module$build$src$core$events$predicates,isCommentDrag$$module$build$src$core$events$predicates,isCommentCollapse$$module$build$src$core$events$predicates,isFinishedLoading$$module$build$src$core$events$predicates,getRecordUndo$$module$build$src$core$events$utils,fire$$module$build$src$core$events$utils,fireInternal$$module$build$src$core$events$utils,fireNow$$module$build$src$core$events$utils, +enqueueEvent$$module$build$src$core$events$utils,filter$$module$build$src$core$events$utils,clearPendingUndo$$module$build$src$core$events$utils,isEnabled$$module$build$src$core$events$utils,setGroupInternal$$module$build$src$core$events$utils,getDescendantIds$$module$build$src$core$events$utils,fromJson$$module$build$src$core$events$utils,get$$module$build$src$core$events$utils,disableOrphans$$module$build$src$core$events$utils,getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common, +registerWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common,setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common,jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common, +defineBlocksWithJsonArrayInternal$$module$build$src$core$common,longStart$$module$build$src$core$touch,longStop$$module$build$src$core$touch,clearTouchIdentifier$$module$build$src$core$touch,shouldHandleEvent$$module$build$src$core$touch,getTouchIdentifierFromEvent$$module$build$src$core$touch,checkTouchIdentifier$$module$build$src$core$touch,conditionalBind$$module$build$src$core$browser_events,bind$$module$build$src$core$browser_events,unbind$$module$build$src$core$browser_events,isTargetInput$$module$build$src$core$browser_events, +isRightButton$$module$build$src$core$browser_events,mouseToSvg$$module$build$src$core$browser_events,getScrollDeltaPixels$$module$build$src$core$browser_events,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,inject$$module$build$src$core$css,createSvgElement$$module$build$src$core$utils$dom,addClass$$module$build$src$core$utils$dom,removeClasses$$module$build$src$core$utils$dom,removeClass$$module$build$src$core$utils$dom,hasClass$$module$build$src$core$utils$dom, +removeNode$$module$build$src$core$utils$dom,insertAfter$$module$build$src$core$utils$dom,setCssTransform$$module$build$src$core$utils$dom,startTextWidthCache$$module$build$src$core$utils$dom,stopTextWidthCache$$module$build$src$core$utils$dom,getTextWidth$$module$build$src$core$utils$dom,getFastTextWidth$$module$build$src$core$utils$dom,getFastTextWidthWithSizeString$$module$build$src$core$utils$dom,measureFontMetrics$$module$build$src$core$utils$dom,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style, +getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style,scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style,getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math, +getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml,domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox,validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox, +hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox,addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox,getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers, register$$module$build$src$core$serialization$registry,unregister$$module$build$src$core$serialization$registry,save$$module$build$src$core$serialization$workspace_comments,append$$module$build$src$core$serialization$workspace_comments,register$$module$build$src$core$clipboard$registry,unregister$$module$build$src$core$clipboard$registry,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,setState$$module$build$src$core$utils$aria,isSerializable$$module$build$src$core$interfaces$i_serializable,save$$module$build$src$core$serialization$blocks,saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks, -saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks, -tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,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,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,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,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,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,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,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,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,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,workspaceToDom$$module$build$src$core$xml,saveWorkspaceComment$$module$build$src$core$xml,variablesToDom$$module$build$src$core$xml,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,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,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, -isDraggable$$module$build$src$core$interfaces$i_draggable,deepMerge$$module$build$src$core$utils$object,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,register$$module$build$src$core$field_registry,unregister$$module$build$src$core$field_registry,fromJsonInternal$$module$build$src$core$field_registry,trimOptions$$module$build$src$core$field_dropdown,applyTrim$$module$build$src$core$field_dropdown,validateOptions$$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,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,warn$$module$build$src$core$utils$deprecation,point$$module$build$src$core$utils$svg_paths,curve$$module$build$src$core$utils$svg_paths,moveTo$$module$build$src$core$utils$svg_paths,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,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,allProcedures$$module$build$src$core$procedures,procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures, -mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,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,getParentConnection$$module$build$src$core$keyboard_nav$ast_node,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,flyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster,blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster,blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster,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,isDeletable$$module$build$src$core$interfaces$i_deletable,copyInternal$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard,pasteFromData$$module$build$src$core$clipboard,duplicateInternal$$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,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,registerDefaultShortcuts$$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,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,onKeyDown$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items, -toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items, -registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,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, -pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectable$$module$build$src$core$interfaces$i_selectable,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item, -hideChaff$$module$build$src$core$blockly,$jscomp; +setRole$$module$build$src$core$utils$aria,setState$$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,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,confirmInternal$$module$build$src$core$dialog,setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,setPrompt$$module$build$src$core$dialog,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks, +isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model,flyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables,createVariableButtonHandler$$module$build$src$core$variables,promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables, +nameUsedWithAnyType$$module$build$src$core$variables,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables,getAddedVariables$$module$build$src$core$variables,save$$module$build$src$core$serialization$blocks,saveAttributes$$module$build$src$core$serialization$blocks, +saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks,saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,appendInternal$$module$build$src$core$serialization$blocks, +appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks,tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,loadInputBlocks$$module$build$src$core$serialization$blocks, +loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,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,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,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,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,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,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,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,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,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,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,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,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,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,isDraggable$$module$build$src$core$interfaces$i_draggable,deepMerge$$module$build$src$core$utils$object,register$$module$build$src$core$field_registry, +unregister$$module$build$src$core$field_registry,fromJsonInternal$$module$build$src$core$field_registry,trimOptions$$module$build$src$core$field_dropdown,applyTrim$$module$build$src$core$field_dropdown,validateOptions$$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,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,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,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures, +procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants, +isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,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,getParentConnection$$module$build$src$core$keyboard_nav$ast_node,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,flyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster, +blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster,blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster,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,isDeletable$$module$build$src$core$interfaces$i_deletable,copyInternal$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard, +pasteFromData$$module$build$src$core$clipboard,duplicateInternal$$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,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, +registerDefaultShortcuts$$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,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject,onKeyDown$$module$build$src$core$inject,bindDocumentEvents$$module$build$src$core$inject, +loadSounds$$module$build$src$core$inject,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items,getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items, +registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,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,pixelsToWorkspaceCoords$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster,isRenderedElement$$module$build$src$core$interfaces$i_rendered_element, +isSelectable$$module$build$src$core$interfaces$i_selectable,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,$jscomp; register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&"string"!==typeof a||""===`${a}`.trim())throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if("string"!==typeof b||""===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], 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}; validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if("function"!==typeof b.fromJson)throw Error('Type "'+a+'" must have a fromJson function');}}; @@ -60,22 +62,30 @@ unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase(); getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();const d=typeMap$$module$build$src$core$registry[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};hasItem$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();return(a=typeMap$$module$build$src$core$registry[a])?!!a[b]:!1}; getClass$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)};getObject$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)}; getAllItems$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();var d=typeMap$$module$build$src$core$registry[a];if(!d){d=`Unable to find [${a}] in the registry.`;if(c)throw Error(`${d} You must require or register a ${a} plugin.`);console.warn(d);return null}if(!b)return d;a=nameMap$$module$build$src$core$registry[a];c=Object.create(null);for(const e of Object.keys(d))c[a[e]]=d[e];return c}; -getClassFromOptions$$module$build$src$core$registry=function(a,b,c){b=b.plugins[String(a)]||DEFAULT$$module$build$src$core$registry;return"function"===typeof b?b:getClass$$module$build$src$core$registry(a,b,c)};getNextUniqueId$$module$build$src$core$utils$idgenerator=function(){return"blockly-"+(nextId$$module$build$src$core$utils$idgenerator++).toString(36)};genUid$$module$build$src$core$utils$idgenerator=function(){return internal$$module$build$src$core$utils$idgenerator.genUid()}; -$.setRecordUndo$$module$build$src$core$events$utils=function(a){recordUndo$$module$build$src$core$events$utils=a};getRecordUndo$$module$build$src$core$events$utils=function(){return recordUndo$$module$build$src$core$events$utils};fire$$module$build$src$core$events$utils=function(a){TEST_ONLY$$module$build$src$core$events$utils.fireInternal(a)}; -fireInternal$$module$build$src$core$events$utils=function(a){if(isEnabled$$module$build$src$core$events$utils()){if(!FIRE_QUEUE$$module$build$src$core$events$utils.length)try{requestAnimationFrame(()=>{setTimeout(fireNow$$module$build$src$core$events$utils,0)})}catch(b){setTimeout(fireNow$$module$build$src$core$events$utils,0)}FIRE_QUEUE$$module$build$src$core$events$utils.push(a)}}; -fireNow$$module$build$src$core$events$utils=function(){var a=filter$$module$build$src$core$events$utils(FIRE_QUEUE$$module$build$src$core$events$utils,!0);FIRE_QUEUE$$module$build$src$core$events$utils.length=0;for(let c=0,d;d=a[c];c++)if(d.workspaceId){var b=getWorkspaceById$$module$build$src$core$common(d.workspaceId);b&&b.fireChangeListener(d)}a=new Set(a.map(c=>c.workspaceId));for(const c of a){if(!c)continue;a=getWorkspaceById$$module$build$src$core$common(c);if(!a)continue;a=a.getUndoStack(); -let d=void 0;for(b=a.length;0{setTimeout(fireNow$$module$build$src$core$events$utils,0)})}catch(b){setTimeout(fireNow$$module$build$src$core$events$utils,0)}enqueueEvent$$module$build$src$core$events$utils(a)}}; +fireNow$$module$build$src$core$events$utils=function(){const a=filter$$module$build$src$core$events$utils(FIRE_QUEUE$$module$build$src$core$events$utils,!0);FIRE_QUEUE$$module$build$src$core$events$utils.length=0;for(const b of a){if(!b.workspaceId)continue;let c;null==(c=getWorkspaceById$$module$build$src$core$common(b.workspaceId))||c.fireChangeListener(b)}}; +enqueueEvent$$module$build$src$core$events$utils=function(a){if(isBlockChange$$module$build$src$core$events$predicates(a)&&"mutation"===a.element){let b;for(b=FIRE_QUEUE$$module$build$src$core$events$utils.length;0!d.isNull());b||a.reverse();return a};clearPendingUndo$$module$build$src$core$events$utils=function(){for(let a=0,b;b=FIRE_QUEUE$$module$build$src$core$events$utils[a];a++)b.recordUndo=!1};$.disable$$module$build$src$core$events$utils=function(){disabled$$module$build$src$core$events$utils++}; $.enable$$module$build$src$core$events$utils=function(){disabled$$module$build$src$core$events$utils--};isEnabled$$module$build$src$core$events$utils=function(){return 0===disabled$$module$build$src$core$events$utils};$.getGroup$$module$build$src$core$events$utils=function(){return group$$module$build$src$core$events$utils};$.setGroup$$module$build$src$core$events$utils=function(a){TEST_ONLY$$module$build$src$core$events$utils.setGroupInternal(a)}; setGroupInternal$$module$build$src$core$events$utils=function(a){group$$module$build$src$core$events$utils="boolean"===typeof a?a?genUid$$module$build$src$core$utils$idgenerator():"":a};getDescendantIds$$module$build$src$core$events$utils=function(a){const b=[];a=a.getDescendants(!1);for(let c=0,d;d=a[c];c++)b[c]=d.id;return b}; fromJson$$module$build$src$core$events$utils=function(a,b){const c=get$$module$build$src$core$events$utils(a.type);if(!c)throw Error("Unknown event type.");return c.fromJson(a,b)};get$$module$build$src$core$events$utils=function(a){const b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,a);if(!b)throw Error(`Event type ${a} not found in registry.`);return b}; -disableOrphans$$module$build$src$core$events$utils=function(a){if((a.type===$.MOVE$$module$build$src$core$events$utils||a.type===$.CREATE$$module$build$src$core$events$utils)&&a.workspaceId){var b=getWorkspaceById$$module$build$src$core$common(a.workspaceId);if(!a.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(a=b.getBlockById(a.blockId)){const c=recordUndo$$module$build$src$core$events$utils;try{recordUndo$$module$build$src$core$events$utils=!1;const d=a.getParent(); +disableOrphans$$module$build$src$core$events$utils=function(a){if((isBlockMove$$module$build$src$core$events$predicates(a)||isBlockCreate$$module$build$src$core$events$predicates(a))&&a.workspaceId){var b=getWorkspaceById$$module$build$src$core$common(a.workspaceId);if(!a.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(a=b.getBlockById(a.blockId)){const c=recordUndo$$module$build$src$core$events$utils;try{recordUndo$$module$build$src$core$events$utils=!1;const d=a.getParent(); if(d&&!d.hasDisabledReason(ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils)){const e=a.getDescendants(!1);for(let f=0,g;g=e[f];f++)g.setDisabledReason(!1,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils)}else if((a.outputConnection||a.previousConnection)&&!b.isDragging()){do a.setDisabledReason(!0,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils),a=a.getNextBlock();while(a)}}finally{recordUndo$$module$build$src$core$events$utils=c}}}}; getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null};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};setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a};getSelected$$module$build$src$core$common=function(){return selected$$module$build$src$core$common}; -$.setSelected$$module$build$src$core$common=function(a){if(selected$$module$build$src$core$common!==a){var b,c,d,e,f,g,h=new (get$$module$build$src$core$events$utils(SELECTED$$module$build$src$core$events$utils))(null!=(d=null==(b=selected$$module$build$src$core$common)?void 0:b.id)?d:null,null!=(e=null==a?void 0:a.id)?e:null,null!=(g=null!=(f=null==a?void 0:a.workspace.id)?f:null==(c=selected$$module$build$src$core$common)?void 0:c.workspace.id)?g:"");fire$$module$build$src$core$events$utils(h); +$.setSelected$$module$build$src$core$common=function(a){if(selected$$module$build$src$core$common!==a){var b,c,d,e,f,g,h=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.SELECTED))(null!=(d=null==(b=selected$$module$build$src$core$common)?void 0:b.id)?d:null,null!=(e=null==a?void 0:a.id)?e:null,null!=(g=null!=(f=null==a?void 0:a.workspace.id)?f:null==(c=selected$$module$build$src$core$common)?void 0:c.workspace.id)?g:"");fire$$module$build$src$core$events$utils(h); var k;null==(k=selected$$module$build$src$core$common)||k.unselect();selected$$module$build$src$core$common=a;var l;null==(l=selected$$module$build$src$core$common)||l.select()}};getParentContainer$$module$build$src$core$common=function(){return parentContainer$$module$build$src$core$common};setParentContainer$$module$build$src$core$common=function(a){parentContainer$$module$build$src$core$common=a}; 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()}}; 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)}; @@ -122,7 +132,7 @@ domToText$$module$build$src$core$utils$xml=function(a){return sanitizeText$$modu convertToolboxDefToJson$$module$build$src$core$utils$toolbox=function(a){if(!a)return null;if(a instanceof Element||"string"===typeof a)a=parseToolboxTree$$module$build$src$core$utils$toolbox(a),a=convertToToolboxJson$$module$build$src$core$utils$toolbox(a);validateToolbox$$module$build$src$core$utils$toolbox(a);return a}; validateToolbox$$module$build$src$core$utils$toolbox=function(a){const b=a.kind;a=a.contents;if(b&&b!==FLYOUT_TOOLBOX_KIND$$module$build$src$core$utils$toolbox&&b!==CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox)throw Error("Invalid toolbox kind "+b+". Please supply either "+FLYOUT_TOOLBOX_KIND$$module$build$src$core$utils$toolbox+" or "+CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox);if(!a)throw Error("Toolbox must have a contents attribute.");}; convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox=function(a){return a?a.contents?a.contents:Array.isArray(a)&&0"CATEGORY"===c.kind.toUpperCase()).length};isCategoryCollapsible$$module$build$src$core$utils$toolbox=function(a){return a&&a.contents?!!a.contents.filter(function(b){return"CATEGORY"===b.kind.toUpperCase()}).length:!1}; convertToToolboxJson$$module$build$src$core$utils$toolbox=function(a){const b={contents:xmlToJsonArray$$module$build$src$core$utils$toolbox(a)};a instanceof Node&&addAttributes$$module$build$src$core$utils$toolbox(a,b);return b}; xmlToJsonArray$$module$build$src$core$utils$toolbox=function(a){const b=[];let c=a.childNodes;c||(c=a);for(let d=0,e;e=c[d];d++){if(!e.tagName)continue;a={};const f=e.tagName.toUpperCase();a.kind=f;"BLOCK"===f?a.blockxml=e:e.childNodes&&0f.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, +d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>1>=Math.abs(c.x-a.x)&&1>=Math.abs(c.y-a.y))};setRole$$module$build$src$core$utils$aria=function(a,b){a.setAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria,b)};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}`)}; +isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return void 0!==a.saveState&&void 0!==a.loadState}; +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= +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()}; +triggerQueuedRenders$$module$build$src$core$render_management=function(a){a||window.cancelAnimationFrame(animationRequestId$$module$build$src$core$render_management);doRenders$$module$build$src$core$render_management(a);!a&&afterRendersResolver$$module$build$src$core$render_management&&afterRendersResolver$$module$build$src$core$render_management()};alwaysImmediatelyRender$$module$build$src$core$render_management=function(){return JavaFx$$module$build$src$core$utils$useragent}; +queueBlock$$module$build$src$core$render_management=function(a){dirtyBlocks$$module$build$src$core$render_management.add(a);eventGroups$$module$build$src$core$render_management.set(a,$.getGroup$$module$build$src$core$events$utils());const b=a.getParent();b?queueBlock$$module$build$src$core$render_management(b):rootBlocks$$module$build$src$core$render_management.add(a)}; +doRenders$$module$build$src$core$render_management=function(a){const b=a?new Set([a]):new Set([...rootBlocks$$module$build$src$core$render_management].map(f=>f.workspace)),c=[...rootBlocks$$module$build$src$core$render_management].filter(shouldRenderRootBlock$$module$build$src$core$render_management).filter(f=>b.has(f.workspace));for(var d of c)renderBlock$$module$build$src$core$render_management(d);for(const f of b)f.resizeContents();for(var e of c)d=e.getRelativeToSurfaceXY(),e.updateComponentLocations(d); +for(const f of c)e=$.getGroup$$module$build$src$core$events$utils(),(d=eventGroups$$module$build$src$core$render_management.get(f))&&$.setGroup$$module$build$src$core$events$utils(d),f.bumpNeighbours(),$.setGroup$$module$build$src$core$events$utils(e);for(const f of c)dequeueBlock$$module$build$src$core$render_management(f);a||(afterRendersPromise$$module$build$src$core$render_management=null)}; +dequeueBlock$$module$build$src$core$render_management=function(a){rootBlocks$$module$build$src$core$render_management.delete(a);dirtyBlocks$$module$build$src$core$render_management.delete(a);eventGroups$$module$build$src$core$render_management.delete(a);for(const b of a.getChildren(!1))dequeueBlock$$module$build$src$core$render_management(b)};shouldRenderRootBlock$$module$build$src$core$render_management=function(a){return!a.isDisposed()&&!a.getParent()}; +renderBlock$$module$build$src$core$render_management=function(a){if(dirtyBlocks$$module$build$src$core$render_management.has(a)&&a.initialized){for(const b of a.getChildren(!1))renderBlock$$module$build$src$core$render_management(b);a.renderEfficiently()}};alert$$module$build$src$core$dialog=function(a,b){alertImplementation$$module$build$src$core$dialog(a,b)};setAlert$$module$build$src$core$dialog=function(a){alertImplementation$$module$build$src$core$dialog=a}; +confirm$$module$build$src$core$dialog=function(a,b){TEST_ONLY$$module$build$src$core$dialog.confirmInternal(a,b)};confirmInternal$$module$build$src$core$dialog=function(a,b){confirmImplementation$$module$build$src$core$dialog(a,b)};setConfirm$$module$build$src$core$dialog=function(a){confirmImplementation$$module$build$src$core$dialog=a};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){promptImplementation$$module$build$src$core$dialog=a};isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return void 0!==a.getProcedureDef};isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return void 0!==a.getProcedureCall&&void 0!==a.renameProcedure}; +isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return void 0!==a.getVariableModel};$.allUsedVarModels$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);const b=new Set;for(let c=0;c{afterRendersResolver$$module$build$src$core$render_management=b;animationRequestId$$module$build$src$core$render_management= -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()}; -triggerQueuedRenders$$module$build$src$core$render_management=function(a){a||window.cancelAnimationFrame(animationRequestId$$module$build$src$core$render_management);doRenders$$module$build$src$core$render_management(a);!a&&afterRendersResolver$$module$build$src$core$render_management&&afterRendersResolver$$module$build$src$core$render_management()};alwaysImmediatelyRender$$module$build$src$core$render_management=function(){return JavaFx$$module$build$src$core$utils$useragent}; -queueBlock$$module$build$src$core$render_management=function(a){dirtyBlocks$$module$build$src$core$render_management.add(a);eventGroups$$module$build$src$core$render_management.set(a,$.getGroup$$module$build$src$core$events$utils());const b=a.getParent();b?queueBlock$$module$build$src$core$render_management(b):rootBlocks$$module$build$src$core$render_management.add(a)}; -doRenders$$module$build$src$core$render_management=function(a){const b=a?new Set([a]):new Set([...rootBlocks$$module$build$src$core$render_management].map(f=>f.workspace)),c=[...rootBlocks$$module$build$src$core$render_management].filter(shouldRenderRootBlock$$module$build$src$core$render_management).filter(f=>b.has(f.workspace));for(var d of c)renderBlock$$module$build$src$core$render_management(d);for(const f of b)f.resizeContents();for(var e of c)d=e.getRelativeToSurfaceXY(),e.updateComponentLocations(d); -for(const f of c)e=$.getGroup$$module$build$src$core$events$utils(),(d=eventGroups$$module$build$src$core$render_management.get(f))&&$.setGroup$$module$build$src$core$events$utils(d),f.bumpNeighbours(),$.setGroup$$module$build$src$core$events$utils(e);for(const f of c)dequeueBlock$$module$build$src$core$render_management(f);a||(afterRendersPromise$$module$build$src$core$render_management=null)}; -dequeueBlock$$module$build$src$core$render_management=function(a){rootBlocks$$module$build$src$core$render_management.delete(a);dirtyBlocks$$module$build$src$core$render_management.delete(a);eventGroups$$module$build$src$core$render_management.delete(a);for(const b of a.getChildren(!1))dequeueBlock$$module$build$src$core$render_management(b)};shouldRenderRootBlock$$module$build$src$core$render_management=function(a){return!a.isDisposed()&&!a.getParent()}; -renderBlock$$module$build$src$core$render_management=function(a){if(dirtyBlocks$$module$build$src$core$render_management.has(a)&&a.initialized){for(const b of a.getChildren(!1))renderBlock$$module$build$src$core$render_management(b);a.renderEfficiently()}};register$$module$build$src$core$serialization$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,a,b)}; -unregister$$module$build$src$core$serialization$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,a)}; -save$$module$build$src$core$serialization$workspace_comments=function(a,{addCoordinates:b=!1,saveIds:c=!0}={}){const d=a.workspace,e=Object.create(null);e.height=a.getSize().height;e.width=a.getSize().width;c&&(e.id=a.id);b&&(b=a.getRelativeToSurfaceXY(),e.x=d.RTL?d.getWidth()-b.x:b.x,e.y=b.y);a.getText()&&(e.text=a.getText());a.isCollapsed()&&(e.collapsed=!0);a.isOwnEditable()||(e.editable=!1);a.isOwnMovable()||(e.movable=!1);a.isOwnDeletable()||(e.deletable=!1);return e}; -append$$module$build$src$core$serialization$workspace_comments=function(a,b,{recordUndo:c=!1}={}){const d=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(c);c=b.newComment(a.id);void 0!==a.text&&c.setText(a.text);if(void 0!==a.x||void 0!==a.y){const f=c.getRelativeToSurfaceXY();let g,h=null!=(g=a.x)?g:f.x;h=b.RTL?b.getWidth()-h:h;var e;b=null!=(e=a.y)?e:f.y;c.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(h,b))}if(void 0!==a.width|| -a.height){e=c.getSize();let f,g;c.setSize(new Size$$module$build$src$core$utils$size(null!=(f=a.width)?f:e.width,null!=(g=a.height)?g:e.height))}void 0!==a.collapsed&&c.setCollapsed(a.collapsed);void 0!==a.editable&&c.setEditable(a.editable);void 0!==a.movable&&c.setMovable(a.movable);void 0!==a.deletable&&c.setDeletable(a.deletable);$.setRecordUndo$$module$build$src$core$events$utils(d);return c}; -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)}; -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, -d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>1>=Math.abs(c.x-a.x)&&1>=Math.abs(c.y-a.y))};setRole$$module$build$src$core$utils$aria=function(a,b){a.setAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria,b)};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}`)}; -isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return void 0!==a.saveState&&void 0!==a.loadState}; save$$module$build$src$core$serialization$blocks=function(a,{addCoordinates:b=!1,addInputBlocks:c=!0,addNextBlocks:d=!0,doFullSerialization:e=!0,saveIds:f=!0}={}){if(a.isInsertionMarker())return null;const g={type:a.type,id:f?a.id:void 0};b&&saveCoords$$module$build$src$core$serialization$blocks(a,g);saveAttributes$$module$build$src$core$serialization$blocks(a,g);saveExtraState$$module$build$src$core$serialization$blocks(a,g,e);saveIcons$$module$build$src$core$serialization$blocks(a,g,e);saveFields$$module$build$src$core$serialization$blocks(a, g,e);c&&saveInputBlocks$$module$build$src$core$serialization$blocks(a,g,e,f);d&&saveNextBlocks$$module$build$src$core$serialization$blocks(a,g,e,f);return g}; saveAttributes$$module$build$src$core$serialization$blocks=function(a,b){a.isCollapsed()&&(b.collapsed=!0);a.isEnabled()||(b.disabledReasons=Array.from(a.getDisabledReasons()));a.isOwnDeletable()||(b.deletable=!1);a.isOwnMovable()||(b.movable=!1);a.isOwnEditable()||(b.editable=!1);void 0!==a.inputsInline&&a.inputsInline!==a.inputsInlineDefault&&(b.inline=a.inputsInline);a.data&&(b.data=a.data)}; @@ -179,11 +189,11 @@ saveInputBlocks$$module$build$src$core$serialization$blocks=function(a,b,c,d){co saveNextBlocks$$module$build$src$core$serialization$blocks=function(a,b,c,d){a.nextConnection&&(a=saveConnection$$module$build$src$core$serialization$blocks(a.nextConnection,c,d))&&(b.next=a)};saveConnection$$module$build$src$core$serialization$blocks=function(a,b,c){const d=a.getShadowState(!0);a=a.targetBlock();if(!d&&!a)return null;const e=Object.create(null);d&&(e.shadow=d);a&&!a.isShadow()&&(e.block=save$$module$build$src$core$serialization$blocks(a,{doFullSerialization:b,saveIds:c}));return e}; append$$module$build$src$core$serialization$blocks=function(a,b,{recordUndo:c=!1}={}){a=appendInternal$$module$build$src$core$serialization$blocks(a,b,{recordUndo:c});b.rendered&&triggerQueuedRenders$$module$build$src$core$render_management();return a}; appendInternal$$module$build$src$core$serialization$blocks=function(a,b,{parentConnection:c,isShadow:d=!1,recordUndo:e=!1}={}){const f=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(e);(e=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);$.disable$$module$build$src$core$events$utils();const g=b.getAllVariables();let h;try{h=appendPrivate$$module$build$src$core$serialization$blocks(a,b,{parentConnection:c, -isShadow:d})}finally{$.enable$$module$build$src$core$events$utils()}checkNewVariables$$module$build$src$core$serialization$blocks(b,g);isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CREATE$$module$build$src$core$events$utils))(h));$.setGroup$$module$build$src$core$events$utils(e);$.setRecordUndo$$module$build$src$core$events$utils(f);if(b.rendered){const k=h;setTimeout(()=>{k.disposed||k.setConnectionTracking(!0)}, +isShadow:d})}finally{$.enable$$module$build$src$core$events$utils()}checkNewVariables$$module$build$src$core$serialization$blocks(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_CREATE))(h));$.setGroup$$module$build$src$core$events$utils(e);$.setRecordUndo$$module$build$src$core$events$utils(f);if(b.rendered){const k=h;setTimeout(()=>{k.disposed||k.setConnectionTracking(!0)}, 1)}return h}; appendPrivate$$module$build$src$core$serialization$blocks=function(a,b,{parentConnection:c,isShadow:d=!1}={}){if(!a.type)throw new MissingBlockType$$module$build$src$core$serialization$exceptions(a);const e=b.newBlock(a.type,a.id);e.setShadow(d);loadCoords$$module$build$src$core$serialization$blocks(e,a);loadAttributes$$module$build$src$core$serialization$blocks(e,a);loadExtraState$$module$build$src$core$serialization$blocks(e,a);tryToConnectParent$$module$build$src$core$serialization$blocks(c,e, a);loadIcons$$module$build$src$core$serialization$blocks(e,a);loadFields$$module$build$src$core$serialization$blocks(e,a);loadInputBlocks$$module$build$src$core$serialization$blocks(e,a);loadNextBlocks$$module$build$src$core$serialization$blocks(e,a);initBlock$$module$build$src$core$serialization$blocks(e,b.rendered);return e}; -checkNewVariables$$module$build$src$core$serialization$blocks=function(a,b){if(isEnabled$$module$build$src$core$events$utils())for(a=getAddedVariables$$module$build$src$core$variables(a,b),b=0;b{$.disable$$module$build$src$core$events$utils();let c;try{c=b instanceof Element?domToBlockInternal$$module$build$src$core$xml(b,a.workspace):appendInternal$$module$build$src$core$serialization$blocks(b,a.workspace);const d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-$.config$$module$build$src$core$config.snapRadius:d.x+$.config$$module$build$src$core$config.snapRadius;d.y+=2*$.config$$module$build$src$core$config.snapRadius; -c.moveBy(d.x,d.y)}finally{$.enable$$module$build$src$core$events$utils()}isEnabled$$module$build$src$core$events$utils()&&!c.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CREATE$$module$build$src$core$events$utils))(c));$.setSelected$$module$build$src$core$common(c);return c}}; +c.moveBy(d.x,d.y)}finally{$.enable$$module$build$src$core$events$utils()}isEnabled$$module$build$src$core$events$utils()&&!c.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))(c));$.setSelected$$module$build$src$core$common(c);return c}}; +mouseToWorkspacePoint$$module$build$src$core$utils$drag=function(a,b){b=mouseToSvg$$module$build$src$core$browser_events(b,a.getParentSvg(),a.getInverseScreenCTM());b.x/=a.scale;b.y/=a.scale;return b};start$$module$build$src$core$utils$drag=function(a,b,c){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);workspaceToDragDelta$$module$build$src$core$utils$drag.set(a,Coordinate$$module$build$src$core$utils$coordinate.difference(c,b))}; +move$$module$build$src$core$utils$drag=function(a,b){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);a=workspaceToDragDelta$$module$build$src$core$utils$drag.get(a);if(!a)throw Error("Drag not initialized");return Coordinate$$module$build$src$core$utils$coordinate.sum(a,b)}; workspaceToDom$$module$build$src$core$xml=function(a,b=!1){const c=$.createElement$$module$build$src$core$utils$xml("xml");var d=variablesToDom$$module$build$src$core$xml($.allUsedVarModels$$module$build$src$core$variables(a));d.hasChildNodes()&&c.appendChild(d);for(const e of a.getTopComments())c.appendChild(saveWorkspaceComment$$module$build$src$core$xml(e,b));a=a.getTopBlocks(!0);for(d=0;df&&(f=k.x)}d=d-g+10;c=b.RTL?c-f:c-e;for(e=0;e=d&&(e=`skewX(${Math.round(Math.sin(d*Math.PI*3)*(1-d)*b)})`,disconnectPid$$module$build$src$core$block_animations=setTimeout(disconnectUiStep$$module$build$src$core$block_animations,10,a,b,c));a.getSvgRoot().setAttribute("transform",`${a.getTranslation()} ${e}`)}; disconnectUiStop$$module$build$src$core$block_animations=function(){wobblingBlock$$module$build$src$core$block_animations&&(disconnectPid$$module$build$src$core$block_animations&&(clearTimeout(disconnectPid$$module$build$src$core$block_animations),disconnectPid$$module$build$src$core$block_animations=null),wobblingBlock$$module$build$src$core$block_animations.getSvgRoot().setAttribute("transform",wobblingBlock$$module$build$src$core$block_animations.getTranslation()),wobblingBlock$$module$build$src$core$block_animations= null)};isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return void 0!==a.getRelativeToSurfaceXY&&void 0!==a.isMovable&&void 0!==a.startDrag&&void 0!==a.drag&&void 0!==a.endDrag&&void 0!==a.revertDrag};deepMerge$$module$build$src$core$utils$object=function(a,b){for(const c in b)a[c]=null!==b[c]&&"object"===typeof b[c]?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a}; -isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return void 0!==a.getProcedureModel&&void 0!==a.doProcedureUpdate&&void 0!==a.isProcedureDef};isObservable$$module$build$src$core$interfaces$i_observable=function(a){return void 0!==a.startPublishing&&void 0!==a.stopPublishing};register$$module$build$src$core$field_registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a,b)}; -unregister$$module$build$src$core$field_registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a)};$.fromJson$$module$build$src$core$field_registry=function(a){return TEST_ONLY$$module$build$src$core$field_registry.fromJsonInternal(a)}; +register$$module$build$src$core$field_registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a,b)};unregister$$module$build$src$core$field_registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a)};$.fromJson$$module$build$src$core$field_registry=function(a){return TEST_ONLY$$module$build$src$core$field_registry.fromJsonInternal(a)}; fromJsonInternal$$module$build$src$core$field_registry=function(a){const b=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.FIELD,a.type);return b?b.fromJson(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)}; trimOptions$$module$build$src$core$field_dropdown=function(a){let b=!1;const c=a.map(([g,h])=>{if("string"===typeof g)return[replaceMessageReferences$$module$build$src$core$utils$parsing(g),h];b=!0;return[null!==g.alt?Object.assign({},g,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(g.alt)}):Object.assign({},g),h]});if(b||2>a.length)return{options:c};var d=c.map(([g])=>g),e=shortestStringLength$$module$build$src$core$utils$string(d);a=commonWordPrefix$$module$build$src$core$utils$string(d, e);const f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:applyTrim$$module$build$src$core$field_dropdown(c,a,f),prefix:e,suffix:d}};applyTrim$$module$build$src$core$field_dropdown=function(a,b,c){return a.map(([d,e])=>[d.substring(b,d.length-c),e])}; @@ -339,9 +350,9 @@ runAfterPageLoad$$module$build$src$core$extensions=function(a){if("object"!==typ $.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))}}; 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)void 0===c[e]&&console.warn(`No tooltip mapping for value ${e} of field `+`${b} of block type ${a.type}.`)}}; $.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))}; -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))};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("")};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};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)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)}; +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("")}; +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};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)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)}; +isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return void 0!==a.getProcedureModel&&void 0!==a.doProcedureUpdate&&void 0!==a.isProcedureDef};isObservable$$module$build$src$core$interfaces$i_observable=function(a){return void 0!==a.startPublishing&&void 0!==a.stopPublishing}; 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=> !!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]}; 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}; @@ -355,12 +366,12 @@ const c=[];if(Blocks$$module$build$src$core$blocks.procedures_defnoreturn){var d 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}; 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, b);b=$.createTextNode$$module$build$src$core$utils$xml(b);e.appendChild(b);d.appendChild(e);c.appendChild(d);a.updateToolbox(c)}; -mutatorOpenListener$$module$build$src$core$procedures=function(a){if(a.type===BUBBLE_OPEN$$module$build$src$core$events$utils&&"mutator"===a.bubbleType&&a.isOpen&&a.blockId){a=getWorkspaceById$$module$build$src$core$common(a.workspaceId).getBlockById(a.blockId);var b=a.type;if("procedures_defnoreturn"===b||"procedures_defreturn"===b)a=a.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),updateMutatorFlyout$$module$build$src$core$procedures(a),a.addChangeListener(mutatorChangeListener$$module$build$src$core$procedures)}}; -mutatorChangeListener$$module$build$src$core$procedures=function(a){if(a.type===$.CREATE$$module$build$src$core$events$utils||a.type===$.DELETE$$module$build$src$core$events$utils||a.type===$.CHANGE$$module$build$src$core$events$utils||a.type===BLOCK_FIELD_INTERMEDIATE_CHANGE$$module$build$src$core$events$utils)a=getWorkspaceById$$module$build$src$core$common(a.workspaceId),updateMutatorFlyout$$module$build$src$core$procedures(a)}; +mutatorOpenListener$$module$build$src$core$procedures=function(a){if(isBubbleOpen$$module$build$src$core$events$predicates(a)&&"mutator"===a.bubbleType&&a.isOpen&&a.blockId){a=getWorkspaceById$$module$build$src$core$common(a.workspaceId).getBlockById(a.blockId);var b=a.type;if("procedures_defnoreturn"===b||"procedures_defreturn"===b)a=a.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE).getWorkspace(),updateMutatorFlyout$$module$build$src$core$procedures(a),a.addChangeListener(mutatorChangeListener$$module$build$src$core$procedures)}}; +mutatorChangeListener$$module$build$src$core$procedures=function(a){if(isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockDelete$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)||isBlockFieldIntermediateChange$$module$build$src$core$events$predicates(a))a=getWorkspaceById$$module$build$src$core$common(a.workspaceId),updateMutatorFlyout$$module$build$src$core$procedures(a)}; getCallers$$module$build$src$core$procedures=function(a,b){return b.getAllBlocks(!1).filter(c=>blockIsModernCallerFor$$module$build$src$core$procedures(c,a)||isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureCall(),a))}; blockIsModernCallerFor$$module$build$src$core$procedures=function(a,b){return isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(a)&&!a.isProcedureDef()&&a.getProcedureModel()&&$.Names$$module$build$src$core$names.equals(a.getProcedureModel().getName(),b)}; $.mutateCallers$$module$build$src$core$procedures=function(a){const b=getRecordUndo$$module$build$src$core$events$utils();var c=a.getProcedureDef()[0];const d=a.mutationToDom(!0);a=getCallers$$module$build$src$core$procedures(c,a.workspace);for(let f=0,g;g=a[f];f++){c=(c=g.mutationToDom())&&domToText$$module$build$src$core$utils$xml(c);g.domToMutation&&g.domToMutation(d);var e=g.mutationToDom();e=e&&domToText$$module$build$src$core$utils$xml(e);c!==e&&($.setRecordUndo$$module$build$src$core$events$utils(!1), -fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CHANGE$$module$build$src$core$events$utils))(g,"mutation",null,c,e)),$.setRecordUndo$$module$build$src$core$events$utils(b))}}; +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,"mutation",null,c,e)),$.setRecordUndo$$module$build$src$core$events$utils(b))}}; $.getDefinition$$module$build$src$core$procedures=function(a,b){for(const c of b.getAllBlocks(!1))if(isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)&&c.isProcedureDef()&&$.Names$$module$build$src$core$names.equals(c.getProcedureModel().getName(),a)||isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureDef()[0],a))return c;return null}; isDynamicShape$$module$build$src$core$renderers$common$constants=function(a){return a.isDynamic};isPuzzleTab$$module$build$src$core$renderers$common$constants=function(a){return void 0!==a.pathDown&&void 0!==a.pathUp};isNotch$$module$build$src$core$renderers$common$constants=function(a){return void 0!==a.pathLeft&&void 0!==a.pathRight}; connectReciprocally$$module$build$src$core$connection=function(a,b){if(!a||!b)throw Error("Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a};getSingleConnection$$module$build$src$core$connection=function(a,b){let c=null;b=b.outputConnection;const d=null==b?void 0:b.getConnectionChecker();for(let e=0,f;f=a.inputList[e];e++){const g=f.connection;let h;if(g&&(null==(h=d)?0:h.canConnect(b,g,!1))){if(c)return null;c=g}}return c}; @@ -379,9 +390,9 @@ moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster=function(a, f),g)||blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster(a,Coordinate$$module$build$src$core$utils$coordinate.sum(e,f),d);)c.RTL?f.translate(-d,2*d):f.translate(d,2*d);a.moveTo(Coordinate$$module$build$src$core$utils$coordinate.sum(b,f))};blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster=function(a,b){return b.some(c=>1>=Math.abs(c.x-a.x)&&1>=Math.abs(c.y-a.y))}; blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster=function(a,b,c){return a.getConnections_(!1).some(d=>!!d.closest(c,b).connection)}; bumpObjectIntoBounds$$module$build$src$core$bump_objects=function(a,b,c){const d=c.getBoundingRectangle(),e=d.right-d.left,f=clamp$$module$build$src$core$utils$math(b.top,d.top,b.top+b.height-(d.bottom-d.top))-d.top;let g=b.left;b=b.left+b.width-e;a.RTL?g=Math.min(b,g):b=Math.max(g,b);return(a=clamp$$module$build$src$core$utils$math(g,d.left,b)-d.left)||f?(c.moveBy(a,f,["inbounds"]),!0):!1}; -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$utils.includes(null!=(d=b.type)?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, -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 b.type===VIEWPORT_CHANGE$$module$build$src$core$events$utils&&b.scale&&b.oldScale&&b.scale>b.oldScale&&bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)}}}; -extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){let c=null;switch(b.type){case $.CREATE$$module$build$src$core$events$utils:case $.MOVE$$module$build$src$core$events$utils:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case COMMENT_CREATE$$module$build$src$core$events$utils:case COMMENT_MOVE$$module$build$src$core$events$utils:case COMMENT_RESIZE$$module$build$src$core$events$utils:c=a.getCommentById(b.commentId)}return c}; +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(null!=(d=b.type)?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, +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)}}}; +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}; 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)}};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return void 0!==a.isDeletable&&void 0!==a.dispose&&void 0!==a.setDeleteStyle}; copyInternal$$module$build$src$core$clipboard=function(a){const b=a.toCopyData();stashedCopyData$$module$build$src$core$clipboard=b;let c;stashedWorkspace$$module$build$src$core$clipboard=null!=(c=a.workspace)?c:null;return b}; paste$$module$build$src$core$clipboard=function(a,b,c){return a&&b?pasteFromData$$module$build$src$core$clipboard(a,b,c):stashedCopyData$$module$build$src$core$clipboard&&stashedWorkspace$$module$build$src$core$clipboard?pasteFromData$$module$build$src$core$clipboard(stashedCopyData$$module$build$src$core$clipboard,stashedWorkspace$$module$build$src$core$clipboard):null}; @@ -410,7 +421,7 @@ registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){regist 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};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=null==(e=c[d])?void 0:e.save(a);f&&(b[d]=f)}return b}; 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(); -b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(const [,f]of d.reverse()){let g;null==(g=f)||g.clear(b)}for(const [f,g]of d.reverse())if(a[f]){let h;null==(h=g)||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(FINISHED_LOADING$$module$build$src$core$events$utils))(b)); +b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(const [,f]of d.reverse()){let g;null==(g=f)||g.clear(b)}for(const [f,g]of d.reverse())if(a[f]){let h;null==(h=g)||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)); $.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}}; inject$$module$build$src$core$inject=function(a,b){let c=null;c="string"===typeof a?document.getElementById(a)||document.querySelector(a):a;var d;if(!document.contains(c)&&document!==(null==(d=c)?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");(null==b?0:b.rtl)&&addClass$$module$build$src$core$utils$dom(d,"blocklyRTL");d.tabIndex= 0;setState$$module$build$src$core$utils$aria(d,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL);c.appendChild(d);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)});return e}; @@ -494,30 +505,25 @@ Type$$module$build$src$core$registry.CONNECTION_PREVIEWER=new Type$$module$build 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"); Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsHorizontalToolbox");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");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");var module$build$src$core$registry={DEFAULT:DEFAULT$$module$build$src$core$registry,TEST_ONLY:TEST_ONLY$$module$build$src$core$registry};module$build$src$core$registry.Type=Type$$module$build$src$core$registry;module$build$src$core$registry.getAllItems=getAllItems$$module$build$src$core$registry;module$build$src$core$registry.getClass=getClass$$module$build$src$core$registry; -module$build$src$core$registry.getClassFromOptions=getClassFromOptions$$module$build$src$core$registry;module$build$src$core$registry.getObject=getObject$$module$build$src$core$registry;module$build$src$core$registry.hasItem=hasItem$$module$build$src$core$registry;module$build$src$core$registry.register=register$$module$build$src$core$registry;module$build$src$core$registry.unregister=unregister$$module$build$src$core$registry;var Blocks$$module$build$src$core$blocks=Object.create(null),module$build$src$core$blocks={Blocks:Blocks$$module$build$src$core$blocks};var soup$$module$build$src$core$utils$idgenerator="!#$()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",internal$$module$build$src$core$utils$idgenerator={genUid:()=>{const a=soup$$module$build$src$core$utils$idgenerator.length,b=[];for(let c=0;20>c;c++)b[c]=soup$$module$build$src$core$utils$idgenerator.charAt(Math.random()*a);return b.join("")}},TEST_ONLY$$module$build$src$core$utils$idgenerator=internal$$module$build$src$core$utils$idgenerator,nextId$$module$build$src$core$utils$idgenerator= -0,module$build$src$core$utils$idgenerator={TEST_ONLY:internal$$module$build$src$core$utils$idgenerator};module$build$src$core$utils$idgenerator.genUid=genUid$$module$build$src$core$utils$idgenerator;module$build$src$core$utils$idgenerator.getNextUniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator;var group$$module$build$src$core$events$utils,recordUndo$$module$build$src$core$events$utils,disabled$$module$build$src$core$events$utils,BLOCK_CREATE$$module$build$src$core$events$utils,BLOCK_DELETE$$module$build$src$core$events$utils,BLOCK_CHANGE$$module$build$src$core$events$utils,BLOCK_FIELD_INTERMEDIATE_CHANGE$$module$build$src$core$events$utils,BLOCK_MOVE$$module$build$src$core$events$utils,VAR_CREATE$$module$build$src$core$events$utils,VAR_DELETE$$module$build$src$core$events$utils,VAR_RENAME$$module$build$src$core$events$utils, -UI$$module$build$src$core$events$utils,BLOCK_DRAG$$module$build$src$core$events$utils,SELECTED$$module$build$src$core$events$utils,CLICK$$module$build$src$core$events$utils,MARKER_MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN$$module$build$src$core$events$utils,TRASHCAN_OPEN$$module$build$src$core$events$utils,TOOLBOX_ITEM_SELECT$$module$build$src$core$events$utils,THEME_CHANGE$$module$build$src$core$events$utils,VIEWPORT_CHANGE$$module$build$src$core$events$utils,COMMENT_CREATE$$module$build$src$core$events$utils, -COMMENT_DELETE$$module$build$src$core$events$utils,COMMENT_CHANGE$$module$build$src$core$events$utils,COMMENT_MOVE$$module$build$src$core$events$utils,COMMENT_RESIZE$$module$build$src$core$events$utils,COMMENT_DRAG$$module$build$src$core$events$utils,COMMENT_COLLAPSE$$module$build$src$core$events$utils,FINISHED_LOADING$$module$build$src$core$events$utils,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils,BUMP_EVENTS$$module$build$src$core$events$utils,FIRE_QUEUE$$module$build$src$core$events$utils, -TEST_ONLY$$module$build$src$core$events$utils,module$build$src$core$events$utils;group$$module$build$src$core$events$utils="";recordUndo$$module$build$src$core$events$utils=!0;disabled$$module$build$src$core$events$utils=0;$.CREATE$$module$build$src$core$events$utils="create";BLOCK_CREATE$$module$build$src$core$events$utils=$.CREATE$$module$build$src$core$events$utils;$.DELETE$$module$build$src$core$events$utils="delete";BLOCK_DELETE$$module$build$src$core$events$utils=$.DELETE$$module$build$src$core$events$utils; -$.CHANGE$$module$build$src$core$events$utils="change";BLOCK_CHANGE$$module$build$src$core$events$utils=$.CHANGE$$module$build$src$core$events$utils;BLOCK_FIELD_INTERMEDIATE_CHANGE$$module$build$src$core$events$utils="block_field_intermediate_change";$.MOVE$$module$build$src$core$events$utils="move";BLOCK_MOVE$$module$build$src$core$events$utils=$.MOVE$$module$build$src$core$events$utils;VAR_CREATE$$module$build$src$core$events$utils="var_create";VAR_DELETE$$module$build$src$core$events$utils="var_delete"; -VAR_RENAME$$module$build$src$core$events$utils="var_rename";UI$$module$build$src$core$events$utils="ui";BLOCK_DRAG$$module$build$src$core$events$utils="drag";SELECTED$$module$build$src$core$events$utils="selected";CLICK$$module$build$src$core$events$utils="click";MARKER_MOVE$$module$build$src$core$events$utils="marker_move";BUBBLE_OPEN$$module$build$src$core$events$utils="bubble_open";TRASHCAN_OPEN$$module$build$src$core$events$utils="trashcan_open"; -TOOLBOX_ITEM_SELECT$$module$build$src$core$events$utils="toolbox_item_select";THEME_CHANGE$$module$build$src$core$events$utils="theme_change";VIEWPORT_CHANGE$$module$build$src$core$events$utils="viewport_change";COMMENT_CREATE$$module$build$src$core$events$utils="comment_create";COMMENT_DELETE$$module$build$src$core$events$utils="comment_delete";COMMENT_CHANGE$$module$build$src$core$events$utils="comment_change";COMMENT_MOVE$$module$build$src$core$events$utils="comment_move"; -COMMENT_RESIZE$$module$build$src$core$events$utils="comment_resize";COMMENT_DRAG$$module$build$src$core$events$utils="comment_drag";COMMENT_COLLAPSE$$module$build$src$core$events$utils="comment_collapse";FINISHED_LOADING$$module$build$src$core$events$utils="finished_loading";ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils="ORPHANED_BLOCK"; -BUMP_EVENTS$$module$build$src$core$events$utils=[$.CREATE$$module$build$src$core$events$utils,$.MOVE$$module$build$src$core$events$utils,COMMENT_CREATE$$module$build$src$core$events$utils,COMMENT_MOVE$$module$build$src$core$events$utils];FIRE_QUEUE$$module$build$src$core$events$utils=[]; -TEST_ONLY$$module$build$src$core$events$utils={FIRE_QUEUE:FIRE_QUEUE$$module$build$src$core$events$utils,fireNow:fireNow$$module$build$src$core$events$utils,fireInternal:fireInternal$$module$build$src$core$events$utils,setGroupInternal:setGroupInternal$$module$build$src$core$events$utils}; -module$build$src$core$events$utils={BLOCK_CHANGE:$.CHANGE$$module$build$src$core$events$utils,BLOCK_CREATE:$.CREATE$$module$build$src$core$events$utils,BLOCK_DELETE:$.DELETE$$module$build$src$core$events$utils,BLOCK_DRAG:BLOCK_DRAG$$module$build$src$core$events$utils,BLOCK_FIELD_INTERMEDIATE_CHANGE:BLOCK_FIELD_INTERMEDIATE_CHANGE$$module$build$src$core$events$utils,BLOCK_MOVE:$.MOVE$$module$build$src$core$events$utils,BUBBLE_OPEN:BUBBLE_OPEN$$module$build$src$core$events$utils,BUMP_EVENTS:BUMP_EVENTS$$module$build$src$core$events$utils, -CHANGE:$.CHANGE$$module$build$src$core$events$utils,CLICK:CLICK$$module$build$src$core$events$utils,COMMENT_CHANGE:COMMENT_CHANGE$$module$build$src$core$events$utils,COMMENT_COLLAPSE:COMMENT_COLLAPSE$$module$build$src$core$events$utils,COMMENT_CREATE:COMMENT_CREATE$$module$build$src$core$events$utils,COMMENT_DELETE:COMMENT_DELETE$$module$build$src$core$events$utils,COMMENT_DRAG:COMMENT_DRAG$$module$build$src$core$events$utils,COMMENT_MOVE:COMMENT_MOVE$$module$build$src$core$events$utils,COMMENT_RESIZE:COMMENT_RESIZE$$module$build$src$core$events$utils, -CREATE:$.CREATE$$module$build$src$core$events$utils,DELETE:$.DELETE$$module$build$src$core$events$utils,FINISHED_LOADING:FINISHED_LOADING$$module$build$src$core$events$utils,MARKER_MOVE:MARKER_MOVE$$module$build$src$core$events$utils,MOVE:$.MOVE$$module$build$src$core$events$utils,SELECTED:SELECTED$$module$build$src$core$events$utils,TEST_ONLY:TEST_ONLY$$module$build$src$core$events$utils,THEME_CHANGE:THEME_CHANGE$$module$build$src$core$events$utils,TOOLBOX_ITEM_SELECT:TOOLBOX_ITEM_SELECT$$module$build$src$core$events$utils, -TRASHCAN_OPEN:TRASHCAN_OPEN$$module$build$src$core$events$utils,UI:UI$$module$build$src$core$events$utils,VAR_CREATE:VAR_CREATE$$module$build$src$core$events$utils,VAR_DELETE:VAR_DELETE$$module$build$src$core$events$utils,VAR_RENAME:VAR_RENAME$$module$build$src$core$events$utils,VIEWPORT_CHANGE:VIEWPORT_CHANGE$$module$build$src$core$events$utils};module$build$src$core$events$utils.clearPendingUndo=clearPendingUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.disable=$.disable$$module$build$src$core$events$utils; -module$build$src$core$events$utils.disableOrphans=disableOrphans$$module$build$src$core$events$utils;module$build$src$core$events$utils.enable=$.enable$$module$build$src$core$events$utils;module$build$src$core$events$utils.filter=filter$$module$build$src$core$events$utils;module$build$src$core$events$utils.fire=fire$$module$build$src$core$events$utils;module$build$src$core$events$utils.fromJson=fromJson$$module$build$src$core$events$utils;module$build$src$core$events$utils.get=get$$module$build$src$core$events$utils; -module$build$src$core$events$utils.getDescendantIds=getDescendantIds$$module$build$src$core$events$utils;module$build$src$core$events$utils.getGroup=$.getGroup$$module$build$src$core$events$utils;module$build$src$core$events$utils.getRecordUndo=getRecordUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$utils.setGroup=$.setGroup$$module$build$src$core$events$utils; -module$build$src$core$events$utils.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,selected$$module$build$src$core$common=null,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common}; +module$build$src$core$registry.getClassFromOptions=getClassFromOptions$$module$build$src$core$registry;module$build$src$core$registry.getObject=getObject$$module$build$src$core$registry;module$build$src$core$registry.hasItem=hasItem$$module$build$src$core$registry;module$build$src$core$registry.register=register$$module$build$src$core$registry;module$build$src$core$registry.unregister=unregister$$module$build$src$core$registry;var Blocks$$module$build$src$core$blocks=Object.create(null),module$build$src$core$blocks={Blocks:Blocks$$module$build$src$core$blocks};var EventType$$module$build$src$core$events$type; +(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.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="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={})); +var BUMP_EVENTS$$module$build$src$core$events$type=[EventType$$module$build$src$core$events$type.BLOCK_CREATE,EventType$$module$build$src$core$events$type.BLOCK_MOVE,EventType$$module$build$src$core$events$type.COMMENT_CREATE,EventType$$module$build$src$core$events$type.COMMENT_MOVE],module$build$src$core$events$type={BUMP_EVENTS:BUMP_EVENTS$$module$build$src$core$events$type};module$build$src$core$events$type.EventType=EventType$$module$build$src$core$events$type;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 soup$$module$build$src$core$utils$idgenerator="!#$()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",internal$$module$build$src$core$utils$idgenerator={genUid:()=>{const a=soup$$module$build$src$core$utils$idgenerator.length,b=[];for(let c=0;20>c;c++)b[c]=soup$$module$build$src$core$utils$idgenerator.charAt(Math.random()*a);return b.join("")}},TEST_ONLY$$module$build$src$core$utils$idgenerator=internal$$module$build$src$core$utils$idgenerator,nextId$$module$build$src$core$utils$idgenerator= +0,module$build$src$core$utils$idgenerator={TEST_ONLY:internal$$module$build$src$core$utils$idgenerator};module$build$src$core$utils$idgenerator.genUid=genUid$$module$build$src$core$utils$idgenerator;module$build$src$core$utils$idgenerator.getNextUniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator;var module$build$src$core$events$predicates={};module$build$src$core$events$predicates.isBlockChange=isBlockChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockCreate=isBlockCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockDelete=isBlockDelete$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockDrag=isBlockDrag$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isBlockFieldIntermediateChange=isBlockFieldIntermediateChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockMove=isBlockMove$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBubbleOpen=isBubbleOpen$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isClick=isClick$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isCommentChange=isCommentChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentCollapse=isCommentCollapse$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentCreate=isCommentCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentDelete=isCommentDelete$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isCommentDrag=isCommentDrag$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentMove=isCommentMove$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentResize=isCommentResize$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isFinishedLoading=isFinishedLoading$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isMarkerMove=isMarkerMove$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isSelected=isSelected$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isThemeChange=isThemeChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isToolboxItemSelect=isToolboxItemSelect$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isTrashcanOpen=isTrashcanOpen$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isVarCreate=isVarCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isVarDelete=isVarDelete$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isVarRename=isVarRename$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isViewportChange=isViewportChange$$module$build$src$core$events$predicates;var group$$module$build$src$core$events$utils="",recordUndo$$module$build$src$core$events$utils=!0,disabled$$module$build$src$core$events$utils=0,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils="ORPHANED_BLOCK",FIRE_QUEUE$$module$build$src$core$events$utils=[],TEST_ONLY$$module$build$src$core$events$utils={FIRE_QUEUE:FIRE_QUEUE$$module$build$src$core$events$utils,enqueueEvent:enqueueEvent$$module$build$src$core$events$utils,fireNow:fireNow$$module$build$src$core$events$utils,fireInternal:fireInternal$$module$build$src$core$events$utils, +setGroupInternal:setGroupInternal$$module$build$src$core$events$utils},module$build$src$core$events$utils={TEST_ONLY:TEST_ONLY$$module$build$src$core$events$utils};module$build$src$core$events$utils.clearPendingUndo=clearPendingUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.disable=$.disable$$module$build$src$core$events$utils;module$build$src$core$events$utils.disableOrphans=disableOrphans$$module$build$src$core$events$utils; +module$build$src$core$events$utils.enable=$.enable$$module$build$src$core$events$utils;module$build$src$core$events$utils.filter=filter$$module$build$src$core$events$utils;module$build$src$core$events$utils.fire=fire$$module$build$src$core$events$utils;module$build$src$core$events$utils.fromJson=fromJson$$module$build$src$core$events$utils;module$build$src$core$events$utils.get=get$$module$build$src$core$events$utils;module$build$src$core$events$utils.getDescendantIds=getDescendantIds$$module$build$src$core$events$utils; +module$build$src$core$events$utils.getGroup=$.getGroup$$module$build$src$core$events$utils;module$build$src$core$events$utils.getRecordUndo=getRecordUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$utils.setGroup=$.setGroup$$module$build$src$core$events$utils;module$build$src$core$events$utils.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,selected$$module$build$src$core$common=null,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common}; module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$common;module$build$src$core$common.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$common.draggingConnections=draggingConnections$$module$build$src$core$common;module$build$src$core$common.getAllWorkspaces=getAllWorkspaces$$module$build$src$core$common; module$build$src$core$common.getBlockTypeCounts=getBlockTypeCounts$$module$build$src$core$common;module$build$src$core$common.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$common.getParentContainer=getParentContainer$$module$build$src$core$common;module$build$src$core$common.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$common.getWorkspaceById=getWorkspaceById$$module$build$src$core$common; module$build$src$core$common.registerWorkspace=registerWorkspace$$module$build$src$core$common;module$build$src$core$common.setMainWorkspace=setMainWorkspace$$module$build$src$core$common;module$build$src$core$common.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$common.setSelected=$.setSelected$$module$build$src$core$common;module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){let a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId)); -if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a}},module$build$src$core$events$events_abstract={};module$build$src$core$events$events_abstract.Abstract=Abstract$$module$build$src$core$events$events_abstract;var UiBase$$module$build$src$core$events$events_ui_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.recordUndo=!1;this.isUiEvent=!0;this.isBlank="undefined"===typeof a;this.workspaceId=a?a:""}},module$build$src$core$events$events_ui_base={};module$build$src$core$events$events_ui_base.UiBase=UiBase$$module$build$src$core$events$events_ui_base;var Click$$module$build$src$core$events$events_click=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){b=a?a.workspace.id:b;null===b&&(b=void 0);super(b);this.type=CLICK$$module$build$src$core$events$utils;this.blockId=a?a.id:void 0;this.targetType=c}toJson(){const a=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");a.targetType=this.targetType;a.blockId=this.blockId;return a}static fromJson(a, -b,c){b=super.fromJson(a,b,null!=c?c:new Click$$module$build$src$core$events$events_click);b.targetType=a.targetType;b.blockId=a.blockId;return b}},ClickTarget$$module$build$src$core$events$events_click;(function(a){a.BLOCK="block";a.WORKSPACE="workspace";a.ZOOM_CONTROLS="zoom_controls"})(ClickTarget$$module$build$src$core$events$events_click||(ClickTarget$$module$build$src$core$events$events_click={})); -register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,CLICK$$module$build$src$core$events$utils,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var LONGPRESS$$module$build$src$core$touch=750,TOUCH_ENABLED$$module$build$src$core$touch="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),touchIdentifier_$$module$build$src$core$touch=null,TOUCH_MAP$$module$build$src$core$touch={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"], +if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a}},module$build$src$core$events$events_abstract={};module$build$src$core$events$events_abstract.Abstract=Abstract$$module$build$src$core$events$events_abstract;var UiBase$$module$build$src$core$events$events_ui_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.recordUndo=!1;this.isUiEvent=!0;this.isBlank="undefined"===typeof a;this.workspaceId=a?a:""}},module$build$src$core$events$events_ui_base={};module$build$src$core$events$events_ui_base.UiBase=UiBase$$module$build$src$core$events$events_ui_base;var Click$$module$build$src$core$events$events_click=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){b=a?a.workspace.id:b;null===b&&(b=void 0);super(b);this.type=EventType$$module$build$src$core$events$type.CLICK;this.blockId=a?a.id:void 0;this.targetType=c}toJson(){const a=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");a.targetType=this.targetType;a.blockId=this.blockId; +return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new Click$$module$build$src$core$events$events_click);b.targetType=a.targetType;b.blockId=a.blockId;return b}},ClickTarget$$module$build$src$core$events$events_click;(function(a){a.BLOCK="block";a.WORKSPACE="workspace";a.ZOOM_CONTROLS="zoom_controls"})(ClickTarget$$module$build$src$core$events$events_click||(ClickTarget$$module$build$src$core$events$events_click={})); +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.CLICK,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var LONGPRESS$$module$build$src$core$touch=750,TOUCH_ENABLED$$module$build$src$core$touch="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),touchIdentifier_$$module$build$src$core$touch=null,TOUCH_MAP$$module$build$src$core$touch={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"], mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},longPid_$$module$build$src$core$touch=0,module$build$src$core$touch={TOUCH_ENABLED:TOUCH_ENABLED$$module$build$src$core$touch,TOUCH_MAP:TOUCH_MAP$$module$build$src$core$touch};module$build$src$core$touch.checkTouchIdentifier=checkTouchIdentifier$$module$build$src$core$touch;module$build$src$core$touch.clearTouchIdentifier=clearTouchIdentifier$$module$build$src$core$touch; module$build$src$core$touch.getTouchIdentifierFromEvent=getTouchIdentifierFromEvent$$module$build$src$core$touch;module$build$src$core$touch.longStart=longStart$$module$build$src$core$touch;module$build$src$core$touch.longStop=longStop$$module$build$src$core$touch;module$build$src$core$touch.shouldHandleEvent=shouldHandleEvent$$module$build$src$core$touch;var rawUserAgent$$module$build$src$core$utils$useragent,isJavaFx$$module$build$src$core$utils$useragent,isWebKit$$module$build$src$core$utils$useragent,isGecko$$module$build$src$core$utils$useragent,isAndroid$$module$build$src$core$utils$useragent,isIPad$$module$build$src$core$utils$useragent,isIPhone$$module$build$src$core$utils$useragent,isMac$$module$build$src$core$utils$useragent,isTablet$$module$build$src$core$utils$useragent,isMobile$$module$build$src$core$utils$useragent; (function(a){function b(d){return c.includes(d.toUpperCase())}rawUserAgent$$module$build$src$core$utils$useragent=a;const c=rawUserAgent$$module$build$src$core$utils$useragent.toUpperCase();isJavaFx$$module$build$src$core$utils$useragent=b("JavaFX");isWebKit$$module$build$src$core$utils$useragent=b("WebKit");isGecko$$module$build$src$core$utils$useragent=b("Gecko")&&!isWebKit$$module$build$src$core$utils$useragent;isAndroid$$module$build$src$core$utils$useragent=b("Android");a=globalThis.navigator&& @@ -532,7 +538,9 @@ var ComponentManager$$module$build$src$core$component_manager=class{constructor( null==(f=this.capabilityToComponentIds.get(e))||f.push(c)}else this.capabilityToComponentIds.set(e,[c])}this.componentData.get(c).capabilities=b}removeComponent(a){const b=this.componentData.get(a);if(b){for(let c=0;c -{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;var module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$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}\n\n.blocklyNonSelectable {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\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: 10000;\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.blocklyFocused {\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 overflow: auto;\n overflow-x: hidden;\n position: relative;\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}\n\n.blocklyDropDownButton {\n display: inline-block;\n float: left;\n padding: 0;\n margin: 4px;\n border-radius: 4px;\n outline: none;\n border: 1px solid;\n transition: box-shadow .1s;\n cursor: pointer;\n}\n\n.blocklyArrowTop {\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyArrowBottom {\n border-bottom: 1px solid;\n border-right: 1px solid;\n border-bottom-right-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyResizeSE {\n cursor: se-resize;\n fill: #aaa;\n}\n\n.blocklyResizeSW {\n cursor: sw-resize;\n fill: #aaa;\n}\n\n.blocklyResizeLine {\n stroke: #515A5A;\n stroke-width: 1;\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 pointer-events: auto;\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 cursor: url("<<>>/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.blocklyDisabled>.blocklyPath {\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.blocklyMultilineText {\n font-family: monospace;\n}\n\n.blocklyNonEditableText>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.blocklyHidden {\n display: none;\n}\n\n.blocklyFieldDropdown:not(.blocklyHidden) {\n display: block;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover),\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 background-color: #fef49c !important;\n min-width: unset;\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 background-color: #fff;\n color: #000;\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.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}\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 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.blocklyFocused {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\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 position: relative; /* Compatibility with gapi, reset from goog-menu */\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.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\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', +{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; +(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={})); +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}\n\n.blocklyNonSelectable {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\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: 10000;\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.blocklyFocused {\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 overflow: auto;\n overflow-x: hidden;\n position: relative;\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}\n\n.blocklyDropDownButton {\n display: inline-block;\n float: left;\n padding: 0;\n margin: 4px;\n border-radius: 4px;\n outline: none;\n border: 1px solid;\n transition: box-shadow .1s;\n cursor: pointer;\n}\n\n.blocklyArrowTop {\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyArrowBottom {\n border-bottom: 1px solid;\n border-right: 1px solid;\n border-bottom-right-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyResizeSE {\n cursor: se-resize;\n fill: #aaa;\n}\n\n.blocklyResizeSW {\n cursor: sw-resize;\n fill: #aaa;\n}\n\n.blocklyResizeLine {\n stroke: #515A5A;\n stroke-width: 1;\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 pointer-events: auto;\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 cursor: url("<<>>/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.blocklyDisabled>.blocklyPath {\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.blocklyMultilineText {\n font-family: monospace;\n}\n\n.blocklyNonEditableText>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.blocklyHidden {\n display: none;\n}\n\n.blocklyFieldDropdown:not(.blocklyHidden) {\n display: block;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover),\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 background-color: #fef49c !important;\n min-width: unset;\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 background-color: #fff;\n color: #000;\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.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}\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 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.blocklyFocused {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\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 position: relative; /* Compatibility with gapi, reset from goog-menu */\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.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\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', 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- 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_NS$$module$build$src$core$utils$dom="http://www.w3.org/2000/svg",HTML_NS$$module$build$src$core$utils$dom="http://www.w3.org/1999/xhtml",XLINK_NS$$module$build$src$core$utils$dom="http://www.w3.org/1999/xlink",NodeType$$module$build$src$core$utils$dom;(function(a){a[a.ELEMENT_NODE=1]="ELEMENT_NODE";a[a.TEXT_NODE=3]="TEXT_NODE";a[a.COMMENT_NODE=8]="COMMENT_NODE"})(NodeType$$module$build$src$core$utils$dom||(NodeType$$module$build$src$core$utils$dom={})); var cacheWidths$$module$build$src$core$utils$dom=null,cacheReference$$module$build$src$core$utils$dom=0,canvasContext$$module$build$src$core$utils$dom=null,module$build$src$core$utils$dom={HTML_NS:HTML_NS$$module$build$src$core$utils$dom};module$build$src$core$utils$dom.NodeType=NodeType$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.SVG_NS=SVG_NS$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.XLINK_NS=XLINK_NS$$module$build$src$core$utils$dom; @@ -542,7 +550,8 @@ module$build$src$core$utils$dom.setCssTransform=setCssTransform$$module$build$sr 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"); Svg$$module$build$src$core$utils$svg.FEPOINTLIGHT=new Svg$$module$build$src$core$utils$svg("fePointLight");Svg$$module$build$src$core$utils$svg.FESPECULARLIGHTING=new Svg$$module$build$src$core$utils$svg("feSpecularLighting");Svg$$module$build$src$core$utils$svg.FILTER=new Svg$$module$build$src$core$utils$svg("filter");Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT=new Svg$$module$build$src$core$utils$svg("foreignObject");Svg$$module$build$src$core$utils$svg.G=new Svg$$module$build$src$core$utils$svg("g"); Svg$$module$build$src$core$utils$svg.IMAGE=new Svg$$module$build$src$core$utils$svg("image");Svg$$module$build$src$core$utils$svg.LINE=new Svg$$module$build$src$core$utils$svg("line");Svg$$module$build$src$core$utils$svg.PATH=new Svg$$module$build$src$core$utils$svg("path");Svg$$module$build$src$core$utils$svg.PATTERN=new Svg$$module$build$src$core$utils$svg("pattern");Svg$$module$build$src$core$utils$svg.POLYGON=new Svg$$module$build$src$core$utils$svg("polygon"); -Svg$$module$build$src$core$utils$svg.RECT=new Svg$$module$build$src$core$utils$svg("rect");Svg$$module$build$src$core$utils$svg.SVG=new Svg$$module$build$src$core$utils$svg("svg");Svg$$module$build$src$core$utils$svg.TEXT=new Svg$$module$build$src$core$utils$svg("text");Svg$$module$build$src$core$utils$svg.TSPAN=new Svg$$module$build$src$core$utils$svg("tspan");var module$build$src$core$utils$svg={};module$build$src$core$utils$svg.Svg=Svg$$module$build$src$core$utils$svg;var Rect$$module$build$src$core$utils$rect=class{constructor(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(a,b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom}intersects(a){return!(this.left>a.right||this.righta.bottom||this.bottom=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom}intersects(a){return this.left<=a.right&&this.right>=a.left&&this.bottom>=a.top&&this.top<=a.bottom}static equals(a,b){return a=== +b?!0:a&&b?a.top===b.top&&a.bottom===b.bottom&&a.left===b.left&&a.right===b.right:!1}static createFromPoint(a,b,c){const d=a.x;a=a.y;return new Rect$$module$build$src$core$utils$rect(a,a+c,d,d+b)}},module$build$src$core$utils$rect={};module$build$src$core$utils$rect.Rect=Rect$$module$build$src$core$utils$rect;var Size$$module$build$src$core$utils$size=class{constructor(a,b){this.width=a;this.height=b}static equals(a,b){return a===b?!0:a&&b?a.width===b.width&&a.height===b.height:!1}static max(a,b){return new Size$$module$build$src$core$utils$size(Math.max(a.width,b.width),Math.max(a.height,b.height))}static min(a,b){return new Size$$module$build$src$core$utils$size(Math.min(a.width,b.width),Math.min(a.height,b.height))}},module$build$src$core$utils$size={};module$build$src$core$utils$size.Size=Size$$module$build$src$core$utils$size;var TEST_ONLY$$module$build$src$core$utils$style={getSizeInternal:getSizeInternal$$module$build$src$core$utils$style},module$build$src$core$utils$style={TEST_ONLY:TEST_ONLY$$module$build$src$core$utils$style};module$build$src$core$utils$style.getBorderBox=getBorderBox$$module$build$src$core$utils$style;module$build$src$core$utils$style.getComputedStyle=getComputedStyle$$module$build$src$core$utils$style;module$build$src$core$utils$style.getContainerOffsetToScrollInto=getContainerOffsetToScrollInto$$module$build$src$core$utils$style; module$build$src$core$utils$style.getPageOffset=getPageOffset$$module$build$src$core$utils$style;module$build$src$core$utils$style.getSize=getSize$$module$build$src$core$utils$style;module$build$src$core$utils$style.getViewportPageOffset=getViewportPageOffset$$module$build$src$core$utils$style;module$build$src$core$utils$style.scrollIntoContainerView=scrollIntoContainerView$$module$build$src$core$utils$style;var XY_REGEX$$module$build$src$core$utils$svg_math=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,XY_STYLE_REGEX$$module$build$src$core$utils$svg_math=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,TEST_ONLY$$module$build$src$core$utils$svg_math={XY_REGEX:XY_REGEX$$module$build$src$core$utils$svg_math,XY_STYLE_REGEX:XY_STYLE_REGEX$$module$build$src$core$utils$svg_math},module$build$src$core$utils$svg_math={TEST_ONLY:TEST_ONLY$$module$build$src$core$utils$svg_math}; module$build$src$core$utils$svg_math.getDocumentScroll=getDocumentScroll$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getInjectionDivXY=getInjectionDivXY$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getRelativeXY=getRelativeXY$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getViewportBBox=getViewportBBox$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.screenToWsCoordinates=screenToWsCoordinates$$module$build$src$core$utils$svg_math; module$build$src$core$utils$svg_math.wsToScreenCoordinates=wsToScreenCoordinates$$module$build$src$core$utils$svg_math;var Scrollbar$$module$build$src$core$scrollbar=class{constructor(a,b,c,d,e){this.workspace=a;this.horizontal=b;this.oldHostMetrics=null;this.ratio=1;this.origin=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0;this.containerVisible=this.isHandleVisible=!0;this.position=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null;this.pair= @@ -571,60 +580,22 @@ var TEST_ONLY$$module$build$src$core$utils$toolbox={hasCategoriesInternal:hasCat 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={})); 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; 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.png"},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); -this.createZoomOutSvg(a);this.createZoomInSvg(a);this.workspace.isMovable()&&this.createZoomResetSvg(a);return this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:2,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls");this.svgGroup&&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,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:bumpDirection$$module$build$src$core$positionable_helpers.UP,b);if(c===verticalPosition$$module$build$src$core$positionable_helpers.TOP){var e=this.SMALL_SPACING+ -this.HEIGHT,f;null==(f=this.zoomInGroup)||f.setAttribute("transform","translate(0, "+e+")");this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(e+this.LARGE_SPACING+this.HEIGHT)+")")}else{f=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let h;null==(h=this.zoomInGroup)||h.setAttribute("transform","translate(0, "+f+")");f=f+this.SMALL_SPACING+this.HEIGHT;null==(e=this.zoomOutGroup)||e.setAttribute("transform","translate(0, "+f+")")}this.top=b.top;this.left=b.left; -var g;null==(g=this.svgGroup)||g.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(a){this.zoomOutGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomOut"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomoutClipPath"+a},this.zoomOutGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, -{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+a+")"},this.zoomOutGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomOutGroup, -"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(a){this.zoomInGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomIn"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoominClipPath"+a},this.zoomInGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE, -{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+a+")"},this.zoomInGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(a,b){this.workspace.markFocused(); -this.workspace.zoomCenter(a);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();b.stopPropagation();b.preventDefault()}createZoomResetSvg(a){this.zoomResetGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomReset"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+a},this.zoomResetGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, -{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+a+")"},this.zoomResetGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomResetGroup, -"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(a){this.workspace.markFocused();const b=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed);this.workspace.beginCanvasTransition();this.workspace.zoomCenter(b);this.workspace.scrollCenter();setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();a.stopPropagation();a.preventDefault()}fireZoomEvent(){const a= -new (get$$module$build$src$core$events$utils(CLICK$$module$build$src$core$events$utils))(null,this.workspace.id,"zoom_controls");fire$$module$build$src$core$events$utils(a)}};register$$module$build$src$core$css("\n.blocklyZoom>image, .blocklyZoom>svg>image {\n opacity: .4;\n}\n\n.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {\n opacity: .6;\n}\n\n.blocklyZoom>image:active, .blocklyZoom>svg>image:active {\n opacity: .8;\n}\n");var module$build$src$core$zoom_controls={}; -module$build$src$core$zoom_controls.ZoomControls=ZoomControls$$module$build$src$core$zoom_controls;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};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"); -var module$build$src$core$icons$icon_types={};module$build$src$core$icons$icon_types.IconType=IconType$$module$build$src$core$icons$icon_types;(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 alertImplementation$$module$build$src$core$dialog=function(a,b){window.alert(a);b&&b()},confirmImplementation$$module$build$src$core$dialog=function(a,b){b(window.confirm(a))},promptImplementation$$module$build$src$core$dialog=function(a,b,c){c(window.prompt(a,b))},TEST_ONLY$$module$build$src$core$dialog={confirmInternal:confirmInternal$$module$build$src$core$dialog},module$build$src$core$dialog={TEST_ONLY:TEST_ONLY$$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;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;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 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 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 VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank="undefined"===typeof a;a&&(this.varId=a.getId(),this.workspaceId=a.workspace.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=super.fromJson(a,b,null!=c?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=VAR_CREATE$$module$build$src$core$events$utils;a&&(this.varType=a.type,this.varName=a.name)}toJson(){const a=super.toJson();if(void 0===this.varType)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"); -a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){const 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");a?b.createVariable(this.varName, -this.varType,this.varId):b.deleteVariableById(this.varId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,VAR_CREATE$$module$build$src$core$events$utils,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_}static compareByName(a,b){return a.name.localeCompare(b.name,void 0,{sensitivity:"base"})}},module$build$src$core$variable_model={};module$build$src$core$variable_model.VariableModel=VariableModel$$module$build$src$core$variable_model;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}; -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.createVariableButtonHandler=createVariableButtonHandler$$module$build$src$core$variables;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;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.nameUsedWithAnyType=nameUsedWithAnyType$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithConflictingParam=nameUsedWithConflictingParam$$module$build$src$core$variables;module$build$src$core$variables.promptName=promptName$$module$build$src$core$variables; -module$build$src$core$variables.renameVariable=$.renameVariable$$module$build$src$core$variables;var 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; -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 WorkspaceComment$$module$build$src$core$comments$workspace_comment=class{constructor(a,b){this.workspace=a;this.text="";this.size=new Size$$module$build$src$core$utils$size(120,100);this.collapsed=!1;this.deletable=this.movable=this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.disposing=this.disposed=!1;this.id=b&&!a.getCommentById(b)?b:genUid$$module$build$src$core$utils$idgenerator();a.addTopComment(this);this.fireCreateEvent()}fireCreateEvent(){isEnabled$$module$build$src$core$events$utils()&& -fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(COMMENT_CREATE$$module$build$src$core$events$utils))(this))}fireDeleteEvent(){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(COMMENT_DELETE$$module$build$src$core$events$utils))(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(COMMENT_CHANGE$$module$build$src$core$events$utils))(this, -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(COMMENT_COLLAPSE$$module$build$src$core$events$utils))(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(COMMENT_RESIZE$$module$build$src$core$events$utils))(this);this.size=a;b.recordCurrentSizeAsNewSize();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.options.readOnly}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.options.readOnly}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&&!this.workspace.options.readOnly}isOwnDeletable(){return this.deletable}moveTo(a, -b){const c=new (get$$module$build$src$core$events$utils(COMMENT_MOVE$$module$build$src$core$events$utils))(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||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 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 CommentView$$module$build$src$core$comments$comment_view=class{constructor(a){this.workspace=a;this.size=new Size$$module$build$src$core$utils$size(120,100);this.collapsed=!1;this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.text="";this.textChangeListeners=[];this.sizeChangeListeners=[];this.disposeListeners=[];this.collapseChangeListeners=[];this.resizePointerMoveListener=this.resizePointerUpListener=null;this.disposed=this.disposing=!1;this.svgRoot= -createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyComment blocklyEditable blocklyDraggable"});this.highlightRect=this.createHighlightRect(this.svgRoot);({topBarGroup:this.topBarGroup,topBarBackground:this.topBarBackground,deleteIcon:this.deleteIcon,foldoutIcon:this.foldoutIcon,textPreview:this.textPreview,textPreviewNode:this.textPreviewNode}=this.createTopBar(this.svgRoot,a));({foreignObject:this.foreignObject,textArea:this.textArea}=this.createTextArea(this.svgRoot)); -this.resizeHandle=this.createResizeHandle(this.svgRoot,a);let b;null==(b=a.getLayerManager())||b.append(this,BLOCK$$module$build$src$core$layers);this.setSizeWithoutFiringEvents(this.size);this.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(0,0))}createHighlightRect(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentHighlight"},a)}createTopBar(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G, -{"class":"blocklyCommentTopbar"},a);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentTopbarBackground"},a),d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyDeleteIcon",href:`${b.options.pathToMedia}delete-icon.svg`},a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyFoldoutIcon",href:`${b.options.pathToMedia}foldout-icon.svg`}, -a);const e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyCommentPreview blocklyCommentText blocklyText"},a),f=document.createTextNode("");e.appendChild(f);conditionalBind$$module$build$src$core$browser_events(b,"pointerdown",this,this.onFoldoutDown);conditionalBind$$module$build$src$core$browser_events(d,"pointerdown",this,this.onDeleteDown);return{topBarGroup:a,topBarBackground:c,deleteIcon:d,foldoutIcon:b,textPreview:e,textPreviewNode:f}}createTextArea(a){a= -createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{"class":"blocklyCommentForeignObject"},a);const b=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");b.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);b.className="blocklyMinimalBody mixly-scrollbar";const c=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");addClass$$module$build$src$core$utils$dom(c,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(c, -"blocklyTextarea");addClass$$module$build$src$core$utils$dom(c,"blocklyText");b.appendChild(c);a.appendChild(b);conditionalBind$$module$build$src$core$browser_events(c,"change",this,this.onTextChange);return{foreignObject:a,textArea:c}}createResizeHandle(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown", -this,this.onResizePointerDown);return a}getSvgRoot(){return this.svgRoot}getSize(){return this.collapsed?this.topBarBackground.getBBox():this.size}setSizeWithoutFiringEvents(a){const b=this.topBarBackground.getBBox(),c=this.deleteIcon.getBBox(),d=this.foldoutIcon.getBBox(),e=this.textPreview.getBBox(),f=this.resizeHandle.getBBox();this.size=a=Size$$module$build$src$core$utils$size.max(a,this.calcMinSize(b,d,c));this.svgRoot.setAttribute("height",`${a.height}`);this.svgRoot.setAttribute("width",`${a.width}`); -this.updateHighlightRect(a);this.updateTopBarSize(a);this.updateTextAreaSize(a,b);this.updateDeleteIconPosition(a,b,c);this.updateFoldoutIconPosition(b,d);this.updateTextPreviewSize(a,b,e,c,f);this.updateResizeHandlePosition(a,f)}setSize(a){const b=this.preResizeSize||this.size;this.setSizeWithoutFiringEvents(a);this.onSizeChange(b,this.size)}calcMinSize(a,b,c){var d;this.updateTextPreview(null!=(d=this.textArea.value)?d:"");d=getTextWidth$$module$build$src$core$utils$dom(this.textPreview);const e= -this.calcFoldoutMargin(a,b),f=this.calcDeleteMargin(a,c);let g=d;this.foldoutIcon.checkVisibility()?g+=b.width+2*e:d&&(g+=4);this.deleteIcon.checkVisibility()?g+=c.width+2*f:d&&(g+=4);return new Size$$module$build$src$core$utils$size(g,a.height+20)}calcDeleteMargin(a,b){return(a.height-b.height)/2}calcFoldoutMargin(a,b){return(a.height-b.height)/2}updateHighlightRect(a){this.highlightRect.setAttribute("height",`${a.height}`);this.highlightRect.setAttribute("width",`${a.width}`);this.workspace.RTL&& -this.highlightRect.setAttribute("x",`${-a.width}`)}updateTopBarSize(a){this.topBarBackground.setAttribute("width",`${a.width}`)}updateTextAreaSize(a,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}`)}updateDeleteIconPosition(a,b,c){b=this.calcDeleteMargin(b,c);this.deleteIcon.setAttribute("y",`${b}`);this.deleteIcon.setAttribute("x", -`${a.width-c.width-b}`)}updateFoldoutIconPosition(a,b){a=this.calcFoldoutMargin(a,b);this.foldoutIcon.setAttribute("y",`${a}`);this.foldoutIcon.setAttribute("x",`${a}`)}updateTextPreviewSize(a,b,c,d,e){const f=(b.height-c.height)/2,g=this.calcDeleteMargin(b,d);b=this.calcFoldoutMargin(b,e);a=a.width-e.width-2*b-d.width-2*g;this.textPreview.setAttribute("x",`${e.width+2*b*(this.workspace.RTL?-1:1)}`);this.textPreview.setAttribute("y",`${f+c.height/2}`);this.textPreview.setAttribute("width",`${a}`)}updateResizeHandlePosition(a, -b){this.resizeHandle.setAttribute("y",`${a.height-b.height}`);this.resizeHandle.setAttribute("x",`${a.width-b.width}`)}onSizeChange(a,b){for(let c=this.sizeChangeListeners.length-1;0<=c;c--)this.sizeChangeListeners[c](a,b)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}removeSizeChangeListener(a){this.sizeChangeListeners.splice(this.sizeChangeListeners.indexOf(a),1)}onResizePointerDown(a){this.isEditable()&&(this.bringToFront(),isRightButton$$module$build$src$core$browser_events(a)||(this.preResizeSize= -this.getSize(),this.workspace.startDrag(a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),a.stopPropagation())}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch(); -this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null);this.setSize(this.size);this.preResizeSize=void 0}onResizePointerMove(a){a=this.workspace.moveDrag(a);this.setSizeWithoutFiringEvents(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y))}isCollapsed(){return this.collapsed}setCollapsed(a){(this.collapsed= -a)?addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCollapsed"):removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCollapsed");this.setSizeWithoutFiringEvents(this.size);this.onCollapse()}onCollapse(){for(let a=this.collapseChangeListeners.length-1;0<=a;a--)this.collapseChangeListeners[a](this.collapsed)}addOnCollapseListener(a){this.collapseChangeListeners.push(a)}removeOnCollapseListener(a){this.collapseChangeListeners.splice(this.collapseChangeListeners.indexOf(a), -1)}onFoldoutDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(this.setCollapsed(!this.collapsed),this.workspace.hideChaff());a.stopPropagation()}isEditable(){return this.editable}setEditable(a){(this.editable=a)?(addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyEditable"),removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyReadonly"),this.textArea.removeAttribute("readonly")):(removeClass$$module$build$src$core$utils$dom(this.svgRoot, -"blocklyEditable"),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyReadonly"),this.textArea.setAttribute("readonly","true"))}getRelativeToSurfaceXY(){return this.location}moveTo(a){this.location=a;this.svgRoot.setAttribute("transform",`translate(${a.x}, ${a.y})`)}getText(){return this.text}setText(a){this.textArea.value=a;this.onTextChange()}addTextChangeListener(a){this.textChangeListeners.push(a)}removeTextChangeListener(a){this.textChangeListeners.splice(this.textChangeListeners.indexOf(a), -1)}onTextChange(){const a=this.text;this.text=this.textArea.value;this.updateTextPreview(this.text);this.setSize(this.size);for(let b=this.textChangeListeners.length-1;0<=b;b--)this.textChangeListeners[b](a,this.text)}updateTextPreview(a){this.textPreviewNode.textContent=this.truncateText(a)}truncateText(a){return 12<=a.length?`${a.substring(0,9)}...`:a}bringToFront(){const a=this.svgRoot.parentNode,b=a.childNodes;b[b.length-1]!==this.svgRoot&&a.appendChild(this.svgRoot)}onDeleteDown(a){isRightButton$$module$build$src$core$browser_events(a)|| -this.dispose();a.stopPropagation()}dispose(){this.disposing=!0;removeNode$$module$build$src$core$utils$dom(this.svgRoot);for(let a=this.disposeListeners.length-1;0<=a;a--)this.disposeListeners[a]();this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing||this.disposed}addDisposeListener(a){this.disposeListeners.push(a)}removeDisposeListener(a){this.disposeListeners.splice(this.disposeListeners.indexOf(a),1)}};register$$module$build$src$core$css("\n.injectionDiv {\n --commentFillColour: #FFFCC7;\n --commentBorderColour: #F2E49B;\n}\n\n.blocklyComment .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 1px solid var(--commentBorderColour);\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n color: #000;\n}\n\n.blocklyReadonly.blocklyComment .blocklyTextarea {\n cursor: inherit;\n}\n\n.blocklyDeleteIcon {\n width: 20px;\n height: 20px;\n display: none;\n cursor: pointer;\n}\n\n.blocklyFoldoutIcon {\n width: 20px;\n height: 20px;\n transform-origin: 12px 12px;\n cursor: pointer;\n}\n.blocklyResizeHandle {\n width: 12px;\n height: 12px;\n cursor: se-resize;\n}\n.blocklyReadonly.blocklyComment .blocklyResizeHandle {\n cursor: inherit;\n}\n\n.blocklyCommentTopbarBackground {\n cursor: grab;\n fill: var(--commentBorderColour);\n height: 24px;\n}\n\n.blocklyComment .blocklyCommentPreview.blocklyText {\n fill: #000;\n dominant-baseline: middle;\n visibility: hidden;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentPreview {\n visibility: visible;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentForeignObject,\n.blocklyCollapsed.blocklyComment .blocklyResizeHandle {\n display: none;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon {\n transform: rotate(-90deg);\n}\n\n.blocklyRTL .blocklyCommentTopbar {\n transform: scale(-1, 1);\n}\n\n.blocklyRTL .blocklyCommentForeignObject {\n direction: rtl;\n}\n\n.blocklyRTL .blocklyCommentPreview {\n /* Revert the scale and control RTL using direction instead. */\n transform: scale(-1, 1);\n direction: rtl;\n}\n\n.blocklyRTL .blocklyResizeHandle {\n transform: scale(-1, 1);\n cursor: sw-resize;\n}\n\n.blocklyCommentHighlight {\n fill: none;\n}\n\n.blocklySelected .blocklyCommentHighlight {\n stroke: #fc3;\n stroke-width: 3px;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentHighlight {\n stroke: none;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground {\n stroke: #fc3;\n stroke-width: 3px;\n}\n"); -var module$build$src$core$comments$comment_view={};module$build$src$core$comments$comment_view.CommentView=CommentView$$module$build$src$core$comments$comment_view;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.workspace.options.readOnly}startDrag(){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;null==(a=this.workspace.getLayerManager())|| -a.moveToDragLayer(this.comment);this.comment.setDragging(!0)}drag(a){this.comment.moveDuringDrag(a)}endDrag(){this.fireDragEndEvent();this.fireMoveEvent();let a;null==(a=this.workspace.getLayerManager())||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(!1)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(COMMENT_DRAG$$module$build$src$core$events$utils))(this.comment, -!0);fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=new (get$$module$build$src$core$events$utils(COMMENT_DRAG$$module$build$src$core$events$utils))(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(COMMENT_MOVE$$module$build$src$core$events$utils))(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)}},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 VARIABLES$$module$build$src$core$serialization$priorities=100,PROCEDURES$$module$build$src$core$serialization$priorities=75,BLOCKS$$module$build$src$core$serialization$priorities=50,WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities=25,module$build$src$core$serialization$priorities={BLOCKS:BLOCKS$$module$build$src$core$serialization$priorities,PROCEDURES:PROCEDURES$$module$build$src$core$serialization$priorities,VARIABLES:VARIABLES$$module$build$src$core$serialization$priorities, +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&& +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, +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: +bumpDirection$$module$build$src$core$positionable_helpers.UP,b);if(c===verticalPosition$$module$build$src$core$positionable_helpers.TOP){var e=this.SMALL_SPACING+this.HEIGHT,f;null==(f=this.zoomInGroup)||f.setAttribute("transform","translate(0, "+e+")");this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(e+this.LARGE_SPACING+this.HEIGHT)+")")}else{f=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let h;null==(h=this.zoomInGroup)||h.setAttribute("transform","translate(0, "+ +f+")");f=f+this.SMALL_SPACING+this.HEIGHT;null==(e=this.zoomOutGroup)||e.setAttribute("transform","translate(0, "+f+")")}this.top=b.top;this.left=b.left;var g;null==(g=this.svgGroup)||g.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(a){this.zoomOutGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomOut"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH, +{id:"blocklyZoomoutClipPath"+a},this.zoomOutGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+a+")"},this.zoomOutGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href", +this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(a){this.zoomInGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomIn"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoominClipPath"+ +a},this.zoomInGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+a+")"},this.zoomInGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+ +SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(a,b){this.workspace.markFocused();this.workspace.zoomCenter(a);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();b.stopPropagation();b.preventDefault()}createZoomResetSvg(a){this.zoomResetGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomReset"}, +this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+a},this.zoomResetGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+ +a+")"},this.zoomResetGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(a){this.workspace.markFocused();const b=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed); +this.workspace.beginCanvasTransition();this.workspace.zoomCenter(b);this.workspace.scrollCenter();setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();a.stopPropagation();a.preventDefault()}fireZoomEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,this.workspace.id,"zoom_controls");fire$$module$build$src$core$events$utils(a)}};register$$module$build$src$core$css("\n.blocklyZoom>image, .blocklyZoom>svg>image {\n opacity: .4;\n}\n\n.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {\n opacity: .6;\n}\n\n.blocklyZoom>image:active, .blocklyZoom>svg>image:active {\n opacity: .8;\n}\n"); +var module$build$src$core$zoom_controls={};module$build$src$core$zoom_controls.ZoomControls=ZoomControls$$module$build$src$core$zoom_controls;var VARIABLES$$module$build$src$core$serialization$priorities=100,PROCEDURES$$module$build$src$core$serialization$priorities=75,BLOCKS$$module$build$src$core$serialization$priorities=50,WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities=25,module$build$src$core$serialization$priorities={BLOCKS:BLOCKS$$module$build$src$core$serialization$priorities,PROCEDURES:PROCEDURES$$module$build$src$core$serialization$priorities,VARIABLES:VARIABLES$$module$build$src$core$serialization$priorities, WORKSPACE_COMMENTS:WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities};var module$build$src$core$serialization$registry={};module$build$src$core$serialization$registry.register=register$$module$build$src$core$serialization$registry;module$build$src$core$serialization$registry.unregister=unregister$$module$build$src$core$serialization$registry;var saveComment$$module$build$src$core$serialization$workspace_comments=save$$module$build$src$core$serialization$workspace_comments,WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments=class{constructor(){this.priority=WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities}save(a){const b=[];for(const c of a.getTopComments())(a=save$$module$build$src$core$serialization$workspace_comments(c,{addCoordinates:!0,saveIds:!0}))&&b.push(a);return b.length?b:null}load(a, 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={}; -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(COMMENT_CREATE$$module$build$src$core$events$utils))(d)); +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)); $.setSelected$$module$build$src$core$common(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={}; 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;(function(a){a.GRID="grid";a.GRIDCELL="gridcell";a.GROUP="group";a.LISTBOX="listbox";a.MENU="menu";a.MENUITEM="menuitem";a.MENUITEMCHECKBOX="menuitemcheckbox";a.OPTION="option";a.PRESENTATION="presentation";a.ROW="row";a.TREE="tree";a.TREEITEM="treeitem"})(Role$$module$build$src$core$utils$aria||(Role$$module$build$src$core$utils$aria={}));var State$$module$build$src$core$utils$aria; (function(a){a.ACTIVEDESCENDANT="activedescendant";a.COLCOUNT="colcount";a.DISABLED="disabled";a.EXPANDED="expanded";a.INVALID="invalid";a.LABEL="label";a.LABELLEDBY="labelledby";a.LEVEL="level";a.ORIENTATION="orientation";a.POSINSET="posinset";a.ROWCOUNT="rowcount";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 module$build$src$core$utils$aria={}; @@ -640,20 +611,30 @@ break;default:return}a.preventDefault();a.stopPropagation()}}getSize(){const a=t "")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const b=document.createElement("div");b.className="blocklyMenuItemContent goog-menuitem-content";if(this.checkable){var c=document.createElement("div");c.className="blocklyMenuItemCheckbox goog-menuitem-checkbox";b.appendChild(c)}c=this.content;"string"===typeof this.content&&(c=document.createTextNode(this.content));b.appendChild(c);a.appendChild(b);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&&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 null!=(a=this.opt_value)?a:null}setRightToLeft(a){this.rightToLeft=a}setRole(a){this.roleName= a}setCheckable(a){this.checkable=a}setChecked(a){this.checked=a}setHighlighted(a){this.highlight=a;const b=this.getElement();b&&this.isEnabled()&&(a?(addClass$$module$build$src$core$utils$dom(b,"blocklyMenuItemHighlight"),addClass$$module$build$src$core$utils$dom(b,"goog-menuitem-highlight")):(removeClass$$module$build$src$core$utils$dom(b,"blocklyMenuItemHighlight"),removeClass$$module$build$src$core$utils$dom(b,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(a){this.enabled= -a}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(a,b){this.actionHandler=a.bind(b)}},module$build$src$core$menuitem={};module$build$src$core$menuitem.MenuItem=MenuItem$$module$build$src$core$menuitem;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 DeserializationError$$module$build$src$core$serialization$exceptions=class extends Error{},MissingBlockType$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Expected to find a 'type' property, defining the block type");this.state=a}},MissingConnection$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a, +a}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(a,b){this.actionHandler=a.bind(b)}},module$build$src$core$menuitem={};module$build$src$core$menuitem.MenuItem=MenuItem$$module$build$src$core$menuitem;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; +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 alertImplementation$$module$build$src$core$dialog=function(a,b){window.alert(a);b&&b()},confirmImplementation$$module$build$src$core$dialog=function(a,b){b(window.confirm(a))},promptImplementation$$module$build$src$core$dialog=function(a,b,c){c(window.prompt(a,b))},TEST_ONLY$$module$build$src$core$dialog={confirmInternal:confirmInternal$$module$build$src$core$dialog},module$build$src$core$dialog={TEST_ONLY:TEST_ONLY$$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;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;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 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 VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank="undefined"===typeof a;a&&(this.varId=a.getId(),this.workspaceId=a.workspace.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=super.fromJson(a,b,null!=c?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.type,this.varName=a.name)}toJson(){const a=super.toJson();if(void 0===this.varType)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"); +a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){const 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");a?b.createVariable(this.varName, +this.varType,this.varId):b.deleteVariableById(this.varId)}};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_}static compareByName(a,b){return a.name.localeCompare(b.name,void 0,{sensitivity:"base"})}},module$build$src$core$variable_model={};module$build$src$core$variable_model.VariableModel=VariableModel$$module$build$src$core$variable_model;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}; +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.createVariableButtonHandler=createVariableButtonHandler$$module$build$src$core$variables;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;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.nameUsedWithAnyType=nameUsedWithAnyType$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithConflictingParam=nameUsedWithConflictingParam$$module$build$src$core$variables;module$build$src$core$variables.promptName=promptName$$module$build$src$core$variables; +module$build$src$core$variables.renameVariable=$.renameVariable$$module$build$src$core$variables;var DeserializationError$$module$build$src$core$serialization$exceptions=class extends Error{},MissingBlockType$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Expected to find a 'type' property, defining the block type");this.state=a}},MissingConnection$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a, b,c){super(`The block ${b.toDevString()} is missing a(n) ${a} 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 ${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, 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; 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, 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; -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 module$build$src$core$interfaces$i_has_bubble={};module$build$src$core$interfaces$i_has_bubble.hasBubble=hasBubble$$module$build$src$core$interfaces$i_has_bubble;var BlockBase$$module$build$src$core$events$events_block_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!a;a&&(this.blockId=a.id,this.workspaceId=a.workspace.id)}toJson(){const a=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.blockId=this.blockId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new BlockBase$$module$build$src$core$events$events_block_base); -b.blockId=a.blockId;return b}},module$build$src$core$events$events_block_base={};module$build$src$core$events$events_block_base.BlockBase=BlockBase$$module$build$src$core$events$events_block_base;var BlockChange$$module$build$src$core$events$events_block_change=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a,b,c,d,e){super(a);this.type=$.CHANGE$$module$build$src$core$events$utils;a&&(this.element=b,this.name=c||void 0,this.oldValue=d,this.newValue=e)}toJson(){const a=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");a.element=this.element;a.name=this.name;a.oldValue= -this.oldValue;a.newValue=this.newValue;this.disabledReason&&(a.disabledReason=this.disabledReason);return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new BlockChange$$module$build$src$core$events$events_block_change);b.element=a.element;b.name=a.name;b.oldValue=a.oldValue;b.newValue=a.newValue;void 0!==a.disabledReason&&(b.disabledReason=a.disabledReason);return b}setDisabledReason(a){if("disabled"!==this.element)throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".'); +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"); +var module$build$src$core$icons$icon_types={};module$build$src$core$icons$icon_types.IconType=IconType$$module$build$src$core$icons$icon_types;var module$build$src$core$interfaces$i_has_bubble={};module$build$src$core$interfaces$i_has_bubble.hasBubble=hasBubble$$module$build$src$core$interfaces$i_has_bubble;var BlockBase$$module$build$src$core$events$events_block_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!a;a&&(this.blockId=a.id,this.workspaceId=a.workspace.id)}toJson(){const a=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.blockId=this.blockId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new BlockBase$$module$build$src$core$events$events_block_base); +b.blockId=a.blockId;return b}},module$build$src$core$events$events_block_base={};module$build$src$core$events$events_block_base.BlockBase=BlockBase$$module$build$src$core$events$events_block_base;var BlockChange$$module$build$src$core$events$events_block_change=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a,b,c,d,e){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CHANGE;a&&(this.element=b,this.name=c||void 0,this.oldValue=d,this.newValue=e)}toJson(){const a=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");a.element=this.element;a.name=this.name; +a.oldValue=this.oldValue;a.newValue=this.newValue;this.disabledReason&&(a.disabledReason=this.disabledReason);return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new BlockChange$$module$build$src$core$events$events_block_change);b.element=a.element;b.name=a.name;b.oldValue=a.oldValue;b.newValue=a.newValue;void 0!==a.disabledReason&&(b.disabledReason=a.disabledReason);return b}setDisabledReason(a){if("disabled"!==this.element)throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".'); this.disabledReason=a}isNull(){return this.oldValue===this.newValue}run(a){var b=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");b=b.getBlockById(this.blockId);if(!b)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const c=b.getIcon(IconType$$module$build$src$core$icons$icon_types.MUTATOR);c&&hasBubble$$module$build$src$core$interfaces$i_has_bubble(c)&& c.bubbleIsVisible()&&c.setBubbleVisible(!1);a=a?this.newValue:this.oldValue;switch(this.element){case "field":(b=b.getField(this.name))?b.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(!!a);break;case "disabled":var d;b.setDisabledReason(!!a,null!=(d=this.disabledReason)?d:MANUALLY_DISABLED$$module$build$src$core$constants);break;case "inline":b.setInputsInline(!!a);break;case "mutation":d=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(b); b.loadExtraState?b.loadExtraState(JSON.parse(a||"{}")):b.domToMutation&&b.domToMutation($.textToDom$$module$build$src$core$utils$xml(a||""));fire$$module$build$src$core$events$utils(new BlockChange$$module$build$src$core$events$events_block_change(b,"mutation",null,d,a));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(a){return a.saveExtraState?(a=a.saveExtraState(!0))?JSON.stringify(a):"":a.mutationToDom?(a=a.mutationToDom())?domToText$$module$build$src$core$xml(a): -"":""}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,$.CHANGE$$module$build$src$core$events$utils,BlockChange$$module$build$src$core$events$events_block_change);var module$build$src$core$events$events_block_change={};module$build$src$core$events$events_block_change.BlockChange=BlockChange$$module$build$src$core$events$events_block_change;var module$build$src$core$utils$math={};module$build$src$core$utils$math.clamp=clamp$$module$build$src$core$utils$math;module$build$src$core$utils$math.toDegrees=toDegrees$$module$build$src$core$utils$math;module$build$src$core$utils$math.toRadians=toRadians$$module$build$src$core$utils$math;var ARROW_SIZE$$module$build$src$core$dropdowndiv=16,BORDER_SIZE$$module$build$src$core$dropdowndiv=1,ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv=12,PADDING_Y$$module$build$src$core$dropdowndiv=16,ANIMATION_TIME$$module$build$src$core$dropdowndiv=.25,animateOutTimer$$module$build$src$core$dropdowndiv=null,onHide$$module$build$src$core$dropdowndiv=null,renderedClassName$$module$build$src$core$dropdowndiv="",themeClassName$$module$build$src$core$dropdowndiv="",div$$module$build$src$core$dropdowndiv, +"":""}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CHANGE,BlockChange$$module$build$src$core$events$events_block_change);var module$build$src$core$events$events_block_change={};module$build$src$core$events$events_block_change.BlockChange=BlockChange$$module$build$src$core$events$events_block_change;var module$build$src$core$utils$math={};module$build$src$core$utils$math.clamp=clamp$$module$build$src$core$utils$math;module$build$src$core$utils$math.toDegrees=toDegrees$$module$build$src$core$utils$math;module$build$src$core$utils$math.toRadians=toRadians$$module$build$src$core$utils$math;var ARROW_SIZE$$module$build$src$core$dropdowndiv=16,BORDER_SIZE$$module$build$src$core$dropdowndiv=1,ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv=12,PADDING_Y$$module$build$src$core$dropdowndiv=16,ANIMATION_TIME$$module$build$src$core$dropdowndiv=.25,animateOutTimer$$module$build$src$core$dropdowndiv=null,onHide$$module$build$src$core$dropdowndiv=null,renderedClassName$$module$build$src$core$dropdowndiv="",themeClassName$$module$build$src$core$dropdowndiv="",div$$module$build$src$core$dropdowndiv, content$$module$build$src$core$dropdowndiv,arrow$$module$build$src$core$dropdowndiv,boundsElement$$module$build$src$core$dropdowndiv=null,owner$$module$build$src$core$dropdowndiv=null,positionToField$$module$build$src$core$dropdowndiv=null,internal$$module$build$src$core$dropdowndiv={getBoundsInfo:function(){const a=getPageOffset$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv),b=getSize$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv); return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}},getPositionMetrics:function(a,b,c,d){const e=internal$$module$build$src$core$dropdowndiv.getBoundsInfo(),f=getSize$$module$build$src$core$utils$style(div$$module$build$src$core$dropdowndiv);return b+f.heighte.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,d,e,f):b+f.heightdocument.documentElement.clientTop?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,d,e,f):getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv(a,e,f)}},TEST_ONLY$$module$build$src$core$dropdowndiv=internal$$module$build$src$core$dropdowndiv,module$build$src$core$dropdowndiv={ANIMATION_TIME:ANIMATION_TIME$$module$build$src$core$dropdowndiv,ARROW_HORIZONTAL_PADDING:ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv, @@ -684,7 +665,7 @@ b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2,e;this. 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):this.visible_&&0===this.size_.width&&(this.render_(),0!==this.size_.width&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."));return this.size_}getScaledBBox(){let a; var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;if(this.isFullBlockField()){var c=this.sourceBlock_.getHeightWidth();const d=b.workspace.scale;a=this.getAbsoluteXY_();b=(c.width+1)*d;c=(c.height+1)*d;GECKO$$module$build$src$core$utils$useragent?(a.x+=1.5*d,a.y+=1.5*d):(a.x-=.5*d,a.y-=.5*d)}else c=this.borderRect_.getBoundingClientRect(),a=getPageOffset$$module$build$src$core$utils$style(this.borderRect_),b=c.width,c=c.height;return new Rect$$module$build$src$core$utils$rect(a.y, a.y+c,a.x,a.x+b)}onLocationChange(a){}getDisplayText_(){let a=this.getText();if(!a)return Field$$module$build$src$core$field.NBSP;a.length>this.maxDisplayLength&&(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");a=a.replace(/\s/g,Field$$module$build$src$core$field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");return a}getText(){const a=this.getText_();return null!==a?String(a):String(this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0;this.constants_=null}forceRerender(){this.isDirty_= -!0;this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(a,b=!0){if(null!==a){var c=this.doClassValidation_(a);a=this.processValidation_(a,c,b);if(!(a instanceof Error)){var d;c=null==(d=this.getValidator())?void 0:d.call(this,a);d=this.processValidation_(a,c,b);d instanceof Error||(a=this.sourceBlock_,a&&a.disposed||(c=this.getValue(),c===d?this.doValueUpdate_(d):(this.doValueUpdate_(d),b&&a&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CHANGE$$module$build$src$core$events$utils))(a, +!0;this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_.queueRender()}setValue(a,b=!0){if(null!==a){var c=this.doClassValidation_(a);a=this.processValidation_(a,c,b);if(!(a instanceof Error)){var d;c=null==(d=this.getValidator())?void 0:d.call(this,a);d=this.processValidation_(a,c,b);d instanceof Error||(a=this.sourceBlock_,a&&a.disposed||(c=this.getValue(),c===d?this.doValueUpdate_(d):(this.doValueUpdate_(d),b&&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.BLOCK_CHANGE))(a, "field",this.name||null,c,d)),this.isDirty_&&this.forceRerender())))}}}processValidation_(a,b,c){return null===b?(this.doValueInvalid_(a,c),this.isDirty_&&this.forceRerender(),Error()):void 0===b?a:b}getValue(){return this.value_}doClassValidation_(a){return null===a||void 0===a?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_||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{c.stopPropagation()})}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)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a);this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=this.getRelativeToSurfaceXY();var b,c;const d=null!=(c=null==(b=this.view)?void 0:b.getSize())?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+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;this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.setSelected$$module$build$src$core$common(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}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(), -"blocklySelected")}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected")}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})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions(ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT, -{comment:this});show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}},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; +"blocklyDragging")}dispose(){this.disposing=!0;this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);if(b){b.handleCommentStart(a,this);let c;null==(c=this.workspace.getLayerManager())||c.append(this,BLOCK$$module$build$src$core$layers);$.setSelected$$module$build$src$core$common(this)}}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(), +"blocklyDraggingDelete")}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(),"blocklySelected")}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected")}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})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions(ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT,{comment:this});show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b= +this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}},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; 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; -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=$.CREATE$$module$build$src$core$events$utils;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=blockToDomWithXY$$module$build$src$core$xml(a),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.xml)throw Error("The block XML 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(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new BlockCreate$$module$build$src$core$events$events_block_create);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml); -b.ids=a.ids;b.json=a.json;void 0!==a.recordUndo&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();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;aa.getBlockById(c)).filter(c=>c&&c.isShadow()).length===b.length};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,$.CREATE$$module$build$src$core$events$utils,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=THEME_CHANGE$$module$build$src$core$events$utils;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=super.fromJson(a,b,null!=c?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,THEME_CHANGE$$module$build$src$core$events$utils,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=VIEWPORT_CHANGE$$module$build$src$core$events$utils;this.viewTop=a;this.viewLeft=b;this.scale=c;this.oldScale=e}toJson(){const a=super.toJson();if(void 0===this.viewTop)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(void 0===this.viewLeft)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson"); +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.xml=blockToDomWithXY$$module$build$src$core$xml(a),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.xml)throw Error("The block XML 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(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a, +b,c){b=super.fromJson(a,b,null!=c?c:new BlockCreate$$module$build$src$core$events$events_block_create);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);b.ids=a.ids;b.json=a.json;void 0!==a.recordUndo&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();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;aa.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=super.fromJson(a,b,null!=c?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(void 0===this.viewTop)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(void 0===this.viewLeft)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson"); if(void 0===this.scale)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(void 0===this.oldScale)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=super.fromJson(a,b,null!=c?c:new ViewportChange$$module$build$src$core$events$events_viewport);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,VIEWPORT_CHANGE$$module$build$src$core$events$utils,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 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(;0<=d&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;d=this.connections.length)return-1;b=a.y;let d=c;for(;0<=d&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;da)c=d;else{b=d;break}}return b}removeConnection(a,b){a=this.findIndexOfConnection(a,b);if(-1===a)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]); return n (this.flyout?$.config$$module$build$src$core$config.flyoutDragRadius:$.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let a;if(!this.targetBlock||null==(a=this.flyout)||!a.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error("Cannot update dragging from the flyout because the ' +\n 'flyout's target workspace is undefined");return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_= @@ -729,22 +739,26 @@ this.startWorkspace_.markFocused(),this.mostRecentEvent=a,block$$module$build$sr shouldHandleEvent$$module$build$src$core$touch(a)||!this.isMultiTouch()){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()}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.");return}this.isEnding_=!0;if(this.dragger)this.dragger.onDragEnd(a,this.currentDragDeltaXY);else this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?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());2===c.length&&(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.isMultiTouch_=!0,a.preventDefault())}handleTouchMove(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b, -this.getTouchPoint(a));this.isPinchZoomEnabled&&2===this.cachedPoints.size?this.handlePinch(a):this.handleMove(a)}handlePinch(a){var b=Array.from(this.cachedPoints.keys()),c=this.cachedPoints.get(b[0]);b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c,b)/this.startDistance;if(0this.previousScale){b=c-this.previousScale;b=0this.cachedPoints.size&&(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.isMultiTouch_}cancel(){if(!this.isEnding_){longStop$$module$build$src$core$touch();if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY);else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY);this.dispose()}}handleRightClick(a){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(a)): -this.startBubble?this.startBubble.showContextMenu(a):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(a)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(a));a.preventDefault();a.stopPropagation();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.startBlock||this.startBubble||this.startComment||$.setSelected$$module$build$src$core$common(null);this.doStart(a)}fireWorkspaceClick(a){fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(CLICK$$module$build$src$core$events$utils))(null,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.");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);this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.flyout?this.doBlockClick():(this.bringBlockToFront(),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"); -if(this.targetBlock.isEnabled()){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours()}}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(CLICK$$module$build$src$core$events$utils))(this.startBlock,this.startWorkspace_.id,"block");fire$$module$build$src$core$events$utils(a)}this.bringBlockToFront(); -$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){a=this.creatorWorkspace;getSelected$$module$build$src$core$common()&&getSelected$$module$build$src$core$common().unselect();this.fireWorkspaceClick(this.startWorkspace_||a)}bringBlockToFront(){this.targetBlock.bringToFront()}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||this.startBubble||(this.startBlock=a,$.setSelected$$module$build$src$core$common(this.startBlock),a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()):this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?this.setTargetBlock(a.getParent()):this.targetBlock=a}setStartWorkspace(a){this.startWorkspace_|| -(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&!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);return!this.hasExceededDragRadius&&a}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let a,b;return null!=(b=null!=(a=this.workspaceDragger)?a:this.dragger)?b:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const a=getAllWorkspaces$$module$build$src$core$common(); -for(let b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1}},module$build$src$core$gesture={};module$build$src$core$gesture.Gesture=Gesture$$module$build$src$core$gesture;var Grid$$module$build$src$core$grid=class{constructor(a,b){this.pattern=a;this.scale=1;let c;this.spacing=null!=(c=b.spacing)?c:0;let d;this.length=null!=(d=b.length)?d:1;this.line2=(this.line1=a.firstChild)&&this.line1.nextSibling;let e;this.snapToGrid=null!=(e=b.snap)?e:!1}setSpacing(a){this.spacing=a;this.update(this.scale)}getSpacing(){return this.spacing}setLength(a){this.length=a;this.update(this.scale)}getLength(){return this.length}setSnapToGrid(a){this.snapToGrid=a}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(a){this.scale= +this.getTouchPoint(a));if(this.isPinchZoomEnabled&&2===this.cachedPoints.size)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]);b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c, +b)/this.startDistance;if(0this.previousScale){b=c-this.previousScale;b=0this.cachedPoints.size&&(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.isMultiTouch_}cancel(){if(!this.isEnding_){longStop$$module$build$src$core$touch();if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY); +else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY);this.dispose()}}handleRightClick(a){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(a)):this.startBubble?this.startBubble.showContextMenu(a):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(a)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(a)); +a.preventDefault();a.stopPropagation();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.startBlock||this.startBubble||this.startComment||$.setSelected$$module$build$src$core$common(null);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, +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."); +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);this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined"); +this.flyout?this.doBlockClick():(this.bringBlockToFront(),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");if(this.targetBlock.isEnabled()){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours()}}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)}this.bringBlockToFront();$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){a=this.creatorWorkspace;getSelected$$module$build$src$core$common()&&getSelected$$module$build$src$core$common().unselect();this.fireWorkspaceClick(this.startWorkspace_||a)}bringBlockToFront(){this.targetBlock.bringToFront()}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||this.startBubble||(this.startBlock=a,$.setSelected$$module$build$src$core$common(this.startBlock),a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()): +this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?this.setTargetBlock(a.getParent()):this.targetBlock=a}setStartWorkspace(a){this.startWorkspace_||(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&!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);return!this.hasExceededDragRadius&&a}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let a,b;return null!=(b=null!=(a=this.workspaceDragger)? +a:this.dragger)?b:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const a=getAllWorkspaces$$module$build$src$core$common();for(let b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1}},module$build$src$core$gesture={};module$build$src$core$gesture.Gesture=Gesture$$module$build$src$core$gesture;var Grid$$module$build$src$core$grid=class{constructor(a,b){this.pattern=a;this.scale=1;let c;this.spacing=null!=(c=b.spacing)?c:0;let d;this.length=null!=(d=b.length)?d:1;this.line2=(this.line1=a.firstChild)&&this.line1.nextSibling;let e;this.snapToGrid=null!=(e=b.snap)?e:!1}setSpacing(a){this.spacing=a;this.update(this.scale)}getSpacing(){return this.spacing}setLength(a){this.length=a;this.update(this.scale)}getLength(){return this.length}setSnapToGrid(a){this.snapToGrid=a}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(a){this.scale= a;var b=this.spacing*a;this.pattern.setAttribute("width",`${b}`);this.pattern.setAttribute("height",`${b}`);b=Math.floor(this.spacing/2)+.5;let c=b-this.length/2,d=b+this.length/2;b*=a;c*=a;d*=a;this.setLineAttributes(this.line1,a,c,d,b,b);this.setLineAttributes(this.line2,a,b,b,c,d)}setLineAttributes(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",`${b}`),a.setAttribute("x1",`${c}`),a.setAttribute("y1",`${e}`),a.setAttribute("x2",`${d}`),a.setAttribute("y2",`${f}`))}moveTo(a,b){this.pattern.setAttribute("x", `${a}`);this.pattern.setAttribute("y",`${b}`)}alignXY(a){var b=this.getSpacing();const c=b/2,d=Math.round(Math.round((a.x-c)/b)*b+c);b=Math.round(Math.round((a.y-c)/b)*b+c);return d===a.x&&b===a.y?a:new Coordinate$$module$build$src$core$utils$coordinate(d,b)}static createDom(a,b,c){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATTERN,{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);let d,e;if(0<(null!=(d=b.length)?d:1)&&0<(null!=(e=b.spacing)? -e:0)){createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a);let f;null!=(f=b.length)&&f&&createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a)}else createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{},a);return a}},module$build$src$core$grid={};module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;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= +e:0)){createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a);let f;null!=(f=b.length)&&f&&createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a)}else createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{},a);return a}},module$build$src$core$grid={};module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var LayerManager$$module$build$src$core$layer_manager=class{constructor(a){this.workspace=a;this.layers=new Map;if(a=a.getInjectionDiv())this.dragLayer=this.createDragLayer(a),this.animationLayer=this.createAnimationLayer(a);a=this.createLayer(BLOCK$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBlockCanvas");a=this.createLayer(BUBBLE$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBubbleCanvas")}createDragLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG, +{"class":"blocklyBlockDragSurface",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"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}createAnimationLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{"class":"blocklyAnimationLayer",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"});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=null==(b=this.dragLayer)?void 0:b.getAttribute("transform");if(c){let e;null==(e=this.animationLayer)||e.setAttribute("transform",c)}let d;null==(d=this.animationLayer)||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a= +`translate(${a.x}, ${a.y}) scale(${b})`;let c;null==(c=this.dragLayer)||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;null==(b=this.dragLayer)||b.appendChild(a.getSvgRoot())}moveOffDragLayer(a,b){this.append(a,b)}append(a,b){this.layers.has(b)||this.createLayer(b);let c;null==(c=this.layers.get(b))||c.appendChild(a.getSvgRoot())}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(aa.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.widtha.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;const d=c+this.size.width;ca.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;a=this.getWorkspaceViewRect(a);ca.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=[];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);0>e&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>2*Math.PI&&(h-=2*Math.PI);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/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>2*Math.PI&&(k-=2*Math.PI);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+g)+" "+b+","+c)}a.push("z");let l;null==(l=this.tail)||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=null==(a=this.svgRoot)?void 0:a.parentNode;return this.svgRoot&&(null==b?void 0:b.lastChild)!==this.svgRoot?(null==b||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)}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(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}}; +_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=2*_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH;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;var module$build$src$core$bubbles$bubble={};module$build$src$core$bubbles$bubble.Bubble=Bubble$$module$build$src$core$bubbles$bubble;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()}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b= +this.createParagraph(b);a=this.createSpans(b,a);this.workspace.RTL&&this.rightAlignSpans(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a)}createSpans(a,b){return b.split("\n").map(c=>{const d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN, +{dy:"1em",x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);c=document.createTextNode(c);d.appendChild(c);return d})}rightAlignSpans(a,b){for(const c of b)c.setAttribute("text-anchor","end"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){const a=this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+2*Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,a.height+2*Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH), +!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 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.CURSOR="default";this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(Array.isArray(a)?(validateOptions$$module$build$src$core$field_dropdown(a), a=trimOptions$$module$build$src$core$field_dropdown(a),this.menuGenerator_=a.options,this.prefixField=a.prefix||null,this.suffixField=a.suffix||null):this.menuGenerator_=a,this.selectedOption=this.getOptions(!1)[0],c&&this.configure_(c),this.setValue(this.selectedOption[1]),b&&this.setValidator(b))}fromXml(a){this.isOptionListDynamic()&&this.getOptions(!1);this.setValue(a.textContent)}loadState(a){this.loadLegacyState(FieldDropdown$$module$build$src$core$field_dropdown,a)||(this.isOptionListDynamic()&& this.getOptions(!1),this.setValue(a))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&addClass$$module$build$src$core$utils$dom(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){let a; return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!(null==(a=this.getSourceBlock())?0:a.isShadow())}createTextArrow_(){this.arrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);let a;this.arrow.appendChild(document.createTextNode((null==(a=this.getSourceBlock())?0:a.RTL)?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR)); @@ -782,22 +806,7 @@ String(e/2-c/2));this.positionTextElement_(g+d,a+f)}renderSelectedText(){this.ge this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);b=b?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let d=0;this.svgArrow&&(d=this.positionSVGArrow(c+b,a/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_.width=c+d+2*b;this.size_.height=a;this.positionTextElement_(b,c)}positionSVGArrow(a,b){if(!this.svgArrow)return 0;const c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;const d=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING: 0,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,f=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow.setAttribute("transform","translate("+(c.RTL?d:a+e)+","+b+")");return f+e}getText_(){if(!this.selectedOption)return null;const a=this.selectedOption[0];return"object"===typeof a?a.alt:a}static fromJson(a){if(!a.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples."); return new this(a.options,void 0,a)}};FieldDropdown$$module$build$src$core$field_dropdown.CHECKMARK_OVERHANG=25;FieldDropdown$$module$build$src$core$field_dropdown.MAX_MENU_HEIGHT_VH=.45;FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR="\u25be";var IMAGE_Y_OFFSET$$module$build$src$core$field_dropdown=5,IMAGE_Y_PADDING$$module$build$src$core$field_dropdown=2*IMAGE_Y_OFFSET$$module$build$src$core$field_dropdown;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 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(){$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);this.startLoc=this.bubble.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;null==(a=this.workspace.getLayerManager())||a.moveToDragLayer(this.bubble);this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(a){this.bubble.moveDuringDrag(a)}endDrag(){this.workspace.setResizesEnabled(!0); -$.setGroup$$module$build$src$core$events$utils(!1);let a;null==(a=this.workspace.getLayerManager())||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){this.workspace=a;this.anchor=b;this.ownerRect=c;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=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,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},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,{"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);conditionalBind$$module$build$src$core$browser_events(this.background,"pointerdown",this,this.onMouseDown)}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,_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;null==(b=this.workspace.getGesture(a))||b.handleBubbleStart(a,this);$.setSelected$$module$build$src$core$common(this)}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,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.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.widtha.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;const d=c+this.size.width;ca.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;a=this.getWorkspaceViewRect(a);ca.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=[];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);0>e&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>2*Math.PI&&(h-=2*Math.PI);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/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>2*Math.PI&&(k-=2*Math.PI);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+g)+" "+b+","+c)}a.push("z");let l;null==(l=this.tail)||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=null==(a=this.svgRoot)?void 0:a.parentNode;return this.svgRoot&&(null==b?void 0:b.lastChild)!==this.svgRoot?(null==b||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)}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(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){}unselect(){}}; -_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6;Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=2*_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH;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;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}, +var module$build$src$core$field_dropdown={};module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;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}, 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(),null==a||a.init(this.miniWorkspace),null==a||a.show(b.languageTree)); this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let e,f;null==(e=this.miniWorkspace.getFlyout())||null==(f=e.getWorkspace())||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"); 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(); @@ -806,22 +815,25 @@ this.getSize(),b=this.calculateWorkspaceSize();Math.abs(a.width-b.width)({kind:"block",type:c}))});return b}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$mutator_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){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)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method"); this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var a of this.rootBlock.getDescendants(!1))a.queueRender();this.rootBlock.setMovable(!1);this.rootBlock.setDeletable(!1);let b,c,d,e;a=null!=(e=null==(b=this.miniWorkspaceBubble)?void 0:null==(c=b.getWorkspace())?void 0:null==(d=c.getFlyout())?void 0:d.getWidth())?e:0;this.rootBlock.moveBy(this.rootBlock.RTL?-(a+WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon):WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon, WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&&this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return a=>{$.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(a)|| -this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null;this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(a){return a.isUiEvent||a.type===$.CREATE$$module$build$src$core$events$utils||a.type===$.CHANGE$$module$build$src$core$events$utils&&"disabled"===a.element}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var a=$.getGroup$$module$build$src$core$events$utils(); -a||$.setGroup$$module$build$src$core$events$utils(!0);var b=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);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($.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,b,c));$.setGroup$$module$build$src$core$events$utils(a)}}getWorkspace(){let a; +this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null;this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(a){return a.isUiEvent||isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)&&"disabled"===a.element}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var a=$.getGroup$$module$build$src$core$events$utils(); +a||$.setGroup$$module$build$src$core$events$utils(!0);var b=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);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 null==(a=this.miniWorkspaceBubble)?void 0:a.getWorkspace()}};$.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; 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; -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 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 KeyCodes$$module$build$src$core$utils$keycodes; +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 KeyCodes$$module$build$src$core$utils$keycodes; (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]= "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"; 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]= @@ -832,36 +844,39 @@ var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes 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; 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; 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; -module$build$src$core$utils.toolbox=module$build$src$core$utils$toolbox;module$build$src$core$utils.userAgent=module$build$src$core$utils$useragent;module$build$src$core$utils.xml=module$build$src$core$utils$xml;var 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 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()}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b= -this.createParagraph(b);a=this.createSpans(b,a);this.workspace.RTL&&this.rightAlignSpans(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a)}createSpans(a,b){return b.split("\n").map(c=>{const d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN, -{dy:"1em",x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);c=document.createTextNode(c);d.appendChild(c);return d})}rightAlignSpans(a,b){for(const c of b)c.setAttribute("text-anchor","end"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){const a=this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+2*Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,a.height+2*Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH), -!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 TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c){super(a,b,c);this.workspace=a;this.anchor=b;this.ownerRect=c;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.textChangeListeners=[];this.sizeChangeListeners=[];this.text="";this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER); +module$build$src$core$utils.toolbox=module$build$src$core$utils$toolbox;module$build$src$core$utils.userAgent=module$build$src$core$utils$useragent;module$build$src$core$utils.xml=module$build$src$core$utils$xml;var TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c){super(a,b,c);this.workspace=a;this.anchor=b;this.ownerRect=c;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.textChangeListeners=[];this.sizeChangeListeners=[];this.text="";this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER); this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");({inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer));this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(a){this.text=a;this.textArea.value= a;this.onTextChange()}addTextChangeListener(a){this.textChangeListeners.push(a)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}createEditor(a){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);const b=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");b.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom); b.className="blocklyMinimalBody";const c=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");c.className="blocklyTextarea blocklyText";c.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");b.appendChild(c);a.appendChild(b);this.bindTextAreaEvents(c);setTimeout(()=>{c.focus()},0);return{inputRoot:a,textArea:c}}bindTextAreaEvents(a){conditionalBind$$module$build$src$core$browser_events(a,"wheel",this,b=>{b.stopPropagation()});conditionalBind$$module$build$src$core$browser_events(a, "focus",this,this.onStartEdit,!0);conditionalBind$$module$build$src$core$browser_events(a,"change",this,this.onTextChange)}createResizeHandle(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height= Math.max(a.height,this.MIN_SIZE.height);const c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${c}`);this.inputRoot.setAttribute("height",`${d}`);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()}onResizePointerDown(a){this.bringToFront(); -isRightButton$$module$build$src$core$browser_events(a)||(this.workspace.startDrag(a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()); -a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=this.workspace.moveDrag(a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL? --a.x:a.x,a.y),!1);this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const a of this.textChangeListeners)a()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}};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 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.textBubble=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, +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,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),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()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const a of this.textChangeListeners)a()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}};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 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.textBubble=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);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"}, 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,"blockly-icon-comment"))}dispose(){super.dispose();let a;null==(a=this.textInputBubble)||a.dispose();let b;null==(b=this.textBubble)||b.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, SIZE$$module$build$src$core$icons$comment_icon)}applyColour(){super.applyColour();const a=this.sourceBlock.style.colourPrimary;let b;null==(b=this.textInputBubble)||b.setColour(a);let c;null==(c=this.textBubble)||c.setColour(a)}updateEditable(){const a=this,b=()=>super.updateEditable;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b().call(a);a.bubbleIsVisible()&&(yield a.setBubbleVisible(!1),yield a.setBubbleVisible(!0))})}onLocationChange(a){super.onLocationChange(a);a=this.getAnchorLocation(); -let b;null==(b=this.textInputBubble)||b.setAnchorLocation(a);let c;null==(c=this.textBubble)||c.setAnchorLocation(a)}setText(a){const b=this.text;fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,b,a));this.text=a;let c;null==(c=this.textInputBubble)||c.setText(this.text);let d;null==(d=this.textBubble)||d.setText(this.text)}getText(){return this.text}setBubbleSize(a){this.bubbleSize= +let b;null==(b=this.textInputBubble)||b.setAnchorLocation(a);let c;null==(c=this.textBubble)||c.setAnchorLocation(a)}setText(a){const b=this.text;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,"comment",null,b,a));this.text=a;let c;null==(c=this.textInputBubble)||c.setText(this.text);let d;null==(d=this.textBubble)||d.setText(this.text)}getText(){return this.text}setBubbleSize(a){this.bubbleSize= a;let b;null==(b=this.textInputBubble)||b.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(a){let b;this.text=null!=(b=a.text)?b:"";let c,d;this.bubbleSize=new Size$$module$build$src$core$utils$size(null!=(c=a.width)?c:DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,null!=(d=a.height)?d:DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon); -let e;this.bubbleVisiblity=null!=(e=a.pinned)?e:!1;this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var a=this.textInputBubble.getText();this.text!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"comment",null,this.text,a)),this.text=a)}}onSizeChange(){this.textInputBubble&& +let e;this.bubbleVisiblity=null!=(e=a.pinned)?e:!1;this.setBubbleVisible(this.bubbleVisiblity)}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var a=this.textInputBubble.getText();this.text!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,"comment",null,this.text,a)),this.text=a)}}onSizeChange(){this.textInputBubble&& (this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(a){const b=this;return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){b.bubbleVisiblity!==a&&(b.bubbleVisiblity=a,yield finishQueuedRenders$$module$build$src$core$render_management(),!b.sourceBlock.rendered||b.sourceBlock.isInFlyout||b.sourceBlock.isInsertionMarker()||(a?(b.sourceBlock.isEditable()?b.showEditableBubble():b.showNonEditableBubble(),b.applyColour()):b.hideBubble(), -fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(BUBBLE_OPEN$$module$build$src$core$events$utils))(b.sourceBlock,a,"comment"))))})}showEditableBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect());this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.textInputBubble.addTextChangeListener(()=>this.onTextChange()); -this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let a;null==(a=this.textInputBubble)||a.dispose();this.textInputBubble=null;let b;null==(b=this.textBubble)||b.dispose();this.textBubble=null}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation, -new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){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)}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3; -register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var 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"}, +fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"comment"))))})}showEditableBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect());this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.textInputBubble.addTextChangeListener(()=> +this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let a;null==(a=this.textInputBubble)||a.dispose();this.textInputBubble=null;let b;null==(b=this.textBubble)||b.dispose();this.textBubble=null}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$comment_icon/ +2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){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)}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3; +register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon);var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var 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;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"}, this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blockly-icon-warning"))}dispose(){super.dispose();let a;null==(a=this.textBubble)|| a.dispose()}getWeight(){return WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$warning_icon,SIZE$$module$build$src$core$icons$warning_icon)}applyColour(){super.applyColour();let a;null==(a=this.textBubble)||a.setColour(this.sourceBlock.style.colourPrimary)}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(a){super.onLocationChange(a);let b;null==(b=this.textBubble)||b.setAnchorLocation(this.getAnchorLocation())}addMessage(a, b){if(this.textMap.get(b)===a)return this;a?this.textMap.set(b,a):this.textMap.delete(b);let c;null==(c=this.textBubble)||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 $jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(b.bubbleIsVisible()!==a){yield finishQueuedRenders$$module$build$src$core$render_management(); -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;null==(c=b.textBubble)||c.dispose();b.textBubble=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(BUBBLE_OPEN$$module$build$src$core$events$utils))(b.sourceBlock,a,"warning"))}})}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$warning_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation, -new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){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;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 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;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; -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 CATEGORY_NAME$$module$build$src$core$procedures,module$build$src$core$procedures;CATEGORY_NAME$$module$build$src$core$procedures="PROCEDURE";$.DEFAULT_ARG$$module$build$src$core$procedures="x";module$build$src$core$procedures={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$procedures,DEFAULT_ARG:$.DEFAULT_ARG$$module$build$src$core$procedures};module$build$src$core$procedures.ObservableProcedureMap=ObservableProcedureMap$$module$build$src$core$observable_procedure_map; +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;null==(c=b.textBubble)||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"))}})}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$warning_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation, +new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){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;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 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; +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.name: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());"), +null)}populateVariables(a){a=$.allUsedVarModels$$module$build$src$core$variables(a);for(let b=0;ba.disposeInternal());this.inputList.forEach(a=> -a.dispose());this.inputList.length=0;this.getConnections_(!0).forEach(a=>a.dispose());this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const a of this.inputList)a.initModel();this.initialized=!0}}unplug(a){this.outputConnection&&this.unplugFromRow_(a);this.previousConnection&&this.unplugFromStack_(a)}unplugFromRow_(a){let b=null,c;if(null==(c=this.outputConnection)?0:c.isConnected())b=this.outputConnection.targetConnection,this.outputConnection.disconnect(); -b&&a&&(a=this.getOnlyValueConnection_())&&a.isConnected()&&!a.targetBlock().isShadow()&&(a=a.targetConnection,null==a||a.disconnect(),this.workspace.connectionChecker.canConnect(a,b,!1)?b.connect(a):null==a||a.onFailedConnect(b))}getOnlyValueConnection_(){let a=null;for(let b=0;ba.disposeInternal());this.inputList.forEach(a=>a.dispose());this.inputList.length=0;this.getConnections_(!0).forEach(a=>a.dispose());this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const a of this.inputList)a.initModel();this.initialized=!0}}unplug(a){this.outputConnection&&this.unplugFromRow_(a);this.previousConnection&&this.unplugFromStack_(a)}unplugFromRow_(a){let b=null,c;if(null==(c=this.outputConnection)? +0:c.isConnected())b=this.outputConnection.targetConnection,this.outputConnection.disconnect();b&&a&&(a=this.getOnlyValueConnection_())&&a.isConnected()&&!a.targetBlock().isShadow()&&(a=a.targetConnection,null==a||a.disconnect(),this.workspace.connectionChecker.canConnect(a,b,!1)?b.connect(a):null==a||a.onFailedConnect(b))}getOnlyValueConnection_(){let a=null;for(let b=0;b{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="?"){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, -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, -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(void 0===a["message"+c])throw Error(b+`args${c} must have a corresponding message (message${c}).`);c++}a.style&&a.style.hat&&(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,b): -this.jsonInitColour_(a,b);for(c=0;void 0!==a["message"+c];)this.interpolate_(a["message"+c],a["args"+c]||[],a["implicitAlign"+c]||a["lastDummyAlign"+c],b),c++;void 0!==a.inputsInline&&($.disable$$module$build$src$core$events$utils(),this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());void 0!==a.output&&this.setOutput(!0,a.output);void 0!==a.outputShape&&this.setOutputShape(a.outputShape);void 0!==a.previousStatement&&this.setPreviousStatement(!0,a.previousStatement); -void 0!==a.nextStatement&&this.setNextStatement(!0,a.nextStatement);void 0!==a.tooltip&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip),this.setTooltip(c));void 0!==a.enableContextMenu&&(this.contextMenu=!!a.enableContextMenu);void 0!==a.suppressPrefixSuffix&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);void 0!==a.helpUrl&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.helpUrl),this.setHelpUrl(c));"string"===typeof a.extensions&&(console.warn(b+ -"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+a.type+"' block."),a.extensions=[a.extensions]);void 0!==a.mutator&&apply$$module$build$src$core$extensions(a.mutator,this,!0);a=a.extensions;if(Array.isArray(a))for(b=0;bf||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated."); -c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");}interpolateArguments_(a,b,c){const d=[];for(let f=0;f=this.inputList.length)throw RangeError("Input index "+ -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);ab.getWeight()-c.getWeight()); -return a}removeIcon(a){if(!this.hasIcon(a))return!1;let b;null==(b=this.getIcon(a))||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"); -const d=new (get$$module$build$src$core$events$utils($.MOVE$$module$build$src$core$events$utils))(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){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++)if(d.connection){var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=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 FlyoutButton$$module$build$src$core$flyout_button=class{constructor(a,b,c,d){this.workspace=a;this.targetWorkspace=b;this.isFlyoutLabel=d;this.onMouseUpWrapper=null;this.height=this.width=0;this.cursorSvg=this.svgText=this.svgGroup=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}createDom(){var a=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton"; +MANUALLY_DISABLED$$module$build$src$core$constants)}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),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_!==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{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="?"){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,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,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(void 0===a["message"+c])throw Error(b+`args${c} must have a corresponding message (message${c}).`);c++}a.style&&a.style.hat&&(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,b):this.jsonInitColour_(a,b);for(c=0;void 0!==a["message"+c];)this.interpolate_(a["message"+c],a["args"+ +c]||[],a["implicitAlign"+c]||a["lastDummyAlign"+c],b),c++;void 0!==a.inputsInline&&($.disable$$module$build$src$core$events$utils(),this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());void 0!==a.output&&this.setOutput(!0,a.output);void 0!==a.outputShape&&this.setOutputShape(a.outputShape);void 0!==a.previousStatement&&this.setPreviousStatement(!0,a.previousStatement);void 0!==a.nextStatement&&this.setNextStatement(!0,a.nextStatement);void 0!==a.tooltip&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip), +this.setTooltip(c));void 0!==a.enableContextMenu&&(this.contextMenu=!!a.enableContextMenu);void 0!==a.suppressPrefixSuffix&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);void 0!==a.helpUrl&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.helpUrl),this.setHelpUrl(c));"string"===typeof a.extensions&&(console.warn(b+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+a.type+"' block."),a.extensions=[a.extensions]);void 0!==a.mutator&& +apply$$module$build$src$core$extensions(a.mutator,this,!0);a=a.extensions;if(Array.isArray(a))for(b=0;bf||f>b)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");}interpolateArguments_(a,b,c){const d=[];for(let f=0;f=this.inputList.length)throw RangeError("Input index "+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);ab.getWeight()-c.getWeight());return a}removeIcon(a){if(!this.hasIcon(a))return!1;let b;null==(b=this.getIcon(a))||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");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){void 0===a&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++)if(d.connection){var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=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 FlyoutButton$$module$build$src$core$flyout_button=class{constructor(a,b,c,d){this.workspace=a;this.targetWorkspace=b;this.isFlyoutLabel=d;this.onMouseUpWrapper=null;this.height=this.width=0;this.cursorSvg=this.svgText=this.svgGroup=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}createDom(){var a=this.isFlyoutLabel?"blocklyFlyoutLabel":"blocklyFlyoutButton"; this.cssClass&&(a+=" "+this.cssClass);this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":a},this.workspace.getCanvas());let b;this.isFlyoutLabel||(b=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, {"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);const c=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);var d=replaceMessageReferences$$module$build$src$core$utils$parsing(this.text); this.workspace.RTL&&(d+="\u200f");c.textContent=d;this.isFlyoutLabel&&(this.svgText=c,this.workspace.getThemeManager().subscribe(this.svgText,"flyoutForegroundColour","fill"));const e=getComputedStyle$$module$build$src$core$utils$style(c,"fontSize"),f=getComputedStyle$$module$build$src$core$utils$style(c,"fontWeight"),g=getComputedStyle$$module$build$src$core$utils$style(c,"fontFamily");this.width=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(c,e,f,g);d=measureFontMetrics$$module$build$src$core$utils$dom(d, @@ -1051,9 +1067,9 @@ new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$s a):null}static createInputNode(a){return a&&a.connection?new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.INPUT,a.connection):null}static createBlockNode(a){return a?new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BLOCK,a):null}static createStackNode(a){return a?new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.STACK, a):null}static createButtonNode(a){return a?new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BUTTON,a):null}static createWorkspaceNode(a,b){return b&&a?new ASTNode$$module$build$src$core$keyboard_nav$ast_node(ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.WORKSPACE,a,{wsCoordinate:b}):null}static createTopNode(a){const b=getParentConnection$$module$build$src$core$keyboard_nav$ast_node(a);return b?ASTNode$$module$build$src$core$keyboard_nav$ast_node.createConnectionNode(b): ASTNode$$module$build$src$core$keyboard_nav$ast_node.createBlockNode(a)}};ASTNode$$module$build$src$core$keyboard_nav$ast_node.NAVIGATE_ALL_FIELDS=!1;ASTNode$$module$build$src$core$keyboard_nav$ast_node.DEFAULT_OFFSET_Y=-20; -(function(a){a=a.types||(a.types={});a.FIELD="field";a.BLOCK="block";a.INPUT="input";a.OUTPUT="output";a.NEXT="next";a.PREVIOUS="previous";a.STACK="stack";a.WORKSPACE="workspace";a.BUTTON="button"})(ASTNode$$module$build$src$core$keyboard_nav$ast_node||(ASTNode$$module$build$src$core$keyboard_nav$ast_node={}));var module$build$src$core$keyboard_nav$ast_node={};module$build$src$core$keyboard_nav$ast_node.ASTNode=ASTNode$$module$build$src$core$keyboard_nav$ast_node;var MarkerMove$$module$build$src$core$events$events_marker_move=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c,d){let e=a?a.workspace.id:void 0;d&&d.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.WORKSPACE&&(e=d.getLocation().id);super(e);this.type=MARKER_MOVE$$module$build$src$core$events$utils;this.blockId=null==a?void 0:a.id;this.oldNode=c||void 0;this.newNode=d;this.isCursor=b}toJson(){const a=super.toJson();if(void 0===this.isCursor)throw Error("Whether this is a cursor event or not is undefined. Either pass a value to the constructor, or call fromJson"); +(function(a){a=a.types||(a.types={});a.FIELD="field";a.BLOCK="block";a.INPUT="input";a.OUTPUT="output";a.NEXT="next";a.PREVIOUS="previous";a.STACK="stack";a.WORKSPACE="workspace";a.BUTTON="button"})(ASTNode$$module$build$src$core$keyboard_nav$ast_node||(ASTNode$$module$build$src$core$keyboard_nav$ast_node={}));var module$build$src$core$keyboard_nav$ast_node={};module$build$src$core$keyboard_nav$ast_node.ASTNode=ASTNode$$module$build$src$core$keyboard_nav$ast_node;var MarkerMove$$module$build$src$core$events$events_marker_move=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c,d){let e=a?a.workspace.id:void 0;d&&d.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.WORKSPACE&&(e=d.getLocation().id);super(e);this.type=EventType$$module$build$src$core$events$type.MARKER_MOVE;this.blockId=null==a?void 0:a.id;this.oldNode=c||void 0;this.newNode=d;this.isCursor=b}toJson(){const a=super.toJson();if(void 0===this.isCursor)throw Error("Whether this is a cursor event or not is undefined. Either pass a value to the constructor, or call fromJson"); if(!this.newNode)throw Error("The new node is undefined. Either pass a node to the constructor, or call fromJson");a.isCursor=this.isCursor;a.blockId=this.blockId;a.oldNode=this.oldNode;a.newNode=this.newNode;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new MarkerMove$$module$build$src$core$events$events_marker_move);b.isCursor=a.isCursor;b.blockId=a.blockId;b.oldNode=a.oldNode;b.newNode=a.newNode;return b}}; -register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,MARKER_MOVE$$module$build$src$core$events$utils,MarkerMove$$module$build$src$core$events$events_marker_move);var module$build$src$core$events$events_marker_move={};module$build$src$core$events$events_marker_move.MarkerMove=MarkerMove$$module$build$src$core$events$events_marker_move;var CURSOR_CLASS$$module$build$src$core$renderers$common$marker_svg="blocklyCursor",MARKER_CLASS$$module$build$src$core$renderers$common$marker_svg="blocklyMarker",HEIGHT_MULTIPLIER$$module$build$src$core$renderers$common$marker_svg=.75,MarkerSvg$$module$build$src$core$renderers$common$marker_svg=class{constructor(a,b,c){this.workspace=a;this.marker=c;this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=this.currentMarkerSvg=this.parent=null;this.constants_= +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.MARKER_MOVE,MarkerMove$$module$build$src$core$events$events_marker_move);var module$build$src$core$events$events_marker_move={};module$build$src$core$events$events_marker_move.MarkerMove=MarkerMove$$module$build$src$core$events$events_marker_move;var CURSOR_CLASS$$module$build$src$core$renderers$common$marker_svg="blocklyCursor",MARKER_CLASS$$module$build$src$core$renderers$common$marker_svg="blocklyMarker",HEIGHT_MULTIPLIER$$module$build$src$core$renderers$common$marker_svg=.75,MarkerSvg$$module$build$src$core$renderers$common$marker_svg=class{constructor(a,b,c){this.workspace=a;this.marker=c;this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=this.currentMarkerSvg=this.parent=null;this.constants_= b;a=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=c.colour||a}getSvgRoot(){return this.svgGroup_}getMarker(){return this.marker}isCursor(){return"cursor"===this.marker.type}createDom(){const a=this.isCursor()?CURSOR_CLASS$$module$build$src$core$renderers$common$marker_svg:MARKER_CLASS$$module$build$src$core$renderers$common$marker_svg;this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":a});this.createDomInternal_(); return this.svgGroup_}setParent_(a){this.isCursor()?(this.parent&&this.parent.setCursorSvg(null),a.setCursorSvg(this.getSvgRoot())):(this.parent&&this.parent.setMarkerSvg(null),a.setMarkerSvg(this.getSvgRoot()));this.parent=a}draw(a,b){if(b){this.constants_=this.workspace.getRenderer().getConstants();var c=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker.colour||c;this.applyColour_(b);this.showAtLocation_(b);this.fireMarkerEvent(a,b);a=this.currentMarkerSvg.childNodes[0]; void 0!==a&&a.beginElement&&a.beginElement()}else this.hide()}showAtLocation_(a){const b=a.getLocation().type;a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BLOCK?this.showWithBlock_(a):a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.OUTPUT?this.showWithOutput_(a):b===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?this.showWithInput_(a):b===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?this.showWithNext_(a): @@ -1067,7 +1083,7 @@ c)+lineOnAxis$$module$build$src$core$utils$svg_paths("V",-b)+lineOnAxis$$module$ this.markerSvgLine_}positionOutput_(a,b,c){if(!this.markerBlock_)throw Error("createDom should be called before positioning the output");a=moveBy$$module$build$src$core$utils$svg_paths(a,0)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",-(a-c.width))+lineOnAxis$$module$build$src$core$utils$svg_paths("v",this.constants_.TAB_OFFSET_FROM_TOP)+c.pathDown+lineOnAxis$$module$build$src$core$utils$svg_paths("V",b)+lineOnAxis$$module$build$src$core$utils$svg_paths("H",a);this.markerBlock_.setAttribute("d", a);this.workspace.RTL&&this.flipRtl(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}positionPrevious_(a,b,c,d){if(!this.markerBlock_)throw Error("createDom should be called before positioning the previous connection marker");a=moveBy$$module$build$src$core$utils$svg_paths(-b,c)+lineOnAxis$$module$build$src$core$utils$svg_paths("V",-b)+lineOnAxis$$module$build$src$core$utils$svg_paths("H",this.constants_.NOTCH_OFFSET_LEFT)+d.pathLeft+lineOnAxis$$module$build$src$core$utils$svg_paths("H", a+2*b)+lineOnAxis$$module$build$src$core$utils$svg_paths("V",c);this.markerBlock_.setAttribute("d",a);this.workspace.RTL&&this.flipRtl(this.markerBlock_);this.currentMarkerSvg=this.markerBlock_}positionRect_(a,b,c,d){if(!this.markerSvgRect_)throw Error("createDom should be called before positioning the rect");this.markerSvgRect_.setAttribute("x",`${a}`);this.markerSvgRect_.setAttribute("y",`${b}`);this.markerSvgRect_.setAttribute("width",`${c}`);this.markerSvgRect_.setAttribute("height",`${d}`);this.currentMarkerSvg= -this.markerSvgRect_}flipRtl(a){a.setAttribute("transform","scale(-1 1)")}hide(){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before hiding the marker");this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"}fireMarkerEvent(a,b){const c=b.getSourceBlock();a=new (get$$module$build$src$core$events$utils(MARKER_MOVE$$module$build$src$core$events$utils))(c, +this.markerSvgRect_}flipRtl(a){a.setAttribute("transform","scale(-1 1)")}hide(){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before hiding the marker");this.markerSvgLine_.style.display="none";this.markerSvgRect_.style.display="none";this.markerInput_.style.display="none";this.markerBlock_.style.display="none"}fireMarkerEvent(a,b){const c=b.getSourceBlock();a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.MARKER_MOVE))(c, this.isCursor(),a,b);fire$$module$build$src$core$events$utils(a)}getBlinkProperties_(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}createDomInternal_(){this.markerSvg_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_);this.markerSvgLine_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, {width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.markerSvg_);this.markerSvgRect_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyVerticalMarker",rx:10,ry:10},this.markerSvg_);this.markerInput_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{transform:""},this.markerSvg_);this.markerBlock_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH, {transform:"",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_);this.hide();if(this.isCursor()){const a=this.getBlinkProperties_();createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE,a,this.markerSvgLine_);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE,a,this.markerInput_);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE,Object.assign({}, @@ -1118,45 +1134,40 @@ c.workspace!==d.workspace?Connection$$module$build$src$core$connection.REASON_DI Connection$$module$build$src$core$connection.CAN_CONNECT}doTypeChecks(a,b){a=a.getCheck();b=b.getCheck();if(!a||!b)return!0;for(let c=0;cc||b.getSourceBlock().isInsertionMarker())return!1;switch(b.type){case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(a,b);case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:if(b.isConnected()&& !b.targetBlock().isInsertionMarker()||a.isConnected())return!1;break;case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:if(b.isConnected()&&!b.targetBlock().isMovable()&&!b.targetBlock().isShadow())return!1;break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:if(b.isConnected()&&!a.getSourceBlock().nextConnection&&!b.targetBlock().isShadow()&&b.targetBlock().nextConnection||b.targetBlock()&&!b.targetBlock().isMovable()&&!b.targetBlock().isShadow())return!1; break;default:return!1}return draggingConnections$$module$build$src$core$common.includes(b)?!1:!0}canConnectToPrevious_(a,b){if(a.targetConnection||draggingConnections$$module$build$src$core$common.includes(b))return!1;if(!b.targetConnection)return!0;a=b.targetBlock();return a.isInsertionMarker()?!a.getPreviousBlock():!1}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_CHECKER,DEFAULT$$module$build$src$core$registry,ConnectionChecker$$module$build$src$core$connection_checker); -var module$build$src$core$connection_checker={};module$build$src$core$connection_checker.ConnectionChecker=ConnectionChecker$$module$build$src$core$connection_checker;var VarDelete$$module$build$src$core$events$events_var_delete=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=VAR_DELETE$$module$build$src$core$events$utils;a&&(this.varType=a.type,this.varName=a.name)}toJson(){const a=super.toJson();if(void 0===this.varType)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"); +var module$build$src$core$connection_checker={};module$build$src$core$connection_checker.ConnectionChecker=ConnectionChecker$$module$build$src$core$connection_checker;var VarDelete$$module$build$src$core$events$events_var_delete=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_DELETE;a&&(this.varType=a.type,this.varName=a.name)}toJson(){const a=super.toJson();if(void 0===this.varType)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"); a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarDelete$$module$build$src$core$events$events_var_delete);b.varType=a.varType;b.varName=a.varName;return b}run(a){const 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");a?b.deleteVariableById(this.varId): -b.createVariable(this.varName,this.varType,this.varId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,VAR_DELETE$$module$build$src$core$events$utils,VarDelete$$module$build$src$core$events$events_var_delete);var module$build$src$core$events$events_var_delete={};module$build$src$core$events$events_var_delete.VarDelete=VarDelete$$module$build$src$core$events$events_var_delete;var VarRename$$module$build$src$core$events$events_var_rename=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a,b){super(a);this.type=VAR_RENAME$$module$build$src$core$events$utils;a&&(this.oldName=a.name,this.newName="undefined"===typeof b?"":b)}toJson(){const a=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson"); +b.createVariable(this.varName,this.varType,this.varId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_DELETE,VarDelete$$module$build$src$core$events$events_var_delete);var module$build$src$core$events$events_var_delete={};module$build$src$core$events$events_var_delete.VarDelete=VarDelete$$module$build$src$core$events$events_var_delete;var VarRename$$module$build$src$core$events$events_var_rename=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a,b){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_RENAME;a&&(this.oldName=a.name,this.newName="undefined"===typeof b?"":b)}toJson(){const a=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson"); a.oldName=this.oldName;a.newName=this.newName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new VarRename$$module$build$src$core$events$events_var_rename);b.oldName=a.oldName;b.newName=a.newName;return b}run(a){const 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.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson"); -a?b.renameVariableById(this.varId,this.newName):b.renameVariableById(this.varId,this.oldName)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,VAR_RENAME$$module$build$src$core$events$utils,VarRename$$module$build$src$core$events$events_var_rename);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){this.workspace=a;this.variableMap=new Map}clear(){for(const a of this.variableMap.values())for(;0{e&&b&&this.deleteVariableInternal(b,d)})):this.deleteVariableInternal(b,d)}else console.warn("Can't delete non-existent variable: "+a)}deleteVariableInternal(a, -b){const c=$.getGroup$$module$build$src$core$events$utils();c||$.setGroup$$module$build$src$core$events$utils(!0);try{for(let d=0;da.name)}getVariableUsesById(a){const b=[],c=this.workspace.getAllBlocks(!1); -for(let d=0;d{e&&b&&this.deleteVariableInternal(b,d)})):this.deleteVariableInternal(b,d)}else console.warn("Can't delete non-existent variable: "+ +a)}deleteVariableInternal(a,b){const c=$.getGroup$$module$build$src$core$events$utils();c||$.setGroup$$module$build$src$core$events$utils(!0);try{for(let d=0;da.name)}getVariableUsesById(a){const b= +[],c=this.workspace.getAllBlocks(!1);for(let d=0;dthis.remainingCapacityOfType(c))return!1;b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return Infinity!==this.options.maxBlocks||!!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;bthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let b=0;b!c.isInsertionMarker())}addTopComment(a){this.topComments.push(a);this.commentDB.has(a.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+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&&1!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(),this.topComments.pop();$.setGroup$$module$build$src$core$events$utils(a);this.variableMap.clear();this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing=!1}}renameVariableById(a,b){this.variableMap.renameVariableById(a,b)}createVariable(a,b,c){return this.variableMap.createVariable(a,b,c)}getVariableUsesById(a){return this.variableMap.getVariableUsesById(a)}deleteVariableById(a){this.variableMap.deleteVariableById(a)}getVariable(a, +b){return this.variableMap.getVariable(a,b)}getVariableById(a){return this.variableMap.getVariableById(a)}getVariablesOfType(a){return this.variableMap.getVariablesOfType(a)}getVariableTypes(){return this.variableMap.getVariableTypes(this)}getAllVariables(){return this.variableMap.getAllVariables()}getAllVariableNames(){return this.variableMap.getAllVariableNames()}getWidth(){return 0}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts");}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts"); +}remainingCapacity(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(a){return this.options.maxInstances?(void 0!==this.options.maxInstances[a]?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;b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return Infinity!== +this.options.maxBlocks||!!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;bthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let b=0;bf[0]-g[0]);for(const [f,g]of e)if(a!!b.getStyleName()));this.refreshToolboxSelection();this.toolbox_&&this.toolbox_.refreshTheme();this.isVisible()&&this.setVisible(!0);const 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=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.isVisible_}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()&&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=a}createDom(a,b){this.injectionDiv||(this.injectionDiv=null!=b?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace"});a&&(this.svgBackground_= @@ -1170,20 +1181,20 @@ renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides, return this.flyout.createDom(a)}getFlyout(a){return this.flyout||a?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM();this.recordDragTargets()}resizeContents(){this.resizesEnabled&&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&&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();null!=a&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));null!=b&&(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("svg"===a.tagName){this.cachedParentSvg=a;break}a=a.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(isEnabled$$module$build$src$core$events$utils()){var a= -this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&1>Math.abs(b-this.oldTop)&&1>Math.abs(c-this.oldLeft))){var d=new (get$$module$build$src$core$events$utils(VIEWPORT_CHANGE$$module$build$src$core$events$utils))(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;null==(c=this.layerManager)||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);let d;null==(d= -this.grid)||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){const a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.isVisible_=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;0<=b;b--)a[b].queueRender();this.getTopBlocks().flatMap(b=> -b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender());finishQueuedRenders$$module$build$src$core$render_management().then(()=>void this.markerManager.updateMarkers())}highlightBlock(a,b){if(void 0===b){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=void 0===b||b)?this.highlightedBlocks.includes(a)||this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks, +this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&1>Math.abs(b-this.oldTop)&&1>Math.abs(c-this.oldLeft))){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;null==(c=this.layerManager)||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);let d; +null==(d=this.grid)||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){const a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.isVisible_=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;0<=b;b--)a[b].queueRender(); +this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender());finishQueuedRenders$$module$build$src$core$render_management().then(()=>void this.markerManager.updateMarkers())}highlightBlock(a,b){if(void 0===b){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=void 0===b||b)?this.highlightedBlocks.includes(a)||this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks, a),a.setHighlighted(b)}refreshToolboxSelection(){const a=this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox_&&a.toolbox_.getFlyout()&&a.toolbox_.refreshSelection()}renameVariableById(a,b){super.renameVariableById(a,b);this.refreshToolboxSelection()}deleteVariableById(a){super.deleteVariableById(a);this.refreshToolboxSelection()}createVariable(a,b,c){a=super.createVariable(a,b,c);this.refreshToolboxSelection();return a}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");}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.clientX,a.clientY))return c.component;return null}onMouseDown_(a){const b= -this.getGesture(a);b&&b.handleWsStart(a,this)}startDrag(a,b){a=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;this.dragDeltaXY=Coordinate$$module$build$src$core$utils$coordinate.difference(b,a)}moveDrag(a){a=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM());a.x/=this.scale;a.y/=this.scale;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.dragDeltaXY, -a)}isDragging(){return null!==this.currentGesture_&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||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(),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=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;db.bottom&&(b.bottom=c.bottom),c.leftb.right&&(b.right=c.right))}return b}cleanUp(){this.setResizesEnabled(!1);$.setGroup$$module$build$src$core$events$utils(!0);const a=this.getTopBlocks(!0);let b=0;for(let c=0,d;d=a[c];c++){if(!d.isMovable())continue;const e=d.getRelativeToSurfaceXY();d.moveBy(-e.x,b-e.y,["cleanup"]);d.snapToGrid(); -b=d.getRelativeToSurfaceXY().y+d.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}$.setGroup$$module$build$src$core$events$utils(!1);this.setResizesEnabled(!0)}showContextMenu(a){if(!this.options.readOnly&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions(ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(b, -a);show$$module$build$src$core$contextmenu(a,b,this.RTL,this)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox_.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode."); -this.options.languageTree=a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);const d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale: -db.bottom&&(b.bottom=c.bottom),c.leftb.right&&(b.right=c.right))}return b}cleanUp(){this.setResizesEnabled(!1);$.setGroup$$module$build$src$core$events$utils(!0); +var a=this.getTopBlocks(!0),b=a.filter(f=>f.isMovable());const c=a.filter(f=>!f.isMovable()).map(f=>f.getBoundingRectangle());a=function(f){for(const g of c)if(f.intersects(g))return g;return null};var d=0;const e=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const f of b){b=f.getBoundingRectangle();f.moveBy(-b.left,d-b.top,["cleanup"]);f.snapToGrid();b=f.getBoundingRectangle();for(d=a(b);null!=d;)d=d.top+d.getHeight()+e,f.moveBy(0,d-b.top,["cleanup"]),f.snapToGrid(),b=f.getBoundingRectangle(), +d=a(b);d=f.getRelativeToSurfaceXY().y+f.getHeightWidth().height+e}$.setGroup$$module$build$src$core$events$utils(!1);this.setResizesEnabled(!0)}showContextMenu(a){if(!this.options.readOnly&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions(ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(b,a);show$$module$build$src$core$contextmenu(a, +b,this.RTL,this)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox_.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree= +a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);const d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale:db.autoHide(a))}static setTopLevelWorkspaceMetrics_(a){const b=this.getMetrics();"number"===typeof a.x&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)*a.x));"number"===typeof a.y&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)}},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 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=TRASHCAN_OPEN$$module$build$src$core$events$utils;this.isOpen=a}toJson(){const a=super.toJson();if(void 0===this.isOpen)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=super.fromJson(a,b,null!=c?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,TRASHCAN_OPEN$$module$build$src$core$events$utils,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 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=SELECTED$$module$build$src$core$events$utils;this.oldElementId=null!=a?a:void 0;this.newElementId=null!=b?b:void 0}toJson(){const a=super.toJson();a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new Selected$$module$build$src$core$events$events_selected);b.oldElementId= -a.oldElementId;b.newElementId=a.newElementId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,SELECTED$$module$build$src$core$events$utils,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 Marker$$module$build$src$core$keyboard_nav$marker=class{constructor(){this.drawer=this.curNode=this.colour=null;this.type="marker"}setDrawer(a){this.drawer=a}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(a){const b=this.curNode;this.curNode=a;this.drawer&&this.drawer.draw(b,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},module$build$src$core$keyboard_nav$marker= +module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;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=null!=a?a:void 0;this.newElementId=null!=b?b:void 0}toJson(){const a=super.toJson();a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,null!=c?c:new Selected$$module$build$src$core$events$events_selected); +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 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; +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));$.setSelected$$module$build$src$core$common(d);return d}};BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE="block";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 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.dragOffset=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.inGroup=!1;this.workspace=a.workspace}isMovable(){if(this.block.isShadow()){let a,b;return null!=(b=null==(a=this.block.getParent())?void 0:a.isMovable())?b:!1}return this.block.isOwnMovable()&& +!this.block.isDeadOrDying()&&!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(a){if(this.block.isShadow())this.startDraggingShadow(a);else{this.dragging=!0;(this.inGroup=!!$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER, +this.workspace.options))(this.block);startTextWidthCache$$module$build$src$core$utils$dom();this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();a=!!a&&(a.altKey||a.ctrlKey||a.metaKey);this.shouldDisconnect(a)&&this.disconnectBlock(a);this.block.setDragging(!0);var b;null==(b=this.workspace.getLayerManager())||b.moveToDragLayer(this.block)}}startDraggingShadow(a){const b=this.block.getParent();if(!b)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents."); +this.dragOffset=Coordinate$$module$build$src$core$utils$coordinate.difference(b.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY());b.startDrag(a)}shouldDisconnect(a){return!!(this.block.getParent()||a&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(a){let b,c,d;this.startParentConn=null!=(d=null==(b=this.block.outputConnection)?void 0:b.targetConnection)?d:null==(c=this.block.previousConnection)?void 0:c.targetConnection;if(a){let e;this.startChildConn= +null==(e=this.block.nextConnection)?void 0:e.targetConnection}this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}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=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){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.drag(Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.dragOffset))}else this.block.moveDuringDrag(a), +this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.startLoc))}updateConnectionPreview(a,b){var c=this.connectionCandidate;const d=this.getConnectionCandidate(a,b);if(d){this.connectionCandidate=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;c=f.isConnected()&& +!f.targetBlock().isInsertionMarker();b&&c&&!this.orphanCanConnectAtEnd(a,f.targetBlock(),e.type)?this.connectionPreviewer.previewReplacement(e,f,f.targetBlock()):this.connectionPreviewer.previewConnection(e,f)}else this.connectionPreviewer.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){const {local:d,neighbour:e}=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,b){a=this.getLocalConnections(a);let c=this.connectionCandidate?$.config$$module$build$src$core$config.connectingSnapRadius: +$.config$$module$build$src$core$config.snapRadius,d=null;for(const e of a){const {connection:f,radius:g}=e.closest(c,b);f&&(d={local:e,neighbour:f,distance:g},c=g)}return d}getLocalConnections(a){const b=a.getConnections_(!1),c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);return b}endDrag(a){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.endDrag(a)}else{this.fireDragEndEvent();this.fireMoveEvent();stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations(); +this.connectionPreviewer.hidePreview();if(!this.block.isDeadOrDying()&&this.dragging){let b;null==(b=this.workspace.getLayerManager())||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.block.setDragging(!1)}this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.block.queueRender();this.block.snapToGrid();this.connectionPreviewer.dispose();this.workspace.setResizesEnabled(!0);this.inGroup||$.setGroup$$module$build$src$core$events$utils(!1)}}applyConnections(a){const {local:b, +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(){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.revertDrag()}else{var a;null==(a=this.startChildConn)||a.connect(this.block.nextConnection);if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection); +break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let b;null==(b=this.workspace.getLayerManager())||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null;this.connectionPreviewer.hidePreview(); +this.connectionCandidate=null;this.block.setDragging(!1);this.dragging=!1}}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var Marker$$module$build$src$core$keyboard_nav$marker=class{constructor(){this.drawer=this.curNode=this.colour=null;this.type="marker"}setDrawer(a){this.drawer=a}getDrawer(){return this.drawer}getCurNode(){return this.curNode}setCurNode(a){const b=this.curNode;this.curNode=a;this.drawer&&this.drawer.draw(b,this.curNode)}draw(){this.drawer&&this.drawer.draw(this.curNode,this.curNode)}hide(){this.drawer&&this.drawer.hide()}dispose(){this.getDrawer()&&this.getDrawer().dispose()}},module$build$src$core$keyboard_nav$marker= {};module$build$src$core$keyboard_nav$marker.Marker=Marker$$module$build$src$core$keyboard_nav$marker;var Cursor$$module$build$src$core$keyboard_nav$cursor=class extends Marker$$module$build$src$core$keyboard_nav$marker{constructor(){super();this.type="cursor"}next(){var a=this.getCurNode();if(!a)return null;for(a=a.next();a&&a.next()&&(a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.NEXT||a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BLOCK);)a=a.next();a&&this.setCurNode(a);return a}in(){var a=this.getCurNode();if(!a)return null;if(a.getType()=== ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.PREVIOUS||a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.OUTPUT)a=a.next();let b,c;(a=null!=(c=null==(b=a)?void 0:b.in())?c:null)&&this.setCurNode(a);return a}prev(){var a=this.getCurNode();if(!a)return null;for(a=a.prev();a&&a.prev()&&(a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.NEXT||a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BLOCK);)a=a.prev();a&&this.setCurNode(a); return a}out(){var a=this.getCurNode();if(!a)return null;(a=a.out())&&a.getType()===ASTNode$$module$build$src$core$keyboard_nav$ast_node.types.BLOCK&&(a=a.prev()||a);a&&this.setCurNode(a);return a}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,Cursor$$module$build$src$core$keyboard_nav$cursor);var module$build$src$core$keyboard_nav$cursor={};module$build$src$core$keyboard_nav$cursor.Cursor=Cursor$$module$build$src$core$keyboard_nav$cursor;var BasicCursor$$module$build$src$core$keyboard_nav$basic_cursor=class extends Cursor$$module$build$src$core$keyboard_nav$cursor{constructor(){super()}next(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode_(a,this.validNode_))&&this.setCurNode(a);return a}in(){return this.next()}prev(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode_(a,this.validNode_))&&this.setCurNode(a);return a}out(){return this.prev()}getNextNode_(a,b){if(!a)return null;const c=a.in()||a.next(); @@ -1215,70 +1240,57 @@ b.getParent()||($.setGroup$$module$build$src$core$events$utils(c),this.bumpAwayF 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()|| 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}}; (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={}; -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 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; -isEnabled$$module$build$src$core$events$utils()&&!d.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils($.CREATE$$module$build$src$core$events$utils))(d));$.setSelected$$module$build$src$core$common(d);return d}};BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE="block";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 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.dragOffset=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspace=a.workspace}isMovable(){if(this.block.isShadow()){let a,b;return null!=(b=null==(a=this.block.getParent())?void 0:a.isMovable())?b:!1}return this.block.isOwnMovable()&&!this.block.isDeadOrDying()&& -!this.workspace.options.readOnly&&!this.block.isInFlyout}startDrag(a){if(this.block.isShadow())this.startDraggingShadow(a);else{this.dragging=!0;$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0);this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,this.workspace.options))(this.block); -startTextWidthCache$$module$build$src$core$utils$dom();this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();a=!!a&&(a.altKey||a.ctrlKey||a.metaKey);this.shouldDisconnect(a)&&this.disconnectBlock(a);this.block.setDragging(!0);var b;null==(b=this.workspace.getLayerManager())||b.moveToDragLayer(this.block)}}startDraggingShadow(a){const b=this.block.getParent();if(!b)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents."); -this.dragOffset=Coordinate$$module$build$src$core$utils$coordinate.difference(b.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY());b.startDrag(a)}shouldDisconnect(a){return!!(this.block.getParent()||a&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(a){let b,c,d;this.startParentConn=null!=(d=null==(b=this.block.outputConnection)?void 0:b.targetConnection)?d:null==(c=this.block.previousConnection)?void 0:c.targetConnection;if(a){let e;this.startChildConn= -null==(e=this.block.nextConnection)?void 0:e.targetConnection}this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(BLOCK_DRAG$$module$build$src$core$events$utils))(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(BLOCK_DRAG$$module$build$src$core$events$utils))(this.block,!1, -this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils($.MOVE$$module$build$src$core$events$utils))(this.block);a.setReason(["drag"]);a.oldCoordinate=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}drag(a){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.drag(Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.dragOffset))}else this.block.moveDuringDrag(a), -this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.startLoc))}updateConnectionPreview(a,b){var c=this.connectionCandidate;const d=this.getConnectionCandidate(a,b);if(d){this.connectionCandidate=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;c=f.isConnected()&& -!f.targetBlock().isInsertionMarker();b&&c&&!this.orphanCanConnectAtEnd(a,f.targetBlock(),e.type)?this.connectionPreviewer.previewReplacement(e,f,f.targetBlock()):this.connectionPreviewer.previewConnection(e,f)}else this.connectionPreviewer.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){const {local:d,neighbour:e}=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,b){a=this.getLocalConnections(a);let c=this.connectionCandidate?$.config$$module$build$src$core$config.connectingSnapRadius: -$.config$$module$build$src$core$config.snapRadius,d=null;for(const e of a){const {connection:f,radius:g}=e.closest(c,b);f&&(d={local:e,neighbour:f,distance:g},c=g)}return d}getLocalConnections(a){const b=a.getConnections_(!1),c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);return b}endDrag(a){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.endDrag(a)}else{this.fireDragEndEvent();this.fireMoveEvent();stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations(); -this.connectionPreviewer.hidePreview();if(!this.block.isDeadOrDying()&&this.dragging){let b;null==(b=this.workspace.getLayerManager())||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.block.setDragging(!1)}this.connectionCandidate?this.applyConnections(this.connectionCandidate):this.block.queueRender();this.block.snapToGrid();this.connectionPreviewer.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(!1)}}applyConnections(a){const {local:b, -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(){if(this.block.isShadow()){let b;null==(b=this.block.getParent())||b.revertDrag()}else{var a;null==(a=this.startChildConn)||a.connect(this.block.nextConnection);if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection); -break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let b;null==(b=this.workspace.getLayerManager())||b.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null;this.connectionPreviewer.hidePreview(); -this.connectionCandidate=null;this.block.setDragging(!1);this.dragging=!1}}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var 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.eventsInit_=this.renderIsInProgress_=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); +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 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.eventsInit_=this.renderIsInProgress_=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); 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,{});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);this.svgGroup_.setAttribute("data-id",this.id);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();!this.workspace.options.readOnly&&a&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown_);a.parentNode||this.workspace.getCanvas().appendChild(a);this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){if(this.isShadow()){let a; null==(a=this.getParent())||a.select()}else this.addSelect()}unselect(){if(this.isShadow()){let a;null==(a=this.getParent())||a.unselect()}else this.removeSelect()}setParent(a){const b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();var c=this.getSvgRoot();if(!this.workspace.isClearing&&c){var d=this.getRelativeToSurfaceXY();a?a.getSvgRoot().appendChild(c):b&&((a=this.workspace.getCanvas().querySelector(".blocklyDragging"))? this.workspace.getCanvas().insertBefore(c,a):this.workspace.getCanvas().appendChild(c),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, -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($.MOVE$$module$build$src$core$events$utils))(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(),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());this.updateComponentLocations(a)}snapToGrid(){if(!this.isDeadOrDying()&& -!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(null!=a&&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=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_())}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?(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))}tab(a,b){const c=new TabNavigateCursor$$module$build$src$core$keyboard_nav$tab_navigate_cursor;c.setCurNode(ASTNode$$module$build$src$core$keyboard_nav$ast_node.createFieldNode(a)); +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(), +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()); +this.updateComponentLocations(a)}snapToGrid(){if(!this.isDeadOrDying()&&!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(null!=a&&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= +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_())}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?(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))}tab(a,b){const c=new TabNavigateCursor$$module$build$src$core$keyboard_nav$tab_navigate_cursor;c.setCurNode(ASTNode$$module$build$src$core$keyboard_nav$ast_node.createFieldNode(a)); a=c.getCurNode();b?c.next():c.prev();(b=c.getCurNode())&&b!==a&&(b.getLocation().showEditor(),this.workspace.keyboardAccessibilityMode&&this.workspace.getCursor().setCurNode(b))}onMouseDown_(a){const b=this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)}showHelp(){const a="function"===typeof this.helpUrl?this.helpUrl():this.helpUrl;a&&window.open(a)}generateContextMenu(){if(this.workspace.options.readOnly||!this.contextMenu)return null;const a=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions(ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK, {block:this});this.customContextMenu&&this.customContextMenu(a);return a}showContextMenu(a){const b=this.generateContextMenu();b&&b.length&&(show$$module$build$src$core$contextmenu(a,b,this.RTL,this.workspace),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, 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)}setDragging(a){(this.dragging=a)?(this.translation="",draggingConnections$$module$build$src$core$common.push(...this.getConnections_(!0)),addClass$$module$build$src$core$utils$dom(this.svgGroup_,"blocklyDragging")):(draggingConnections$$module$build$src$core$common.length= 0,removeClass$$module$build$src$core$utils$dom(this.svgGroup_,"blocklyDragging"));for(let b=0;bclearTimeout(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(){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:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){this.pathObject.applyColour(this);const a=this.getIcons();for(let b=0;b{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,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();this.queueRender();return a}createIconPointerDownListener(a){return b=>{this.isDeadOrDying()||(b=this.workspace.getGesture(b))&&b.setStartIcon(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}setEnabled(a){warn$$module$build$src$core$utils$deprecation("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const b=this.isEnabled();super.setEnabled(a);this.isEnabled()===b||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()===c||this.getInheritedDisabled()||this.updateDisabled()}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); -a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);this.pathObject.setStyle(a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_=a;if(b)this.hat=b.hat,this.pathObject.setStyle(b),this.colour_=b.colourPrimary,this.style=b,this.applyColour();else throw Error("Invalid style name: "+a);}bringToFront(a=!1){let b=this;if(!b.isDeadOrDying()){do{const c=b.getSvgRoot(), -d=c.parentNode,e=d.childNodes;e[e.length-1]!==c&&d.appendChild(c);if(a)break;b=b.getParent()}while(b)}}setPreviousStatement(a,b){super.setPreviousStatement(a,b);this.queueRender()}setNextStatement(a,b){super.setNextStatement(a,b);this.queueRender()}setOutput(a,b){super.setOutput(a,b);this.queueRender()}setInputsInline(a){super.setInputsInline(a);this.queueRender()}removeInput(a,b){a=super.removeInput(a,b);this.queueRender();return a}moveNumberedInputBefore(a,b){super.moveNumberedInputBefore(a,b); -this.queueRender()}appendInput(a){super.appendInput(a);this.queueRender();return a}setConnectionTracking(a){this.previousConnection&&this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;bclearTimeout(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(){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:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){this.pathObject.applyColour(this);const a=this.getIcons();for(let b=0;b{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,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(); +this.queueRender();return a}createIconPointerDownListener(a){return b=>{this.isDeadOrDying()||(b=this.workspace.getGesture(b))&&b.setStartIcon(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}setEnabled(a){warn$$module$build$src$core$utils$deprecation("setEnabled","v11","v12","the setDisabledReason method of BlockSvg");const b=this.isEnabled();super.setEnabled(a);this.isEnabled()=== +b||this.getInheritedDisabled()||this.updateDisabled()}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()===c||this.getInheritedDisabled()||this.updateDisabled()}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);a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_); +this.pathObject.setStyle(a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_=a;if(b)this.hat=b.hat,this.pathObject.setStyle(b),this.colour_=b.colourPrimary,this.style=b,this.applyColour();else throw Error("Invalid style name: "+a);}bringToFront(a=!1){let b=this;if(!b.isDeadOrDying()){do{const c=b.getSvgRoot(),d=c.parentNode,e=d.childNodes;e[e.length-1]!==c&&d.appendChild(c);if(a)break; +b=b.getParent()}while(b)}}setPreviousStatement(a,b){super.setPreviousStatement(a,b);this.queueRender()}setNextStatement(a,b){super.setNextStatement(a,b);this.queueRender()}setOutput(a,b){super.setOutput(a,b);this.queueRender()}setInputsInline(a){super.setInputsInline(a);this.queueRender()}removeInput(a,b){a=super.removeInput(a,b);this.queueRender();return a}moveNumberedInputBefore(a,b){super.moveNumberedInputBefore(a,b);this.queueRender()}appendInput(a){super.appendInput(a);this.queueRender();return a}setConnectionTracking(a){this.previousConnection&& +this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b=this.workspace.options.maxTrashcanContents||(a=new Options$$module$build$src$core$options({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex, +module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;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(void 0===this.isOpen)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=super.fromJson(a,b,null!= +c?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;0>=this.workspace.options.maxTrashcanContents||(a=new Options$$module$build$src$core$options({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex, renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition===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,this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(a)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G, {"class":"blocklyTrash"});let a;const b=String(Math.random()).substring(2);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyTrashBodyClipPath"+b},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan,height:BODY_HEIGHT$$module$build$src$core$trashcan,y:LID_HEIGHT$$module$build$src$core$trashcan},a);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE, {width:SPRITE$$module$build$src$core$sprites.width,x:-SPRITE_LEFT$$module$build$src$core$trashcan,height:SPRITE$$module$build$src$core$sprites.height,y:-SPRITE_TOP$$module$build$src$core$trashcan,"clip-path":"url(#blocklyTrashBodyClipPath"+b+")"},this.svgGroup);c.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH, {id:"blocklyTrashLidClipPath"+b},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan,height:LID_HEIGHT$$module$build$src$core$trashcan},a);this.svgLid=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,x:-SPRITE_LEFT$$module$build$src$core$trashcan,height:SPRITE$$module$build$src$core$sprites.height,y:-SPRITE_TOP$$module$build$src$core$trashcan, "clip-path":"url(#blocklyTrashLidClipPath"+b+")"},this.svgGroup);this.svgLid.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerup",this,this.click);bind$$module$build$src$core$browser_events(c,"pointerover",this,this.mouseOver);bind$$module$build$src$core$browser_events(c, -"pointerout",this,this.mouseOut);this.animateLid();return this.svgGroup}init(){0{let c;null==(c=this.flyout)||c.show(a);b.cursor="";let d;null==(d=this.workspace.scrollbar)||d.setVisible(!1)},10);this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var a;null==(a=this.flyout)||a.hide();var b;null==(b=this.workspace.scrollbar)||b.setVisible(!0);this.fireUiEvent(!1);this.workspace.recordDragTargets()}}autoHide(a){!a&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&& -(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,a);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(WIDTH$$module$build$src$core$trashcan,BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan),MARGIN_HORIZONTAL$$module$build$src$core$trashcan,MARGIN_VERTICAL$$module$build$src$core$trashcan, -a,this.workspace);b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,MARGIN_VERTICAL$$module$build$src$core$trashcan,c.vertical===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:bumpDirection$$module$build$src$core$positionable_helpers.UP,b);this.top=b.top;this.left=b.left;var d;null==(d=this.svgGroup)||d.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.top, -this.top+BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan,this.left,this.left+WIDTH$$module$build$src$core$trashcan)}getClientRect(){if(!this.svgGroup)return null;var a=this.svgGroup.getBoundingClientRect();const b=a.top+SPRITE_TOP$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;a=a.left+SPRITE_LEFT$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;return new Rect$$module$build$src$core$utils$rect(b, -b+LID_HEIGHT$$module$build$src$core$trashcan+BODY_HEIGHT$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan,a,a+WIDTH$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan)}onDragOver(a){this.setLidOpen(this.wouldDelete_)}onDragExit(a){this.setLidOpen(!1)}onDrop(a){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(a){this.isLidOpen!==a&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=a,this.animateLid())}animateLid(){const a= -ANIMATION_FRAMES$$module$build$src$core$trashcan;var b=1/(a+1);this.lidOpen+=this.isLidOpen?b:-b;this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1);this.setLidAngle(this.lidOpen*MAX_LID_ANGLE$$module$build$src$core$trashcan);b=OPACITY_MIN$$module$build$src$core$trashcan+this.lidOpen*(OPACITY_MAX$$module$build$src$core$trashcan-OPACITY_MIN$$module$build$src$core$trashcan);this.svgGroup&&(this.svgGroup.style.opacity=`${b}`);this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask= -setTimeout(this.animateLid.bind(this),ANIMATION_LENGTH$$module$build$src$core$trashcan/a))}setLidAngle(a){const b=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let c;null==(c=this.svgLid)||c.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:WIDTH$$module$build$src$core$trashcan-4)+","+(LID_HEIGHT$$module$build$src$core$trashcan-2)+")")}setMinOpenness(a){this.minOpenness=a;this.isLidOpen||this.setLidAngle(a* -MAX_LID_ANGLE$$module$build$src$core$trashcan)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(a){a=new (get$$module$build$src$core$events$utils(TRASHCAN_OPEN$$module$build$src$core$events$utils))(a,this.workspace.id);fire$$module$build$src$core$events$utils(a)}blockMouseDownWhenOpenable(a){!this.contentsIsOpen()&&this.hasContents()&&a.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(a){if(!(0>= -this.workspace.options.maxTrashcanContents||a.type!==$.DELETE$$module$build$src$core$events$utils||a.type!==$.DELETE$$module$build$src$core$events$utils||a.wasShadow)){if(!a.oldJson)throw Error("Encountered a delete event without proper oldJson");a=JSON.stringify(this.cleanBlockJson(a.oldJson));if(!this.contents.includes(a)){for(this.contents.unshift(a);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id; +"pointerout",this,this.mouseOut);this.animateLid();return this.svgGroup}init(){0{let c;null==(c=this.flyout)||c.show(a);b.cursor="";let d;null==(d=this.workspace.scrollbar)||d.setVisible(!1)},10);this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var a;null==(a=this.flyout)||a.hide();var b;null==(b=this.workspace.scrollbar)||b.setVisible(!0);this.fireUiEvent(!1);this.workspace.recordDragTargets()}}autoHide(a){!a&& +this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,a);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(WIDTH$$module$build$src$core$trashcan,BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan), +MARGIN_HORIZONTAL$$module$build$src$core$trashcan,MARGIN_VERTICAL$$module$build$src$core$trashcan,a,this.workspace);b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,MARGIN_VERTICAL$$module$build$src$core$trashcan,c.vertical===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:bumpDirection$$module$build$src$core$positionable_helpers.UP,b);this.top=b.top;this.left=b.left;var d;null==(d=this.svgGroup)||d.setAttribute("transform", +"translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.top,this.top+BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan,this.left,this.left+WIDTH$$module$build$src$core$trashcan)}getClientRect(){if(!this.svgGroup)return null;var a=this.svgGroup.getBoundingClientRect();const b=a.top+SPRITE_TOP$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;a=a.left+SPRITE_LEFT$$module$build$src$core$trashcan- +MARGIN_HOTSPOT$$module$build$src$core$trashcan;return new Rect$$module$build$src$core$utils$rect(b,b+LID_HEIGHT$$module$build$src$core$trashcan+BODY_HEIGHT$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan,a,a+WIDTH$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan)}onDragOver(a){this.setLidOpen(this.wouldDelete_)}onDragExit(a){this.setLidOpen(!1)}onDrop(a){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(a){this.isLidOpen!==a&& +(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=a,this.animateLid())}animateLid(){const a=ANIMATION_FRAMES$$module$build$src$core$trashcan;var b=1/(a+1);this.lidOpen+=this.isLidOpen?b:-b;this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1);this.setLidAngle(this.lidOpen*MAX_LID_ANGLE$$module$build$src$core$trashcan);b=OPACITY_MIN$$module$build$src$core$trashcan+this.lidOpen*(OPACITY_MAX$$module$build$src$core$trashcan-OPACITY_MIN$$module$build$src$core$trashcan);this.svgGroup&& +(this.svgGroup.style.opacity=`${b}`);this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),ANIMATION_LENGTH$$module$build$src$core$trashcan/a))}setLidAngle(a){const b=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let c;null==(c=this.svgLid)||c.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:WIDTH$$module$build$src$core$trashcan-4)+","+(LID_HEIGHT$$module$build$src$core$trashcan- +2)+")")}setMinOpenness(a){this.minOpenness=a;this.isLidOpen||this.setLidAngle(a*MAX_LID_ANGLE$$module$build$src$core$trashcan)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(a){a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TRASHCAN_OPEN))(a,this.workspace.id);fire$$module$build$src$core$events$utils(a)}blockMouseDownWhenOpenable(a){!this.contentsIsOpen()&&this.hasContents()&&a.stopPropagation()}mouseOver(){this.hasContents()&& +this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(a){if(!(0>=this.workspace.options.maxTrashcanContents||!isBlockDelete$$module$build$src$core$events$predicates(a)||a.wasShadow)){if(!a.oldJson)throw Error("Encountered a delete event without proper oldJson");a=JSON.stringify(this.cleanBlockJson(a.oldJson));if(!this.contents.includes(a)){for(this.contents.unshift(a);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id; delete c.x;delete c.y;delete c.enabled;delete c.disabledReasons;if(c.icons&&c.icons.comment){var d=c.icons.comment;delete d.height;delete d.width;delete d.pinned}d=c.inputs;for(var e in d){var f=d[e];const g=f.block;f=f.shadow;g&&b(g);f&&b(f)}c.next&&(e=c.next,c=e.block,e=e.shadow,c&&b(c),e&&b(e))}}a=JSON.parse(JSON.stringify(a));b(a);return Object.assign({},{kind:"BLOCK"},a)}},WIDTH$$module$build$src$core$trashcan=47,BODY_HEIGHT$$module$build$src$core$trashcan=44,LID_HEIGHT$$module$build$src$core$trashcan= 16,MARGIN_VERTICAL$$module$build$src$core$trashcan=20,MARGIN_HORIZONTAL$$module$build$src$core$trashcan=20,MARGIN_HOTSPOT$$module$build$src$core$trashcan=10,SPRITE_LEFT$$module$build$src$core$trashcan=0,SPRITE_TOP$$module$build$src$core$trashcan=32,HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan=.1,ANIMATION_LENGTH$$module$build$src$core$trashcan=80,ANIMATION_FRAMES$$module$build$src$core$trashcan=4,OPACITY_MIN$$module$build$src$core$trashcan=.4,OPACITY_MAX$$module$build$src$core$trashcan=.8, 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 ShortcutRegistry$$module$build$src$core$shortcut_registry=class{constructor(){this.shortcuts=new Map;this.keyMap=new Map;this.reset()}reset(){this.shortcuts.clear();this.keyMap.clear()}register(a,b){if(this.shortcuts.get(a.name)&&!b)throw Error(`Shortcut named "${a.name}" already exists.`);this.shortcuts.set(a.name,a);if((b=a.keyCodes)&&0{this.targetWorkspace.isDragging()||b.addSelect()}));this.listeners.push(bind$$module$build$src$core$browser_events(a, "pointerleave",b,()=>{this.targetWorkspace.isDragging()||b.removeSelect()}));this.listeners.push(bind$$module$build$src$core$browser_events(c,"pointerenter",b,()=>{this.targetWorkspace.isDragging()||b.addSelect()}));this.listeners.push(bind$$module$build$src$core$browser_events(c,"pointerleave",b,()=>{this.targetWorkspace.isDragging()||b.removeSelect()}))}blockMouseDown(a){return b=>{const c=this.targetWorkspace.getGesture(b);c&&(c.setStartBlock(a),c.handleFlyoutStart(b,this))}}onMouseDown(a){const b= this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}isBlockCreatable(a){return a.isEnabled()}createBlock(a){let b=null;$.disable$$module$build$src$core$events$utils();var c=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{b=this.placeNewBlock(a)}finally{$.enable$$module$build$src$core$events$utils()}this.targetWorkspace.hideChaff();a=getAddedVariables$$module$build$src$core$variables(this.targetWorkspace,c);if(isEnabled$$module$build$src$core$events$utils()){$.setGroup$$module$build$src$core$events$utils(!0); -for(c=0;c>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolboxDiv {\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.blocklyToolboxContents {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxContents:focus {\n outline: none;\n}\n'); @@ -1689,4 +1702,4 @@ module$build$src$core$blockly.renderManagement=module$build$src$core$render_mana 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_toolbox_item={};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_flyout={};var module$build$src$core$interfaces$i_drag_target={};var module$build$src$core$interfaces$i_dragger={};var module$build$src$core$interfaces$i_delete_area={};var module$build$src$core$interfaces$i_contextmenu={};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_collapsible_toolbox_item={};var module$build$src$core$interfaces$i_bubble={};var module$build$src$core$interfaces$i_bounded_element={};var module$build$src$core$interfaces$i_autohideable={};var module$build$src$core$interfaces$i_ast_node_location_with_block={};var module$build$src$core$interfaces$i_ast_node_location_svg={};var module$build$src$core$interfaces$i_ast_node_location={}; module$build$src$core$blockly.__namespace__=$; return module$build$src$core$blockly; -})); \ No newline at end of file +}));